worker

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 28, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(overlordHost string, gamePath string) *Handler

NewHandler returns a new server

func (*Handler) Close

func (h *Handler) Close()

func (*Handler) GetOverlordClient

func (h *Handler) GetOverlordClient() *OverlordClient

func (*Handler) RouteOverlord

func (h *Handler) RouteOverlord()

RouteOverlord are all routes server received from overlord

func (*Handler) Run

func (h *Handler) Run()

Run starts a Handler running logic

type OverlordClient

type OverlordClient struct {
	*cws.Client
}

OverlordClient maintans connection to overlord We expect only one OverlordClient for each server

func NewOverlordClient

func NewOverlordClient(oc *websocket.Conn) *OverlordClient

NewOverlordClient returns a client connecting to overlord for coordiation between different server

type Session

type Session struct {
	ID string

	// Should I make direct reference
	RoomID string
	// contains filtered or unexported fields
}

Session represents a session connected from the browser to the current server It requires one connection to browser and one connection to the overlord connection to browser is 1-1. connection to overlord is n - 1 Peerconnection can be from other server to ensure better latency

func (*Session) Close

func (s *Session) Close()

Close close a session

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL