Documentation ¶
Index ¶
- type GameProxy
- type GameProxyCached
- type GameProxyManager
- func (m *GameProxyManager) CreateProxy(playerConn network.Connection, inst *gameinstance.GameInstance) (*GameProxy, error)
- func (m *GameProxyManager) DeserializeSelf(data []byte) error
- func (m *GameProxyManager) GetProxy(addr string) (*GameProxy, error)
- func (m *GameProxyManager) HydrateDeserialized(gatewayServer *net.UDPConn) error
- func (m *GameProxyManager) RemoveConnectionsTo(addr string, cb func(network.Connection)) error
- func (m *GameProxyManager) SerializeSelf() ([]byte, error)
- type GameProxyManagerCached
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GameProxy ¶
type GameProxy struct { PlayerConn network.Connection GameConn network.Connection // contains filtered or unexported fields }
func NewGameProxy ¶
func NewGameProxy(playerConn network.Connection, inst *gameinstance.GameInstance, onClose func(string)) (*GameProxy, error)
NewGameProxy creates and starts a new instance of a game proxy. The onClose callback should be used to perform any cleanup that would be done after a Close() call by the caller, and it must be provided. Its first argument is the player's address.
func (*GameProxy) DeserializeSelf ¶
func (*GameProxy) HydrateDeserialized ¶
HydrateDeserialized hyhdrates and starts an instance of a game proxy. The onClose callback should be used to perform any cleanup that would be done after a Close() call by the caller, and it must be provided. Its first argument is the player's address.
func (*GameProxy) SendToGame ¶
func (*GameProxy) SerializeSelf ¶
type GameProxyCached ¶
GameProxyCached represents the data needed to reconstruct a game proxy from serialized data.
type GameProxyManager ¶
type GameProxyManager struct {
// contains filtered or unexported fields
}
func NewGameProxyManager ¶
func NewGameProxyManager() *GameProxyManager
NewProxyManager returns a new game proxy manager.
func (*GameProxyManager) CreateProxy ¶
func (m *GameProxyManager) CreateProxy(playerConn network.Connection, inst *gameinstance.GameInstance) (*GameProxy, error)
CreateProxy creates a proxy from the provided player connection to the specified instance.
func (*GameProxyManager) DeserializeSelf ¶
func (m *GameProxyManager) DeserializeSelf(data []byte) error
func (*GameProxyManager) GetProxy ¶
func (m *GameProxyManager) GetProxy(addr string) (*GameProxy, error)
func (*GameProxyManager) HydrateDeserialized ¶
func (m *GameProxyManager) HydrateDeserialized(gatewayServer *net.UDPConn) error
func (*GameProxyManager) RemoveConnectionsTo ¶
func (m *GameProxyManager) RemoveConnectionsTo(addr string, cb func(network.Connection)) error
RemoveConnectionsTo removes all connections to the provided address. A callback may be provided that will be called for each stopped proxy.
func (*GameProxyManager) SerializeSelf ¶
func (m *GameProxyManager) SerializeSelf() ([]byte, error)