Refactoring of BNetServer
This commit is contained in:
@@ -25,8 +25,8 @@ using Game.Groups;
|
||||
using Game.Guilds;
|
||||
using Game.Mails;
|
||||
using Game.Maps;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
@@ -554,8 +554,8 @@ namespace Game.Achievements
|
||||
string subject = reward.Subject;
|
||||
string text = reward.Body;
|
||||
|
||||
LocaleConstant localeConstant = _owner.GetSession().GetSessionDbLocaleIndex();
|
||||
if (localeConstant != LocaleConstant.enUS)
|
||||
Locale localeConstant = _owner.GetSession().GetSessionDbLocaleIndex();
|
||||
if (localeConstant != Locale.enUS)
|
||||
{
|
||||
AchievementRewardLocale loc = Global.AchievementMgr.GetAchievementRewardLocale(achievement);
|
||||
if (loc != null)
|
||||
@@ -1327,8 +1327,8 @@ namespace Game.Achievements
|
||||
}
|
||||
|
||||
AchievementRewardLocale data = new AchievementRewardLocale();
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
ObjectManager.AddLocaleString(result.Read<string>(2), locale, data.Subject);
|
||||
@@ -1363,8 +1363,8 @@ namespace Game.Achievements
|
||||
|
||||
public class AchievementRewardLocale
|
||||
{
|
||||
public StringArray Subject = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Body = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Subject = new StringArray((int)Locale.Total);
|
||||
public StringArray Body = new StringArray((int)Locale.Total);
|
||||
}
|
||||
|
||||
public class CompletedAchievementData
|
||||
|
||||
@@ -24,8 +24,8 @@ using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Garrisons;
|
||||
using Game.Maps;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Scenarios;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Constants;
|
||||
using Game.BattleGrounds;
|
||||
using Game.Entities;
|
||||
using Game.Guilds;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.BattleGrounds;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.Arenas
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.BattleGrounds;
|
||||
|
||||
namespace Game.Arenas
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Framework.Dynamic;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.BattleGrounds;
|
||||
|
||||
namespace Game.Arenas
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.BattleGrounds;
|
||||
|
||||
namespace Game.Arenas
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Framework.Dynamic;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.BattleGrounds;
|
||||
|
||||
namespace Game.Arenas
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.BattleGrounds;
|
||||
|
||||
namespace Game.Arenas
|
||||
|
||||
@@ -21,7 +21,7 @@ using Framework.Dynamic;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Mails;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Concurrent;
|
||||
@@ -588,9 +588,9 @@ namespace Game
|
||||
break;
|
||||
}
|
||||
|
||||
for (LocaleConstant locale = LocaleConstant.enUS; locale < LocaleConstant.Total; ++locale)
|
||||
for (Locale locale = Locale.enUS; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == LocaleConstant.None)
|
||||
if (locale == Locale.None)
|
||||
continue;
|
||||
|
||||
bucket.FullName[(int)locale] = auction.Items[0].GetName(locale);
|
||||
@@ -677,7 +677,7 @@ namespace Game
|
||||
|
||||
_itemsByAuctionId[auction.Id] = auction;
|
||||
|
||||
AuctionPosting.Sorter insertSorter = new AuctionPosting.Sorter(LocaleConstant.enUS, new AuctionSortDef[] { new AuctionSortDef(AuctionHouseSortOrder.Price, false) }, 1);
|
||||
AuctionPosting.Sorter insertSorter = new AuctionPosting.Sorter(Locale.enUS, new AuctionSortDef[] { new AuctionSortDef(AuctionHouseSortOrder.Price, false) }, 1);
|
||||
var auctionIndex = bucket.Auctions.BinarySearch(auction, insertSorter);
|
||||
if (auctionIndex < 0)
|
||||
auctionIndex = ~auctionIndex;
|
||||
@@ -1407,7 +1407,7 @@ namespace Game
|
||||
else
|
||||
{
|
||||
bidderAccId = Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(auction.Bidder);
|
||||
logGmTrade = Global.AccountMgr.HasPermission(bidderAccId, RBACPermissions.LogGmTrade, Global.WorldMgr.GetRealmId().Realm);
|
||||
logGmTrade = Global.AccountMgr.HasPermission(bidderAccId, RBACPermissions.LogGmTrade, Global.WorldMgr.GetRealmId().Index);
|
||||
|
||||
if (logGmTrade && !Global.CharacterCacheStorage.GetCharacterNameByGuid(auction.Bidder, out bidderName))
|
||||
bidderName = Global.ObjectMgr.GetCypherString(CypherStrings.Unknown);
|
||||
@@ -1724,7 +1724,7 @@ namespace Game
|
||||
|
||||
public class Sorter : IComparer<AuctionPosting>
|
||||
{
|
||||
public Sorter(LocaleConstant locale, AuctionSortDef[] sorts, int sortCount)
|
||||
public Sorter(Locale locale, AuctionSortDef[] sorts, int sortCount)
|
||||
{
|
||||
_locale = locale;
|
||||
_sorts = sorts;
|
||||
@@ -1776,7 +1776,7 @@ namespace Game
|
||||
return 0;
|
||||
}
|
||||
|
||||
LocaleConstant _locale;
|
||||
Locale _locale;
|
||||
AuctionSortDef[] _sorts;
|
||||
int _sortCount;
|
||||
}
|
||||
@@ -1800,7 +1800,7 @@ namespace Game
|
||||
public byte SortLevel = 0;
|
||||
public byte MinBattlePetLevel = 0;
|
||||
public byte MaxBattlePetLevel = 0;
|
||||
public string[] FullName = new string[(int)LocaleConstant.Total];
|
||||
public string[] FullName = new string[(int)Locale.Total];
|
||||
|
||||
public List<AuctionPosting> Auctions = new List<AuctionPosting>();
|
||||
|
||||
@@ -1846,7 +1846,7 @@ namespace Game
|
||||
|
||||
public class Sorter : IComparer<AuctionsBucketData>
|
||||
{
|
||||
public Sorter(LocaleConstant locale, AuctionSortDef[] sorts, int sortCount)
|
||||
public Sorter(Locale locale, AuctionSortDef[] sorts, int sortCount)
|
||||
{
|
||||
_locale = locale;
|
||||
_sorts = sorts;
|
||||
@@ -1884,7 +1884,7 @@ namespace Game
|
||||
return 0;
|
||||
}
|
||||
|
||||
LocaleConstant _locale;
|
||||
Locale _locale;
|
||||
AuctionSortDef[] _sorts;
|
||||
int _sortCount;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Maps;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@ using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Guilds;
|
||||
using Game.Maps;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -20,7 +20,7 @@ using Framework.Database;
|
||||
using Game.Arenas;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -21,7 +21,7 @@ using Game.Arenas;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.BattleGrounds
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Game.Entities;
|
||||
using Framework.Constants;
|
||||
using System.Collections.Generic;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.DataStorage;
|
||||
using Game.BattleGrounds;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System.Collections.Generic;
|
||||
using Framework.GameMath;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Game.BattleGrounds.Zones
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Collections;
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Game.BlackMarket
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.Entities;
|
||||
using Game.Mails;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Game.BlackMarket
|
||||
@@ -232,7 +232,7 @@ namespace Game.BlackMarket
|
||||
if (bidderAccId == 0) // Account exists
|
||||
return;
|
||||
|
||||
logGmTrade = Global.AccountMgr.HasPermission(bidderAccId, RBACPermissions.LogGmTrade, Global.WorldMgr.GetRealmId().Realm);
|
||||
logGmTrade = Global.AccountMgr.HasPermission(bidderAccId, RBACPermissions.LogGmTrade, Global.WorldMgr.GetRealmId().Index);
|
||||
|
||||
if (logGmTrade && !Global.CharacterCacheStorage.GetCharacterNameByGuid(bidderGuid, out bidderName))
|
||||
bidderName = Global.ObjectMgr.GetCypherString(CypherStrings.Unknown);
|
||||
|
||||
@@ -4,7 +4,7 @@ using Game.Entities;
|
||||
using Framework.Database;
|
||||
using Framework.Constants;
|
||||
using Game.Arenas;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.Cache
|
||||
{
|
||||
|
||||
@@ -20,8 +20,8 @@ using Framework.Database;
|
||||
using Game.Entities;
|
||||
using Game.Guilds;
|
||||
using Game.Mails;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -21,7 +21,7 @@ using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -106,7 +106,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
public static void GetChannelName(ref string channelName, uint channelId, LocaleConstant locale, AreaTableRecord zoneEntry)
|
||||
public static void GetChannelName(ref string channelName, uint channelId, Locale locale, AreaTableRecord zoneEntry)
|
||||
{
|
||||
if (channelId != 0)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
public string GetName(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public string GetName(Locale locale = Locale.enUS)
|
||||
{
|
||||
string result = _channelName;
|
||||
GetChannelName(ref result, _channelId, locale, _zoneEntry);
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Cache;
|
||||
|
||||
namespace Game.Chat
|
||||
@@ -38,10 +38,10 @@ namespace Game.Chat
|
||||
_modifier = modifier;
|
||||
}
|
||||
|
||||
public override ServerPacket Invoke(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override ServerPacket Invoke(Locale locale = Locale.enUS)
|
||||
{
|
||||
// LocalizedPacketDo sends client DBC locale, we need to get available to server locale
|
||||
LocaleConstant localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
Locale localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
|
||||
ChannelNotify data = new ChannelNotify();
|
||||
data.Type = _modifier.GetNotificationType();
|
||||
@@ -61,9 +61,9 @@ namespace Game.Chat
|
||||
_source = source;
|
||||
}
|
||||
|
||||
public override ServerPacket Invoke(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override ServerPacket Invoke(Locale locale = Locale.enUS)
|
||||
{
|
||||
LocaleConstant localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
Locale localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
|
||||
ChannelNotifyJoined notify = new ChannelNotifyJoined();
|
||||
//notify.ChannelWelcomeMsg = "";
|
||||
@@ -86,9 +86,9 @@ namespace Game.Chat
|
||||
_suspended = suspend;
|
||||
}
|
||||
|
||||
public override ServerPacket Invoke(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override ServerPacket Invoke(Locale locale = Locale.enUS)
|
||||
{
|
||||
LocaleConstant localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
Locale localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
|
||||
ChannelNotifyLeft notify = new ChannelNotifyLeft();
|
||||
notify.Channel = _source.GetName(localeIdx);
|
||||
@@ -111,9 +111,9 @@ namespace Game.Chat
|
||||
_guid = guid;
|
||||
}
|
||||
|
||||
public override ServerPacket Invoke(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override ServerPacket Invoke(Locale locale = Locale.enUS)
|
||||
{
|
||||
LocaleConstant localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
Locale localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
|
||||
ChatPkt packet = new ChatPkt();
|
||||
Player player = Global.ObjAccessor.FindConnectedPlayer(_guid);
|
||||
@@ -146,17 +146,17 @@ namespace Game.Chat
|
||||
_guid = guid;
|
||||
}
|
||||
|
||||
public override ServerPacket Invoke(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override ServerPacket Invoke(Locale locale = Locale.enUS)
|
||||
{
|
||||
LocaleConstant localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
Locale localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
|
||||
ChatPkt packet = new ChatPkt();
|
||||
Player player = Global.ObjAccessor.FindConnectedPlayer(_guid);
|
||||
if (player)
|
||||
packet.Initialize(ChatMsg.Channel, _lang, player, player, _what, 0, _source.GetName(localeIdx), LocaleConstant.enUS, _prefix);
|
||||
packet.Initialize(ChatMsg.Channel, _lang, player, player, _what, 0, _source.GetName(localeIdx), Locale.enUS, _prefix);
|
||||
else
|
||||
{
|
||||
packet.Initialize(ChatMsg.Channel, _lang, null, null, _what, 0, _source.GetName(localeIdx), LocaleConstant.enUS, _prefix);
|
||||
packet.Initialize(ChatMsg.Channel, _lang, null, null, _what, 0, _source.GetName(localeIdx), Locale.enUS, _prefix);
|
||||
packet.SenderGUID = _guid;
|
||||
packet.TargetGUID = _guid;
|
||||
}
|
||||
@@ -179,9 +179,9 @@ namespace Game.Chat
|
||||
_guid = guid;
|
||||
}
|
||||
|
||||
public override ServerPacket Invoke(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override ServerPacket Invoke(Locale locale = Locale.enUS)
|
||||
{
|
||||
LocaleConstant localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
Locale localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
|
||||
UserlistAdd userlistAdd = new UserlistAdd();
|
||||
userlistAdd.AddedUserGUID = _guid;
|
||||
@@ -204,9 +204,9 @@ namespace Game.Chat
|
||||
_guid = guid;
|
||||
}
|
||||
|
||||
public override ServerPacket Invoke(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override ServerPacket Invoke(Locale locale = Locale.enUS)
|
||||
{
|
||||
LocaleConstant localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
Locale localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
|
||||
UserlistUpdate userlistUpdate = new UserlistUpdate();
|
||||
userlistUpdate.UpdatedUserGUID = _guid;
|
||||
@@ -229,9 +229,9 @@ namespace Game.Chat
|
||||
_guid = guid;
|
||||
}
|
||||
|
||||
public override ServerPacket Invoke(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override ServerPacket Invoke(Locale locale = Locale.enUS)
|
||||
{
|
||||
LocaleConstant localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
Locale localeIdx = Global.WorldMgr.GetAvailableDbcLocale(locale);
|
||||
|
||||
UserlistRemove userlistRemove = new UserlistRemove();
|
||||
userlistRemove.RemovedUserGUID = _guid;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -145,7 +145,7 @@ namespace Game.Chat
|
||||
{
|
||||
ulong high = 0;
|
||||
high |= (ulong)HighGuid.ChatChannel << 58;
|
||||
high |= (ulong)Global.WorldMgr.GetRealmId().Realm << 42;
|
||||
high |= (ulong)Global.WorldMgr.GetRealmId().Index << 42;
|
||||
high |= (ulong)(_team == Team.Alliance ? 3 : 5) << 4;
|
||||
|
||||
ObjectGuid channelGuid = new ObjectGuid();
|
||||
@@ -163,7 +163,7 @@ namespace Game.Chat
|
||||
|
||||
ulong high = 0;
|
||||
high |= (ulong)HighGuid.ChatChannel << 58;
|
||||
high |= (ulong)Global.WorldMgr.GetRealmId().Realm << 42;
|
||||
high |= (ulong)Global.WorldMgr.GetRealmId().Index << 42;
|
||||
high |= 1ul << 25; // built-in
|
||||
if (channelEntry.Flags.HasAnyFlag(ChannelDBCFlags.CityOnly2))
|
||||
high |= 1ul << 24; // trade
|
||||
|
||||
@@ -22,7 +22,7 @@ using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -735,7 +735,7 @@ namespace Game.Chat
|
||||
return Global.ObjectMgr.GetCypherString(str);
|
||||
}
|
||||
|
||||
public virtual LocaleConstant GetSessionDbcLocale()
|
||||
public virtual Locale GetSessionDbcLocale()
|
||||
{
|
||||
return _session.GetSessionDbcLocale();
|
||||
}
|
||||
@@ -864,7 +864,7 @@ namespace Game.Chat
|
||||
return true;
|
||||
}
|
||||
|
||||
public override LocaleConstant GetSessionDbcLocale()
|
||||
public override Locale GetSessionDbcLocale()
|
||||
{
|
||||
return Global.WorldMgr.GetDefaultDbcLocale();
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ namespace Game.Chat.Commands
|
||||
[Command("account", RBACPermissions.CommandBanlistAccount, true)]
|
||||
static bool HandleBanListAccountCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_EXPIRED_IP_BANS);
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DelExpiredIpBans);
|
||||
DB.Login.Execute(stmt);
|
||||
|
||||
string filterStr = args.NextString();
|
||||
@@ -433,7 +433,7 @@ namespace Game.Chat.Commands
|
||||
[Command("ip", RBACPermissions.CommandBanlistIp, true)]
|
||||
static bool HandleBanListIPCommand(StringArguments args, CommandHandler handler)
|
||||
{
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DEL_EXPIRED_IP_BANS);
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.DelExpiredIpBans);
|
||||
DB.Login.Execute(stmt);
|
||||
|
||||
string filterStr = args.NextString();
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace Game.Chat
|
||||
if (!handler.ExtractPlayerTarget(args, out target))
|
||||
return false;
|
||||
|
||||
LocaleConstant loc = handler.GetSessionDbcLocale();
|
||||
Locale loc = handler.GetSessionDbcLocale();
|
||||
string targetName = target.GetName();
|
||||
string knownStr = handler.GetCypherString(CypherStrings.Known);
|
||||
|
||||
@@ -405,7 +405,7 @@ namespace Game.Chat
|
||||
if (!handler.ExtractPlayerTarget(args, out target))
|
||||
return false;
|
||||
|
||||
LocaleConstant loc = handler.GetSessionDbcLocale();
|
||||
Locale loc = handler.GetSessionDbcLocale();
|
||||
|
||||
var targetFSL = target.GetReputationMgr().GetStateList();
|
||||
foreach (var pair in targetFSL)
|
||||
|
||||
@@ -23,7 +23,7 @@ using Game.Combat;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace Game.Chat
|
||||
// Get the accounts with GM Level >0
|
||||
PreparedStatement stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_GM_ACCOUNTS);
|
||||
stmt.AddValue(0, AccountTypes.Moderator);
|
||||
stmt.AddValue(1, Global.WorldMgr.GetRealm().Id.Realm);
|
||||
stmt.AddValue(1, Global.WorldMgr.GetRealm().Id.Index);
|
||||
SQLResult result = DB.Login.Query(stmt);
|
||||
|
||||
if (!result.IsEmpty())
|
||||
|
||||
@@ -164,7 +164,7 @@ namespace Game.Chat.Commands
|
||||
skillInfo.CanLink == 0) // only prof with recipes have set
|
||||
continue;
|
||||
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
name = skillInfo.DisplayName[locale];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
continue;
|
||||
@@ -172,7 +172,7 @@ namespace Game.Chat.Commands
|
||||
if (!name.Like(namePart))
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < LocaleConstant.Total; ++locale)
|
||||
for (; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == handler.GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -186,7 +186,7 @@ namespace Game.Chat.Commands
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < LocaleConstant.Total)
|
||||
if (locale < Locale.Total)
|
||||
{
|
||||
skillId = skillInfo.Id;
|
||||
break;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Game.Chat
|
||||
// Search in AreaTable.dbc
|
||||
foreach (var areaEntry in CliDB.AreaTableStorage.Values)
|
||||
{
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
string name = areaEntry.AreaName[locale];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
continue;
|
||||
@@ -53,7 +53,7 @@ namespace Game.Chat
|
||||
if (!name.Like(namePart))
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < LocaleConstant.Total; ++locale)
|
||||
for (; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == handler.GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -67,7 +67,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < LocaleConstant.Total)
|
||||
if (locale < Locale.Total)
|
||||
{
|
||||
if (maxlookup != 0 && count++ == maxlookup)
|
||||
{
|
||||
@@ -234,7 +234,7 @@ namespace Game.Chat
|
||||
{
|
||||
FactionState factionState = target ? target.GetReputationMgr().GetState(factionEntry) : null;
|
||||
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
string name = factionEntry.Name[locale];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
continue;
|
||||
@@ -242,7 +242,7 @@ namespace Game.Chat
|
||||
if (!name.Like(namePart))
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < LocaleConstant.Total; ++locale)
|
||||
for (; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == handler.GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -256,7 +256,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < LocaleConstant.Total)
|
||||
if (locale < Locale.Total)
|
||||
{
|
||||
if (maxlookup != 0 && count++ == maxlookup)
|
||||
{
|
||||
@@ -365,7 +365,7 @@ namespace Game.Chat
|
||||
// Search in ItemSet.dbc
|
||||
foreach (var set in CliDB.ItemSetStorage.Values)
|
||||
{
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
string name = set.Name[locale];
|
||||
if (name.IsEmpty())
|
||||
continue;
|
||||
@@ -373,7 +373,7 @@ namespace Game.Chat
|
||||
if (!name.Like(namePart))
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < LocaleConstant.Total; ++locale)
|
||||
for (; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == handler.GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -387,7 +387,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < LocaleConstant.Total)
|
||||
if (locale < Locale.Total)
|
||||
{
|
||||
if (maxlookup != 0 && count++ == maxlookup)
|
||||
{
|
||||
@@ -629,7 +629,7 @@ namespace Game.Chat
|
||||
// Search in SkillLine.dbc
|
||||
foreach (var skillInfo in CliDB.SkillLineStorage.Values)
|
||||
{
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
string name = skillInfo.DisplayName[locale];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
continue;
|
||||
@@ -637,7 +637,7 @@ namespace Game.Chat
|
||||
if (!name.Like(namePart))
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < LocaleConstant.Total; ++locale)
|
||||
for (; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == handler.GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -651,7 +651,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < LocaleConstant.Total)
|
||||
if (locale < Locale.Total)
|
||||
{
|
||||
if (maxlookup != 0 && count++ == maxlookup)
|
||||
{
|
||||
@@ -700,7 +700,7 @@ namespace Game.Chat
|
||||
|
||||
bool found = false;
|
||||
uint count = 0;
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
|
||||
// Search in TaxiNodes.dbc
|
||||
foreach (var nodeEntry in CliDB.TaxiNodesStorage.Values)
|
||||
@@ -802,7 +802,7 @@ namespace Game.Chat
|
||||
if (target && target.GetGender() != gender)
|
||||
continue;
|
||||
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
string name = gender == Gender.Male ? titleInfo.Name[locale]: titleInfo.Name1[locale];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
continue;
|
||||
@@ -810,7 +810,7 @@ namespace Game.Chat
|
||||
if (!name.Like(namePart))
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < LocaleConstant.Total; ++locale)
|
||||
for (; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == handler.GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -824,7 +824,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < LocaleConstant.Total)
|
||||
if (locale < Locale.Total)
|
||||
{
|
||||
if (maxlookup != 0 && counter == maxlookup)
|
||||
{
|
||||
@@ -869,7 +869,7 @@ namespace Game.Chat
|
||||
// search in Map.dbc
|
||||
foreach (var mapInfo in CliDB.MapStorage.Values)
|
||||
{
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
string name = mapInfo.MapName[locale];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
continue;
|
||||
@@ -877,7 +877,7 @@ namespace Game.Chat
|
||||
if (!name.Like(namePart) && handler.GetSession())
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < LocaleConstant.Total; ++locale)
|
||||
for (; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == handler.GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -891,7 +891,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < LocaleConstant.Total)
|
||||
if (locale < Locale.Total)
|
||||
{
|
||||
if (maxlookup != 0 && counter == maxlookup)
|
||||
{
|
||||
@@ -1071,7 +1071,7 @@ namespace Game.Chat
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spellName.Id, Difficulty.None);
|
||||
if (spellInfo != null)
|
||||
{
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
string name = spellInfo.SpellName[locale];
|
||||
if (name.IsEmpty())
|
||||
continue;
|
||||
@@ -1079,7 +1079,7 @@ namespace Game.Chat
|
||||
if (!name.Like(namePart))
|
||||
{
|
||||
locale = 0;
|
||||
for (; locale < LocaleConstant.Total; ++locale)
|
||||
for (; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (locale == handler.GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -1093,7 +1093,7 @@ namespace Game.Chat
|
||||
}
|
||||
}
|
||||
|
||||
if (locale < LocaleConstant.Total)
|
||||
if (locale < Locale.Total)
|
||||
{
|
||||
if (maxlookup != 0 && count++ == maxlookup)
|
||||
{
|
||||
@@ -1167,7 +1167,7 @@ namespace Game.Chat
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(id, Difficulty.None);
|
||||
if (spellInfo != null)
|
||||
{
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
string name = spellInfo.SpellName[locale];
|
||||
if (string.IsNullOrEmpty(name))
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ using Framework.Database;
|
||||
using Framework.IO;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
|
||||
namespace Game.Chat
|
||||
|
||||
@@ -24,7 +24,7 @@ using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Maps;
|
||||
using Game.Movement;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -263,7 +263,7 @@ namespace Game.Chat
|
||||
{
|
||||
var record = CliDB.ItemSparseStorage.Values.FirstOrDefault(itemSparse =>
|
||||
{
|
||||
for (LocaleConstant i = 0; i < LocaleConstant.Total; ++i)
|
||||
for (Locale i = 0; i < Locale.Total; ++i)
|
||||
if (itemName == itemSparse.Display[i])
|
||||
return true;
|
||||
return false;
|
||||
@@ -1359,7 +1359,7 @@ namespace Game.Chat
|
||||
Race raceid;
|
||||
Class classid;
|
||||
Gender gender;
|
||||
LocaleConstant locale = handler.GetSessionDbcLocale();
|
||||
Locale locale = handler.GetSessionDbcLocale();
|
||||
uint totalPlayerTime;
|
||||
uint level;
|
||||
string alive = handler.GetCypherString(CypherStrings.Error);
|
||||
@@ -1437,7 +1437,7 @@ namespace Game.Chat
|
||||
|
||||
// Query the prepared statement for login data
|
||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.SEL_PINFO);
|
||||
stmt.AddValue(0, Global.WorldMgr.GetRealm().Id.Realm);
|
||||
stmt.AddValue(0, Global.WorldMgr.GetRealm().Id.Index);
|
||||
stmt.AddValue(1, accId);
|
||||
SQLResult result0 = DB.Login.Query(stmt);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Constants;
|
||||
using Framework.IO;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@ namespace Game.Chat.Commands
|
||||
|
||||
if (rdata == null)
|
||||
{
|
||||
data.rbac = new RBACData(accountId, accountName, (int)Global.WorldMgr.GetRealm().Id.Realm, (byte)Global.AccountMgr.GetSecurity(accountId, (int)Global.WorldMgr.GetRealm().Id.Realm));
|
||||
data.rbac = new RBACData(accountId, accountName, (int)Global.WorldMgr.GetRealm().Id.Index, (byte)Global.AccountMgr.GetSecurity(accountId, (int)Global.WorldMgr.GetRealm().Id.Index));
|
||||
data.rbac.LoadFromDB();
|
||||
data.needDelete = true;
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ namespace Game.Chat.Commands
|
||||
ObjectGuid targetGuid = Global.CharacterCacheStorage.GetCharacterGuidByName(target);
|
||||
uint accountId = Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(targetGuid);
|
||||
// Target must exist and have administrative rights
|
||||
if (!Global.AccountMgr.HasPermission(accountId, RBACPermissions.CommandsBeAssignedTicket, Global.WorldMgr.GetRealm().Id.Realm))
|
||||
if (!Global.AccountMgr.HasPermission(accountId, RBACPermissions.CommandsBeAssignedTicket, Global.WorldMgr.GetRealm().Id.Index))
|
||||
{
|
||||
handler.SendSysMessage(CypherStrings.CommandTicketassignerrorA);
|
||||
return true;
|
||||
@@ -283,7 +283,7 @@ namespace Game.Chat.Commands
|
||||
}
|
||||
|
||||
// Assign ticket
|
||||
ticket.SetAssignedTo(targetGuid, Global.AccountMgr.IsAdminAccount(Global.AccountMgr.GetSecurity(accountId, (int)Global.WorldMgr.GetRealm().Id.Realm)));
|
||||
ticket.SetAssignedTo(targetGuid, Global.AccountMgr.IsAdminAccount(Global.AccountMgr.GetSecurity(accountId, (int)Global.WorldMgr.GetRealm().Id.Index)));
|
||||
ticket.SaveToDB();
|
||||
|
||||
string msg = ticket.FormatViewMessageString(handler, null, target, null, null);
|
||||
@@ -448,7 +448,7 @@ namespace Game.Chat.Commands
|
||||
{
|
||||
ObjectGuid guid = ticket.GetAssignedToGUID();
|
||||
uint accountId = Global.CharacterCacheStorage.GetCharacterAccountIdByGuid(guid);
|
||||
security = Global.AccountMgr.GetSecurity(accountId, (int)Global.WorldMgr.GetRealm().Id.Realm);
|
||||
security = Global.AccountMgr.GetSecurity(accountId, (int)Global.WorldMgr.GetRealm().Id.Index);
|
||||
}
|
||||
|
||||
// Check security
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace Game.DataStorage
|
||||
internal static int LoadedFileCount;
|
||||
internal static string DataPath;
|
||||
|
||||
public static void LoadStores(string dataPath, LocaleConstant defaultLocale)
|
||||
public static void LoadStores(string dataPath, Locale defaultLocale)
|
||||
{
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
LoadedFileCount = 0;
|
||||
@@ -36,7 +36,7 @@ namespace Game.DataStorage
|
||||
DataPath = dataPath + "/dbc/" + defaultLocale + "/";
|
||||
|
||||
AchievementStorage = DBReader.Read<AchievementRecord>("Achievement.db2", HotfixStatements.SEL_ACHIEVEMENT, HotfixStatements.SEL_ACHIEVEMENT_LOCALE);
|
||||
AnimationDataStorage = DBReader.Read<AnimationDataRecord>("AnimationData.db2", HotfixStatements.SEL_ANIMATION_DATA);
|
||||
//AnimationDataStorage = DBReader.Read<AnimationDataRecord>("AnimationData.db2", HotfixStatements.SEL_ANIMATION_DATA);
|
||||
AnimKitStorage = DBReader.Read<AnimKitRecord>("AnimKit.db2", HotfixStatements.SEL_ANIM_KIT);
|
||||
AreaGroupMemberStorage = DBReader.Read<AreaGroupMemberRecord>("AreaGroupMember.db2", HotfixStatements.SEL_AREA_GROUP_MEMBER);
|
||||
AreaTableStorage = DBReader.Read<AreaTableRecord>("AreaTable.db2", HotfixStatements.SEL_AREA_TABLE, HotfixStatements.SEL_AREA_TABLE_LOCALE);
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Game.DataStorage
|
||||
{
|
||||
bool HasRecord(uint id);
|
||||
|
||||
void WriteRecord(uint id, LocaleConstant locale, ByteBuffer buffer);
|
||||
void WriteRecord(uint id, Locale locale, ByteBuffer buffer);
|
||||
|
||||
void EraseRecord(uint id);
|
||||
}
|
||||
@@ -191,9 +191,9 @@ namespace Game.DataStorage
|
||||
if (preparedStatementLocale == 0)
|
||||
return;
|
||||
|
||||
for (LocaleConstant locale = 0; locale < LocaleConstant.Total; ++locale)
|
||||
for (Locale locale = 0; locale < Locale.Total; ++locale)
|
||||
{
|
||||
if (Global.WorldMgr.GetDefaultDbcLocale() == locale || locale == LocaleConstant.None)
|
||||
if (Global.WorldMgr.GetDefaultDbcLocale() == locale || locale == Locale.None)
|
||||
continue;
|
||||
|
||||
PreparedStatement stmt = DB.Hotfix.GetPreparedStatement(preparedStatementLocale);
|
||||
@@ -235,7 +235,7 @@ namespace Game.DataStorage
|
||||
return ContainsKey(id);
|
||||
}
|
||||
|
||||
public void WriteRecord(uint id, LocaleConstant locale, ByteBuffer buffer)
|
||||
public void WriteRecord(uint id, Locale locale, ByteBuffer buffer)
|
||||
{
|
||||
T entry = this.LookupByKey(id);
|
||||
|
||||
|
||||
@@ -536,13 +536,13 @@ namespace Game.DataStorage
|
||||
LocalizedString localized = new LocalizedString();
|
||||
if (_stringsTable == null)
|
||||
{
|
||||
localized[LocaleConstant.enUS] = _data.ReadCString();
|
||||
localized[Locale.enUS] = _data.ReadCString();
|
||||
}
|
||||
else
|
||||
{
|
||||
var pos = _recordsOffset + (_data.Position >> 3);
|
||||
int ofs = GetFieldValue<int>(fieldIndex);
|
||||
localized[LocaleConstant.enUS] = _stringsTable.LookupByKey(pos + ofs);
|
||||
localized[Locale.enUS] = _stringsTable.LookupByKey(pos + ofs);
|
||||
}
|
||||
|
||||
f.SetValue(obj, localized);
|
||||
@@ -732,12 +732,12 @@ namespace Game.DataStorage
|
||||
|
||||
public class LocalizedString
|
||||
{
|
||||
public bool HasString(LocaleConstant locale = SharedConst.DefaultLocale)
|
||||
public bool HasString(Locale locale = SharedConst.DefaultLocale)
|
||||
{
|
||||
return !string.IsNullOrEmpty(stringStorage[(int)locale]);
|
||||
}
|
||||
|
||||
public string this[LocaleConstant locale]
|
||||
public string this[Locale locale]
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -749,6 +749,6 @@ namespace Game.DataStorage
|
||||
}
|
||||
}
|
||||
|
||||
StringArray stringStorage = new StringArray((int)LocaleConstant.Total);
|
||||
StringArray stringStorage = new StringArray((int)Locale.Total);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Framework.GameMath;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -37,7 +37,7 @@ namespace Game.DataStorage
|
||||
_powersByClass[i][j] = (uint)PowerType.Max;
|
||||
}
|
||||
|
||||
for (uint i = 0; i < (int)LocaleConstant.Total + 1; ++i)
|
||||
for (uint i = 0; i < (int)Locale.Total + 1; ++i)
|
||||
_nameValidators[i] = new List<string>();
|
||||
}
|
||||
|
||||
@@ -360,13 +360,13 @@ namespace Game.DataStorage
|
||||
|
||||
foreach (var namesProfanity in CliDB.NamesProfanityStorage.Values)
|
||||
{
|
||||
Cypher.Assert(namesProfanity.Language < (int)LocaleConstant.Total || namesProfanity.Language == -1);
|
||||
Cypher.Assert(namesProfanity.Language < (int)Locale.Total || namesProfanity.Language == -1);
|
||||
if (namesProfanity.Language != -1)
|
||||
_nameValidators[namesProfanity.Language].Add(namesProfanity.Name);
|
||||
else
|
||||
for (uint i = 0; i < (int)LocaleConstant.Total; ++i)
|
||||
for (uint i = 0; i < (int)Locale.Total; ++i)
|
||||
{
|
||||
if (i == (int)LocaleConstant.None)
|
||||
if (i == (int)Locale.None)
|
||||
continue;
|
||||
|
||||
_nameValidators[i].Add(namesProfanity.Name);
|
||||
@@ -376,16 +376,16 @@ namespace Game.DataStorage
|
||||
CliDB.NamesProfanityStorage.Clear();
|
||||
|
||||
foreach (var namesReserved in CliDB.NamesReservedStorage.Values)
|
||||
_nameValidators[(int)LocaleConstant.Total].Add(namesReserved.Name);
|
||||
_nameValidators[(int)Locale.Total].Add(namesReserved.Name);
|
||||
|
||||
CliDB.NamesReservedStorage.Clear();
|
||||
|
||||
foreach (var namesReserved in CliDB.NamesReservedLocaleStorage.Values)
|
||||
{
|
||||
Cypher.Assert(!Convert.ToBoolean(namesReserved.LocaleMask & ~((1 << (int)LocaleConstant.Total) - 1)));
|
||||
for (int i = 0; i < (int)LocaleConstant.Total; ++i)
|
||||
Cypher.Assert(!Convert.ToBoolean(namesReserved.LocaleMask & ~((1 << (int)Locale.Total) - 1)));
|
||||
for (int i = 0; i < (int)Locale.Total; ++i)
|
||||
{
|
||||
if (i == (int)LocaleConstant.None)
|
||||
if (i == (int)Locale.None)
|
||||
continue;
|
||||
|
||||
if (Convert.ToBoolean(namesReserved.LocaleMask & (1 << i)))
|
||||
@@ -816,7 +816,7 @@ namespace Game.DataStorage
|
||||
return (uint)CliDB.AzeriteLevelInfoStorage.Count;
|
||||
}
|
||||
|
||||
public string GetBroadcastTextValue(BroadcastTextRecord broadcastText, LocaleConstant locale = LocaleConstant.enUS, Gender gender = Gender.Male, bool forceGender = false)
|
||||
public string GetBroadcastTextValue(BroadcastTextRecord broadcastText, Locale locale = Locale.enUS, Gender gender = Gender.Male, bool forceGender = false)
|
||||
{
|
||||
if ((gender == Gender.Female || gender == Gender.None) && (forceGender || broadcastText.Text1.HasString(SharedConst.DefaultLocale)))
|
||||
{
|
||||
@@ -857,7 +857,7 @@ namespace Game.DataStorage
|
||||
return _charStartOutfits.LookupByKey(race | (class_ << 8) | (gender << 16));
|
||||
}
|
||||
|
||||
public string GetClassName(Class class_, LocaleConstant locale = LocaleConstant.enUS)
|
||||
public string GetClassName(Class class_, Locale locale = Locale.enUS)
|
||||
{
|
||||
ChrClassesRecord classEntry = CliDB.ChrClassesStorage.LookupByKey(class_);
|
||||
if (classEntry == null)
|
||||
@@ -866,7 +866,7 @@ namespace Game.DataStorage
|
||||
if (classEntry.Name[locale][0] != '\0')
|
||||
return classEntry.Name[locale];
|
||||
|
||||
return classEntry.Name[LocaleConstant.enUS];
|
||||
return classEntry.Name[Locale.enUS];
|
||||
}
|
||||
|
||||
public uint GetPowerIndexByClass(PowerType powerType, Class classId)
|
||||
@@ -874,7 +874,7 @@ namespace Game.DataStorage
|
||||
return _powersByClass[(int)classId][(int)powerType];
|
||||
}
|
||||
|
||||
public string GetChrRaceName(Race race, LocaleConstant locale = LocaleConstant.enUS)
|
||||
public string GetChrRaceName(Race race, Locale locale = Locale.enUS)
|
||||
{
|
||||
ChrRacesRecord raceEntry = CliDB.ChrRacesStorage.LookupByKey(race);
|
||||
if (raceEntry == null)
|
||||
@@ -883,7 +883,7 @@ namespace Game.DataStorage
|
||||
if (raceEntry.Name[locale][0] != '\0')
|
||||
return raceEntry.Name[locale];
|
||||
|
||||
return raceEntry.Name[LocaleConstant.enUS];
|
||||
return raceEntry.Name[Locale.enUS];
|
||||
}
|
||||
|
||||
public ChrSpecializationRecord GetChrSpecializationByIndex(Class class_, uint index)
|
||||
@@ -896,7 +896,7 @@ namespace Game.DataStorage
|
||||
return _defaultChrSpecializationsByClass.LookupByKey(class_);
|
||||
}
|
||||
|
||||
public string GetCreatureFamilyPetName(CreatureFamily petfamily, LocaleConstant locale)
|
||||
public string GetCreatureFamilyPetName(CreatureFamily petfamily, Locale locale)
|
||||
{
|
||||
if (petfamily == CreatureFamily.None)
|
||||
return null;
|
||||
@@ -1526,14 +1526,14 @@ namespace Game.DataStorage
|
||||
return listNameGen[gender].SelectRandom().Name;
|
||||
}
|
||||
|
||||
public ResponseCodes ValidateName(string name, LocaleConstant locale)
|
||||
public ResponseCodes ValidateName(string name, Locale locale)
|
||||
{
|
||||
foreach (var testName in _nameValidators[(int)locale])
|
||||
if (testName.Equals(name, StringComparison.OrdinalIgnoreCase))
|
||||
return ResponseCodes.CharNameProfane;
|
||||
|
||||
// regexes at TOTAL_LOCALES are loaded from NamesReserved which is not locale specific
|
||||
foreach (var testName in _nameValidators[(int)LocaleConstant.Total])
|
||||
foreach (var testName in _nameValidators[(int)Locale.Total])
|
||||
if (testName.Equals(name, StringComparison.OrdinalIgnoreCase))
|
||||
return ResponseCodes.CharNameReserved;
|
||||
|
||||
@@ -2099,7 +2099,7 @@ namespace Game.DataStorage
|
||||
MultiMap<uint, MountTypeXCapabilityRecord> _mountCapabilitiesByType = new MultiMap<uint, MountTypeXCapabilityRecord>();
|
||||
MultiMap<uint, MountXDisplayRecord> _mountDisplays = new MultiMap<uint, MountXDisplayRecord>();
|
||||
Dictionary<uint, List<NameGenRecord>[]> _nameGenData = new Dictionary<uint, List<NameGenRecord>[]>();
|
||||
List<string>[] _nameValidators = new List<string>[(int)LocaleConstant.Total + 1];
|
||||
List<string>[] _nameValidators = new List<string>[(int)Locale.Total + 1];
|
||||
MultiMap<uint, uint> _phasesByGroup = new MultiMap<uint, uint>();
|
||||
Dictionary<PowerType, PowerTypeRecord> _powerTypes = new Dictionary<PowerType, PowerTypeRecord>();
|
||||
Dictionary<uint, byte> _pvpItemBonus = new Dictionary<uint, byte>();
|
||||
|
||||
@@ -26,7 +26,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.DungeonFinding
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using System.Collections.Generic;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.DungeonFinding
|
||||
{
|
||||
|
||||
@@ -20,12 +20,12 @@ using Framework.GameMath;
|
||||
using Game.AI;
|
||||
using Game.Maps;
|
||||
using Game.Movement;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Framework.Dynamic;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using Framework.Dynamic;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ using Game.DataStorage;
|
||||
using Game.Maps;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ using Game.Maps;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Framework.Collections;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
|
||||
@@ -23,7 +23,7 @@ using Game.DataStorage;
|
||||
using Game.Groups;
|
||||
using Game.Loots;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -2561,9 +2561,9 @@ namespace Game.Entities
|
||||
return vCount.count;
|
||||
}
|
||||
|
||||
public override string GetName(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override string GetName(Locale locale = Locale.enUS)
|
||||
{
|
||||
if (locale != LocaleConstant.enUS)
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
CreatureLocale cl = Global.ObjectMgr.GetCreatureLocale(GetEntry());
|
||||
if (cl != null)
|
||||
|
||||
@@ -20,7 +20,7 @@ using Framework.Constants;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Framework.Dynamic;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
@@ -309,10 +309,10 @@ namespace Game.Entities
|
||||
|
||||
public class CreatureLocale
|
||||
{
|
||||
public StringArray Name = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray NameAlt = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Title = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray TitleAlt = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Name = new StringArray((int)Locale.Total);
|
||||
public StringArray NameAlt = new StringArray((int)Locale.Total);
|
||||
public StringArray Title = new StringArray((int)Locale.Total);
|
||||
public StringArray TitleAlt = new StringArray((int)Locale.Total);
|
||||
}
|
||||
|
||||
public struct EquipmentItem
|
||||
|
||||
@@ -21,7 +21,7 @@ using Framework.GameMath;
|
||||
using Game.Conditions;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -103,7 +103,7 @@ namespace Game.Misc
|
||||
strBoxText = item.BoxText;
|
||||
|
||||
// Check need of localization.
|
||||
if (GetLocale() != LocaleConstant.enUS)
|
||||
if (GetLocale() != Locale.enUS)
|
||||
{
|
||||
if (optionBroadcastText == null)
|
||||
{
|
||||
@@ -181,8 +181,8 @@ namespace Game.Misc
|
||||
|
||||
public void SetMenuId(uint menu_id) { _menuId = menu_id; }
|
||||
public uint GetMenuId() { return _menuId; }
|
||||
public void SetLocale(LocaleConstant locale) { _locale = locale; }
|
||||
LocaleConstant GetLocale() { return _locale; }
|
||||
public void SetLocale(Locale locale) { _locale = locale; }
|
||||
Locale GetLocale() { return _locale; }
|
||||
|
||||
public int GetMenuItemCount()
|
||||
{
|
||||
@@ -212,7 +212,7 @@ namespace Game.Misc
|
||||
Dictionary<uint, GossipMenuItem> _menuItems = new Dictionary<uint, GossipMenuItem>();
|
||||
Dictionary<uint, GossipMenuItemData> _menuItemData = new Dictionary<uint, GossipMenuItemData>();
|
||||
uint _menuId;
|
||||
LocaleConstant _locale;
|
||||
Locale _locale;
|
||||
}
|
||||
|
||||
public class InteractionData
|
||||
@@ -284,8 +284,8 @@ namespace Game.Misc
|
||||
text.Repeatable = quest.IsRepeatable();
|
||||
|
||||
text.QuestTitle = quest.LogTitle;
|
||||
LocaleConstant locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != LocaleConstant.enUS)
|
||||
Locale locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
QuestTemplateLocale localeData = Global.ObjectMgr.GetQuestLocale(quest.Id);
|
||||
if (localeData != null)
|
||||
@@ -319,8 +319,8 @@ namespace Game.Misc
|
||||
packet.Id = pointOfInterest.Id;
|
||||
packet.Name = pointOfInterest.Name;
|
||||
|
||||
LocaleConstant locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != LocaleConstant.enUS)
|
||||
Locale locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
PointOfInterestLocale localeData = Global.ObjectMgr.GetPointOfInterestLocale(id);
|
||||
if (localeData != null)
|
||||
@@ -338,7 +338,7 @@ namespace Game.Misc
|
||||
public void SendQuestGiverQuestListMessage(WorldObject questgiver)
|
||||
{
|
||||
ObjectGuid guid = questgiver.GetGUID();
|
||||
LocaleConstant localeConstant = _session.GetSessionDbLocaleIndex();
|
||||
Locale localeConstant = _session.GetSessionDbLocaleIndex();
|
||||
|
||||
QuestGiverQuestListMessage questList = new QuestGiverQuestListMessage();
|
||||
questList.QuestGiverGUID = guid;
|
||||
@@ -350,7 +350,7 @@ namespace Game.Misc
|
||||
questList.GreetEmoteType = questGreeting.EmoteType;
|
||||
questList.Greeting = questGreeting.Text;
|
||||
|
||||
if (localeConstant != LocaleConstant.enUS)
|
||||
if (localeConstant != Locale.enUS)
|
||||
{
|
||||
QuestGreetingLocale questGreetingLocale = Global.ObjectMgr.GetQuestGreetingLocale(questgiver.GetTypeId(), questgiver.GetEntry());
|
||||
if (questGreetingLocale != null)
|
||||
@@ -368,7 +368,7 @@ namespace Game.Misc
|
||||
{
|
||||
string title = quest.LogTitle;
|
||||
|
||||
if (localeConstant != LocaleConstant.enUS)
|
||||
if (localeConstant != Locale.enUS)
|
||||
{
|
||||
QuestTemplateLocale localeData = Global.ObjectMgr.GetQuestLocale(quest.Id);
|
||||
if (localeData != null)
|
||||
@@ -412,8 +412,8 @@ namespace Game.Misc
|
||||
packet.PortraitTurnInText = quest.PortraitTurnInText;
|
||||
packet.PortraitTurnInName = quest.PortraitTurnInName;
|
||||
|
||||
LocaleConstant locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != LocaleConstant.enUS)
|
||||
Locale locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
QuestTemplateLocale localeData = Global.ObjectMgr.GetQuestLocale(quest.Id);
|
||||
if (localeData != null)
|
||||
@@ -479,8 +479,8 @@ namespace Game.Misc
|
||||
|
||||
QueryQuestInfoResponse queryQuestInfoResponse = quest.QueryData;
|
||||
|
||||
LocaleConstant loc = _session.GetSessionDbLocaleIndex();
|
||||
if (loc != LocaleConstant.enUS)
|
||||
Locale loc = _session.GetSessionDbLocaleIndex();
|
||||
if (loc != Locale.enUS)
|
||||
{
|
||||
QuestTemplateLocale questTemplateLocale = Global.ObjectMgr.GetQuestLocale(queryQuestInfoResponse.QuestID);
|
||||
if (questTemplateLocale != null)
|
||||
@@ -519,8 +519,8 @@ namespace Game.Misc
|
||||
packet.PortraitTurnInText = quest.PortraitTurnInText;
|
||||
packet.PortraitTurnInName = quest.PortraitTurnInName;
|
||||
|
||||
LocaleConstant locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != LocaleConstant.enUS)
|
||||
Locale locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
QuestTemplateLocale localeData = Global.ObjectMgr.GetQuestLocale(quest.Id);
|
||||
if (localeData != null)
|
||||
@@ -583,8 +583,8 @@ namespace Game.Misc
|
||||
packet.QuestTitle = quest.LogTitle;
|
||||
packet.CompletionText = quest.RequestItemsText;
|
||||
|
||||
LocaleConstant locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != LocaleConstant.enUS)
|
||||
Locale locale = _session.GetSessionDbLocaleIndex();
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
QuestTemplateLocale localeData = Global.ObjectMgr.GetQuestLocale(quest.Id);
|
||||
if (localeData != null)
|
||||
@@ -747,7 +747,7 @@ namespace Game.Misc
|
||||
|
||||
public class PageTextLocale
|
||||
{
|
||||
public StringArray Text = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Text = new StringArray((int)Locale.Total);
|
||||
}
|
||||
|
||||
public class GossipMenuItems
|
||||
@@ -781,7 +781,7 @@ namespace Game.Misc
|
||||
|
||||
public class PointOfInterestLocale
|
||||
{
|
||||
public StringArray Name = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Name = new StringArray((int)Locale.Total);
|
||||
}
|
||||
|
||||
public class GossipMenus
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Framework.Constants;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
|
||||
namespace Game.Entities
|
||||
@@ -26,10 +26,10 @@ namespace Game.Entities
|
||||
_type = type;
|
||||
_spells = spells;
|
||||
|
||||
_greeting[(int)LocaleConstant.enUS] = greeting;
|
||||
_greeting[(int)Locale.enUS] = greeting;
|
||||
}
|
||||
|
||||
public void SendSpells(Creature npc, Player player, LocaleConstant locale)
|
||||
public void SendSpells(Creature npc, Player player, Locale locale)
|
||||
{
|
||||
float reputationDiscount = player.GetReputationPriceDiscount(npc);
|
||||
|
||||
@@ -171,15 +171,15 @@ namespace Game.Entities
|
||||
player.SendPacket(trainerBuyFailed);
|
||||
}
|
||||
|
||||
string GetGreeting(LocaleConstant locale)
|
||||
string GetGreeting(Locale locale)
|
||||
{
|
||||
if (_greeting[(int)locale].IsEmpty())
|
||||
return _greeting[(int)LocaleConstant.enUS];
|
||||
return _greeting[(int)Locale.enUS];
|
||||
|
||||
return _greeting[(int)locale];
|
||||
}
|
||||
|
||||
public void AddGreetingLocale(LocaleConstant locale, string greeting)
|
||||
public void AddGreetingLocale(Locale locale, string greeting)
|
||||
{
|
||||
_greeting[(int)locale] = greeting;
|
||||
}
|
||||
@@ -187,6 +187,6 @@ namespace Game.Entities
|
||||
uint _id;
|
||||
TrainerType _type;
|
||||
List<TrainerSpell> _spells;
|
||||
Array<string> _greeting = new Array<string>((int)LocaleConstant.Total);
|
||||
Array<string> _greeting = new Array<string>((int)Locale.Total);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Spells;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
|
||||
@@ -25,12 +25,12 @@ using Game.DataStorage;
|
||||
using Game.Groups;
|
||||
using Game.Loots;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
@@ -2086,9 +2086,9 @@ namespace Game.Entities
|
||||
return GetGoInfo().ScriptId;
|
||||
}
|
||||
|
||||
public override string GetName(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override string GetName(Locale locale = Locale.enUS)
|
||||
{
|
||||
if (locale != LocaleConstant.enUS)
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
GameObjectLocale cl = Global.ObjectMgr.GetGameObjectLocale(GetEntry());
|
||||
if (cl != null)
|
||||
|
||||
@@ -20,7 +20,7 @@ using Framework.Constants;
|
||||
using Framework.GameMath;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
@@ -1235,9 +1235,9 @@ namespace Game.Entities
|
||||
|
||||
public class GameObjectLocale
|
||||
{
|
||||
public StringArray Name = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray CastBarCaption = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Unk1 = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Name = new StringArray((int)Locale.Total);
|
||||
public StringArray CastBarCaption = new StringArray((int)Locale.Total);
|
||||
public StringArray Unk1 = new StringArray((int)Locale.Total);
|
||||
}
|
||||
|
||||
public class GameObjectAddon
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.DataStorage;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.DataStorage;
|
||||
|
||||
namespace Game.Entities
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
|
||||
@@ -20,8 +20,8 @@ using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Loots;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -104,7 +104,7 @@ namespace Game.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
public override string GetName(LocaleConstant locale = LocaleConstant.enUS)
|
||||
public override string GetName(Locale locale = Locale.enUS)
|
||||
{
|
||||
ItemTemplate itemTemplate = GetTemplate();
|
||||
var suffix = CliDB.ItemNameDescriptionStorage.LookupByKey(_bonusData.Suffix);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace Game.Entities
|
||||
Specializations[2] = new BitSet((int)Class.Max * PlayerConst.MaxSpecializations);
|
||||
}
|
||||
|
||||
public string GetName(LocaleConstant locale = SharedConst.DefaultLocale)
|
||||
public string GetName(Locale locale = SharedConst.DefaultLocale)
|
||||
{
|
||||
return ExtendedData.Display[locale];
|
||||
}
|
||||
|
||||
@@ -83,11 +83,11 @@ namespace Game.Entities
|
||||
if (type == HighGuid.Transport)
|
||||
return new ObjectGuid((ulong)type << 58 | (counter << 38), 0);
|
||||
else
|
||||
return new ObjectGuid((ulong)type << 58 | (ulong)Global.WorldMgr.GetRealm().Id.Realm << 42, counter);
|
||||
return new ObjectGuid((ulong)type << 58 | (ulong)Global.WorldMgr.GetRealm().Id.Index << 42, counter);
|
||||
}
|
||||
static ObjectGuid MapSpecificCreate(HighGuid type, byte subType, ushort mapId, uint serverId, uint entry, ulong counter)
|
||||
{
|
||||
return new ObjectGuid((((ulong)type << 58) | ((ulong)(Global.WorldMgr.GetRealm().Id.Realm & 0x1FFF) << 42) | ((ulong)(mapId & 0x1FFF) << 29) | ((ulong)(entry & 0x7FFFFF) << 6) | ((ulong)subType & 0x3F)),
|
||||
return new ObjectGuid((((ulong)type << 58) | ((ulong)(Global.WorldMgr.GetRealm().Id.Index & 0x1FFF) << 42) | ((ulong)(mapId & 0x1FFF) << 29) | ((ulong)(entry & 0x7FFFFF) << 6) | ((ulong)subType & 0x3F)),
|
||||
(((ulong)(serverId & 0xFFFFFF) << 40) | (counter & 0xFFFFFFFFFF)));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
*/
|
||||
|
||||
using Framework.IO;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Game.Entities
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Framework.GameMath;
|
||||
|
||||
@@ -21,8 +21,8 @@ using Framework.GameMath;
|
||||
using Game.AI;
|
||||
using Game.BattleFields;
|
||||
using Game.Maps;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Scenarios;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -1671,7 +1671,7 @@ namespace Game.Entities
|
||||
public virtual ushort GetMovementAnimKitId() { return 0; }
|
||||
public virtual ushort GetMeleeAnimKitId() { return 0; }
|
||||
|
||||
public virtual string GetName(LocaleConstant locale = LocaleConstant.enUS) { return _name; }
|
||||
public virtual string GetName(Locale locale = Locale.enUS) { return _name; }
|
||||
public void SetName(string name) { _name = name; }
|
||||
|
||||
public ObjectGuid GetGUID() { return m_guid; }
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Groups;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -27,7 +27,7 @@ using Game.Groups;
|
||||
using Game.Guilds;
|
||||
using Game.Mails;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -3532,7 +3532,7 @@ namespace Game.Entities
|
||||
stmt.AddValue(0, GetSession().GetAccountId());
|
||||
stmt.AddValue(1, Global.WorldMgr.GetRealmId().Region);
|
||||
stmt.AddValue(2, Global.WorldMgr.GetRealmId().Site);
|
||||
stmt.AddValue(3, Global.WorldMgr.GetRealmId().Realm);
|
||||
stmt.AddValue(3, Global.WorldMgr.GetRealmId().Index);
|
||||
stmt.AddValue(4, GetName());
|
||||
stmt.AddValue(5, GetGUID().GetCounter());
|
||||
stmt.AddValue(6, Time.UnixTime);
|
||||
|
||||
@@ -25,7 +25,7 @@ using Game.Guilds;
|
||||
using Game.Loots;
|
||||
using Game.Mails;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -21,7 +21,7 @@ using Game.DataStorage;
|
||||
using Game.Groups;
|
||||
using Game.Guilds;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ using Game.BattleFields;
|
||||
using Game.BattleGrounds;
|
||||
using Game.Cache;
|
||||
using Game.DataStorage;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.PvP;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
|
||||
@@ -23,7 +23,7 @@ using Game.Groups;
|
||||
using Game.Mails;
|
||||
using Game.Maps;
|
||||
using Game.Misc;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -2803,8 +2803,8 @@ namespace Game.Entities
|
||||
|
||||
packet.QuestTitle = quest.LogTitle;
|
||||
|
||||
LocaleConstant loc_idx = receiver.GetSession().GetSessionDbLocaleIndex();
|
||||
if (loc_idx != LocaleConstant.enUS)
|
||||
Locale loc_idx = receiver.GetSession().GetSessionDbLocaleIndex();
|
||||
if (loc_idx != Locale.enUS)
|
||||
{
|
||||
QuestTemplateLocale questLocale = Global.ObjectMgr.GetQuestLocale(quest.Id);
|
||||
if (questLocale != null)
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Constants;
|
||||
using Framework.Dynamic;
|
||||
using Game.BattlePets;
|
||||
using Game.DataStorage;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ using Game.Loots;
|
||||
using Game.Mails;
|
||||
using Game.Maps;
|
||||
using Game.Misc;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using Game.PvP;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
@@ -2429,7 +2429,7 @@ namespace Game.Entities
|
||||
string strBoxText = "";
|
||||
BroadcastTextRecord optionBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(menuItems.OptionBroadcastTextId);
|
||||
BroadcastTextRecord boxBroadcastText = CliDB.BroadcastTextStorage.LookupByKey(menuItems.BoxBroadcastTextId);
|
||||
LocaleConstant locale = GetSession().GetSessionDbLocaleIndex();
|
||||
Locale locale = GetSession().GetSessionDbLocaleIndex();
|
||||
|
||||
if (optionBroadcastText != null)
|
||||
strOptionText = Global.DB2Mgr.GetBroadcastTextValue(optionBroadcastText, locale, GetGender());
|
||||
@@ -2441,7 +2441,7 @@ namespace Game.Entities
|
||||
else
|
||||
strBoxText = menuItems.BoxText;
|
||||
|
||||
if (locale != LocaleConstant.enUS)
|
||||
if (locale != Locale.enUS)
|
||||
{
|
||||
if (optionBroadcastText == null)
|
||||
{
|
||||
@@ -5057,8 +5057,8 @@ namespace Game.Entities
|
||||
if (playerChoice == null)
|
||||
return;
|
||||
|
||||
LocaleConstant locale = GetSession().GetSessionDbLocaleIndex();
|
||||
PlayerChoiceLocale playerChoiceLocale = locale != LocaleConstant.enUS ? Global.ObjectMgr.GetPlayerChoiceLocale(choiceId) : null;
|
||||
Locale locale = GetSession().GetSessionDbLocaleIndex();
|
||||
PlayerChoiceLocale playerChoiceLocale = locale != Locale.enUS ? Global.ObjectMgr.GetPlayerChoiceLocale(choiceId) : null;
|
||||
|
||||
PlayerTalkClass.GetInteractionData().Reset();
|
||||
PlayerTalkClass.GetInteractionData().SourceGuid = sender;
|
||||
@@ -5080,7 +5080,7 @@ namespace Game.Entities
|
||||
for (var i = 0; i < playerChoice.Responses.Count; ++i)
|
||||
{
|
||||
PlayerChoiceResponse playerChoiceResponseTemplate = playerChoice.Responses[i];
|
||||
var playerChoiceResponse = new Network.Packets.PlayerChoiceResponse();
|
||||
var playerChoiceResponse = new Networking.Packets.PlayerChoiceResponse();
|
||||
|
||||
playerChoiceResponse.ResponseID = playerChoiceResponseTemplate.ResponseId;
|
||||
playerChoiceResponse.ChoiceArtFileID = playerChoiceResponseTemplate.ChoiceArtFileId;
|
||||
@@ -5111,7 +5111,7 @@ namespace Game.Entities
|
||||
|
||||
if (playerChoiceResponseTemplate.Reward.HasValue)
|
||||
{
|
||||
var reward = new Network.Packets.PlayerChoiceResponseReward();
|
||||
var reward = new Networking.Packets.PlayerChoiceResponseReward();
|
||||
reward.TitleID = playerChoiceResponseTemplate.Reward.Value.TitleId;
|
||||
reward.PackageID = playerChoiceResponseTemplate.Reward.Value.PackageId;
|
||||
reward.SkillLineID = playerChoiceResponseTemplate.Reward.Value.SkillLineId;
|
||||
@@ -5123,7 +5123,7 @@ namespace Game.Entities
|
||||
|
||||
foreach (var item in playerChoiceResponseTemplate.Reward.Value.Items)
|
||||
{
|
||||
var rewardEntry = new Network.Packets.PlayerChoiceResponseRewardEntry();
|
||||
var rewardEntry = new Networking.Packets.PlayerChoiceResponseRewardEntry();
|
||||
rewardEntry.Item.ItemID = item.Id;
|
||||
rewardEntry.Quantity = item.Quantity;
|
||||
if (!item.BonusListIDs.Empty())
|
||||
@@ -5136,7 +5136,7 @@ namespace Game.Entities
|
||||
|
||||
foreach (var currency in playerChoiceResponseTemplate.Reward.Value.Currency)
|
||||
{
|
||||
var rewardEntry = new Network.Packets.PlayerChoiceResponseRewardEntry();
|
||||
var rewardEntry = new Networking.Packets.PlayerChoiceResponseRewardEntry();
|
||||
rewardEntry.Item.ItemID = currency.Id;
|
||||
rewardEntry.Quantity = currency.Quantity;
|
||||
reward.Items.Add(rewardEntry);
|
||||
@@ -5144,7 +5144,7 @@ namespace Game.Entities
|
||||
|
||||
foreach (var faction in playerChoiceResponseTemplate.Reward.Value.Faction)
|
||||
{
|
||||
var rewardEntry = new Network.Packets.PlayerChoiceResponseRewardEntry();
|
||||
var rewardEntry = new Networking.Packets.PlayerChoiceResponseRewardEntry();
|
||||
rewardEntry.Item.ItemID = faction.Id;
|
||||
rewardEntry.Quantity = faction.Quantity;
|
||||
reward.Items.Add(rewardEntry);
|
||||
@@ -6458,7 +6458,7 @@ namespace Game.Entities
|
||||
return;
|
||||
|
||||
ChatPkt data = new ChatPkt();
|
||||
data.Initialize(ChatMsg.Whisper, isLogged ? Language.AddonLogged : Language.Addon, this, this, text, 0, "", LocaleConstant.enUS, prefix);
|
||||
data.Initialize(ChatMsg.Whisper, isLogged ? Language.AddonLogged : Language.Addon, this, this, text, 0, "", Locale.enUS, prefix);
|
||||
receiver.SendPacket(data);
|
||||
}
|
||||
public override void Whisper(string text, Language language, Player target = null, bool something = false)
|
||||
@@ -6508,7 +6508,7 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
LocaleConstant locale = target.GetSession().GetSessionDbLocaleIndex();
|
||||
Locale locale = target.GetSession().GetSessionDbLocaleIndex();
|
||||
ChatPkt packet = new ChatPkt();
|
||||
packet.Initialize(ChatMsg.Whisper, Language.Universal, this, target, Global.DB2Mgr.GetBroadcastTextValue(bct, locale, GetGender()));
|
||||
target.SendPacket(packet);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Collections;
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System;
|
||||
@@ -34,15 +34,11 @@ namespace Game.Entities
|
||||
public void InitTaxiNodesForLevel(Race race, Class chrClass, uint level)
|
||||
{
|
||||
// class specific initial known nodes
|
||||
var factionMask = Player.TeamForRace(race) == Team.Horde ? CliDB.HordeTaxiNodesMask : CliDB.AllianceTaxiNodesMask;
|
||||
switch (chrClass)
|
||||
if (chrClass == Class.Deathknight)
|
||||
{
|
||||
case Class.Deathknight:
|
||||
{
|
||||
for (int i = 0; i < PlayerConst.TaxiMaskSize; ++i)
|
||||
m_taximask[i] |= (byte)(CliDB.OldContinentsNodesMask[i] & factionMask[i]);
|
||||
break;
|
||||
}
|
||||
var factionMask = Player.TeamForRace(race) == Team.Horde ? CliDB.HordeTaxiNodesMask : CliDB.AllianceTaxiNodesMask;
|
||||
for (int i = 0; i < PlayerConst.TaxiMaskSize; ++i)
|
||||
m_taximask[i] |= (byte)(CliDB.OldContinentsNodesMask[i] & factionMask[i]);
|
||||
}
|
||||
|
||||
// race specific initial known nodes: capital and taxi hub masks
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Groups;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
|
||||
namespace Game.Entities
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Collections;
|
||||
using Framework.Constants;
|
||||
using Framework.GameMath;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ using Game.DataStorage;
|
||||
using Game.Groups;
|
||||
using Game.Loots;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.PvP;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
|
||||
@@ -23,7 +23,7 @@ using Game.Combat;
|
||||
using Game.DataStorage;
|
||||
using Game.Maps;
|
||||
using Game.Movement;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -21,7 +21,7 @@ using Game.BattleGrounds;
|
||||
using Game.DataStorage;
|
||||
using Game.Maps;
|
||||
using Game.Movement;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Game.Spells;
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Framework.Dynamic;
|
||||
using Game.BattleGrounds;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
@@ -25,12 +25,12 @@ using Game.Combat;
|
||||
using Game.DataStorage;
|
||||
using Game.Maps;
|
||||
using Game.Movement;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Game.Network;
|
||||
using Game.Networking;
|
||||
|
||||
namespace Game.Entities
|
||||
{
|
||||
@@ -366,7 +366,7 @@ namespace Game.Entities
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
LocaleConstant locale = target.GetSession().GetSessionDbLocaleIndex();
|
||||
Locale locale = target.GetSession().GetSessionDbLocaleIndex();
|
||||
ChatPkt data = new ChatPkt();
|
||||
data.Initialize(isBossWhisper ? ChatMsg.RaidBossWhisper : ChatMsg.MonsterWhisper, Language.Universal, this, target, text, 0, "", locale);
|
||||
target.SendPacket(data);
|
||||
@@ -413,7 +413,7 @@ namespace Game.Entities
|
||||
return;
|
||||
}
|
||||
|
||||
LocaleConstant locale = target.GetSession().GetSessionDbLocaleIndex();
|
||||
Locale locale = target.GetSession().GetSessionDbLocaleIndex();
|
||||
ChatPkt data = new ChatPkt();
|
||||
data.Initialize(isBossWhisper ? ChatMsg.RaidBossWhisper : ChatMsg.MonsterWhisper, Language.Universal, this, target, Global.DB2Mgr.GetBroadcastTextValue(bct, locale, GetGender()), 0, "", locale);
|
||||
target.SendPacket(data);
|
||||
|
||||
@@ -20,7 +20,7 @@ using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Framework.Collections;
|
||||
|
||||
@@ -22,7 +22,7 @@ using Framework.GameMath;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -195,7 +195,7 @@ namespace Game
|
||||
}
|
||||
}
|
||||
|
||||
public static ResponseCodes CheckPlayerName(string name, LocaleConstant locale, bool create = false)
|
||||
public static ResponseCodes CheckPlayerName(string name, Locale locale, bool create = false)
|
||||
{
|
||||
if (name.Length > 12)
|
||||
return ResponseCodes.CharNameTooLong;
|
||||
@@ -243,12 +243,12 @@ namespace Game
|
||||
|
||||
return IsValidString(name, strictMask, true);
|
||||
}
|
||||
public static void AddLocaleString(string value, LocaleConstant locale, StringArray data)
|
||||
public static void AddLocaleString(string value, Locale locale, StringArray data)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(value))
|
||||
data[(int)locale] = value;
|
||||
}
|
||||
public static void GetLocaleString(StringArray data, LocaleConstant locale, ref string value)
|
||||
public static void GetLocaleString(StringArray data, Locale locale, ref string value)
|
||||
{
|
||||
if (data.Length > (int)locale && !string.IsNullOrEmpty(data[(int)locale]))
|
||||
value = data[(int)locale];
|
||||
@@ -535,7 +535,7 @@ namespace Game
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loaded {0} realm names in {1} ms.", count, Time.GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
public string GetCypherString(uint entry, LocaleConstant locale = LocaleConstant.enUS)
|
||||
public string GetCypherString(uint entry, Locale locale = Locale.enUS)
|
||||
{
|
||||
if (!CypherStringStorage.ContainsKey(entry))
|
||||
{
|
||||
@@ -549,7 +549,7 @@ namespace Game
|
||||
|
||||
return cs[(int)SharedConst.DefaultLocale];
|
||||
}
|
||||
public string GetCypherString(CypherStrings cmd, LocaleConstant locale = LocaleConstant.enUS)
|
||||
public string GetCypherString(CypherStrings cmd, Locale locale = Locale.enUS)
|
||||
{
|
||||
return GetCypherString((uint)cmd, locale);
|
||||
}
|
||||
@@ -3059,8 +3059,8 @@ namespace Game
|
||||
uint trainerId = trainerLocalesResult.Read<uint>(0);
|
||||
string localeName = trainerLocalesResult.Read<string>(1);
|
||||
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
Trainer trainer = _trainers.LookupByKey(trainerId);
|
||||
@@ -7883,8 +7883,8 @@ namespace Game
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_creatureLocaleStorage.ContainsKey(id))
|
||||
@@ -7915,8 +7915,8 @@ namespace Game
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_gameObjectLocaleStorage.ContainsKey(id))
|
||||
@@ -7946,8 +7946,8 @@ namespace Game
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_questTemplateLocaleStorage.ContainsKey(id))
|
||||
@@ -7981,8 +7981,8 @@ namespace Game
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_questObjectivesLocaleStorage.ContainsKey(id))
|
||||
@@ -8034,8 +8034,8 @@ namespace Game
|
||||
|
||||
string localeName = result.Read<string>(2);
|
||||
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_questGreetingLocaleStorage[type].ContainsKey(id))
|
||||
@@ -8063,8 +8063,8 @@ namespace Game
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_questOfferRewardLocaleStorage.ContainsKey(id))
|
||||
@@ -8090,8 +8090,8 @@ namespace Game
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_questRequestItemsLocaleStorage.ContainsKey(id))
|
||||
@@ -8120,8 +8120,8 @@ namespace Game
|
||||
uint optionIndex = result.Read<uint>(1);
|
||||
string localeName = result.Read<string>(2);
|
||||
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
GossipMenuItemsLocale data = new GossipMenuItemsLocale();
|
||||
@@ -8149,8 +8149,8 @@ namespace Game
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_pageTextLocaleStorage.ContainsKey(id))
|
||||
@@ -8177,8 +8177,8 @@ namespace Game
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (!_pointOfInterestLocaleStorage.ContainsKey(id))
|
||||
@@ -9171,8 +9171,8 @@ namespace Game
|
||||
{
|
||||
int choiceId = result.Read<int>(0);
|
||||
string localeName = result.Read<string>(1);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
if (GetPlayerChoice(choiceId) == null)
|
||||
@@ -9203,8 +9203,8 @@ namespace Game
|
||||
int choiceId = result.Read<int>(0);
|
||||
int responseId = result.Read<int>(1);
|
||||
string localeName = result.Read<string>(2);
|
||||
LocaleConstant locale = localeName.ToEnum<LocaleConstant>();
|
||||
if (locale == LocaleConstant.enUS)
|
||||
Locale locale = localeName.ToEnum<Locale>();
|
||||
if (locale == Locale.enUS)
|
||||
continue;
|
||||
|
||||
var playerChoiceLocale = _playerChoiceLocales.LookupByKey(choiceId);
|
||||
@@ -10715,24 +10715,24 @@ namespace Game
|
||||
|
||||
public class GossipMenuItemsLocale
|
||||
{
|
||||
public StringArray OptionText = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray BoxText = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray OptionText = new StringArray((int)Locale.Total);
|
||||
public StringArray BoxText = new StringArray((int)Locale.Total);
|
||||
}
|
||||
|
||||
public class PlayerChoiceLocale
|
||||
{
|
||||
public StringArray Question = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Question = new StringArray((int)Locale.Total);
|
||||
public Dictionary<int /*ResponseId*/, PlayerChoiceResponseLocale> Responses = new Dictionary<int, PlayerChoiceResponseLocale>();
|
||||
}
|
||||
|
||||
public class PlayerChoiceResponseLocale
|
||||
{
|
||||
public StringArray Answer = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Header = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray SubHeader = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray ButtonTooltip = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Description = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Confirmation = new StringArray((int)LocaleConstant.Total);
|
||||
public StringArray Answer = new StringArray((int)Locale.Total);
|
||||
public StringArray Header = new StringArray((int)Locale.Total);
|
||||
public StringArray SubHeader = new StringArray((int)Locale.Total);
|
||||
public StringArray ButtonTooltip = new StringArray((int)Locale.Total);
|
||||
public StringArray Description = new StringArray((int)Locale.Total);
|
||||
public StringArray Confirmation = new StringArray((int)Locale.Total);
|
||||
}
|
||||
|
||||
public class PlayerChoiceResponseRewardItem
|
||||
|
||||
@@ -23,8 +23,8 @@ using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Loots;
|
||||
using Game.Maps;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -21,8 +21,8 @@ using Game.Achievements;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Groups;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -1437,7 +1437,7 @@ namespace Game.Guilds
|
||||
if (session != null && session.GetPlayer() != null && _HasRankRight(session.GetPlayer(), officerOnly ? GuildRankRights.OffChatSpeak : GuildRankRights.GChatSpeak))
|
||||
{
|
||||
ChatPkt data = new ChatPkt();
|
||||
data.Initialize(officerOnly ? ChatMsg.Officer : ChatMsg.Guild, isLogged ? Language.AddonLogged : Language.Addon, session.GetPlayer(), null, msg, 0, "", LocaleConstant.enUS, prefix);
|
||||
data.Initialize(officerOnly ? ChatMsg.Officer : ChatMsg.Guild, isLogged ? Language.AddonLogged : Language.Addon, session.GetPlayer(), null, msg, 0, "", Locale.enUS, prefix);
|
||||
foreach (var member in m_members.Values)
|
||||
{
|
||||
Player player = member.FindPlayer();
|
||||
@@ -1744,7 +1744,7 @@ namespace Game.Guilds
|
||||
DB.Characters.CommitTransaction(trans);
|
||||
}
|
||||
|
||||
void _CreateDefaultGuildRanks(SQLTransaction trans, LocaleConstant loc = LocaleConstant.enUS)
|
||||
void _CreateDefaultGuildRanks(SQLTransaction trans, Locale loc = Locale.enUS)
|
||||
{
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.DEL_GUILD_RANKS);
|
||||
stmt.AddValue(0, m_id);
|
||||
|
||||
@@ -19,7 +19,7 @@ using Framework.Constants;
|
||||
using Framework.Database;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@ using Framework.Dynamic;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Mails;
|
||||
using Game.Network;
|
||||
using Game.Network.Packets;
|
||||
using Game.Networking;
|
||||
using Game.Networking.Packets;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user