Skip to content

Commit

Permalink
🐛 Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RMBGAME committed Nov 29, 2023
1 parent dc20ce4 commit caf4e78
Showing 1 changed file with 30 additions and 5 deletions.
35 changes: 30 additions & 5 deletions SAM.API/Wrappers/SteamUser019.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,43 @@ public class SteamUser017 : NativeWrapper<ISteamUser019>
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
private delegate ulong NativeGetSteamId(IntPtr self);

[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
private delegate void NativeGetSteamId2(IntPtr self, out ulong steamId);

public ulong GetSteamId()
{
var steamId = Call<ulong, NativeGetSteamId>(Functions.GetSteamID, ObjectAddress);
return steamId;
if (OperatingSystem.IsMacOS())
{
var steamId = Call<ulong, NativeGetSteamId>(Functions.GetSteamID, ObjectAddress);
return steamId;
}
else
{
var call = GetFunction<NativeGetSteamId2>(Functions.GetSteamID);
ulong steamId;
call(ObjectAddress, out steamId);
return steamId;
}
}

public ulong GetSteamId3()
{
var steamId = Call<ulong, NativeGetSteamId>(Functions.GetSteamID, ObjectAddress);
steamId = ((steamId >> (ushort)0) & 0xFFFFFFFF);
return steamId;
if (OperatingSystem.IsMacOS())
{
var steamId = Call<ulong, NativeGetSteamId>(Functions.GetSteamID, ObjectAddress);
steamId = ((steamId >> (ushort)0) & 0xFFFFFFFF);
return steamId;
}
else
{
var call = GetFunction<NativeGetSteamId2>(Functions.GetSteamID);
ulong steamId;
call(ObjectAddress, out steamId);
steamId = ((steamId >> (ushort)0) & 0xFFFFFFFF);
return steamId;
}
}

#endregion

#region GetPlayerSteamLevel
Expand Down

0 comments on commit caf4e78

Please sign in to comment.