Skip to content

Commit 9c3411c

Browse files
committed
Revert "Fix #741: Add new CServerRPCControlPacket to toggle RPCs from server (#1978)"
This reverts commit 146bd15.
1 parent 17a2f84 commit 9c3411c

21 files changed

+283
-433
lines changed

Client/mods/deathmatch/StdInc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
#include <ijsify.h>
4848
#include <Common.h>
4949
#include "net/Packets.h"
50-
#include "net/rpc_enums.h"
5150
#include "Enums.h"
5251
#include "net/SyncStructures.h"
5352
#include "CIdArray.h"

Client/mods/deathmatch/logic/CClientGame.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,6 @@ class CClientGame
440440

441441
void TriggerDiscordJoin(SString strSecret);
442442

443-
inline const bool IsServerRPCFunctionDisabled(const eServerRPCFunctions eServerRPCFunction) const { return m_disabledServerRPCFunctions[eServerRPCFunction]; };
444-
inline void SetServerRPCFunctionDisabled(const eServerRPCFunctions eServerRPCFunction, const bool bDisabled = true)
445-
{
446-
m_disabledServerRPCFunctions[eServerRPCFunction] = bDisabled;
447-
};
448-
449443
private:
450444
// CGUI Callbacks
451445
bool OnKeyDown(CGUIKeyEventArgs Args);
@@ -830,8 +824,6 @@ class CClientGame
830824
SString m_strACInfo;
831825
std::map<uint, uint> m_SentMessageIds;
832826

833-
std::array<bool, eServerRPCFunctions::NUM_SERVER_RPC_FUNCS> m_disabledServerRPCFunctions;
834-
835827
bool m_bLastKeyWasEscapeCancelled;
836828
std::set<SString> m_AllowKeyUpMap;
837829
uint m_uiPrecisionCallDepth;

Client/mods/deathmatch/logic/CNetAPI.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,9 +1993,6 @@ void CNetAPI::WriteCameraSync(NetBitStreamInterface& BitStream)
19931993

