Closed Kudosaki closed 1 month ago
Though realistically speaking for usage of variables in cases where player switches servers constantly, Redis would be the best option.
MySQL can work too, but you'll have to add a bunch of conditions when player leave & join the server aside from the autosaving.
And also to prevent the auto saving overriding each other as well.
Oh, I found the variable manager area, It doesn't seems like the variables are being updated properly between servers it seems?
but restarting Server B will loads up the variable changed on A, so database definetly is working, just not updated properly when player leave & join :hmm:
The data is loaded from the database everytime they join the server.
The data is loaded from the database everytime they join the server.
Doesn't seem like it's doing that right now on latest release for ServerVariables.
Server A /svar set variablename playername something
Leave Server A
Joins Server B
/svar get variablename playername Results in wrong variable
Restarting Server B /svar get variablename playername
Displays as something. So my database is connected correctly.
If you use /svar set variablename playername something, the variable is updated on the database. Could you retry the same test and check if the value on the database is updated? Make sure of that, and then, leave the server A and join server B.
Sounds good, will test now
Before changing on server.
Changed
Still seeing no changes
UUID of player Kudosaki is 4ea416f4-7e12-3cca-83a3-f5b83276ded1
That's my UUID
Eh, the server clearly says my uuid is that but
when I change the value it's changing the value of
the d9 uuid :hurtrealbad:
EH??
I have sent you a friend request under the name LonelyWarrior, I think we can try to diagnose this together on discord better.. than using git
Though im suspecting it's because this might be uh... offline server issue?
I'm seeing a funny behaviour though, changing the variable on both A and B updates the value on the database, but two server are displaying two different variables... I would to to stream the whole process to you lmao
Before i changed anything...
Changing on Server B
/svar get on Server B
Database view when changed on server B
/svar get on Server A
Setting var on Server A
Database when changed var on Server A
/svar get going on Server B
That whole database thing ain't making lots of senses :lmao:
Why do you have the same user with 2 different UUIDs? If that's the case, then it will bug. If you changed the offline-mode of your server while having data, then this will happen. Remove the duplicated usernames.
I suggest Redis as the means of server syncing for ServerVariables because this would allow people to sync between servers more accurately.
Both are connected to the same database.
And with a brief look on the code, There seems to be nothing to update that variable when player leaves/disconnect, hence that data is most likely not possible to be viewed from Server B.