-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: xonotic player names being reported as numbers (#580)
* fix: xonotic player names being reported as numbers * changelog
- Loading branch information
1 parent
cfd5614
commit 5210f52
Showing
4 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import quake3 from './quake3.js' | ||
|
||
export default class xonotic extends quake3 { | ||
async run (state) { | ||
await super.run(state) | ||
|
||
// Sometimes, the server returns a player's name as a number (which seems to be the team?) and the name in | ||
// an extra field called "address", we are not sure of this behaviour nor if this is a good enough solution | ||
for (const player of state.players) { | ||
if (!isNaN(player.name) && player.raw.address) { | ||
player.raw.team = player.name | ||
player.name = player.raw.address | ||
} | ||
} | ||
} | ||
} |