|
|
@ -215,11 +215,6 @@ static wchar_t s_clientExeName[] = L"plClient.exe"; |
|
|
|
* |
|
|
|
* |
|
|
|
***/ |
|
|
|
***/ |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
static void LogHandler (ELogSeverity severity, const wchar_t msg[]) { |
|
|
|
|
|
|
|
AsyncLogWriteMsg(L"UruPlayer", severity, msg); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|
static void NetErrorHandler (ENetProtocol protocol, ENetError error) { |
|
|
|
static void NetErrorHandler (ENetProtocol protocol, ENetError error) { |
|
|
|
|
|
|
|
|
|
|
@ -247,7 +242,8 @@ static void NetErrorHandler (ENetProtocol protocol, ENetError error) { |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
LogMsg(kLogError, L"NetErr: %s: %s", srv, NetErrorToString(error)); |
|
|
|
plString msg = plString::Format("NetErr: %S: %S", srv, NetErrorToString(error)); |
|
|
|
|
|
|
|
plStatusLog::AddLineS("patcher.log", msg.cstr()); |
|
|
|
|
|
|
|
|
|
|
|
// Notify GameTap something bad happened.
|
|
|
|
// Notify GameTap something bad happened.
|
|
|
|
if (!s_patchError) { |
|
|
|
if (!s_patchError) { |
|
|
@ -831,7 +827,9 @@ static void FileSrvIpAddressCallback ( |
|
|
|
NetCliGateKeeperDisconnect(); |
|
|
|
NetCliGateKeeperDisconnect(); |
|
|
|
|
|
|
|
|
|
|
|
if (IS_NET_ERROR(result)) { |
|
|
|
if (IS_NET_ERROR(result)) { |
|
|
|
LogMsg(kLogDebug, L"FileSrvIpAddressRequest failed: %s", NetErrorToString(result)); |
|
|
|
plString msg = plString::Format("FileSrvIpAddressRequest failed: %S", NetErrorToString(result)); |
|
|
|
|
|
|
|
plStatusLog::AddLineS("patcher.log", msg.cstr()); |
|
|
|
|
|
|
|
|
|
|
|
s_patchError = true; |
|
|
|
s_patchError = true; |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
@ -862,13 +860,14 @@ static void FileSrvIpAddressCallback ( |
|
|
|
void InitAsyncCore () { |
|
|
|
void InitAsyncCore () { |
|
|
|
if(AtomicAdd(&s_asyncCoreInitCount, 1) > 0) |
|
|
|
if(AtomicAdd(&s_asyncCoreInitCount, 1) > 0) |
|
|
|
return; |
|
|
|
return; |
|
|
|
LogRegisterHandler(LogHandler); |
|
|
|
|
|
|
|
AsyncCoreInitialize(); |
|
|
|
AsyncCoreInitialize(); |
|
|
|
AsyncLogInitialize(L"Log", false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
wchar_t productString[256]; |
|
|
|
wchar_t productString[256]; |
|
|
|
ProductString(productString, arrsize(productString)); |
|
|
|
ProductString(productString, arrsize(productString)); |
|
|
|
LogMsg(kLogPerf, L"Patcher: %s", productString); |
|
|
|
|
|
|
|
|
|
|
|
char* log = hsWStringToString(productString); |
|
|
|
|
|
|
|
plStatusLog::AddLineS("patcher.log", log); |
|
|
|
|
|
|
|
delete[] log; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
@ -880,9 +879,7 @@ void ShutdownAsyncCore () { |
|
|
|
while (s_perf[kPerfThreadTaskCount]) |
|
|
|
while (s_perf[kPerfThreadTaskCount]) |
|
|
|
AsyncSleep(10); |
|
|
|
AsyncSleep(10); |
|
|
|
|
|
|
|
|
|
|
|
AsyncLogDestroy(); |
|
|
|
|
|
|
|
AsyncCoreDestroy(30 * 1000); |
|
|
|
AsyncCoreDestroy(30 * 1000); |
|
|
|
LogUnregisterHandler(LogHandler); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
|