[bot] Implement ScrSetSpawnInfo(...)

This commit is contained in:
RD42 2024-06-02 22:36:16 +08:00
parent 1b58865926
commit 05e65e3d17
4 changed files with 29 additions and 8 deletions

View File

@ -61,3 +61,11 @@ void SignalHandler(int sig);
long GetTickCount();
char* strlwr(char* str);
#endif
#pragma pack(1)
typedef struct _PLAYER_SPAWN_INFO
{
char _gap0[46];
} PLAYER_SPAWN_INFO;

View File

@ -1,11 +1,24 @@
#include "../main.h"
void ScrUnk44(RPCParameters *rpcParams)
using namespace RakNet;
extern CNetGame* pNetGame;
//----------------------------------------------------
void ScrSetSpawnInfo(RPCParameters *rpcParams)
{
// TODO: ScrUnk44
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
int iBitLength = rpcParams->numberOfBitsOfData;
PlayerID sender = rpcParams->sender;
PLAYER_SPAWN_INFO SpawnInfo;
RakNet::BitStream bsData(Data,(iBitLength/8)+1,false);
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
bsData.Read((PCHAR)&SpawnInfo, sizeof(PLAYER_SPAWN_INFO));
}
//----------------------------------------------------
void ScrUnk45(RPCParameters *rpcParams) {}
void ScrUnk99(RPCParameters *rpcParams) {}
void ScrUnk0B(RPCParameters *rpcParams) {}
@ -121,7 +134,7 @@ void ScrUnk58(RPCParameters *rpcParams) {}
void RegisterScriptRPCs(RakClientInterface* pRakClient)
{
REGISTER_STATIC_RPC(pRakClient, ScrUnk44);
REGISTER_STATIC_RPC(pRakClient, ScrSetSpawnInfo);
REGISTER_STATIC_RPC(pRakClient, ScrUnk45);
REGISTER_STATIC_RPC(pRakClient, ScrUnk99);
REGISTER_STATIC_RPC(pRakClient, ScrUnk0B);
@ -195,7 +208,7 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient)
void UnRegisterScriptRPCs(RakClientInterface* pRakClient)
{
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk44);
UNREGISTER_STATIC_RPC(pRakClient, ScrSetSpawnInfo);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk45);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk0B);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk99);

View File

@ -123,7 +123,7 @@
#define RPC_ScrUnk5C "\x5C"
#define RPC_ScrUnk96 "\x96"
#define RPC_ScrUnk70 "\x70"
#define RPC_ScrUnk44 "\x44"
#define RPC_ScrSetSpawnInfo "\x44"
#define RPC_ScrUnk45 "\x45"
#define RPC_ScrUnk99 "\x99"
#define RPC_ScrUnk0B "\x0B"

View File

@ -50,7 +50,7 @@ void ScrUnk62(RPCParameters *rpcParams) {}
void ScrUnk5C(RPCParameters *rpcParams) {}
void ScrUnk96(RPCParameters *rpcParams) {}
void ScrUnk70(RPCParameters *rpcParams) {}
void ScrUnk44(RPCParameters *rpcParams) {}
void ScrSetSpawnInfo(RPCParameters *rpcParams) {}
void ScrUnk45(RPCParameters *rpcParams) {}
void ScrUnk99(RPCParameters *rpcParams) {}
void ScrUnk0B(RPCParameters *rpcParams) {}
@ -150,7 +150,7 @@ void RegisterScriptRPCs(RakClientInterface* pRakClient)
REGISTER_STATIC_RPC(pRakClient, ScrUnk5C);
REGISTER_STATIC_RPC(pRakClient, ScrUnk96);
REGISTER_STATIC_RPC(pRakClient, ScrUnk70);
REGISTER_STATIC_RPC(pRakClient, ScrUnk44);
REGISTER_STATIC_RPC(pRakClient, ScrSetSpawnInfo);
REGISTER_STATIC_RPC(pRakClient, ScrUnk45);
REGISTER_STATIC_RPC(pRakClient, ScrUnk99);
REGISTER_STATIC_RPC(pRakClient, ScrUnk0B);
@ -258,7 +258,7 @@ void UnRegisterScriptRPCs(RakClientInterface* pRakClient)
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk29);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk2A);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk2B);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk44);
UNREGISTER_STATIC_RPC(pRakClient, ScrSetSpawnInfo);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk45);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk0B);
UNREGISTER_STATIC_RPC(pRakClient, ScrUnk99);