common_globals

package
v1.0.30 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2023 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CurrentGatheringID = nex.NewCounter(0)
View Source
var CurrentMatchmakingCallID = nex.NewCounter(0)
View Source
var GetUserFriendPIDsHandler func(pid uint32) []uint32
View Source
var Logger = plogger.NewLogger()

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

func ChangeSessionOwner(ownerClient *nex.Client, gathering uint32)

ChangeSessionOwner changes the session owner to a different client

func DeleteIndex added in v1.0.19

func DeleteIndex(s []uint32, index int) []uint32

DeleteIndex removes a value from a slice with the given index

func FindClientSession added in v1.0.19

func FindClientSession(connectionID uint32) uint32

FindClientSession searches for session the given connection ID is connected to

func FindOtherConnectionID added in v1.0.19

func FindOtherConnectionID(excludedConnectionID uint32, gatheringID uint32) uint32

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

func RemoveClientFromAllSessions(client *nex.Client)

RemoveClientFromAllSessions removes a client from every session

func RemoveConnectionIDFromSession added in v1.0.28

func RemoveConnectionIDFromSession(clientConnectionID uint32, gathering uint32)

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

Jump to

Keyboard shortcuts

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