114 {
116 std::string dbPortOutput;
117
118 {
121 dbPort = (*res)[0].Get<
uint16>();
122
123 if (dbPort)
125 else
127 }
128
130
131 handler->
PSendSysMessage(
"Using SSL version: {} (library: {})", OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION));
132 handler->
PSendSysMessage(
"Using Boost version: {}.{}.{}", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
134
137
139
140 handler->
PSendSysMessage(
"Worldserver listening connections on port %" PRIu16, worldPort);
142
146
148
149 std::string dataDir =
sWorld->GetDataPath();
150 std::vector<std::string> subDirs;
151 subDirs.emplace_back("maps");
152 if (vmapIndoorCheck || vmapLOSCheck || vmapHeightCheck)
153 {
154 handler->
PSendSysMessage(
"VMAPs status: Enabled. LineOfSight: {}, getHeight: {}, indoorCheck: {}", vmapLOSCheck, vmapHeightCheck, vmapIndoorCheck);
155 subDirs.emplace_back("vmaps");
156 }
157 else
159
160 if (mmapEnabled)
161 {
163 subDirs.emplace_back("mmaps");
164 }
165 else
167
168 for (std::string const& subDir : subDirs)
169 {
170 std::filesystem::path mapPath(dataDir);
171 mapPath /= subDir;
172
173 if (!std::filesystem::exists(mapPath))
174 {
175 handler->
PSendSysMessage(
"{} directory doesn't exist!. Using path: {}", subDir, mapPath.generic_string());
176 continue;
177 }
178
179 auto end = std::filesystem::directory_iterator();
180 std::size_t folderSize = std::accumulate(std::filesystem::directory_iterator(mapPath), end, std::size_t(0), [](std::size_t val, std::filesystem::path const& mapFile)
181 {
182 if (std::filesystem::is_regular_file(mapFile))
183 val += std::filesystem::file_size(mapFile);
184 return val;
185 });
186
187 handler->
PSendSysMessage(
"{} directory located in {}. Total size: {} bytes", subDir, mapPath.generic_string(), folderSize);
188 }
189
191 uint32 availableLocalesMask = (1 << defaultLocale);
192
194 {
196 if (locale == defaultLocale)
197 continue;
198
199 if (
sWorld->GetAvailableDbcLocale(locale) != defaultLocale)
200 availableLocalesMask |= (1 << locale);
201 }
202
203 std::string availableLocales;
205 {
206 if (!(availableLocalesMask & (1 << i)))
207 continue;
208
211 availableLocales += " ";
212 }
213
214 handler->
PSendSysMessage(
"Default DBC locale: {}.\nAll available DBC locales: {}",
localeNames[defaultLocale], availableLocales);
215
217
218 std::string lldb = "No updates found!";
220 {
221 Field* fields = resL->Fetch();
222 lldb = fields[0].
Get<std::string>();
223 }
224 std::string lcdb = "No updates found!";
226 {
227 Field* fields = resC->Fetch();
228 lcdb = fields[0].
Get<std::string>();
229 }
230 std::string lwdb = "No updates found!";
232 {
233 Field* fields = resW->Fetch();
234 lwdb = fields[0].
Get<std::string>();
235 }
236
240
244
247 else
249
251 {
253 }
254
255 return true;
256 }
LocaleConstant
Definition: Common.h:65
@ TOTAL_LOCALES
Definition: Common.h:76
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
std::uint16_t uint16
Definition: Define.h:108
char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:20
@ CONFIG_PORT_WORLD
Definition: IWorld.h:219
@ CONFIG_ENABLE_MMAPS
Definition: IWorld.h:147
@ CONFIG_VMAP_INDOOR_CHECK
Definition: IWorld.h:128
std::shared_ptr< ResultSet > QueryResult
Definition: DatabaseEnvFwd.h:28
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
Realm realm
Definition: World.cpp:112
std::string StringFormat(FormatString< Args... > fmt, Args &&... args)
Default AC string format function.
Definition: StringFormat.h:34
AC_COMMON_API char const * GetMySQLExecutable()
Definition: GitRevision.cpp:61
AC_COMMON_API char const * GetCMakeVersion()
Definition: GitRevision.cpp:41
AC_COMMON_API char const * GetHostOSVersion()
Definition: GitRevision.cpp:46
AC_DATABASE_API uint32 GetLibraryVersion()
Definition: MySQLThreading.cpp:31
AC_COMMON_API std::vector< std::string_view > GetEnableModulesList()
Definition: ModuleMgr.cpp:31
bool isHeightCalcEnabled() const
Definition: IVMapMgr.h:119
bool isLineOfSightCalcEnabled() const
Definition: IVMapMgr.h:118
static VMapMgr2 * createOrGetVMapMgr()
Definition: VMapFactory.cpp:27
Class used to access individual fields of database query result.
Definition: Field.h:99
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition: Field.h:113
void PSendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:213
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:162
uint32 Realm
Definition: Realm.h:43
RealmHandle Id
Definition: Realm.h:69