Core/Players: Prevent creation of characters with duplicate names

Port From (https://github.com/TrinityCore/TrinityCore/commit/49ab2bbe3883749594fe92a752e1d618c625d1b6)
This commit is contained in:
Hondacrx
2024-11-10 17:30:37 -05:00
parent 3e2f82d4af
commit 9cb6940f7b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -611,12 +611,12 @@ namespace Game
stmt.AddValue(2, Global.RealmMgr.GetCurrentRealmId().Index);
loginTransaction.Append(stmt);
DB.Login.CommitTransaction(loginTransaction);
AddTransactionCallback(DB.Characters.AsyncCommitTransaction(characterTransaction)).AfterComplete(success =>
{
if (success)
{
DB.Login.CommitTransaction(loginTransaction);
Log.outInfo(LogFilter.Player, "Account: {0} (IP: {1}) Create Character: {2} {3}", GetAccountId(), GetRemoteAddress(), createInfo.Name, newChar.GetGUID().ToString());
Global.ScriptMgr.OnPlayerCreate(newChar);
Global.CharacterCacheStorage.AddCharacterCacheEntry(newChar.GetGUID(), GetAccountId(), newChar.GetName(), (byte)newChar.GetNativeGender(), (byte)newChar.GetRace(), (byte)newChar.GetClass(), (byte)newChar.GetLevel(), false);