Documentation ¶
Index ¶
- Constants
- func EntityId(high, low uint64) *entity.EntityId
- func Hash(s string) uint32
- func MakePacket(header *rpc.Header, buf []byte) ([]byte, error)
- func ServiceHash(binder ServiceBinder) uint32
- type AccountService
- func (s *AccountService) CacheExpire(body []byte) error
- func (s *AccountService) CreateGameAccount(body []byte) ([]byte, error)
- func (s *AccountService) CredentialUpdate(body []byte) error
- func (s *AccountService) FlagUpdate(body []byte) ([]byte, error)
- func (s *AccountService) ForwardCacheExpire(body []byte) error
- func (s *AccountService) GetAccount(body []byte) ([]byte, error)
- func (s *AccountService) GetAccountState(body []byte) ([]byte, error)
- func (s *AccountService) GetCAISInfo(body []byte) ([]byte, error)
- func (s *AccountService) GetEBalance(body []byte) ([]byte, error)
- func (s *AccountService) GetEBalanceRestrictions(body []byte) ([]byte, error)
- func (s *AccountService) GetGameAccount(body []byte) ([]byte, error)
- func (s *AccountService) GetGameAccountState(body []byte) ([]byte, error)
- func (s *AccountService) GetGameSessionInfo(body []byte) ([]byte, error)
- func (s *AccountService) GetGameTimeRemainingInfo(body []byte) ([]byte, error)
- func (s *AccountService) GetLicenses(body []byte) ([]byte, error)
- func (s *AccountService) GetWalletList(body []byte) ([]byte, error)
- func (s *AccountService) Invoke(method int, body []byte) (resp []byte, err error)
- func (s *AccountService) IsIgrAddress(body []byte) error
- func (s *AccountService) Methods() []string
- func (s *AccountService) Name() string
- func (s *AccountService) Subscribe(body []byte) ([]byte, error)
- func (s *AccountService) Unsubscribe(body []byte) error
- type AccountServiceBinder
- type AuthClientService
- type AuthClientServiceBinder
- type AuthServerService
- func (s *AuthServerService) CompleteLogin() error
- func (s *AuthServerService) FinishQueue()
- func (s *AuthServerService) GenerateTempCookie(body []byte) ([]byte, error)
- func (s *AuthServerService) Invoke(method int, body []byte) (resp []byte, err error)
- func (s *AuthServerService) Logon(body []byte) error
- func (s *AuthServerService) Methods() []string
- func (s *AuthServerService) ModuleMessage(body []byte) error
- func (s *AuthServerService) ModuleNotify(body []byte) error
- func (s *AuthServerService) Name() string
- func (s *AuthServerService) SelectGameAccount(body []byte) error
- func (s *AuthServerService) SelectGameAccount_DEPRECATED(body []byte) error
- func (s *AuthServerService) VerifyWebCredentials(body []byte) error
- type AuthServerServiceBinder
- type ChallengeNotifyService
- type ChallengeNotifyServiceBinder
- type ChannelInvitationService
- func (s *ChannelInvitationService) AcceptInvitation(body []byte) ([]byte, error)
- func (s *ChannelInvitationService) DeclineInvitation(body []byte) error
- func (s *ChannelInvitationService) DecrementChannelCount(body []byte) error
- func (s *ChannelInvitationService) IncrementChannelCount(body []byte) ([]byte, error)
- func (s *ChannelInvitationService) Invoke(method int, body []byte) (resp []byte, err error)
- func (s *ChannelInvitationService) ListChannelCount(body []byte) ([]byte, error)
- func (s *ChannelInvitationService) Methods() []string
- func (s *ChannelInvitationService) Name() string
- func (s *ChannelInvitationService) RevokeInvitation(body []byte) error
- func (s *ChannelInvitationService) SendInvitation(body []byte) ([]byte, error)
- func (s *ChannelInvitationService) Subscribe(body []byte) ([]byte, error)
- func (s *ChannelInvitationService) SuggestInvitation(body []byte) error
- func (s *ChannelInvitationService) Unsubscribe(body []byte) error
- func (s *ChannelInvitationService) UpdateChannelCount(body []byte) error
- type ChannelInvitationServiceBinder
- type ConnectionService
- func (s *ConnectionService) Bind(body []byte) ([]byte, error)
- func (s *ConnectionService) Connect(body []byte) ([]byte, error)
- func (s *ConnectionService) Echo(body []byte) ([]byte, error)
- func (s *ConnectionService) Encrypt(body []byte) error
- func (s *ConnectionService) ForceDisconnect(body []byte) error
- func (s *ConnectionService) Invoke(method int, body []byte) (resp []byte, err error)
- func (s *ConnectionService) KeepAlive(body []byte) error
- func (s *ConnectionService) Methods() []string
- func (s *ConnectionService) Name() string
- func (s *ConnectionService) RequestDisconnect(body []byte) error
- type ConnectionServiceBinder
- type FourccValue
- type FriendsService
- func (s *FriendsService) AcceptInvitation(body []byte) error
- func (s *FriendsService) AssignRole(body []byte) error
- func (s *FriendsService) DeclineInvitation(body []byte) error
- func (s *FriendsService) IgnoreInvitation(body []byte) error
- func (s *FriendsService) Invoke(method int, body []byte) (resp []byte, err error)
- func (s *FriendsService) Methods() []string
- func (s *FriendsService) Name() string
- func (s *FriendsService) RemoveFriend(body []byte) ([]byte, error)
- func (s *FriendsService) RevokeAllInvitations(body []byte) error
- func (s *FriendsService) RevokeInvitation(body []byte) error
- func (s *FriendsService) SendInvitation(body []byte) error
- func (s *FriendsService) SubscribeToFriends(body []byte) ([]byte, error)
- func (s *FriendsService) UnsubscribeToFriends(body []byte) error
- func (s *FriendsService) UpdateFriendState(body []byte) error
- func (s *FriendsService) ViewFriends(body []byte) ([]byte, error)
- type FriendsServiceBinder
- type GameMasterService
- func (s *GameMasterService) CancelGameEntry(body []byte) error
- func (s *GameMasterService) ChangeGame(body []byte) error
- func (s *GameMasterService) FindGame(body []byte) ([]byte, error)
- func (s *GameMasterService) GameEnded(body []byte) error
- func (s *GameMasterService) GetFactoryInfo(body []byte) ([]byte, error)
- func (s *GameMasterService) GetGameStats(body []byte) ([]byte, error)
- func (s *GameMasterService) Invoke(method int, body []byte) (resp []byte, err error)
- func (s *GameMasterService) JoinGame(body []byte) ([]byte, error)
- func (s *GameMasterService) ListFactories(body []byte) ([]byte, error)
- func (s *GameMasterService) Methods() []string
- func (s *GameMasterService) Name() string
- func (s *GameMasterService) PlayerLeft(body []byte) error
- func (s *GameMasterService) RegisterServer(body []byte) error
- func (s *GameMasterService) RegisterUtilities(body []byte) error
- func (s *GameMasterService) Subscribe(body []byte) ([]byte, error)
- func (s *GameMasterService) UnregisterServer(body []byte) error
- func (s *GameMasterService) UnregisterUtilities(body []byte) error
- func (s *GameMasterService) Unsubscribe(body []byte) error
- type GameMasterServiceBinder
- type GameServer
- type GameUtilitiesService
- func (s *GameUtilitiesService) GetLoad(body []byte) ([]byte, error)
- func (s *GameUtilitiesService) GetPlayerVariables(body []byte) ([]byte, error)
- func (s *GameUtilitiesService) Invoke(method int, body []byte) (resp []byte, err error)
- func (s *GameUtilitiesService) Methods() []string
- func (s *GameUtilitiesService) Name() string
- func (s *GameUtilitiesService) NotifyGameAccountOffline(body []byte) error
- func (s *GameUtilitiesService) NotifyGameAccountOnline(body []byte) error
- func (s *GameUtilitiesService) PresenceChannelCreated(body []byte) error
- func (s *GameUtilitiesService) ProcessClientRequest(body []byte) ([]byte, error)
- func (s *GameUtilitiesService) ProcessServerRequest(body []byte) ([]byte, error)
- type GameUtilitiesServiceBinder
- type MessageValue
- type Notification
- type PresenceService
- func (s *PresenceService) Invoke(method int, body []byte) (resp []byte, err error)
- func (s *PresenceService) Methods() []string
- func (s *PresenceService) Name() string
- func (s *PresenceService) Query(body []byte) error
- func (s *PresenceService) Subscribe(body []byte) error
- func (s *PresenceService) Unsubscribe(body []byte) error
- func (s *PresenceService) Update(body []byte) error
- type PresenceServiceBinder
- type ResourcesService
- type ResourcesServiceBinder
- type Server
- type Service
- type ServiceBinder
- type Session
- func (s *Session) BindExport(index int, hash uint32)
- func (s *Session) BindImport(index int, hash uint32)
- func (s *Session) ChanForTransition(state int) chan struct{}
- func (s *Session) Disconnect()
- func (s *Session) DisconnectOnPanic()
- func (s *Session) HandleNotifications()
- func (s *Session) HandlePacket(header *rpc.Header, body []byte)
- func (s *Session) HandleRequest(serviceId, methodId int, body []byte) (resp []byte)
- func (s *Session) HandleResponse(token uint32, body []byte)
- func (s *Session) ImportedService(name string) Service
- func (s *Session) MakeRequestHeader(service Service, methodId, size int) *rpc.Header
- func (s *Session) OnceNotified(ty string, handle func(n *Notification))
- func (s *Session) QueuePacket(header *rpc.Header, buf []byte) error
- func (s *Session) Respond(token uint32, body []byte)
- func (s *Session) Transition(state int)
- func (s *Session) WaitForTransition(state int)
Constants ¶
const ( ErrorOK = 0 ErrorNoAuth = 10 )
const ( NotifyClientRequest = "GS_CL_REQ" NotifyClientResponse = "GS_CL_RES" NotifyFindGameRequest = "GS_FG_REQ" NotifyFindGameResponse = "GS_FG_RES" NotifyQueueEntry = "GQ_ENTRY" NotifyQueueUpdate = "GQ_UPDATE" NotifyQueueExit = "GQ_EXIT" NotifyQueueResult = "G_RESULT" NotifyMatchMakerStart = "MM_START" NotifyMatchMakerEnd = "MM_END" NotifyWhisper = "WHISPER" NotifySpectatorInvite = "WTCG.SpectatorInvite" )
const ( StateDisconnected = iota StateConnecting StateConnected StateLoggingIn StateAuthenticationFailed StateReady StateCount )
Variables ¶
This section is empty.
Functions ¶
func MakePacket ¶
MakePacket returns a buffer with the encoded values of the supplied header and body.
func ServiceHash ¶
func ServiceHash(binder ServiceBinder) uint32
ServiceHash returns a hash of the service's fully qualified name.
Types ¶
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
The Account service holds data about the client's game account.
func (*AccountService) CacheExpire ¶
func (s *AccountService) CacheExpire(body []byte) error
func (*AccountService) CreateGameAccount ¶
func (s *AccountService) CreateGameAccount(body []byte) ([]byte, error)
func (*AccountService) CredentialUpdate ¶
func (s *AccountService) CredentialUpdate(body []byte) error
func (*AccountService) FlagUpdate ¶
func (s *AccountService) FlagUpdate(body []byte) ([]byte, error)
func (*AccountService) ForwardCacheExpire ¶
func (s *AccountService) ForwardCacheExpire(body []byte) error
func (*AccountService) GetAccount ¶
func (s *AccountService) GetAccount(body []byte) ([]byte, error)
func (*AccountService) GetAccountState ¶
func (s *AccountService) GetAccountState(body []byte) ([]byte, error)
func (*AccountService) GetCAISInfo ¶
func (s *AccountService) GetCAISInfo(body []byte) ([]byte, error)
func (*AccountService) GetEBalance ¶
func (s *AccountService) GetEBalance(body []byte) ([]byte, error)
func (*AccountService) GetEBalanceRestrictions ¶
func (s *AccountService) GetEBalanceRestrictions(body []byte) ([]byte, error)
func (*AccountService) GetGameAccount ¶
func (s *AccountService) GetGameAccount(body []byte) ([]byte, error)
func (*AccountService) GetGameAccountState ¶
func (s *AccountService) GetGameAccountState(body []byte) ([]byte, error)
func (*AccountService) GetGameSessionInfo ¶
func (s *AccountService) GetGameSessionInfo(body []byte) ([]byte, error)
func (*AccountService) GetGameTimeRemainingInfo ¶
func (s *AccountService) GetGameTimeRemainingInfo(body []byte) ([]byte, error)
func (*AccountService) GetLicenses ¶
func (s *AccountService) GetLicenses(body []byte) ([]byte, error)
func (*AccountService) GetWalletList ¶
func (s *AccountService) GetWalletList(body []byte) ([]byte, error)
func (*AccountService) Invoke ¶
func (s *AccountService) Invoke(method int, body []byte) (resp []byte, err error)
func (*AccountService) IsIgrAddress ¶
func (s *AccountService) IsIgrAddress(body []byte) error
func (*AccountService) Methods ¶
func (s *AccountService) Methods() []string
func (*AccountService) Name ¶
func (s *AccountService) Name() string
func (*AccountService) Unsubscribe ¶
func (s *AccountService) Unsubscribe(body []byte) error
type AccountServiceBinder ¶
type AccountServiceBinder struct{}
func (AccountServiceBinder) Bind ¶
func (AccountServiceBinder) Bind(sess *Session) Service
type AuthClientService ¶
type AuthClientService struct {
// contains filtered or unexported fields
}
The AuthClient service is implemented by the client to handle auth modules and Logon results.
func (*AuthClientService) Invoke ¶
func (s *AuthClientService) Invoke(method int, body []byte) (resp []byte, err error)
func (*AuthClientService) Methods ¶
func (s *AuthClientService) Methods() []string
func (*AuthClientService) Name ¶
func (s *AuthClientService) Name() string
type AuthClientServiceBinder ¶
type AuthClientServiceBinder struct{}
func (AuthClientServiceBinder) Bind ¶
func (AuthClientServiceBinder) Bind(sess *Session) Service
type AuthServerService ¶
type AuthServerService struct {
// contains filtered or unexported fields
}
The AuthServer service handles Logon requests. This implementation does not use the Module system but instead relies on a pre-shared WebAuth token to authenticate the client.
func (*AuthServerService) CompleteLogin ¶
func (s *AuthServerService) CompleteLogin() error
func (*AuthServerService) FinishQueue ¶
func (s *AuthServerService) FinishQueue()
func (*AuthServerService) GenerateTempCookie ¶
func (s *AuthServerService) GenerateTempCookie(body []byte) ([]byte, error)
func (*AuthServerService) Invoke ¶
func (s *AuthServerService) Invoke(method int, body []byte) (resp []byte, err error)
func (*AuthServerService) Logon ¶
func (s *AuthServerService) Logon(body []byte) error
func (*AuthServerService) Methods ¶
func (s *AuthServerService) Methods() []string
func (*AuthServerService) ModuleMessage ¶
func (s *AuthServerService) ModuleMessage(body []byte) error
func (*AuthServerService) ModuleNotify ¶
func (s *AuthServerService) ModuleNotify(body []byte) error
func (*AuthServerService) Name ¶
func (s *AuthServerService) Name() string
func (*AuthServerService) SelectGameAccount ¶
func (s *AuthServerService) SelectGameAccount(body []byte) error
func (*AuthServerService) SelectGameAccount_DEPRECATED ¶
func (s *AuthServerService) SelectGameAccount_DEPRECATED(body []byte) error
func (*AuthServerService) VerifyWebCredentials ¶
func (s *AuthServerService) VerifyWebCredentials(body []byte) error
type AuthServerServiceBinder ¶
type AuthServerServiceBinder struct{}
func (AuthServerServiceBinder) Bind ¶
func (AuthServerServiceBinder) Bind(sess *Session) Service
type ChallengeNotifyService ¶
type ChallengeNotifyService struct {
// contains filtered or unexported fields
}
The ChallengeNotify service is implemented by the client to allow the server to request the client provide proof of authentication.
func (*ChallengeNotifyService) Invoke ¶
func (s *ChallengeNotifyService) Invoke(method int, body []byte) (resp []byte, err error)
func (*ChallengeNotifyService) Methods ¶
func (s *ChallengeNotifyService) Methods() []string
func (*ChallengeNotifyService) Name ¶
func (s *ChallengeNotifyService) Name() string
func (*ChallengeNotifyService) Run ¶
func (s *ChallengeNotifyService) Run()
type ChallengeNotifyServiceBinder ¶
type ChallengeNotifyServiceBinder struct{}
func (ChallengeNotifyServiceBinder) Bind ¶
func (ChallengeNotifyServiceBinder) Bind(sess *Session) Service
type ChannelInvitationService ¶
type ChannelInvitationService struct {
// contains filtered or unexported fields
}
The ChannelInvitation service manages chat channel invitations.
func (*ChannelInvitationService) AcceptInvitation ¶
func (s *ChannelInvitationService) AcceptInvitation(body []byte) ([]byte, error)
func (*ChannelInvitationService) DeclineInvitation ¶
func (s *ChannelInvitationService) DeclineInvitation(body []byte) error
func (*ChannelInvitationService) DecrementChannelCount ¶
func (s *ChannelInvitationService) DecrementChannelCount(body []byte) error
func (*ChannelInvitationService) IncrementChannelCount ¶
func (s *ChannelInvitationService) IncrementChannelCount(body []byte) ([]byte, error)
func (*ChannelInvitationService) Invoke ¶
func (s *ChannelInvitationService) Invoke(method int, body []byte) (resp []byte, err error)
func (*ChannelInvitationService) ListChannelCount ¶
func (s *ChannelInvitationService) ListChannelCount(body []byte) ([]byte, error)
func (*ChannelInvitationService) Methods ¶
func (s *ChannelInvitationService) Methods() []string
func (*ChannelInvitationService) Name ¶
func (s *ChannelInvitationService) Name() string
func (*ChannelInvitationService) RevokeInvitation ¶
func (s *ChannelInvitationService) RevokeInvitation(body []byte) error
func (*ChannelInvitationService) SendInvitation ¶
func (s *ChannelInvitationService) SendInvitation(body []byte) ([]byte, error)
func (*ChannelInvitationService) Subscribe ¶
func (s *ChannelInvitationService) Subscribe(body []byte) ([]byte, error)
func (*ChannelInvitationService) SuggestInvitation ¶
func (s *ChannelInvitationService) SuggestInvitation(body []byte) error
func (*ChannelInvitationService) Unsubscribe ¶
func (s *ChannelInvitationService) Unsubscribe(body []byte) error
func (*ChannelInvitationService) UpdateChannelCount ¶
func (s *ChannelInvitationService) UpdateChannelCount(body []byte) error
type ChannelInvitationServiceBinder ¶
type ChannelInvitationServiceBinder struct{}
func (ChannelInvitationServiceBinder) Bind ¶
func (ChannelInvitationServiceBinder) Bind(sess *Session) Service
type ConnectionService ¶
type ConnectionService struct {
// contains filtered or unexported fields
}
The Connection service is the default service that manages the RPC binding process for other services and also handles low-level functions like pings, errors resulting in disconnection, and elevations to encrypted streams.
func (*ConnectionService) Connect ¶
func (s *ConnectionService) Connect(body []byte) ([]byte, error)
func (*ConnectionService) Encrypt ¶
func (s *ConnectionService) Encrypt(body []byte) error
func (*ConnectionService) ForceDisconnect ¶
func (s *ConnectionService) ForceDisconnect(body []byte) error
func (*ConnectionService) Invoke ¶
func (s *ConnectionService) Invoke(method int, body []byte) (resp []byte, err error)
func (*ConnectionService) KeepAlive ¶
func (s *ConnectionService) KeepAlive(body []byte) error
func (*ConnectionService) Methods ¶
func (s *ConnectionService) Methods() []string
func (*ConnectionService) Name ¶
func (s *ConnectionService) Name() string
func (*ConnectionService) RequestDisconnect ¶
func (s *ConnectionService) RequestDisconnect(body []byte) error
type ConnectionServiceBinder ¶
type ConnectionServiceBinder struct{}
func (ConnectionServiceBinder) Bind ¶
func (ConnectionServiceBinder) Bind(sess *Session) Service
type FourccValue ¶
type FourccValue struct {
Value string
}
Wrapper type for disambiguationg string and fourcc values in attributes.
type FriendsService ¶
type FriendsService struct {
// contains filtered or unexported fields
}
The Friends service handles friends and friend requests.
func (*FriendsService) AcceptInvitation ¶
func (s *FriendsService) AcceptInvitation(body []byte) error
func (*FriendsService) AssignRole ¶
func (s *FriendsService) AssignRole(body []byte) error
func (*FriendsService) DeclineInvitation ¶
func (s *FriendsService) DeclineInvitation(body []byte) error
func (*FriendsService) IgnoreInvitation ¶
func (s *FriendsService) IgnoreInvitation(body []byte) error
func (*FriendsService) Invoke ¶
func (s *FriendsService) Invoke(method int, body []byte) (resp []byte, err error)
func (*FriendsService) Methods ¶
func (s *FriendsService) Methods() []string
func (*FriendsService) Name ¶
func (s *FriendsService) Name() string
func (*FriendsService) RemoveFriend ¶
func (s *FriendsService) RemoveFriend(body []byte) ([]byte, error)
func (*FriendsService) RevokeAllInvitations ¶
func (s *FriendsService) RevokeAllInvitations(body []byte) error
func (*FriendsService) RevokeInvitation ¶
func (s *FriendsService) RevokeInvitation(body []byte) error
func (*FriendsService) SendInvitation ¶
func (s *FriendsService) SendInvitation(body []byte) error
func (*FriendsService) SubscribeToFriends ¶
func (s *FriendsService) SubscribeToFriends(body []byte) ([]byte, error)
func (*FriendsService) UnsubscribeToFriends ¶
func (s *FriendsService) UnsubscribeToFriends(body []byte) error
func (*FriendsService) UpdateFriendState ¶
func (s *FriendsService) UpdateFriendState(body []byte) error
func (*FriendsService) ViewFriends ¶
func (s *FriendsService) ViewFriends(body []byte) ([]byte, error)
type FriendsServiceBinder ¶
type FriendsServiceBinder struct{}
func (FriendsServiceBinder) Bind ¶
func (FriendsServiceBinder) Bind(sess *Session) Service
type GameMasterService ¶
type GameMasterService struct {
// contains filtered or unexported fields
}
The GameUtilities service arbitrates packets between the client and servers specific to individual games.
func (*GameMasterService) CancelGameEntry ¶
func (s *GameMasterService) CancelGameEntry(body []byte) error
func (*GameMasterService) ChangeGame ¶
func (s *GameMasterService) ChangeGame(body []byte) error
func (*GameMasterService) FindGame ¶
func (s *GameMasterService) FindGame(body []byte) ([]byte, error)
func (*GameMasterService) GameEnded ¶
func (s *GameMasterService) GameEnded(body []byte) error
func (*GameMasterService) GetFactoryInfo ¶
func (s *GameMasterService) GetFactoryInfo(body []byte) ([]byte, error)
func (*GameMasterService) GetGameStats ¶
func (s *GameMasterService) GetGameStats(body []byte) ([]byte, error)
func (*GameMasterService) Invoke ¶
func (s *GameMasterService) Invoke(method int, body []byte) (resp []byte, err error)
func (*GameMasterService) JoinGame ¶
func (s *GameMasterService) JoinGame(body []byte) ([]byte, error)
func (*GameMasterService) ListFactories ¶
func (s *GameMasterService) ListFactories(body []byte) ([]byte, error)
func (*GameMasterService) Methods ¶
func (s *GameMasterService) Methods() []string
func (*GameMasterService) Name ¶
func (s *GameMasterService) Name() string
func (*GameMasterService) PlayerLeft ¶
func (s *GameMasterService) PlayerLeft(body []byte) error
func (*GameMasterService) RegisterServer ¶
func (s *GameMasterService) RegisterServer(body []byte) error
func (*GameMasterService) RegisterUtilities ¶
func (s *GameMasterService) RegisterUtilities(body []byte) error
func (*GameMasterService) Subscribe ¶
func (s *GameMasterService) Subscribe(body []byte) ([]byte, error)
func (*GameMasterService) UnregisterServer ¶
func (s *GameMasterService) UnregisterServer(body []byte) error
func (*GameMasterService) UnregisterUtilities ¶
func (s *GameMasterService) UnregisterUtilities(body []byte) error
func (*GameMasterService) Unsubscribe ¶
func (s *GameMasterService) Unsubscribe(body []byte) error
type GameMasterServiceBinder ¶
type GameMasterServiceBinder struct{}
func (GameMasterServiceBinder) Bind ¶
func (GameMasterServiceBinder) Bind(sess *Session) Service
type GameServer ¶
type GameServer interface { // Connect connects the bnet session to the game session. The game server // should set up the Client and ServerNotification channels on sess. Connect(sess *Session) }
A GameServer accepts clients to create sessions.
type GameUtilitiesService ¶
type GameUtilitiesService struct {
// contains filtered or unexported fields
}
The GameUtilities service arbitrates packets between the client and servers specific to individual games.
func (*GameUtilitiesService) GetLoad ¶
func (s *GameUtilitiesService) GetLoad(body []byte) ([]byte, error)
func (*GameUtilitiesService) GetPlayerVariables ¶
func (s *GameUtilitiesService) GetPlayerVariables(body []byte) ([]byte, error)
func (*GameUtilitiesService) Invoke ¶
func (s *GameUtilitiesService) Invoke(method int, body []byte) (resp []byte, err error)
func (*GameUtilitiesService) Methods ¶
func (s *GameUtilitiesService) Methods() []string
func (*GameUtilitiesService) Name ¶
func (s *GameUtilitiesService) Name() string
func (*GameUtilitiesService) NotifyGameAccountOffline ¶
func (s *GameUtilitiesService) NotifyGameAccountOffline(body []byte) error
func (*GameUtilitiesService) NotifyGameAccountOnline ¶
func (s *GameUtilitiesService) NotifyGameAccountOnline(body []byte) error
func (*GameUtilitiesService) PresenceChannelCreated ¶
func (s *GameUtilitiesService) PresenceChannelCreated(body []byte) error
func (*GameUtilitiesService) ProcessClientRequest ¶
func (s *GameUtilitiesService) ProcessClientRequest(body []byte) ([]byte, error)
func (*GameUtilitiesService) ProcessServerRequest ¶
func (s *GameUtilitiesService) ProcessServerRequest(body []byte) ([]byte, error)
type GameUtilitiesServiceBinder ¶
type GameUtilitiesServiceBinder struct{}
func (GameUtilitiesServiceBinder) Bind ¶
func (GameUtilitiesServiceBinder) Bind(sess *Session) Service
type MessageValue ¶
type MessageValue struct {
Value []byte
}
Wrapper type for disambiguationg blob and message values in attributes.
type Notification ¶
A notification sent or received by battle.net from or to another server.
func NewNotification ¶
func NewNotification(ty string, m map[string]interface{}) *Notification
func (*Notification) Map ¶
func (n *Notification) Map() map[string]interface{}
Converts a notification into a flat map containing a type key for the notification's type and all of the notification's attributes.
type PresenceService ¶
type PresenceService struct {
// contains filtered or unexported fields
}
The Presence service maintains and broadcasts the "presence" of players within the Bnet system: their current game, status, location, etc.
func (*PresenceService) Invoke ¶
func (s *PresenceService) Invoke(method int, body []byte) (resp []byte, err error)
func (*PresenceService) Methods ¶
func (s *PresenceService) Methods() []string
func (*PresenceService) Name ¶
func (s *PresenceService) Name() string
func (*PresenceService) Query ¶
func (s *PresenceService) Query(body []byte) error
func (*PresenceService) Subscribe ¶
func (s *PresenceService) Subscribe(body []byte) error
func (*PresenceService) Unsubscribe ¶
func (s *PresenceService) Unsubscribe(body []byte) error
func (*PresenceService) Update ¶
func (s *PresenceService) Update(body []byte) error
type PresenceServiceBinder ¶
type PresenceServiceBinder struct{}
func (PresenceServiceBinder) Bind ¶
func (PresenceServiceBinder) Bind(sess *Session) Service
type ResourcesService ¶
type ResourcesService struct {
// contains filtered or unexported fields
}
The Resources service allows the client to query content handles for files that are usually often updated.
func (*ResourcesService) GetContentHandle ¶
func (s *ResourcesService) GetContentHandle(body []byte) ([]byte, error)
func (*ResourcesService) Invoke ¶
func (s *ResourcesService) Invoke(method int, body []byte) (resp []byte, err error)
func (*ResourcesService) Methods ¶
func (s *ResourcesService) Methods() []string
func (*ResourcesService) Name ¶
func (s *ResourcesService) Name() string
type ResourcesServiceBinder ¶
type ResourcesServiceBinder struct{}
func (ResourcesServiceBinder) Bind ¶
func (ResourcesServiceBinder) Bind(sess *Session) Service
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
A Server accepts client connections and processes each connection as a Session.
func (*Server) ConnectGameServer ¶
func (*Server) ListenAndServe ¶
ListenAndServe listens for incoming connections on the specified address indefinitely, handling each connection as a new Session.
func (*Server) RegisterGameServer ¶
func (s *Server) RegisterGameServer(fourcc string, serv GameServer)
type Service ¶
type Service interface { // Name returns the fully qualified name of the service. Name() string // Methods returns the names of the service's invokable methods. Methods() []string // Invoke executes a method. Invoke(method int, body []byte) (resp []byte, err error) }
A Service is a set of RPC methods bound to a particular Session.
type ServiceBinder ¶
type ServiceBinder interface { // Bind binds a service to a session. Passing nil will give a default // instance which can be used to inspect the service and method names. Bind(sess *Session) Service }
A ServiceBinder is used to create instances of a service bound to individual sessions.
type Session ¶
type Session struct { // ServerNotifications are notifications sent by the bnet server to the game // server. ServerNotifications chan<- *Notification // ClientNotifications are notifications sent by the game server to the bnet // server. ClientNotifications <-chan *Notification // contains filtered or unexported fields }
func (*Session) BindExport ¶
func (*Session) BindImport ¶
func (*Session) ChanForTransition ¶
ChanForTransition makes a channel that waits for the specified state.
func (*Session) Disconnect ¶
func (s *Session) Disconnect()
func (*Session) DisconnectOnPanic ¶
func (s *Session) DisconnectOnPanic()
func (*Session) HandleNotifications ¶
func (s *Session) HandleNotifications()
func (*Session) HandleRequest ¶
func (*Session) HandleResponse ¶
func (*Session) ImportedService ¶
func (*Session) MakeRequestHeader ¶
func (*Session) OnceNotified ¶
func (s *Session) OnceNotified(ty string, handle func(n *Notification))
Will trigger handler once the server is notified with a notification of type ty.
func (*Session) Transition ¶
Transition updates the session's state with the value provided, and notifies any listeners of that state update.
func (*Session) WaitForTransition ¶
WaitForTransition blocks until the session state matches the value provided.