Author Topic: Can multiple servers share the same stats from sv.db (and data folder)?  (Read 288 times)

0 Members and 1 Guest are viewing this topic.

Offline APNxRPG24

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
If I have two identical servers (i.e. sandbox), I want to know how I can share player stats between them, such as for utime (time played on server), bans, permissions, etc. and other stat values that will change per player.

Cloning the first server to the second one wouldn't really work because the stats will change over time. For example, it might say a player has 5 days playtime on the first server, but only 5 minutes on the second server if the files were copied over before (not after) they played.

Is there a way the addons (ulx, ulib, utime, etc.) can be changed so they point to the same data and database file?
« Last Edit: June 11, 2018, 11:05:41 PM by APNxRPG24 »

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2642
  • Karma: 413
    • |G4P| Gman4President
You can't share sv.db files because SQLite databases are locked when they are open. Server 1 would have access and server 2 would not.

You can point to the same data files, but only for things that don't change.. groups for example. If you tried to do this with users or bans, when Server 1 would write, it would overwrite anything server 2 did and the other way around too.

The only way to really share data is to utilize a form of MySQL data integration. You would need the MySQLoo module, and either design your own ULX implementation or use one of the ones out there already. There are some on gmodstore and also a few floating around here. Not sure what works these days, but you could try them out.

Offline APNxRPG24

  • Newbie
  • *
  • Posts: 8
  • Karma: 0
Are there any in particular that are recommended?

Specifically I'd like
1) user groups/permissions to sync up (an admin promotion would apply for that user on all servers)
2) utime to be tracked the same on all/both servers
3) globalized bans (so banned players can't just hop to another server hosted by/on the same person/network)

I'm unsure what SQLoo is, and haven't the slightest idea about SQL other than it is used for databases. But I suppose I could always create a gmod store job if I want something specific tailored to a server network.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2642
  • Karma: 413
    • |G4P| Gman4President
Search the releases here. There are a few for both groups/bans and UTime integration.

https://forums.ulyssesmod.net/index.php/topic,9416.0.html
https://forums.ulyssesmod.net/index.php/topic,9672.0.html
https://forums.ulyssesmod.net/index.php/topic,8968.0.html
https://forums.ulyssesmod.net/index.php/topic,5738.0.html

I don't know which of these work or if they work at all. The one I made years ago no longer works (I think) and I never bothered fixing it.

I thought there was one on gmodstore, but not any more, he removed it.

MySQL is a module. You'll have to install it on your servers (if your host allows you to do that) and then have a database hosted somewhere.

Syncing servers is not an easy task and requires lots of work and attention to make it work properly.

You could probably create a job and have someone do it for you that has done it before. That would be the easiest way, but then when something goes wrong, you won't know how to fix it.

Either way, good luck!