Commit 45556faa authored by mercury233's avatar mercury233

test

parent 6f962667
...@@ -3,10 +3,11 @@ ...@@ -3,10 +3,11 @@
#include "data_manager.h" #include "data_manager.h"
#include <event2/thread.h> #include <event2/thread.h>
int enable_log = 1; int enable_log = 0;
#ifdef YGOPRO_SERVER_MODE
enable_log = 1;
#else
bool exit_on_return = false; bool exit_on_return = false;
bool runasserver = true;
bool keep_on_return = false;
bool open_file = false; bool open_file = false;
wchar_t open_file_name[256] = L""; wchar_t open_file_name[256] = L"";
...@@ -26,7 +27,6 @@ void GetParameterW(wchar_t* param, const char* arg) { ...@@ -26,7 +27,6 @@ void GetParameterW(wchar_t* param, const char* arg) {
BufferIO::DecodeUTF8(arg, param); BufferIO::DecodeUTF8(arg, param);
#endif #endif
} }
/*
void ClickButton(irr::gui::IGUIElement* btn) { void ClickButton(irr::gui::IGUIElement* btn) {
irr::SEvent event; irr::SEvent event;
event.EventType = irr::EET_GUI_EVENT; event.EventType = irr::EET_GUI_EVENT;
...@@ -34,7 +34,8 @@ void ClickButton(irr::gui::IGUIElement* btn) { ...@@ -34,7 +34,8 @@ void ClickButton(irr::gui::IGUIElement* btn) {
event.GUIEvent.Caller = btn; event.GUIEvent.Caller = btn;
ygo::mainGame->device->postEventFromUser(event); ygo::mainGame->device->postEventFromUser(event);
} }
*/ #endif //YGOPRO_SERVER_MODE
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
#ifndef _WIN32 #ifndef _WIN32
setlocale(LC_CTYPE, "UTF-8"); setlocale(LC_CTYPE, "UTF-8");
...@@ -58,15 +59,16 @@ int main(int argc, char* argv[]) { ...@@ -58,15 +59,16 @@ int main(int argc, char* argv[]) {
evthread_use_pthreads(); evthread_use_pthreads();
#endif //_WIN32 #endif //_WIN32
ygo::Game _game; ygo::Game _game;
if (runasserver){ #ifdef YGOPRO_SERVER_MODE
ygo::aServerPort=7911; ygo::aServerPort=7911;
ygo::aServerPort=atoi(argv[1]); ygo::aServerPort=atoi(argv[1]);
ygo::lflist=atoi(argv[2]); ygo::lflist=atoi(argv[2]);
ygo::start_hand=0; ygo::start_hand=0;
ygo::replay_mode=0;
if (argc>2) { if (argc>2) {
ygo::rule=atoi(argv[3]); ygo::rule=atoi(argv[3]);
ygo::mode=atoi(argv[4]); ygo::mode=atoi(argv[4]);
if (ygo::mode > 2)
ygo::mode = 0;
if (argv[5][0]=='T') if (argv[5][0]=='T')
ygo::duel_rule=DEFAULT_DUEL_RULE-1; ygo::duel_rule=DEFAULT_DUEL_RULE-1;
else else
...@@ -83,15 +85,12 @@ int main(int argc, char* argv[]) { ...@@ -83,15 +85,12 @@ int main(int argc, char* argv[]) {
ygo::start_hand=atoi(argv[9]); ygo::start_hand=atoi(argv[9]);
ygo::draw_count=atoi(argv[10]); ygo::draw_count=atoi(argv[10]);
ygo::time_limit=atoi(argv[11]); ygo::time_limit=atoi(argv[11]);
if (argc>12)
ygo::replay_mode=atoi(argv[12]); ygo::replay_mode=atoi(argv[12]);
} }
ygo::mainGame = &_game; ygo::mainGame = &_game;
ygo::mainGame->MainServerLoop(ygo::mode, ygo::lflist); ygo::mainGame->MainServerLoop(ygo::mode, ygo::lflist);
return 0; return 0;
} #else
/*
ygo::mainGame = &_game; ygo::mainGame = &_game;
if(!ygo::mainGame->Initialize()) if(!ygo::mainGame->Initialize())
return 0; return 0;
...@@ -188,6 +187,6 @@ int main(int argc, char* argv[]) { ...@@ -188,6 +187,6 @@ int main(int argc, char* argv[]) {
#else #else
#endif //_WIN32 #endif //_WIN32
*/ #endif //YGOPRO_SERVER_MODE
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment