1
Fork 0
mirror of https://github.com/SapphireServer/Sapphire.git synced 2025-04-27 22:57:45 +00:00

add CrashHandler to lobby/api/world and cleanup test code in tools

This commit is contained in:
NotAdam 2019-03-26 23:17:57 +11:00
parent 0272ff1232
commit 0a6593bdd5
5 changed files with 15 additions and 10 deletions

View file

@ -32,6 +32,10 @@
#include "Forwards.h"
#include "SapphireAPI.h"
#include <Util/CrashHandler.h>
Sapphire::Common::Util::CrashHandler crashHandler;
Sapphire::Db::DbWorkerPool< Sapphire::Db::ZoneDbConnection > g_charaDb;
Sapphire::Data::ExdDataGenerated g_exdDataGen;
Sapphire::Network::SapphireAPI g_sapphireAPI;

View file

@ -65,6 +65,9 @@ void Util::CrashHandler::printStackTrace( unsigned int max_frames )
#ifndef _WIN32
// used as is from: https://oroboro.com/stack-trace-on-crash/
// only changes output slightly
void* addrlist[ max_frames + 1 ];
int addrlen = backtrace( addrlist, sizeof( addrlist ) / sizeof( void* ) );

View file

@ -1,5 +1,9 @@
#include "ServerLobby.h"
#include <Util/CrashHandler.h>
Sapphire::Common::Util::CrashHandler crashHandler;
Sapphire::ServerLobby g_serverLobby( "lobby.ini" );
int main( int32_t argc, char* argv[] )

View file

@ -27,21 +27,11 @@ using namespace Sapphire;
//const std::string datLocation( "/opt/sapphire_3_15_0/bin/sqpack" );
const std::string datLocation( "/mnt/c/Program Files (x86)/Steam/steamapps/common/FINAL FANTASY XIV Online/game/sqpack" );
int shit()
{
int* ptr = nullptr;
*ptr = 1;
}
int main()
{
Logger::init( "struct_test" );
shit();
Logger::info( "Setting up EXD data" );
if( !g_exdData.init( datLocation ) )
{

View file

@ -3,9 +3,13 @@
#include "ServerMgr.h"
#include <Framework.h>
#include <Util/CrashHandler.h>
using namespace Sapphire;
using namespace Sapphire::World;
Common::Util::CrashHandler crashHandler;
int main( int32_t argc, char* argv[] )
{
auto pFramework = Sapphire::make_Framework();