Forum

> > CS2D > General > USGN Avatar won't load
Forums overviewCS2D overviewGeneral overviewLog in to reply

English USGN Avatar won't load

14 replies
To the start Previous 1 Next To the start

old USGN Avatar won't load

Ratatatat OP
User Off Offline

Quote
Even when I faced the thread where question already answered but, when I tried both two ways from that thread,nothing has worked and I wrote this to meet someone,who can help me with this that's what kind of problem it is: Always when I start game on my CS2D server my avatar looks like that us ,despite that I changed my avatar,it won't load my avatar from USGN

Please answer this question

old Re: USGN Avatar won't load

DC
Admin Off Offline

Quote
In-game UnrealSoftware.de avatar download is currently broken because I switched to HTTPS. Will try to fix it.

old Re: USGN Avatar won't load

DC
Admin Off Offline

Quote
Should work again

Edit:
Okay, no. It doesn't work.

Edit²:
Okay... finally fixed it.
I looked at the wrong code in CS2D. The relevant parts do not set "CS2D" as user agent. They don't set a user agent at all. Therefore my webserver setting which checks the user agent had no effect and kept redirecting to HTTPS.

I now adjusted the webserver rule for UnrealSoftware.de to only redirect to HTTPS if any user agent is set. If no user agent HTTP header is set the automatic HTTPS-redirect won't take place, allowing CS2D to access unrealsoftware.de data via plain old HTTP.

Hooray!

If you STILL experience problems with this please let me know!
edited 3×, last 08.08.20 09:43:37 am

old Maybe slightly off topic

saint-
User Off Offline

Quote
I experienced a similar problem with the spraylogo. On my screen the spraylogo would be my custom spraylogo, but others see my spray logo as the standard U spraylogo.

Wrote it here because reading this thread reminded me of that and maybe it could be a similar problem.

old Re: USGN Avatar won't load

gloryS
User Off Offline

Quote
Me too i have this bug with avatar and from my steam account. i change steam avatar but in game is don't change is keeping old avatar

old Re: USGN Avatar won't load

DC
Admin Off Offline

Quote
@user gloryS: That's another issue. CS2D caches all avatars and never loads them twice. So if someone changes an avatar you already loaded, it won't be changed for you.

You can manually enforce a reload by deleting the following folder and all of its contents:
sys/cache/avatars/steam

it's relative to the folder where you installed CS2D.

@user saint-: The spray logo is transferred directly via the game server using UDP. So this certainly isn't related to the HTTPS problems.
edited 1×, last 08.09.20 06:15:46 pm

old Re: USGN Avatar won't load

mrc
User Off Offline

Quote
is possible to add a button or something in the options>net tab to clear/delete avatars cache? I would also suggest an option to clear minimaps cache.

old Re: USGN Avatar won't load

mrc
User Off Offline

Quote
@user DC: ,
By any chance, did the in-game (USGN) avatar download break after this:
https://unrealsoftware.de/news.php?show=433764

I noticed another issue regarding the Steam avatar JSON files.

The references inside the JSON files appear to be correct, and the avatar URLs listed in them are accessible and working. However, when I try to open the downloaded JPG avatar files, Windows reports that the file format is not supported.

Specifically, when opening the image, I get the message:

"This file format is not supported."

And when I try to open it with Paint, I get:

"Paint can't read this file. This is not a valid bitmap file, or its format is not currently supported."

Because of this, it seems that the avatar files themselves may be corrupted or not being downloaded correctly, even though the URLs referenced in the JSON files are valid and accessible.

Also, could the Steam installation path have any influence on this issue? For example, would installing Steam in a custom directory instead of the default location affect avatar downloading or processing in any way?

old Re: USGN Avatar won't load

DC
Admin Off Offline

Quote
@user mrc: It is very possible that the server move broke it. The problem is that the avatar download needs to work via HTTP not via HTTPS because CS2D doesn't support HTTPS at all. The web server is still configured to allow HTTP if it's the CS2D client but maybe it broke something with that config.

What happens if you open the broken file with a text editor? Wouldn't surprise me if it would just contain a HTTP response code / error.

Edit:
I deleted my avatar cache (whole sys/cache/avatars folder) and it just re-downloaded and displayed my avatar without any issues. So it's working in general.

@user Gennadiy: you may have to delete your sys/cache/avatars
@user mrc: Not sure what happens on your system. like I said would be interesting to see the actual content of the cached files

old Re: USGN Avatar won't load

DC
Admin Off Offline

Quote
That the file just contains the error is exactly what I expected. Steam must have dropped HTTP support then. Which makes sense. Nobody really uses it anymore. I don't really want to setup a proxy script for Steam avatars and cache all the avatars on my server.

I guess the best option is to entirely disable Steam avatar support for now.

Thank you for your support and input though.

old Re: USGN Avatar won't load

mrc
User Off Offline

Quote
@edit Yes, it works! Fixed avatars once and for all (but in my server only).

1. Install Node.js and npm (if not already):
1
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && sudo apt install -y nodejs
2. Go to your CS2D server folder and run: npm install axios sharp
3. Place the .js script (below) in the CS2D folder.
4. Set it up as a systemd service so it auto-starts on VPS reboot.
Spoiler >

5. Add 'avatars,1' to 'sys/mods_server.lst'.
6. Add the Lua script to your sys/lua/autorun (or wherever you manage hooks).
7. Restart CS2D server and start the proxy service.
8. Now you can call Steam avatars once they're downloaded with:
1
path = "mods/avatars/" .. player(id, "steamid") .. ".png"

Node.js Proxy
Spoiler >

Lua Script
Spoiler >
edited 21×, last 26.06.26 10:10:17 pm

old Re: USGN Avatar won't load

DC
Admin Off Offline

Quote
That's cool! Thanks for sharing!
I will try to fix avatars with the next update but I can't make any promises.
To the start Previous 1 Next To the start
Log in to replyGeneral overviewCS2D overviewForums overview