|
|
|
@ -47,7 +47,8 @@ Mead, WA 99021
|
|
|
|
|
#include "hsThread.h" |
|
|
|
|
#include "hsTimer.h" |
|
|
|
|
|
|
|
|
|
#include "pnUtils/pnUtils.h" // for CCmdParser |
|
|
|
|
#include "pnUtils/pnUtils.h" |
|
|
|
|
#include "pnUtils/plCmdParser.h" |
|
|
|
|
#include "pnAsyncCore/pnAsyncCore.h" |
|
|
|
|
#include "plNetGameLib/plNetGameLib.h" |
|
|
|
|
#include "plStatusLog/plStatusLog.h" |
|
|
|
@ -432,21 +433,27 @@ void plClientLauncher::ParseArguments()
|
|
|
|
|
|
|
|
|
|
enum { kArgServerIni, kArgNoSelfPatch, kArgImage, kArgRepairGame, kArgPatchOnly, |
|
|
|
|
kArgSkipLoginDialog }; |
|
|
|
|
const CmdArgDef cmdLineArgs[] = { |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeString, L"ServerIni", kArgServerIni }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"NoSelfPatch", kArgNoSelfPatch }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"Image", kArgImage }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"Repair", kArgRepairGame }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"PatchOnly", kArgPatchOnly }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"SkipLoginDialog", kArgSkipLoginDialog } |
|
|
|
|
const plCmdArgDef cmdLineArgs[] = { |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeString, "ServerIni", kArgServerIni }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, "NoSelfPatch", kArgNoSelfPatch }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, "Image", kArgImage }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, "Repair", kArgRepairGame }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, "PatchOnly", kArgPatchOnly }, |
|
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, "SkipLoginDialog", kArgSkipLoginDialog } |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
CCmdParser cmdParser(cmdLineArgs, arrsize(cmdLineArgs)); |
|
|
|
|
cmdParser.Parse(); |
|
|
|
|
std::vector<plString> args; |
|
|
|
|
args.reserve(__argc); |
|
|
|
|
for (size_t i = 0; i < __argc; i++) { |
|
|
|
|
args.push_back(plString::FromWchar(__wargv[i])); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
plCmdParser cmdParser(cmdLineArgs, arrsize(cmdLineArgs)); |
|
|
|
|
cmdParser.Parse(args); |
|
|
|
|
|
|
|
|
|
// cache 'em
|
|
|
|
|
if (cmdParser.IsSpecified(kArgServerIni)) |
|
|
|
|
fServerIni = plString::FromWchar(cmdParser.GetString(kArgServerIni)); |
|
|
|
|
fServerIni = cmdParser.GetString(kArgServerIni); |
|
|
|
|
APPLY_FLAG(kArgNoSelfPatch, kHaveSelfPatched); |
|
|
|
|
APPLY_FLAG(kArgImage, kClientImage); |
|
|
|
|
APPLY_FLAG(kArgRepairGame, kRepairGame); |
|
|
|
|