19941994
void CNetAPI::RPC(eServerRPCFunctions ID, NetBitStreamInterface* pBitStream)
19951995
{
1996-
if (g_pClientGame->IsServerRPCFunctionDisabled(ID))
1997-
return;
1998-
19991996
NetBitStreamInterface* pRPCBitStream = g_pNet->AllocateNetBitStream();
20001997
if (pRPCBitStream)
20011998
{

Client/mods/deathmatch/logic/CNetAPI.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,17 @@ class CNetAPI;
2525
#define CAM_SYNC_RATE ( g_TickRateSettings.iCamSync )
2626
#define TICK_RATE_AIM ( std::min ( TICK_RATE, g_TickRateSettings.iKeySyncRotation ) ) // Keysync or puresync update the aim, so use the shortest interval
2727

28+
enum eServerRPCFunctions
29+
{
30+
PLAYER_INGAME_NOTICE,
31+
INITIAL_DATA_STREAM,
32+
PLAYER_TARGET,
33+
PLAYER_WEAPON,
34+
KEY_BIND,
35+
CURSOR_EVENT,
36+
REQUEST_STEALTH_KILL,
37+
};
38+
2839
class CNetAPI
2940
{
3041
public:

Client/mods/deathmatch/logic/CPacketHandler.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,6 @@ bool CPacketHandler::ProcessPacket(unsigned char ucPacketID, NetBitStreamInterfa
210210
Packet_ServerInfoSync(bitStream);
211211
return true;
212212

213-
case PACKET_ID_SERVER_RPC_CONTROL:
214-
Packet_ServerRPCControl(bitStream);
215-
return true;
216-
217213
default:
218214
break;
219215
}
@@ -5324,21 +5320,6 @@ void CPacketHandler::Packet_ServerInfoSync(NetBitStreamInterface& bitStream)
53245320
}
53255321
}
53265322

5327-
void CPacketHandler::Packet_ServerRPCControl(NetBitStreamInterface& bitStream)
5328-
{
5329-
unsigned short usNumFunctions;
5330-
if (bitStream.ReadCompressed(usNumFunctions))
5331-
{
5332-
for (unsigned short us = 0; us < usNumFunctions; us++)
5333-
{
5334-
unsigned int uiServerRPCFunction;
5335-
bool bDisabled;
5336-
if (bitStream.Read(uiServerRPCFunction) && bitStream.ReadBit(bDisabled))
5337-
g_pClientGame->SetServerRPCFunctionDisabled(static_cast<eServerRPCFunctions>(uiServerRPCFunction), bDisabled);
5338-
}
5339-
}
5340-
}
5341-
53425323
//
53435324
//
53445325
//

Client/mods/deathmatch/logic/CPacketHandler.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ class CPacketHandler
100100
void Packet_ChatClear(NetBitStreamInterface& bitStream);
101101
void Packet_ServerInfoSync(NetBitStreamInterface& bitStream);
102102
void Packet_PolygonHeight(NetBitStreamInterface& bitStream);
103-
void Packet_ServerRPCControl(NetBitStreamInterface& bitStream);
104103

105104
// For debugging protocol errors during ENTITY_ADD packet
106105
void EntityAddDebugBegin(uint uiNumEntities, NetBitStreamInterface* pBitStream);

Client/mods/deathmatch/logic/rpc/CRPCFunctions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ CBlendedWeather* CRPCFunctions::m_pBlendedWeather;
4949
CClientGame* CRPCFunctions::m_pClientGame;
5050
CClientWaterManager* CRPCFunctions::m_pWaterManager;
5151

52-
SFixedArray<CRPCFunctions::SRPCHandler, eElementRPCFunctions::NUM_RPC_FUNCS> CRPCFunctions::m_RPCHandlers;
53-
SFixedArray<CRPCFunctions::SElementRPCHandler, eElementRPCFunctions::NUM_RPC_FUNCS> CRPCFunctions::m_ElementRPCHandlers;
52+
SFixedArray<CRPCFunctions::SRPCHandler, CRPCFunctions::NUM_RPC_FUNCS> CRPCFunctions::m_RPCHandlers;
53+
SFixedArray<CRPCFunctions::SElementRPCHandler, CRPCFunctions::NUM_RPC_FUNCS> CRPCFunctions::m_ElementRPCHandlers;
5454

5555
CRPCFunctions::CRPCFunctions(CClientGame* pClientGame)
5656
{

Server/mods/deathmatch/StdInc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ struct SAclRequest;
4040
#include "CBox.h"
4141
#include "CMatrix.h"
4242
#include "net/Packets.h"
43-
#include "net/rpc_enums.h"
4443
#include "Enums.h"
4544
#include <bochs_internal/bochs_crc32.h>
4645
#include "CChecksum.h"
@@ -96,7 +95,6 @@ struct SAclRequest;
9695
#include "packets/CResourceStopPacket.h"
9796
#include "packets/CResourceClientScriptsPacket.h"
9897
#include "packets/CReturnSyncPacket.h"
99-
#include "packets/CServerRPCControlPacket.h"
10098
#include "packets/CServerTextItemPacket.h"
10199
#include "packets/CUpdateInfoPacket.h"
102100
#include "packets/CUnoccupiedVehicleStartSyncPacket.h"

Server/mods/deathmatch/logic/CEvents.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ CEvents::CEvents()
1717
m_bEventCancelled = false;
1818
}
1919

20-
bool CEvents::AddEvent(const char* szName, const char* szArguments, CLuaMain* pLuaMain, bool bAllowRemoteTrigger, eServerRPCFunctions eServerRPCFunction)
20+
bool CEvents::AddEvent(const char* szName, const char* szArguments, CLuaMain* pLuaMain, bool bAllowRemoteTrigger)
2121
{
2222
assert(szName);
2323
assert(szArguments);
@@ -32,7 +32,6 @@ bool CEvents::AddEvent(const char* szName, const char* szArguments, CLuaMain* pL
3232
pEvent->strArguments = szArguments;
3333
pEvent->pLuaMain = pLuaMain;
3434
pEvent->bAllowRemoteTrigger = bAllowRemoteTrigger;
35-
pEvent->eServerRPCFunction = eServerRPCFunction;
3635

3736
m_EventHashMap[szName] = pEvent;
3837

Server/mods/deathmatch/logic/CEvents.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717

1818
struct SEvent
1919
{
20-
class CLuaMain* pLuaMain;
21-
std::string strName;
22-
std::string strArguments;
23-
bool bAllowRemoteTrigger;
24-
eServerRPCFunctions eServerRPCFunction;
20+
class CLuaMain* pLuaMain;
21+
std::string strName;
22+
std::string strArguments;
23+
bool bAllowRemoteTrigger;
2524
};
2625

2726
class CEvents
@@ -30,8 +29,7 @@ class CEvents
3029
CEvents();
3130
~CEvents() { RemoveAllEvents(); };
3231

33-
bool AddEvent(const char* szName, const char* szArguments, class CLuaMain* pLuaMain, bool bAllowRemoteTrigger,
34-
eServerRPCFunctions eServerRPCFunction = eServerRPCFunctions::NUM_SERVER_RPC_FUNCS);
32+
bool AddEvent(const char* szName, const char* szArguments, class CLuaMain* pLuaMain, bool bAllowRemoteTrigger);
3533
void RemoveEvent(SEvent* pEvent);
3634
void RemoveEvent(const char* szName);
3735
void RemoveAllEvents(class CLuaMain* pMain);

0 commit comments

Comments
 (0)