From 263f756a20763eb4eac34bcf47ccecd55ffdd10e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Thu, 14 Mar 2019 07:56:44 +0100 Subject: [PATCH] Add STATICSCHEME macro to be used with requests to STATICSERVER Make up your mind, jacob1! --- src/Config.h | 4 +--- src/client/Client.cpp | 4 ++-- src/client/http/AvatarRequest.cpp | 2 +- src/client/http/ThumbnailRequest.cpp | 4 ++-- src/gui/preview/PreviewModel.cpp | 6 +++--- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/Config.h b/src/Config.h index f3985934b..edc7930c7 100644 --- a/src/Config.h +++ b/src/Config.h @@ -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 diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 9b2bd60dd..4456d7ace 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -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); diff --git a/src/client/http/AvatarRequest.cpp b/src/client/http/AvatarRequest.cpp index 00f70b43a..2e0ee144f 100644 --- a/src/client/http/AvatarRequest.cpp +++ b/src/client/http/AvatarRequest.cpp @@ -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) { } diff --git a/src/client/http/ThumbnailRequest.cpp b/src/client/http/ThumbnailRequest.cpp index 03c6e28dc..8581df245 100644 --- a/src/client/http/ThumbnailRequest.cpp +++ b/src/client/http/ThumbnailRequest.cpp @@ -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) { } diff --git a/src/gui/preview/PreviewModel.cpp b/src/gui/preview/PreviewModel.cpp index 2d7c6e166..774b63374 100644 --- a/src/gui/preview/PreviewModel.cpp +++ b/src/gui/preview/PreviewModel.cpp @@ -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;