Windows specific on overloaded functions in ISteamGameServerStats

This commit is contained in:
Garry Newman 2019-05-15 13:25:50 +01:00
parent a1599e3226
commit 778b1081cb
2 changed files with 10 additions and 4 deletions

View File

@ -14,11 +14,11 @@ internal class ISteamGameServerStats : SteamInterface
public override void InitInternals() public override void InitInternals()
{ {
_RequestUserStats = Marshal.GetDelegateForFunctionPointer<FRequestUserStats>( Marshal.ReadIntPtr( VTable, 0) ); _RequestUserStats = Marshal.GetDelegateForFunctionPointer<FRequestUserStats>( Marshal.ReadIntPtr( VTable, 0) );
_GetUserStat1 = Marshal.GetDelegateForFunctionPointer<FGetUserStat1>( Marshal.ReadIntPtr( VTable, 8) ); _GetUserStat1 = Marshal.GetDelegateForFunctionPointer<FGetUserStat1>( Marshal.ReadIntPtr( VTable, Config.Os == OsType.Windows ? 16 : 8 ) );
_GetUserStat2 = Marshal.GetDelegateForFunctionPointer<FGetUserStat2>( Marshal.ReadIntPtr( VTable, 16) ); _GetUserStat2 = Marshal.GetDelegateForFunctionPointer<FGetUserStat2>( Marshal.ReadIntPtr( VTable, Config.Os == OsType.Windows ? 8 : 16 ) );
_GetUserAchievement = Marshal.GetDelegateForFunctionPointer<FGetUserAchievement>( Marshal.ReadIntPtr( VTable, 24) ); _GetUserAchievement = Marshal.GetDelegateForFunctionPointer<FGetUserAchievement>( Marshal.ReadIntPtr( VTable, 24) );
_SetUserStat1 = Marshal.GetDelegateForFunctionPointer<FSetUserStat1>( Marshal.ReadIntPtr( VTable, 32) ); _SetUserStat1 = Marshal.GetDelegateForFunctionPointer<FSetUserStat1>( Marshal.ReadIntPtr( VTable, Config.Os == OsType.Windows ? 40 : 32 ) );
_SetUserStat2 = Marshal.GetDelegateForFunctionPointer<FSetUserStat2>( Marshal.ReadIntPtr( VTable, 40) ); _SetUserStat2 = Marshal.GetDelegateForFunctionPointer<FSetUserStat2>( Marshal.ReadIntPtr( VTable, Config.Os == OsType.Windows ? 32 : 40 ) );
_UpdateUserAvgRateStat = Marshal.GetDelegateForFunctionPointer<FUpdateUserAvgRateStat>( Marshal.ReadIntPtr( VTable, 48) ); _UpdateUserAvgRateStat = Marshal.GetDelegateForFunctionPointer<FUpdateUserAvgRateStat>( Marshal.ReadIntPtr( VTable, 48) );
_SetUserAchievement = Marshal.GetDelegateForFunctionPointer<FSetUserAchievement>( Marshal.ReadIntPtr( VTable, 56) ); _SetUserAchievement = Marshal.GetDelegateForFunctionPointer<FSetUserAchievement>( Marshal.ReadIntPtr( VTable, 56) );
_ClearUserAchievement = Marshal.GetDelegateForFunctionPointer<FClearUserAchievement>( Marshal.ReadIntPtr( VTable, 64) ); _ClearUserAchievement = Marshal.GetDelegateForFunctionPointer<FClearUserAchievement>( Marshal.ReadIntPtr( VTable, 64) );

View File

@ -77,6 +77,12 @@ void WriteFunctionPointerReader( CodeParser.Class clss )
Swap( clss, "GetGlobalStatHistory1", "GetGlobalStatHistory2", locations ); Swap( clss, "GetGlobalStatHistory1", "GetGlobalStatHistory2", locations );
} }
if ( clss.Name == "ISteamGameServerStats" )
{
Swap( clss, "GetUserStat1", "GetUserStat2", locations );
Swap( clss, "SetUserStat1", "SetUserStat2", locations );
}
if ( clss.Name == "ISteamUGC" ) if ( clss.Name == "ISteamUGC" )
{ {
Swap( clss, "CreateQueryAllUGCRequest1", "CreateQueryAllUGCRequest2", locations ); Swap( clss, "CreateQueryAllUGCRequest1", "CreateQueryAllUGCRequest2", locations );