Room change, room list with flags
This commit is contained in:
11
room.h
11
room.h
@@ -22,7 +22,8 @@ namespace Yc {
|
||||
none = 0,
|
||||
dice = 1,
|
||||
poker = 2,
|
||||
rounds = 4
|
||||
rounds = 4,
|
||||
password = 8
|
||||
};
|
||||
|
||||
Room(Server *parent, Json::Value roomParams);
|
||||
@@ -32,7 +33,8 @@ namespace Yc {
|
||||
bool addUser(std::string userName, std::string color, std::string password, int socket);
|
||||
bool addUser(User *user, std::string password);
|
||||
bool userNameExists(std::string userName);
|
||||
void removeUser(std::string _token);
|
||||
void removeUser(std::string _token, bool silent = false);
|
||||
void removeUser(User *user, bool silent = false);
|
||||
void setStop();
|
||||
void addMessage(User::MsgType type, const char* messageText, std::string userName = "", std::string color = "");
|
||||
void addMessage(User::MsgType type, std::string messageText, std::string userName = "", std::string color = "");
|
||||
@@ -42,6 +44,10 @@ namespace Yc {
|
||||
bool canDice();
|
||||
unsigned int addDice(User *user, int diceValue);
|
||||
bool accessAllowed(std::string userName, std::string password);
|
||||
bool userIsInRoom(std::string userName);
|
||||
void addUserWhenQueueEmpty(User *user);
|
||||
bool userToNewRoom(User *user, std::string newRoom, std::string password);
|
||||
unsigned int flags();
|
||||
private:
|
||||
struct Message {
|
||||
User::MsgType type;
|
||||
@@ -65,6 +71,7 @@ namespace Yc {
|
||||
time_t _lastRoundEnd;
|
||||
int _roundLength;
|
||||
std::vector<std::pair<User *, int>> _diceValues;
|
||||
std::mutex mutexQueue;
|
||||
void _handleDice();
|
||||
void _startDiceRound();
|
||||
void _endDiceRound();
|
||||
|
||||
Reference in New Issue
Block a user