ChanceSD/PvPManager-Issues

Failed to update database

Closed this issue · 9 comments

Describe the bug
When a player leaves the Server i get this error in console: [05:53:45 ERROR]: [PvPManager] Failed to update database. I believe this is because of Plugins like essentials granting Nicknames and setting them as DisplayName for Players because the Displayname is to long then (because of color codes maybe..?)

To Reproduce
Steps to reproduce the behavior:

  1. Install EpicCore (Chat Manager Plugin)
  2. (Use Database for PVP Manager)
  3. Leave Server

Expected behavior
The Plugin should for example clear out the color codes or if it detects that the DisplayName is to long use the PlayName instead..?

Plugin and Server version
Server: 1.20.1
PvP Manager: 3.25

Screenshots
grafik

You're right, that is most likely the issue, the displayname is too large. I believe this would not be a problem if using sqlite as a database but mysql is strict about those things.
The plugin does save the name without color codes, then it also saves the displayname with all colors which to be honest is not used for anything right now. Eventually I planned to display player stats such as kills and what not so I made it save the colored name as well.
Do you happen to know the max length of displaynames for that chat plugin? I could try to increase it, you could also do it if you go into phpmyadmin and assign a larger size to the displayname column in the pmr_users table.

Yeah ofcause i know that i can change the database just with alter table but to be honest i dont want to manually change things in a bought plugin.. just seems wrong.

Those are the settings from the Chat Plugin for nicknames:

image

Not sure what you mean, can't possibly predict the size of displaynames on every server, for reference the current max size I used for the displayname column is VARCHAR(75) which means a max of 75 characters.

I thought 75 would be enough for a name with colors since the max size of a name is 16 characters. I can increase that to 255 which is the maximum or to a lower number if you know what size you would need. It's probably better to just go for 255 though.

And I didn't mean to imply you don't know how to change a database, I was just explaining the change I'm gonna do is the same you can do right now on phpmyadmin in case you don't want to wait. Since it takes a couple of clicks if using the phpmyadmin interface

Well 75 is probably enough that's right. But that plug-in I use is not just using color codes like &4,&8,&2 but is using gradient color codes. Maybe that's why they're so long cause as far as I know gradient is using hex

Like this: https://www.spigotmc.org/threads/how-do-i-make-a-gradient-text-command.520252/

Yes, that's what I assumed was happening too, gradients generate very long color codes

here you can see whats the datatype of my chat plugin:
grafik

so thats what you'd need to increase it to at minimum i guess. Also that blured text is a gradiant color code just like i guessed.

Sorry for the delay, did you manage to do the change in your own database?
I've been with little time lately but I still plan to do that change either way, will make it have a size of 255

Yeah. I altered the column to a length of 255. worked for me.

This fix will be in version 3.26 for everyone