Skip to content

Commit

Permalink
feat!: Matchmaking rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniElectra committed Jun 30, 2024
1 parent 98a2806 commit e71f872
Show file tree
Hide file tree
Showing 48 changed files with 2,355 additions and 1,120 deletions.
13 changes: 2 additions & 11 deletions globals/matchmaking_globals.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
package common_globals

import (
"github.com/PretendoNetwork/nex-go/v2"
match_making_types "github.com/PretendoNetwork/nex-protocols-go/v2/match-making/types"
"sync"
)

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 *nex.MutexSlice[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)
}

var Sessions map[uint32]*CommonMatchmakeSession
var MatchmakingMutex *sync.RWMutex = &sync.RWMutex{}
var GetUserFriendPIDsHandler func(pid uint32) []uint32
var CurrentGatheringID = nex.NewCounter[uint32](0)
var CurrentMatchmakingCallID = nex.NewCounter[uint32](0)
Loading

0 comments on commit e71f872

Please sign in to comment.