-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.hpp
35 lines (27 loc) · 716 Bytes
/
config.hpp
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
/**
* config.hpp
*/
#include <cstdint>
#include <functional>
#include <string>
#include <map>
#include "json.hpp"
using nlohmann::json;
namespace config {
bool debug = true;
uint16_t port = 3000;
uint64_t max_players = 256;
uint64_t max_lobbies = 16;
uint64_t max_players_per_lobby = 16;
uint16_t player_timeout = 12; // Seconds until player is forcefully disconnected
std::map<std::string, std::function<json (const json)>> game_processing = {
{"increment", [](const json message) {
json return_message = message;
json data = message.value("data", json::object());
int value = data.value("value", 0);
data["value"] = value + 1;
return_message["data"] = data;
return return_message;
}}
};
}