Friend Services
src/friendsvr/ provides management and recommendation services with protocols and SDKs.
The lobby's logic/friend_api/ integrates lists, invitations, acceptance/rejection, removal, and gifts.
Recommendation strategies remain unimplemented in task_action_recommend_search and the lobby's
friend_get_suggest; a successful call does not imply populated recommendations.
Quick Start
- Enable
friendsvr-managementin the values process layout, prepare Redis, and usemodules/friend_api.yamland the corresponding chart configuration. The management SDK depends on distributed transactions; prepare transaction services using distributed transactions. - Add
friend-sdk-managementto the consumer'sUSE_SERVICE_SDKand reconfigure/build. The recommendation service framework supports custom strategies and is outside this minimal integration. - Follow
src/lobbysvr/service/logic/friend_api/user_friend_api_manager.h/.cppfor business integration; use the SDK'sdata/friend_cache.handrouter/router_friend_manager.hfor data access. - Follow the lobby's
FriendManagementNotifyServicegeneration declaration and handler registration for notifications. - With two test users, send and accept an invitation, query both lists, then remove the relationship.
Verify both users' data and notifications. Client messages are in
com.protocol.friend_api.proto; robot'scmd/friend.goprovides existing command entry points.
Adjust existing invitation, gift, and count limits through configuration. Follow the RPC quick start for RPC declarations.
Customization and Design
Management protocols live under src/friendsvr/protocol/management/, and recommendation protocols under
protocol/recommend/. Transaction participant and WAL implementations live under
service/management/data/; inspect them when changing relationship persistence or recovery.
Use src/friendsvr/test/friendsvr_management_test.cpp and lobby friend tests for validation.