Skip to content

Commit

Permalink
🐛 Fix Mac \ Linux GetSteamId Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RMBGAME committed Nov 29, 2023
1 parent bfcf236 commit dc20ce4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions SAM.API/Wrappers/SteamUser019.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,17 @@ public class SteamUser017 : NativeWrapper<ISteamUser019>
{
#region GetSteamID
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
private delegate void NativeGetSteamId(IntPtr self, out ulong steamId);
private delegate ulong NativeGetSteamId(IntPtr self);

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

public ulong GetSteamId3()
{
var call = GetFunction<NativeGetSteamId>(Functions.GetSteamID);
ulong steamId;
call(ObjectAddress, out steamId);
var steamId = Call<ulong, NativeGetSteamId>(Functions.GetSteamID, ObjectAddress);
steamId = ((steamId >> (ushort)0) & 0xFFFFFFFF);
return steamId;
}
Expand All @@ -51,6 +48,7 @@ public ulong GetSteamId3()
#region GetPlayerSteamLevel
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
private delegate IntPtr NativeGetPlayerSteamLevel(IntPtr self);

public IntPtr GetPlayerSteamLevel()
{
var result = Call<IntPtr, NativeGetPlayerSteamLevel>(Functions.GetPlayerSteamLevel, ObjectAddress);
Expand Down

0 comments on commit dc20ce4

Please sign in to comment.