server state test

This commit is contained in:
2025-08-06 13:55:22 +02:00
parent 599dfa0cee
commit 990c6f078d
12 changed files with 183 additions and 22 deletions

View File

@@ -15,6 +15,10 @@
#include <sp/io/MessageStream.h>
#include <sp/io/StdIo.h>
#include <server/Server.h>
#include <server/socket/TcpSocket.h>
#include <server/state/LobbyState.h>
class WorldApply : public td::protocol::PacketHandler {
private:
td::game::World& m_World;
@@ -92,7 +96,6 @@ td::sim::GameHistory GetCustomHistory() {
return gh;
}
int main(int argc, char** argv) {
td::game::World w = GetWorld();
@@ -128,6 +131,15 @@ int main(int argc, char** argv) {
}
});
// server
auto socket = std::make_shared<td::server::TcpSocket>();
td::server::Server server(socket);
server.UpdateState(std::make_shared<td::server::LobbyState>());
server.Update(1.0f);
server.Update(1.0f);
socket->OnDisconnect(0);
while (!display.IsCloseRequested()) {
display.PollEvents();
float lerp = simulation.Update();