[bot] Implement RequestSpawn(...)

This commit is contained in:
RD42 2024-06-03 22:53:22 +08:00
parent 843b2406bf
commit c82d3764fd
2 changed files with 19 additions and 1 deletions

View File

@ -42,6 +42,8 @@ BYTE unnamed_8[MAX_PLAYERS];
BOOL unnamed_7[MAX_VEHICLES];
char unnamed_4[1000][63];
bool bSpawned = false;
//----------------------------------------------------
// TODO: length assert has to be at line 397

View File

@ -7,6 +7,8 @@ extern CNetGame* pNetGame;
#define REJECT_REASON_BAD_NICKNAME 2
#define REJECT_REASON_BAD_MOD 3
extern bool bSpawned;
void EnterVehicle(RPCParameters *rpcParams) {}
void ExitVehicle(RPCParameters *rpcParams) {}
void Unk6B(RPCParameters *rpcParams) {}
@ -200,7 +202,21 @@ void RequestClass(RPCParameters *rpcParams)
void RequestSpawn(RPCParameters *rpcParams)
{
// TODO: RequestSpawn
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
int iBitLength = rpcParams->numberOfBitsOfData;
PlayerID sender = rpcParams->sender;
BYTE byteRequestOutcome=0;
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
bsData.Read(byteRequestOutcome);
if(byteRequestOutcome) {
// Let the rest of the network know we're spawning.
if(pNetGame->GetBotMode()) pNetGame->GetBotMode()->OnNPCSpawn();
bSpawned = true;
RakNet::BitStream bsSendSpawn;
pNetGame->GetRakClient()->RPC(RPC_Spawn,&bsSendSpawn,HIGH_PRIORITY,RELIABLE_SEQUENCED,0,false);
}
}
void Unk20(RPCParameters *rpcParams)