diff --git a/server/gameserver/app.cc b/server/gameserver/app.cc index 00efc282..78806ff0 100644 --- a/server/gameserver/app.cc +++ b/server/gameserver/app.cc @@ -123,8 +123,9 @@ static void SavePerfLog() f8::HttpClientPool::Instance()->max_user_request_delay = 0; } -bool App::Init(int argc, char* argv[]) +void App::Init() { + #if 0 signal(SIGPIPE, SIG_IGN); this->argc_ = argc; this->argv_ = argv; @@ -227,6 +228,7 @@ bool App::Init(int argc, char* argv[]) ); } return true; + #endif } void App::UnInit() @@ -598,3 +600,18 @@ int App::GetVersion() } return *version_; } + +const std::string App::GetPkgName() +{ + +} + +void App::Update() +{ + +} + +void App::DispatchSocketMsg(f8::MsgHdr* hdr) +{ + +} diff --git a/server/gameserver/app.h b/server/gameserver/app.h index 84d053fa..d776a53f 100644 --- a/server/gameserver/app.h +++ b/server/gameserver/app.h @@ -4,9 +4,10 @@ #include #include +#include struct MsgNode; -class App : public a8::Singleton +class App : public f8::UserApp, public a8::Singleton { private: App() {}; @@ -17,8 +18,11 @@ public: std::map debug_params; #endif - bool Init(int argc, char* argv[]); - void UnInit(); + virtual const std::string GetPkgName() override; + virtual void Init() override; + virtual void UnInit() override; + virtual void Update() override; + virtual void DispatchSocketMsg(f8::MsgHdr* hdr) override; int Run(); diff --git a/server/gameserver/main.cc b/server/gameserver/main.cc index 3ca4bada..f8b89104 100644 --- a/server/gameserver/main.cc +++ b/server/gameserver/main.cc @@ -1,12 +1,10 @@ #include "precompile.h" + +#include + #include "app.h" int main(int argc, char* argv[]) { - int exitcode = 0; - if (App::Instance()->Init(argc, argv)) { - exitcode = App::Instance()->Run(); - App::Instance()->UnInit(); - } - return exitcode; + return f8::App::Instance()->Run(argc, argv, App::Instance()); }