mirror of
https://github.com/Dingo-Shenanigans/ReSkate.git
synced 2026-10-21 14:06:38 +02:00
Backend lists for tags, cosmetics and bans
- Read Dev / Creator / Homie Steam IDs from api.reskate.dev instead of the hardcoded list
- Creator (red) and Homie (gold) tags and hoodie/board colours; Admin tag is now pink
- Global bans: lobby hosts and dedicated servers turn banned players away
("global_bans": false in ReSkateServer.json opts a server out)
- SPECIAL menu page for listed players to hide their own tag and items
- Fix hoodie and board keeping the animated colour after the animation turns off
- Multiplayer protocol 39 -> 40
This commit is contained in:
1 parent
493cc4f5a1
commit
c930b512e6
50 files changed
+1539
-86
No files matched your search
@@ -2,6 +2,9 @@
|
||||
#include <Windows.h>
|
||||
#include <winhttp.h>
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <string>
|
||||
|
||||
namespace dingosdk::https {
|
||||
@@ -72,4 +75,24 @@ Download get(std::wstring_view url, const std::filesystem::path& destination,
|
||||
result.ok = true;
|
||||
return result;
|
||||
}
|
||||
|
||||
std::optional<std::string> get_text(std::wstring_view url, std::uint64_t max_bytes,
|
||||
std::uint32_t timeout_seconds, const wchar_t* agent, Download* result) {
|
||||
static std::atomic<unsigned> serial{};
|
||||
wchar_t folder[MAX_PATH + 1]{};
|
||||
const auto length = GetTempPathW(MAX_PATH, folder);
|
||||
const auto path = std::filesystem::path(length ? std::wstring(folder, length) : L".") /
|
||||
(L"reskate-get-" + std::to_wstring(GetCurrentProcessId()) + L"-" + std::to_wstring(++serial) + L".tmp");
|
||||
std::error_code error;
|
||||
std::filesystem::remove(path, error); // get needs a fresh destination
|
||||
const auto download = get(url, path, max_bytes, timeout_seconds, agent);
|
||||
if (result) *result = download;
|
||||
std::optional<std::string> text;
|
||||
if (download.ok) {
|
||||
std::ifstream in(path, std::ios::binary);
|
||||
text.emplace(std::istreambuf_iterator<char>(in), std::istreambuf_iterator<char>());
|
||||
}
|
||||
std::filesystem::remove(path, error);
|
||||
return text;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user