Skip to content

Commit 25c6c6a

Browse files
committed
Inject different DLLs for galaxy and aspyr builds
1 parent cb8bf26 commit 25c6c6a

File tree

3 files changed

+23
-10
lines changed

3 files changed

+23
-10
lines changed

SWBF2Admin/Gameserver/ServerManager.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ public enum ServerStatus
3636

3737
public class ServerManager : ComponentBase
3838
{
39-
private const string DLLLOADER_FILENAME = "dllloader.exe";
39+
private const string DLLLOADER_FILENAME_32 = "dllloader_32.exe";
40+
private const string DLLLOADER_FILENAME_64 = "dllloader_64.exe";
4041
private const int STEAMMODE_PDECT_TIMEOUT = 1000;
4142
private const int STEAMMODE_MAX_RETRY = 30;
4243

@@ -269,10 +270,22 @@ private void InjectRconDllIfRequired()
269270
{
270271
if (serverType == GameserverType.GoG || serverType == GameserverType.Steam || serverType == GameserverType.Aspyr)
271272
{
272-
string loader = $"{Core.Files.ParseFileName(Core.Config.ServerPath)}/{DLLLOADER_FILENAME}";
273+
string loader;
274+
string dll;
275+
if (serverType == GameserverType.Aspyr)
276+
{
277+
loader = $"{Core.Files.ParseFileName(Core.Config.ServerPath)}/{DLLLOADER_FILENAME_64}";
278+
dll = "rconserver_64.dll";
279+
}
280+
else
281+
{
282+
loader = $"{Core.Files.ParseFileName(Core.Config.ServerPath)}/{DLLLOADER_FILENAME_32}";
283+
dll = "rconserver_32.dll";
284+
}
285+
273286
if (File.Exists(loader))
274287
{
275-
Process.Start(loader, string.Format("--pid {0} --dll {1}", serverProcess.Id, "RconServer.dll"));
288+
Process.Start(loader, string.Format("--pid {0} --dll {1}", serverProcess.Id, dll));
276289
}
277290
else
278291
{

rconserver-aspyr/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.10)
2-
project(rconserver)
2+
project(rconserver_64)
33

44
set(CMAKE_BUILD_TYPE Release)
55
set(CMAKE_GENERATOR_PLATFORM amd64)
@@ -10,9 +10,9 @@ set(SOURCES
1010
Logger.cpp
1111
)
1212

13-
add_library(rconserver SHARED ${SOURCES})
14-
target_compile_definitions(rconserver PRIVATE RCONSERVER_EXPORTS _WINDOWS _USRDLL)
15-
set_property(TARGET rconserver PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedRelease")
13+
add_library(rconserver_64 SHARED ${SOURCES})
14+
target_compile_definitions(rconserver_64 PRIVATE RCONSERVER_EXPORTS _WINDOWS _USRDLL)
15+
set_property(TARGET rconserver_64 PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedRelease")
1616

1717
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
1818
message(STATUS "Compiling for 64-bit architecture")

rconserver-galaxy/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.10)
2-
project(rconserver)
2+
project(rconserver_32)
33

44
set(CMAKE_BUILD_TYPE Release)
55
set(CMAKE_GENERATOR_PLATFORM x86)
@@ -13,6 +13,6 @@ set(SOURCES
1313
RconServer.cpp
1414
)
1515

16-
add_library(rconserver SHARED ${SOURCES})
17-
target_compile_definitions(rconserver PRIVATE RCONSERVER_EXPORTS _WINDOWS _USRDLL)
16+
add_library(rconserver_32 SHARED ${SOURCES})
17+
target_compile_definitions(rconserver_32 PRIVATE RCONSERVER_EXPORTS _WINDOWS _USRDLL)
1818
set_property(TARGET rconserver PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreadedRelease")

0 commit comments

Comments
 (0)