Skip to content

Add information to MTA Server List ("rules" table provided by ASE) #3788

Closed as not planned
@Fernando-A-Rocha

Description

@Fernando-A-Rocha

Is your feature request related to a problem? Please describe.

In order to easily improve the Server Browser by showing more server information to the client, we should merge #3761 which adds new default "rules" that a server can set to define its description, social media URLs, etc. All of this information can already be stored in the rules key-value pairs of the server's ASE query response (Port 22126 UDP by default).

So, we need a way to obtain this information in the client, to then display it correctly in the Server Browser (e.g. showing a server's tags).

Describe the solution you'd like

The Server Browser obtains the server list from MTA's servers

enum
{
ASE_HAS_PLAYER_COUNT = 0x0004,
ASE_HAS_MAX_PLAYER_COUNT = 0x0008,
ASE_HAS_GAME_NAME = 0x0010,
ASE_HAS_SERVER_NAME = 0x0020,
ASE_HAS_GAME_MODE = 0x0040,
ASE_HAS_MAP_NAME = 0x0080,
ASE_HAS_SERVER_VERSION = 0x0100,
ASE_HAS_PASSWORDED_FLAG = 0x0200,
ASE_HAS_SERIALS_FLAG = 0x0400,
ASE_HAS_PLAYER_LIST = 0x0800,
ASE_HAS_RESPONDING_FLAG = 0x1000,
ASE_HAS_RESTRICTION_FLAGS = 0x2000,
ASE_HAS_SEARCH_IGNORE_SECTIONS = 0x4000,
ASE_HAS_KEEP_FLAG = 0x8000,
ASE_HAS_HTTP_PORT = 0x080000,
ASE_HAS_SPECIAL_FLAGS = 0x100000,

See https://master.multitheftauto.com/ase/mta/ (list of server info such as name, player count, etc in ASE format), which can be fetched and parsed using a script such as https://github.com/Fernando-A-Rocha/ase2json_py

Image

Several things need be done, imo:

  • Add new ASE Flag to return the Rules table which you can also call Rules Map or Rules List (see Client/core/ServerBrowser/CServerList.h)
  • Modify the Master server list MTA service (requires backend access) to return the data
  • Edit the C++ scripts so they can fetch and parse the string key-value pairs from the Rules table fetched
  • (FUTURE) Revamp the Server Browser UI to parse and use the new information

Describe alternatives you've considered

Doing nothing will unfortunately not allow us to make progress in getting the issues #3761 resolves easily, without having to refactor/rewrite A LOT of code.

Additional context

Curiosities:

This is how ASE format includes key-value pairs in its structure
Image

This is how OpenGSQ-Python parses the ASE response, in particular the rules part
Image

Game-State is dealing with the rules table that servers provide in their ASE response properly 🥳
(not an advertisement) e.g. https://www.game-state.com/164.132.200.104:22003/ contains:
Author: AGRP Team
Script Version: 24.08.12

The JSON server list provided by https://mtasa.com/api/ also does not contain the server Rules array. I am unsure where this API is used, but it would be nice to also update it.

Security Policy

  • I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions