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 version as a top level field #532

Merged
merged 27 commits into from
Feb 24, 2024

Conversation

podrivo
Copy link
Contributor

@podrivo podrivo commented Feb 4, 2024

This adds a top level state.version on protocols that have state.raw.version in their responses.
It will close #468 and #528.

It would be good to have other take a look as well!

List of protocols checked and notes:

  • armagetron
  • ase
  • asa
  • assettocorsa
  • battlefield
  • doom3
  • eco
  • factorio
  • farmingsimulator
  • ffow
  • gamespy1
  • gamespy3
  • geneshift
  • mafia2mp
  • minecraft
  • mumbleping
  • openttd
  • palworld
  • rfactor
  • samp
  • savage2
  • starmade
  • teamspeak3
  • tribes1
  • valve
  • theisleevrima
  • buildandshoot
  • cs2d
  • discord
  • epic
  • fivem
  • gamespy2
  • goldsrc
  • hexen2
  • jc2mp
  • kspdmp
  • mafia2online
  • minecraftbedrock
  • minecraftvanilla
  • mumble
  • nadeo
  • quake1
  • quake2
  • quake3
  • starsiege
  • teamspeak2
  • terraria
  • tribes1master (not applicable)
  • unreal2
  • ut3
  • vcmp
  • ventrilo
  • warsow
  • eldewrito
  • beammpmaster (not applicable)
  • beammp
  • dayz

Protocol Has version Notes
armagetron Yes Already had version implemented.
ase Yes Already had version implemented.
asa Yes gamedig --type protocol-asa 46.4.104.117:7777
assettocorsa Yes gamedig --type protocol-assettocorsa 5.161.43.117:8081
battlefield Yes Already had version implemented.
buildandshoot - Wasn't able to get a response and test it. Links: list and converter
cs2d No gamedig --type cs2d --pretty 185.17.3.123:36699
discord No gamedig --type discord --guildId 651278179348119553
doom3 Yes gamedig --type protocol-doom3 74.91.118.204:27666
eco Yes gamedig --type protocol-eco s1.playeco.ru:3001
epic - Core protocol. Protocol is not being used.
factorio Yes gamedig --type protocol-factorio 58.32.16.64:34199
ffow Yes Already had version implemented.
fivem Yes gamedig --type protocol-fivem 158.69.62.46:30120
gamespy1 Yes gamedig --type protocol-gamespy1 139.162.235.20:7778
gamespy2 Yes gamedig --type protocol-gamespy2 85.215.163.158:27888
gamespy3 Yes gamedig --type battlefield2 95.172.92.116:16567
geneshift Yes Already had version implemented.
goldsrc - No extra version. Extends valve protocol.
hexen2 - Didn't find a server to test. Game seems dead, with max of 20 players in the last 9 years and 45 all time.
jc2mp Yes gamedig --type jc2m 185.34.216.12:7777
kspdmp - Didn't find a server to test.
mafia2mp Yes gamedig --type protocol-mafia2mp 82.208.17.10:27327
mafia2online - No extra version. Extends mafia2mp protocol.
minecraft Yes gamedig --type minecraft mc.hypixel.net
minecraftbedrock Yes Didn't find a server to test. Protocol is not being used.
minecraftvanilla Yes Didn't find a server to test. Protocol is not being used.
mumble - Didn't find a server to test.
mumbleping Yes gamedig --type protocol-mumbleping mumble.defalserver.org:64738
nadeo - Didn't find a server to test.
openttd Yes Already had version implemented.
palworld Yes gamedig --type protocol-palworld 34.39.133.230:30001
quake1 Yes Extends quake2 protocol. / gamedig --type protocol-quake1 osqw.com.br:28501
quake2 Yes gamedig --type protocol-fivem 158.69.62.46:30120
quake3 Yes gamedig --type protocol-quake3 45.235.98.51:27960
rfactor Yes Already had version implemented.
samp Yes Already had version implemented.
savage2 Yes Already had version implemented.
starmade Yes gamedig --type protocol-starmade sm.cakebuildserver.com:57921
starsiege - No extra version. Extends tribes1 protocol. / gamedig --type protocol-starsiege 96.126.117.157:29007
teamspeak2 No gamedig --type protocol-teamspeak2 130.44.23.184:9112
teamspeak3 Yes gamedig --type protocol-teamspeak3 3.212.217.93:9987
terraria - Can't test it. Need a server mod and token to test it.
tribes1 Yes Already had version implemented.
tribes1master Master Server, not applicable.
unreal2 Yes gamedig --type protocol-unreal2 212.42.38.94:7778
ut3 - Tried several easily findable servers online, using different ports, but none responded.
valve Yes Already had version implemented.
vcmp - No extra version. Extends samp protocol. / gamedig --type protocol-vcmp 51.178.65.136:8114
ventrilo Yes gamedig --type protocol-ventrilo 144.217.102.178:6775
warsow - No extra version. Extends quake3 protocol.
eldewrito Yes gamedig --type protocol-eldewrito 23.159.176.139:11771
beammpmaster Master Server, not applicable.
beammp Yes gamedig --type protocol-beammp 95.165.144.131:30817
dayz - No extra version. Extends valve protocol.
theisleevrima Yes Can't test it. Found servers didn't work. Got a response example from this PR: #501

