Browse Source

Remove AsyncLog usage from the patcher.

Darryl Pogue 13 years ago
parent
commit
fa81d44489
  1. 23
      Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp
  2. 16
      Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp

23
Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp

@ -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) {
@ -247,7 +242,8 @@ static void NetErrorHandler (ENetProtocol protocol, ENetError error) {
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.
if (!s_patchError) {
@ -831,7 +827,9 @@ static void FileSrvIpAddressCallback (
NetCliGateKeeperDisconnect();
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;
return;
}
@ -862,13 +860,14 @@ static void FileSrvIpAddressCallback (
void InitAsyncCore () {
if(AtomicAdd(&s_asyncCoreInitCount, 1) > 0)
return;
LogRegisterHandler(LogHandler);
AsyncCoreInitialize();
AsyncLogInitialize(L"Log", false);
wchar_t productString[256];
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])
AsyncSleep(10);
AsyncLogDestroy();
AsyncCoreDestroy(30 * 1000);
LogUnregisterHandler(LogHandler);
}
//============================================================================

16
Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp

@ -87,7 +87,9 @@ static wchar_t s_newPatcherFile[MAX_PATH];
//============================================================================
static void NetErrorHandler (ENetProtocol protocol, ENetError error) {
LogMsg(kLogError, L"NetErr: %s", NetErrorToString(error));
plString msg = plString::Format("NetErr: %S", NetErrorToString(error));
plStatusLog::AddLineS("patcher.log", msg.cstr());
if (IS_NET_SUCCESS(s_patchResult))
s_patchResult = error;
s_downloadComplete = true;
@ -116,7 +118,9 @@ static void DownloadCallback (
break;
default:
LogMsg(kLogError, L"Error getting patcher file: %s", NetErrorToString(result));
plString msg = plString::Format("Error getting patcher file: %S", NetErrorToString(result));
plStatusLog::AddLineS("patcher.log", msg.cstr());
if (IS_NET_SUCCESS(s_patchResult))
s_patchResult = result;
break;
@ -161,7 +165,9 @@ static void ManifestCallback (
break;
default:
LogMsg(kLogError, L"Error getting patcher manifest: %s", NetErrorToString(result));
plString msg = plString::Format("Error getting patcher manifest: %S", NetErrorToString(result));
plStatusLog::AddLineS("patcher.log", msg.cstr());
if (IS_NET_SUCCESS(s_patchResult))
s_patchResult = result;
break;
@ -211,7 +217,9 @@ static void FileSrvIpAddressCallback (
NetCliGateKeeperDisconnect();
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_patchResult = result;
s_downloadComplete = true;
}

Loading…
Cancel
Save