server state test
This commit is contained in:
14
src/main.cpp
14
src/main.cpp
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user