0ad/source/network
vyordan 71be79791f
Some checks failed
checkrefs / lfscheck (push) Has been cancelled
checkrefs / checkrefs (push) Has been cancelled
lint / cppcheck (push) Has been cancelled
lint / copyright (push) Has been cancelled
lint / jenkinsfiles (push) Has been cancelled
pre-commit / build (push) Has been cancelled
Use turn_id_t (int32_t) for turn-count across simulation, network and replay
CSimulation2 used , CSimulation2Impl mixed /, and
CTurnManager used  for the same turn-count concept, forcing a
static_cast<int64_t> at the one place these types already met
(rejoin-test comparison).

Add  (alias for std::int32_t) in SimulationCommand.h and use
it consistently for every turn counter in CSimulation2/Impl,
CTurnManager and its subclasses (CLocalTurnManager,
CReplayTurnManager), CNetServerTurnManager/CNetClientTurnManager, and
the network wire format (m_Turn in CEndCommandBatchMessage,
CSimulationMessage, CSyncCheckMessage, CSyncErrorMessage, and
m_CurrentTurn in CLoadedGameMessage).

Turn *duration* fields (m_TurnLength, m_CommandDelay,
DEFAULT_TURN_LENGTH, COMMAND_DELAY_SP/MP, SetTurnLength,
GetSavedTurnLength return type) are left as u32 — they're milliseconds,
not a counter, and out of scope here.

Remaining turn_id_t vs size_t comparisons use std::cmp_equal or
explicit casts, matching the existing pattern in Simulation2.cpp.

Fixes #8718
2026-07-31 10:34:20 +02:00
..
scripting Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
tests Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
FSM.h Fix includes in source/network 2025-07-23 18:18:47 +02:00
HttpServer.cpp Use cpp-httplib instead of mongoose 2026-01-24 10:45:48 +01:00
HttpServer.h Use cpp-httplib instead of mongoose 2026-01-24 10:45:48 +01:00
NetClient.cpp Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
NetClient.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
NetClientSession.cpp Use std::unique_ptr for stats-table 2026-04-18 14:38:38 +02:00
NetClientSession.h Use std::unique_ptr for stats-table 2026-04-18 14:38:38 +02:00
NetClientTurnManager.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
NetClientTurnManager.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
NetEnet.cpp Remove custom span and use std::span 2025-08-24 11:09:57 +02:00
NetEnet.h Fix includes in source/network 2025-07-23 18:18:47 +02:00
NetFileTransfer.cpp Do the gamestate compression in the task-manager 2026-04-09 19:03:46 +02:00
NetFileTransfer.h Do the gamestate compression in the task-manager 2026-04-09 19:03:46 +02:00
NetHost.cpp Fix includes in source/network 2025-07-23 18:18:47 +02:00
NetHost.h Use std::unique_ptr for ENetPeer 2026-04-18 14:38:38 +02:00
NetMessage.cpp Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
NetMessage.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
NetMessages.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
NetMessageSim.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
NetProtocol.cpp Fix some includes all over the place 2025-08-13 19:38:21 +02:00
NetProtocol.h Split NetSession into two files 2026-03-11 21:03:52 +01:00
NetServer.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
NetServer.h Move Script* classes to Script namespace 2026-06-20 17:43:00 +02:00
NetServerSession.cpp Split NetSession into two files 2026-03-11 21:03:52 +01:00
NetServerSession.h Split NetSession into two files 2026-03-11 21:03:52 +01:00
NetServerTurnManager.cpp Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
NetServerTurnManager.h Use turn_id_t (int32_t) for turn-count across simulation, network and replay 2026-07-31 10:34:20 +02:00
NetStats.cpp Use std::unique_ptr for ENetPeer 2026-04-18 14:38:38 +02:00
NetStats.h Use std::unique_ptr for ENetPeer 2026-04-18 14:38:38 +02:00
NMTCreator.h Prefer [[maybe_unused]] over UNUSED2 2025-07-28 13:16:37 +02:00
Serialization.h Fix includes in source/network 2025-07-23 18:18:47 +02:00
StringConverters.h Fix includes in source/network 2025-07-23 18:18:47 +02:00
StunClient.cpp Make requirements sufficient in StunClient 2025-08-12 20:45:16 +02:00
StunClient.h Fix includes in source/network 2025-07-23 18:18:47 +02:00