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

Add Farming Simulator 2022/2019 #531

Merged
merged 14 commits into from
Feb 5, 2024
Merged

Add Farming Simulator 2022/2019 #531

merged 14 commits into from
Feb 5, 2024

Conversation

Vito0912
Copy link
Contributor

@Vito0912 Vito0912 commented Feb 1, 2024

Added Farming Simulator 2022. It may also work with older versions, although I currently only own Farming Simulator 19 and 17. I will need to investigate whether I can set up a server for them. As of now, this has only been tested with a Farming Simulator 2022 server.

Note:
Server queries are not possible. To obtain the necessary token, you must own or have permission to access the web interface.

I have not tested whether the token works when used in code; my testing was limited to using it with the command line.

@Vito0912 Vito0912 changed the title Add Farming Simulator 2022 Add Farming Simulator 2022/2019 Feb 1, 2024
@Vito0912
Copy link
Contributor Author

Vito0912 commented Feb 1, 2024

I am not able to start a Farming Simulator 17 Server. It will likely work, but I cannot test it.

@CosminPerRam
Copy link
Member

To add support for a game we need to make sure queries work on them, so FS17 could be added later.

As of now, this has only been tested with a Farming Simulator 2022 server.

So as the changes in this PR, we would need to also test FS19.

GAMES_LIST.md Outdated
@@ -460,6 +461,10 @@ Conan Exiles never responds to player query.
### <a name="minecraft">Minecraft
Many Minecraft servers do not respond with players data.

### <a name='farmingsimulator'>Farming Simulator
Farming Simulator 2022 servers need a token (reffered as code in the game). It can be obtained at your server's web interface (http://ip:port/settings.html). It can be passed to GameDig with the additional option: `token`
Copy link
Member

Choose a reason for hiding this comment

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

Farming Simulator 2022 servers need a token, so, only FS22 or both? as this note is added on both of them.

@@ -102,7 +102,7 @@ export default class QueryRunner {
errors.push(e)
}
}

Copy link
Member

Choose a reason for hiding this comment

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

This line doesnt need to be changed.

lib/games.js Outdated
@@ -1186,6 +1186,22 @@ export const games = {
protocol: 'ase'
}
},
farmingsimulator2019: {
name: 'Farming Simulator 2019',
release_year: 2021,
Copy link
Member

Choose a reason for hiding this comment

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

Should be 2018.

@CosminPerRam
Copy link
Member

As the queries require tokens to be made, you think you could join the Discord server or message me on Discord regarding providing me the needed ones? As I dont own the game I cannot really verify that this PR is valid (not that I don't trust you, but its just to make sure all is good).

@Vito0912
Copy link
Contributor Author

Vito0912 commented Feb 1, 2024

So as the changes in this PR, we would need to also test FS19.

I tested it with Farming Simulator 19

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.

Privately validated that the queries work.
Please also run eslint (:

}
});

state.mods = [];
Copy link
Member

Choose a reason for hiding this comment

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

mods is not a stabilized field, so it should be under state.raw.

GAMES_LIST.md Outdated
@@ -122,6 +122,8 @@
| factorio | Factorio | |
| farcry | Far Cry | |
| farcry2 | Far Cry 2 | |
| farmingsimulator2019 | Farming Simulator 2019 | [Notes](#farmingsimulator) |
Copy link
Member

Choose a reason for hiding this comment

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

The name of the game should be Farming Simulator 19, same for 22.

Copy link
Contributor Author

@Vito0912 Vito0912 Feb 1, 2024

Choose a reason for hiding this comment

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

Should the naming of the keys also be changed?

Copy link
Member

Choose a reason for hiding this comment

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

Yep.

Copy link
Member

Choose a reason for hiding this comment

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

(Requesting the name change as seeing on their website that they call the game "Farming Simulator 22", not "Farming Simulator 2022")

Copy link
Member

Choose a reason for hiding this comment

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

(same goes for the names in the games.js file).

@podrivo
Copy link
Contributor

podrivo commented Feb 4, 2024

@Vito0912 Sorry, but still a conflict to resolve before merging...

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.

Good to merge, but please also run eslint of the protocol file.

@podrivo
Copy link
Contributor

podrivo commented Feb 5, 2024

@Vito0912 Do we have a version field in the query response? Wondering if we should add a version top level for Farming Simulator as well.

@Vito0912
Copy link
Contributor Author

Vito0912 commented Feb 5, 2024

@podrivo Yeah, I am pretty sure it does have a version in it's response. Can't remember that there was a top level version. I will add it as soon as I have time.

@podrivo
Copy link
Contributor

podrivo commented Feb 5, 2024

No sweat!
If you could add a query response at the original post, I'll make sure to add it in the other PR (#532).

@Vito0912
Copy link
Contributor Author

Vito0912 commented Feb 5, 2024

I've updated the file to adhere to the ESLint standards and have also added the version information to raw.version. I'm uncertain as to why it triggered another merge of the branch. I hope this won't cause any issues.

@CosminPerRam CosminPerRam merged commit 3a17184 into gamedig:master Feb 5, 2024
4 of 5 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.

3 participants