Community AlphaAlpha MUADMINS
PLPolski
Zaloguj się
Na MuADMINSConfig ScannerWgraj zip swoich plików: rates, dropy, spoty, limityOtwórzNa MuADMINSSpotkajmy się na DiscordziePoproś o pomoc, pokaż, nad czym pracujesz, i rozmawiaj o MU z innymi właścicielami serwerów.Otwórz
← Wszystkie rozwiązania

Unicode (NVARCHAR) migration of a MuEmu / Louis Season 6 database: what is right and what breaks

Napisane przez MuADMINS na podstawie źródłaNot verified

Review of a Season 6 Unicode script set (a migration that converts the name columns to NVARCHAR plus new WZ_CreateCharacter, WZ_DeleteCharacter, WZ_CreateGuild procedures). Its table list (CustomNpcQuest, CustomQuest, CustomAttack, RankingKingGuild, RankingTvT, WarehouseGuild ...) is the Louis Season 6 one.

Right: NVARCHAR stores any language whatever the collation; the guild procedure uses the real Guild.Number column.

What breaks:

  1. It drops the primary keys of 46 tables ("Will NOT recreate") and some UNIQUE constraints. Without them duplicate names become possible and the server's lookups get slow. Put them back after the conversion (in the MuEmu based scripts: Character(Name), AccountCharacter(Id), warehouse(AccountID), Guild(G_Name), GuildMember(Name), MEMB_STAT(memb___id)):
SELECT Name, COUNT(*) FROM Character GROUP BY Name HAVING COUNT(*) > 1;
ALTER TABLE Character ADD CONSTRAINT PK_Character PRIMARY KEY CLUSTERED (Name);
  1. MEMB_INFO and the main AccountCharacter table are not converted (only AccountCharacter2 to 5), but the new WZ_CreateCharacter writes NVARCHAR names into AccountCharacter.GameID1 to GameID5: a Korean name lands there as ?. Convert GameID1 to GameID10 and GameIDC too, for example:
ALTER TABLE AccountCharacter ALTER COLUMN GameID1 NVARCHAR(10) NULL;
  1. The new WZ_CreateCharacter fills only 5 slots; Louis Update 26 and MSPro V6 use 10.
  2. Every other procedure that receives a name with VARCHAR parameters (WZ_RenameCharacter, WZ_GuildCreate, WZ_SetGuildDelete, WZ_GetResetInfo, WZ_SetResetInfo, WZ_FriendAdd ...) still turns it into ?.
  3. Whether the GameServer and client send Unicode names is decided by the server files. Test all of it on a restored copy first, server closed, backup first.

Source: MuADMINS review of Database_Unicode_Migration_SIMPLE_CLEAN.sql, Database_StoredProcedure_Unicode_FINAL.sql and fixed_stored_proc_language.sql, compared with the Louis (JogandoMU) Season 6 Update 2 to 28 scripts and the X-Team / MuDevs MuOnline scripts.

Napisane przez MuADMINS
Czy to pomogło?

Nadal masz problem? Szukaj w MuGPS Zapytaj Asystenta MU

MuADMINS Community Alpha: za darmo, tworzone przez społeczność, w aktywnym rozwoju.