Skip to content

Commit 123fe87

Browse files
authored
Merge pull request #247 from Earu/fix/listen-server-linux
Fixes for linux/listen servers
2 parents f2663e9 + eb4dbff commit 123fe87

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎Game.Shared/GarrysMod/LuaPlayer.cs‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,13 @@ static int Player__AccountID(ILuaInterface lua) {
130130
return 1;
131131
}
132132

133+
[LuaMethod]
134+
static int Player__IsListenServerHost(ILuaInterface lua) {
135+
BasePlayer player = Get_Player(1, false)!;
136+
lua.PushBool(!engine.IsDedicatedServer() && player.EntIndex() == 1);
137+
return 1;
138+
}
139+
133140
#if GAME_DLL
134141
[LuaMethod]
135142
static int Player__OwnerSteamID64(ILuaInterface lua) {

‎Source.Common/Steam/Steamworks.cs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ namespace Source.Common.Steam;
1010
// I am very annoyed
1111
public class SteamworksDotNetBoasts100PercentCoverageOfTheNativeSteamworksAPIAcrossAllInterfaces
1212
{
13-
[DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamGameServer_RunCallbacks();
14-
[DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SetBreakpadAppID(uint unAppID);
13+
#if WIN32
14+
const string SteamApiLibrary = "steam_api64";
15+
#else
16+
const string SteamApiLibrary = "steam_api";
17+
#endif
18+
19+
[DllImport(SteamApiLibrary, CallingConvention = CallingConvention.Cdecl)] public static extern void SteamGameServer_RunCallbacks();
20+
[DllImport(SteamApiLibrary, CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SetBreakpadAppID(uint unAppID);
1521
}
1622

1723
// These are some hacks to access the internal pointers for steamclient

0 commit comments

Comments
 (0)