feat(command-zone): add server-side support with tests

Implement server-side protocol and game logic for networked command
zone play.

Protocol changes:
- room_commands.proto: command zone messages and responses

Server components:
- ServerCounter: counter synchronization for commander tax
- ServerGame: command zone game state management
- ServerPlayer: player-level command zone handling
- Server/ServerProtocolHandler: command zone message routing
- Servatrice: command zone support in the main server

Design decisions:
- setCount() returns bool for event suppression (avoid duplicate events)
- Zone state synchronized across all connected clients
- Commander tax persists across zone transitions

Test coverage verifies setCount() return value behavior for proper
event suppression in networked scenarios.
This commit is contained in:
DawnFire42 2026-02-25 13:38:59 -05:00
parent 47fade7bcb
commit c2a10466db
13 changed files with 457 additions and 22 deletions

View file

@ -105,6 +105,21 @@ target_link_libraries(counter_visibility_test
add_test(NAME counter_visibility_test COMMAND counter_visibility_test)
# ------------------------
# Server Counter SetCount Test
# Tests setCount() return value for event suppression
# ------------------------
add_executable(server_counter_setcount_test
server_counter_setcount_test.cpp
)
target_link_libraries(server_counter_setcount_test
PRIVATE Threads::Threads
PRIVATE ${GTEST_BOTH_LIBRARIES}
)
add_test(NAME server_counter_setcount_test COMMAND server_counter_setcount_test)
# ------------------------
# Dependencies on gtest
# ------------------------
@ -114,4 +129,5 @@ if(NOT GTEST_FOUND)
add_dependencies(command_zone_state_test gtest)
add_dependencies(command_zone_integration_test gtest)
add_dependencies(counter_visibility_test gtest)
add_dependencies(server_counter_setcount_test gtest)
endif()