Documentation ¶
Index ¶
- Variables
- func AddPlayersToSession(session *CommonMatchmakeSession, connectionIDs []uint32, ...) (error, uint32)
- func ChangeSessionOwner(ownerClient *nex.Client, gathering uint32)
- func DeleteIndex(s []uint32, index int) []uint32
- func FindClientSession(connectionID uint32) uint32
- func FindOtherConnectionID(excludedConnectionID uint32, gatheringID uint32) uint32
- func FindSessionByMatchmakeSession(pid uint32, searchMatchmakeSession *match_making_types.MatchmakeSession) uint32
- func GetAvailableGatheringID() uint32
- func RemoveClientFromAllSessions(client *nex.Client)
- func RemoveConnectionIDFromSession(clientConnectionID uint32, gathering uint32)
- type CommonMatchmakeSession
Constants ¶
This section is empty.
Variables ¶
var CurrentGatheringID = nex.NewCounter(0)
var CurrentMatchmakingCallID = nex.NewCounter(0)
var GetUserFriendPIDsHandler func(pid uint32) []uint32
var Logger = plogger.NewLogger()
var Sessions map[uint32]*CommonMatchmakeSession
Functions ¶
func AddPlayersToSession ¶ added in v1.0.26
func AddPlayersToSession(session *CommonMatchmakeSession, connectionIDs []uint32, initiatingClient *nex.Client, joinMessage string) (error, uint32)
AddPlayersToSession updates the given sessions state to include the provided connection IDs Returns a NEX error code if failed
func ChangeSessionOwner ¶ added in v1.0.28
ChangeSessionOwner changes the session owner to a different client
func DeleteIndex ¶ added in v1.0.19
DeleteIndex removes a value from a slice with the given index
func FindClientSession ¶ added in v1.0.19
FindClientSession searches for session the given connection ID is connected to
func FindOtherConnectionID ¶ added in v1.0.19
FindOtherConnectionID searches a connection ID on the session that isn't the given one Returns 0 if no connection ID could be found
func FindSessionByMatchmakeSession ¶ added in v1.0.28
func FindSessionByMatchmakeSession(pid uint32, searchMatchmakeSession *match_making_types.MatchmakeSession) uint32
FindSessionByMatchmakeSession finds a gathering that matches with a MatchmakeSession
func GetAvailableGatheringID ¶ added in v1.0.28
func GetAvailableGatheringID() uint32
GetAvailableGatheringID returns a gathering ID which doesn't belong to any session Returns 0 if no IDs are available (math.MaxUint32 has been reached)
func RemoveClientFromAllSessions ¶ added in v1.0.28
RemoveClientFromAllSessions removes a client from every session
func RemoveConnectionIDFromSession ¶ added in v1.0.28
RemoveConnectionIDFromSession removes a client from the session
Types ¶
type CommonMatchmakeSession ¶
type CommonMatchmakeSession struct { GameMatchmakeSession *match_making_types.MatchmakeSession // * Used by the game, contains the current state of the MatchmakeSession SearchMatchmakeSession *match_making_types.MatchmakeSession // * Used by the server when searching for matches, contains the state of the MatchmakeSession during the search process for easy compares ConnectionIDs []uint32 // * Players in the room, referenced by their connection IDs. This is used instead of the PID in order to ensure we're talking to the correct client (in case of e.g. multiple logins) }
func CreateSessionByMatchmakeSession ¶ added in v1.0.29
func CreateSessionByMatchmakeSession(matchmakeSession *match_making_types.MatchmakeSession, searchMatchmakeSession *match_making_types.MatchmakeSession, hostPID uint32) (*CommonMatchmakeSession, error, uint32)
CreateSessionByMatchmakeSession creates a gathering from a MatchmakeSession
func FindSessionsByMatchmakeSessionSearchCriterias ¶ added in v1.0.28
func FindSessionsByMatchmakeSessionSearchCriterias(pid uint32, lstSearchCriteria []*match_making_types.MatchmakeSessionSearchCriteria, gameSpecificChecks func(searchCriteria *match_making_types.MatchmakeSessionSearchCriteria, matchmakeSession *match_making_types.MatchmakeSession) bool) []*CommonMatchmakeSession
FindSessionsByMatchmakeSessionSearchCriterias finds a gathering that matches with the given search criteria