diff --git a/client/scenes/clean_up.cpp b/client/scenes/clean_up.cpp index 416a1c8..fab06fd 100644 --- a/client/scenes/clean_up.cpp +++ b/client/scenes/clean_up.cpp @@ -82,20 +82,13 @@ CleanUp::~CleanUp() { void CleanUp::Update(double delta) { if (std::chrono::steady_clock::now() - startTick > std::chrono::duration(10)) { - QuitEvent(); + SetNextScene(SceneList::MAINMENU); } //BUGFIX: Eat incoming packets while(network.Receive()); } -void CleanUp::RenderFrame() { - SDL_FillRect(GetScreen(), 0, 0); - Render(GetScreen()); - SDL_Flip(GetScreen()); - fps.Calculate(); -} - void CleanUp::Render(SDL_Surface* const screen) { backButton.DrawTo(screen); font.DrawStringTo("You have been disconnected.", screen, 50, 30); diff --git a/client/scenes/clean_up.hpp b/client/scenes/clean_up.hpp index ac39b44..7ab48bd 100644 --- a/client/scenes/clean_up.hpp +++ b/client/scenes/clean_up.hpp @@ -30,12 +30,8 @@ #include "raster_font.hpp" #include "button.hpp" -//common -#include "frame_rate.hpp" - -#include "character.hpp" - //client +#include "character.hpp" #include "base_scene.hpp" //std namespace @@ -55,7 +51,6 @@ public: protected: //Frame loop void Update(double delta); - void RenderFrame(); void Render(SDL_Surface* const); //Event handlers @@ -79,7 +74,6 @@ protected: //UI Button backButton; - FrameRate fps; //auto return std::chrono::steady_clock::time_point startTick; diff --git a/server/server_application.cpp b/server/server_application.cpp index 5ba1acd..8be21db 100644 --- a/server/server_application.cpp +++ b/server/server_application.cpp @@ -138,7 +138,7 @@ void ServerApplication::Init(int argc, char** argv) { } void ServerApplication::Proc() { - SerialPacket* packetBuffer = static_cast(malloc(MAX_PACKET_SIZE)); + SerialPacket* packetBuffer = reinterpret_cast(new char[MAX_PACKET_SIZE]); while(running) { //suck in the waiting packets & process them while(network.Receive(packetBuffer)) { @@ -150,7 +150,7 @@ void ServerApplication::Proc() { //give the computer a break SDL_Delay(10); } - free(static_cast(packetBuffer)); + delete packetBuffer; } void ServerApplication::Quit() { diff --git a/todo.txt b/todo.txt index 66189df..38b4594 100644 --- a/todo.txt +++ b/todo.txt @@ -3,6 +3,7 @@ TODO: Get the rooms working TODO: A proper logging system TODO: Move the statistics into their own SQL table, instead of duplicating the structure a dozen times +TODO: Fix shoddy movement TODO: make the whole thing more fault tolerant TODO: Authentication TODO: server is slaved to the client