Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serverlist enhancements #11342

Closed

Conversation

ShadowNinja
Copy link
Contributor

This makes two enhancements for the server list:

  • Print HTTP response bodies on error responses. This is useful because the server list returns information on why the request failed in the body. Without this you only get the response code, which could mean several different things.
  • Add a world UUID and send it to the server list. This allows the server list to keep better track of worlds and is a companion to Persist servers in separate database serverlist#45 . This should not be merged until that PR is in production so that the server list doesn't publish UUIDs, which could be used to spoof servers.

How to test

Change src/serverlist.cpp so that it sends invalid JSON, enable announce, and start a server.

src/content/subgames.cpp Outdated Show resolved Hide resolved
src/httpfetch.cpp Outdated Show resolved Hide resolved
@sfan5 sfan5 added the WIP label Jul 4, 2021
@rubenwardy
Copy link
Contributor

Closing as no response in a long time. Feel free to reopen

@rubenwardy rubenwardy closed this Oct 31, 2021
@ShadowNinja ShadowNinja reopened this Nov 20, 2021
@ShadowNinja ShadowNinja force-pushed the serverlist-enhancements branch from 85b09c7 to a670a83 Compare November 20, 2021 02:01
@ShadowNinja
Copy link
Contributor Author

ShadowNinja commented Nov 20, 2021

One change to HTTP Fetch that would be visible to the Lua API is that HTTP responses with a 400+ code doesn't cause succeeded to be set to false anymore, only an actual cURL failure (e.g. connection refused) will cause that. lua_api.txt doesn't define what precisely succeeded means, though, so either implementation could be correct. Let me know what you think should be done.

This is useful for keeping track of worlds even if they change addresses.
@ShadowNinja ShadowNinja force-pushed the serverlist-enhancements branch from a670a83 to 4f08916 Compare January 3, 2022 01:58
@rubenwardy
Copy link
Contributor

What remains to be done?

@sfan5
Copy link
Collaborator

sfan5 commented Apr 24, 2022

Probably ready, the serverlist PR needs to be merged first.

@rubenwardy rubenwardy added the Concept approved Approved by a core dev: PRs welcomed! label Apr 25, 2022
@Zughy Zughy removed the WIP label May 28, 2022
@Zughy Zughy added the Adoption needed The pull request needs someone to adopt it. Adoption welcomed! label Oct 19, 2022
@Zughy Zughy closed this Oct 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adoption needed The pull request needs someone to adopt it. Adoption welcomed! Concept approved Approved by a core dev: PRs welcomed! Possible close @ Startup / Config / Util
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants