Skip to content

Commit 2beb353

Browse files
committed
Added flag to disable plugins interface to make things quicker for devs
1 parent 8b73398 commit 2beb353

3 files changed

Lines changed: 142 additions & 18 deletions

File tree

GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/NextGenMP_defines.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#define GENERALS_ONLINE
55
#endif
66

7+
#define GENERALS_ONLINE_USE_PLUGINS_INTERFACE
8+
79
//#define USE_MAULLER_ONEDRIVE_FIX 1
810
//#define USE_STUBBJAX_TRANSPORT_CONTAIN_FIX 1
911

GeneralsMD/Code/GameEngine/Include/GameNetwork/GeneralsOnline/PluginInterfaces.h

Lines changed: 134 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#pragma once
22

3-
#define AC_ENABLED 1
4-
53
enum class EConnectionState : uint8_t
64
{
75
NOT_CONNECTED,
@@ -12,6 +10,22 @@ enum class EConnectionState : uint8_t
1210
CONNECTION_DISCONNECTED
1311
};
1412

13+
enum class ENetworkChannels : uint8_t
14+
{
15+
Game = 0,
16+
Anticheat,
17+
Signalling
18+
};
19+
20+
enum class EPacketReliability : int32_t
21+
{
22+
PACKET_RELIABILITY_UNRELIABLE_UNORDERED = 0,
23+
PACKET_RELIABILITY_RELIABLE_UNORDERED = 1,
24+
PACKET_RELIABILITY_RELIABLE_ORDERED = 2
25+
};
26+
27+
28+
1529
enum class EAnticheatActionType : int32_t
1630
{
1731
NONE = 0,
@@ -33,20 +47,8 @@ enum class EAnticheatActionReason : int32_t
3347
PermaBanned = 10
3448
};
3549

36-
enum class ENetworkChannels : uint8_t
37-
{
38-
Game = 0,
39-
Anticheat,
40-
Signalling
41-
};
42-
43-
enum class EPacketReliability : int32_t
44-
{
45-
PACKET_RELIABILITY_UNRELIABLE_UNORDERED = 0,
46-
PACKET_RELIABILITY_RELIABLE_UNORDERED = 1,
47-
PACKET_RELIABILITY_RELIABLE_ORDERED = 2
48-
};
49-
50+
#if defined(GENERALS_ONLINE_USE_PLUGINS_INTERFACE)
51+
#define AC_ENABLED 1
5052

5153
class AnticheatPlugInterface
5254
{
@@ -191,3 +193,119 @@ class AnticheatPlugInterface
191193
};
192194

193195
extern HWND ApplicationHWnd;
196+
#else
197+
class AnticheatPlugInterface
198+
{
199+
public:
200+
static bool g_bPendingExitLobby;
201+
202+
static void AC_NetworkMessageArrived(uint32_t goUserID, void* pData, uint32_t dataLen)
203+
{
204+
205+
}
206+
207+
static bool DidPluginFailToLoad() { return false; }
208+
209+
static bool IsPluginLoaded()
210+
{
211+
return true;
212+
}
213+
214+
static bool IsExternalProcessRunning()
215+
{
216+
return true;
217+
}
218+
219+
static int GetAnticheatIdentifier()
220+
{
221+
return 0;
222+
}
223+
224+
static int GetConnectionLatencyForUser(std::string mwUserID, uint32_t goUserID)
225+
{
226+
return 0;
227+
}
228+
229+
static void LoadPlugin(const char* szPluginName)
230+
{
231+
232+
}
233+
234+
static void Authenticate()
235+
{
236+
237+
}
238+
239+
static void UnloadPlugin()
240+
{
241+
242+
}
243+
244+
static void Tick()
245+
{
246+
247+
}
248+
249+
static void RefreshToken()
250+
{
251+
252+
}
253+
254+
static bool RegisterPlayer(std::string mwUserID, uint32_t goUserID)
255+
{
256+
return true;
257+
}
258+
259+
static bool DeregisterPlayer(std::string mwUserID, uint32_t goUserID)
260+
{
261+
return true;
262+
}
263+
264+
static void BeginSession()
265+
{
266+
267+
}
268+
269+
static void EndSession()
270+
{
271+
272+
}
273+
274+
static bool DoesACPluginProvideSecureGameTransport()
275+
{
276+
return false;
277+
}
278+
279+
static void SendPacket(const char* szMiddlewareUserID, uint64_t targetGoUserID, void* pData, int numBytes, ENetworkChannels channel, EPacketReliability reliability)
280+
{
281+
282+
}
283+
284+
static void StartSignalling(const char* szMiddlewareUserID, uint64_t goUserID)
285+
{
286+
287+
}
288+
289+
static int GetNextRecvPacketSize(uint8_t channelToReceiveOn)
290+
{
291+
return 0;
292+
}
293+
294+
static bool RecvPacket(uint8_t** pOutData, uint8_t channelToReceiveOn)
295+
{
296+
*pOutData = nullptr;
297+
return false;
298+
}
299+
300+
static void DisconnectPlayer(const char* szMiddlewareUserID, uint64_t goUserID)
301+
{
302+
303+
}
304+
305+
static void DisconnectAll()
306+
{
307+
308+
}
309+
};
310+
311+
#endif

GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/PluginInterfaces.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
#include "../OnlineServices_Init.h"
55
#include "../OnlineServices_Auth.h"
66

7+
bool AnticheatPlugInterface::g_bPendingExitLobby = false;
8+
9+
#if defined(GENERALS_ONLINE_USE_PLUGINS_INTERFACE)
10+
711
#define AC_PLUGIN_LOAD_FUNCTION(funcName) \
812
AnticheatPlugInterface::Functions.fn##funcName = (FuncDef##funcName)GetProcAddress(g_hACPluginModule, #funcName); \
913
if (!AnticheatPlugInterface::Functions.fn##funcName) \
@@ -285,8 +289,6 @@ void AnticheatPlugInterface::LoadPlugin(const char* szPluginName)
285289
}
286290
}
287291

288-
bool AnticheatPlugInterface::g_bPendingExitLobby = false;
289-
290292
void AnticheatPlugInterface::AC_NetworkMessageArrived(uint32_t goUserID, void* pData, uint32_t dataLen)
291293
{
292294
#if defined(AC_ENABLED)
@@ -588,3 +590,5 @@ void AnticheatPlugInterface::UnloadPlugin()
588590
}
589591
#endif
590592
}
593+
594+
#endif

0 commit comments

Comments
 (0)