Commit 5ae93809 authored by DailyShana's avatar DailyShana

fix

parent 769b3ca9
...@@ -120,37 +120,46 @@ int main(int argc, char* argv[]) { ...@@ -120,37 +120,46 @@ int main(int argc, char* argv[]) {
bool keep_on_return = false; bool keep_on_return = false;
for(int i = 1; i < argc; ++i) { for(int i = 1; i < argc; ++i) {
if(argv[i][0] == '-' && argv[i][1] == 'e') { if(argv[i][0] == '-' && argv[i][1] == 'e' && argv[i][2]) {
ygo::dataManager.LoadDB(&argv[i][2]); ygo::dataManager.LoadDB(&argv[i][2]);
continue; continue;
} }
if(!strcmp(argv[i], "-e")) { // extra database if(!strcmp(argv[i], "-e")) { // extra database
++i; ++i;
if(i < argc)
ygo::dataManager.LoadDB(&argv[i][0]); ygo::dataManager.LoadDB(&argv[i][0]);
continue; continue;
} else if(!strcmp(argv[i], "-n")) { // nickName } else if(!strcmp(argv[i], "-n")) { // nickName
++i; ++i;
if(i < argc) {
wchar_t param[128]; wchar_t param[128];
GetParameterW(param, &argv[i][0]); GetParameterW(param, &argv[i][0]);
ygo::mainGame->ebNickName->setText(param); ygo::mainGame->ebNickName->setText(param);
}
continue; continue;
} else if(!strcmp(argv[i], "-h")) { // Host address } else if(!strcmp(argv[i], "-h")) { // Host address
++i; ++i;
if(i < argc) {
wchar_t param[128]; wchar_t param[128];
GetParameterW(param, &argv[i][0]); GetParameterW(param, &argv[i][0]);
ygo::mainGame->ebJoinHost->setText(param); ygo::mainGame->ebJoinHost->setText(param);
}
continue; continue;
} else if(!strcmp(argv[i], "-p")) { // host Port } else if(!strcmp(argv[i], "-p")) { // host Port
++i; ++i;
if(i < argc) {
wchar_t param[128]; wchar_t param[128];
GetParameterW(param, &argv[i][0]); GetParameterW(param, &argv[i][0]);
ygo::mainGame->ebJoinPort->setText(param); ygo::mainGame->ebJoinPort->setText(param);
}
continue; continue;
} else if(!strcmp(argv[i], "-w")) { // host passWord } else if(!strcmp(argv[i], "-w")) { // host passWord
++i; ++i;
if(i < argc) {
wchar_t param[128]; wchar_t param[128];
GetParameterW(param, &argv[i][0]); GetParameterW(param, &argv[i][0]);
ygo::mainGame->ebJoinPass->setText(param); ygo::mainGame->ebJoinPass->setText(param);
}
continue; continue;
} else if(!strcmp(argv[i], "-k")) { // Keep on return } else if(!strcmp(argv[i], "-k")) { // Keep on return
exit_on_return = false; exit_on_return = false;
...@@ -162,7 +171,7 @@ int main(int argc, char* argv[]) { ...@@ -162,7 +171,7 @@ int main(int argc, char* argv[]) {
continue; continue;
} else { // open deck } else { // open deck
exit_on_return = !keep_on_return; exit_on_return = !keep_on_return;
if(i < argc) { if(i + 1 < argc) {
open_file = true; open_file = true;
GetParameterW(open_file_name, &argv[i + 1][0]); GetParameterW(open_file_name, &argv[i + 1][0]);
} }
...@@ -181,7 +190,7 @@ int main(int argc, char* argv[]) { ...@@ -181,7 +190,7 @@ int main(int argc, char* argv[]) {
break; break;
} else if(!strcmp(argv[i], "-r")) { // Replay } else if(!strcmp(argv[i], "-r")) { // Replay
exit_on_return = !keep_on_return; exit_on_return = !keep_on_return;
if(i < argc) { if(i + 1 < argc) {
open_file = true; open_file = true;
GetParameterW(open_file_name, &argv[i + 1][0]); GetParameterW(open_file_name, &argv[i + 1][0]);
} }
...@@ -191,7 +200,7 @@ int main(int argc, char* argv[]) { ...@@ -191,7 +200,7 @@ int main(int argc, char* argv[]) {
break; break;
} else if(!strcmp(argv[i], "-s")) { // Single } else if(!strcmp(argv[i], "-s")) { // Single
exit_on_return = !keep_on_return; exit_on_return = !keep_on_return;
if(i < argc) { if(i + 1 < argc) {
open_file = true; open_file = true;
GetParameterW(open_file_name, &argv[i + 1][0]); GetParameterW(open_file_name, &argv[i + 1][0]);
} }
......
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