mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
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:
parent
47fade7bcb
commit
c2a10466db
13 changed files with 457 additions and 22 deletions
|
|
@ -965,6 +965,11 @@ bool Servatrice::permitCreateGameAsJudge() const
|
|||
return settingsCache->value("game/allow_create_as_judge", false).toBool();
|
||||
}
|
||||
|
||||
bool Servatrice::permitCommandZone() const
|
||||
{
|
||||
return settingsCache->value("game/allow_command_zone", true).toBool();
|
||||
}
|
||||
|
||||
QHostAddress Servatrice::getServerTCPHost() const
|
||||
{
|
||||
QString host = settingsCache->value("server/host", "any").toString();
|
||||
|
|
|
|||
|
|
@ -265,6 +265,7 @@ public:
|
|||
int getMaxCommandCountPerInterval() const override;
|
||||
int getMaxUserTotal() const override;
|
||||
bool permitCreateGameAsJudge() const override;
|
||||
bool permitCommandZone() const override;
|
||||
int getMaxTcpUserLimit() const;
|
||||
int getMaxWebSocketUserLimit() const;
|
||||
int getUsersWithAddress(const QHostAddress &address) const;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue