|
|
@ -730,26 +730,31 @@ void SetBytesRemainingCallback (unsigned bytes) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum { |
|
|
|
enum { |
|
|
|
kArgFileSrv, |
|
|
|
kArgServerIni, |
|
|
|
kArgNoSelfPatch, |
|
|
|
kArgNoSelfPatch, |
|
|
|
kArgBuildId, |
|
|
|
kArgBuildId, |
|
|
|
kArgCwd, |
|
|
|
kArgCwd, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
static const CmdArgDef s_cmdLineArgs[] = { |
|
|
|
static const CmdArgDef s_cmdLineArgs[] = { |
|
|
|
{ kCmdArgFlagged | kCmdTypeString, L"FileSrv", kArgFileSrv }, |
|
|
|
{ kCmdArgFlagged | kCmdTypeString, L"ServerIni", kArgServerIni }, |
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"NoSelfPatch", kArgNoSelfPatch }, |
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"NoSelfPatch", kArgNoSelfPatch }, |
|
|
|
{ kCmdArgFlagged | kCmdTypeInt, L"BuildId", kArgBuildId }, |
|
|
|
{ kCmdArgFlagged | kCmdTypeInt, L"BuildId", kArgBuildId }, |
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"Cwd", kArgCwd }, |
|
|
|
{ kCmdArgFlagged | kCmdTypeBool, L"Cwd", kArgCwd }, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "pfConsoleCore/pfConsoleEngine.h" |
|
|
|
|
|
|
|
PF_CONSOLE_LINK_FILE(Core) |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
int __stdcall WinMain (
|
|
|
|
int __stdcall WinMain (
|
|
|
|
HINSTANCE hInstance, |
|
|
|
HINSTANCE hInstance, |
|
|
|
HINSTANCE hPrevInstance, |
|
|
|
HINSTANCE hPrevInstance, |
|
|
|
LPSTR lpCmdLine, |
|
|
|
LPSTR lpCmdLine, |
|
|
|
int nCmdShow |
|
|
|
int nCmdShow |
|
|
|
){
|
|
|
|
){ |
|
|
|
|
|
|
|
PF_CONSOLE_INITIALIZE(Core) |
|
|
|
|
|
|
|
|
|
|
|
wchar token[256]; |
|
|
|
wchar token[256]; |
|
|
|
const wchar *appCmdLine = AppGetCommandLine(); |
|
|
|
const wchar *appCmdLine = AppGetCommandLine(); |
|
|
|
StrTokenize(&appCmdLine, token, arrsize(token), WHITESPACE); |
|
|
|
StrTokenize(&appCmdLine, token, arrsize(token), WHITESPACE); |
|
|
@ -790,6 +795,24 @@ int __stdcall WinMain ( |
|
|
|
|
|
|
|
|
|
|
|
curl_global_init(CURL_GLOBAL_ALL); |
|
|
|
curl_global_init(CURL_GLOBAL_ALL); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const wchar *serverIni = L"server.ini"; |
|
|
|
|
|
|
|
if(cmdParser.IsSpecified(kArgServerIni)) |
|
|
|
|
|
|
|
serverIni = cmdParser.GetString(kArgServerIni); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load the server.ini so we know what to connect to
|
|
|
|
|
|
|
|
FILE *serverini = _wfopen(serverIni, L"rb"); |
|
|
|
|
|
|
|
if (serverini) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
fclose(serverini); |
|
|
|
|
|
|
|
pfConsoleEngine tempConsole; |
|
|
|
|
|
|
|
tempConsole.ExecuteFile(serverIni); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
hsMessageBox("No server.ini file found. Please check your URU installation.", "Error", hsMessageBoxNormal); |
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(!isTempPatcher) |
|
|
|
if(!isTempPatcher) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// create window thread
|
|
|
|
// create window thread
|
|
|
@ -798,8 +821,6 @@ int __stdcall WinMain ( |
|
|
|
0, |
|
|
|
0, |
|
|
|
nil
|
|
|
|
nil
|
|
|
|
); |
|
|
|
); |
|
|
|
if (cmdParser.IsSpecified(kArgFileSrv)) |
|
|
|
|
|
|
|
SetFileSrvHostname(cmdParser.GetString(kArgFileSrv)); |
|
|
|
|
|
|
|
if(cmdParser.IsSpecified(kArgBuildId)) |
|
|
|
if(cmdParser.IsSpecified(kArgBuildId)) |
|
|
|
s_launcherInfo.buildId = cmdParser.GetInt(kArgBuildId); |
|
|
|
s_launcherInfo.buildId = cmdParser.GetInt(kArgBuildId); |
|
|
|
|
|
|
|
|
|
|
@ -892,7 +913,6 @@ int __stdcall WinMain ( |
|
|
|
for (PathFind * path = paths.Ptr(); path != paths.Term(); ++path) |
|
|
|
for (PathFind * path = paths.Ptr(); path != paths.Term(); ++path) |
|
|
|
PathDeleteFile(path->name); |
|
|
|
PathDeleteFile(path->name); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SetConsoleCtrlHandler(CtrlHandler, TRUE); |
|
|
|
SetConsoleCtrlHandler(CtrlHandler, TRUE); |
|
|
|
InitAsyncCore(); // must do this before self patch, since it needs to connect to the file server
|
|
|
|
InitAsyncCore(); // must do this before self patch, since it needs to connect to the file server
|
|
|
|
|
|
|
|
|
|
|
|