Integrating and Adding Components
Quick Start: Use an Existing Component
- Choose a component and prepare its instances/configuration using its quick start.
- Add the SDK dependency to the consumer's existing
project_service_declare_instancedeclaration. For DTMQ, appenddtmq-proxy-sdktoUSE_COMPONENTS:USE_COMPONENTS "dtmq-proxy-sdk". Friends and matchmaking live undersrc/*svr/; put their SDKs inUSE_SERVICE_SDK. - Reconfigure/build, include public SDK headers, and call the API from business actions.
For notifications, follow declarations in
lobbysvr/service/CMakeLists.txtand register generated handlers in main. - Verify a request and required notifications/callbacks. Ordinary integration needs no edits to component CMake helpers, generators, or templates.
Extend the parameters of the existing declaration; do not define the service target again.
Quick Start: Add a Reusable Component
- For a pure algorithm component, follow SDK layouts under
src/component/GameSharedComponent/. For “protocol + service + SDK”, followsrc/component/dtmq/. - Copy declarations and replace component names, protocol targets, protobuf service full names, output paths,
and export macros. Declare component protos in
project_component_declare_protocol'sPROTOCOLS; reuseproject_component_declare_service/project_component_declare_sdkfor services and SDKs. - Register the directory in
src/component/CMakeLists.txt. For a separate process, register its type and deployment using adding a service. Algorithm-only SDKs need no process configuration. - Follow the protocol and RPC quick starts, reconfigure/build, implement the behavior, and declare the consuming service's SDK dependency as above.
Customization and Design
Read src/component/component-functions.cmake and RPC and code generation
only when changing linking, generated layouts, or component setup.
Each component's design page covers replication, persistence, and lifecycle rules.