Issue with Clan/Guild system

Hi,

I was thinking about adding a clan/guild system to my game, but i got some very bad scenario in my head.

Example:

  • Server 1 loaded version 1 of guild data
  • Player in server 1 added some coins into guild bank. Data is not yet saved in datastore.
  • Server 2 loads data from datastore, which is the old one.
  • Player from server 1 leaves and data of the guild (where he put some coins into guild bank) saves.
  • Player from server 2 leaves too and data which server loaded was old, where there is no coins in bank which was taken from player 1 data and it saves/overrides data of the guild.

Results: Player 1 spent his coins to put them into guild bank and it feels like he just wasted them because another server loaded old data and saved it.

I have no idea how can i avoid this issue, but still some games like Vesteria have Guild systems in them and mostly don’t have any issues.

use messaging service to see if any of the servers has that clandata loaded .

if they do then direct all interactions to that server

or

when requesting the data, serverlock ik with a variable, and tell others it is in use

I’m afraid messaging service can fail.

And about second method i think i don’t quite understand it.

when requesting the data, serverlock ik with a variable, and tell others it is in use

So what i think you mean is Server 1 loads guild data and session locks it with his JobId. But this will prevent other servers to load this data.

I would like you to explain more about this method because i think i don’t understand it right.

that is exactly what i mean

a third option would be to make a refresh button or get the data from the datastore every time a change needs to be made

Hmm. Will try third option as it sounds as it would work. Thanks for help!