added check for allowing only class and blitz game mode at server
This commit is contained in:
@@ -29,11 +29,12 @@ func MatchmakerMatched(
|
|||||||
|
|
||||||
propsA := entries[0].GetProperties()
|
propsA := entries[0].GetProperties()
|
||||||
propsB := entries[1].GetProperties()
|
propsB := entries[1].GetProperties()
|
||||||
|
validModes := map[string]bool{"classic": true, "blitz": true}
|
||||||
|
|
||||||
modeA, okA := propsA["mode"].(string)
|
modeA, okA := propsA["mode"].(string)
|
||||||
modeB, okB := propsB["mode"].(string)
|
modeB, okB := propsB["mode"].(string)
|
||||||
|
|
||||||
if !okA || !okB {
|
if !okA || !okB || !validModes[modeA] || !validModes[modeB] {
|
||||||
logger.Warn("MatchmakerMatched missing mode property — ignoring")
|
logger.Warn("MatchmakerMatched missing mode property — ignoring")
|
||||||
return "", nil
|
return "", nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user