Matchmaking and Teams
src/matchsvr/ provides matchmaking pools, rooms, and result notifications;
src/teamsvr/ provides team rooms; its teamsvr-match teammate-search service remains a placeholder.
The lobby's logic/matching/ and logic/team/ integrate player-facing behavior.
Quick Start: Matchmaking
- Enable a
matchsvrinstance and configure Redis. Edit pools, rule groups, matching rules, and parameter merge rules inresource/ExcelTables/Matching.xlsx; followLevel.xlsxfor levels. - Export and publish Excel configuration, and add
matchsvr-sdkto the consumer'sUSE_SERVICE_SDK. - Use generated APIs in
src/matchsvr/sdk/rpc/matching/matchsvrservice.atfw.gen.h. Follow the lobby'suser_matching_manager.h/.cppfor player workflows, and registerMatchsvrNotifyServicehandlers for results. - Use the existing
src/robot/case_config/matching_demo.confscenario to verify start, confirmation, cancellation, and result notifications. Seematching_team_3v3.conffor team matching. Waiting-room cases are described inmatching_waiting_cases.md, but their pools and levels are absent from the default workbooks; prepare the additional fixtures documented there instead of running them against default resources.
Existing matching parameters are configured through Excel and values. New algorithms or matching semantics need business implementations. See Orbit for battle process management after matching.
Waiting Rooms and State
The lobby persists DUserMatchingData in table_user.matching_data, including level_data.level_select.
user_matching_manager::init_from_table_data and dump restore and write this data respectively.
After initial Orbit user initialization succeeds, a waiting room admits late Units into the existing room without
recreating DS or remapping established factions. Admission is bounded by room and faction reservations and checks
the absolute end_join_timepoint at admission, confirmation, initialization, retry, and post-await commit. A late
success cannot revive a timed-out Unit. A late-unit initialization failure closes the whole waiting room without
rolling back Units that already succeeded. A successful player may match elsewhere with a new Unit ID, but the old
waiting room rejects both admitted Unit IDs and successful player identities.
Match's Orbit EndJoin/UserQuit actions currently return success as placeholders; they do not establish completed DS
settlement. See src/matchsvr/README.md for the complete state and WAL contract.
Quick Start: Teams
- Enable
teamsvr-room; addmatchsvrwhen teams enter battle matchmaking. Edit and export team types inresource/ExcelTables/Team.xlsx. - Add
team-common-sdkandteam-sdk-roomto the consumer'sUSE_SERVICE_SDK. Room APIs live insrc/teamsvr/sdk/room/rpc/team/team_room_client_api.h. - Follow
src/lobbysvr/service/logic/team/user_team_manager.h/.cppfor members, invitations, captains, and state synchronization. - With test users, verify team creation, invitations/joining, leaving, and any matching workflow; inspect client state and notifications.
Invitations and active join requests are separate flows. Use team_send_join_request for a request and
team_accept_join_request / team_reject_join_request for review. EN_TTDF_DISABLE_INVITATION and
EN_TTDF_DISABLE_APPLY disable invitation and request flows respectively. Verify Lobby caching, upstream merge, and
required, deduplicated, and recovered full/incremental notifications at the actual flush boundary.
TeamMatchService.search in teamsvr-match has no teammate-search implementation. It is separate from entering
teams into matchsvr and is outside the minimal integration above.
Customization and Design
Matchmaking protocols live under src/matchsvr/protocol/, team protocols under src/teamsvr/protocol/,
and client messages in com.protocol.match.proto and com.protocol.team.proto.
Algorithms and WAL implementations live in service logic/ directories; tests live in their test/ directories.
For new RPCs or config fields, use the RPC and
server config guides.