summaryrefslogtreecommitdiff
path: root/server/lobby.h
blob: fa0e5feafb77004ee63105c035308936914f1fb2 (plain)
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
#ifndef LOBBY_H
#define LOBBY_H

#include <boost/asio.hpp>

#include <vector>

#include "tcpserver.h"
#include "client.h"

class Lobby {
	private:
		boost::asio::io_service io_service;
		TCPServer server;
		
		std::vector<Client::p> waiting;
		
		//! Handle new connection.
		void handle_connect(Connection::p connection);
		
		//! Handle login.
		void handle_login(Client::p client);
		
		//! Handle action.
		void handle_action(Client::p client, int game_mode);
	
	public:
		Lobby();
		
		void run();
};

#endif