mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-11 10:54:15 +02:00
Get png avatars from the static server
Also restore concurrent connection / stream counts, and fix a bug that would cause AvatarButtons to try to fetch avatars before they knew what name they belonged to. I apparently broke this in the first PNG commit.
This commit is contained in:
@@ -5,8 +5,8 @@
|
|||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
const int curl_multi_wait_timeout_ms = 100;
|
const int curl_multi_wait_timeout_ms = 100;
|
||||||
const long curl_max_host_connections = 1;
|
const long curl_max_host_connections = 2;
|
||||||
const long curl_max_concurrent_streams = 1;
|
const long curl_max_concurrent_streams = 50;
|
||||||
|
|
||||||
namespace http
|
namespace http
|
||||||
{
|
{
|
||||||
|
@@ -26,12 +26,10 @@ void AvatarButton::OnResponse(std::unique_ptr<VideoBuffer> Avatar)
|
|||||||
|
|
||||||
void AvatarButton::Tick(float dt)
|
void AvatarButton::Tick(float dt)
|
||||||
{
|
{
|
||||||
if(!avatar && !tried)
|
if (!avatar && !tried && name.size() > 0)
|
||||||
{
|
{
|
||||||
tried = true;
|
tried = true;
|
||||||
// TODO: Currently a very expensive-to-call endpoint; skips the cache server. If we call it too quickly, we get banned as
|
RequestSetup(SCHEME STATICSERVER "/avatars/" + name + ".png", Size.X, Size.Y);
|
||||||
// an anti-DoS measure. This is why concurrent connections / connection multiplexing have been temporarily disabled.
|
|
||||||
RequestSetup(SCHEME SERVER "/Mini/GetAvatarPng.php?Username=" + name, Size.X, Size.Y);
|
|
||||||
RequestStart();
|
RequestStart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user