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

feat: add Renegade X support #643

Merged
merged 8 commits into from
Oct 4, 2024

Conversation

RattleSN4K3
Copy link
Contributor

@RattleSN4K3 RattleSN4K3 commented Sep 19, 2024

Adds support for Renegade X, using master server
Related issues: #629

Note

Setup and Response updated to reflect made changes during developing this PR.

Query single server

Setup:

GameDig.query({
  type: 'renegade10',
  address: '1.0.0.1',
  port: 7778

Example response

{
  "name": "[PREFIX] Server Name",
  "map": "CNC-Field",
  "password": false,
  "raw": {
    "Name": "Server Name",
    "NamePrefix": "[PREFIX]",
    "Current Map": "CNC-Field",
    "Bots": 0,
    "Players": 12,
    "Game Version": "Open Beta 5.84.767",
    "Variables": {
      "Mine Limit": 24,
      "bSteamRequired": false,
      "bPrivateMessageTeamOnly": false,
      "bPassworded": false,
      "bAllowPrivateMessaging": true,
      "bRanked": true,
      "Game Type": 1,
      "Player Limit": 64,
      "Vehicle Limit": 20,
      "bAutoBalanceTeams": false,
      "Team Mode": 6,
      "bSpawnCrates": true,
      "CrateRespawnAfterPickup": 35,
      "Time Limit": 50
    },
    "Port": 7778,
    "IP": "1.0.0.1"
  },
  "version": "Open Beta 5.84.767",
  "maxplayers": 64,
  "numplayers": 12,
  "players": [],
  "bots": [],
  "queryPort": 7777,
  "connect": "1.0.0.1:7778",
  "ping": 0
}

Query and receive master list

Setup:

GameDig.query({
  type: 'renegade10master'

Example response

{
  "name": "",
  "map": "",
  "password": false,
  "raw": {
    "servers": [
      {
        "name": "Server Name",
        "map": "CNC-Walls",
        "password": false,
        "raw": {
          "Name": "Server Name",
          "Current Map": "CNC-Walls",
          "Bots": 0,
          "Players": 0,
          "Game Version": "Open Beta 5.71.534",
          "Variables": {
            "Mine Limit": 30,
            "bSteamRequired": false,
            "bPrivateMessageTeamOnly": false,
            "bPassworded": false,
            "bAllowPrivateMessaging": true,
            "bRanked": true,
            "Game Type": 1,
            "Player Limit": 24,
            "Vehicle Limit": 11,
            "bAutoBalanceTeams": false,
            "Team Mode": 6,
            "bSpawnCrates": true,
            "CrateRespawnAfterPickup": 30,
            "Time Limit": 0
          },
          "Port": 7777,
          "IP": "1.0.0.1"
        },
        "version": "Open Beta 5.71.534",
        "maxplayers": 24,
        "numplayers": 0,
        "players": [],
        "bots": [],
        "queryPort": 0
      },
      {
        "name": "[PREFIX] Test Server",
        "map": "CNC-Uphill",
        "password": true,
        "raw": {
          "Name": "Test Server",
          "NamePrefix": "[PREFIX]",
          "Current Map": "CNC-Uphill",
          "Bots": 0,
          "Players": 0,
          "Game Version": "Open Beta 5.79.698",
          "Variables": {
            "Mine Limit": 24,
            "bSteamRequired": false,
            "bPrivateMessageTeamOnly": false,
            "bPassworded": true,
            "bAllowPrivateMessaging": true,
            "bRanked": true,
            "Game Type": 1,
            "Player Limit": 32,
            "Vehicle Limit": 10,
            "bAutoBalanceTeams": false,
            "Team Mode": 1,
            "bSpawnCrates": false,
            "CrateRespawnAfterPickup": 30,
            "Time Limit": 60
          },
          "Port": 7777,
          "IP": "1.0.0.2"
        },
        "version": "Open Beta 5.79.698",
        "maxplayers": 32,
        "numplayers": 0,
        "players": [],
        "bots": [],
        "queryPort": 0
      }
    ]
  },
  "version": "",
  "maxplayers": 0,
  "numplayers": 0,
  "players": [],
  "bots": [],
  "connect": "undefined:undefined",
  "ping": 0
}

@RattleSN4K3
Copy link
Contributor Author

ID test fails but I don't think the ID should be forced as renegade10.

@CosminPerRam
Copy link
Member

Unfortunately it needs to be that due to the current GID formatting rules.
We have gotten a bunch of negative feedback regarding it and will most likely be changed in the next major version (see #514 for more info), but for now we've got to hold onto the old system.

@xCausxn
Copy link
Contributor

xCausxn commented Sep 20, 2024

Even though 0 is falsy, I think we need to make sure password is either true or false

@RattleSN4K3
Copy link
Contributor Author

Even though 0 is falsy, I think we need to make sure password is either true or false

Good catch. I actually wanted to enforce "0"/"1" and ended up having 0/1. The downside of working on severel protocols in parallel and and not checking the Results output.

@RattleSN4K3 RattleSN4K3 force-pushed the feat/renegade-x branch 2 times, most recently from 5d5db5c to a183ae1 Compare September 21, 2024 17:02
@RattleSN4K3
Copy link
Contributor Author

I changed processing password. Due to some commit message, I wanted to rebase the PR, but since it was a draft, I see no problem with it (I generel would not prefer doing so).

PR is ready for review.

@RattleSN4K3 RattleSN4K3 marked this pull request as ready for review September 21, 2024 17:07
protocols/renegadex.js Outdated Show resolved Hide resolved
protocols/renegadex.js Outdated Show resolved Hide resolved
protocols/index.js Outdated Show resolved Hide resolved
protocols/index.js Outdated Show resolved Hide resolved
@RattleSN4K3
Copy link
Contributor Author

RattleSN4K3 commented Oct 4, 2024

Updated the PR to reflect the proposed changes.

My points regarding the last changes still stand tho:

  • Alternative protocols separated into single files could be messy... in case of protocols being dependent on existing ones (see master and server-query based on master protocol)

    With possible changes (for instance with feat: handle alternative query for some games #608) the file structured could be scattered.

  • Inconsistency in protocol names and game id

@CosminPerRam CosminPerRam merged commit fe9d4f2 into gamedig:master Oct 4, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Add Renegade X as supported Game
3 participants