Core/PacketIO: Updated packet structures to 8.1.5
Port TrinityCore Commit: https://github.com/TrinityCore/TrinityCore/commit/31fda79556e55375962a3c9e46f6dbdbf6e90d18
This commit is contained in:
@@ -785,4 +785,11 @@ namespace Framework.Constants
|
||||
NeedsFanfare = 0x01,
|
||||
IsFavorite = 0x02
|
||||
}
|
||||
|
||||
public enum ToyFlags
|
||||
{
|
||||
None = 0,
|
||||
Favorite = 0x01,
|
||||
HasFanfare = 0x02
|
||||
}
|
||||
}
|
||||
|
||||
@@ -948,7 +948,8 @@ namespace Framework.Constants
|
||||
{
|
||||
Player = 0x01,
|
||||
DeathKnight = 0x04,
|
||||
DemonHunter = 0x20
|
||||
DemonHunter = 0x20,
|
||||
Conditional = 0x400
|
||||
}
|
||||
|
||||
public enum CharSectionType
|
||||
|
||||
@@ -84,6 +84,8 @@ namespace Framework.Constants
|
||||
TooLowGearScore = 4,
|
||||
TooHighGearScore = 5,
|
||||
RaidLocked = 6,
|
||||
NoSpec = 14,
|
||||
HasRestriction = 15,
|
||||
AttunementTooLowLevel = 1001,
|
||||
AttunementTooHighLevel = 1002,
|
||||
QuestNotCompleted = 1022,
|
||||
@@ -146,7 +148,7 @@ namespace Framework.Constants
|
||||
Ok = 0x00, // Joined (No Client Msg)
|
||||
GroupFull = 0x1f, // Your Group Is Already Full.
|
||||
NoLfgObject = 0x21, // Internal Lfg Error.
|
||||
NoSlotsPlayer = 0x22, // You Do Not Meet The Requirements For The Chosen Dungeons.
|
||||
NoSlots = 0x22, // You Do Not Meet The Requirements For The Chosen Dungeons.
|
||||
MismatchedSlots = 0x23, // You Cannot Mix Dungeons, Raids, And Random When Picking Dungeons.
|
||||
PartyPlayersFromDifferentRealms = 0x24, // The Dungeon You Chose Does Not Support Players From Multiple Realms.
|
||||
MembersNotPresent = 0x25, // One Or More Group Members Are Pending Invites Or Disconnected.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -369,7 +369,7 @@ namespace Framework.Constants
|
||||
BypassArmorForCaster = 345,
|
||||
EnableAltPower = 346, // Nyi
|
||||
ModSpellCooldownByHaste = 347,
|
||||
DepositBonusMoneyInGuildBankOnLoot = 348, // Nyi
|
||||
ModMoneyGain = 348, // Modifies gold gains from source: [Misc = 0, Quests][Misc = 1, Loot]
|
||||
ModCurrencyGain = 349,
|
||||
ModGatheringItemsGainedPercent = 350, // Nyi
|
||||
Unk351 = 351,
|
||||
|
||||
@@ -149,8 +149,8 @@ namespace Framework.Database
|
||||
PrepareStatement(LoginStatements.UPD_LAST_CHAR_UNDELETE, "UPDATE battlenet_accounts SET LastCharacterUndelete = UNIX_TIMESTAMP() WHERE Id = ?");
|
||||
|
||||
// Account wide toys
|
||||
PrepareStatement(LoginStatements.SEL_ACCOUNT_TOYS, "SELECT itemId, isFavourite FROM battlenet_account_toys WHERE accountId = ?");
|
||||
PrepareStatement(LoginStatements.REP_ACCOUNT_TOYS, "REPLACE INTO battlenet_account_toys (accountId, itemId, isFavourite) VALUES (?, ?, ?)");
|
||||
PrepareStatement(LoginStatements.SEL_ACCOUNT_TOYS, "SELECT itemId, isFavourite, hasFanfare FROM battlenet_account_toys WHERE accountId = ?");
|
||||
PrepareStatement(LoginStatements.REP_ACCOUNT_TOYS, "REPLACE INTO battlenet_account_toys (accountId, itemId, isFavourite, hasFanfare) VALUES (?, ?, ?, ?)");
|
||||
|
||||
// Battle Pets
|
||||
PrepareStatement(LoginStatements.SEL_BATTLE_PETS, "SELECT guid, species, breed, level, exp, health, quality, flags, name FROM battle_pets WHERE battlenetAccountId = ?");
|
||||
|
||||
@@ -120,31 +120,32 @@ public class RealmManager : Singleton<RealmManager>
|
||||
return _realms.LookupByKey(id);
|
||||
}
|
||||
|
||||
// List of client builds for verbose version info in realmlist packet
|
||||
RealmBuildInfo[] ClientBuilds =
|
||||
{
|
||||
new RealmBuildInfo(28938, 8, 1, 5, ' ' ),
|
||||
new RealmBuildInfo(21355, 6, 2, 4, ' ' ),
|
||||
new RealmBuildInfo(20726, 6, 2, 3, ' ' ),
|
||||
new RealmBuildInfo(20574, 6, 2, 2, 'a' ),
|
||||
new RealmBuildInfo(20490, 6, 2, 2, 'a' ),
|
||||
new RealmBuildInfo(15595, 4, 3, 4, ' ' ),
|
||||
new RealmBuildInfo(14545, 4, 2, 2, ' ' ),
|
||||
new RealmBuildInfo(13623, 4, 0, 6, 'a' ),
|
||||
new RealmBuildInfo(13930, 3, 3, 5, 'a' ), // 3.3.5a China Mainland build
|
||||
new RealmBuildInfo(12340, 3, 3, 5, 'a' ),
|
||||
new RealmBuildInfo(11723, 3, 3, 3, 'a' ),
|
||||
new RealmBuildInfo(11403, 3, 3, 2, ' ' ),
|
||||
new RealmBuildInfo(11159, 3, 3, 0, 'a' ),
|
||||
new RealmBuildInfo(10505, 3, 2, 2, 'a' ),
|
||||
new RealmBuildInfo(9947, 3, 1, 3, ' ' ),
|
||||
new RealmBuildInfo(8606, 2, 4, 3, ' ' ),
|
||||
new RealmBuildInfo(6141, 1, 12, 3, ' ' ),
|
||||
new RealmBuildInfo(6005, 1, 12, 2, ' ' ),
|
||||
new RealmBuildInfo(5875, 1, 12, 1, ' ' ),
|
||||
};
|
||||
|
||||
RealmBuildInfo GetBuildInfo(uint build)
|
||||
{
|
||||
// List of client builds for verbose version info in realmlist packet
|
||||
RealmBuildInfo[] ClientBuilds =
|
||||
{
|
||||
new RealmBuildInfo(21355, 6, 2, 4, ' '),
|
||||
new RealmBuildInfo( 20726, 6, 2, 3, ' '),
|
||||
new RealmBuildInfo(20574, 6, 2, 2, 'a'),
|
||||
new RealmBuildInfo( 20490, 6, 2, 2, 'a'),
|
||||
new RealmBuildInfo( 15595, 4, 3, 4, ' '),
|
||||
new RealmBuildInfo( 14545, 4, 2, 2, ' '),
|
||||
new RealmBuildInfo( 13623, 4, 0, 6, 'a'),
|
||||
new RealmBuildInfo( 13930, 3, 3, 5, 'a'), // 3.3.5a China Mainland build
|
||||
new RealmBuildInfo( 12340, 3, 3, 5, 'a'),
|
||||
new RealmBuildInfo( 11723, 3, 3, 3, 'a'),
|
||||
new RealmBuildInfo( 11403, 3, 3, 2, ' '),
|
||||
new RealmBuildInfo( 11159, 3, 3, 0, 'a'),
|
||||
new RealmBuildInfo( 10505, 3, 2, 2, 'a'),
|
||||
new RealmBuildInfo( 9947, 3, 1, 3, ' '),
|
||||
new RealmBuildInfo( 8606, 2, 4, 3, ' '),
|
||||
new RealmBuildInfo( 6141, 1, 12, 3, ' '),
|
||||
new RealmBuildInfo( 6005, 1, 12, 2, ' '),
|
||||
new RealmBuildInfo( 5875, 1, 12, 1, ' '),
|
||||
};
|
||||
|
||||
foreach (var clientBuild in ClientBuilds)
|
||||
if (clientBuild.Build == build)
|
||||
return clientBuild;
|
||||
@@ -152,6 +153,16 @@ public class RealmManager : Singleton<RealmManager>
|
||||
return null;
|
||||
}
|
||||
|
||||
public uint GetMinorMajorBugfixVersionForBuild(uint build)
|
||||
{
|
||||
RealmBuildInfo buildInfo = ClientBuilds.FirstOrDefault(p =>
|
||||
{
|
||||
return p.Build < build;
|
||||
});
|
||||
|
||||
return buildInfo != null ? (buildInfo.MajorVersion * 10000 + buildInfo.MinorVersion * 100 + buildInfo.BugfixVersion) : 0;
|
||||
}
|
||||
|
||||
public void WriteSubRegions(Bgs.Protocol.GameUtilities.V1.GetAllValuesForAttributeResponse response)
|
||||
{
|
||||
foreach (string subRegion in GetSubRegions())
|
||||
|
||||
@@ -399,24 +399,6 @@ namespace Game.Arenas
|
||||
}
|
||||
}
|
||||
|
||||
public void Inspect(WorldSession session, ObjectGuid guid)
|
||||
{
|
||||
ArenaTeamMember member = GetMember(guid);
|
||||
if (member == null)
|
||||
return;
|
||||
|
||||
WorldPacket data = new WorldPacket(ServerOpcodes.InspectPvp);
|
||||
data.WritePackedGuid(guid); // player guid
|
||||
data.WriteUInt8(GetSlot()); // slot (0...2)
|
||||
data.WriteUInt32(GetId()); // arena team id
|
||||
data.WriteUInt32(stats.Rating); // rating
|
||||
data.WriteUInt32(stats.SeasonGames); // season played
|
||||
data.WriteUInt32(stats.SeasonWins); // season wins
|
||||
data.WriteUInt32(member.SeasonGames); // played (count of all games, that the inspected member participated...)
|
||||
data.WriteUInt32(member.PersonalRating); // personal rating
|
||||
//session.SendPacket(data);
|
||||
}
|
||||
|
||||
void BroadcastPacket(ServerPacket packet)
|
||||
{
|
||||
foreach (var member in Members)
|
||||
|
||||
@@ -611,7 +611,7 @@ namespace Game.DataStorage
|
||||
uint count = 0;
|
||||
do
|
||||
{
|
||||
uint id = result.Read<uint>(0);
|
||||
int id = result.Read<int>(0);
|
||||
uint tableHash = result.Read<uint>(1);
|
||||
int recordId = result.Read<int>(2);
|
||||
bool deleted = result.Read<bool>(3);
|
||||
@@ -621,7 +621,8 @@ namespace Game.DataStorage
|
||||
continue;
|
||||
}
|
||||
|
||||
_hotfixData[MathFunctions.MakePair64(id, tableHash)] = recordId;
|
||||
_hotfixData.Add(id, Tuple.Create(tableHash, recordId));
|
||||
++_hotfixCount;
|
||||
deletedRecords[Tuple.Create(tableHash, recordId)] = deleted;
|
||||
|
||||
++count;
|
||||
@@ -669,7 +670,8 @@ namespace Game.DataStorage
|
||||
Log.outInfo(LogFilter.ServerLoading, $"Loaded {_hotfixBlob.Count} hotfix blob records in {Time.GetMSTimeDiffToNow(oldMSTime)} ms");
|
||||
}
|
||||
|
||||
public Dictionary<ulong, int> GetHotfixData() { return _hotfixData; }
|
||||
public uint GetHotfixCount() { return _hotfixCount; }
|
||||
public MultiMap<int, Tuple<uint, int>> GetHotfixData() { return _hotfixData; }
|
||||
|
||||
public byte[] GetHotfixBlobData(uint tableHash, int recordId)
|
||||
{
|
||||
@@ -1884,7 +1886,8 @@ namespace Game.DataStorage
|
||||
}
|
||||
|
||||
Dictionary<uint, IDB2Storage> _storage = new Dictionary<uint, IDB2Storage>();
|
||||
Dictionary<ulong, int> _hotfixData = new Dictionary<ulong, int>();
|
||||
uint _hotfixCount = 0;
|
||||
MultiMap<int, Tuple<uint, int>> _hotfixData = new MultiMap<int, Tuple<uint, int>>();
|
||||
Dictionary<Tuple<uint, int>, byte[]> _hotfixBlob = new Dictionary<Tuple<uint, int>, byte[]>();
|
||||
|
||||
MultiMap<uint, uint> _areaGroupMembers = new MultiMap<uint, uint>();
|
||||
|
||||
@@ -382,7 +382,7 @@ namespace Game.DungeonFinding
|
||||
|
||||
// Check player or group member restrictions
|
||||
if (!player.GetSession().HasPermission(RBACPermissions.JoinDungeonFinder))
|
||||
joinData.result = LfgJoinResult.NoSlotsPlayer;
|
||||
joinData.result = LfgJoinResult.NoSlots;
|
||||
else if (player.InBattleground() || player.InArena() || player.InBattlegroundQueue())
|
||||
joinData.result = LfgJoinResult.CantUseDungeons;
|
||||
else if (player.HasAura(SharedConst.LFGSpellDungeonDeserter))
|
||||
@@ -390,9 +390,9 @@ namespace Game.DungeonFinding
|
||||
else if (player.HasAura(SharedConst.LFGSpellDungeonCooldown))
|
||||
joinData.result = LfgJoinResult.RandomCooldownPlayer;
|
||||
else if (dungeons.Empty())
|
||||
joinData.result = LfgJoinResult.NoSlotsPlayer;
|
||||
joinData.result = LfgJoinResult.NoSlots;
|
||||
else if (player.HasAura(9454)) // check Freeze debuff
|
||||
joinData.result = LfgJoinResult.NoSlotsPlayer;
|
||||
joinData.result = LfgJoinResult.NoSlots;
|
||||
else if (grp)
|
||||
{
|
||||
if (grp.GetMembersCount() > MapConst.MaxGroupSize)
|
||||
@@ -414,7 +414,10 @@ namespace Game.DungeonFinding
|
||||
else if (plrg.InBattleground() || plrg.InArena() || plrg.InBattlegroundQueue())
|
||||
joinData.result = LfgJoinResult.CantUseDungeons;
|
||||
else if (plrg.HasAura(9454)) // check Freeze debuff
|
||||
joinData.result = LfgJoinResult.PartyNotMeetReqs;
|
||||
{
|
||||
joinData.result = LfgJoinResult.NoSlots;
|
||||
joinData.playersMissingRequirement.Add(plrg.GetName());
|
||||
}
|
||||
++memberCount;
|
||||
players.Add(plrg.GetGUID());
|
||||
}
|
||||
@@ -471,9 +474,9 @@ namespace Game.DungeonFinding
|
||||
dungeons = GetDungeonsByRandom(rDungeonId);
|
||||
|
||||
// if we have lockmap then there are no compatible dungeons
|
||||
GetCompatibleDungeons(dungeons, players, joinData.lockmap, isContinue);
|
||||
GetCompatibleDungeons(dungeons, players, joinData.lockmap, joinData.playersMissingRequirement, isContinue);
|
||||
if (dungeons.Empty())
|
||||
joinData.result = grp ? LfgJoinResult.NoLfgObject : LfgJoinResult.NoSlotsPlayer;
|
||||
joinData.result = LfgJoinResult.NoSlots;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -730,10 +733,11 @@ namespace Game.DungeonFinding
|
||||
}
|
||||
}
|
||||
|
||||
void GetCompatibleDungeons(List<uint> dungeons, List<ObjectGuid> players, Dictionary<ObjectGuid, Dictionary<uint, LfgLockInfoData>> lockMap, bool isContinue)
|
||||
void GetCompatibleDungeons(List<uint> dungeons, List<ObjectGuid> players, Dictionary<ObjectGuid, Dictionary<uint, LfgLockInfoData>> lockMap, List<string> playersMissingRequirement, bool isContinue)
|
||||
{
|
||||
lockMap.Clear();
|
||||
Dictionary<uint, uint> lockedDungeons = new Dictionary<uint, uint>();
|
||||
List<uint> dungeonsToRemove = new List<uint>();
|
||||
|
||||
foreach (var guid in players)
|
||||
{
|
||||
@@ -775,15 +779,20 @@ namespace Game.DungeonFinding
|
||||
}
|
||||
|
||||
if (eraseDungeon)
|
||||
dungeons.Remove(dungeonId);
|
||||
dungeonsToRemove.Add(dungeonId);
|
||||
|
||||
if (!lockMap.ContainsKey(guid))
|
||||
lockMap[guid] = new Dictionary<uint, LfgLockInfoData>();
|
||||
|
||||
lockMap[guid][it2.Key] = it2.Value;
|
||||
playersMissingRequirement.Add(player.GetName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (uint dungeonIdToRemove in dungeonsToRemove)
|
||||
dungeons.Remove(dungeonIdToRemove);
|
||||
|
||||
if (!dungeons.Empty())
|
||||
lockMap.Clear();
|
||||
}
|
||||
@@ -1995,6 +2004,7 @@ namespace Game.DungeonFinding
|
||||
public LfgJoinResult result;
|
||||
public LfgRoleCheckState state;
|
||||
public Dictionary<ObjectGuid, Dictionary<uint, LfgLockInfoData>> lockmap = new Dictionary<ObjectGuid, Dictionary<uint, LfgLockInfoData>>();
|
||||
public List<string> playersMissingRequirement = new List<string>();
|
||||
}
|
||||
|
||||
public class LfgUpdateData
|
||||
|
||||
@@ -83,6 +83,9 @@ namespace Game.Entities
|
||||
public float ModExperience;
|
||||
public bool RacialLeader;
|
||||
public uint MovementId;
|
||||
public float FadeRegionRadius;
|
||||
public int WidgetSetID;
|
||||
public int WidgetSetUnitConditionID;
|
||||
public bool RegenHealth;
|
||||
public uint MechanicImmuneMask;
|
||||
public CreatureFlagsExtra FlagsExtra;
|
||||
|
||||
@@ -1481,9 +1481,6 @@ namespace Game.Entities
|
||||
|
||||
static bool HasStats(ItemInstance itemInstance, BonusData bonus)
|
||||
{
|
||||
if (itemInstance.RandomPropertiesID != 0)
|
||||
return true;
|
||||
|
||||
for (byte i = 0; i < ItemConst.MaxStats; ++i)
|
||||
{
|
||||
if (bonus.ItemStatAllocation[i] != 0)
|
||||
|
||||
@@ -399,6 +399,7 @@ namespace Game.Entities
|
||||
data.WriteFloat(unit.GetSpeed(UnitMoveType.PitchRate));
|
||||
|
||||
data.WriteUInt32(0); // unit.m_movementInfo.forces.size()
|
||||
data.WriteFloat(1.0f); // MovementForcesModMagnitude
|
||||
|
||||
data.WriteBit(HasSpline);
|
||||
data.FlushBits();
|
||||
|
||||
@@ -73,9 +73,9 @@ namespace Game.Entities
|
||||
_owner.GetPlayer().AddDynamicValue(ActivePlayerDynamicFields.Toys, value);
|
||||
}
|
||||
|
||||
public bool AddToy(uint itemId, bool isFavourite = false)
|
||||
public bool AddToy(uint itemId, bool isFavourite, bool hasFanfare)
|
||||
{
|
||||
if (UpdateAccountToys(itemId, isFavourite))
|
||||
if (UpdateAccountToys(itemId, isFavourite, hasFanfare))
|
||||
{
|
||||
_owner.GetPlayer().AddDynamicValue(ActivePlayerDynamicFields.Toys, itemId);
|
||||
return true;
|
||||
@@ -92,9 +92,8 @@ namespace Game.Entities
|
||||
do
|
||||
{
|
||||
uint itemId = result.Read<uint>(0);
|
||||
bool isFavourite = result.Read<bool>(1);
|
||||
|
||||
_toys[itemId] = isFavourite;
|
||||
_toys[itemId] = GetToyFlags(result.Read<bool>(1), result.Read<bool>(2));
|
||||
} while (result.NextRow());
|
||||
}
|
||||
|
||||
@@ -106,17 +105,18 @@ namespace Game.Entities
|
||||
stmt = DB.Login.GetPreparedStatement(LoginStatements.REP_ACCOUNT_TOYS);
|
||||
stmt.AddValue(0, _owner.GetBattlenetAccountId());
|
||||
stmt.AddValue(1, pair.Key);
|
||||
stmt.AddValue(2, pair.Value);
|
||||
stmt.AddValue(2, pair.Value.HasAnyFlag(ToyFlags.Favorite));
|
||||
stmt.AddValue(3, pair.Value.HasAnyFlag(ToyFlags.HasFanfare));
|
||||
trans.Append(stmt);
|
||||
}
|
||||
}
|
||||
|
||||
bool UpdateAccountToys(uint itemId, bool isFavourite = false)
|
||||
bool UpdateAccountToys(uint itemId, bool isFavourite, bool hasFanfare)
|
||||
{
|
||||
if (_toys.ContainsKey(itemId))
|
||||
return false;
|
||||
|
||||
_toys.Add(itemId, isFavourite);
|
||||
_toys.Add(itemId, GetToyFlags(isFavourite, hasFanfare));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -125,7 +125,30 @@ namespace Game.Entities
|
||||
if (!_toys.ContainsKey(itemId))
|
||||
return;
|
||||
|
||||
_toys[itemId] = favorite;
|
||||
if (favorite)
|
||||
_toys[itemId] |= ToyFlags.Favorite;
|
||||
else
|
||||
_toys[itemId] &= ~ToyFlags.Favorite;
|
||||
}
|
||||
|
||||
public void ToyClearFanfare(uint itemId)
|
||||
{
|
||||
if (!_toys.ContainsKey(itemId))
|
||||
return;
|
||||
|
||||
_toys[itemId] &= ~ToyFlags.HasFanfare;
|
||||
}
|
||||
|
||||
ToyFlags GetToyFlags(bool isFavourite, bool hasFanfare)
|
||||
{
|
||||
ToyFlags flags = ToyFlags.None;
|
||||
if (isFavourite)
|
||||
flags |= ToyFlags.Favorite;
|
||||
|
||||
if (hasFanfare)
|
||||
flags |= ToyFlags.HasFanfare;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
public void OnItemAdded(Item item)
|
||||
@@ -825,13 +848,13 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
public bool HasToy(uint itemId) { return _toys.ContainsKey(itemId); }
|
||||
public Dictionary<uint, bool> GetAccountToys() { return _toys; }
|
||||
public Dictionary<uint, ToyFlags> GetAccountToys() { return _toys; }
|
||||
public Dictionary<uint, HeirloomData> GetAccountHeirlooms() { return _heirlooms; }
|
||||
public Dictionary<uint, MountStatusFlags> GetAccountMounts() { return _mounts; }
|
||||
|
||||
WorldSession _owner;
|
||||
|
||||
Dictionary<uint, bool> _toys = new Dictionary<uint, bool>();
|
||||
Dictionary<uint, ToyFlags> _toys = new Dictionary<uint, ToyFlags>();
|
||||
Dictionary<uint, HeirloomData> _heirlooms = new Dictionary<uint, HeirloomData>();
|
||||
Dictionary<uint, MountStatusFlags> _mounts = new Dictionary<uint, MountStatusFlags>();
|
||||
System.Collections.BitSet _appearances;
|
||||
|
||||
@@ -3253,7 +3253,7 @@ namespace Game.Entities
|
||||
|
||||
stmt.AddValue(index++, GetByteValue(ActivePlayerFields.Bytes, PlayerFieldOffsets.FieldBytesOffsetActionBarToggles));
|
||||
stmt.AddValue(index++, m_grantableLevels);
|
||||
stmt.AddValue(index++, Global.WorldMgr.GetRealm().Build);
|
||||
stmt.AddValue(index++, Global.RealmMgr.GetMinorMajorBugfixVersionForBuild(Global.WorldMgr.GetRealm().Build));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1327,6 +1327,7 @@ namespace Game.Entities
|
||||
packet.WeeklyQuantity.Set(newWeekCount);
|
||||
packet.TrackedQuantity.Set(newTrackedCount);
|
||||
packet.Flags = playerCurrency.Flags;
|
||||
packet.QuantityChange.Set(count);
|
||||
|
||||
SendPacket(packet);
|
||||
}
|
||||
@@ -2771,7 +2772,7 @@ namespace Game.Entities
|
||||
}
|
||||
void SendNewMail()
|
||||
{
|
||||
SendPacket(new NotifyRecievedMail());
|
||||
SendPacket(new NotifyReceivedMail());
|
||||
}
|
||||
public void UpdateNextMailTimeAndUnreads()
|
||||
{
|
||||
@@ -5015,6 +5016,7 @@ namespace Game.Entities
|
||||
displayPlayerChoice.SenderGUID = sender;
|
||||
displayPlayerChoice.ChoiceID = choiceId;
|
||||
displayPlayerChoice.UiTextureKitID = playerChoice.UiTextureKitId;
|
||||
displayPlayerChoice.SoundKitID = playerChoice.SoundKitId;
|
||||
displayPlayerChoice.Question = playerChoice.Question;
|
||||
if (playerChoiceLocale != null)
|
||||
ObjectManager.GetLocaleString(playerChoiceLocale.Question, locale, ref displayPlayerChoice.Question);
|
||||
@@ -5032,9 +5034,13 @@ namespace Game.Entities
|
||||
playerChoiceResponse.ChoiceArtFileID = playerChoiceResponseTemplate.ChoiceArtFileId;
|
||||
playerChoiceResponse.Flags = playerChoiceResponseTemplate.Flags;
|
||||
playerChoiceResponse.WidgetSetID = playerChoiceResponseTemplate.WidgetSetID;
|
||||
playerChoiceResponse.UiTextureAtlasElementID = playerChoiceResponseTemplate.UiTextureAtlasElementID;
|
||||
playerChoiceResponse.SoundKitID = playerChoiceResponseTemplate.SoundKitID;
|
||||
playerChoiceResponse.GroupID = playerChoiceResponseTemplate.GroupID;
|
||||
playerChoiceResponse.Answer = playerChoiceResponseTemplate.Answer;
|
||||
playerChoiceResponse.Header = playerChoiceResponseTemplate.Header;
|
||||
playerChoiceResponse.SubHeader = playerChoiceResponseTemplate.SubHeader;
|
||||
playerChoiceResponse.ButtonTooltip = playerChoiceResponseTemplate.ButtonTooltip;
|
||||
playerChoiceResponse.Description = playerChoiceResponseTemplate.Description;
|
||||
playerChoiceResponse.Confirmation = playerChoiceResponseTemplate.Confirmation;
|
||||
if (playerChoiceLocale != null)
|
||||
@@ -5044,6 +5050,8 @@ namespace Game.Entities
|
||||
{
|
||||
ObjectManager.GetLocaleString(playerChoiceResponseLocale.Answer, locale, ref playerChoiceResponse.Answer);
|
||||
ObjectManager.GetLocaleString(playerChoiceResponseLocale.Header, locale, ref playerChoiceResponse.Header);
|
||||
ObjectManager.GetLocaleString(playerChoiceResponseLocale.SubHeader, locale, ref playerChoiceResponse.SubHeader);
|
||||
ObjectManager.GetLocaleString(playerChoiceResponseLocale.ButtonTooltip, locale, ref playerChoiceResponse.ButtonTooltip);
|
||||
ObjectManager.GetLocaleString(playerChoiceResponseLocale.Description, locale, ref playerChoiceResponse.Description);
|
||||
ObjectManager.GetLocaleString(playerChoiceResponseLocale.Confirmation, locale, ref playerChoiceResponse.Confirmation);
|
||||
}
|
||||
@@ -5093,6 +5101,8 @@ namespace Game.Entities
|
||||
playerChoiceResponse.Reward.Set(reward);
|
||||
displayPlayerChoice.Responses[i] = playerChoiceResponse;
|
||||
}
|
||||
|
||||
playerChoiceResponse.RewardQuestID = playerChoiceResponseTemplate.RewardQuestID;
|
||||
}
|
||||
|
||||
SendPacket(displayPlayerChoice);
|
||||
|
||||
@@ -977,7 +977,7 @@ namespace Game.Entities
|
||||
playOrphanSpellVisual.SpellVisualID = spellVisualId;
|
||||
playOrphanSpellVisual.TravelSpeed = travelSpeed;
|
||||
playOrphanSpellVisual.SpeedAsTime = speedAsTime;
|
||||
playOrphanSpellVisual.UnkZero = 0.0f;
|
||||
playOrphanSpellVisual.LaunchDelay = 0.0f;
|
||||
SendMessageToSet(playOrphanSpellVisual, true);
|
||||
}
|
||||
|
||||
@@ -991,7 +991,7 @@ namespace Game.Entities
|
||||
playOrphanSpellVisual.SpellVisualID = spellVisualId;
|
||||
playOrphanSpellVisual.TravelSpeed = travelSpeed;
|
||||
playOrphanSpellVisual.SpeedAsTime = speedAsTime;
|
||||
playOrphanSpellVisual.UnkZero = 0.0f;
|
||||
playOrphanSpellVisual.LaunchDelay = 0.0f;
|
||||
SendMessageToSet(playOrphanSpellVisual, true);
|
||||
}
|
||||
|
||||
@@ -1016,12 +1016,12 @@ namespace Game.Entities
|
||||
SendMessageToSet(playSpellVisual, true);
|
||||
}
|
||||
|
||||
public void SendPlaySpellVisual(Vector3 targetPosition, float o, uint spellVisualId, uint missReason, uint reflectStatus, float travelSpeed, bool speedAsTime = false)
|
||||
public void SendPlaySpellVisual(Vector3 targetPosition, float launchDelay, uint spellVisualId, uint missReason, uint reflectStatus, float travelSpeed, bool speedAsTime = false)
|
||||
{
|
||||
PlaySpellVisual playSpellVisual = new PlaySpellVisual();
|
||||
playSpellVisual.Source = GetGUID();
|
||||
playSpellVisual.TargetPosition = targetPosition; // exclusive with Target
|
||||
playSpellVisual.Orientation = o;
|
||||
playSpellVisual.LaunchDelay = launchDelay;
|
||||
playSpellVisual.SpellVisualID = spellVisualId;
|
||||
playSpellVisual.TravelSpeed = travelSpeed;
|
||||
playSpellVisual.MissReason = (ushort)missReason;
|
||||
|
||||
@@ -1760,8 +1760,10 @@ namespace Game
|
||||
"spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, VehicleId, mingold, maxgold, AIName, MovementType, " +
|
||||
//60 61 62 63 64 65 66 67 68
|
||||
"InhabitType, HoverHeight, HealthModifier, HealthModifierExtra, ManaModifier, ManaModifierExtra, ArmorModifier, DamageModifier, ExperienceModifier, " +
|
||||
//69 70 71 72 73 74
|
||||
"RacialLeader, movementId, RegenHealth, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template");
|
||||
//69 70 71 72 73 74 75 76
|
||||
"RacialLeader, movementId, FadeRegionRadius, WidgetSetID, WidgetSetUnitConditionID, RegenHealth, mechanic_immune_mask, flags_extra, " +
|
||||
//77
|
||||
"ScriptName FROM creature_template");
|
||||
|
||||
|
||||
if (result.IsEmpty())
|
||||
@@ -1855,10 +1857,13 @@ namespace Game
|
||||
creature.ModExperience = fields.Read<float>(68);
|
||||
creature.RacialLeader = fields.Read<bool>(69);
|
||||
creature.MovementId = fields.Read<uint>(70);
|
||||
creature.RegenHealth = fields.Read<bool>(71);
|
||||
creature.MechanicImmuneMask = fields.Read<uint>(72);
|
||||
creature.FlagsExtra = (CreatureFlagsExtra)fields.Read<uint>(73);
|
||||
creature.ScriptID = GetScriptId(fields.Read<string>(74));
|
||||
creature.FadeRegionRadius = fields.Read<float>(71);
|
||||
creature.WidgetSetID = fields.Read<int>(72);
|
||||
creature.WidgetSetUnitConditionID = fields.Read<int>(73);
|
||||
creature.RegenHealth = fields.Read<bool>(74);
|
||||
creature.MechanicImmuneMask = fields.Read<uint>(75);
|
||||
creature.FlagsExtra = (CreatureFlagsExtra)fields.Read<uint>(76);
|
||||
creature.ScriptID = GetScriptId(fields.Read<string>(77));
|
||||
|
||||
creatureTemplateStorage.Add(entry, creature);
|
||||
}
|
||||
@@ -6298,9 +6303,9 @@ namespace Game
|
||||
"RewardFactionID5, RewardFactionValue5, RewardFactionOverride5, RewardFactionCapIn5, RewardFactionFlags, " +
|
||||
//96 97 98 99 100 101 102 103
|
||||
"RewardCurrencyID1, RewardCurrencyQty1, RewardCurrencyID2, RewardCurrencyQty2, RewardCurrencyID3, RewardCurrencyQty3, RewardCurrencyID4, RewardCurrencyQty4, " +
|
||||
//104 105 106 107 108 109 110
|
||||
"AcceptedSoundKitID, CompleteSoundKitID, AreaGroupID, TimeAllowed, AllowableRaces, TreasurePickerID, Expansion, " +
|
||||
//111 112 113 114 115 116 117 118 119
|
||||
//104 105 106 107 108 109 110 111
|
||||
"AcceptedSoundKitID, CompleteSoundKitID, AreaGroupID, TimeAllowed, AllowableRaces, TreasurePickerID, Expansion, ManagedWorldStateID, " +
|
||||
//112 113 114 115 116 117 118 119 120
|
||||
"LogTitle, LogDescription, QuestDescription, AreaDescription, PortraitGiverText, PortraitGiverName, PortraitTurnInText, PortraitTurnInName, QuestCompletionLog" +
|
||||
" FROM quest_template");
|
||||
|
||||
@@ -8834,7 +8839,7 @@ namespace Game
|
||||
uint oldMSTime = Time.GetMSTime();
|
||||
_playerChoices.Clear();
|
||||
|
||||
SQLResult choiceResult = DB.World.Query("SELECT ChoiceId, UiTextureKitId, Question, HideWarboardHeader, KeepOpenAfterChoice FROM playerchoice");
|
||||
SQLResult choiceResult = DB.World.Query("SELECT ChoiceId, UiTextureKitId, SoundKitId, Question, HideWarboardHeader, KeepOpenAfterChoice FROM playerchoice");
|
||||
if (choiceResult.IsEmpty())
|
||||
{
|
||||
Log.outInfo(LogFilter.ServerLoading, "Loaded 0 player choices. DB table `playerchoice` is empty.");
|
||||
@@ -8852,15 +8857,16 @@ namespace Game
|
||||
PlayerChoice choice = new PlayerChoice();
|
||||
choice.ChoiceId = choiceResult.Read<int>(0);
|
||||
choice.UiTextureKitId = choiceResult.Read<int>(1);
|
||||
choice.Question = choiceResult.Read<string>(2);
|
||||
choice.HideWarboardHeader = choiceResult.Read<bool>(3);
|
||||
choice.KeepOpenAfterChoice = choiceResult.Read<bool>(4);
|
||||
choice.SoundKitId = choiceResult.Read<uint>(2);
|
||||
choice.Question = choiceResult.Read<string>(3);
|
||||
choice.HideWarboardHeader = choiceResult.Read<bool>(4);
|
||||
choice.KeepOpenAfterChoice = choiceResult.Read<bool>(5);
|
||||
|
||||
_playerChoices[choice.ChoiceId] = choice;
|
||||
|
||||
} while (choiceResult.NextRow());
|
||||
|
||||
SQLResult responses = DB.World.Query("SELECT ChoiceId, ResponseId, ChoiceArtFileId, Flags, WidgetSetID, GroupID, Header, Answer, Description, Confirmation FROM playerchoice_response ORDER BY `Index` ASC");
|
||||
SQLResult responses = DB.World.Query("SELECT ChoiceId, ResponseId, ChoiceArtFileId, Flags, WidgetSetID, UiTextureAtlasElementID, SoundKitID, GroupID, Answer, Header, SubHeader, ButtonTemplate, Description, Confirmation, RewardQuestID FROM playerchoice_response ORDER BY `Index` ASC");
|
||||
if (!responses.IsEmpty())
|
||||
{
|
||||
do
|
||||
@@ -8881,11 +8887,17 @@ namespace Game
|
||||
response.ChoiceArtFileId = responses.Read<int>(2);
|
||||
response.Flags = responses.Read<int>(3);
|
||||
response.WidgetSetID = responses.Read<uint>(4);
|
||||
response.GroupID = responses.Read<byte>(5);
|
||||
response.Header = responses.Read<string>(6);
|
||||
response.Answer = responses.Read<string>(7);
|
||||
response.Description = responses.Read<string>(8);
|
||||
response.Confirmation = responses.Read<string>(9);
|
||||
response.UiTextureAtlasElementID = responses.Read<uint>(5);
|
||||
response.SoundKitID = responses.Read<uint>(6);
|
||||
response.GroupID = responses.Read<byte>(7);
|
||||
response.Answer = responses.Read<string>(8);
|
||||
response.Header = responses.Read<string>(9);
|
||||
response.SubHeader = responses.Read<string>(10);
|
||||
response.ButtonTooltip = responses.Read<string>(11);
|
||||
response.Description = responses.Read<string>(12);
|
||||
response.Confirmation = responses.Read<string>(13);
|
||||
if (!responses.IsNull(14))
|
||||
response.RewardQuestID.Set(responses.Read<uint>(14));
|
||||
++responseCount;
|
||||
|
||||
choice.Responses[responseId] = response;
|
||||
@@ -9122,8 +9134,8 @@ namespace Game
|
||||
|
||||
oldMSTime = Time.GetMSTime();
|
||||
|
||||
// 0 1 2 3 4 5 6
|
||||
result = DB.World.Query("SELECT ChoiceID, ResponseID, locale, Header, Answer, Description, Confirmation FROM playerchoice_response_locale");
|
||||
// 0 1 2 3 4 5 6 7 8
|
||||
result = DB.World.Query("SELECT ChoiceID, ResponseID, locale, Answer, Header, SubHeader, ButtonTooltip, Description, Confirmation FROM playerchoice_response_locale");
|
||||
if (!result.IsEmpty())
|
||||
{
|
||||
uint count = 0;
|
||||
@@ -9151,10 +9163,12 @@ namespace Game
|
||||
}
|
||||
|
||||
PlayerChoiceResponseLocale data = playerChoiceLocale.Responses[responseId];
|
||||
AddLocaleString(result.Read<string>(3), locale, data.Header);
|
||||
AddLocaleString(result.Read<string>(4), locale, data.Answer);
|
||||
AddLocaleString(result.Read<string>(5), locale, data.Description);
|
||||
AddLocaleString(result.Read<string>(6), locale, data.Confirmation);
|
||||
AddLocaleString(result.Read<string>(3), locale, data.Answer);
|
||||
AddLocaleString(result.Read<string>(4), locale, data.Header);
|
||||
AddLocaleString(result.Read<string>(5), locale, data.SubHeader);
|
||||
AddLocaleString(result.Read<string>(6), locale, data.ButtonTooltip);
|
||||
AddLocaleString(result.Read<string>(7), locale, data.Description);
|
||||
AddLocaleString(result.Read<string>(8), locale, data.Confirmation);
|
||||
count++;
|
||||
} while (result.NextRow());
|
||||
|
||||
@@ -10579,6 +10593,8 @@ namespace Game
|
||||
{
|
||||
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);
|
||||
}
|
||||
@@ -10632,12 +10648,17 @@ namespace Game
|
||||
public int ChoiceArtFileId;
|
||||
public int Flags;
|
||||
public uint WidgetSetID;
|
||||
public uint UiTextureAtlasElementID;
|
||||
public uint SoundKitID;
|
||||
public byte GroupID;
|
||||
public string Header;
|
||||
public string Answer;
|
||||
public string Header;
|
||||
public string SubHeader;
|
||||
public string ButtonTooltip;
|
||||
public string Description;
|
||||
public string Confirmation;
|
||||
public Optional<PlayerChoiceResponseReward> Reward;
|
||||
public Optional<uint> RewardQuestID;
|
||||
}
|
||||
|
||||
public class PlayerChoice
|
||||
@@ -10649,6 +10670,7 @@ namespace Game
|
||||
|
||||
public int ChoiceId;
|
||||
public int UiTextureKitId;
|
||||
public uint SoundKitId;
|
||||
public string Question;
|
||||
public List<PlayerChoiceResponse> Responses = new List<PlayerChoiceResponse>();
|
||||
public bool HideWarboardHeader;
|
||||
|
||||
@@ -254,10 +254,11 @@ namespace Game.Guilds
|
||||
session.SendPacket(roster);
|
||||
}
|
||||
|
||||
public void SendQueryResponse(WorldSession session)
|
||||
public void SendQueryResponse(WorldSession session, ObjectGuid playerGuid)
|
||||
{
|
||||
QueryGuildInfoResponse response = new QueryGuildInfoResponse();
|
||||
response.GuildGUID = GetGUID();
|
||||
response.PlayerGuid = playerGuid;
|
||||
response.HasGuildInfo = true;
|
||||
|
||||
response.Info.GuildGuid = GetGUID();
|
||||
@@ -400,7 +401,7 @@ namespace Game.Guilds
|
||||
|
||||
SendSaveEmblemResult(session, GuildEmblemError.Success); // "Guild Emblem saved."
|
||||
|
||||
SendQueryResponse(session);
|
||||
SendQueryResponse(session, ObjectGuid.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2019 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Network.Packets;
|
||||
|
||||
namespace Game
|
||||
{
|
||||
public partial class WorldSession
|
||||
{
|
||||
void SendNotInArenaTeamPacket(ArenaTypes type)
|
||||
{
|
||||
ArenaError arenaError = new ArenaError();
|
||||
arenaError.ErrorType = ArenaErrorType.NoTeam;
|
||||
arenaError.TeamSize = (byte)type; // team type (2=2v2, 3=3v3, 5=5v5), can be used for custom types...
|
||||
SendPacket(arenaError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,11 +57,14 @@ namespace Game
|
||||
void HandleBattlemasterJoin(BattlemasterJoin battlemasterJoin)
|
||||
{
|
||||
bool isPremade = false;
|
||||
Group grp = null;
|
||||
|
||||
BattlefieldStatusFailed battlefieldStatusFailed;
|
||||
if (battlemasterJoin.QueueIDs.Empty())
|
||||
{
|
||||
Log.outError(LogFilter.Network, $"Battleground: no bgtype received. possible cheater? {_player.GetGUID().ToString()}");
|
||||
return;
|
||||
}
|
||||
|
||||
uint bgTypeId_ = (uint)(battlemasterJoin.QueueID & 0xFFFF);
|
||||
uint bgTypeId_ = (uint)(battlemasterJoin.QueueIDs[0] & 0xFFFF);
|
||||
if (!CliDB.BattlemasterListStorage.ContainsKey(bgTypeId_))
|
||||
{
|
||||
Log.outError(LogFilter.Network, "Battleground: invalid bgtype ({0}) received. possible cheater? player guid {1}", bgTypeId_, GetPlayer().GetGUID().ToString());
|
||||
@@ -94,8 +97,12 @@ namespace Game
|
||||
return;
|
||||
|
||||
GroupJoinBattlegroundResult err = GroupJoinBattlegroundResult.None;
|
||||
|
||||
Group grp = _player.GetGroup();
|
||||
|
||||
BattlefieldStatusFailed battlefieldStatusFailed;
|
||||
// check queue conditions
|
||||
if (!battlemasterJoin.JoinAsGroup)
|
||||
if (grp == null)
|
||||
{
|
||||
if (GetPlayer().isUsingLfg())
|
||||
{
|
||||
@@ -159,11 +166,6 @@ namespace Game
|
||||
}
|
||||
else
|
||||
{
|
||||
grp = GetPlayer().GetGroup();
|
||||
|
||||
if (!grp)
|
||||
return;
|
||||
|
||||
if (grp.GetLeaderGUID() != GetPlayer().GetGUID())
|
||||
return;
|
||||
|
||||
@@ -517,10 +519,7 @@ namespace Game
|
||||
// check real arenateam existence only here (if it was moved to group.CanJoin .. () then we would ahve to get it twice)
|
||||
ArenaTeam at = Global.ArenaTeamMgr.GetArenaTeamById(ateamId);
|
||||
if (at == null)
|
||||
{
|
||||
GetPlayer().GetSession().SendNotInArenaTeamPacket(arenatype);
|
||||
return;
|
||||
}
|
||||
|
||||
// get the team rating for queuing
|
||||
uint arenaRating = at.GetRating();
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace Game
|
||||
|
||||
packet.MarketID = templ.MarketID;
|
||||
packet.Item = templ.Item;
|
||||
packet.RandomPropertiesID = templ.Item.RandomPropertiesID;
|
||||
packet.RandomPropertiesID = 0;
|
||||
|
||||
SendPacket(packet);
|
||||
}
|
||||
|
||||
@@ -34,13 +34,14 @@ namespace Game
|
||||
{
|
||||
if (guild.IsMember(query.PlayerGuid))
|
||||
{
|
||||
guild.SendQueryResponse(this);
|
||||
guild.SendQueryResponse(this, query.PlayerGuid);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QueryGuildInfoResponse response = new QueryGuildInfoResponse();
|
||||
response.GuildGUID = query.GuildGuid;
|
||||
response.PlayerGuid = query.PlayerGuid;
|
||||
SendPacket(response);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,41 +59,44 @@ namespace Game
|
||||
|
||||
void SendAvailableHotfixes(int version)
|
||||
{
|
||||
SendPacket(new AvailableHotfixes(version, Global.DB2Mgr.GetHotfixData()));
|
||||
SendPacket(new AvailableHotfixes(version, Global.DB2Mgr.GetHotfixCount(), Global.DB2Mgr.GetHotfixData()));
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.HotfixRequest, Status = SessionStatus.Authed)]
|
||||
void HandleHotfixRequest(HotfixRequest hotfixQuery)
|
||||
{
|
||||
Dictionary<ulong, int> hotfixes = Global.DB2Mgr.GetHotfixData();
|
||||
var hotfixes = Global.DB2Mgr.GetHotfixData();
|
||||
|
||||
HotfixResponse hotfixQueryResponse = new HotfixResponse();
|
||||
foreach (ulong hotfixId in hotfixQuery.Hotfixes)
|
||||
foreach (HotfixRecord hotfixRecord in hotfixQuery.Hotfixes)
|
||||
{
|
||||
int hotfix = hotfixes.LookupByKey(hotfixId);
|
||||
if (hotfix != 0)
|
||||
var hotfixedRecords = hotfixes.LookupByKey(hotfixRecord.HotfixID);
|
||||
if (!hotfixedRecords.Empty())
|
||||
{
|
||||
var storage = Global.DB2Mgr.GetStorage(MathFunctions.Pair64_HiPart(hotfixId));
|
||||
foreach (var tableRecord in hotfixedRecords)
|
||||
{
|
||||
var storage = Global.DB2Mgr.GetStorage(hotfixRecord.TableHash);
|
||||
|
||||
HotfixResponse.HotfixData hotfixData = new HotfixResponse.HotfixData();
|
||||
hotfixData.ID = hotfixId;
|
||||
hotfixData.RecordID = hotfix;
|
||||
if (storage != null && storage.HasRecord((uint)hotfixData.RecordID))
|
||||
{
|
||||
hotfixData.Data.HasValue = true;
|
||||
storage.WriteRecord((uint)hotfixData.RecordID, GetSessionDbcLocale(), hotfixData.Data.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] blobData = Global.DB2Mgr.GetHotfixBlobData(MathFunctions.Pair64_HiPart(hotfixId), hotfix);
|
||||
if (blobData != null)
|
||||
HotfixResponse.HotfixData hotfixData = new HotfixResponse.HotfixData();
|
||||
hotfixData.Record = hotfixRecord;
|
||||
if (storage != null && storage.HasRecord((uint)hotfixData.Record.RecordID))
|
||||
{
|
||||
hotfixData.Data.HasValue = true;
|
||||
hotfixData.Data.Value.WriteBytes(blobData);
|
||||
uint pos = hotfixQueryResponse.HotfixContent.GetSize();
|
||||
storage.WriteRecord((uint)hotfixData.Record.RecordID, GetSessionDbcLocale(), hotfixQueryResponse.HotfixContent);
|
||||
hotfixData.Size.Set(hotfixQueryResponse.HotfixContent.GetSize() - pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] blobData = Global.DB2Mgr.GetHotfixBlobData(hotfixData.Record.TableHash, hotfixData.Record.RecordID);
|
||||
if (blobData != null)
|
||||
{
|
||||
hotfixData.Size.Set((uint)blobData.Length);
|
||||
hotfixQueryResponse.HotfixContent.WriteBytes(blobData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
hotfixQueryResponse.Hotfixes.Add(hotfixData);
|
||||
hotfixQueryResponse.Hotfixes.Add(hotfixData);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,61 +78,15 @@ namespace Game
|
||||
|
||||
inspectResult.InspecteeGUID = inspect.Target;
|
||||
inspectResult.SpecializationID = (int)player.GetUInt32Value(PlayerFields.CurrentSpecId);
|
||||
inspectResult.LifetimeMaxRank = player.GetByteValue(ActivePlayerFields.Bytes, PlayerFieldOffsets.FieldBytesOffsetLifetimeMaxPvpRank);
|
||||
inspectResult.TodayHK = player.GetUInt16Value(ActivePlayerFields.Kills, PlayerFieldOffsets.FieldKillsOffsetTodayKills);
|
||||
inspectResult.YesterdayHK = player.GetUInt16Value(ActivePlayerFields.Kills, PlayerFieldOffsets.FieldKillsOffsetYesterdayKills);
|
||||
inspectResult.LifetimeHK = player.GetUInt32Value(ActivePlayerFields.LifetimeHonorableKills);
|
||||
inspectResult.HonorLevel = player.GetUInt32Value(PlayerFields.HonorLevel);
|
||||
|
||||
SendPacket(inspectResult);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.RequestHonorStats)]
|
||||
void HandleRequestHonorStatsOpcode(RequestHonorStats request)
|
||||
{
|
||||
Player player = Global.ObjAccessor.FindPlayer(request.TargetGUID);
|
||||
if (!player)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WorldSession.HandleRequestHonorStatsOpcode: Target {0} not found.", request.TargetGUID.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetPlayer().IsWithinDistInMap(player, SharedConst.InspectDistance, false))
|
||||
return;
|
||||
|
||||
if (GetPlayer().IsValidAttackTarget(player))
|
||||
return;
|
||||
|
||||
InspectHonorStats honorStats = new InspectHonorStats();
|
||||
honorStats.PlayerGUID = request.TargetGUID;
|
||||
honorStats.LifetimeHK = player.GetUInt32Value(ActivePlayerFields.LifetimeHonorableKills);
|
||||
honorStats.YesterdayHK = player.GetUInt16Value(ActivePlayerFields.Kills, 1);
|
||||
honorStats.TodayHK = player.GetUInt16Value(ActivePlayerFields.Kills, 0);
|
||||
honorStats.LifetimeMaxRank = 0; // @todo
|
||||
|
||||
SendPacket(honorStats);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.InspectPvp)]
|
||||
void HandleInspectPVP(InspectPVPRequest request)
|
||||
{
|
||||
// @todo: deal with request.InspectRealmAddress
|
||||
|
||||
Player player = Global.ObjAccessor.FindPlayer(request.InspectTarget);
|
||||
if (!player)
|
||||
{
|
||||
Log.outDebug(LogFilter.Network, "WorldSession.HandleInspectPVP: Target {0} not found.", request.InspectTarget.ToString());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetPlayer().IsWithinDistInMap(player, SharedConst.InspectDistance, false))
|
||||
return;
|
||||
|
||||
if (GetPlayer().IsValidAttackTarget(player))
|
||||
return;
|
||||
|
||||
InspectPVPResponse response = new InspectPVPResponse();
|
||||
response.ClientGUID = request.InspectTarget;
|
||||
// @todo: fill brackets
|
||||
|
||||
SendPacket(response);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.QueryInspectAchievements)]
|
||||
void HandleQueryInspectAchievements(QueryInspectAchievements inspect)
|
||||
{
|
||||
|
||||
@@ -316,7 +316,6 @@ namespace Game
|
||||
foreach (var dungeonId in dungeons)
|
||||
lfgRoleCheckUpdate.JoinSlots.Add(Global.LFGMgr.GetLFGDungeonEntry(dungeonId));
|
||||
|
||||
lfgRoleCheckUpdate.BgQueueID = 0;
|
||||
lfgRoleCheckUpdate.GroupFinderActivityID = 0;
|
||||
if (!roleCheck.roles.Empty())
|
||||
{
|
||||
@@ -348,6 +347,8 @@ namespace Game
|
||||
lfgJoinResult.Result = (byte)joinData.result;
|
||||
if (joinData.result == LfgJoinResult.RoleCheckFailed)
|
||||
lfgJoinResult.ResultDetail = (byte)joinData.state;
|
||||
else if (joinData.result == LfgJoinResult.NoSlots)
|
||||
lfgJoinResult.BlackListNames = joinData.playersMissingRequirement;
|
||||
|
||||
foreach (var it in joinData.lockmap)
|
||||
{
|
||||
|
||||
@@ -196,42 +196,32 @@ namespace Game
|
||||
playersNear.Add(member);
|
||||
}
|
||||
|
||||
uint goldPerPlayer = (uint)(loot.gold / playersNear.Count);
|
||||
ulong goldPerPlayer = (ulong)(loot.gold / playersNear.Count);
|
||||
|
||||
foreach (var pl in playersNear)
|
||||
{
|
||||
pl.ModifyMoney(goldPerPlayer);
|
||||
pl.UpdateCriteria(CriteriaTypes.LootMoney, goldPerPlayer);
|
||||
ulong goldMod = MathFunctions.CalculatePct(goldPerPlayer, pl.GetTotalAuraModifierByMiscValue(AuraType.ModMoneyGain, 1));
|
||||
|
||||
Guild guild = Global.GuildMgr.GetGuildById(pl.GetGuildId());
|
||||
if (guild)
|
||||
{
|
||||
uint guildGold = MathFunctions.CalculatePct(goldPerPlayer, pl.GetTotalAuraModifier(AuraType.DepositBonusMoneyInGuildBankOnLoot));
|
||||
if (guildGold != 0)
|
||||
guild.HandleMemberDepositMoney(this, guildGold, true);
|
||||
}
|
||||
pl.ModifyMoney((long)(goldPerPlayer + goldMod));
|
||||
pl.UpdateCriteria(CriteriaTypes.LootMoney, goldPerPlayer);
|
||||
|
||||
LootMoneyNotify packet = new LootMoneyNotify();
|
||||
packet.Money = goldPerPlayer;
|
||||
packet.MoneyMod = goldMod;
|
||||
packet.SoleLooter = playersNear.Count <= 1 ? true : false;
|
||||
pl.SendPacket(packet);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.ModifyMoney(loot.gold);
|
||||
player.UpdateCriteria(CriteriaTypes.LootMoney, loot.gold);
|
||||
ulong goldMod = MathFunctions.CalculatePct(loot.gold, player.GetTotalAuraModifierByMiscValue(AuraType.ModMoneyGain, 1));
|
||||
|
||||
Guild guild = Global.GuildMgr.GetGuildById(player.GetGuildId());
|
||||
if (guild)
|
||||
{
|
||||
uint guildGold = MathFunctions.CalculatePct(loot.gold, player.GetTotalAuraModifier(AuraType.DepositBonusMoneyInGuildBankOnLoot));
|
||||
if (guildGold != 0)
|
||||
guild.HandleMemberDepositMoney(this, guildGold, true);
|
||||
}
|
||||
player.ModifyMoney((long)(loot.gold + goldMod));
|
||||
player.UpdateCriteria(CriteriaTypes.LootMoney, loot.gold);
|
||||
|
||||
LootMoneyNotify packet = new LootMoneyNotify();
|
||||
packet.Money = loot.gold;
|
||||
packet.MoneyMod = goldMod;
|
||||
packet.SoleLooter = true; // "You loot..."
|
||||
SendPacket(packet);
|
||||
}
|
||||
|
||||
@@ -534,6 +534,7 @@ namespace Game
|
||||
item.StackCount = (int)itemTemplate.GetBuyCount();
|
||||
item.Price = (ulong)price;
|
||||
item.DoNotFilterOnVendor = vendorItem.IgnoreFiltering;
|
||||
item.Refundable = (itemTemplate.GetFlags() & ItemFlags.ItemPurchaseRecord) != 0 && vendorItem.ExtendedCost != 0 && itemTemplate.GetMaxStackSize() == 1;
|
||||
|
||||
item.Item.ItemID = vendorItem.item;
|
||||
if (!vendorItem.BonusListIDs.Empty())
|
||||
|
||||
@@ -158,6 +158,9 @@ namespace Game
|
||||
stats.HealthScalingExpansion = creatureInfo.HealthScalingExpansion;
|
||||
stats.VignetteID = creatureInfo.VignetteID;
|
||||
stats.Class = (int)creatureInfo.UnitClass;
|
||||
stats.FadeRegionRadius = creatureInfo.FadeRegionRadius;
|
||||
stats.WidgetSetID = creatureInfo.WidgetSetID;
|
||||
stats.WidgetSetUnitConditionID = creatureInfo.WidgetSetUnitConditionID;
|
||||
|
||||
stats.Title = creatureInfo.SubName;
|
||||
stats.TitleAlt = creatureInfo.TitleAlt;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (_collectionMgr.AddToy(item.GetEntry(), false))
|
||||
if (_collectionMgr.AddToy(item.GetEntry(), false, false))
|
||||
_player.DestroyItem(item.GetBagSlot(), item.GetSlot(), true);
|
||||
}
|
||||
|
||||
@@ -93,5 +93,11 @@ namespace Game
|
||||
spell.m_castFlagsEx |= SpellCastFlagsEx.UseToySpell;
|
||||
spell.prepare(targets);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.ToyClearFanfare)]
|
||||
void HandleToyClearFanfare(ToyClearFanfare toyClearFanfare)
|
||||
{
|
||||
_collectionMgr.ToyClearFanfare(toyClearFanfare.ItemID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,12 @@ namespace Game.Network.Packets
|
||||
{
|
||||
_worldPacket.WriteUInt32(CurrentSeason);
|
||||
_worldPacket.WriteUInt32(PreviousSeason);
|
||||
_worldPacket.WriteUInt32(PvpSeasonID);
|
||||
}
|
||||
|
||||
public uint PreviousSeason = 0;
|
||||
public uint CurrentSeason = 0;
|
||||
public uint PreviousSeason;
|
||||
public uint CurrentSeason;
|
||||
public uint PvpSeasonID;
|
||||
}
|
||||
|
||||
public class AreaSpiritHealerQuery : ClientPacket
|
||||
@@ -301,16 +303,17 @@ namespace Game.Network.Packets
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
QueueID = _worldPacket.ReadUInt64();
|
||||
var queueCount = _worldPacket.ReadUInt32();
|
||||
Roles = _worldPacket.ReadUInt8();
|
||||
BlacklistMap[0] = _worldPacket.ReadInt32();
|
||||
BlacklistMap[1] = _worldPacket.ReadInt32();
|
||||
JoinAsGroup = _worldPacket.HasBit();
|
||||
|
||||
for (var i = 0; i < queueCount; ++i)
|
||||
QueueIDs[i] = _worldPacket.ReadUInt64();
|
||||
}
|
||||
|
||||
public bool JoinAsGroup;
|
||||
public Array<ulong> QueueIDs = new Array<ulong>(1);
|
||||
public byte Roles;
|
||||
public ulong QueueID;
|
||||
public int[] BlacklistMap = new int[2];
|
||||
}
|
||||
|
||||
@@ -550,21 +553,6 @@ namespace Game.Network.Packets
|
||||
public override void Read() { }
|
||||
}
|
||||
|
||||
public class ArenaError : ServerPacket
|
||||
{
|
||||
public ArenaError() : base(ServerOpcodes.ArenaError) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt32(ErrorType);
|
||||
if (ErrorType == ArenaErrorType.NoTeam)
|
||||
_worldPacket.WriteUInt8(TeamSize);
|
||||
}
|
||||
|
||||
public ArenaErrorType ErrorType;
|
||||
public byte TeamSize;
|
||||
}
|
||||
|
||||
//Structs
|
||||
public struct BattlefieldStatusHeader
|
||||
{
|
||||
|
||||
@@ -49,10 +49,14 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt32(Characters.Count);
|
||||
_worldPacket.WriteInt32(MaxCharacterLevel);
|
||||
_worldPacket.WriteUInt32(RaceUnlockData.Count);
|
||||
_worldPacket.WriteUInt32(UnlockedConditionalAppearances.Count);
|
||||
|
||||
if (DisabledClassesMask.HasValue)
|
||||
_worldPacket.WriteUInt32(DisabledClassesMask.Value);
|
||||
|
||||
foreach (UnlockedConditionalAppearance unlockedConditionalAppearance in UnlockedConditionalAppearances)
|
||||
unlockedConditionalAppearance.Write(_worldPacket);
|
||||
|
||||
foreach (CharacterInfo charInfo in Characters)
|
||||
charInfo.Write(_worldPacket);
|
||||
|
||||
@@ -72,6 +76,7 @@ namespace Game.Network.Packets
|
||||
|
||||
public List<CharacterInfo> Characters = new List<CharacterInfo>(); // all characters on the list
|
||||
public List<RaceUnlock> RaceUnlockData = new List<RaceUnlock>(); //
|
||||
public List<UnlockedConditionalAppearance> UnlockedConditionalAppearances = new List<UnlockedConditionalAppearance>();
|
||||
|
||||
public class CharacterInfo
|
||||
{
|
||||
@@ -169,7 +174,7 @@ namespace Game.Network.Packets
|
||||
if (spec != null)
|
||||
SpecID = (ushort)spec.Id;
|
||||
|
||||
LastLoginBuild = fields.Read<uint>(30);
|
||||
LastLoginVersion = fields.Read<uint>(30);
|
||||
|
||||
for (byte slot = 0; slot < InventorySlots.BagEnd; ++slot)
|
||||
{
|
||||
@@ -217,7 +222,7 @@ namespace Game.Network.Packets
|
||||
data.WriteUInt32(LastPlayedTime);
|
||||
data.WriteUInt16(SpecID);
|
||||
data.WriteUInt32(Unknown703);
|
||||
data.WriteUInt32(LastLoginBuild);
|
||||
data.WriteUInt32(LastLoginVersion);
|
||||
data.WriteUInt32(Flags4);
|
||||
data.WriteBits(Name.GetByteCount(), 6);
|
||||
data.WriteBit(FirstLogin);
|
||||
@@ -255,7 +260,7 @@ namespace Game.Network.Packets
|
||||
public uint LastPlayedTime;
|
||||
public ushort SpecID;
|
||||
public uint Unknown703;
|
||||
public uint LastLoginBuild;
|
||||
public uint LastLoginVersion;
|
||||
public PetInfo Pet = new PetInfo();
|
||||
public bool BoostInProgress; // @todo
|
||||
public uint[] ProfessionIds = new uint[2]; // @todo
|
||||
@@ -274,6 +279,7 @@ namespace Game.Network.Packets
|
||||
public uint DisplayEnchantId;
|
||||
public byte InventoryType;
|
||||
}
|
||||
|
||||
public struct PetInfo
|
||||
{
|
||||
public uint CreatureDisplayId; // PetCreatureDisplayID
|
||||
@@ -298,6 +304,18 @@ namespace Game.Network.Packets
|
||||
public bool HasAchievement;
|
||||
public bool HasHeritageArmor;
|
||||
}
|
||||
|
||||
public struct UnlockedConditionalAppearance
|
||||
{
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt32(AchievementID);
|
||||
data.WriteInt32(Unused);
|
||||
}
|
||||
|
||||
public int AchievementID;
|
||||
public int Unused;
|
||||
}
|
||||
}
|
||||
|
||||
public class CreateCharacter : ClientPacket
|
||||
|
||||
@@ -388,7 +388,7 @@ namespace Game.Network.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt32(MessageID);
|
||||
_worldPacket.WriteInt32(MessageID);
|
||||
|
||||
_worldPacket.WriteBits(StringParam.GetByteCount(), 11);
|
||||
_worldPacket.WriteString(StringParam);
|
||||
|
||||
@@ -443,7 +443,7 @@ namespace Game.Network.Packets
|
||||
public int Unknown;
|
||||
}
|
||||
|
||||
struct GarrisonMissionAreaBonus
|
||||
struct GarrisonMissionBonusAbility
|
||||
{
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
@@ -509,7 +509,7 @@ namespace Game.Network.Packets
|
||||
missionRewardItem.Write(data);
|
||||
}
|
||||
|
||||
foreach (GarrisonMissionAreaBonus areaBonus in MissionAreaBonuses)
|
||||
foreach (GarrisonMissionBonusAbility areaBonus in MissionAreaBonuses)
|
||||
areaBonus.Write(data);
|
||||
|
||||
foreach (GarrisonTalent talent in Talents)
|
||||
@@ -541,7 +541,7 @@ namespace Game.Network.Packets
|
||||
public List<GarrisonMission> Missions = new List<GarrisonMission>();
|
||||
public List<List<GarrisonMissionReward>> MissionRewards = new List<List<GarrisonMissionReward>>();
|
||||
public List<List<GarrisonMissionReward>> MissionOvermaxRewards = new List<List<GarrisonMissionReward>>();
|
||||
public List<GarrisonMissionAreaBonus> MissionAreaBonuses = new List<GarrisonMissionAreaBonus>();
|
||||
public List<GarrisonMissionBonusAbility> MissionAreaBonuses = new List<GarrisonMissionBonusAbility>();
|
||||
public List<GarrisonTalent> Talents = new List<GarrisonTalent>();
|
||||
public List<bool> CanStartMission = new List<bool>();
|
||||
public List<int> ArchivedMissions = new List<int>();
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Game.Network.Packets
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(GuildGUID);
|
||||
_worldPacket.WritePackedGuid(PlayerGuid);
|
||||
_worldPacket.WriteBit(HasGuildInfo);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
@@ -75,6 +76,7 @@ namespace Game.Network.Packets
|
||||
}
|
||||
|
||||
public ObjectGuid GuildGUID;
|
||||
public ObjectGuid PlayerGuid;
|
||||
public GuildInfo Info = new GuildInfo();
|
||||
public bool HasGuildInfo;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ using Framework.Dynamic;
|
||||
using Framework.IO;
|
||||
using Game.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace Game.Network.Packets
|
||||
{
|
||||
@@ -78,23 +79,32 @@ namespace Game.Network.Packets
|
||||
|
||||
class AvailableHotfixes : ServerPacket
|
||||
{
|
||||
public AvailableHotfixes(int hotfixCacheVersion, Dictionary<ulong, int> hotfixes) : base(ServerOpcodes.AvailableHotfixes)
|
||||
public AvailableHotfixes(int hotfixCacheVersion, uint hotfixCount, MultiMap<int, Tuple<uint, int>> hotfixes) : base(ServerOpcodes.AvailableHotfixes)
|
||||
{
|
||||
HotfixCacheVersion = hotfixCacheVersion;
|
||||
HotfixCount = hotfixCount;
|
||||
Hotfixes = hotfixes;
|
||||
}
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteInt32(HotfixCacheVersion);
|
||||
_worldPacket.WriteUInt32(HotfixCount);
|
||||
|
||||
_worldPacket.WriteUInt32(Hotfixes.Count);
|
||||
foreach (var hotfixEntry in Hotfixes)
|
||||
_worldPacket.WriteInt64(hotfixEntry.Key);
|
||||
foreach (var key in Hotfixes.Keys)
|
||||
{
|
||||
foreach (var tableRecord in Hotfixes[key])
|
||||
{
|
||||
_worldPacket.WriteUInt32(tableRecord.Item1);
|
||||
_worldPacket.WriteInt32(tableRecord.Item2);
|
||||
_worldPacket.WriteInt32(key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int HotfixCacheVersion;
|
||||
public Dictionary<ulong, int> Hotfixes = new Dictionary<ulong, int>();
|
||||
public uint HotfixCount;
|
||||
public MultiMap<int, Tuple<uint, int>> Hotfixes;
|
||||
}
|
||||
|
||||
class HotfixRequest : ClientPacket
|
||||
@@ -103,15 +113,17 @@ namespace Game.Network.Packets
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
uint hotfixCount = _worldPacket.ReadUInt32();
|
||||
//if (hotfixCount > Global.DB2Mgr.GetHotfixData().Count)
|
||||
//throw PacketArrayMaxCapacityException(hotfixCount, sDB2Manager.GetHotfixData().size());
|
||||
ClientBuild = _worldPacket.ReadUInt32();
|
||||
DataBuild = _worldPacket.ReadUInt32();
|
||||
|
||||
uint hotfixCount = _worldPacket.ReadUInt32();
|
||||
for (var i = 0; i < hotfixCount; ++i)
|
||||
Hotfixes.Add(_worldPacket.ReadUInt64());
|
||||
Hotfixes.Add(new HotfixRecord(_worldPacket));
|
||||
}
|
||||
|
||||
public List<ulong> Hotfixes = new List<ulong>();
|
||||
public uint ClientBuild;
|
||||
public uint DataBuild;
|
||||
public List<HotfixRecord> Hotfixes = new List<HotfixRecord>();
|
||||
}
|
||||
|
||||
class HotfixResponse : ServerPacket
|
||||
@@ -123,27 +135,55 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt32(Hotfixes.Count);
|
||||
foreach (HotfixData hotfix in Hotfixes)
|
||||
hotfix.Write(_worldPacket);
|
||||
|
||||
_worldPacket.WriteUInt32(HotfixContent.GetSize());
|
||||
_worldPacket.WriteBytes(HotfixContent);
|
||||
}
|
||||
|
||||
public List<HotfixData> Hotfixes = new List<HotfixData>();
|
||||
public ByteBuffer HotfixContent;
|
||||
|
||||
public class HotfixData
|
||||
{
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteInt64(ID);
|
||||
data.WriteInt32(RecordID);
|
||||
data.WriteBit(Data.HasValue);
|
||||
if (Data.HasValue)
|
||||
Record.Write(data);
|
||||
if (Size.HasValue)
|
||||
{
|
||||
data.WriteUInt32(Data.Value.GetSize());
|
||||
data.WriteBytes(Data.Value);
|
||||
data.WriteUInt32(Size);
|
||||
data.WriteBit(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
data.WriteUInt32(0);
|
||||
data.WriteBit(false);
|
||||
}
|
||||
data.FlushBits();
|
||||
}
|
||||
|
||||
public ulong ID;
|
||||
public int RecordID;
|
||||
public Optional<ByteBuffer> Data;
|
||||
public HotfixRecord Record;
|
||||
public Optional<uint> Size;
|
||||
}
|
||||
}
|
||||
|
||||
public struct HotfixRecord
|
||||
{
|
||||
public HotfixRecord(WorldPacket data)
|
||||
{
|
||||
TableHash = data.ReadUInt32();
|
||||
RecordID = data.ReadInt32();
|
||||
HotfixID = data.ReadInt32();
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(TableHash);
|
||||
data.WriteInt32(RecordID);
|
||||
data.WriteInt32(HotfixID);
|
||||
}
|
||||
|
||||
public uint TableHash;
|
||||
public int RecordID;
|
||||
public int HotfixID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,11 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteInt32(ClassID);
|
||||
_worldPacket.WriteInt32(SpecializationID);
|
||||
_worldPacket.WriteInt32(GenderID);
|
||||
_worldPacket.WriteUInt8(LifetimeMaxRank);
|
||||
_worldPacket.WriteUInt16(TodayHK);
|
||||
_worldPacket.WriteUInt16(YesterdayHK);
|
||||
_worldPacket.WriteInt32(LifetimeHK);
|
||||
_worldPacket.WriteInt32(HonorLevel);
|
||||
|
||||
for (int i = 0; i < Glyphs.Count; ++i)
|
||||
_worldPacket.WriteUInt16(Glyphs[i]);
|
||||
@@ -62,13 +67,17 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteBit(AzeriteLevel.HasValue);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
Items.ForEach(p => p.Write(_worldPacket));
|
||||
foreach (PVPBracketData bracket in Bracket)
|
||||
bracket.Write(_worldPacket);
|
||||
|
||||
if (GuildData.HasValue)
|
||||
GuildData.Value.Write(_worldPacket);
|
||||
|
||||
if (AzeriteLevel.HasValue)
|
||||
_worldPacket.WriteInt32(AzeriteLevel.Value);
|
||||
|
||||
foreach (InspectItemData item in Items)
|
||||
item.Write(_worldPacket);
|
||||
}
|
||||
|
||||
public ObjectGuid InspecteeGUID;
|
||||
@@ -79,74 +88,16 @@ namespace Game.Network.Packets
|
||||
public Class ClassID = Class.None;
|
||||
public Gender GenderID = Gender.None;
|
||||
public Optional<InspectGuildData> GuildData = new Optional<InspectGuildData>();
|
||||
public Array<PVPBracketData> Bracket = new Array<PVPBracketData>(6);
|
||||
public int SpecializationID;
|
||||
public Optional<int> AzeriteLevel;
|
||||
}
|
||||
|
||||
public class RequestHonorStats : ClientPacket
|
||||
{
|
||||
public RequestHonorStats(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
TargetGUID = _worldPacket.ReadPackedGuid();
|
||||
}
|
||||
|
||||
public ObjectGuid TargetGUID;
|
||||
}
|
||||
|
||||
public class InspectHonorStats : ServerPacket
|
||||
{
|
||||
public InspectHonorStats() : base(ServerOpcodes.InspectHonorStats) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(PlayerGUID);
|
||||
_worldPacket.WriteUInt8(LifetimeMaxRank);
|
||||
_worldPacket.WriteUInt16(YesterdayHK); // @todo: confirm order
|
||||
_worldPacket.WriteUInt16(TodayHK); // @todo: confirm order
|
||||
_worldPacket.WriteUInt32(LifetimeHK);
|
||||
}
|
||||
|
||||
public ObjectGuid PlayerGUID;
|
||||
public uint LifetimeHK;
|
||||
public ushort YesterdayHK;
|
||||
public uint HonorLevel;
|
||||
public ushort TodayHK;
|
||||
public ushort YesterdayHK;
|
||||
public byte LifetimeMaxRank;
|
||||
}
|
||||
|
||||
public class InspectPVPRequest : ClientPacket
|
||||
{
|
||||
public InspectPVPRequest(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
InspectTarget = _worldPacket.ReadPackedGuid();
|
||||
InspectRealmAddress = _worldPacket.ReadUInt32();
|
||||
}
|
||||
|
||||
public ObjectGuid InspectTarget;
|
||||
public uint InspectRealmAddress;
|
||||
}
|
||||
|
||||
public class InspectPVPResponse : ServerPacket
|
||||
{
|
||||
public InspectPVPResponse() : base(ServerOpcodes.InspectPvp) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WritePackedGuid(ClientGUID);
|
||||
|
||||
_worldPacket.WriteBits(Bracket.Count, 3);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
Bracket.ForEach(p => p.Write(_worldPacket));
|
||||
}
|
||||
|
||||
public List<PVPBracketData> Bracket = new List<PVPBracketData>();
|
||||
public ObjectGuid ClientGUID;
|
||||
}
|
||||
|
||||
public class QueryInspectAchievements : ClientPacket
|
||||
{
|
||||
public QueryInspectAchievements(WorldPacket packet) : base(packet) { }
|
||||
@@ -272,7 +223,6 @@ namespace Game.Network.Packets
|
||||
data.WriteInt32(Unk801_1);
|
||||
data.WriteBit(Unk801_2);
|
||||
data.FlushBits();
|
||||
|
||||
}
|
||||
|
||||
public int Rating;
|
||||
|
||||
@@ -774,8 +774,6 @@ namespace Game.Network.Packets
|
||||
public ItemInstance(Item item)
|
||||
{
|
||||
ItemID = item.GetEntry();
|
||||
RandomPropertiesSeed = item.GetItemSuffixFactor();
|
||||
RandomPropertiesID = (uint)item.GetItemRandomPropertyId();
|
||||
var bonusListIds = item.GetDynamicValues(ItemDynamicFields.BonusListIds);
|
||||
if (!bonusListIds.Empty())
|
||||
{
|
||||
@@ -800,9 +798,6 @@ namespace Game.Network.Packets
|
||||
public ItemInstance(Loots.LootItem lootItem)
|
||||
{
|
||||
ItemID = lootItem.itemid;
|
||||
RandomPropertiesSeed = lootItem.randomSuffix;
|
||||
if (lootItem.randomPropertyId.Type != ItemRandomEnchantmentType.BonusList)
|
||||
RandomPropertiesID = lootItem.randomPropertyId.Id;
|
||||
|
||||
if (!lootItem.BonusListIDs.Empty())
|
||||
{
|
||||
@@ -821,9 +816,6 @@ namespace Game.Network.Packets
|
||||
public ItemInstance(VoidStorageItem voidItem)
|
||||
{
|
||||
ItemID = voidItem.ItemEntry;
|
||||
RandomPropertiesSeed = voidItem.ItemSuffixFactor;
|
||||
if (voidItem.ItemRandomPropertyId.Type != ItemRandomEnchantmentType.BonusList)
|
||||
RandomPropertiesID = voidItem.ItemRandomPropertyId.Id;
|
||||
|
||||
if (voidItem.ItemUpgradeId != 0 || voidItem.FixedScalingLevel != 0 || voidItem.ArtifactKnowledgeLevel != 0)
|
||||
{
|
||||
@@ -861,8 +853,6 @@ namespace Game.Network.Packets
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteUInt32(ItemID);
|
||||
data.WriteUInt32(RandomPropertiesSeed);
|
||||
data.WriteUInt32(RandomPropertiesID);
|
||||
|
||||
data.WriteBit(ItemBonus.HasValue);
|
||||
data.WriteBit(Modifications.HasValue);
|
||||
@@ -878,8 +868,6 @@ namespace Game.Network.Packets
|
||||
public void Read(WorldPacket data)
|
||||
{
|
||||
ItemID = data.ReadUInt32();
|
||||
RandomPropertiesSeed = data.ReadUInt32();
|
||||
RandomPropertiesID = data.ReadUInt32();
|
||||
|
||||
ItemBonus.HasValue = data.HasBit();
|
||||
Modifications.HasValue = data.HasBit();
|
||||
@@ -894,8 +882,7 @@ namespace Game.Network.Packets
|
||||
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return ItemID.GetHashCode() ^ RandomPropertiesSeed.GetHashCode() ^
|
||||
RandomPropertiesID.GetHashCode() ^ ItemBonus.GetHashCode() ^ Modifications.GetHashCode();
|
||||
return ItemID.GetHashCode() ^ ItemBonus.GetHashCode() ^ Modifications.GetHashCode();
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
@@ -908,7 +895,7 @@ namespace Game.Network.Packets
|
||||
|
||||
public static bool operator ==(ItemInstance left, ItemInstance right)
|
||||
{
|
||||
if (left.ItemID != right.ItemID || left.RandomPropertiesID != right.RandomPropertiesID || left.RandomPropertiesSeed != right.RandomPropertiesSeed)
|
||||
if (left.ItemID != right.ItemID)
|
||||
return false;
|
||||
|
||||
if (left.ItemBonus.HasValue != right.ItemBonus.HasValue || left.Modifications.HasValue != right.Modifications.HasValue)
|
||||
@@ -929,8 +916,6 @@ namespace Game.Network.Packets
|
||||
}
|
||||
|
||||
public uint ItemID;
|
||||
public uint RandomPropertiesSeed;
|
||||
public uint RandomPropertiesID;
|
||||
public Optional<ItemBonusInstanceData> ItemBonus;
|
||||
public Optional<CompactArray> Modifications;
|
||||
}
|
||||
|
||||
@@ -235,13 +235,16 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt8(PartyIndex);
|
||||
_worldPacket.WriteUInt8(RoleCheckStatus);
|
||||
_worldPacket.WriteUInt32(JoinSlots.Count);
|
||||
_worldPacket.WriteUInt64(BgQueueID);
|
||||
_worldPacket.WriteUInt32(BgQueueIDs.Count);
|
||||
_worldPacket.WriteUInt32(GroupFinderActivityID);
|
||||
_worldPacket.WriteUInt32(Members.Count);
|
||||
|
||||
foreach (var slot in JoinSlots)
|
||||
_worldPacket.WriteUInt32(slot);
|
||||
|
||||
foreach (ulong bgQueueID in BgQueueIDs)
|
||||
_worldPacket.WriteUInt64(bgQueueID);
|
||||
|
||||
_worldPacket.WriteBit(IsBeginning);
|
||||
_worldPacket.WriteBit(IsRequeue);
|
||||
_worldPacket.FlushBits();
|
||||
@@ -253,7 +256,7 @@ namespace Game.Network.Packets
|
||||
public byte PartyIndex;
|
||||
public byte RoleCheckStatus;
|
||||
public List<uint> JoinSlots = new List<uint>();
|
||||
public ulong BgQueueID;
|
||||
public List<ulong> BgQueueIDs = new List<ulong>();
|
||||
public int GroupFinderActivityID = 0;
|
||||
public List<LFGRoleCheckUpdateMember> Members = new List<LFGRoleCheckUpdateMember>();
|
||||
public bool IsBeginning;
|
||||
@@ -271,15 +274,24 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt8(Result);
|
||||
_worldPacket.WriteUInt8(ResultDetail);
|
||||
_worldPacket.WriteUInt32(BlackList.Count);
|
||||
_worldPacket.WriteUInt32(BlackListNames.Count);
|
||||
|
||||
foreach (LFGJoinBlackList blackList in BlackList)
|
||||
blackList.Write(_worldPacket);
|
||||
|
||||
foreach (string str in BlackListNames)
|
||||
_worldPacket.WriteBits(str.GetByteCount() + 1, 24);
|
||||
|
||||
foreach (string str in BlackListNames)
|
||||
if (!str.IsEmpty())
|
||||
_worldPacket.WriteCString(str);
|
||||
}
|
||||
|
||||
public RideTicket Ticket = new RideTicket();
|
||||
public byte Result;
|
||||
public byte ResultDetail;
|
||||
public List<LFGJoinBlackList> BlackList = new List<LFGJoinBlackList>();
|
||||
public List<string> BlackListNames = new List<string>();
|
||||
}
|
||||
|
||||
class LFGQueueStatus : ServerPacket
|
||||
|
||||
@@ -143,12 +143,14 @@ namespace Game.Network.Packets
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
_worldPacket.WriteUInt32(Money);
|
||||
_worldPacket.WriteUInt64(Money);
|
||||
_worldPacket.WriteUInt64(MoneyMod);
|
||||
_worldPacket.WriteBit(SoleLooter);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public uint Money;
|
||||
public ulong Money;
|
||||
public ulong MoneyMod;
|
||||
public bool SoleLooter;
|
||||
}
|
||||
|
||||
|
||||
@@ -283,9 +283,9 @@ namespace Game.Network.Packets
|
||||
}
|
||||
}
|
||||
|
||||
public class NotifyRecievedMail : ServerPacket
|
||||
public class NotifyReceivedMail : ServerPacket
|
||||
{
|
||||
public NotifyRecievedMail() : base(ServerOpcodes.NotifyReceivedMail) { }
|
||||
public NotifyReceivedMail() : base(ServerOpcodes.NotifyReceivedMail) { }
|
||||
|
||||
public override void Write()
|
||||
{
|
||||
|
||||
@@ -118,6 +118,9 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteBit(TrackedQuantity.HasValue);
|
||||
_worldPacket.WriteBit(MaxQuantity.HasValue);
|
||||
_worldPacket.WriteBit(SuppressChatLog);
|
||||
_worldPacket.WriteBit(QuantityChange.HasValue);
|
||||
_worldPacket.WriteBit(QuantityGainSource.HasValue);
|
||||
_worldPacket.WriteBit(QuantityLostSource.HasValue);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
if (WeeklyQuantity.HasValue)
|
||||
@@ -128,6 +131,15 @@ namespace Game.Network.Packets
|
||||
|
||||
if (MaxQuantity.HasValue)
|
||||
_worldPacket.WriteInt32(MaxQuantity.Value);
|
||||
|
||||
if (QuantityChange.HasValue)
|
||||
_worldPacket.WriteInt32(QuantityChange.Value);
|
||||
|
||||
if (QuantityGainSource.HasValue)
|
||||
_worldPacket.WriteInt32(QuantityGainSource.Value);
|
||||
|
||||
if (QuantityLostSource.HasValue)
|
||||
_worldPacket.WriteInt32(QuantityLostSource.Value);
|
||||
}
|
||||
|
||||
public uint Type;
|
||||
@@ -136,6 +148,9 @@ namespace Game.Network.Packets
|
||||
public Optional<int> WeeklyQuantity;
|
||||
public Optional<int> TrackedQuantity;
|
||||
public Optional<int> MaxQuantity;
|
||||
public Optional<int> QuantityChange;
|
||||
public Optional<int> QuantityGainSource;
|
||||
public Optional<int> QuantityLostSource;
|
||||
public bool SuppressChatLog;
|
||||
}
|
||||
|
||||
|
||||
@@ -1017,7 +1017,7 @@ namespace Game.Network.Packets
|
||||
data.WriteBit(VehicleRecID.HasValue);
|
||||
data.WriteBit(CollisionHeight.HasValue);
|
||||
data.WriteBit(MovementForce_.HasValue);
|
||||
data.WriteBit(Unknown.HasValue);
|
||||
data.WriteBit(MovementForceGUID.HasValue);
|
||||
data.FlushBits();
|
||||
|
||||
if (CollisionHeight.HasValue)
|
||||
@@ -1041,8 +1041,8 @@ namespace Game.Network.Packets
|
||||
if (VehicleRecID.HasValue)
|
||||
data.WriteInt32(VehicleRecID.Value);
|
||||
|
||||
if (Unknown.HasValue)
|
||||
data.WritePackedGuid(Unknown.Value);
|
||||
if (MovementForceGUID.HasValue)
|
||||
data.WritePackedGuid(MovementForceGUID.Value);
|
||||
|
||||
if (MovementForce_.HasValue)
|
||||
MovementForce_.Value.Write(data);
|
||||
@@ -1055,7 +1055,7 @@ namespace Game.Network.Packets
|
||||
public Optional<int> VehicleRecID;
|
||||
public Optional<CollisionHeightInfo> CollisionHeight;
|
||||
public Optional<MovementForce> MovementForce_;
|
||||
public Optional<ObjectGuid> Unknown;
|
||||
public Optional<ObjectGuid> MovementForceGUID;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -333,6 +333,7 @@ namespace Game.Network.Packets
|
||||
data.WriteInt32(PlayerConditionFailed);
|
||||
Item.Write(data);
|
||||
data.WriteBit(DoNotFilterOnVendor);
|
||||
data.WriteBit(Refundable);
|
||||
data.FlushBits();
|
||||
}
|
||||
|
||||
@@ -346,6 +347,7 @@ namespace Game.Network.Packets
|
||||
public int ExtendedCostID;
|
||||
public int PlayerConditionFailed;
|
||||
public bool DoNotFilterOnVendor;
|
||||
public bool Refundable;
|
||||
}
|
||||
|
||||
public class TrainerListSpell
|
||||
|
||||
@@ -201,6 +201,13 @@ namespace Game.Network.Packets
|
||||
public string Name;
|
||||
}
|
||||
|
||||
class GroupUninvite : ServerPacket
|
||||
{
|
||||
public GroupUninvite() : base(ServerOpcodes.GroupUninvite) { }
|
||||
|
||||
public override void Write() { }
|
||||
}
|
||||
|
||||
class RequestPartyMemberStats : ClientPacket
|
||||
{
|
||||
public RequestPartyMemberStats(WorldPacket packet) : base(packet) { }
|
||||
@@ -422,13 +429,6 @@ namespace Game.Network.Packets
|
||||
public sbyte PartyIndex;
|
||||
}
|
||||
|
||||
class GroupUninvite : ServerPacket
|
||||
{
|
||||
public GroupUninvite() : base(ServerOpcodes.GroupUninvite) { }
|
||||
|
||||
public override void Write() { }
|
||||
}
|
||||
|
||||
class GroupDestroyed : ServerPacket
|
||||
{
|
||||
public GroupDestroyed() : base(ServerOpcodes.GroupDestroyed) { }
|
||||
@@ -1042,7 +1042,8 @@ namespace Game.Network.Packets
|
||||
data.WriteUInt8(RolesAssigned);
|
||||
data.WriteUInt8(Class);
|
||||
data.WriteString(Name);
|
||||
data.WriteString(VoiceStateID);
|
||||
if (!VoiceStateID.IsEmpty())
|
||||
data.WriteString(VoiceStateID);
|
||||
}
|
||||
|
||||
public ObjectGuid GUID;
|
||||
|
||||
@@ -131,6 +131,9 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt32(Stats.RequiredExpansion);
|
||||
_worldPacket.WriteInt32(Stats.VignetteID);
|
||||
_worldPacket.WriteInt32(Stats.Class);
|
||||
_worldPacket.WriteFloat(Stats.FadeRegionRadius);
|
||||
_worldPacket.WriteInt32(Stats.WidgetSetID);
|
||||
_worldPacket.WriteInt32(Stats.WidgetSetUnitConditionID);
|
||||
|
||||
if (!Stats.Title.IsEmpty())
|
||||
_worldPacket.WriteCString(Stats.Title);
|
||||
@@ -738,6 +741,9 @@ namespace Game.Network.Packets
|
||||
public uint RequiredExpansion;
|
||||
public uint VignetteID;
|
||||
public int Class;
|
||||
public float FadeRegionRadius;
|
||||
public int WidgetSetID;
|
||||
public int WidgetSetUnitConditionID;
|
||||
public uint[] Flags = new uint[2];
|
||||
public uint[] ProxyCreatureID = new uint[SharedConst.MaxCreatureKillCredit];
|
||||
public StringArray Name = new StringArray(SharedConst.MaxCreatureNames);
|
||||
|
||||
@@ -201,6 +201,7 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteInt64(Info.AllowableRaces);
|
||||
_worldPacket.WriteInt32(Info.TreasurePickerID);
|
||||
_worldPacket.WriteInt32(Info.Expansion);
|
||||
_worldPacket.WriteInt32(Info.ManagedWorldStateID);
|
||||
|
||||
_worldPacket.WriteBits(Info.LogTitle.GetByteCount(), 9);
|
||||
_worldPacket.WriteBits(Info.LogDescription.GetByteCount(), 12);
|
||||
@@ -837,6 +838,7 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt32(Responses.Count);
|
||||
_worldPacket.WritePackedGuid(SenderGUID);
|
||||
_worldPacket.WriteInt32(UiTextureKitID);
|
||||
_worldPacket.WriteUInt32(SoundKitID);
|
||||
_worldPacket.WriteBits(Question.GetByteCount(), 8);
|
||||
_worldPacket.WriteBit(CloseChoiceFrame);
|
||||
_worldPacket.WriteBit(HideWarboardHeader);
|
||||
@@ -852,6 +854,7 @@ namespace Game.Network.Packets
|
||||
public ObjectGuid SenderGUID;
|
||||
public int ChoiceID;
|
||||
public int UiTextureKitID;
|
||||
public uint SoundKitID;
|
||||
public string Question;
|
||||
public List<PlayerChoiceResponse> Responses = new List<PlayerChoiceResponse>();
|
||||
public bool CloseChoiceFrame;
|
||||
@@ -965,6 +968,7 @@ namespace Game.Network.Packets
|
||||
public uint TimeAllowed;
|
||||
public int TreasurePickerID;
|
||||
public int Expansion;
|
||||
public int ManagedWorldStateID;
|
||||
public List<QuestObjective> Objectives = new List<QuestObjective>();
|
||||
public uint[] RewardItems = new uint[SharedConst.QuestRewardItemCount];
|
||||
public uint[] RewardAmount = new uint[SharedConst.QuestRewardItemCount];
|
||||
@@ -1254,13 +1258,18 @@ namespace Game.Network.Packets
|
||||
data.WriteInt32(ChoiceArtFileID);
|
||||
data.WriteInt32(Flags);
|
||||
data.WriteUInt32(WidgetSetID);
|
||||
data.WriteUInt32(UiTextureAtlasElementID);
|
||||
data.WriteUInt32(SoundKitID);
|
||||
data.WriteUInt8(GroupID);
|
||||
|
||||
data.WriteBits(Answer.GetByteCount(), 9);
|
||||
data.WriteBits(Header.GetByteCount(), 9);
|
||||
data.WriteBits(SubHeader.GetByteCount(), 7);
|
||||
data.WriteBits(ButtonTooltip.GetByteCount(), 9);
|
||||
data.WriteBits(Description.GetByteCount(), 11);
|
||||
data.WriteBits(Confirmation.GetByteCount(), 7);
|
||||
|
||||
data.WriteBit(RewardQuestID.HasValue);
|
||||
data.WriteBit(Reward.HasValue);
|
||||
data.FlushBits();
|
||||
|
||||
@@ -1269,19 +1278,29 @@ namespace Game.Network.Packets
|
||||
|
||||
data.WriteString(Answer);
|
||||
data.WriteString(Header);
|
||||
data.WriteString(SubHeader);
|
||||
data.WriteString(ButtonTooltip);
|
||||
data.WriteString(Description);
|
||||
data.WriteString(Confirmation);
|
||||
|
||||
if (RewardQuestID.HasValue)
|
||||
data.WriteUInt32(RewardQuestID.Value);
|
||||
}
|
||||
|
||||
public int ResponseID;
|
||||
public int ChoiceArtFileID;
|
||||
public int Flags;
|
||||
public uint WidgetSetID;
|
||||
public uint UiTextureAtlasElementID;
|
||||
public uint SoundKitID;
|
||||
public byte GroupID;
|
||||
public string Answer;
|
||||
public string Header;
|
||||
public string SubHeader;
|
||||
public string ButtonTooltip;
|
||||
public string Description;
|
||||
public string Confirmation;
|
||||
public Optional<PlayerChoiceResponseReward> Reward;
|
||||
public Optional<uint> RewardQuestID;
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ namespace Game.Network.Packets
|
||||
{
|
||||
public class InitializeFactions : ServerPacket
|
||||
{
|
||||
const ushort FactionCount = 300;
|
||||
const ushort FactionCount = 350;
|
||||
|
||||
public InitializeFactions() : base(ServerOpcodes.InitializeFactions, ConnectionType.Instance) { }
|
||||
|
||||
|
||||
@@ -691,8 +691,8 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WritePackedGuid(Target);
|
||||
_worldPacket.WriteUInt32(SpellVisualID);
|
||||
_worldPacket.WriteFloat(TravelSpeed);
|
||||
_worldPacket.WriteFloat(UnkZero);
|
||||
_worldPacket.WriteFloat(Unk801);
|
||||
_worldPacket.WriteFloat(LaunchDelay);
|
||||
_worldPacket.WriteFloat(MinDuration);
|
||||
_worldPacket.WriteBit(SpeedAsTime);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
@@ -702,8 +702,8 @@ namespace Game.Network.Packets
|
||||
public uint SpellVisualID;
|
||||
public bool SpeedAsTime;
|
||||
public float TravelSpeed;
|
||||
public float UnkZero; // Always zero
|
||||
public float Unk801;
|
||||
public float LaunchDelay; // Always zero
|
||||
public float MinDuration;
|
||||
public Vector3 SourceRotation; // Vector of rotations, Orientation is z
|
||||
public Vector3 TargetLocation; // Exclusive with Target
|
||||
}
|
||||
@@ -716,29 +716,31 @@ namespace Game.Network.Packets
|
||||
{
|
||||
_worldPacket.WritePackedGuid(Source);
|
||||
_worldPacket.WritePackedGuid(Target);
|
||||
_worldPacket.WritePackedGuid(Unk801_1);
|
||||
_worldPacket.WritePackedGuid(Transport);
|
||||
_worldPacket.WriteVector3(TargetPosition);
|
||||
_worldPacket.WriteUInt32(SpellVisualID);
|
||||
_worldPacket.WriteFloat(TravelSpeed);
|
||||
_worldPacket.WriteUInt16(HitReason);
|
||||
_worldPacket.WriteUInt16(MissReason);
|
||||
_worldPacket.WriteUInt16(ReflectStatus);
|
||||
_worldPacket.WriteFloat(Orientation);
|
||||
_worldPacket.WriteFloat(Unk801_2);
|
||||
_worldPacket.WriteFloat(LaunchDelay);
|
||||
_worldPacket.WriteFloat(MinDuration);
|
||||
_worldPacket.WriteBit(SpeedAsTime);
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public ObjectGuid Source;
|
||||
public ObjectGuid Target; // Exclusive with TargetPosition
|
||||
public ObjectGuid Unk801_1;
|
||||
public ushort MissReason;
|
||||
public uint SpellVisualID;
|
||||
public bool SpeedAsTime;
|
||||
public ushort ReflectStatus;
|
||||
public float TravelSpeed;
|
||||
public ObjectGuid Transport; // Used when Target = Empty && (SpellVisual::Flags & 0x400) == 0
|
||||
public Vector3 TargetPosition; // Exclusive with Target
|
||||
public float Orientation;
|
||||
public float Unk801_2;
|
||||
public uint SpellVisualID;
|
||||
public float TravelSpeed;
|
||||
public ushort HitReason;
|
||||
public ushort MissReason;
|
||||
public ushort ReflectStatus;
|
||||
public float LaunchDelay;
|
||||
public float MinDuration;
|
||||
public bool SpeedAsTime;
|
||||
}
|
||||
|
||||
class PlaySpellVisualKit : ServerPacket
|
||||
@@ -1268,6 +1270,7 @@ namespace Game.Network.Packets
|
||||
{
|
||||
data.WriteInt16(PlayerLevelDelta);
|
||||
data.WriteUInt16(PlayerItemLevel);
|
||||
data.WriteUInt16(TargetItemLevel);
|
||||
data.WriteUInt16(ScalingHealthItemLevelCurveID);
|
||||
data.WriteUInt8(TargetLevel);
|
||||
data.WriteUInt8(Expansion);
|
||||
@@ -1282,6 +1285,7 @@ namespace Game.Network.Packets
|
||||
public ContentTuningType TuningType;
|
||||
public short PlayerLevelDelta;
|
||||
public ushort PlayerItemLevel;
|
||||
public ushort TargetItemLevel;
|
||||
public ushort ScalingHealthItemLevelCurveID;
|
||||
public byte TargetLevel;
|
||||
public byte Expansion;
|
||||
@@ -1401,7 +1405,7 @@ namespace Game.Network.Packets
|
||||
{
|
||||
public void Read(WorldPacket data)
|
||||
{
|
||||
Flags = (SpellCastTargetFlags)data.ReadBits<uint>(25);
|
||||
Flags = (SpellCastTargetFlags)data.ReadBits<uint>(26);
|
||||
SrcLocation.HasValue = data.HasBit();
|
||||
DstLocation.HasValue = data.HasBit();
|
||||
Orientation.HasValue = data.HasBit();
|
||||
@@ -1428,7 +1432,7 @@ namespace Game.Network.Packets
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteBits((uint)Flags, 25);
|
||||
data.WriteBits((uint)Flags, 26);
|
||||
data.WriteBit(SrcLocation.HasValue);
|
||||
data.WriteBit(DstLocation.HasValue);
|
||||
data.WriteBit(Orientation.HasValue);
|
||||
@@ -1525,19 +1529,40 @@ namespace Game.Network.Packets
|
||||
public uint[] Misc = new uint[2];
|
||||
}
|
||||
|
||||
public struct SpellMissStatus
|
||||
public struct SpellHitStatus
|
||||
{
|
||||
public SpellHitStatus(SpellMissInfo reason)
|
||||
{
|
||||
Reason = reason;
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteBits(Reason, 4);
|
||||
if (Reason == (byte)SpellMissInfo.Reflect)
|
||||
data.WriteUInt8(Reason);
|
||||
}
|
||||
|
||||
public SpellMissInfo Reason;
|
||||
}
|
||||
|
||||
public struct SpellMissStatus
|
||||
{
|
||||
public SpellMissStatus(SpellMissInfo reason, SpellMissInfo reflectStatus)
|
||||
{
|
||||
Reason = reason;
|
||||
ReflectStatus = reflectStatus;
|
||||
}
|
||||
|
||||
public void Write(WorldPacket data)
|
||||
{
|
||||
data.WriteBits((byte)Reason, 4);
|
||||
if (Reason == SpellMissInfo.Reflect)
|
||||
data.WriteBits(ReflectStatus, 4);
|
||||
|
||||
data.FlushBits();
|
||||
}
|
||||
|
||||
public byte Reason;
|
||||
public byte ReflectStatus;
|
||||
public SpellMissInfo Reason;
|
||||
public SpellMissInfo ReflectStatus;
|
||||
}
|
||||
|
||||
public struct SpellPowerData
|
||||
@@ -1643,22 +1668,26 @@ namespace Game.Network.Packets
|
||||
|
||||
data.WriteBits(HitTargets.Count, 16);
|
||||
data.WriteBits(MissTargets.Count, 16);
|
||||
data.WriteBits(HitStatus.Count, 16);
|
||||
data.WriteBits(MissStatus.Count, 16);
|
||||
data.WriteBits(RemainingPower.Count, 9);
|
||||
data.WriteBit(RemainingRunes.HasValue);
|
||||
data.WriteBits(TargetPoints.Count, 16);
|
||||
data.FlushBits();
|
||||
|
||||
foreach (SpellMissStatus status in MissStatus)
|
||||
status.Write(data);
|
||||
foreach (SpellMissStatus missStatus in MissStatus)
|
||||
missStatus.Write(data);
|
||||
|
||||
Target.Write(data);
|
||||
|
||||
foreach (ObjectGuid target in HitTargets)
|
||||
data.WritePackedGuid(target);
|
||||
foreach (ObjectGuid hitTarget in HitTargets)
|
||||
data.WritePackedGuid(hitTarget);
|
||||
|
||||
foreach (ObjectGuid target in MissTargets)
|
||||
data.WritePackedGuid(target);
|
||||
foreach (ObjectGuid missTarget in MissTargets)
|
||||
data.WritePackedGuid(missTarget);
|
||||
|
||||
foreach (SpellHitStatus hitStatus in HitStatus)
|
||||
hitStatus.Write(data);
|
||||
|
||||
foreach (SpellPowerData power in RemainingPower)
|
||||
power.Write(data);
|
||||
@@ -1681,6 +1710,7 @@ namespace Game.Network.Packets
|
||||
public uint CastTime;
|
||||
public List<ObjectGuid> HitTargets = new List<ObjectGuid>();
|
||||
public List<ObjectGuid> MissTargets = new List<ObjectGuid>();
|
||||
public List<SpellHitStatus> HitStatus = new List<SpellHitStatus>();
|
||||
public List<SpellMissStatus> MissStatus = new List<SpellMissStatus>();
|
||||
public SpellTargetData Target = new SpellTargetData();
|
||||
public List<SpellPowerData> RemainingPower = new List<SpellPowerData>();
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace Game.Network.Packets
|
||||
|
||||
_worldPacket.WriteUInt32(BpayStoreProductDeliveryDelay);
|
||||
_worldPacket.WriteUInt32(ClubsPresenceUpdateTimer);
|
||||
_worldPacket.WriteUInt32(HiddenUIClubsPresenceUpdateTimer);
|
||||
|
||||
_worldPacket.WriteBit(VoiceEnabled);
|
||||
_worldPacket.WriteBit(EuropaTicketSystemStatus.HasValue);
|
||||
@@ -77,6 +78,7 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteBit(ClubsEnabled);
|
||||
_worldPacket.WriteBit(ClubsBattleNetClubTypeAllowed);
|
||||
_worldPacket.WriteBit(ClubsCharacterClubTypeAllowed);
|
||||
_worldPacket.WriteBit(ClubsPresenceUpdateEnabled);
|
||||
_worldPacket.WriteBit(VoiceChatDisabledByParentalControl);
|
||||
_worldPacket.WriteBit(VoiceChatMutedByParentalControl);
|
||||
_worldPacket.FlushBits();
|
||||
@@ -159,6 +161,7 @@ namespace Game.Network.Packets
|
||||
public long TokenBalanceAmount;
|
||||
public uint BpayStoreProductDeliveryDelay;
|
||||
public uint ClubsPresenceUpdateTimer;
|
||||
public uint HiddenUIClubsPresenceUpdateTimer; // Timer for updating club presence when communities ui frame is hidden
|
||||
public bool ItemRestorationButtonEnabled;
|
||||
public bool CharUndeleteEnabled; // Implemented
|
||||
public bool BpayStoreDisabledByParentalControls;
|
||||
@@ -176,6 +179,7 @@ namespace Game.Network.Packets
|
||||
public bool ClubsEnabled;
|
||||
public bool ClubsBattleNetClubTypeAllowed;
|
||||
public bool ClubsCharacterClubTypeAllowed;
|
||||
public bool ClubsPresenceUpdateEnabled;
|
||||
public bool VoiceChatDisabledByParentalControl;
|
||||
public bool VoiceChatMutedByParentalControl;
|
||||
|
||||
|
||||
@@ -87,12 +87,12 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteUInt64(CurrentMarketPrice);
|
||||
_worldPacket.WriteUInt32(UnkInt);
|
||||
_worldPacket.WriteUInt32(Result);
|
||||
_worldPacket.WriteUInt32(UnkInt2);
|
||||
_worldPacket.WriteUInt32(AuctionDuration);
|
||||
}
|
||||
|
||||
public ulong CurrentMarketPrice;
|
||||
public uint UnkInt; // send CMSG_REQUEST_WOW_TOKEN_MARKET_PRICE
|
||||
public TokenResult Result;
|
||||
public uint UnkInt2 = 0;
|
||||
public uint AuctionDuration; // preset auction duration enum
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace Game.Network.Packets
|
||||
{
|
||||
@@ -54,20 +55,36 @@ namespace Game.Network.Packets
|
||||
_worldPacket.WriteBit(IsFullUpdate);
|
||||
_worldPacket.FlushBits();
|
||||
|
||||
// both lists have to have the same size
|
||||
// all lists have to have the same size
|
||||
_worldPacket.WriteUInt32(Toys.Count);
|
||||
_worldPacket.WriteUInt32(Toys.Count);
|
||||
_worldPacket.WriteUInt32(Toys.Count);
|
||||
|
||||
foreach (var item in Toys)
|
||||
_worldPacket.WriteUInt32(item.Key);
|
||||
foreach (var pair in Toys)
|
||||
_worldPacket.WriteUInt32(pair.Key);
|
||||
|
||||
foreach (var favourite in Toys)
|
||||
_worldPacket.WriteBit(favourite.Value);
|
||||
foreach (var pair in Toys)
|
||||
_worldPacket.WriteBit(pair.Value.HasAnyFlag(ToyFlags.Favorite));
|
||||
|
||||
foreach (var pair in Toys)
|
||||
_worldPacket.WriteBit(pair.Value.HasAnyFlag(ToyFlags.HasFanfare));
|
||||
|
||||
_worldPacket.FlushBits();
|
||||
}
|
||||
|
||||
public bool IsFullUpdate = false;
|
||||
public Dictionary<uint, bool> Toys = new Dictionary<uint, bool>();
|
||||
public Dictionary<uint, ToyFlags> Toys = new Dictionary<uint, ToyFlags>();
|
||||
}
|
||||
|
||||
class ToyClearFanfare : ClientPacket
|
||||
{
|
||||
public ToyClearFanfare(WorldPacket packet) : base(packet) { }
|
||||
|
||||
public override void Read()
|
||||
{
|
||||
ItemID = _worldPacket.ReadUInt32();
|
||||
}
|
||||
|
||||
public uint ItemID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,16 +124,17 @@ namespace Game
|
||||
AllowableRaces = (long)fields.Read<ulong>(108);
|
||||
TreasurePickerID = fields.Read<int>(109);
|
||||
Expansion = fields.Read<int>(110);
|
||||
ManagedWorldStateID = fields.Read<int>(111);
|
||||
|
||||
LogTitle = fields.Read<string>(111);
|
||||
LogDescription = fields.Read<string>(112);
|
||||
QuestDescription = fields.Read<string>(113);
|
||||
AreaDescription = fields.Read<string>(114);
|
||||
PortraitGiverText = fields.Read<string>(115);
|
||||
PortraitGiverName = fields.Read<string>(116);
|
||||
PortraitTurnInText = fields.Read<string>(117);
|
||||
PortraitTurnInName = fields.Read<string>(118);
|
||||
QuestCompletionLog = fields.Read<string>(119);
|
||||
LogTitle = fields.Read<string>(112);
|
||||
LogDescription = fields.Read<string>(113);
|
||||
QuestDescription = fields.Read<string>(114);
|
||||
AreaDescription = fields.Read<string>(115);
|
||||
PortraitGiverText = fields.Read<string>(116);
|
||||
PortraitGiverName = fields.Read<string>(117);
|
||||
PortraitTurnInText = fields.Read<string>(118);
|
||||
PortraitTurnInName = fields.Read<string>(119);
|
||||
QuestCompletionLog = fields.Read<string>(120);
|
||||
}
|
||||
|
||||
public void LoadQuestDetails(SQLFields fields)
|
||||
@@ -487,6 +488,7 @@ namespace Game
|
||||
public long AllowableRaces { get; set; }
|
||||
public int TreasurePickerID;
|
||||
public int Expansion;
|
||||
public int ManagedWorldStateID;
|
||||
public List<QuestObjective> Objectives = new List<QuestObjective>();
|
||||
public string LogTitle = "";
|
||||
public string LogDescription = "";
|
||||
|
||||
@@ -3724,6 +3724,7 @@ namespace Game.Spells
|
||||
if (targetInfo.missCondition == SpellMissInfo.None) // hits
|
||||
{
|
||||
data.HitTargets.Add(targetInfo.targetGUID);
|
||||
data.HitStatus.Add(new SpellHitStatus(SpellMissInfo.None));
|
||||
|
||||
m_channelTargetEffectMask |= targetInfo.effectMask;
|
||||
}
|
||||
@@ -3731,12 +3732,7 @@ namespace Game.Spells
|
||||
{
|
||||
data.MissTargets.Add(targetInfo.targetGUID);
|
||||
|
||||
SpellMissStatus missStatus = new SpellMissStatus();
|
||||
missStatus.Reason = (byte)targetInfo.missCondition;
|
||||
if (targetInfo.missCondition == SpellMissInfo.Reflect)
|
||||
missStatus.ReflectStatus = (byte)targetInfo.reflectResult;
|
||||
|
||||
data.MissStatus.Add(missStatus);
|
||||
data.MissStatus.Add(new SpellMissStatus(targetInfo.missCondition, targetInfo.reflectResult));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user