TrinityCore
cs_server.cpp
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/* ScriptData
19Name: server_commandscript
20%Complete: 100
21Comment: All server related commands
22Category: commandscripts
23EndScriptData */
24
25#include "ScriptMgr.h"
26#include "Chat.h"
27#include "ChatCommand.h"
28#include "Config.h"
29#include "DatabaseEnv.h"
30#include "DatabaseLoader.h"
31#include "GameTime.h"
32#include "GitRevision.h"
33#include "Language.h"
34#include "Log.h"
35#include "MySQLThreading.h"
36#include "RBAC.h"
37#include "Realm.h"
38#include "UpdateTime.h"
39#include "Util.h"
40#include "VMapFactory.h"
41#include "VMapManager2.h"
42#include "World.h"
43#include "WorldSession.h"
44#include <boost/filesystem/operations.hpp>
45#include <openssl/crypto.h>
46#include <openssl/opensslv.h>
47#include <numeric>
48
49#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
50#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
51#endif
52
54{
55public:
56 server_commandscript() : CommandScript("server_commandscript") { }
57
58 std::vector<ChatCommand> GetCommands() const override
59 {
60 static std::vector<ChatCommand> serverIdleRestartCommandTable =
61 {
64 };
65
66 static std::vector<ChatCommand> serverIdleShutdownCommandTable =
67 {
70 };
71
72 static std::vector<ChatCommand> serverRestartCommandTable =
73 {
77 };
78
79 static std::vector<ChatCommand> serverShutdownCommandTable =
80 {
84 };
85
86 static std::vector<ChatCommand> serverSetCommandTable =
87 {
91 };
92
93 static std::vector<ChatCommand> serverCommandTable =
94 {
98 { "idlerestart", rbac::RBAC_PERM_COMMAND_SERVER_IDLERESTART, true, nullptr, "", serverIdleRestartCommandTable },
99 { "idleshutdown", rbac::RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN, true, nullptr, "", serverIdleShutdownCommandTable },
103 { "restart", rbac::RBAC_PERM_COMMAND_SERVER_RESTART, true, nullptr, "", serverRestartCommandTable },
104 { "shutdown", rbac::RBAC_PERM_COMMAND_SERVER_SHUTDOWN, true, nullptr, "", serverShutdownCommandTable },
105 { "set", rbac::RBAC_PERM_COMMAND_SERVER_SET, true, nullptr, "", serverSetCommandTable },
106 };
107
108 static std::vector<ChatCommand> commandTable =
109 {
110 { "server", rbac::RBAC_PERM_COMMAND_SERVER, true, nullptr, "", serverCommandTable },
111 };
112 return commandTable;
113 }
114
115 // Triggering corpses expire check in world
116 static bool HandleServerCorpsesCommand(ChatHandler* /*handler*/, char const* /*args*/)
117 {
118 sWorld->RemoveOldCorpses();
119 return true;
120 }
121
122 static bool HandleServerDebugCommand(ChatHandler* handler, char const* /*args*/)
123 {
124 std::string dbPortOutput;
125
126 uint16 dbPort = 0;
127 if (QueryResult res = LoginDatabase.PQuery("SELECT port FROM realmlist WHERE id = {}", realm.Id.Realm))
128 dbPort = (*res)[0].GetUInt16();
129
130 if (dbPort)
131 dbPortOutput = Trinity::StringFormat("Realmlist (Realm Id: {}) configured in port {}", realm.Id.Realm, dbPort);
132 else
133 dbPortOutput = Trinity::StringFormat("Realm Id: {} not found in `realmlist` table. Please check your setup", realm.Id.Realm);
134
136 handler->PSendSysMessage("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
137 handler->PSendSysMessage("Using Boost version: %i.%i.%i", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
138 handler->PSendSysMessage("Using MySQL version: %u", MySQL::GetLibraryVersion());
139 handler->PSendSysMessage("Using CMake version: %s", GitRevision::GetCMakeVersion());
140
141 handler->PSendSysMessage("Compiled on: %s", GitRevision::GetHostOSVersion());
142
143 uint32 updateFlags = sConfigMgr->GetIntDefault("Updates.EnableDatabases", DatabaseLoader::DATABASE_NONE);
144 if (!updateFlags)
145 handler->SendSysMessage("Automatic database updates are disabled for all databases!");
146 else
147 {
148 static char const* const databaseNames[] =
149 {
150 "Auth",
151 "Characters",
152 "World",
153 "Hotfixes"
154 };
155 static size_t constexpr databaseCount = std::extent<decltype(databaseNames)>::value;
156
157 std::string availableUpdateDatabases;
158 for (uint32 i = 0; i < databaseCount; ++i)
159 {
160 if (!(updateFlags & (1 << i)))
161 continue;
162
163 availableUpdateDatabases += databaseNames[i];
164 if (i != databaseCount - 1)
165 availableUpdateDatabases += ", ";
166 }
167
168 handler->PSendSysMessage("Automatic database updates are enabled for the following databases: %s", availableUpdateDatabases.c_str());
169 }
170
171 handler->PSendSysMessage("Worldserver listening connections on port %u", sWorld->getIntConfig(CONFIG_PORT_WORLD));
172 handler->PSendSysMessage("%s", dbPortOutput.c_str());
173
174 bool vmapIndoorCheck = sWorld->getBoolConfig(CONFIG_VMAP_INDOOR_CHECK);
177
178 bool mmapEnabled = sWorld->getBoolConfig(CONFIG_ENABLE_MMAPS);
179
180 std::string dataDir = sWorld->GetDataPath();
181 std::vector<std::string> subDirs;
182 subDirs.emplace_back("maps");
183 if (vmapIndoorCheck || vmapLOSCheck || vmapHeightCheck)
184 {
185 handler->PSendSysMessage("VMAPs status: Enabled. LineOfSight: %i, getHeight: %i, indoorCheck: %i", vmapLOSCheck, vmapHeightCheck, vmapIndoorCheck);
186 subDirs.emplace_back("vmaps");
187 }
188 else
189 handler->SendSysMessage("VMAPs status: Disabled");
190
191 if (mmapEnabled)
192 {
193 handler->SendSysMessage("MMAPs status: Enabled");
194 subDirs.emplace_back("mmaps");
195 }
196 else
197 handler->SendSysMessage("MMAPs status: Disabled");
198
199 for (std::string const& subDir : subDirs)
200 {
201 boost::filesystem::path mapPath(dataDir);
202 mapPath /= subDir;
203
204 if (!boost::filesystem::exists(mapPath))
205 {
206 handler->PSendSysMessage("%s directory doesn't exist!. Using path: %s", subDir.c_str(), mapPath.generic_string().c_str());
207 continue;
208 }
209
210 auto end = boost::filesystem::directory_iterator();
211 std::size_t folderSize = std::accumulate(boost::filesystem::directory_iterator(mapPath), end, std::size_t(0), [](std::size_t val, boost::filesystem::path const& mapFile)
212 {
213 boost::system::error_code ec;
214 if (boost::filesystem::is_regular_file(mapFile, ec))
215 val += boost::filesystem::file_size(mapFile);
216 return val;
217 });
218
219 handler->PSendSysMessage("%s directory located in %s. Total size: " SZFMTD " bytes", subDir.c_str(), mapPath.generic_string().c_str(), folderSize);
220 }
221
222 LocaleConstant defaultLocale = sWorld->GetDefaultDbcLocale();
223 uint32 availableLocalesMask = (1 << defaultLocale);
224
225 for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
226 {
227 LocaleConstant locale = static_cast<LocaleConstant>(i);
228 if (locale == defaultLocale)
229 continue;
230
231 if (sWorld->GetAvailableDbcLocale(locale) != defaultLocale)
232 availableLocalesMask |= (1 << locale);
233 }
234
235 std::string availableLocales;
236 for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
237 {
238 if (!(availableLocalesMask & (1 << i)))
239 continue;
240
241 availableLocales += localeNames[i];
242 if (i != TOTAL_LOCALES - 1)
243 availableLocales += " ";
244 }
245
246 handler->PSendSysMessage("Using %s DBC Locale as default. All available DBC locales: %s", localeNames[defaultLocale], availableLocales.c_str());
247
248 handler->PSendSysMessage("Using World DB: %s", sWorld->GetDBVersion());
249
250 handler->PSendSysMessage("LoginDatabase queue size: %zu", LoginDatabase.QueueSize());
251 handler->PSendSysMessage("CharacterDatabase queue size: %zu", CharacterDatabase.QueueSize());
252 handler->PSendSysMessage("WorldDatabase queue size: %zu", WorldDatabase.QueueSize());
253 return true;
254 }
255
256 static bool HandleServerInfoCommand(ChatHandler* handler, char const* /*args*/)
257 {
258 uint32 playersNum = sWorld->GetPlayerCount();
259 uint32 maxPlayersNum = sWorld->GetMaxPlayerCount();
260 uint32 activeClientsNum = sWorld->GetActiveSessionCount();
261 uint32 queuedClientsNum = sWorld->GetQueuedSessionCount();
262 uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount();
263 uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount();
264 std::string uptime = secsToTimeString(GameTime::GetUptime());
266
268 handler->PSendSysMessage(LANG_CONNECTED_PLAYERS, playersNum, maxPlayersNum);
269 handler->PSendSysMessage(LANG_CONNECTED_USERS, activeClientsNum, maxActiveClientsNum, queuedClientsNum, maxQueuedClientsNum);
270 handler->PSendSysMessage(LANG_UPTIME, uptime.c_str());
271 handler->PSendSysMessage(LANG_UPDATE_DIFF, updateTime);
272 // Can't use sWorld->ShutdownMsg here in case of console command
273 if (sWorld->IsShuttingDown())
274 handler->PSendSysMessage(LANG_SHUTDOWN_TIMELEFT, secsToTimeString(sWorld->GetShutDownTimeLeft()).c_str());
275
276 return true;
277 }
278 // Display the 'Message of the day' for the realm
279 static bool HandleServerMotdCommand(ChatHandler* handler, char const* /*args*/)
280 {
281 std::string motd;
282 for (std::string const& line : sWorld->GetMotd())
283 motd += line;
284 handler->PSendSysMessage(LANG_MOTD_CURRENT, motd.c_str());
285 return true;
286 }
287
288 static bool HandleServerPLimitCommand(ChatHandler* handler, char const* args)
289 {
290 if (*args)
291 {
292 char* paramStr = strtok((char*)args, " ");
293 if (!paramStr)
294 return false;
295
296 int32 limit = strlen(paramStr);
297
298 if (strncmp(paramStr, "player", limit) == 0)
299 sWorld->SetPlayerSecurityLimit(SEC_PLAYER);
300 else if (strncmp(paramStr, "moderator", limit) == 0)
301 sWorld->SetPlayerSecurityLimit(SEC_MODERATOR);
302 else if (strncmp(paramStr, "gamemaster", limit) == 0)
303 sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER);
304 else if (strncmp(paramStr, "administrator", limit) == 0)
305 sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
306 else if (strncmp(paramStr, "reset", limit) == 0)
307 {
308 sWorld->SetPlayerAmountLimit(sConfigMgr->GetIntDefault("PlayerLimit", 100));
309 sWorld->LoadDBAllowedSecurityLevel();
310 }
311 else
312 {
313 int32 value = atoi(paramStr);
314 if (value < 0)
315 sWorld->SetPlayerSecurityLimit(AccountTypes(-value));
316 else
317 sWorld->SetPlayerAmountLimit(uint32(value));
318 }
319 }
320
321 uint32 playerAmountLimit = sWorld->GetPlayerAmountLimit();
322 AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
323 char const* secName = "";
324 switch (allowedAccountType)
325 {
326 case SEC_PLAYER:
327 secName = "Player";
328 break;
329 case SEC_MODERATOR:
330 secName = "Moderator";
331 break;
332 case SEC_GAMEMASTER:
333 secName = "Gamemaster";
334 break;
336 secName = "Administrator";
337 break;
338 default:
339 secName = "<unknown>";
340 break;
341 }
342 handler->PSendSysMessage("Player limits: amount %u, min. security level %s.", playerAmountLimit, secName);
343
344 return true;
345 }
346
347 static bool HandleServerShutDownCancelCommand(ChatHandler* handler, char const* /*args*/)
348 {
349 if (uint32 timer = sWorld->ShutdownCancel())
351
352 return true;
353 }
354
355 static bool IsOnlyUser(WorldSession* mySession)
356 {
357 // check if there is any session connected from a different address
358 std::string myAddr = mySession ? mySession->GetRemoteAddress() : "";
359 SessionMap const& sessions = sWorld->GetAllSessions();
360 for (SessionMap::value_type const& session : sessions)
361 if (session.second && myAddr != session.second->GetRemoteAddress())
362 return false;
363 return true;
364 }
365 static bool HandleServerShutDownCommand(ChatHandler* handler, char const* args)
366 {
367 return ShutdownServer(handler, args, 0, SHUTDOWN_EXIT_CODE);
368 }
369
370 static bool HandleServerRestartCommand(ChatHandler* handler, char const* args)
371 {
373 }
374
375 static bool HandleServerForceShutDownCommand(ChatHandler* handler, char const* args)
376 {
378 }
379
380 static bool HandleServerForceRestartCommand(ChatHandler* handler, char const* args)
381 {
383 }
384
385 static bool HandleServerIdleShutDownCommand(ChatHandler* handler, char const* args)
386 {
388 }
389
390 static bool HandleServerIdleRestartCommand(ChatHandler* handler, char const* args)
391 {
393 }
394
395 // Exit the realm
396 static bool HandleServerExitCommand(ChatHandler* handler, char const* /*args*/)
397 {
400 return true;
401 }
402
403 // Define the 'Message of the day' for the realm
404 static bool HandleServerSetMotdCommand(ChatHandler* handler, char const* args)
405 {
406 sWorld->SetMotd(args);
407 handler->PSendSysMessage(LANG_MOTD_NEW, args);
408 return true;
409 }
410
411 // Set whether we accept new clients
412 static bool HandleServerSetClosedCommand(ChatHandler* handler, char const* args)
413 {
414 if (strncmp(args, "on", 3) == 0)
415 {
417 sWorld->SetClosed(true);
418 return true;
419 }
420 else if (strncmp(args, "off", 4) == 0)
421 {
423 sWorld->SetClosed(false);
424 return true;
425 }
426
428 handler->SetSentErrorMessage(true);
429 return false;
430 }
431
432 // Set the level of logging
433 static bool HandleServerSetLogLevelCommand(ChatHandler* /*handler*/, std::string const& type, std::string const& name, int32 level)
434 {
435 if (name.empty() || level < 0 || (type != "a" && type != "l"))
436 return false;
437
438 sLog->SetLogLevel(name, level, type == "l");
439 return true;
440 }
441
442private:
443 static bool ParseExitCode(char const* exitCodeStr, int32& exitCode)
444 {
445 exitCode = atoi(exitCodeStr);
446
447 // Handle atoi() errors
448 if (exitCode == 0 && (exitCodeStr[0] != '0' || exitCodeStr[1] != '\0'))
449 return false;
450
451 // Exit code should be in range of 0-125, 126-255 is used
452 // in many shells for their own return codes and code > 255
453 // is not supported in many others
454 if (exitCode < 0 || exitCode > 125)
455 return false;
456
457 return true;
458 }
459
460 static bool ShutdownServer(ChatHandler* handler, char const* args, uint32 shutdownMask, int32 defaultExitCode)
461 {
462 if (!*args)
463 return false;
464
465 if (strlen(args) > 255)
466 return false;
467
468 // #delay [#exit_code] [reason]
469 int32 delay = 0;
470 char* delayStr = strtok((char*)args, " ");
471 if (!delayStr)
472 return false;
473
474 if (isNumeric(delayStr))
475 {
476 delay = atoi(delayStr);
477 // Prevent interpret wrong arg value as 0 secs shutdown time
478 if ((delay == 0 && (delayStr[0] != '0' || delayStr[1] != '\0')) || delay < 0)
479 return false;
480 }
481 else
482 {
483 delay = TimeStringToSecs(std::string(delayStr));
484
485 if (delay == 0)
486 return false;
487 }
488
489 char* exitCodeStr = nullptr;
490
491 char reason[256] = { 0 };
492
493 while (char* nextToken = strtok(nullptr, " "))
494 {
495 if (isNumeric(nextToken))
496 exitCodeStr = nextToken;
497 else
498 {
499 strcat(reason, nextToken);
500 if (char* remainingTokens = strtok(nullptr, "\0"))
501 {
502 strcat(reason, " ");
503 strcat(reason, remainingTokens);
504 }
505 break;
506 }
507 }
508
509 int32 exitCode = defaultExitCode;
510 if (exitCodeStr)
511 if (!ParseExitCode(exitCodeStr, exitCode))
512 return false;
513
514 // Override parameter "delay" with the configuration value if there are still players connected and "force" parameter was not specified
515 if (delay < (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD) && !(shutdownMask & SHUTDOWN_MASK_FORCE) && !IsOnlyUser(handler->GetSession()))
516 {
517 delay = (int32)sWorld->getIntConfig(CONFIG_FORCE_SHUTDOWN_THRESHOLD);
518 handler->PSendSysMessage(LANG_SHUTDOWN_DELAYED, delay);
519 }
520
521 sWorld->ShutdownServ(delay, shutdownMask, static_cast<uint8>(exitCode), std::string(reason));
522
523 return true;
524 }
525};
526
528{
530}
char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:20
LocaleConstant
Definition: Common.h:48
@ TOTAL_LOCALES
Definition: Common.h:62
AccountTypes
Definition: Common.h:39
@ SEC_PLAYER
Definition: Common.h:40
@ SEC_ADMINISTRATOR
Definition: Common.h:43
@ SEC_GAMEMASTER
Definition: Common.h:42
@ SEC_MODERATOR
Definition: Common.h:41
#define sConfigMgr
Definition: Config.h:61
std::shared_ptr< ResultSet > QueryResult
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
uint8_t uint8
Definition: Define.h:144
int32_t int32
Definition: Define.h:138
uint16_t uint16
Definition: Define.h:143
uint32_t uint32
Definition: Define.h:142
#define SZFMTD
Definition: Define.h:132
@ LANG_MOTD_CURRENT
Definition: Language.h:88
@ LANG_UPDATE_DIFF
Definition: Language.h:51
@ LANG_SHUTDOWN_DELAYED
Definition: Language.h:1239
@ LANG_COMMAND_EXIT
Definition: Language.h:834
@ LANG_USE_BOL
Definition: Language.h:310
@ LANG_CONNECTED_USERS
Definition: Language.h:44
@ LANG_SHUTDOWN_CANCELLED
Definition: Language.h:1240
@ LANG_WORLD_CLOSED
Definition: Language.h:1175
@ LANG_UPTIME
Definition: Language.h:45
@ LANG_MOTD_NEW
Definition: Language.h:874
@ LANG_WORLD_OPENED
Definition: Language.h:1176
@ LANG_CONNECTED_PLAYERS
Definition: Language.h:92
@ LANG_SHUTDOWN_TIMELEFT
Definition: Language.h:52
#define sLog
Definition: Log.h:130
Role Based Access Control related classes definition.
WorldUpdateTime sWorldUpdateTime
Definition: UpdateTime.cpp:21
std::string secsToTimeString(uint64 timeInSecs, TimeFormat timeFormat, bool hoursOnly)
Definition: Util.cpp:115
uint32 TimeStringToSecs(std::string const &timestring)
Definition: Util.cpp:258
bool isNumeric(wchar_t wchar)
Definition: Util.h:189
WorldSession * GetSession()
Definition: Chat.h:42
void PSendSysMessage(const char *fmt, Args &&... args)
Definition: Chat.h:57
void SetSentErrorMessage(bool val)
Definition: Chat.h:114
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:113
uint32 GetLastUpdateTime() const
Definition: UpdateTime.cpp:28
bool isHeightCalcEnabled() const
Definition: IVMapManager.h:114
bool isLineOfSightCalcEnabled() const
Definition: IVMapManager.h:113
static VMapManager2 * createOrGetVMapManager()
Definition: VMapFactory.cpp:27
Player session in the World.
Definition: WorldSession.h:963
std::string const & GetRemoteAddress() const
static void StopNow(uint8 exitcode)
Definition: World.h:670
static bool ShutdownServer(ChatHandler *handler, char const *args, uint32 shutdownMask, int32 defaultExitCode)
Definition: cs_server.cpp:460
static bool HandleServerForceShutDownCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:375
static bool HandleServerDebugCommand(ChatHandler *handler, char const *)
Definition: cs_server.cpp:122
static bool HandleServerSetMotdCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:404
static bool HandleServerExitCommand(ChatHandler *handler, char const *)
Definition: cs_server.cpp:396
static bool HandleServerCorpsesCommand(ChatHandler *, char const *)
Definition: cs_server.cpp:116
static bool HandleServerShutDownCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:365
static bool HandleServerForceRestartCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:380
static bool HandleServerPLimitCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:288
static bool HandleServerIdleShutDownCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:385
static bool HandleServerSetLogLevelCommand(ChatHandler *, std::string const &type, std::string const &name, int32 level)
Definition: cs_server.cpp:433
std::vector< ChatCommand > GetCommands() const override
Definition: cs_server.cpp:58
static bool HandleServerMotdCommand(ChatHandler *handler, char const *)
Definition: cs_server.cpp:279
static bool IsOnlyUser(WorldSession *mySession)
Definition: cs_server.cpp:355
static bool HandleServerRestartCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:370
static bool HandleServerIdleRestartCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:390
static bool HandleServerSetClosedCommand(ChatHandler *handler, char const *args)
Definition: cs_server.cpp:412
static bool ParseExitCode(char const *exitCodeStr, int32 &exitCode)
Definition: cs_server.cpp:443
static bool HandleServerInfoCommand(ChatHandler *handler, char const *)
Definition: cs_server.cpp:256
static bool HandleServerShutDownCancelCommand(ChatHandler *handler, char const *)
Definition: cs_server.cpp:347
void AddSC_server_commandscript()
Definition: cs_server.cpp:527
#define sWorld
Definition: World.h:931
std::unordered_map< uint32, WorldSession * > SessionMap
Definition: World.h:559
Realm realm
Definition: World.cpp:3966
@ CONFIG_FORCE_SHUTDOWN_THRESHOLD
Definition: World.h:294
@ CONFIG_PORT_WORLD
Definition: World.h:239
@ CONFIG_ENABLE_MMAPS
Definition: World.h:168
@ CONFIG_VMAP_INDOOR_CHECK
Definition: World.h:145
@ RESTART_EXIT_CODE
Definition: World.h:76
@ SHUTDOWN_EXIT_CODE
Definition: World.h:74
@ SHUTDOWN_MASK_RESTART
Definition: World.h:67
@ SHUTDOWN_MASK_FORCE
Definition: World.h:69
@ SHUTDOWN_MASK_IDLE
Definition: World.h:68
uint32 GetUptime()
Uptime (in secs)
Definition: GameTime.cpp:82
TC_COMMON_API char const * GetCMakeVersion()
Definition: GitRevision.cpp:41
TC_COMMON_API char const * GetHostOSVersion()
Definition: GitRevision.cpp:46
TC_COMMON_API char const * GetFullVersion()
Definition: GitRevision.cpp:96
TC_DATABASE_API uint32 GetLibraryVersion()
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default TC string format function.
Definition: StringFormat.h:38
@ RBAC_PERM_COMMAND_SERVER_SHUTDOWN_FORCE
Definition: RBAC.h:710
@ RBAC_PERM_COMMAND_SERVER_SHUTDOWN
Definition: RBAC.h:606
@ RBAC_PERM_COMMAND_SERVER_SET_LOGLEVEL
Definition: RBAC.h:604
@ RBAC_PERM_COMMAND_SERVER_RESTART_CANCEL
Definition: RBAC.h:600
@ RBAC_PERM_COMMAND_SERVER_SET
Definition: RBAC.h:601
@ RBAC_PERM_COMMAND_SERVER_EXIT
Definition: RBAC.h:592
@ RBAC_PERM_COMMAND_SERVER_RESTART
Definition: RBAC.h:599
@ RBAC_PERM_COMMAND_SERVER_PLIMIT
Definition: RBAC.h:598
@ RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN_CANCEL
Definition: RBAC.h:596
@ RBAC_PERM_COMMAND_SERVER_SHUTDOWN_CANCEL
Definition: RBAC.h:607
@ RBAC_PERM_COMMAND_SERVER_IDLERESTART_CANCEL
Definition: RBAC.h:594
@ RBAC_PERM_COMMAND_SERVER
Definition: RBAC.h:590
@ RBAC_PERM_COMMAND_SERVER_MOTD
Definition: RBAC.h:608
@ RBAC_PERM_COMMAND_SERVER_SET_CLOSED
Definition: RBAC.h:602
@ RBAC_PERM_COMMAND_SERVER_SET_MOTD
Definition: RBAC.h:605
@ RBAC_PERM_COMMAND_SERVER_INFO
Definition: RBAC.h:597
@ RBAC_PERM_COMMAND_SERVER_IDLERESTART
Definition: RBAC.h:593
@ RBAC_PERM_COMMAND_SERVER_RESTART_FORCE
Definition: RBAC.h:711
@ RBAC_PERM_COMMAND_SERVER_IDLESHUTDOWN
Definition: RBAC.h:595
@ RBAC_PERM_COMMAND_SERVER_DEBUG
Definition: RBAC.h:741
@ RBAC_PERM_COMMAND_SERVER_CORPSES
Definition: RBAC.h:591
Battlenet::RealmHandle Id
Definition: Realm.h:82