forked from SantiSev/jazz-jackrabbit-2-remake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.h
36 lines (27 loc) · 840 Bytes
/
server.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
#ifndef TP_FINAL_SERVER_H
#define TP_FINAL_SERVER_H
#include <iostream>
#include <string>
#include <utility>
#include "game_logic/matches_manager.h"
#include "protocol/accepter.h"
#define QUIT "q"
class Server {
private:
ServerAccepter* accepter;
public:
// Constructor of the Server class, initializes the protocol and receives the port as a
// parameter to create the socket
explicit Server(const std::string& port);
// cant copy or move
Server(const Server&) = delete;
Server& operator=(const Server&) = delete;
Server(Server&&) = delete;
Server& operator=(Server&&) = delete;
// Run the server, creates and throws two threads, the accepter and the gameloop (logic of the
// game), then waits for the user to close the server
void run();
// Destroyer
~Server();
};
#endif