-
Notifications
You must be signed in to change notification settings - Fork 0
/
IRCServer.h
62 lines (47 loc) · 1.86 KB
/
IRCServer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef IRC_SERVER
#define IRC_SERVER
#define PASSWORD_FILE "password.txt"
class IRCServer {
// Add any variables you need
public:
/* typedef struct User{
char * name;
char * password;
} User;
typedef struct Chatter{
char * name;
Chatter * next;
} Chatter;
typedef struct Message{
char * msg;
char * snder;
Message * next;
} Message;
typedef struct Room{
char * roomName;
Message * start;
Chatter * inRoom;
Room * nextRoom;
} Room;
*/
private:
int open_server_socket(int port);
public:
void initialize();
bool checkPassword(int fd, const char * user, const char * password);
void processRequest( int socket );
void addUser(int fd, const char * user, const char * password, const char * args);
void enterRoom(int fd, const char * user, const char * password, const char * args);
void leaveRoom(int fd, const char * user, const char * password, const char * args);
void sendMessage(int fd, const char * user, const char * password, const char * args, const char * message);
void getMessages(int fd, const char * user, const char * password, char * args, const char * message);
void createRoom(int fd, const char * user, const char * password, const char * args);
void getMessages2(int fd, const char * user, const char * password, char * args, const char * message);
void getRooms (int fd, const char * user, const char * password, const char * args);
void getUsersInRoom(int fd, const char * user, const char * password, const char * args);
void getUsersInRoom2(int fd, const char * user, const char * password, const char * args);
void getAllUsers(int fd, const char * user, const char * password, const char * args);
void getAllUsers2(int fd, const char * user, const char * password, const char * args);
void runServer(int port);
};
#endif