Core/Players: Prevent creation of characters with duplicate names
Port From (https://github.com/TrinityCore/TrinityCore/commit/49ab2bbe3883749594fe92a752e1d618c625d1b6)
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user