diff --git a/plugins/modules/matchmaking.go b/plugins/modules/matchmaking.go index d5df163..4ef5e60 100644 --- a/plugins/modules/matchmaking.go +++ b/plugins/modules/matchmaking.go @@ -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)