-
Notifications
You must be signed in to change notification settings - Fork 46
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
Implementing online sync #105
Comments
Hi, you can create a shell script which will sync records, launch a game and sync records when game closes. Modify your game launcher ( |
This is what I've done so far. Ideally, it would be great if this happened automatically when the files change. I know how I would do that – a small service or something. However, especially on the Steam Deck, this is problematic. So, I thought it would be cool if somehow the game could trigger the sync. |
For the steamdeck, have Steam run your script that does the syncing, and have it do the sync before and after closing the game. |
Pinned this issue. Closing, because it's task for external tools. |
Hi,
I am a hardcore NFS2SE fan. I wanted a way to sync my times to a server to compete with other players.
Here's what I've accomplished so far:
Wrapped my head around the format of the stats files to decode them. That worked very well.
Implemented an API endpoint to post the stats. Basically, a bash script using curl takes the files from ~/.nfs2se/stats/ and the config.dat file and posts them to an endpoint. The API decodes the config.dat to extract the player's name. Then, the "record files" are decoded. When an entry matches the previously extracted player's name, the record is saved to a database.
This also works in reverse. There are endpoints for every track to download the records in the correct format and place them in the stats directory. This way, the in-game records are updated.
For now, this process works, but it needs to be triggered manually.
Do you see a way to implement this in the build itself, or do you have any tips on how I can simplify this process?
You can view the results at: https://garcias-garage.de/nfs2se-ranking/oval.stf/
Currently, I have this setup running with one other player. And I must say, it is so much more fun racing against times another human produced than against AI times. We list challenges on the website so we can compete in them.
Enpoint to post times:
(Example for "Last Resort" Do this for every track)
Endpoint to download records for tracks:
(Example for "Last Resort" Do this for every track)
curl --location 'https://garcias-garage.de/nfs2se-ranking/download/last.stf'
Possible track record file names (for upload and download):
Here is the Bash script: https://gist.github.com/vgarcia007/977d992d22a974e00557d6eccb6c78c0
I am mainly a web developer, with a few Linux and Docker skills. But that's it. I must admit I don't understand the code in this repository enough to comprehend if it is possible to implement this in the binary itself or create an in-game menu entry to trigger the sync. If I could, I would try to implement this myself.
For now, my workaround is to trigger the bash script via a Bashy Steam Deck plugin. However, some automation or an in-game possibility would be much nicer. Does anyone have an idea?
Sorry for posting this as an issue, but I thought this way I have the highest chance to reach out to someone with enough interest in this old game :)
The text was updated successfully, but these errors were encountered: