sjstein / R8DIUM

A discord bot to manage individual run8 users
GNU General Public License v3.0
2 stars 0 forks source link

Support for more than one server #105

Closed Darthyoda714 closed 6 months ago

Darthyoda714 commented 7 months ago

The ability for the bot to be able to handle multiple host security files on the same computer for servers hosting multiple R8 regions on the same hosting machine.

sjstein commented 7 months ago

Assumptions:

  1. The user database is the same for all servers
  2. The instantiation of the different servers is done via unique directory structures (but on the same machine)
  3. There will never be a case where a user is banned on only one region
sjstein commented 7 months ago

First iteration is just to have the option to write to multiple HostSecurity files when the time comes to update them.

In terms of merging the HostSecurity data back in to the user db, it is probably safe to just use one, as right now we are really only grabbing the UID.

sjstein commented 7 months ago

Things get a bit more complicated when also looking into issue #91 - since that brings in the concept of tracking a user's login history. The current solution for that issue is to add another column to the user db named "last_login" - which is populated via scraping the log file. With multiple servers now:

  1. Do we add more than one "last_login" field? Perhaps "last_login_s1", "last_login_s2", etc - representing each server being tracked?
  2. If so, then we must scrape more than one log file (one per server) to grab that info
sjstein commented 7 months ago

For the logging/pruning of users, rather than a log of each "last login", it would be simpler on the schema to add not only the "last_login" field, but also "last_server" field.

Envisioning the configuration file having entries as such:

[server1]
name = CaliSW
security_file = C:\Program Files\Run8Studios\CaliServer\Run8 Train Simulator V3\...etc.
log_file =  C:\Program Files\Run8Studios\CaliServer\Run8 Train Simulator V3\...etc.

[server2]
name = SouthEast
security_file = C:\Program Files\Run8Studios\SeServer\Run8 Train Simulator V3\...etc.
log_file =  C:\Program Files\Run8Studios\SeServer\Run8 Train Simulator V3\...etc.
sjstein commented 7 months ago

This is currently being tested on branch #105

sjstein commented 6 months ago

This has been addressed in branch #108