2017-08-08 13:53:47 +02:00
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
#include "ServerZone.h"
|
2017-08-11 23:13:00 +01:00
|
|
|
#include <boost/algorithm/string.hpp>
|
2018-03-09 00:06:44 +01:00
|
|
|
#include <Framework.h>
|
|
|
|
#include <Logging/Logger.h>
|
|
|
|
#include <Exd/ExdDataGenerated.h>
|
|
|
|
#include "Script/ScriptMgr.h"
|
|
|
|
#include <Database/CharaDbConnection.h>
|
|
|
|
#include <Database/DbWorkerPool.h>
|
|
|
|
#include "Linkshell/LinkshellMgr.h"
|
|
|
|
#include "Zone/TerritoryMgr.h"
|
2018-03-09 10:19:38 +01:00
|
|
|
#include "DebugCommand/DebugCommandHandler.h"
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2018-06-10 16:34:26 +00:00
|
|
|
#include <Config/ConfigMgr.h>
|
|
|
|
|
2018-03-09 00:06:44 +01:00
|
|
|
Core::Framework g_fw;
|
2018-03-02 07:22:25 -03:00
|
|
|
|
2018-03-09 00:06:44 +01:00
|
|
|
using namespace Core;
|
|
|
|
|
|
|
|
bool setupFramework()
|
|
|
|
{
|
2018-06-10 16:34:26 +00:00
|
|
|
auto pServer = boost::make_shared< ServerZone >( "zone.ini" );
|
2018-03-09 00:06:44 +01:00
|
|
|
auto pLogger = boost::make_shared< Logger >();
|
|
|
|
auto pExdData = boost::make_shared< Data::ExdDataGenerated >();
|
|
|
|
auto pScript = boost::make_shared< Scripting::ScriptMgr >();
|
|
|
|
auto pDb = boost::make_shared< Db::DbWorkerPool< Db::CharaDbConnection > >();
|
|
|
|
auto pLsMgr = boost::make_shared< LinkshellMgr >();
|
|
|
|
auto pTeriMgr = boost::make_shared< TerritoryMgr >();
|
2018-03-09 10:19:38 +01:00
|
|
|
auto pDebugCom = boost::make_shared< DebugCommandHandler >();
|
2018-06-10 16:34:26 +00:00
|
|
|
auto pConfig = boost::make_shared< ConfigMgr >();
|
2018-03-09 00:06:44 +01:00
|
|
|
|
|
|
|
pLogger->setLogPath( "log/SapphireZone_" );
|
|
|
|
pLogger->init();
|
|
|
|
|
|
|
|
g_fw.set< ServerZone >( pServer );
|
|
|
|
g_fw.set< Logger >( pLogger );
|
|
|
|
g_fw.set< Data::ExdDataGenerated >( pExdData );
|
|
|
|
g_fw.set< Scripting::ScriptMgr >( pScript );
|
|
|
|
g_fw.set< Db::DbWorkerPool< Db::CharaDbConnection > >( pDb );
|
|
|
|
g_fw.set< LinkshellMgr >( pLsMgr );
|
|
|
|
g_fw.set< TerritoryMgr >( pTeriMgr );
|
2018-03-09 10:19:38 +01:00
|
|
|
g_fw.set< DebugCommandHandler >( pDebugCom );
|
2018-06-10 16:34:26 +00:00
|
|
|
g_fw.set< ConfigMgr >( pConfig );
|
2018-03-09 00:06:44 +01:00
|
|
|
|
|
|
|
// actuall catch errors here...
|
|
|
|
return true;
|
|
|
|
}
|
2017-08-08 13:53:47 +02:00
|
|
|
|
2017-08-11 22:56:30 +01:00
|
|
|
int main( int32_t argc, char* argv[] )
|
2017-08-08 13:53:47 +02:00
|
|
|
{
|
2018-03-09 00:06:44 +01:00
|
|
|
if( !setupFramework() )
|
|
|
|
return 0; // too fucking bad...
|
|
|
|
|
|
|
|
g_fw.get< ServerZone >()->run( argc, argv );
|
2017-08-08 13:53:47 +02:00
|
|
|
return 0;
|
2018-03-09 10:19:38 +01:00
|
|
|
}
|