CN1602 is the local client. KR is the official tree with unpacked Data, System, and Sound. Packed .wpk files stay off git.
181 lines
5.0 KiB
C++
181 lines
5.0 KiB
C++
#include "StdAfx.h"
|
|
#include ".\gameserverex.h"
|
|
|
|
//PARSER
|
|
#include "GameScriptParserManager.h"
|
|
#include <SunEventInfoParser.h>
|
|
#include <PacketStruct_ServerCommon.h>
|
|
#ifdef _APPLY_NHN_FILTERFING
|
|
#include <IAF_Export.h> //lib ???
|
|
#endif
|
|
//custom
|
|
#include "ServerOptionParser.h"
|
|
#include "ObjectFactory.h"
|
|
#include "GamePartyManager.h"
|
|
#include "SummonManager.h"
|
|
#include "StatusFactory.h"
|
|
#include "StatisticsManager.h"
|
|
#include "GameZoneManager.h"
|
|
#include "UnitGroupManager.h"
|
|
#include "QuestManager_Concrete.h"
|
|
#include "DropManager.h"
|
|
#include "PacketHandler/PacketHandler.h"
|
|
#include "ResrcManager.h"
|
|
#include "TradeManager.h"
|
|
#include "GameGuildManager.h"
|
|
#include "RatioManager.h"
|
|
#include "FunctionalRestrictManager.h"
|
|
#include "PeakTimeEvent.h"
|
|
#include "MovementChecker.h"
|
|
#include <EventManager.h>
|
|
#include <AppliedItemDependencyChain.h>
|
|
#include <AppliedNpcDependencyChain.h>
|
|
|
|
//#endif //__WAVERIX_SOLAR_AUTH_SERVER_IMPLEMENTATION__
|
|
|
|
#include <ProhibitionWordParser.h>
|
|
#include <World/GameWarControlManager.h>
|
|
#include "GameRankingManager.h"
|
|
|
|
static VOID _StartManagerOnScriptPreLoad()
|
|
{
|
|
AppliedNpcDependencyChain::CreateInstance();
|
|
if( !AppliedNpcDependencyChain::GetWorkKey() )
|
|
{
|
|
AppliedNpcDependencyChain* pWorkNode = AppliedNpcDependencyChain::Instance();
|
|
WORK_KEY wKey = WorkLoadManager::RegisterTask( pWorkNode );
|
|
AppliedNpcDependencyChain::SetWorkKey( wKey );
|
|
}
|
|
}
|
|
|
|
static VOID TraceInitStep(const char* step)
|
|
{
|
|
if (FILE* trace = fopen("script_load_trace.txt", "a"))
|
|
{
|
|
fprintf(trace, "step %s\n", step);
|
|
fclose(trace);
|
|
}
|
|
}
|
|
|
|
static VOID _StartManagerOnScriptLoaded()
|
|
{
|
|
TraceInitStep("EventManager");
|
|
if( !EventManager::GetWorkKey() )
|
|
{
|
|
IWorkNode* pWorkNode = new EventManager();
|
|
WORK_KEY wKey = WorkLoadManager::RegisterTask( pWorkNode );
|
|
EventManager::SetWorkKey( wKey );
|
|
}
|
|
|
|
TraceInitStep("AppliedItemDependencyChain");
|
|
AppliedItemDependencyChain::CreateInstance();
|
|
if( !AppliedItemDependencyChain::GetWorkKey() )
|
|
{
|
|
AppliedItemDependencyChain* pWorkNode = AppliedItemDependencyChain::Instance();
|
|
WORK_KEY wKey = WorkLoadManager::RegisterTask( pWorkNode );
|
|
AppliedItemDependencyChain::SetWorkKey( wKey );
|
|
}
|
|
|
|
TraceInitStep("MovementChecker::PreCalcScript");
|
|
MovementChecker::PreCalcScript();
|
|
|
|
TraceInitStep("GameWarControlManager");
|
|
if( !GameWarControlManager::GetWorkKey() )
|
|
{
|
|
GameWarControlManager* pWorkNode = new GameWarControlManager();
|
|
const WORK_KEY wKey = WorkLoadManager::RegisterTask( pWorkNode );
|
|
GameWarControlManager::SetWorkKey( wKey );
|
|
}
|
|
|
|
TraceInitStep("HighLoadBalancer");
|
|
HighLoadBalancer::CreateInstance();
|
|
// CHANGES: f110511.1L, shared logic, _NA002635_GP_DP_PROTOCOL_UINIFICATION
|
|
#ifdef _NA_008012_20150130_RANKING_SYSTEM
|
|
TraceInitStep("GameRankingMgr::OnScriptsLoaded");
|
|
g_GameRankingMgr.OnScriptsLoaded();
|
|
#endif // _NA_008012_20150130_RANKING_SYSTEM
|
|
// CHANGES: f110809.1L
|
|
TraceInitStep("NpcHeartbeat::OnAiScriptLoaded");
|
|
nsAI::NpcHeartbeat::OnAiScriptLoaded();
|
|
TraceInitStep("_StartManagerOnScriptLoaded done");
|
|
};
|
|
|
|
BOOL GameServerEx::ParserInit()
|
|
{
|
|
SERVER_POOL_OPTION& stServerPoolOptionInfo = ServerOptionParser::Instance()->GetPoolInfo();
|
|
|
|
GameScriptParserManager::Instance()->RegisterParser();
|
|
GameScriptParserManager::Instance()->InitParserPool( (VOID*)&stServerPoolOptionInfo );
|
|
|
|
_StartManagerOnScriptPreLoad();
|
|
|
|
#ifdef __WAVERIX_SOLAR_AUTH_SERVER_IMPLEMENTATION__
|
|
return TRUE;
|
|
#else
|
|
GameScriptParserManager::Instance()->Load();
|
|
#endif
|
|
|
|
TraceInitStep("after Load, before _StartManagerOnScriptLoaded");
|
|
_StartManagerOnScriptLoaded();
|
|
TraceInitStep("ParserInit return");
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
void GameServerEx::ParserRelease()
|
|
{
|
|
ServerOptionParser::Instance()->Release(); ServerOptionParser::DestroyInstance();
|
|
|
|
GameScriptParserManager::Instance()->Release();
|
|
GameScriptParserManager::Instance()->DestroyInstanceEx();
|
|
GameScriptParserManager::DestroyInstance();
|
|
}
|
|
|
|
|
|
#ifdef __WAVERIX_SOLAR_AUTH_SERVER_IMPLEMENTATION__
|
|
|
|
VOID GameServerEx::ReadyToStartServer()
|
|
{
|
|
g_pGameServer->LogicInit();
|
|
|
|
ScriptDataManager::RegisterCallbackAllDataLoaded( GameServerSyncWithMasterServer );
|
|
|
|
#ifdef _APPLY_NHN_FILTERFING
|
|
static BOOLEAN s_bInited = 0;
|
|
if(s_bInited == 0)
|
|
{
|
|
int result = IAF::LoadAbuseDB();
|
|
// error handling?
|
|
if(result != 0)
|
|
{
|
|
SUNLOG(eCRITICAL_LOG, "Fail to load IAF LoadAbuseDB %d", result);
|
|
return;
|
|
}
|
|
}
|
|
#endif
|
|
|
|
// ?? ???? PHASE_EXCHANGE?? ?????.
|
|
// ?? ??????? ?????? ????? ??????? ?????. ???? ????? ????? ??.
|
|
ServerSession* pSendSession = g_pGameServer->GetMasterServerSession();
|
|
if( pSendSession )
|
|
{
|
|
MSG_SERVERCOMMON_DATA_TRANSFER_SENDDATA_NTF msgNTF;
|
|
pSendSession->Send( (BYTE*)&msgNTF, sizeof(msgNTF) );
|
|
}
|
|
|
|
_StartManagerOnScriptLoaded();
|
|
}
|
|
|
|
VOID GameServerEx::GameServerSyncWithMasterServer()
|
|
{
|
|
// ?? ???? PHASE_EXCHANGE?? ?????.
|
|
ServerSession* pSendSession = g_pGameServer->GetMasterServerSession();
|
|
if( pSendSession )
|
|
{
|
|
MSG_SERVERCOMMON_DATA_TRANSFER_SENDDATA_NTF msgNTF;
|
|
pSendSession->Send( (BYTE*)&msgNTF, sizeof(msgNTF) );
|
|
}
|
|
}
|
|
|
|
#endif //__WAVERIX_SOLAR_AUTH_SERVER_IMPLEMENTATION__
|