Initial submit

This commit is contained in:
Torsten Schulz
2017-07-18 23:51:56 +02:00
parent 071d70ecf6
commit 26ab29859d
13 changed files with 535 additions and 68 deletions

View File

@@ -1,17 +1,34 @@
#ifndef YP_LIB_SERVER_H
#define YP_LIB_SERVER_H
#include "config.h"
#include <vector>
#include "room.h"
#include <json/value.h>
namespace Yp {
namespace Lib {
namespace Yc {
namespace Lib {
class Server
{
public:
Server();
};
class Server
{
public:
Server(Yc::Lib::Config *config);
void run();
std::vector<std::string> roomList();
Json::Value jsonRoomList();
private:
int _socket;
Yc::Lib::Config *_config;
bool _stop;
std::vector<Yc::Lib::Room*> _rooms;
void createRooms(Json::Value roomList);
void handleRequest();
void inputSwitcher(int userSocket, std::string input);
bool userExists(std::string userName);
void initUser(int userSocket, Json::Value data);
};
} // namespace Lib
} // namespace Lib
} // namespace Yp
#endif // YP_LIB_SERVER_H
#endif // YP_LIB_SERVER_H