mirror of
https://github.com/dashr9230/SA-MP.git
synced 2025-01-03 16:13:34 +08:00
[server] Update CNetGame constructor
This commit is contained in:
parent
b76af09430
commit
efae836897
10
raknet/RakNetworkFactory.cpp
Normal file
10
raknet/RakNetworkFactory.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
// TODO: Implement RakNetworkFactory.cpp
|
||||
|
||||
#include "RakNetworkFactory.h"
|
||||
#include "RakServerInterface.h"
|
||||
#include "RakServer.h"
|
||||
|
||||
RakServerInterface* RakNetworkFactory::GetRakServerInterface( void )
|
||||
{
|
||||
return new RakServer;
|
||||
}
|
19
raknet/RakNetworkFactory.h
Normal file
19
raknet/RakNetworkFactory.h
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
// TODO: Implement RakNetworkFactory.h
|
||||
|
||||
#ifndef __RAK_NETWORK_FACTORY_H
|
||||
#define __RAK_NETWORK_FACTORY_H
|
||||
|
||||
#include "Export.h"
|
||||
|
||||
class RakServerInterface;
|
||||
|
||||
class RAK_DLL_EXPORT RakNetworkFactory
|
||||
{
|
||||
public:
|
||||
|
||||
static RakServerInterface* GetRakServerInterface( void );
|
||||
|
||||
};
|
||||
|
||||
#endif
|
@ -2,6 +2,12 @@
|
||||
#ifndef SAMPSRV_MAIN_H
|
||||
#define SAMPSRV_MAIN_H
|
||||
|
||||
// -------
|
||||
// DEFINES
|
||||
// -------
|
||||
|
||||
#define MAX_PLAYERS 1000
|
||||
|
||||
#define DEFAULT_MAX_PLAYERS 50
|
||||
#define DEFAULT_LISTEN_PORT 8192
|
||||
|
||||
@ -45,6 +51,8 @@
|
||||
#include <string>
|
||||
|
||||
// Raknet
|
||||
#include "../raknet/RakServer.h"
|
||||
#include "../raknet/RakNetworkFactory.h"
|
||||
#include "../raknet/GetTime.h"
|
||||
|
||||
// amx
|
||||
|
@ -3,71 +3,71 @@
|
||||
|
||||
CNetGame::CNetGame()
|
||||
{
|
||||
m_bAllowWeapons = FALSE;
|
||||
m_byteWorldTime = 12;
|
||||
m_byteWeather = 1;
|
||||
m_bStuntBonus = true;
|
||||
m_fGravity = 0.008f;
|
||||
m_iDeathDropMoney = 0;
|
||||
field_6A = false;
|
||||
m_bVehicleFriendlyFire = FALSE;
|
||||
|
||||
// Init member variables
|
||||
m_pPlayerPool = NULL;
|
||||
m_pVehiclePool = NULL;
|
||||
m_pGameMode = NULL;
|
||||
m_pPickupPool = NULL;
|
||||
m_pObjectPool = NULL;
|
||||
m_pMenuPool = NULL;
|
||||
m_pTextPool = NULL;
|
||||
m_bNameTagLOS = true;
|
||||
m_pGangZonePool = NULL;
|
||||
m_pLabelPool = NULL;
|
||||
m_pActorPool = NULL;
|
||||
m_bLanMode = FALSE;
|
||||
field_6B = 1;
|
||||
|
||||
m_bLimitGlobalChatRadius = FALSE;
|
||||
m_fGlobalChatRadius = 10000.0f;
|
||||
m_bLimitPlayerMarkerRadius = FALSE;
|
||||
m_fPlayerMarkerRadius = 10000.0f;
|
||||
m_fNameTagDrawDistance = 70.0f;
|
||||
m_bDisableEnterExits = false;
|
||||
field_5C = 0;
|
||||
|
||||
m_iCurrentGameModeIndex = 0;
|
||||
m_iCurrentGameModeRepeat = 0;
|
||||
m_bFirstGameModeLoaded = FALSE;
|
||||
|
||||
m_pScriptTimers = new CScriptTimers;
|
||||
m_pScriptHttps = new CScriptHttps;
|
||||
|
||||
#ifndef WIN32
|
||||
m_dElapsedTime = 0.0;
|
||||
#endif
|
||||
|
||||
if(pConsole->GetIntVariable("maxplayers") > MAX_PLAYERS) {
|
||||
pConsole->SetIntVariable("maxplayers", MAX_PLAYERS);
|
||||
}
|
||||
|
||||
CHAR *szBindAddress = pConsole->GetStringVariable("bind");
|
||||
if (szBindAddress && szBindAddress[0] == 0)
|
||||
szBindAddress = NULL;
|
||||
|
||||
DWORD dwPort = pConsole->GetIntVariable("port");
|
||||
DWORD dwMaxPlayers = pConsole->GetIntVariable("maxplayers");
|
||||
BOOL bLanMode = pConsole->GetBoolVariable("lanmode");
|
||||
|
||||
// Setup RakNet
|
||||
m_pRak = RakNetworkFactory::GetRakServerInterface();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO: CNetGame::CNetGame W: 0048EEE0 L: 080AF360
|
||||
|
||||
/*_this = this;
|
||||
this->field_8 = 0;
|
||||
this->field_C = 0;
|
||||
this->field_0 = 0;
|
||||
this->field_10 = 0;
|
||||
this->field_14 = 0;
|
||||
this->field_18 = 0;
|
||||
this->field_1C = 0;
|
||||
this->field_77 = 1;
|
||||
this->field_24 = 0;
|
||||
this->field_20 = 0;
|
||||
this->field_28 = 0;
|
||||
this->field_50 = 0;
|
||||
this->field_6B = 1;
|
||||
dword_515CF8 = 0;
|
||||
this->field_5A = 0;
|
||||
this->field_59 = 12;
|
||||
this->field_5D = 1;
|
||||
this->field_5B = 1;
|
||||
LODWORD(this->field_62) = 1006834287;
|
||||
this->field_66 = 0;
|
||||
this->field_6A = 0;
|
||||
this->field_7E = 0;
|
||||
this->field_6C = 0;
|
||||
LODWORD(this->field_6E) = 1176256512;
|
||||
this->field_79 = 0;
|
||||
LODWORD(this->field_7A) = 1176256512;
|
||||
LODWORD(this->field_72) = 1116471296;
|
||||
this->field_76 = 0;
|
||||
this->field_5C = 0;
|
||||
this->field_2C = 0;
|
||||
this->field_30 = 0;
|
||||
this->field_34 = 0;
|
||||
v2 = operator new(0x10u);
|
||||
v26 = 0;
|
||||
if ( v2 )
|
||||
v3 = sub_482BF0(v2);
|
||||
else
|
||||
v3 = 0;
|
||||
_this->field_3C = v3;
|
||||
v4 = operator new(0x320u);
|
||||
v26 = 1;
|
||||
if ( v4 )
|
||||
v5 = sub_4809D0(v4);
|
||||
else
|
||||
v5 = 0;
|
||||
_this->field_38 = v5;
|
||||
v26 = -1;
|
||||
if ( CConsole::GetIntVariable(pConsole, "maxplayers") > 1000 )
|
||||
CConsole::SetIntVariable(pConsole, "maxplayers", 1000);
|
||||
v6 = CConsole::GetStringVariable(pConsole, "bind");
|
||||
v7 = v6;
|
||||
v21 = v6;
|
||||
if ( v6 && !*v6 )
|
||||
{
|
||||
v21 = 0;
|
||||
v7 = 0;
|
||||
}
|
||||
v8 = CConsole::GetIntVariable(pConsole, "port");
|
||||
v19 = CConsole::GetIntVariable(pConsole, "maxplayers");
|
||||
v20 = CConsole::GetBoolVariable(pConsole, "lanmode");
|
||||
v9 = RakNetworkFactory::GetRakServerInterface();
|
||||
_this->field_40 = v9;
|
||||
/*
|
||||
sub_496D10(v9);
|
||||
dword_515CFC = sub_44E9D0();
|
||||
_this->field_44 = sub_48DBD0(_this);
|
||||
|
@ -2,8 +2,6 @@
|
||||
#ifndef SAMPSRV_NETGAME_H
|
||||
#define SAMPSRV_NETGAME_H
|
||||
|
||||
class RakServerInterface {}; // TODO: RakServerInterface placeholder, remove this later
|
||||
|
||||
class CNetGame // size: W: 14808 L: 14816
|
||||
{
|
||||
private:
|
||||
|
@ -129,6 +129,30 @@
|
||||
<File
|
||||
RelativePath="..\raknet\GetTime.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\raknet\RakNetworkFactory.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\raknet\RakNetworkFactory.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\raknet\RakPeer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\raknet\RakPeer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\raknet\RakPeerInterface.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\raknet\RakServer.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\raknet\RakServer.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\raknet\RakServerInterface.h">
|
||||
</File>
|
||||
<Filter
|
||||
Name="amx"
|
||||
Filter="">
|
||||
|
Loading…
x
Reference in New Issue
Block a user