fixes
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
2025-12-01 18:27:19 +05:30
parent 3eadb49a72
commit 1c31c489c7

View File

@@ -16,7 +16,6 @@ type MatchmakingTicket struct {
// --------------------------------------------------
// GENERIC MATCHMAKER — Supports ALL Games & Modes
// --------------------------------------------------
func MatchmakerMatched(
ctx context.Context,
logger runtime.Logger,
@@ -36,8 +35,8 @@ func MatchmakerMatched(
mode, okMode := props0["mode"].(string)
if !okGame || !okMode {
logger.Warn("MatchmakerMatched: Missing 'game' or 'mode' properties.")
return "", nil
logger.Error("MatchmakerMatched: Missing 'game' or 'mode' properties.")
return "", runtime.NewError("missing matchmaking properties", 3)
}
// Ensure ALL players match game + mode
@@ -57,10 +56,11 @@ func MatchmakerMatched(
// This depends on how "game" was registered in main.go.
// Example: initializer.RegisterMatch("tictactoe", NewGenericMatch(TicTacToeRules))
matchParams := map[string]interface{}{
"game": game,
"mode": mode,
}
matchID, err := nk.MatchCreate(ctx, game, matchParams)
matchID, err := nk.MatchCreate(ctx, "generic", matchParams)
if err != nil {
logger.Error("MatchmakerMatched: MatchCreate failed: %v", err)
return "", runtime.NewError("failed to create match", 13)