#Clear pet level or rollback

1 messages · Page 1 of 1 (latest)

exotic elm
#

Do you know why many of my players are losing their pet level?

main juniper
main juniper
exotic elm
exotic elm
#

mh

exotic elm
exotic elm
#

?

main juniper
exotic elm
#

I use MySql

DisableMySQL: false

exotic elm
main juniper
main juniper
exotic elm
#
DefaultName: §9Pet of %player%
OverrideDefaultName: true
EnableClickBackToMenu: true
UseDefaultMythicMobsNames: false
RightClickToOpenMenu: false
LeftClickToOpenMenu: false
DisableInventoryWhileHoldingSignalStick: true
DismountOnDamaged: true
SpawnPetOnReconnect: true
SneakMode: false
Nameable: true
Mountable: true
DistanceTeleport: 30
MaxNameLenght: 16
InventorySize: -1
PercentHealthOnRespawn: 0.2
ActivateBackMenuIcon: true
AutoSaveDelay: 3600
GlobalRespawnCooldown: false
DefaultRespawnCooldown: 0
AutoRespawn: true
Experience:
  BarSize: 40
  Symbol: '|'
  ColorDone: §a
  ColorLeft: §f
Taming:
  AnnouncementType: CHAT
  BarSize: 40
  Symbol: '|'
  ColorDone: §a
  ColorLeft: §f
MySQL:
  Prefix: mcpets_
  User: xxx
  Password: xxx
  Host: xxx
  Port: 'xxx'
  Database: xxx
BlackListedWorlds: []
DisableMySQL: false
DismountOnDamagedExcludePlayers: false
FastMount: false
DisableFastMountWhileHoldingSignalStick: false
main juniper
main juniper
#

I'll grab a bite and come back to you real quick

exotic elm
#

and often when I let the server run for a long time like +8 hours I would say, because if I restart 10-15 min later there will be no rollback

main juniper
#

Since all servers run a different instance of MCPets

#

There needs to be only one that saves the DB on a regular basis

exotic elm
#

Currently I only have 1 mcpets server on my db.

main juniper
#

It's been a while since I last discussed this tbh so I would need to research the discord or maybe it's on the wiki somewhere

main juniper
exotic elm
#

I use mariaDB, but i have only one server for the moment

main juniper
#

That is perfectly fine if so

#

What I meant was

#

All of your Minecraft servers run MCPets

exotic elm
#

Rather 1 server, connected to 1 database and not yet several servers to the same database

main juniper
#

Oh so there's just one server for now

#

Not multiple instances running in parallel?

exotic elm
#

no

#

hm

#

wait

#

my dev server

#

I think that must be the reason, because it restarts quite often.

main juniper
#

They're both connected to the same database?

exotic elm
#

yes

main juniper
#

Generally speaking, if multiple servers are connected to the same database, only one needs to perform the save cycle, otherwise the cache is overwritten between both servers and it bugs. So for the main server where people use their pets, you should have a saving cycle that runs with the AutoSaveDelay set to like 3600. For the other servers you should set -1

exotic elm
#

and if i have multiple main server ?

#

or i can disable autoSaveDelay in all server and save only with restart ?

main juniper
#

It doesn't have to be the server where people use their pets I believe

#

Although it's been years since I made this feature so I kinda forget as time goes on 😅

exotic elm
#

This morning

exotic elm
#

The saveData() method used TRUNCATE followed by INSERT, creating a window where data could be lost if two servers were saved

exotic elm
#

@main juniper i think is a problem

#

getMySQL().query("REPLACE INTO " + table + " (uuid, names, inventories, data) VALUES (...)");

use this

#
    // Old (unsafe)
    getMySQL().query("TRUNCATE " + table);

    // New (safe)
    getMySQL().query("REPLACE INTO " + table + " (uuid, names, inventories, data) VALUES (...)");
main juniper
#

Are you using latest build? Maybe this has already been looked into