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:
parent
1f7b01bd9e
commit
a3a874f4d6
@ -5,8 +5,8 @@
|
||||
#include <iostream>
|
||||
|
||||
const int curl_multi_wait_timeout_ms = 100;
|
||||
const long curl_max_host_connections = 1;
|
||||
const long curl_max_concurrent_streams = 1;
|
||||
const long curl_max_host_connections = 2;
|
||||
const long curl_max_concurrent_streams = 50;
|
||||
|
||||
namespace http
|
||||
{
|
||||
|
@ -26,12 +26,10 @@ void AvatarButton::OnResponse(std::unique_ptr<VideoBuffer> Avatar)
|
||||
|
||||
void AvatarButton::Tick(float dt)
|
||||
{
|
||||
if(!avatar && !tried)
|
||||
if (!avatar && !tried && name.size() > 0)
|
||||
{
|
||||
tried = true;
|
||||
// TODO: Currently a very expensive-to-call endpoint; skips the cache server. If we call it too quickly, we get banned as
|
||||
// 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);
|
||||
RequestSetup(SCHEME STATICSERVER "/avatars/" + name + ".png", Size.X, Size.Y);
|
||||
RequestStart();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user