mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 17:13:44 +00:00
fix(multiplayer): reconcile authoritative initial connections
This commit is contained in:
@@ -78,7 +78,7 @@ func NewRankedConnections(matchID, serverID, protocol string, players []JoinAuth
|
||||
}
|
||||
|
||||
func (r *RankedConnections) validate(auth JoinAuthorisation, now time.Time) error {
|
||||
if auth.MatchID != r.MatchID || auth.ServerID != r.ServerID || auth.Protocol != r.Protocol || auth.PlayerID == "" || auth.SteamID == "" || auth.Slot < 0 || auth.Team < 0 || auth.ExpiresAt.IsZero() {
|
||||
if auth.MatchID != r.MatchID || auth.ServerID != r.ServerID || auth.Protocol != r.Protocol || auth.PlayerID == "" || auth.SteamID == "" || auth.Slot < 0 || auth.Slot > 5 || auth.Team < 0 || auth.Team > 1 || auth.Slot/3 != auth.Team || auth.ExpiresAt.IsZero() {
|
||||
return ErrJoinAuthorisation
|
||||
}
|
||||
if !now.IsZero() && !now.Before(auth.ExpiresAt) {
|
||||
|
||||
Reference in New Issue
Block a user