Raised This Month: $32 Target: $400
 8% 

Database collation types and col char types for player's names (cksurf)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 07-07-2019 , 19:49   Database collation types and col char types for player's names (cksurf)
Reply With Quote #1

Hello I have an issue with player coming on my Surf Server with names like 𝑫𝒂𝒓𝒍𝒊𝒏𝒈 ❤

They can get times and if they set an SR it says so. But they never get points are a rank. If you try to retrieve the info via !top or !maptop or !rank nothing populates.

I set my DB and all tables and collumns to use utf8mb4_general_ci. I have the name field collation and the char type for the name collumn set to utf8mb4_general_520_ci But nothing is helping this issue

Here are the queries I ran to convert my DB. ckSurf uses Swedish collation by default




Code:
//Change DB Collation & Char set
ALTER DATABASE cksurdev CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
Code:
// Change Table Collation

ALTER TABLE ck_bonus CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_challenges CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_checkpoints CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_latestrecords CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_maptier CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_playerchat CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_playeroptions CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_playerrank CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_playertemp CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_playertimes CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_playertitles CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_spawnlocations CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE ck_stages CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Code:
// Collumn collation

ALTER TABLE `ck_bonus` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_bonus` MODIFY `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ck_bonus` MODIFY `mapname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_challenges` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_challenges` MODIFY `steamid2` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_challenges` MODIFY `map` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ck_checkpoints` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_checkpoints` MODIFY `mapname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_latestrecords` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_latestrecords` MODIFY `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ck_latestrecords` MODIFY `map` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_maptier` MODIFY `mapname` varchar(54) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_playerchat` MODIFY `steamid` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_playerchat` MODIFY `tag` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ck_playerchat` MODIFY `name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ck_playeroptions` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_playerrank` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_playerrank` MODIFY `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ck_playerrank` MODIFY `country` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ck_playertemp` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_playertemp` MODIFY `mapname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_playertimes` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_playertimes` MODIFY `mapname` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_playertimes` MODIFY `name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
ALTER TABLE `ck_playertitles` MODIFY `steamid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_spawnlocations` MODIFY `mapname` varchar(54) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_stages` MODIFY `steamid` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
ALTER TABLE `ck_stages` MODIFY `map` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
__________________
My CSGO Community! Come Say Hi! We keep things chill and toxicity is not welcome and dealt with:

http://csgosurfing.com

Last edited by TrappaTroopa; 07-07-2019 at 20:15.
TrappaTroopa is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 07-07-2019 , 21:30   Re: Database collation types and col char types for player's names (cksurf)
Reply With Quote #2

If you wish to store names properly, I'd suggest changing the charset in the plugin from utf8 to utf8mb4 with SM 1.10, which includes support for newer MySQL versions. This should be in the sql.sp file.

You'll also need to change the names column to something larger, like varchar(64) to accommodate for names with emojis that take up more bytes, but still fill the same amount of character space.
__________________
sneaK is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 07-07-2019 , 21:34   Re: Database collation types and col char types for player's names (cksurf)
Reply With Quote #3

Quote:
Originally Posted by sneaK View Post
If you wish to store names properly, I'd suggest changing the charset in the plugin from utf8 to utf8mb4 with SM 1.10, which includes support for newer MySQL versions. This should be in the sql.sp file.

You'll also need to change the names column to something larger, like varchar(64) to accommodate for names with emojis that take up more bytes, but still fill the same amount of character space.
Ok I'll go through the plugin and change that stuff.

is utf8mb4_general_ci recommended to use on the tables and collumns?
__________________
My CSGO Community! Come Say Hi! We keep things chill and toxicity is not welcome and dealt with:

http://csgosurfing.com
TrappaTroopa is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 07-07-2019 , 21:44   Re: Database collation types and col char types for player's names (cksurf)
Reply With Quote #4

That should be fine.
__________________
sneaK is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 07-07-2019 , 22:04   Re: Database collation types and col char types for player's names (cksurf)
Reply With Quote #5

Quote:
Originally Posted by sneaK View Post
That should be fine.
Ok I changed all the Name fields to VARCHAR(64). It compiles fine in SM 1.9. When I try to compile in SM 1.10 I get this

Code:
Google Drive\SourceMod plugins\sourcemod-1.10.0-git6415-windows\addons\sourcemod\scripting\include\smlib/entities.inc(1773) : fatal error 196: deprecated syntax; see https://wiki.alliedmods.net/SourcePawn_Transitional_Syntax#Typedefs
//
// Compilation aborted.
// 1 Error.
Here is the line in entities.inc:

Code:
functag Entity_ChangeOverTimeCallback bool:public(&entity, &Float:interval, &currentCall);
What would the proper syntax be here?

Edit:

I increased the size of the "Name" column char limit to 64 manually on my Database "Name" columns for the appropriate tables (ck_playerrank, ck_playertimes, etc) and I an still getting issues:
Attached Thumbnails
Click image for larger version

Name:	playernames.PNG
Views:	38
Size:	50.6 KB
ID:	176278  
__________________
My CSGO Community! Come Say Hi! We keep things chill and toxicity is not welcome and dealt with:

http://csgosurfing.com

Last edited by TrappaTroopa; 07-07-2019 at 23:42.
TrappaTroopa is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 07-08-2019 , 00:57   Re: Database collation types and col char types for player's names (cksurf)
Reply With Quote #6

smlib in transitional syntax: https://github.com/bcserv/smlib/tree...itional_syntax

Increasing the name column char limit is not all you need. Were you able to recompile it with utf8mb4 charset being set instead of utf8?
__________________
sneaK is offline
TrappaTroopa
Senior Member
Join Date: Feb 2016
Old 07-08-2019 , 20:01   Re: Database collation types and col char types for player's names (cksurf)
Reply With Quote #7

Quote:
Originally Posted by sneaK View Post
smlib in transitional syntax: https://github.com/bcserv/smlib/tree...itional_syntax

Increasing the name column char limit is not all you need. Were you able to recompile it with utf8mb4 charset being set instead of utf8?
I was yes.

I am actually having a developer work on the timer for me as I want quite a bit of changes made. Thanks for your help tho! I appreciate your quick replies!
__________________
My CSGO Community! Come Say Hi! We keep things chill and toxicity is not welcome and dealt with:

http://csgosurfing.com

Last edited by TrappaTroopa; 07-08-2019 at 20:02.
TrappaTroopa is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode