Browse Source

Merge pull request #68 from diafero/fixes

cleanup and fixes, coexistance of internal and external launcher
(Zrax, Dox said in IRC it's looking okay)
diafero 14 years ago
parent
commit
4020ea22ab
  1. 17
      Sources/Plasma/Apps/plClient/winmain.cpp
  2. 5
      Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp
  3. 46
      Sources/Plasma/Apps/plUruLauncher/Main.cpp
  4. 1
      Sources/Plasma/FeatureLib/pfLoginDialog/plLoginDialog.cpp
  5. 6
      Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbSrvs.cpp

17
Sources/Plasma/Apps/plClient/winmain.cpp

@ -70,12 +70,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define UPDATE_STATUSMSG_SECONDS 30
#define WM_USER_SETSTATUSMSG WM_USER+1
#if BUILD_TYPE == BUILD_TYPE_DEV
#define STATUS_PATH L"www2.cyanworlds.com"
#else
#define STATUS_PATH L"support.cyanworlds.com"
#endif
//
// Globals
//
@ -122,19 +116,12 @@ static const unsigned AUTH_FAILED_TIMER = 2;
#define FAKE_PASS_STRING "********"
//============================================================================
// External patcher file
// External patcher file (directly starting plClient is not allowed)
//============================================================================
#ifdef PLASMA_EXTERNAL_RELEASE
static wchar s_patcherExeName[] = L"UruLauncher.exe";
//============================================================================
// Internal patcher file
//============================================================================
#else
static wchar s_patcherExeName[] = L"plUruLauncher.exe";
#endif // PLASMA_EXTERNAL_RELEASE
//============================================================================
@ -1193,7 +1180,7 @@ void StatusCallback(void *param)
curl_easy_setopt(hCurl, CURLOPT_WRITEFUNCTION, &CurlCallback);
curl_easy_setopt(hCurl, CURLOPT_WRITEDATA, param);
if (curl_easy_perform(hCurl) != 0)
if (statusUrl[0] && curl_easy_perform(hCurl) != 0) // only perform request if there's actually a URL set
PostMessage(hwnd, WM_USER_SETSTATUSMSG, 0, (LPARAM) curlError);
for(unsigned i = 0; i < UPDATE_STATUSMSG_SECONDS && s_loginDlgRunning; ++i)

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

@ -164,8 +164,11 @@ double ProcessManifestEntryParam::startTime = 0;
// IMPORTANT: This string may NEVER change. Doing so will break self-patching,
// leaving clients with older patchers "dead in the water", without
// a way to play Uru.
#ifdef PLASMA_EXTERNAL_RELEASE
const wchar kPatcherExeFilename[] = L"UruLauncher.exe";
#else
const wchar kPatcherExeFilename[] = L"plUruLauncher.exe";
#endif
//============================================================================

46
Sources/Plasma/Apps/plUruLauncher/Main.cpp

@ -39,19 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define WHITESPACE L" \"\t\r\n\x1A"
#define UPDATE_STATUSMSG_SECONDS 30 // Must be an int
#if BUILD_TYPE == BUILD_TYPE_DEV
#define STATUS_PATH L"www2.cyanworlds.com"
#else
#define STATUS_PATH L"support.cyanworlds.com"
#endif
#if BUILD_TYPE == BUILD_TYPE_BETA
static const char s_postKey[] = ""; //"betakey=6C5DC90EFD7AF8892D2A65CDE5DF46D55A2777EC3D196ED83F912B62185A74DD";
#else
static const char s_postKey[] = "";
#endif
/*****************************************************************************
*
@ -605,39 +592,19 @@ static size_t CurlCallback(void *buffer, size_t size, size_t nmemb, void *)
//============================================================================
static void StatusCallback(void *)
{
CURL *hCurl;
char *serverStatus = hsWStringToString(BuildTypeServerStatusPath());
char serverUrl[256];
snprintf(serverUrl, 256, "http://support.cyanworlds.com%s", serverStatus);
delete [] serverStatus;
char *serverUrl = hsWStringToString(GetServerStatusUrl());
hCurl = curl_easy_init();
CURL * hCurl = curl_easy_init();
curl_easy_setopt(hCurl, CURLOPT_ERRORBUFFER, s_curlError);
// update while we are running
while(!s_shutdown)
{
if(BuildTypeServerStatusPath())
{
//TODO: Get a server status path from the server.ini, without
// pulling in all the annoying pfConsole dependencies.
// Alternatively, make a better launcher...
curl_easy_setopt(hCurl, CURLOPT_USERAGENT, "UruClient/1.0");
curl_easy_setopt(hCurl, CURLOPT_URL, serverUrl);
if(StrLen(s_postKey))
{
char *safeData = curl_easy_escape(hCurl, s_postKey, strlen(s_postKey));
curl_easy_setopt(hCurl, CURLOPT_POST, 1);
curl_easy_setopt(hCurl, CURLOPT_POSTFIELDS, safeData);
curl_free(safeData);
}
curl_easy_setopt(hCurl, CURLOPT_USERAGENT, "UruClient/1.0");
curl_easy_setopt(hCurl, CURLOPT_URL, serverUrl);
if (curl_easy_perform(hCurl) != 0)
SetStatusText(s_curlError);
}
if (serverUrl[0] && curl_easy_perform(hCurl) != 0) // only perform request if there's actually a URL set
SetStatusText(s_curlError);
for(unsigned i = 0; i < UPDATE_STATUSMSG_SECONDS && !s_shutdown; ++i)
{
@ -646,6 +613,7 @@ static void StatusCallback(void *)
}
curl_easy_cleanup(hCurl);
delete [] serverUrl;
s_statusEvent.Signal();
}

1
Sources/Plasma/FeatureLib/pfLoginDialog/plLoginDialog.cpp

@ -63,7 +63,6 @@ plLoginDialog::plLoginDialog( HWND parentWnd )
std::string plLoginDialog::MakeSafeLobbyServerName(const std::string & value)
{
//return plIDataServer::MakeSafeMachineName(value,"parablegame.cyanworlds.com");
return "";
}

6
Sources/Plasma/NucleusLib/pnNetBase/Private/pnNbSrvs.cpp

@ -137,9 +137,9 @@ void SetGateKeeperSrvHostname (const wchar addr[]) {
//============================================================================
// User-visible Server
//============================================================================
static wchar s_serverStatusUrl[256];
static wchar s_serverSignupUrl[256];
static wchar s_serverName[256];
static wchar s_serverStatusUrl[256] = {0};
static wchar s_serverSignupUrl[256] = {0};
static wchar s_serverName[256] = {0};
//============================================================================
const wchar *GetServerStatusUrl () {

Loading…
Cancel
Save