mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[bot] Implement ConnectionRejected(...)
* Update SAMPRPC.h * Update `RegisterRPCs(...)` * Update `UnRegisterRPCs(...)`
This commit is contained in:
parent
72ab40c2e2
commit
fc879a6fdc
@ -1,5 +1,10 @@
|
|||||||
|
|
||||||
#include "../main.h"
|
#include "../main.h"
|
||||||
|
using namespace RakNet;
|
||||||
|
|
||||||
|
#define REJECT_REASON_BAD_VERSION 1
|
||||||
|
#define REJECT_REASON_BAD_NICKNAME 2
|
||||||
|
#define REJECT_REASON_BAD_MOD 3
|
||||||
|
|
||||||
void EnterVehicle(RPCParameters *rpcParams) {}
|
void EnterVehicle(RPCParameters *rpcParams) {}
|
||||||
void ExitVehicle(RPCParameters *rpcParams) {}
|
void ExitVehicle(RPCParameters *rpcParams) {}
|
||||||
@ -24,9 +29,24 @@ void GameModeRestart(RPCParameters *rpcParams)
|
|||||||
pNetGame->ShutdownForGameModeRestart();
|
pNetGame->ShutdownForGameModeRestart();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unk82(RPCParameters *rpcParams)
|
void ConnectionRejected(RPCParameters *rpcParams)
|
||||||
{
|
{
|
||||||
// TODO: Unk82
|
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
|
||||||
|
int iBitLength = rpcParams->numberOfBitsOfData;
|
||||||
|
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
|
||||||
|
BYTE byteRejectReason;
|
||||||
|
|
||||||
|
bsData.Read(byteRejectReason);
|
||||||
|
|
||||||
|
if(byteRejectReason==REJECT_REASON_BAD_VERSION) {
|
||||||
|
//logprintf("BOT: CONNECTION REJECTED. INCORRECT SA-MP VERSION!");
|
||||||
|
}
|
||||||
|
else if(byteRejectReason==REJECT_REASON_BAD_NICKNAME) {
|
||||||
|
//logprintf("BOT: CONNECTION REJECTED. BAD NICKNAME!");
|
||||||
|
}
|
||||||
|
|
||||||
|
pNetGame->GetRakClient()->Disconnect(500);
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientMessage(RPCParameters *rpcParams)
|
void ClientMessage(RPCParameters *rpcParams)
|
||||||
@ -111,7 +131,7 @@ void RegisterRPCs(RakClientInterface * pRakClient)
|
|||||||
REGISTER_STATIC_RPC(pRakClient,UpdateScoresPingsIPs);
|
REGISTER_STATIC_RPC(pRakClient,UpdateScoresPingsIPs);
|
||||||
REGISTER_STATIC_RPC(pRakClient,SvrStats);
|
REGISTER_STATIC_RPC(pRakClient,SvrStats);
|
||||||
REGISTER_STATIC_RPC(pRakClient,GameModeRestart);
|
REGISTER_STATIC_RPC(pRakClient,GameModeRestart);
|
||||||
REGISTER_STATIC_RPC(pRakClient,Unk82);
|
REGISTER_STATIC_RPC(pRakClient,ConnectionRejected);
|
||||||
REGISTER_STATIC_RPC(pRakClient,ClientMessage);
|
REGISTER_STATIC_RPC(pRakClient,ClientMessage);
|
||||||
REGISTER_STATIC_RPC(pRakClient,WorldTime);
|
REGISTER_STATIC_RPC(pRakClient,WorldTime);
|
||||||
REGISTER_STATIC_RPC(pRakClient,Unk5F);
|
REGISTER_STATIC_RPC(pRakClient,Unk5F);
|
||||||
@ -147,7 +167,7 @@ void UnRegisterRPCs(RakClientInterface * pRakClient)
|
|||||||
UNREGISTER_STATIC_RPC(pRakClient,UpdateScoresPingsIPs);
|
UNREGISTER_STATIC_RPC(pRakClient,UpdateScoresPingsIPs);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,SvrStats);
|
UNREGISTER_STATIC_RPC(pRakClient,SvrStats);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,GameModeRestart);
|
UNREGISTER_STATIC_RPC(pRakClient,GameModeRestart);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,Unk82);
|
UNREGISTER_STATIC_RPC(pRakClient,ConnectionRejected);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,ClientMessage);
|
UNREGISTER_STATIC_RPC(pRakClient,ClientMessage);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,WorldTime);
|
UNREGISTER_STATIC_RPC(pRakClient,WorldTime);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,Unk5F);
|
UNREGISTER_STATIC_RPC(pRakClient,Unk5F);
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
#define RPC_Unk27 "\x27"
|
#define RPC_Unk27 "\x27"
|
||||||
#define RPC_UpdateScoresPingsIPs "\x9B"
|
#define RPC_UpdateScoresPingsIPs "\x9B"
|
||||||
#define RPC_SvrStats "\x66"
|
#define RPC_SvrStats "\x66"
|
||||||
#define RPC_Unk82 "\x82"
|
|
||||||
#define RPC_GameModeRestart "\x28"
|
#define RPC_GameModeRestart "\x28"
|
||||||
|
#define RPC_ConnectionRejected "\x82"
|
||||||
#define RPC_ClientMessage "\x5D"
|
#define RPC_ClientMessage "\x5D"
|
||||||
#define RPC_WorldTime "\x5E"
|
#define RPC_WorldTime "\x5E"
|
||||||
#define RPC_Unk5F "\x5F"
|
#define RPC_Unk5F "\x5F"
|
||||||
|
@ -13,8 +13,8 @@ void Unk26(RPCParameters *rpcParams) {}
|
|||||||
void Unk27(RPCParameters *rpcParams) {}
|
void Unk27(RPCParameters *rpcParams) {}
|
||||||
void UpdateScoresPingsIPs(RPCParameters *rpcParams) {}
|
void UpdateScoresPingsIPs(RPCParameters *rpcParams) {}
|
||||||
void SvrStats(RPCParameters *rpcParams) {}
|
void SvrStats(RPCParameters *rpcParams) {}
|
||||||
void Unk82(RPCParameters *rpcParams) {}
|
|
||||||
void GameModeRestart(RPCParameters *rpcParams) {}
|
void GameModeRestart(RPCParameters *rpcParams) {}
|
||||||
|
void ConnectionRejected(RPCParameters *rpcParams) {}
|
||||||
void ClientMessage(RPCParameters *rpcParams) {}
|
void ClientMessage(RPCParameters *rpcParams) {}
|
||||||
void WorldTime(RPCParameters *rpcParams) {}
|
void WorldTime(RPCParameters *rpcParams) {}
|
||||||
void Unk5F(RPCParameters *rpcParams) {}
|
void Unk5F(RPCParameters *rpcParams) {}
|
||||||
@ -64,8 +64,8 @@ void RegisterRPCs(RakClientInterface * pRakClient)
|
|||||||
REGISTER_STATIC_RPC(pRakClient,Unk27);
|
REGISTER_STATIC_RPC(pRakClient,Unk27);
|
||||||
REGISTER_STATIC_RPC(pRakClient,UpdateScoresPingsIPs);
|
REGISTER_STATIC_RPC(pRakClient,UpdateScoresPingsIPs);
|
||||||
REGISTER_STATIC_RPC(pRakClient,SvrStats);
|
REGISTER_STATIC_RPC(pRakClient,SvrStats);
|
||||||
REGISTER_STATIC_RPC(pRakClient,Unk82);
|
|
||||||
REGISTER_STATIC_RPC(pRakClient,GameModeRestart);
|
REGISTER_STATIC_RPC(pRakClient,GameModeRestart);
|
||||||
|
REGISTER_STATIC_RPC(pRakClient,ConnectionRejected);
|
||||||
REGISTER_STATIC_RPC(pRakClient,ClientMessage);
|
REGISTER_STATIC_RPC(pRakClient,ClientMessage);
|
||||||
REGISTER_STATIC_RPC(pRakClient,WorldTime);
|
REGISTER_STATIC_RPC(pRakClient,WorldTime);
|
||||||
REGISTER_STATIC_RPC(pRakClient,Unk5F);
|
REGISTER_STATIC_RPC(pRakClient,Unk5F);
|
||||||
@ -132,8 +132,8 @@ void UnRegisterRPCs(RakClientInterface * pRakClient)
|
|||||||
UNREGISTER_STATIC_RPC(pRakClient,Unk27);
|
UNREGISTER_STATIC_RPC(pRakClient,Unk27);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,UpdateScoresPingsIPs);
|
UNREGISTER_STATIC_RPC(pRakClient,UpdateScoresPingsIPs);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,SvrStats);
|
UNREGISTER_STATIC_RPC(pRakClient,SvrStats);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,Unk82);
|
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,GameModeRestart);
|
UNREGISTER_STATIC_RPC(pRakClient,GameModeRestart);
|
||||||
|
UNREGISTER_STATIC_RPC(pRakClient,ConnectionRejected);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,ClientMessage);
|
UNREGISTER_STATIC_RPC(pRakClient,ClientMessage);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,WorldTime);
|
UNREGISTER_STATIC_RPC(pRakClient,WorldTime);
|
||||||
UNREGISTER_STATIC_RPC(pRakClient,Unk5F);
|
UNREGISTER_STATIC_RPC(pRakClient,Unk5F);
|
||||||
|
Loading…
Reference in New Issue
Block a user