From ef9cb1b5a4c701a6be3bc68dba706cbbef42d3f7 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 2 Feb 2013 19:52:13 -0500 Subject: [PATCH] Fix patcher launching crazy --- Sources/Plasma/Apps/plClient/winmain.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/winmain.cpp b/Sources/Plasma/Apps/plClient/winmain.cpp index 85670e79..ccc2e7b6 100644 --- a/Sources/Plasma/Apps/plClient/winmain.cpp +++ b/Sources/Plasma/Apps/plClient/winmain.cpp @@ -1232,26 +1232,25 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC memset(&pi, 0, sizeof(pi)); si.cb = sizeof(si); - plStringStream cmdLine; const char** addrs; if (!eventExists) // if it is missing, assume patcher wasn't launched { - cmdLine << "\\" << plString::FromWchar(s_patcherExeName); + plStringStream cmdLine; GetAuthSrvHostnames(&addrs); - if(strlen(addrs[0])) - cmdLine << plString::Format(" /AuthSrv=%s", addrs[0]); + if (strlen(addrs[0])) + cmdLine << " /AuthSrv=" << addrs[0]; GetFileSrvHostnames(&addrs); - if(strlen(addrs[0])) - cmdLine << plString::Format(" /FileSrv=%s", addrs[0]); + if (strlen(addrs[0])) + cmdLine << " /FileSrv=" << addrs[0]; GetGateKeeperSrvHostnames(&addrs); - if(strlen(addrs[0])) - cmdLine << plString::Format(" /GateKeeperSrv=%s", addrs[0]); + if (strlen(addrs[0])) + cmdLine << " /GateKeeperSrv=" << addrs[0]; - if(!CreateProcessW(NULL, (LPWSTR)cmdLine.GetString().ToUtf16().GetData(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) + if(!CreateProcessW(s_patcherExeName, (LPWSTR)cmdLine.GetString().ToUtf16().GetData(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { hsMessageBox("Failed to launch patcher", "Error", hsMessageBoxNormal); }