| 292 | } |
| 293 | |
| 294 | static void ClientVersionFixup(bool overrideProtocolVersion) |
| 295 | { |
| 296 | g_Config.ClientVersion = ParseVersion(g_Config.ClientVersionString.c_str()); |
| 297 | g_Config.ProtocolClientVersion = g_Config.ClientVersion; |
| 298 | if (overrideProtocolVersion) |
| 299 | { |
| 300 | g_Config.ProtocolClientVersion = ParseVersion(g_Config.ProtocolClientVersionString.c_str()); |
| 301 | } |
| 302 | else |
| 303 | { |
| 304 | g_Config.ProtocolClientVersionString = g_Config.ClientVersionString; |
| 305 | } |
| 306 | SetClientCrypt(g_Config.ProtocolClientVersion); |
| 307 | |
| 308 | const bool useVerdata = g_Config.ClientVersion < CV_500A; |
| 309 | const auto clientType = GetClientType(g_Config.ClientVersion); |
| 310 | |
| 311 | if (g_Config.ClientVersion < CV_500A) |
| 312 | { |
| 313 | g_MapSize[0].Width = 6144; |
| 314 | g_MapSize[1].Width = 6144; |
| 315 | } |
| 316 | |
| 317 | if (!g_Config.UseCrypt) |
| 318 | { |
| 319 | g_Config.EncryptionType = ET_NOCRYPT; |
| 320 | } |
| 321 | |
| 322 | if (g_Config.ClientVersion >= CV_70331) |
| 323 | { |
| 324 | g_MaxViewRange = MAX_VIEW_RANGE_NEW; |
| 325 | } |
| 326 | else |
| 327 | { |
| 328 | g_MaxViewRange = MAX_VIEW_RANGE_OLD; |
| 329 | } |
| 330 | |
| 331 | g_PacketManager.ConfigureClientVersion(g_Config.ClientVersion); |
| 332 | |
| 333 | if (!s_Mark.ClientFlag) |
| 334 | { |
| 335 | g_Config.ClientFlag = clientType; |
| 336 | } |
| 337 | if (!s_Mark.UseVerdata) |
| 338 | { |
| 339 | g_Config.UseVerdata = useVerdata; |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | // priority order looking for a config file: |
| 344 | // 1. command line -c/--config option |
no test coverage detected