[bot] Implement WorldPlayerRemove(...)

This commit is contained in:
RD42 2024-06-08 21:44:02 +08:00
parent 0902c67707
commit 5ce9095241
3 changed files with 24 additions and 8 deletions

View File

@ -223,10 +223,26 @@ void WorldPlayerDeath(RPCParameters *rpcParams)
}
//----------------------------------------------------
// Physical player should be removed
void UnkA3(RPCParameters *rpcParams)
void WorldPlayerRemove(RPCParameters *rpcParams)
{
// TODO: UnkA3
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
int iBitLength = rpcParams->numberOfBitsOfData;
PlayerID sender = rpcParams->sender;
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
PLAYERID playerId=0;
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
bsData.Read(playerId);
if(pNetGame->GetPlayerPool()->GetSlotState(playerId) == FALSE) return;
pNetGame->SetPlayerAdded(playerId,FALSE);
if(pNetGame->GetBotMode()) {
pNetGame->GetBotMode()->OnPlayerStreamOut(playerId);
}
}
//----------------------------------------------------
@ -481,10 +497,10 @@ void RegisterRPCs(RakClientInterface * pRakClient)
REGISTER_STATIC_RPC(pRakClient,RequestClass);
REGISTER_STATIC_RPC(pRakClient,RequestSpawn);
REGISTER_STATIC_RPC(pRakClient,WorldPlayerAdd);
REGISTER_STATIC_RPC(pRakClient,UnkA3);
REGISTER_STATIC_RPC(pRakClient,UnkA4);
REGISTER_STATIC_RPC(pRakClient,UnkA5);
REGISTER_STATIC_RPC(pRakClient,WorldPlayerDeath);
REGISTER_STATIC_RPC(pRakClient,WorldPlayerRemove);
}
//----------------------------------------------------
@ -511,10 +527,10 @@ void UnRegisterRPCs(RakClientInterface * pRakClient)
UNREGISTER_STATIC_RPC(pRakClient,Unk1D);
UNREGISTER_STATIC_RPC(pRakClient,Unk1E);
UNREGISTER_STATIC_RPC(pRakClient,WorldPlayerAdd);
UNREGISTER_STATIC_RPC(pRakClient,UnkA3);
UNREGISTER_STATIC_RPC(pRakClient,UnkA4);
UNREGISTER_STATIC_RPC(pRakClient,UnkA5);
UNREGISTER_STATIC_RPC(pRakClient,WorldPlayerDeath);
UNREGISTER_STATIC_RPC(pRakClient,WorldPlayerRemove);
UNREGISTER_STATIC_RPC(pRakClient,ServerJoin);
UNREGISTER_STATIC_RPC(pRakClient,ServerQuit);
UNREGISTER_STATIC_RPC(pRakClient,InitGame);

View File

@ -36,11 +36,11 @@
#define RPC_Unk1D "\x1D"
#define RPC_Unk1E "\x1E"
#define RPC_Unk3C "\x3C"
#define RPC_UnkA3 "\xA3"
#define RPC_UnkA4 "\xA4"
#define RPC_UnkA5 "\xA5"
#define RPC_WorldPlayerAdd "\x20"
#define RPC_WorldPlayerDeath "\xA6"
#define RPC_WorldPlayerRemove "\xA3"
#define RPC_DamageVehicle "\x6A"
#define RPC_Unk18 "\x18"
#define RPC_EnterVehicle "\x1A"

View File

@ -25,11 +25,11 @@ void Weather(RPCParameters *rpcParams) {}
void Unk1D(RPCParameters *rpcParams) {}
void Unk1E(RPCParameters *rpcParams) {}
void Unk3C(RPCParameters *rpcParams) {}
void UnkA3(RPCParameters *rpcParams) {}
void UnkA4(RPCParameters *rpcParams) {}
void UnkA5(RPCParameters *rpcParams) {}
void WorldPlayerAdd(RPCParameters *rpcParams) {}
void WorldPlayerDeath(RPCParameters *rpcParams) {}
void WorldPlayerRemove(RPCParameters *rpcParams) {}
void DamageVehicle(RPCParameters *rpcParams) {}
void Unk18(RPCParameters *rpcParams) {}
void EnterVehicle(RPCParameters *rpcParams) {}
@ -76,11 +76,11 @@ void RegisterRPCs(RakClientInterface * pRakClient)
REGISTER_STATIC_RPC(pRakClient,Unk1D);
REGISTER_STATIC_RPC(pRakClient,Unk1E);
REGISTER_STATIC_RPC(pRakClient,Unk3C);
REGISTER_STATIC_RPC(pRakClient,UnkA3);
REGISTER_STATIC_RPC(pRakClient,UnkA4);
REGISTER_STATIC_RPC(pRakClient,UnkA5);
REGISTER_STATIC_RPC(pRakClient,WorldPlayerAdd);
REGISTER_STATIC_RPC(pRakClient,WorldPlayerDeath);
REGISTER_STATIC_RPC(pRakClient,WorldPlayerRemove);
REGISTER_STATIC_RPC(pRakClient,DamageVehicle);
REGISTER_STATIC_RPC(pRakClient,Unk18);
REGISTER_STATIC_RPC(pRakClient,EnterVehicle);
@ -106,11 +106,11 @@ void RegisterRPCs(RakClientInterface * pRakClient)
void UnRegisterRPCs(RakClientInterface * pRakClient)
{
UNREGISTER_STATIC_RPC(pRakClient,Unk3C);
UNREGISTER_STATIC_RPC(pRakClient,UnkA3);
UNREGISTER_STATIC_RPC(pRakClient,UnkA4);
UNREGISTER_STATIC_RPC(pRakClient,UnkA5);
UNREGISTER_STATIC_RPC(pRakClient,WorldPlayerAdd);
UNREGISTER_STATIC_RPC(pRakClient,WorldPlayerDeath);
UNREGISTER_STATIC_RPC(pRakClient,WorldPlayerRemove);
UNREGISTER_STATIC_RPC(pRakClient,Unk18);
UNREGISTER_STATIC_RPC(pRakClient,RequestClass);
UNREGISTER_STATIC_RPC(pRakClient,RequestSpawn);