Skip to content

Commit 75f6c60

Browse files
committed
Update BLT:CSE to work with the latest PAYDAY 2 release
* Standalone support is now broken, must be used as a client DLL. * Lua has been updated with all upstream changes. * Custom download paths are still supported of course.
1 parent 2ab7562 commit 75f6c60

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ bin/
22
lib/detours*
33
proj/Debug/addons.obj
44
proj/Debug/console.obj
5+
proj/IPHLPAPI.opensdf
56
*.obj
67
*.log
78
*.tlog

proj/IPHLPAPI.vcxproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,14 @@
3939
</ImportGroup>
4040
<PropertyGroup Label="UserMacros" />
4141
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
42-
<IncludePath>..\incl;..\..\curl\include;$(IncludePath)</IncludePath>
43-
<LibraryPath>..\lib;..\..\curl\lib;$(LibraryPath)</LibraryPath>
42+
<IncludePath>D:\openssl-win32\include;..\incl;..\..\curl\include;..\..\zlib\;$(IncludePath)</IncludePath>
43+
<LibraryPath>..\..\Detours\lib.X86;..\lib;..\..\curl\build\Win32\VC12\LIB Release - LIB OpenSSL\;..\..\zlib\contrib\vstudio\vc11\x86\ZlibStatRelease;D:\OpenSSL-Win32\lib\VC\static;$(LibraryPath)</LibraryPath>
44+
<TargetName>BLTCSE</TargetName>
4445
</PropertyGroup>
4546
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
46-
<IncludePath>..\incl;..\..\curl\include;$(IncludePath)</IncludePath>
47-
<LibraryPath>..\lib;..\..\curl\lib;$(LibraryPath)</LibraryPath>
47+
<IncludePath>D:\openssl-win32\include;..\incl;..\..\curl\include;..\..\zlib\;$(IncludePath)</IncludePath>
48+
<LibraryPath>..\..\Detours\lib.X86;..\lib;..\..\curl\build\Win32\VC12\LIB Release - LIB OpenSSL\;..\..\zlib\contrib\vstudio\vc11\x86\ZlibStatRelease;D:\OpenSSL-Win32\lib\VC\static;$(LibraryPath)</LibraryPath>
49+
<TargetName>BLTCSE</TargetName>
4850
</PropertyGroup>
4951
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
5052
<ClCompile>
@@ -76,7 +78,7 @@
7678
<EnableCOMDATFolding>true</EnableCOMDATFolding>
7779
<OptimizeReferences>true</OptimizeReferences>
7880
<ModuleDefinitionFile>iphp.def</ModuleDefinitionFile>
79-
<AdditionalDependencies>libcurl_a.lib;detours.lib;zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
81+
<AdditionalDependencies>libcurl.lib;detours.lib;zlibstat.lib;wldap32.lib;wsock32.lib;ws2_32.lib;libeay32MD.lib;ssleay32MD.lib;%(AdditionalDependencies)</AdditionalDependencies>
8082
</Link>
8183
</ItemDefinitionGroup>
8284
<ItemGroup>

src/InitiateState.cpp

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,19 @@ void* __fastcall do_game_update_new(void* thislol, int edx, int* a, int* b){
334334
// Mine worked fine, but this seems more elegant.
335335

336336
//If you want elegant, make an actual class member function and recast it through vararg abuse. -Olipro.
337+
338+
void luaL_openlib_wrapper(lua_State *L, const char *name, luaL_Reg elements[], int)
339+
{
340+
lua_createtable(L, 0, 0);
341+
while (elements->func)
342+
{
343+
lua_pushcclosure(L, elements->func, 0);
344+
lua_setfield(L, -2, elements->name);
345+
++elements;
346+
}
347+
lua_setfield(L, LUA_GLOBALSINDEX, name);
348+
}
349+
337350
EXTERN_C IMAGE_DOS_HEADER __ImageBase;
338351
int __fastcall luaL_newstate_new(void* thislol, int edx, char no, char freakin, int clue){
339352
lua_State *L = nullptr;
@@ -358,10 +371,10 @@ int __fastcall luaL_newstate_new(void* thislol, int edx, char no, char freakin,
358371
CREATE_LUA_FUNCTION(luaF_unzipfile, "unzip")
359372

360373
luaL_Reg consoleLib[] = { { "CreateConsole", luaF_createconsole }, { "DestroyConsole", luaF_destroyconsole }, { NULL, NULL } };
361-
luaL_openlib(L, "console", consoleLib, 0);
374+
luaL_openlib_wrapper(L, "console", consoleLib, 0);
362375

363376
luaL_Reg fileLib[] = { { "GetDirectories", luaF_getdir }, { "GetFiles", luaF_getfiles }, { "RemoveDirectory", luaF_removeDirectory }, { "DirectoryExists", luaF_directoryExists }, { NULL, NULL } };
364-
luaL_openlib(L, "file", fileLib, 0);
377+
luaL_openlib_wrapper(L, "file", fileLib, 0);
365378

366379
static std::string dir, file, safe_path;
367380
if (!dir.length())

0 commit comments

Comments
 (0)