Browse Source

Use the server.ini in plUruLauncher so it works again

Michael Hansen 14 years ago
parent
commit
42168ecf9d
  1. 2
      Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt
  2. 30
      Sources/Plasma/Apps/plUruLauncher/Main.cpp

2
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)

30
Sources/Plasma/Apps/plUruLauncher/Main.cpp

@ -730,19 +730,22 @@ 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,
@ -750,6 +753,8 @@ int __stdcall WinMain (
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

Loading…
Cancel
Save