//ALTERED public bool ClearAchievement(string name, bool state) { using (var nativeName = NativeStrings.StringToStringHandle(name)) { return(this.Call <bool, NativeClearAchievement>(this.Functions.ClearAchievement, this.ObjectAddress, name)); } }
public bool GetStatValue(string name, out float value) { using (var nativeName = NativeStrings.StringToStringHandle(name)) { var call = this.GetFunction <NativeGetStatFloat>(this.Functions.GetStatFloat); return(call(this.ObjectAddress, nativeName.Handle, out value)); } }
public bool GetAchievementAchievedPercent(string name, out float percent) { using (var nativeName = NativeStrings.StringToStringHandle(name)) { var call = this.GetFunction <NativeGetAchievementAchievedPercent>(this.Functions.GetAchievementAchievedPercent); return(call(this.ObjectAddress, nativeName.Handle, out percent)); } }
public bool GetAchievementAndUnlockTime(string name, out bool isAchieved, out int unlockTime) { using (var nativeName = NativeStrings.StringToStringHandle(name)) { var call = this.GetFunction <NativeGetAchievementAndUnlockTime>(this.Functions.GetAchievementAndUnlockTime); return(call(this.ObjectAddress, nativeName.Handle, out isAchieved, out unlockTime)); } }
public int GetAchievementIcon(string name) { using (var nativeName = NativeStrings.StringToStringHandle(name)) { return(this.Call <int, NativeGetAchievementIcon>( this.Functions.GetAchievementIcon, this.ObjectAddress, nativeName.Handle)); } }
public bool SetStatValue(string name, int value) { using (var nativeName = NativeStrings.StringToStringHandle(name)) { return(this.Call <bool, NativeSetStatInt>( this.Functions.SetStatInteger, this.ObjectAddress, nativeName.Handle, value)); } }
public bool ResetFloatStatValue(string name) { using (var nativeName = NativeStrings.StringToStringHandle(name)) { return(this.Call <bool, NativeSetStatFloat>( this.Functions.SetStatFloat, this.ObjectAddress, nativeName.Handle, 0f)); } }
public string GetAchievementDisplayAttribute(string name, string key) { using (var nativeName = NativeStrings.StringToStringHandle(name)) using (var nativeKey = NativeStrings.StringToStringHandle(key)) { var result = this.Call <IntPtr, NativeGetAchievementDisplayAttribute>( this.Functions.GetAchievementDisplayAttribute, this.ObjectAddress, nativeName.Handle, nativeKey.Handle); return(NativeStrings.PointerToString(result)); } }
private TClass GetISteamApps <TClass>(int user, int pipe, string version) where TClass : INativeWrapper, new() { using (var nativeVersion = NativeStrings.StringToStringHandle(version)) { IntPtr address = this.Call <IntPtr, NativeGetISteamApps>( this.Functions.GetISteamApps, user, pipe, nativeVersion.Handle); var result = new TClass(); result.SetupFunctions(address); return(result); } }
public string GetAppData(uint appId, string key) { using (var nativeHandle = NativeStrings.StringToStringHandle(key)) { const int valueLength = 1024; var valuePointer = Marshal.AllocHGlobal(valueLength); int result = this.Call <int, NativeGetAppData>( this.Functions.GetAppData, this.ObjectAddress, appId, nativeHandle.Handle, valuePointer, valueLength); var value = result == 0 ? null : NativeStrings.PointerToString(valuePointer, valueLength); Marshal.FreeHGlobal(valuePointer); return(value); } }