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

Added additional properties to getListPlayers and getSquads methods #313

Merged
merged 1 commit into from
Nov 5, 2023

Conversation

lbzepoqo
Copy link
Contributor

@lbzepoqo lbzepoqo commented Nov 2, 2023

Changes were suggested here.

This introduces several updates to the getListPlayers and getSquads methods in the rcon.js file, improving the amount of information returned by these methods.

For the getListPlayers method:

  • Added a check to return the players array immediately if the response is empty or not defined. This prevents potential errors when trying to process an undefined or empty response.
  • Updated the regex used to parse the response, allowing it to capture additional information about whether the player is a leader and their role.
  • Added isLeader and role properties to the returned player object. The isLeader property is a boolean indicating whether the player is a squad leader, and the role property represents the role of the player.

For the getSquads method:

  • Added a check to return the squads array immediately if the responseSquad is empty or not defined. This prevents potential errors when trying to process an undefined or empty response.
  • Updated the regex used to parse the response, allowing it to capture additional information about the squad creator's name and Steam ID.
  • Added creatorName and creatorSteamID properties to the returned squad object. These properties represent the name and Steam ID of the squad creator.

@werewolfboy13 werewolfboy13 added core bug Bug related to the core SquadJS API patch Patch Change labels Nov 5, 2023
@werewolfboy13 werewolfboy13 merged commit 8a988c1 into Team-Silver-Sphere:master Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core bug Bug related to the core SquadJS API patch Patch Change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants