added check for allowing only class and blitz game mode at server

This commit is contained in:
2025-11-27 16:10:04 +05:30
parent 4a833dc258
commit ead7ad2c35

View File

@@ -29,11 +29,12 @@ func MatchmakerMatched(
propsA := entries[0].GetProperties()
propsB := entries[1].GetProperties()
validModes := map[string]bool{"classic": true, "blitz": true}
modeA, okA := propsA["mode"].(string)
modeB, okB := propsB["mode"].(string)
if !okA || !okB {
if !okA || !okB || !validModes[modeA] || !validModes[modeB] {
logger.Warn("MatchmakerMatched missing mode property — ignoring")
return "", nil
}