/
polcfg.h
127 lines (110 loc) · 3.27 KB
/
polcfg.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/** @file
*
* @par History
* - 2007/06/17 Shinigami: added config.world_data_path
* - 2009/12/02 Turley: added MaxTileID -Tomi
* - 2009/12/04 Turley: cleanup "MasterKey1","MasterKey2","ClientVersion","KeyFile" - Tomi
* - 2010/02/04 Turley: polcfg.discard_old_events discards oldest event if queue is full
*/
#ifndef POLCFG_H
#define POLCFG_H
#include <atomic>
#include <string>
#include <vector>
#if !defined( _WIN32 )
#include <sys/stat.h>
#include <sys/types.h>
#endif
namespace Pol
{
namespace Core
{
struct PolConfig
{
std::string uo_datafile_root;
std::string world_data_path;
std::string realm_data_path;
std::string pidfile_path;
std::atomic<bool> verbose;
std::atomic<unsigned short> loglevel; // 0=nothing 10=lots
unsigned short select_timeout_usecs;
unsigned short loginserver_timeout_mins;
bool watch_rpm;
bool watch_sysload;
bool log_sysload;
bool watch_mapcache;
bool check_integrity;
bool inhibit_saves;
bool log_script_cycles;
bool count_resource_tiles;
bool web_server;
unsigned short web_server_port;
bool web_server_local_only;
unsigned short web_server_debug;
std::string web_server_password;
bool profile_cprops;
bool cache_interactive_scripts;
bool show_speech_colors;
bool require_spellbooks;
bool enable_secure_trading;
unsigned int runaway_script_threshold;
bool ignore_load_errors;
std::atomic<unsigned short> min_cmdlvl_ignore_inactivity;
std::atomic<unsigned short> inactivity_warning_timeout;
std::atomic<unsigned short> inactivity_disconnect_timeout;
std::atomic<unsigned short> min_cmdlevel_to_login;
unsigned short max_tile_id;
unsigned int max_objtype;
unsigned short max_anim_id;
unsigned short max_clients;
unsigned short character_slots;
unsigned short max_clients_bypass_cmdlevel;
bool allow_multi_clients_per_account;
bool display_unknown_packets;
bool exp_los_checks_map;
bool enable_debug_log;
// Debugger properties must be only when initial_load is true in read_pol_config.
unsigned short debug_port;
unsigned short dap_debug_port;
std::string debug_password;
bool debug_local_only;
bool log_traces_when_stuck;
unsigned short debug_level;
bool report_rtc_scripts;
bool report_critical_scripts;
bool report_missing_configs;
bool retain_cleartext_passwords;
bool discard_old_events;
int shutdown_save_type; // either SAVE_FULL or SAVE_INCREMENTAL
int assertion_shutdown_save_type;
std::string minidump_type;
int account_save;
bool use_single_thread_login;
bool disable_nagle;
bool show_realm_info;
bool enforce_mount_objtype;
std::atomic<bool> single_thread_decay;
std::atomic<bool> thread_decay_statistics;
bool show_warning_gump;
bool show_warning_item;
bool show_warning_cursor_seq;
bool show_warning_boat_move;
/**
* @brief Returns true if program aborts are reported
*/
bool report_program_aborts();
/**
* crash reporting system with some early default values
*/
std::string report_admin_email;
std::string report_server;
std::string report_url;
std::vector<std::string> allowed_environmentvariables_access;
bool enable_colored_output;
static void read_pol_config( bool initial_load );
static struct stat pol_cfg_stat;
static void reload_pol_cfg();
};
} // namespace Core
} // namespace Pol
#endif