Started working on multithreaded rooms

This commit is contained in:
Kayne Ruse
2013-12-08 15:55:49 +11:00
parent a448c8fb68
commit be26c9d103
7 changed files with 356 additions and 39 deletions
+13 -18
View File
@@ -34,26 +34,15 @@
#include "config_utility.hpp"
#include "vector2.hpp"
#include "client.hpp"
#include "player.hpp"
#include "world_room.hpp"
//STL
#include <map>
#include <string>
//hold the client info
struct Client {
static int counter;
IPaddress address;
};
//hold the player info
struct Player {
static int counter;
int clientIndex;
std::string handle;
std::string avatar;
Vector2 position;
Vector2 motion;
};
//The main application class
class ServerApplication {
public:
@@ -90,8 +79,14 @@ private:
bool running = true;
ConfigUtility config;
std::map<int, Client> clientMap;
std::map<int, Player> playerMap;
//global lists
ClientMap clientMap;
PlayerMap playerMap;
WorldRoomMap worldRoomMap;
int clientCounter = 0;
int playerCounter = 0;
int worldRoomCounter = 0;
};
#endif