mirror of
https://github.com/edubart/otclient.git
synced 2025-12-21 16:07:12 +01:00
too many changes to list, many regressions were made, master will be UNSTABLE for a few days
This commit is contained in:
35
src/main.cpp
35
src/main.cpp
@@ -21,39 +21,12 @@
|
||||
*/
|
||||
|
||||
#include <otclient/otclient.h>
|
||||
#include <framework/core/eventdispatcher.h>
|
||||
|
||||
#include <csignal>
|
||||
|
||||
void signal_handler(int sig)
|
||||
{
|
||||
static bool signaled = false;
|
||||
switch(sig) {
|
||||
case SIGTERM:
|
||||
case SIGINT:
|
||||
if(!signaled) {
|
||||
signaled = true;
|
||||
g_dispatcher.addEvent(std::bind(&OTClient::onClose, &g_client));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WIN32_NO_CONSOLE
|
||||
#include <windows.h>
|
||||
int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nCmdShow)
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
boost::split(args, lpszArgument, boost::is_any_of(std::string(" ")));
|
||||
#else
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
for(int i=0; i<argc; ++i)
|
||||
args.push_back(argv[i]);
|
||||
#endif
|
||||
g_client.init(args);
|
||||
g_client.run();
|
||||
g_client.terminate();
|
||||
std::vector<std::string> args(argv, argv + argc);
|
||||
g_otclient.init(args);
|
||||
g_otclient.run();
|
||||
g_otclient.terminate();
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user