mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-19 11:49:09 +00:00
Use the server.ini in plUruLauncher so it works again
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
include_directories("../../Apps")
|
include_directories("../../Apps")
|
||||||
include_directories("../../CoreLib")
|
include_directories("../../CoreLib")
|
||||||
|
include_directories("../../FeatureLib")
|
||||||
include_directories("../../NucleusLib/inc")
|
include_directories("../../NucleusLib/inc")
|
||||||
include_directories("../../NucleusLib")
|
include_directories("../../NucleusLib")
|
||||||
include_directories("../../PubUtilLib")
|
include_directories("../../PubUtilLib")
|
||||||
@ -30,6 +31,7 @@ add_executable(plUruLauncher WIN32 ${plUruLauncher_SOURCES} ${plUruLauncher_HEAD
|
|||||||
${plUruLauncher_RESOURCES})
|
${plUruLauncher_RESOURCES})
|
||||||
target_link_libraries(plUruLauncher CoreLib)
|
target_link_libraries(plUruLauncher CoreLib)
|
||||||
target_link_libraries(plUruLauncher CoreLibExe)
|
target_link_libraries(plUruLauncher CoreLibExe)
|
||||||
|
target_link_libraries(plUruLauncher pfConsoleCore)
|
||||||
target_link_libraries(plUruLauncher plAudioCore)
|
target_link_libraries(plUruLauncher plAudioCore)
|
||||||
target_link_libraries(plUruLauncher plClientPatcher)
|
target_link_libraries(plUruLauncher plClientPatcher)
|
||||||
target_link_libraries(plUruLauncher plCompression)
|
target_link_libraries(plUruLauncher plCompression)
|
||||||
|
@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user