diff --git a/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt b/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt index 4b2daced..f8a384a1 100644 --- a/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt +++ b/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories("../../Apps") include_directories("../../CoreLib") +include_directories("../../FeatureLib") include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") @@ -30,6 +31,7 @@ add_executable(plUruLauncher WIN32 ${plUruLauncher_SOURCES} ${plUruLauncher_HEAD ${plUruLauncher_RESOURCES}) target_link_libraries(plUruLauncher CoreLib) target_link_libraries(plUruLauncher CoreLibExe) +target_link_libraries(plUruLauncher pfConsoleCore) target_link_libraries(plUruLauncher plAudioCore) target_link_libraries(plUruLauncher plClientPatcher) target_link_libraries(plUruLauncher plCompression) diff --git a/Sources/Plasma/Apps/plUruLauncher/Main.cpp b/Sources/Plasma/Apps/plUruLauncher/Main.cpp index 3aeb2b1b..88347521 100644 --- a/Sources/Plasma/Apps/plUruLauncher/Main.cpp +++ b/Sources/Plasma/Apps/plUruLauncher/Main.cpp @@ -730,26 +730,31 @@ void SetBytesRemainingCallback (unsigned bytes) { enum { - kArgFileSrv, + kArgServerIni, kArgNoSelfPatch, kArgBuildId, kArgCwd, }; static const CmdArgDef s_cmdLineArgs[] = { - { kCmdArgFlagged | kCmdTypeString, L"FileSrv", kArgFileSrv }, + { kCmdArgFlagged | kCmdTypeString, L"ServerIni", kArgServerIni }, { kCmdArgFlagged | kCmdTypeBool, L"NoSelfPatch", kArgNoSelfPatch }, { kCmdArgFlagged | kCmdTypeInt, L"BuildId", kArgBuildId }, { kCmdArgFlagged | kCmdTypeBool, L"Cwd", kArgCwd }, }; +#include "pfConsoleCore/pfConsoleEngine.h" +PF_CONSOLE_LINK_FILE(Core) + //============================================================================ int __stdcall WinMain ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow -){ +){ + PF_CONSOLE_INITIALIZE(Core) + wchar token[256]; const wchar *appCmdLine = AppGetCommandLine(); StrTokenize(&appCmdLine, token, arrsize(token), WHITESPACE); @@ -790,6 +795,24 @@ int __stdcall WinMain ( 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) { // create window thread @@ -798,8 +821,6 @@ int __stdcall WinMain ( 0, nil ); - if (cmdParser.IsSpecified(kArgFileSrv)) - SetFileSrvHostname(cmdParser.GetString(kArgFileSrv)); if(cmdParser.IsSpecified(kArgBuildId)) s_launcherInfo.buildId = cmdParser.GetInt(kArgBuildId); @@ -892,7 +913,6 @@ int __stdcall WinMain ( for (PathFind * path = paths.Ptr(); path != paths.Term(); ++path) PathDeleteFile(path->name); - SetConsoleCtrlHandler(CtrlHandler, TRUE); InitAsyncCore(); // must do this before self patch, since it needs to connect to the file server