Connection and disconnection are working correctly

I've dummied out the player code, so only the client connection code is
working. Otherwise the protocol hasn't changed.

I've also made a few other tweaks as I went along, but nothing really
major.
This commit is contained in:
Kayne Ruse
2014-03-04 02:46:19 +11:00
parent 7bb5e8ce0d
commit 756d4e770d
5 changed files with 99 additions and 95 deletions
+14 -17
View File
@@ -31,12 +31,13 @@
#include "SDL/SDL.h"
//misc
#include "client_manager.hpp"
#include "player_manager.hpp"
//common
#include "config_utility.hpp"
#include "vector2.hpp"
#include "client.hpp"
#include "player.hpp"
//STL
#include <map>
#include <string>
@@ -45,8 +46,8 @@
class ServerApplication {
public:
//standard functions
ServerApplication();
~ServerApplication();
ServerApplication() = default;
~ServerApplication() = default;
void Init(int argc, char** argv);
void Loop();
@@ -59,13 +60,11 @@ private:
void HandleBroadcastRequest(NetworkPacket);
void HandleJoinRequest(NetworkPacket);
void HandleDisconnect(NetworkPacket);
void HandleSynchronize(NetworkPacket);
// void HandleSynchronize(NetworkPacket);
void HandleShutdown(NetworkPacket);
void HandlePlayerNew(NetworkPacket);
void HandlePlayerDelete(NetworkPacket);
void HandlePlayerUpdate(NetworkPacket);
void PumpPacket(NetworkPacket);
// void HandlePlayerNew(NetworkPacket);
// void HandlePlayerDelete(NetworkPacket);
// void HandlePlayerUpdate(NetworkPacket);
//networking
UDPNetworkUtility network;
@@ -73,16 +72,14 @@ private:
//database
sqlite3* database = nullptr;
//lua
//TODO
//misc
bool running = true;
ConfigUtility config;
//global lists
ClientMap clientMap;
PlayerMap playerMap;
int clientCounter = 0;
int playerCounter = 0;
ClientManager clientMgr;
};
#endif