Skip to content
Permalink
Browse files

Add STATICSCHEME macro to be used with requests to STATICSERVER

Make up your mind, jacob1!
  • Loading branch information...
LBPHacker authored and jacob1 committed Mar 14, 2019
1 parent 5bc3c03 commit 263f756a20763eb4eac34bcf47ccecd55ffdd10e
@@ -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
@@ -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);

@@ -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)
{
}

@@ -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)
{
}
@@ -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;

0 comments on commit 263f756

Please sign in to comment.
You can’t perform that action at this time.