Skip to content

Commit 0894de3

Browse files
committed
Sync to Steamworks.NET @ 3e5c4e2b7f922e1f46e7d199059468a7c6eafa52
1 parent b1018c8 commit 0894de3

21 files changed

+206
-257
lines changed

Assets/Plugins/Steamworks.NET/ISteamMatchmakingResponses.cs

Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public ISteamMatchmakingServerListResponse(ServerResponded onServerResponded, Se
7373
m_pGCHandle.Free();
7474
}
7575
}
76-
76+
7777
#if NOTHISPTR
7878
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
7979
private delegate void InternalServerResponded(HServerListRequest hRequest, int iServer);
@@ -82,13 +82,34 @@ public ISteamMatchmakingServerListResponse(ServerResponded onServerResponded, Se
8282
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
8383
private delegate void InternalRefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response);
8484
private void InternalOnServerResponded(HServerListRequest hRequest, int iServer) {
85-
m_ServerResponded(hRequest, iServer);
85+
try
86+
{
87+
m_ServerResponded(hRequest, iServer);
88+
}
89+
catch (Exception e)
90+
{
91+
CallbackDispatcher.ExceptionHandler(e);
92+
}
8693
}
8794
private void InternalOnServerFailedToRespond(HServerListRequest hRequest, int iServer) {
88-
m_ServerFailedToRespond(hRequest, iServer);
95+
try
96+
{
97+
m_ServerFailedToRespond(hRequest, iServer);
98+
}
99+
catch (Exception e)
100+
{
101+
CallbackDispatcher.ExceptionHandler(e);
102+
}
89103
}
90104
private void InternalOnRefreshComplete(HServerListRequest hRequest, EMatchMakingServerResponse response) {
91-
m_RefreshComplete(hRequest, response);
105+
try
106+
{
107+
m_RefreshComplete(hRequest, response);
108+
}
109+
catch (Exception e)
110+
{
111+
CallbackDispatcher.ExceptionHandler(e);
112+
}
92113
}
93114
#else
94115
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
@@ -98,13 +119,34 @@ private void InternalOnRefreshComplete(HServerListRequest hRequest, EMatchMaking
98119
[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
99120
private delegate void InternalRefreshComplete(IntPtr thisptr, HServerListRequest hRequest, EMatchMakingServerResponse response);
100121
private void InternalOnServerResponded(IntPtr thisptr, HServerListRequest hRequest, int iServer) {
101-
m_ServerResponded(hRequest, iServer);
122+
try
123+
{
124+
m_ServerResponded(hRequest, iServer);
125+
}
126+
catch (Exception e)
127+
{
128+
CallbackDispatcher.ExceptionHandler(e);
129+
}
102130
}
103131
private void InternalOnServerFailedToRespond(IntPtr thisptr, HServerListRequest hRequest, int iServer) {
104-
m_ServerFailedToRespond(hRequest, iServer);
132+
try
133+
{
134+
m_ServerFailedToRespond(hRequest, iServer);
135+
}
136+
catch (Exception e)
137+
{
138+
CallbackDispatcher.ExceptionHandler(e);
139+
}
105140
}
106141
private void InternalOnRefreshComplete(IntPtr thisptr, HServerListRequest hRequest, EMatchMakingServerResponse response) {
107-
m_RefreshComplete(hRequest, response);
142+
try
143+
{
144+
m_RefreshComplete(hRequest, response);
145+
}
146+
catch (Exception e)
147+
{
148+
CallbackDispatcher.ExceptionHandler(e);
149+
}
108150
}
109151
#endif
110152

Assets/Plugins/Steamworks.NET/Steam.cs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
namespace Steamworks {
1818
public static class Version {
19-
public const string SteamworksNETVersion = "13.0.0";
20-
public const string SteamworksSDKVersion = "1.47";
21-
public const string SteamAPIDLLVersion = "05.53.33.78";
22-
public const int SteamAPIDLLSize = 261072;
23-
public const int SteamAPI64DLLSize = 290768;
19+
public const string SteamworksNETVersion = "14.0.0";
20+
public const string SteamworksSDKVersion = "1.48";
21+
public const string SteamAPIDLLVersion = "05.69.73.98";
22+
public const int SteamAPIDLLSize = 237856;
23+
public const int SteamAPI64DLLSize = 262944;
2424
}
2525

2626
public static class SteamAPI {
@@ -31,6 +31,7 @@ public static class SteamAPI {
3131
//
3232
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
3333

34+
3435
// SteamAPI_Init must be called before using any other API functions. If it fails, an
3536
// error message will be output to the debugger (or stderr) with further information.
3637
public static bool Init() {
@@ -49,9 +50,11 @@ public static bool Init() {
4950
return ret;
5051
}
5152

53+
// SteamAPI_Shutdown should be called during process shutdown if possible.
5254
public static void Shutdown() {
5355
InteropHelp.TestIfPlatformSupported();
5456
NativeMethods.SteamAPI_Shutdown();
57+
CSteamAPIContext.Clear();
5558
}
5659

5760
// SteamAPI_RestartAppIfNecessary ensures that your executable was launched through Steam.
@@ -78,7 +81,6 @@ public static void ReleaseCurrentThreadMemory() {
7881
NativeMethods.SteamAPI_ReleaseCurrentThreadMemory();
7982
}
8083

81-
8284
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
8385
// steam callback and call-result helpers
8486
//
@@ -99,9 +101,14 @@ public static void ReleaseCurrentThreadMemory() {
99101
//
100102
// Callbacks and call-results are queued automatically and are only
101103
// delivered/executed when your application calls SteamAPI_RunCallbacks().
104+
//
105+
// Note that there is an alternative, lower level callback dispatch mechanism.
106+
// See SteamAPI_ManualDispatch_Init
102107
//----------------------------------------------------------------------------------------------------------------------------------------------------------//
103108

104-
// SteamAPI_RunCallbacks is safe to call from multiple threads simultaneously,
109+
// Dispatch all queued Steamworks callbacks.
110+
//
111+
// This is safe to call from multiple threads simultaneously,
105112
// but if you choose to do this, callback code could be executed on any thread.
106113
// One alternative is to call SteamAPI_RunCallbacks from the main thread only,
107114
// and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads.
@@ -122,12 +129,6 @@ public static bool IsSteamRunning() {
122129
return NativeMethods.SteamAPI_IsSteamRunning();
123130
}
124131

125-
// returns the HSteamUser of the last user to dispatch a callback
126-
public static HSteamUser GetHSteamUserCurrent() {
127-
InteropHelp.TestIfPlatformSupported();
128-
return (HSteamUser)NativeMethods.Steam_GetHSteamUserCurrent();
129-
}
130-
131132
// returns the pipe we are communicating to Steam with
132133
public static HSteamPipe GetHSteamPipe() {
133134
InteropHelp.TestIfPlatformSupported();

0 commit comments

Comments
 (0)