void InitGame(RPCParameters *rpcParams)
{
PCHAR Data = reinterpret_cast<PCHAR>(rpcParams->input);
int iBitLength = rpcParams->numberOfBitsOfData;
RakNet::BitStream bsInitGame((unsigned char *)Data,(iBitLength/8)+1,false);
PLAYERID MyPlayerID;
bool bLanMode, bStuntBonus;
BYTE byteVehicleModels[212];
bool m_bZoneNames, m_bUseCJWalk, m_bAllowWeapons, m_bLimitGlobalChatRadius;
float m_fGlobalChatRadius, m_fNameTagDrawDistance;
bool m_bDisableEnterExits, m_bNameTagLOS, m_bManualVehicleEngineAndLight;
bool m_bShowPlayerTags;
int m_iShowPlayerMarkers;
BYTE m_byteWorldTime, m_byteWeather;
float m_fGravity;
int m_iDeathDropMoney;
bool m_bInstagib;
bsInitGame.ReadCompressed(m_bZoneNames);
bsInitGame.ReadCompressed(m_bUseCJWalk);
bsInitGame.ReadCompressed(m_bAllowWeapons);
bsInitGame.ReadCompressed(m_bLimitGlobalChatRadius);
bsInitGame.Read(m_fGlobalChatRadius);
bsInitGame.ReadCompressed(bStuntBonus);
bsInitGame.Read(m_fNameTagDrawDistance);
bsInitGame.ReadCompressed(m_bDisableEnterExits);
bsInitGame.ReadCompressed(m_bNameTagLOS);
bsInitGame.ReadCompressed(m_bManualVehicleEngineAndLight); //
bsInitGame.Read(iSpawnsAvailable);
bsInitGame.Read(MyPlayerID);
bsInitGame.ReadCompressed(m_bShowPlayerTags);
bsInitGame.Read(m_iShowPlayerMarkers);
bsInitGame.Read(m_byteWorldTime);
bsInitGame.Read(m_byteWeather);
bsInitGame.Read(m_fGravity);
bsInitGame.ReadCompressed(bLanMode);
bsInitGame.Read(m_iDeathDropMoney);
bsInitGame.ReadCompressed(m_bInstagib);
// Server's send rate restrictions
if(!settings.uiForceCustomSendRates)
{
bsInitGame.Read(iNetModeNormalOnfootSendRate);
bsInitGame.Read(iNetModeNormalIncarSendRate);
bsInitGame.Read(iNetModeFiringSendRate);
bsInitGame.Read(iNetModeSendMultiplier);
}
else
bsInitGame.SetReadOffset(bsInitGame.GetReadOffset() + 4*32);
bsInitGame.Read(m_bLagCompensation);
BYTE unk;
bsInitGame.Read(unk);
bsInitGame.Read(unk);
bsInitGame.Read(unk);
BYTE byteStrLen;
bsInitGame.Read(byteStrLen);
if(byteStrLen)
{
memset(g_szHostName,0,sizeof(g_szHostName));
bsInitGame.Read(g_szHostName, byteStrLen);
}
g_szHostName[byteStrLen] = '\0';
bsInitGame.Read((char *)&byteVehicleModels[0],212);
g_myPlayerID = MyPlayerID;
char szTitle[64];
if(settings.iConsole)
{
sprintf(szTitle, "%s (%d) - %.16s - RakSAMP %s", g_szNickName, g_myPlayerID, g_szHostName, RAKSAMP_VERSION);
SetConsoleTitle(szTitle);
Log("Connected to %.64s\n", g_szHostName);
}
else
{
sprintf(szTitle, "%s (%d) - RakSAMP %s", g_szNickName, g_myPlayerID, RAKSAMP_VERSION);
SetWindowText(hwnd, szTitle);
Log("Connected to %.64s", g_szHostName);
}
iGameInited = 1;
}