Implemented the real server

This commit is contained in:
Vladislav Khorev committed 2026-10-30 16:37:30 +06:00
1 parent 931236bec0
commit 075750442f
22 files changed
+1130 -44

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
#pragma once
#include <cstdint>
#include <memory>
#include <string>
namespace FRG {
class InternalGameServer;
class WebsocketGameServer {
public:
WebsocketGameServer(
InternalGameServer& gameServer,
const std::string& address = "0.0.0.0",
std::uint16_t port = 8080);
~WebsocketGameServer();
WebsocketGameServer(const WebsocketGameServer&) = delete;
WebsocketGameServer& operator=(const WebsocketGameServer&) = delete;
void update(std::int64_t deltaMs);
void broadcastState();
std::uint16_t port() const;
private:
class Impl;
InternalGameServer& gameServer_;
std::unique_ptr<Impl> impl_;
std::int64_t broadcastElapsedMs_ = 0;
};
} // namespace FRG