mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Closes #182 -- dpogue/kill_utils
Conflicts: Sources/Plasma/Apps/plClient/winmain.cpp
This commit is contained in:
@ -121,7 +121,7 @@ bool gPendingActivate = false;
|
||||
bool gPendingActivateFlag = false;
|
||||
|
||||
static bool s_loginDlgRunning = false;
|
||||
static CEvent s_statusEvent(kEventManualReset);
|
||||
static hsSemaphore s_statusEvent(0); // Start non-signalled
|
||||
static UINT s_WmTaskbarList = RegisterWindowMessage("TaskbarButtonCreated");
|
||||
|
||||
FILE *errFP = nil;
|
||||
@ -1129,7 +1129,7 @@ void StatusCallback(void *param)
|
||||
{
|
||||
HWND hwnd = (HWND)param;
|
||||
|
||||
char *statusUrl = hsWStringToString(GetServerStatusUrl());
|
||||
const char *statusUrl = GetServerStatusUrl();
|
||||
CURL *hCurl = curl_easy_init();
|
||||
|
||||
// For reporting errors
|
||||
@ -1153,9 +1153,8 @@ void StatusCallback(void *param)
|
||||
}
|
||||
|
||||
curl_easy_cleanup(hCurl);
|
||||
delete [] statusUrl;
|
||||
|
||||
s_statusEvent.Signal();
|
||||
s_statusEvent.Signal(); // Signal the semaphore
|
||||
}
|
||||
|
||||
BOOL CALLBACK UruLoginDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam )
|
||||
@ -1211,7 +1210,7 @@ BOOL CALLBACK UruLoginDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||
case WM_DESTROY:
|
||||
{
|
||||
s_loginDlgRunning = false;
|
||||
s_statusEvent.Wait(kEventWaitForever);
|
||||
s_statusEvent.Wait();
|
||||
KillTimer(hwndDlg, AUTH_LOGIN_TIMER);
|
||||
return TRUE;
|
||||
}
|
||||
@ -1283,8 +1282,8 @@ BOOL CALLBACK UruLoginDialogProc( HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
|
||||
}
|
||||
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_URULOGIN_GAMETAPLINK)
|
||||
{
|
||||
const wchar_t *signupurl = GetServerSignupUrl();
|
||||
ShellExecuteW(NULL, L"open", signupurl, NULL, NULL, SW_SHOWNORMAL);
|
||||
const char* signupurl = GetServerSignupUrl();
|
||||
ShellExecuteA(NULL, "open", signupurl, NULL, NULL, SW_SHOWNORMAL);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@ -1490,25 +1489,27 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
|
||||
memset(&si, 0, sizeof(si));
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
si.cb = sizeof(si);
|
||||
wchar_t cmdLine[MAX_PATH];
|
||||
const wchar_t ** addrs;
|
||||
|
||||
plStringStream cmdLine;
|
||||
const char** addrs;
|
||||
|
||||
if (!eventExists) // if it is missing, assume patcher wasn't launched
|
||||
{
|
||||
StrCopy(cmdLine, s_patcherExeName, arrsize(cmdLine));
|
||||
cmdLine << _TEMP_CONVERT_FROM_WCHAR_T(s_patcherExeName);
|
||||
|
||||
GetAuthSrvHostnames(&addrs);
|
||||
if(wcslen(addrs[0]))
|
||||
StrPrintf(cmdLine, arrsize(cmdLine), L"%ws /AuthSrv=%ws", cmdLine, addrs[0]);
|
||||
if(strlen(addrs[0]))
|
||||
cmdLine << plString::Format(" /AuthSrv=%s", addrs[0]);
|
||||
|
||||
GetFileSrvHostnames(&addrs);
|
||||
if(wcslen(addrs[0]))
|
||||
StrPrintf(cmdLine, arrsize(cmdLine), L"%ws /FileSrv=%ws", cmdLine, addrs[0]);
|
||||
if(strlen(addrs[0]))
|
||||
cmdLine << plString::Format(" /FileSrv=%s", addrs[0]);
|
||||
|
||||
GetGateKeeperSrvHostnames(&addrs);
|
||||
if(wcslen(addrs[0]))
|
||||
StrPrintf(cmdLine, arrsize(cmdLine), L"%ws /GateKeeperSrv=%ws", cmdLine, addrs[0]);
|
||||
if(strlen(addrs[0]))
|
||||
cmdLine << plString::Format(" /GateKeeperSrv=%s", addrs[0]);
|
||||
|
||||
if(!CreateProcessW(NULL, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
||||
if(!CreateProcessW(NULL, (LPWSTR)cmdLine.GetString().ToUtf16().GetData(), NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
|
||||
{
|
||||
hsMessageBox("Failed to launch patcher", "Error", hsMessageBoxNormal);
|
||||
}
|
||||
|
Reference in New Issue
Block a user