Initial submit
This commit is contained in:
42
user.h
42
user.h
@@ -1,17 +1,43 @@
|
||||
#ifndef YC_LIB_USER_H
|
||||
#define YC_LIB_USER_H
|
||||
|
||||
#include <string>
|
||||
#include <json/json.h>
|
||||
|
||||
namespace Yc {
|
||||
namespace Lib {
|
||||
namespace Lib {
|
||||
|
||||
class User
|
||||
{
|
||||
public:
|
||||
User();
|
||||
};
|
||||
class Room;
|
||||
|
||||
} // namespace Lib
|
||||
class User {
|
||||
public:
|
||||
enum MsgType {
|
||||
token = 1,
|
||||
userListe = 2,
|
||||
roomList = 3,
|
||||
message = 4,
|
||||
system = 5
|
||||
};
|
||||
|
||||
User(Room *parent, std::string name, std::string color, int socket);
|
||||
std::string name() const;
|
||||
bool validateToken(std::string token);
|
||||
bool isUser(User *toValidate);
|
||||
void sendMsg(MsgType type, std::string message, std::string userName, std::string color);
|
||||
void sendMsg(MsgType type, Json::Value message, std::string userName, std::string color);
|
||||
void checkerTask();
|
||||
void stop();
|
||||
std::string color() const;
|
||||
private:
|
||||
Room *_parent;
|
||||
std::string _name;
|
||||
std::string _color;
|
||||
int _socket;
|
||||
std::string _token;
|
||||
bool _stop;
|
||||
};
|
||||
|
||||
} // namespace Lib
|
||||
} // namespace Yc
|
||||
|
||||
#endif // YC_LIB_USER_H
|
||||
#endif // YC_LIB_USER_H
|
||||
|
||||
Reference in New Issue
Block a user