Skip to content

Commit bae5b30

Browse files
committed
Update to Steamworks.NET 9.1.0
1 parent 535ec9d commit bae5b30

File tree

15 files changed

+120
-92
lines changed

15 files changed

+120
-92
lines changed

.gitignore

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
.DS_Store
1+
# Folders
2+
.DS_Store/
3+
.vs/
24
Library/
3-
Temp/
45
obj/
6+
Temp/
7+
8+
# Files
59
*.csproj
6-
*.pidb
7-
*.unityproj
810
*.sln
9-
*.userprefs
10-
*.suo
11+
*.VC.db
1112

1213
/steam_appid.txt
-11.8 KB
Binary file not shown.

Assets/Plugins/Steamworks.NET/CallbackDispatcher.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static class CallbackDispatcher {
5151
// For some reason throwing an exception causes RunCallbacks() to break otherwise.
5252
// If you have a custom ExceptionHandler in your engine you can register it here manually until we get something more elegant hooked up.
5353
public static void ExceptionHandler(Exception e) {
54-
#if UNITY_BUILD
54+
#if UNITY_STANDALONE
5555
UnityEngine.Debug.LogException(e);
5656
#elif STEAMWORKS_WIN || STEAMWORKS_LIN_OSX
5757
Console.WriteLine(e.Message);
@@ -295,6 +295,7 @@ private void OnRunCallback(
295295
#endif
296296
IntPtr pvParam) {
297297
m_hAPICall = SteamAPICall_t.Invalid; // Caller unregisters for us
298+
298299
try {
299300
m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T)), false);
300301
}
@@ -308,21 +309,17 @@ private void OnRunCallResult(
308309
#if !STDCALL
309310
IntPtr thisptr,
310311
#endif
311-
IntPtr pvParam, bool bFailed, ulong hSteamAPICall) {
312-
SteamAPICall_t hAPICall = (SteamAPICall_t)hSteamAPICall;
313-
if (hAPICall == m_hAPICall) {
312+
IntPtr pvParam, bool bFailed, ulong hSteamAPICall_) {
313+
SteamAPICall_t hSteamAPICall = (SteamAPICall_t)hSteamAPICall_;
314+
if (hSteamAPICall == m_hAPICall) {
315+
m_hAPICall = SteamAPICall_t.Invalid; // Caller unregisters for us
316+
314317
try {
315318
m_Func((T)Marshal.PtrToStructure(pvParam, typeof(T)), bFailed);
316319
}
317320
catch (Exception e) {
318321
CallbackDispatcher.ExceptionHandler(e);
319322
}
320-
321-
// The official SDK sets m_hAPICall to invalid before calling the callresult function,
322-
// this doesn't let us access .Handle from within the function though.
323-
if (hAPICall == m_hAPICall) { // Ensure that m_hAPICall has not been changed in m_Func
324-
m_hAPICall = SteamAPICall_t.Invalid; // Caller unregisters for us
325-
}
326323
}
327324
}
328325

Assets/Plugins/Steamworks.NET/Steam.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace Steamworks {
1010
public static class Version {
11-
public const string SteamworksNETVersion = "9.0.0";
11+
public const string SteamworksNETVersion = "9.1.0";
1212
public const string SteamworksSDKVersion = "1.39";
1313
public const string SteamAPIDLLVersion = "03.75.32.07";
1414
public const int SteamAPIDLLSize = 219424;
@@ -192,42 +192,42 @@ public static HSteamUser GetHSteamUser() {
192192
public static class SteamEncryptedAppTicket {
193193
public static bool BDecryptTicket(byte[] rgubTicketEncrypted, uint cubTicketEncrypted, byte[] rgubTicketDecrypted, ref uint pcubTicketDecrypted, byte[] rgubKey, int cubKey) {
194194
InteropHelp.TestIfPlatformSupported();
195-
return NativeMethods.BDecryptTicket(rgubTicketEncrypted, cubTicketEncrypted, rgubTicketDecrypted, ref pcubTicketDecrypted, rgubKey, cubKey);
195+
return NativeMethods.SteamEncryptedAppTicket_BDecryptTicket(rgubTicketEncrypted, cubTicketEncrypted, rgubTicketDecrypted, ref pcubTicketDecrypted, rgubKey, cubKey);
196196
}
197197

198198
public static bool BIsTicketForApp(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, AppId_t nAppID) {
199199
InteropHelp.TestIfPlatformSupported();
200-
return NativeMethods.BIsTicketForApp(rgubTicketDecrypted, cubTicketDecrypted, nAppID);
200+
return NativeMethods.SteamEncryptedAppTicket_BIsTicketForApp(rgubTicketDecrypted, cubTicketDecrypted, nAppID);
201201
}
202202

203203
public static uint GetTicketIssueTime(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) {
204204
InteropHelp.TestIfPlatformSupported();
205-
return NativeMethods.GetTicketIssueTime(rgubTicketDecrypted, cubTicketDecrypted);
205+
return NativeMethods.SteamEncryptedAppTicket_GetTicketIssueTime(rgubTicketDecrypted, cubTicketDecrypted);
206206
}
207207

208208
public static void GetTicketSteamID(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out CSteamID psteamID) {
209209
InteropHelp.TestIfPlatformSupported();
210-
NativeMethods.GetTicketSteamID(rgubTicketDecrypted, cubTicketDecrypted, out psteamID);
210+
NativeMethods.SteamEncryptedAppTicket_GetTicketSteamID(rgubTicketDecrypted, cubTicketDecrypted, out psteamID);
211211
}
212212

213213
public static uint GetTicketAppID(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) {
214214
InteropHelp.TestIfPlatformSupported();
215-
return NativeMethods.GetTicketAppID(rgubTicketDecrypted, cubTicketDecrypted);
215+
return NativeMethods.SteamEncryptedAppTicket_GetTicketAppID(rgubTicketDecrypted, cubTicketDecrypted);
216216
}
217217

218218
public static bool BUserOwnsAppInTicket(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, AppId_t nAppID) {
219219
InteropHelp.TestIfPlatformSupported();
220-
return NativeMethods.BUserOwnsAppInTicket(rgubTicketDecrypted, cubTicketDecrypted, nAppID);
220+
return NativeMethods.SteamEncryptedAppTicket_BUserOwnsAppInTicket(rgubTicketDecrypted, cubTicketDecrypted, nAppID);
221221
}
222222

223223
public static bool BUserIsVacBanned(byte[] rgubTicketDecrypted, uint cubTicketDecrypted) {
224224
InteropHelp.TestIfPlatformSupported();
225-
return NativeMethods.BUserIsVacBanned(rgubTicketDecrypted, cubTicketDecrypted);
225+
return NativeMethods.SteamEncryptedAppTicket_BUserIsVacBanned(rgubTicketDecrypted, cubTicketDecrypted);
226226
}
227227

228228
public static byte[] GetUserVariableData(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out uint pcubUserData) {
229229
InteropHelp.TestIfPlatformSupported();
230-
System.IntPtr punSecretData = NativeMethods.GetUserVariableData(rgubTicketDecrypted, cubTicketDecrypted, out pcubUserData);
230+
System.IntPtr punSecretData = NativeMethods.SteamEncryptedAppTicket_GetUserVariableData(rgubTicketDecrypted, cubTicketDecrypted, out pcubUserData);
231231
byte[] ret = new byte[pcubUserData];
232232
System.Runtime.InteropServices.Marshal.Copy(punSecretData, ret, 0, (int)pcubUserData);
233233
return ret;

0 commit comments

Comments
 (0)