begin client-server

This commit is contained in:
2025-08-06 20:10:56 +02:00
parent 89213e9a97
commit c813c49707
26 changed files with 264 additions and 188 deletions

View File

@@ -7,7 +7,11 @@
#include <td/game/WorldTypes.h>
// Make it dynamic ?
#ifdef NDEBUG
#define LOCKSTEP_BUFFER_SIZE 10
#else
#define LOCKSTEP_BUFFER_SIZE 1
#endif
namespace td {
namespace protocol {
@@ -45,7 +49,7 @@ struct PlayerLeave {
struct PredictCommand {
CommandPtr m_Command;
std::uint16_t m_FrameNumber;
StepTime m_FrameNumber;
};
/** Keep alive */
@@ -73,7 +77,7 @@ struct BeginGame {
};
struct LockSteps {
std::uint16_t m_FirstFrameNumber;
StepTime m_FirstFrameNumber;
std::array<LockStep, LOCKSTEP_BUFFER_SIZE> m_LockSteps;
};
@@ -95,6 +99,7 @@ struct WorldData {
game::ChunkList m_Chunks;
};
// TODO: spawn multiple troops at the same time
struct SpawnTroop {
sp::BitField<EntityType, 5> m_Type;
sp::BitField<std::uint8_t, 3> m_Level;