115 {
117 std::string dbPortOutput;
118
119 {
122 dbPort = (*res)[0].Get<
uint16>();
123
124 if (dbPort)
126 else
128 }
129
131
132 handler->
PSendSysMessage(
"Using SSL version: {} (library: {})", OPENSSL_VERSION_TEXT, OpenSSL_version(OPENSSL_VERSION));
133 handler->
PSendSysMessage(
"Using Boost version: {}.{}.{}", BOOST_VERSION / 100000, BOOST_VERSION / 100 % 1000, BOOST_VERSION % 100);
135
138
140
141 handler->
PSendSysMessage(
"Worldserver listening connections on port {}", worldPort);
143
147
149
150 std::string dataDir =
sWorld->GetDataPath();
151 std::vector<std::string> subDirs;
152 subDirs.emplace_back("maps");
153 if (vmapIndoorCheck || vmapLOSCheck || vmapHeightCheck)
154 {
155 handler->
PSendSysMessage(
"VMAPs status: Enabled. LineOfSight: {}, getHeight: {}, indoorCheck: {}", vmapLOSCheck, vmapHeightCheck, vmapIndoorCheck);
156 subDirs.emplace_back("vmaps");
157 }
158 else
160
161 if (mmapEnabled)
162 {
164 subDirs.emplace_back("mmaps");
165 }
166 else
168
169 for (std::string const& subDir : subDirs)
170 {
171 std::filesystem::path mapPath(dataDir);
172 mapPath /= subDir;
173
174 if (!std::filesystem::exists(mapPath))
175 {
176 handler->
PSendSysMessage(
"{} directory doesn't exist!. Using path: {}", subDir, mapPath.generic_string());
177 continue;
178 }
179
180 auto end = std::filesystem::directory_iterator();
181 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)
182 {
183 if (std::filesystem::is_regular_file(mapFile))
184 val += std::filesystem::file_size(mapFile);
185 return val;
186 });
187
188 handler->
PSendSysMessage(
"{} directory located in {}. Total size: {} bytes", subDir, mapPath.generic_string(), folderSize);
189 }
190
192 uint32 availableLocalesMask = (1 << defaultLocale);
193
195 {
197 if (locale == defaultLocale)
198 continue;
199
200 if (
sWorld->GetAvailableDbcLocale(locale) != defaultLocale)
201 availableLocalesMask |= (1 << locale);
202 }
203
204 std::string availableLocales;
206 {
207 if (!(availableLocalesMask & (1 << i)))
208 continue;
209
212 availableLocales += " ";
213 }
214
215 handler->
PSendSysMessage(
"Default DBC locale: {}.\nAll available DBC locales: {}",
localeNames[defaultLocale], availableLocales);
216
218
219 std::string lldb = "No updates found!";
221 {
222 Field* fields = resL->Fetch();
223 lldb = fields[0].
Get<std::string>();
224 }
225 std::string lcdb = "No updates found!";
227 {
228 Field* fields = resC->Fetch();
229 lcdb = fields[0].
Get<std::string>();
230 }
231 std::string lwdb = "No updates found!";
233 {
234 Field* fields = resW->Fetch();
235 lwdb = fields[0].
Get<std::string>();
236 }
237
241
245
248 else
250
252 {
254 }
255
256 return true;
257 }
LocaleConstant
Definition: Common.h:65
@ TOTAL_LOCALES
Definition: Common.h:76
char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:20
std::uint8_t uint8
Definition: Define.h:109
std::uint32_t uint32
Definition: Define.h:107
std::uint16_t uint16
Definition: Define.h:108
@ CONFIG_PORT_WORLD
Definition: IWorld.h:215
@ CONFIG_ENABLE_MMAPS
Definition: IWorld.h:142
@ CONFIG_VMAP_INDOOR_CHECK
Definition: IWorld.h:123
std::shared_ptr< ResultSet > QueryResult
Definition: DatabaseEnvFwd.h:27
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:98
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition: Field.h:112
void PSendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:210
virtual void SendSysMessage(std::string_view str, bool escapeCharacters=false)
Definition: Chat.cpp:159
uint32 Realm
Definition: Realm.h:43
RealmHandle Id
Definition: Realm.h:69