feat: add rpc_find_match for basic 2-player matchmaking
- Implement rpc_find_match Nakama RPC function - Search for existing authoritative TicTacToe matches via MatchList - Return first match with available slot (size < 2) - Create new match using MatchCreate when none available - Add request/response structs for future extensibility - Log match search, selection, and creation flow - Gracefully handle optional JSON payload and invalid input
This commit is contained in:
@@ -34,6 +34,10 @@ func InitModule(
|
||||
logger.Error("Failed to register RPC: %v", err)
|
||||
return err
|
||||
}
|
||||
if err := initializer.RegisterRpc("rpc_find_match", rpcFindMatch); err != nil {
|
||||
logger.Error("RegisterRpc rpc_find_match failed: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
logger.Info("Go module loaded successfully!")
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user