Multiple changes, read more

* Implemented HeartbeatUtility
* simplified the SQL files
* Added a dummy inventory button
This commit is contained in:
2016-04-25 22:10:11 +10:00
parent 5285397101
commit 7c6468c1dd
10 changed files with 259 additions and 145 deletions
+3 -9
View File
@@ -43,6 +43,7 @@
#include "base_scene.hpp"
#include "base_barrier.hpp"
#include "base_creature.hpp"
#include "heartbeat_utility.hpp"
#include "local_character.hpp"
#include "SDL2/SDL.h"
@@ -80,12 +81,6 @@ private:
//handle incoming traffic
void HandlePacket(SerialPacket* const);
//heartbeat system
void hPing(ServerPacket* const);
void hPong(ServerPacket* const);
void CheckHeartBeat();
//basic connections
void SendLogoutRequest();
void SendDisconnectRequest();
@@ -148,6 +143,7 @@ private:
TTF_Font* font = nullptr;
Button disconnectButton;
Button shutdownButton;
Button inventoryButton;
FrameRate fps;
TextLine fpsTextLine;
@@ -165,11 +161,9 @@ private:
LocalCharacter* localCharacter = nullptr;
//heartbeat
//TODO: (2) Heartbeat needs it's own utility
HeartbeatUtility heartbeatUtility;
typedef std::chrono::steady_clock Clock;
Clock::time_point lastBeat = Clock::now();
Clock::time_point queryTime = Clock::now() - std::chrono::seconds(4); //back 4 seconds to trigger automatically
int attemptedBeats = 0;
//ugly references; I hate this
ConfigUtility& config = ConfigUtility::GetSingleton();