@podrivo podrivo marked this pull request as ready for review February 5, 2024 01:15
protocols/armagetron.js Outdated Show resolved Hide resolved
protocols/ase.js Outdated Show resolved Hide resolved
protocols/assettocorsa.js Show resolved Hide resolved
protocols/mumbleping.js Show resolved Hide resolved
@podrivo
Copy link
Contributor Author

podrivo commented Feb 9, 2024

Nice! Makes sense to me. Thank you!

protocols/samp.js Outdated Show resolved Hide resolved
Copy link
Member

@CosminPerRam CosminPerRam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.
But until merging this, we'd have to decide a default value for that field, add a line in the changelog and further research into the other games that might have (or not) this, such as cs2d and the others.

@@ -21,6 +21,7 @@ export default class mafia2mp extends Core {
state.numplayers = parseInt(this.readString(reader))
state.maxplayers = parseInt(this.readString(reader))
state.raw.gamemode = this.readString(reader)
state.version = state.raw.gamemode
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Apparently this is a customizable field, but I've seen that it really is a version on some servers, so I guess it's fine, noting this just for future references.

@podrivo
Copy link
Contributor Author

podrivo commented Feb 10, 2024

we'd have to decide a default value for that field

You mean always having a state.version, regardless of having it in the response? How the rust repo does it?

further research into the other games that might have (or not) this, such as cs2d and the others.

I've tested a few other protocols, but I haven't tested all. It would be great to have others join in to help testing! (:

@CosminPerRam
Copy link
Member

You mean always having a state.version

Yes, as it's a stabilized field it should have a default value to always be present.
In rust-gamedig it is stabilized as an Option<String>, so it'll be alright to make "" (an empty string) its default value.
Location of the other stabilized fields:

name = ''
map = ''
password = false

but I haven't tested all

It's alright, this is quite a big task anyways (:
But if possible, please do make a task list for the rest of the game that needs to be checked to add support to keep track of them.

@CosminPerRam
Copy link
Member

A change in the readme is also required to add the version field in the "Query Response" table.

@podrivo
Copy link
Contributor Author

podrivo commented Feb 13, 2024

A change in the readme is also required to add the version field in the "Query Response" table.

Wondering if version is always the game version. I've added like this:

Game version that is running on the server. Empty if not present.

@CosminPerRam
Copy link
Member

Unfortunately I didn't had the time to contribute to the long list of protocols to check for versions.
I see that the list is completed (missing ones could come in later), is this good to go? Any more things you'd like to do?

@podrivo
Copy link
Contributor Author

podrivo commented Feb 24, 2024

No worries! I wasn't able to test some protocols, but most of them I was able to check.

I see that the list is completed (missing ones could come in later), is this good to go? Any more things you'd like to do?

I have to sync with the master and add the gtasao version from this PR #547

@podrivo
Copy link
Contributor Author

podrivo commented Feb 24, 2024

I guess we're good to go! 👍

Copy link
Member

@CosminPerRam CosminPerRam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, great stuff!

@CosminPerRam CosminPerRam merged commit a7c3b54 into gamedig:master Feb 24, 2024
4 checks passed
blackwaterbread pushed a commit to blackwaterbread/node-gamedig that referenced this pull request Feb 29, 2024
* add top level version on existing entries

* start adding version on new protocols WIP

* add version to more games

* more games with version

* add more games

* more version

* even more games with version

* add 'delete state.raw.version'

* fix delete version

* Update CHANGELOG.md

* add version in Results.js

* more games

* add new game

* more games

* add version on README

* add new game

* other game

* new game

* add unreal2 version

* add ventrilo version

* add eldewrito eldewrito

* add beammp version

* fix starmade version

* add new version in samp protocol

* docs: tweak the changelog line a bit

---------

Co-authored-by: CosminPerRam <cosmin.p@live.com>
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: Stabilize version field
2 participants