Add STATICSCHEME macro to be used with requests to STATICSERVER

Make up your mind, jacob1!
This commit is contained in:
Tamás Bálint Misius 2019-03-14 07:56:44 +01:00 committed by jacob1
parent 5bc3c03082
commit 263f756a20
5 changed files with 9 additions and 11 deletions

View File

@ -87,6 +87,7 @@
#define SCHEME "https://"
#define SERVER "powdertoy.co.uk"
#define STATICSCHEME "https://"
#define STATICSERVER "static.powdertoy.co.uk"
#define LOCAL_SAVE_DIR "Saves"
@ -95,9 +96,6 @@
#define BRUSH_DIR "Brushes"
//Number of unique thumbnails to have in cache at one time
#define THUMB_CACHE_SIZE 256
#ifndef M_GRAV
#define M_GRAV 6.67300e-1
#endif

View File

@ -1195,9 +1195,9 @@ unsigned char * Client::GetSaveData(int saveID, int saveDate, int & dataLength)
dataLength = 0;
ByteString urlStr;
if (saveDate)
urlStr = ByteString::Build(SCHEME, STATICSERVER, "/", saveID, "_", saveDate, ".cps");
urlStr = ByteString::Build(STATICSCHEME, STATICSERVER, "/", saveID, "_", saveDate, ".cps");
else
urlStr = ByteString::Build(SCHEME, STATICSERVER, "/", saveID, ".cps");
urlStr = ByteString::Build(STATICSCHEME, STATICSERVER, "/", saveID, ".cps");
data = http::Request::Simple(urlStr, &dataStatus);

View File

@ -4,7 +4,7 @@
namespace http
{
AvatarRequest::AvatarRequest(ByteString username, int width, int height) :
ImageRequest(ByteString::Build(SCHEME STATICSERVER "/avatars/", username, ".pti"), width, height)
ImageRequest(ByteString::Build(STATICSCHEME STATICSERVER "/avatars/", username, ".pti"), width, height)
{
}

View File

@ -6,8 +6,8 @@ namespace http
ThumbnailRequest::ThumbnailRequest(int saveID, int saveDate, int width, int height) :
ImageRequest((
saveDate
? ByteString::Build(SCHEME STATICSERVER "/", saveID, "_", saveDate, "_small.pti")
: ByteString::Build(SCHEME STATICSERVER "/", saveID, "_small.pti")
? ByteString::Build(STATICSCHEME STATICSERVER "/", saveID, "_", saveDate, "_small.pti")
: ByteString::Build(STATICSCHEME STATICSERVER "/", saveID, "_small.pti")
), width, height)
{
}

View File

@ -72,9 +72,9 @@ void PreviewModel::UpdateSave(int saveID, int saveDate)
ByteString url;
if (saveDate)
url = ByteString::Build(SCHEME, STATICSERVER, "/", saveID, "_", saveDate, ".cps");
url = ByteString::Build(STATICSCHEME, STATICSERVER, "/", saveID, "_", saveDate, ".cps");
else
url = ByteString::Build(SCHEME, STATICSERVER, "/", saveID, ".cps");
url = ByteString::Build(STATICSCHEME, STATICSERVER, "/", saveID, ".cps");
saveDataDownload = new http::Request(url);
saveDataDownload->Start();
@ -239,7 +239,7 @@ bool PreviewModel::ParseSaveInfo(ByteString &saveInfoResponse)
saveDataDownload->Cancel();
delete saveData;
saveData = NULL;
saveDataDownload = new http::Request(ByteString::Build(SCHEME, STATICSERVER, "/2157797.cps"));
saveDataDownload = new http::Request(ByteString::Build(STATICSCHEME, STATICSERVER, "/2157797.cps"));
saveDataDownload->Start();
}
return true;