Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Game.Shared/GarrysMod/LuaPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ static int Player__AccountID(ILuaInterface lua) {
return 1;
}

[LuaMethod]
static int Player__IsListenServerHost(ILuaInterface lua) {
BasePlayer player = Get_Player(1, false)!;
lua.PushBool(!engine.IsDedicatedServer() && player.EntIndex() == 1);
return 1;
}

#if GAME_DLL
[LuaMethod]
static int Player__OwnerSteamID64(ILuaInterface lua) {
Expand Down
10 changes: 8 additions & 2 deletions Source.Common/Steam/Steamworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ namespace Source.Common.Steam;
// I am very annoyed
public class SteamworksDotNetBoasts100PercentCoverageOfTheNativeSteamworksAPIAcrossAllInterfaces
{
[DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamGameServer_RunCallbacks();
[DllImport("steam_api64", CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SetBreakpadAppID(uint unAppID);
#if WIN32
const string SteamApiLibrary = "steam_api64";
#else
const string SteamApiLibrary = "steam_api";
#endif

[DllImport(SteamApiLibrary, CallingConvention = CallingConvention.Cdecl)] public static extern void SteamGameServer_RunCallbacks();
[DllImport(SteamApiLibrary, CallingConvention = CallingConvention.Cdecl)] public static extern void SteamAPI_SetBreakpadAppID(uint unAppID);
}

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