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:
2025-11-26 16:09:48 +05:30
parent fa4d4d00be
commit 0fb448dd45
2 changed files with 74 additions and 0 deletions

View File

@@ -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