Skip to content

Commit

Permalink
Add STATICSCHEME macro to be used with requests to STATICSERVER
Browse files Browse the repository at this point in the history
Make up your mind, jacob1!
  • Loading branch information
LBPHacker authored and jacob1 committed Mar 19, 2019
1 parent 5bc3c03 commit 263f756
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/Config.h
Expand Up @@ -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"
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/client/Client.cpp
Expand Up @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/client/http/AvatarRequest.cpp
Expand Up @@ -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)
{
}

Expand Down
4 changes: 2 additions & 2 deletions src/client/http/ThumbnailRequest.cpp
Expand Up @@ -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)
{
}
Expand Down
6 changes: 3 additions & 3 deletions src/gui/preview/PreviewModel.cpp
Expand Up @@ -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();

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 263f756

Please sign in to comment.