summaryrefslogtreecommitdiff
path: root/Assembly_Firstpass/Steamworks/SteamGameServerApps.cs
blob: 9b91467b9516af7c5b3fc53400057d38afc1bce1 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
using System;
using System.Runtime.InteropServices;

namespace Steamworks;

public static class SteamGameServerApps
{
	public static bool BIsSubscribed()
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsSubscribed(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static bool BIsLowViolence()
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsLowViolence(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static bool BIsCybercafe()
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsCybercafe(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static bool BIsVACBanned()
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsVACBanned(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static string GetCurrentGameLanguage()
	{
		InteropHelp.TestIfAvailableGameServer();
		return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetCurrentGameLanguage(CSteamGameServerAPIContext.GetSteamApps()));
	}

	public static string GetAvailableGameLanguages()
	{
		InteropHelp.TestIfAvailableGameServer();
		return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetAvailableGameLanguages(CSteamGameServerAPIContext.GetSteamApps()));
	}

	public static bool BIsSubscribedApp(AppId_t appID)
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsSubscribedApp(CSteamGameServerAPIContext.GetSteamApps(), appID);
	}

	public static bool BIsDlcInstalled(AppId_t appID)
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsDlcInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID);
	}

	public static uint GetEarliestPurchaseUnixTime(AppId_t nAppID)
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_GetEarliestPurchaseUnixTime(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
	}

	public static bool BIsSubscribedFromFreeWeekend()
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsSubscribedFromFreeWeekend(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static int GetDLCCount()
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_GetDLCCount(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static bool BGetDLCDataByIndex(int iDLC, out AppId_t pAppID, out bool pbAvailable, out string pchName, int cchNameBufferSize)
	{
		InteropHelp.TestIfAvailableGameServer();
		IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize);
		bool flag = NativeMethods.ISteamApps_BGetDLCDataByIndex(CSteamGameServerAPIContext.GetSteamApps(), iDLC, out pAppID, out pbAvailable, intPtr, cchNameBufferSize);
		pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
		Marshal.FreeHGlobal(intPtr);
		return flag;
	}

	public static void InstallDLC(AppId_t nAppID)
	{
		InteropHelp.TestIfAvailableGameServer();
		NativeMethods.ISteamApps_InstallDLC(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
	}

	public static void UninstallDLC(AppId_t nAppID)
	{
		InteropHelp.TestIfAvailableGameServer();
		NativeMethods.ISteamApps_UninstallDLC(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
	}

	public static void RequestAppProofOfPurchaseKey(AppId_t nAppID)
	{
		InteropHelp.TestIfAvailableGameServer();
		NativeMethods.ISteamApps_RequestAppProofOfPurchaseKey(CSteamGameServerAPIContext.GetSteamApps(), nAppID);
	}

	public static bool GetCurrentBetaName(out string pchName, int cchNameBufferSize)
	{
		InteropHelp.TestIfAvailableGameServer();
		IntPtr intPtr = Marshal.AllocHGlobal(cchNameBufferSize);
		bool flag = NativeMethods.ISteamApps_GetCurrentBetaName(CSteamGameServerAPIContext.GetSteamApps(), intPtr, cchNameBufferSize);
		pchName = (flag ? InteropHelp.PtrToStringUTF8(intPtr) : null);
		Marshal.FreeHGlobal(intPtr);
		return flag;
	}

	public static bool MarkContentCorrupt(bool bMissingFilesOnly)
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_MarkContentCorrupt(CSteamGameServerAPIContext.GetSteamApps(), bMissingFilesOnly);
	}

	public static uint GetInstalledDepots(AppId_t appID, DepotId_t[] pvecDepots, uint cMaxDepots)
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_GetInstalledDepots(CSteamGameServerAPIContext.GetSteamApps(), appID, pvecDepots, cMaxDepots);
	}

	public static uint GetAppInstallDir(AppId_t appID, out string pchFolder, uint cchFolderBufferSize)
	{
		InteropHelp.TestIfAvailableGameServer();
		IntPtr intPtr = Marshal.AllocHGlobal((int)cchFolderBufferSize);
		uint num = NativeMethods.ISteamApps_GetAppInstallDir(CSteamGameServerAPIContext.GetSteamApps(), appID, intPtr, cchFolderBufferSize);
		pchFolder = ((num != 0) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
		Marshal.FreeHGlobal(intPtr);
		return num;
	}

	public static bool BIsAppInstalled(AppId_t appID)
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsAppInstalled(CSteamGameServerAPIContext.GetSteamApps(), appID);
	}

	public static CSteamID GetAppOwner()
	{
		InteropHelp.TestIfAvailableGameServer();
		return (CSteamID)NativeMethods.ISteamApps_GetAppOwner(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static string GetLaunchQueryParam(string pchKey)
	{
		InteropHelp.TestIfAvailableGameServer();
		using InteropHelp.UTF8StringHandle pchKey2 = new InteropHelp.UTF8StringHandle(pchKey);
		return InteropHelp.PtrToStringUTF8(NativeMethods.ISteamApps_GetLaunchQueryParam(CSteamGameServerAPIContext.GetSteamApps(), pchKey2));
	}

	public static bool GetDlcDownloadProgress(AppId_t nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal)
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_GetDlcDownloadProgress(CSteamGameServerAPIContext.GetSteamApps(), nAppID, out punBytesDownloaded, out punBytesTotal);
	}

	public static int GetAppBuildId()
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_GetAppBuildId(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static void RequestAllProofOfPurchaseKeys()
	{
		InteropHelp.TestIfAvailableGameServer();
		NativeMethods.ISteamApps_RequestAllProofOfPurchaseKeys(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static SteamAPICall_t GetFileDetails(string pszFileName)
	{
		InteropHelp.TestIfAvailableGameServer();
		using InteropHelp.UTF8StringHandle pszFileName2 = new InteropHelp.UTF8StringHandle(pszFileName);
		return (SteamAPICall_t)NativeMethods.ISteamApps_GetFileDetails(CSteamGameServerAPIContext.GetSteamApps(), pszFileName2);
	}

	public static int GetLaunchCommandLine(out string pszCommandLine, int cubCommandLine)
	{
		InteropHelp.TestIfAvailableGameServer();
		IntPtr intPtr = Marshal.AllocHGlobal(cubCommandLine);
		int num = NativeMethods.ISteamApps_GetLaunchCommandLine(CSteamGameServerAPIContext.GetSteamApps(), intPtr, cubCommandLine);
		pszCommandLine = ((num != -1) ? InteropHelp.PtrToStringUTF8(intPtr) : null);
		Marshal.FreeHGlobal(intPtr);
		return num;
	}

	public static bool BIsSubscribedFromFamilySharing()
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsSubscribedFromFamilySharing(CSteamGameServerAPIContext.GetSteamApps());
	}

	public static bool BIsTimedTrial(out uint punSecondsAllowed, out uint punSecondsPlayed)
	{
		InteropHelp.TestIfAvailableGameServer();
		return NativeMethods.ISteamApps_BIsTimedTrial(CSteamGameServerAPIContext.GetSteamApps(), out punSecondsAllowed, out punSecondsPlayed);
	}
}