Skip to content

Commit 77e1255

Browse files
committed
Add support for the taiwanese client, fixes #5
1 parent 5980dcd commit 77e1255

4 files changed

Lines changed: 27 additions & 7 deletions

File tree

src/UnCSO2.vcxproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PropertyGroup Label="Globals">
1414
<ProjectGuid>{B12702AD-ABFB-343A-A199-8E24837244A3}</ProjectGuid>
1515
<Keyword>Qt4VSv1.0</Keyword>
16-
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
16+
<WindowsTargetPlatformVersion>10.0.17763.0</WindowsTargetPlatformVersion>
1717
<ProjectName>UnCSO2</ProjectName>
1818
</PropertyGroup>
1919
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -62,6 +62,7 @@
6262
<FloatingPointModel>Fast</FloatingPointModel>
6363
<PrecompiledHeader>Create</PrecompiledHeader>
6464
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
65+
<LanguageStandard>stdcpp17</LanguageStandard>
6566
</ClCompile>
6667
<Link>
6768
<SubSystem>Windows</SubSystem>
@@ -97,6 +98,7 @@ cmd /c "$(SolutionDir)git-version-gen.cmd"</Command>
9798
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
9899
<FloatingPointModel>Fast</FloatingPointModel>
99100
<PrecompiledHeader>Create</PrecompiledHeader>
101+
<LanguageStandard>stdcpp17</LanguageStandard>
100102
</ClCompile>
101103
<Link>
102104
<SubSystem>Windows</SubSystem>

src/pkgfilesystem.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77

88
static const std::string s_szTiancityPackageFileKey = "\x9B\x65\xC7\x9B\xC7\xDF\x8E\x7E\xD4\xC6\x59\x52\x5C\xF7\x22\xFF\xF4\xE8\xFF\xE7\xB5\xC2\x77";
99
static const std::string s_szNexonPackageFileKey = "\x6C\x6B\x67\x75\x69\x37\x38\x31\x6B\x6C\x37\x38\x39\x73\x64\x21\x40\x23\x25\x38\x39\x26\x5E\x73\x64";
10+
static const std::string s_szBeanfunPackageFileKey = "\x86\x39\x53\xBD\x16\x11\x6D\x06\x2A\x84\xF3\x4E\xE0\x4A\xA3";
1011

1112
static const std::string s_szTiancityPackageEntryKey = "\x8E\x5C\xB8\x92\x45\xD1\x90\xBA\x82\x0F\xD9\x7A\x99\x8E\xB3\x87\xF7";
1213
static const std::string s_szNexonPackageEntryKey = "\x5E\x39\x67\x45\x72\x67\x32\x53\x78\x37\x62\x6E\x6B\x37\x40\x23\x73\x64\x66\x6A\x6E\x68\x40";
14+
static const std::string s_szBeanfunPackageEntryKey = "\x1F\x9F\xF8\xF4\x18\xAC\x25\xA2\xBB\x37\x82\x6D\xA8\xAE\xA7\x28\xBA\xDD\xDD\xE4\x6B";
1315

1416
GameDataProvider g_GameDataProvider = GameDataProvider::GAMEDATAPROVIDER_NONE;
1517

@@ -21,6 +23,8 @@ static const std::string& GetPackageFileKey()
2123
return s_szNexonPackageFileKey;
2224
case GAMEDATAPROVIDER_TIANCITY:
2325
return s_szTiancityPackageFileKey;
26+
case GAMEDATAPROVIDER_BEANFUN:
27+
return s_szBeanfunPackageFileKey;
2428
default:
2529
throw std::exception("Unknown game data provider!\n");
2630
}
@@ -34,6 +38,8 @@ static const std::string& GetPackageEntryKey()
3438
return s_szNexonPackageEntryKey;
3539
case GAMEDATAPROVIDER_TIANCITY:
3640
return s_szTiancityPackageEntryKey;
41+
case GAMEDATAPROVIDER_BEANFUN:
42+
return s_szBeanfunPackageEntryKey;
3743
default:
3844
throw std::exception("Unknown game data provider!\n");
3945
}

src/pkgfilesystem.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ enum GameDataProvider
7979
{
8080
GAMEDATAPROVIDER_NONE = -1,
8181
GAMEDATAPROVIDER_NEXON = 0, // south korean version
82-
GAMEDATAPROVIDER_TIANCITY // chinese version
82+
GAMEDATAPROVIDER_TIANCITY, // chinese version
83+
GAMEDATAPROVIDER_BEANFUN // taiwanese version
8384
};
8485

8586
extern GameDataProvider g_GameDataProvider;
@@ -88,9 +89,12 @@ inline void DetectGameDataProvider( const uint8_t* pFileBuffer )
8889
{
8990
std::string szPkgBuffer = reinterpret_cast<const char*>(pFileBuffer);
9091
bool bFoundTiancityDll = szPkgBuffer.find( "sedata.dll" ) != std::string::npos;
92+
bool bIsBeancity = szPkgBuffer.find( "be607ef651369efec2dbf8ee4eb18c23.pkg" ) != std::string::npos;
9193

9294
if (bFoundTiancityDll)
9395
g_GameDataProvider = GAMEDATAPROVIDER_TIANCITY;
96+
else if (bIsBeancity)
97+
g_GameDataProvider = GAMEDATAPROVIDER_BEANFUN;
9498
else
9599
g_GameDataProvider = GAMEDATAPROVIDER_NEXON;
96100
}
@@ -103,6 +107,8 @@ inline const wchar_t* GetGameDataProviderStr()
103107
return L"Nexon (South Korea)";
104108
case GAMEDATAPROVIDER_TIANCITY:
105109
return L"Tiancity (China)";
110+
case GAMEDATAPROVIDER_BEANFUN:
111+
return L"Beanfun (Taiwan)";
106112
default:
107113
return L"unknown";
108114
}

src/stdafx.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@
33
#define DBG_PRINTF(message, ...) printf( "%s: " message, __func__, ##__VA_ARGS__ )
44
#define DBG_WPRINTF(message, ...) wprintf( L"%S: " message, __func__, ##__VA_ARGS__ );
55

6-
#include <Windows.h>
6+
#include <stdint.h>
77

88
#include <assert.h>
9-
#include <intrin.h>
9+
#include <intrin.h>
10+
#include <stdio.h>
11+
12+
#include <filesystem>
1013
#include <sstream>
11-
#include <stdint.h>
12-
#include <stdio.h>
14+
15+
#include <array>
1316
#include <string>
1417
#include <vector>
15-
#include "vc17_filesystem.h"
1618

1719
#include "version.h"
1820

21+
#ifdef _WIN32
22+
#include <Windows.h>
23+
#endif
24+
1925
extern std::filesystem::path g_PkgDataPath;
2026
extern std::filesystem::path g_OutPath;

0 commit comments

Comments
 (0)