JustaPenguin / assetto-server-manager

A web interface to manage an Assetto Corsa Server.
https://github.com/JustaPenguin/assetto-server-manager/releases
MIT License
286 stars 70 forks source link

Multiple server entry lists #523

Open cheesegrits opened 4 years ago

cheesegrits commented 4 years ago

The last stumbling block I have for using server manager for my league is splits, whereby I need to run the same scheduled race at the same time on multiple servers, but with different pre-booked entry lists. The current shared JSON structure doesn't work for that. I could create three separate races, but if I schedule them, then all three servers will try and run all three races. Or I could create one race ... but then it has the same entry list.

What I'd like to propose is an additional configuration setting on races for "LocalEntryList". If set, the entry list for that race is split out and stored in the local JSON store, as a separate file, with the same UUID as the race in the shared folder, so in my case ...

path: /var/local/assetto/serverX/json shared_data_path: /var/local/assetto/shared/json

/var/local/assetto/shared/json/custom_races/XYZ.json /var/local/assetto/server1/json/entry_lists/XYZ.json /var/local/assetto/server2/json/entry_lists/XYZ.json /var/local/assetto/server2/json/entry_lists/XYZ.json

The new option would only need to be presented to the user if store type is JSON, and shared_data_path is set.

I'm happy to code it up and submit a PR for review if you think it's a reasonable approach.

cheesegrits commented 4 years ago

I went ahead and coded it up, as I'd like to use server manager for our league race this weekend. Haven't done a ton of testing yet, but seems to work OK. Can create a race on server1, create a pre-booked entry list for it, setting Local Entry List. Then go edit the race on server2, initially entry list is blank, create a pre-booked entry list for server2. Both servers retain their unique entry lists, but have the same shared race config. Both fire up on schedule, with their own entry lists.

https://github.com/cheesegrits/assetto-server-manager/commit/f219697b1a82fc7e7103aa280dab44c4e0af6a2e