blob: 15cdd44c739d98104a8c9fd4241ad7e66d51989a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
namespace Steamworks;
public static class GameServer
{
public static bool Init(uint unIP, ushort usGamePort, ushort usQueryPort, EServerMode eServerMode, string pchVersionString)
{
InteropHelp.TestIfPlatformSupported();
bool flag;
using (InteropHelp.UTF8StringHandle pchVersionString2 = new InteropHelp.UTF8StringHandle(pchVersionString))
{
flag = NativeMethods.SteamInternal_GameServer_Init(unIP, 0, usGamePort, usQueryPort, eServerMode, pchVersionString2);
}
if (flag)
{
flag = CSteamGameServerAPIContext.Init();
}
if (flag)
{
CallbackDispatcher.Initialize();
}
return flag;
}
public static void Shutdown()
{
InteropHelp.TestIfPlatformSupported();
NativeMethods.SteamGameServer_Shutdown();
CSteamGameServerAPIContext.Clear();
CallbackDispatcher.Shutdown();
}
public static void RunCallbacks()
{
CallbackDispatcher.RunFrame(isGameServer: true);
}
public static void ReleaseCurrentThreadMemory()
{
InteropHelp.TestIfPlatformSupported();
NativeMethods.SteamGameServer_ReleaseCurrentThreadMemory();
}
public static bool BSecure()
{
InteropHelp.TestIfPlatformSupported();
return NativeMethods.SteamGameServer_BSecure();
}
public static CSteamID GetSteamID()
{
InteropHelp.TestIfPlatformSupported();
return (CSteamID)NativeMethods.SteamGameServer_GetSteamID();
}
public static HSteamPipe GetHSteamPipe()
{
InteropHelp.TestIfPlatformSupported();
return (HSteamPipe)NativeMethods.SteamGameServer_GetHSteamPipe();
}
public static HSteamUser GetHSteamUser()
{
InteropHelp.TestIfPlatformSupported();
return (HSteamUser)NativeMethods.SteamGameServer_GetHSteamUser();
}
}
|