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

@@ -1,31 +0,0 @@
#pragma once
#include <optional>
#include <td/protocol/command/Commands.h>
#include <td/protocol/packet/Packets.h>
namespace td {
namespace game {
class GameHistory {
private:
using HistorySizeType = StepsType;
std::vector<std::optional<protocol::LockStep>> m_History;
public:
GameHistory();
void SetLockStep(HistorySizeType a_Index, protocol::LockStep&& a_LockStep);
const protocol::LockStep& GetLockStep(HistorySizeType a_Index) const;
bool HasLockStep(HistorySizeType a_Index) const;
void FromPacket(td::protocol::pdata::LockSteps&& a_Steps);
td::protocol::packets::LockStepsPacket ToPacket(HistorySizeType a_StartIndex);
};
} // namespace game
} // namespace td

View File

@@ -25,6 +25,8 @@ class ServerSimulation : public protocol::CommandHandler {
protocol::packets::LockStepsPacket Update();
protocol::packets::LockStepsPacket MakePacket();
// no checks are done !
virtual void Handle(const protocol::commands::SpawnTroopCommand& a_SpawnTroop) override;