Core/PacketIO: Updated most packet structures to 9.0.1
Port From (https://github.com/TrinityCore/TrinityCore/commit/cab4c87d2d7f6d734ef067d6bf50f4b1d338a7bc)
This commit is contained in:
@@ -578,8 +578,8 @@ namespace Game
|
||||
reportedPlayer.ReportedAfkBy(GetPlayer());
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.RequestRatedBattlefieldInfo)]
|
||||
void HandleRequestRatedBattlefieldInfo(RequestRatedBattlefieldInfo packet)
|
||||
[WorldPacketHandler(ClientOpcodes.RequestRatedPvpInfo)]
|
||||
void HandleRequestRatedPvpInfo(RequestRatedPvpInfo packet)
|
||||
{
|
||||
RatedPvpInfo ratedPvpInfo = new RatedPvpInfo();
|
||||
SendPacket(ratedPvpInfo);
|
||||
|
||||
@@ -108,12 +108,12 @@ namespace Game
|
||||
Global.CalendarMgr.SendCalendarCommandResult(GetPlayer().GetGUID(), CalendarError.EventInvalid);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarCommunityFilter)]
|
||||
void HandleCalendarCommunityFilter(CalendarCommunityFilter calendarCommunityFilter)
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarCommunityInviteRequest)]
|
||||
void HandleCalendarCommunityInvite(CalendarCommunityInviteRequest calendarCommunityInvite)
|
||||
{
|
||||
Guild guild = Global.GuildMgr.GetGuildById(GetPlayer().GetGuildId());
|
||||
if (guild)
|
||||
guild.MassInviteToEvent(this, calendarCommunityFilter.MinLevel, calendarCommunityFilter.MaxLevel, calendarCommunityFilter.MaxRankOrder);
|
||||
guild.MassInviteToEvent(this, calendarCommunityInvite.MinLevel, calendarCommunityInvite.MaxLevel, calendarCommunityInvite.MaxRankOrder);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarAddEvent)]
|
||||
@@ -234,8 +234,8 @@ namespace Game
|
||||
Global.CalendarMgr.SendCalendarCommandResult(guid, CalendarError.EventInvalid);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarEventInvite)]
|
||||
void HandleCalendarEventInvite(CalendarEventInvite calendarEventInvite)
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarInvite)]
|
||||
void HandleCalendarInvite(CalendarInvitePkt calendarInvite)
|
||||
{
|
||||
ObjectGuid playerGuid = GetPlayer().GetGUID();
|
||||
|
||||
@@ -243,10 +243,10 @@ namespace Game
|
||||
Team inviteeTeam = 0;
|
||||
ulong inviteeGuildId = 0;
|
||||
|
||||
if (!ObjectManager.NormalizePlayerName(ref calendarEventInvite.Name))
|
||||
if (!ObjectManager.NormalizePlayerName(ref calendarInvite.Name))
|
||||
return;
|
||||
|
||||
Player player = Global.ObjAccessor.FindPlayerByName(calendarEventInvite.Name);
|
||||
Player player = Global.ObjAccessor.FindPlayerByName(calendarInvite.Name);
|
||||
if (player)
|
||||
{
|
||||
// Invitee is online
|
||||
@@ -257,7 +257,7 @@ namespace Game
|
||||
else
|
||||
{
|
||||
// Invitee offline, get data from database
|
||||
ObjectGuid guid = Global.CharacterCacheStorage.GetCharacterGuidByName(calendarEventInvite.Name);
|
||||
ObjectGuid guid = Global.CharacterCacheStorage.GetCharacterGuidByName(calendarInvite.Name);
|
||||
if (!guid.IsEmpty())
|
||||
{
|
||||
CharacterCacheEntry characterInfo = Global.CharacterCacheStorage.GetCharacterCacheByGuid(guid);
|
||||
@@ -288,14 +288,14 @@ namespace Game
|
||||
|
||||
if (Convert.ToBoolean(result1.Read<byte>(0) & (byte)SocialFlag.Ignored))
|
||||
{
|
||||
Global.CalendarMgr.SendCalendarCommandResult(playerGuid, CalendarError.IgnoringYouS, calendarEventInvite.Name);
|
||||
Global.CalendarMgr.SendCalendarCommandResult(playerGuid, CalendarError.IgnoringYouS, calendarInvite.Name);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!calendarEventInvite.Creating)
|
||||
if (!calendarInvite.Creating)
|
||||
{
|
||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarEventInvite.EventID);
|
||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarInvite.EventID);
|
||||
if (calendarEvent != null)
|
||||
{
|
||||
if (calendarEvent.IsGuildEvent() && calendarEvent.GuildId == inviteeGuildId)
|
||||
@@ -305,7 +305,7 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
CalendarInvite invite = new CalendarInvite(Global.CalendarMgr.GetFreeInviteId(), calendarEventInvite.EventID, inviteeGuid, playerGuid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.Invited, CalendarModerationRank.Player, "");
|
||||
CalendarInvite invite = new CalendarInvite(Global.CalendarMgr.GetFreeInviteId(), calendarInvite.EventID, inviteeGuid, playerGuid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.Invited, CalendarModerationRank.Player, "");
|
||||
Global.CalendarMgr.AddInvite(calendarEvent, invite);
|
||||
}
|
||||
else
|
||||
@@ -313,13 +313,13 @@ namespace Game
|
||||
}
|
||||
else
|
||||
{
|
||||
if (calendarEventInvite.IsSignUp && inviteeGuildId == GetPlayer().GetGuildId())
|
||||
if (calendarInvite.IsSignUp && inviteeGuildId == GetPlayer().GetGuildId())
|
||||
{
|
||||
Global.CalendarMgr.SendCalendarCommandResult(playerGuid, CalendarError.NoGuildInvites);
|
||||
return;
|
||||
}
|
||||
|
||||
CalendarInvite invite = new CalendarInvite(calendarEventInvite.EventID, 0, inviteeGuid, playerGuid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.Invited, CalendarModerationRank.Player, "");
|
||||
CalendarInvite invite = new CalendarInvite(calendarInvite.EventID, 0, inviteeGuid, playerGuid, SharedConst.CalendarDefaultResponseTime, CalendarInviteStatus.Invited, CalendarModerationRank.Player, "");
|
||||
Global.CalendarMgr.SendCalendarEventInvite(invite);
|
||||
}
|
||||
}
|
||||
@@ -347,25 +347,25 @@ namespace Game
|
||||
Global.CalendarMgr.SendCalendarCommandResult(guid, CalendarError.EventInvalid);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarEventRsvp)]
|
||||
void HandleCalendarEventRsvp(CalendarEventRSVP calendarEventRSVP)
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarRsvp)]
|
||||
void HandleCalendarRsvp(HandleCalendarRsvp calendarRSVP)
|
||||
{
|
||||
ObjectGuid guid = GetPlayer().GetGUID();
|
||||
|
||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarEventRSVP.EventID);
|
||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarRSVP.EventID);
|
||||
if (calendarEvent != null)
|
||||
{
|
||||
// i think we still should be able to remove self from locked events
|
||||
if (calendarEventRSVP.Status != CalendarInviteStatus.Removed && calendarEvent.IsLocked())
|
||||
if (calendarRSVP.Status != CalendarInviteStatus.Removed && calendarEvent.IsLocked())
|
||||
{
|
||||
Global.CalendarMgr.SendCalendarCommandResult(guid, CalendarError.EventLocked);
|
||||
return;
|
||||
}
|
||||
|
||||
CalendarInvite invite = Global.CalendarMgr.GetInvite(calendarEventRSVP.InviteID);
|
||||
CalendarInvite invite = Global.CalendarMgr.GetInvite(calendarRSVP.InviteID);
|
||||
if (invite != null)
|
||||
{
|
||||
invite.Status = calendarEventRSVP.Status;
|
||||
invite.Status = calendarRSVP.Status;
|
||||
invite.ResponseTime = Time.UnixTime;
|
||||
|
||||
Global.CalendarMgr.UpdateInvite(invite);
|
||||
@@ -399,22 +399,22 @@ namespace Game
|
||||
Global.CalendarMgr.SendCalendarCommandResult(guid, CalendarError.NoInvite);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarEventStatus)]
|
||||
void HandleCalendarEventStatus(CalendarEventStatus calendarEventStatus)
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarStatus)]
|
||||
void HandleCalendarStatus(CalendarStatus calendarStatus)
|
||||
{
|
||||
ObjectGuid guid = GetPlayer().GetGUID();
|
||||
|
||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarEventStatus.EventID);
|
||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarStatus.EventID);
|
||||
if (calendarEvent != null)
|
||||
{
|
||||
CalendarInvite invite = Global.CalendarMgr.GetInvite(calendarEventStatus.InviteID);
|
||||
CalendarInvite invite = Global.CalendarMgr.GetInvite(calendarStatus.InviteID);
|
||||
if (invite != null)
|
||||
{
|
||||
invite.Status = (CalendarInviteStatus)calendarEventStatus.Status;
|
||||
invite.Status = (CalendarInviteStatus)calendarStatus.Status;
|
||||
|
||||
Global.CalendarMgr.UpdateInvite(invite);
|
||||
Global.CalendarMgr.SendCalendarEventStatus(calendarEvent, invite);
|
||||
Global.CalendarMgr.SendCalendarClearPendingAction(calendarEventStatus.Guid);
|
||||
Global.CalendarMgr.SendCalendarClearPendingAction(calendarStatus.Guid);
|
||||
}
|
||||
else
|
||||
Global.CalendarMgr.SendCalendarCommandResult(guid, CalendarError.NoInvite); // correct?
|
||||
@@ -424,17 +424,17 @@ namespace Game
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CalendarEventModeratorStatus)]
|
||||
void HandleCalendarEventModeratorStatus(CalendarEventModeratorStatus calendarEventModeratorStatus)
|
||||
void HandleCalendarModeratorStatus(CalendarModeratorStatusQuery calendarModeratorStatus)
|
||||
{
|
||||
ObjectGuid guid = GetPlayer().GetGUID();
|
||||
|
||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarEventModeratorStatus.EventID);
|
||||
CalendarEvent calendarEvent = Global.CalendarMgr.GetEvent(calendarModeratorStatus.EventID);
|
||||
if (calendarEvent != null)
|
||||
{
|
||||
CalendarInvite invite = Global.CalendarMgr.GetInvite(calendarEventModeratorStatus.InviteID);
|
||||
CalendarInvite invite = Global.CalendarMgr.GetInvite(calendarModeratorStatus.InviteID);
|
||||
if (invite != null)
|
||||
{
|
||||
invite.Rank = (CalendarModerationRank)calendarEventModeratorStatus.Status;
|
||||
invite.Rank = (CalendarModerationRank)calendarModeratorStatus.Status;
|
||||
Global.CalendarMgr.UpdateInvite(invite);
|
||||
Global.CalendarMgr.SendCalendarEventModeratorStatusAlert(calendarEvent, invite);
|
||||
}
|
||||
|
||||
@@ -54,11 +54,6 @@ namespace Game
|
||||
|
||||
void HandleCharEnumCallback(SQLResult result)
|
||||
{
|
||||
byte demonHunterCount = 0; // We use this counter to allow multiple demon hunter creations when allowed in config
|
||||
bool canAlwaysCreateDemonHunter = HasPermission(RBACPermissions.SkipCheckCharacterCreationDemonHunter);
|
||||
if (WorldConfig.GetIntValue(WorldCfg.CharacterCreatingMinLevelForDemonHunter) == 0) // char level = 0 means this check is disabled, so always true
|
||||
canAlwaysCreateDemonHunter = true;
|
||||
|
||||
EnumCharactersResult charResult = new EnumCharactersResult();
|
||||
charResult.Success = true;
|
||||
charResult.IsDeletedCharacters = false;
|
||||
@@ -101,14 +96,6 @@ namespace Game
|
||||
if (!Global.CharacterCacheStorage.HasCharacterCacheEntry(charInfo.Guid)) // This can happen if characters are inserted into the database manually. Core hasn't loaded name data yet.
|
||||
Global.CharacterCacheStorage.AddCharacterCacheEntry(charInfo.Guid, GetAccountId(), charInfo.Name, charInfo.SexId, charInfo.RaceId, (byte)charInfo.ClassId, charInfo.ExperienceLevel, false);
|
||||
|
||||
if (charInfo.ClassId == Class.DemonHunter)
|
||||
demonHunterCount++;
|
||||
|
||||
if (demonHunterCount >= WorldConfig.GetIntValue(WorldCfg.DemonHuntersPerRealm) && !canAlwaysCreateDemonHunter)
|
||||
charResult.HasDemonHunterOnRealm = true;
|
||||
else
|
||||
charResult.HasDemonHunterOnRealm = false;
|
||||
|
||||
charResult.MaxCharacterLevel = Math.Max(charResult.MaxCharacterLevel, charInfo.ExperienceLevel);
|
||||
|
||||
charResult.Characters.Add(charInfo);
|
||||
@@ -116,8 +103,6 @@ namespace Game
|
||||
while (result.NextRow());
|
||||
}
|
||||
|
||||
charResult.IsTestDemonHunterCreationAllowed = canAlwaysCreateDemonHunter;
|
||||
charResult.IsDemonHunterCreationAllowed = GetAccountExpansion() >= Expansion.Legion || canAlwaysCreateDemonHunter;
|
||||
charResult.IsAlliedRacesCreationAllowed = GetAccountExpansion() >= Expansion.BattleForAzeroth;
|
||||
|
||||
foreach (var requirement in Global.ObjectMgr.GetRaceUnlockRequirements())
|
||||
@@ -360,25 +345,10 @@ namespace Game
|
||||
if (result1 != null && !result1.IsEmpty())
|
||||
{
|
||||
Team team = Player.TeamForRace(createInfo.RaceId);
|
||||
int freeDemonHunterSlots = WorldConfig.GetIntValue(WorldCfg.DemonHuntersPerRealm);
|
||||
|
||||
byte accRace = result1.Read<byte>(1);
|
||||
|
||||
if (checkDemonHunterReqs)
|
||||
{
|
||||
byte accClass = result1.Read<byte>(2);
|
||||
if (accClass == (byte)Class.DemonHunter)
|
||||
{
|
||||
if (freeDemonHunterSlots > 0)
|
||||
--freeDemonHunterSlots;
|
||||
|
||||
if (freeDemonHunterSlots == 0)
|
||||
{
|
||||
SendCharCreate(ResponseCodes.CharCreateFailed);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasDemonHunterReqLevel)
|
||||
{
|
||||
byte accLevel = result1.Read<byte>(0);
|
||||
@@ -1079,6 +1049,40 @@ namespace Game
|
||||
GetPlayer().GetReputationMgr().SetInactive(packet.Index, packet.State);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.CheckCharacterNameAvailability)]
|
||||
void HandleCheckCharacterNameAvailability(CheckCharacterNameAvailability checkCharacterNameAvailability)
|
||||
{
|
||||
// prevent character rename to invalid name
|
||||
if (!ObjectManager.NormalizePlayerName(ref checkCharacterNameAvailability.Name))
|
||||
{
|
||||
SendPacket(new CheckCharacterNameAvailabilityResult(checkCharacterNameAvailability.SequenceIndex, ResponseCodes.CharNameNoName));
|
||||
return;
|
||||
}
|
||||
|
||||
ResponseCodes res = ObjectManager.CheckPlayerName(checkCharacterNameAvailability.Name, GetSessionDbcLocale(), true);
|
||||
if (res != ResponseCodes.CharNameSuccess)
|
||||
{
|
||||
SendPacket(new CheckCharacterNameAvailabilityResult(checkCharacterNameAvailability.SequenceIndex, res));
|
||||
return;
|
||||
}
|
||||
|
||||
// check name limitations
|
||||
if (!HasPermission(RBACPermissions.SkipCheckCharacterCreationReservedname) && Global.ObjectMgr.IsReservedName(checkCharacterNameAvailability.Name))
|
||||
{
|
||||
SendPacket(new CheckCharacterNameAvailabilityResult(checkCharacterNameAvailability.SequenceIndex, ResponseCodes.CharNameReserved));
|
||||
return;
|
||||
}
|
||||
|
||||
// Ensure that there is no character with the desired new name
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.SEL_CHECK_NAME);
|
||||
stmt.AddValue(0, checkCharacterNameAvailability.Name);
|
||||
|
||||
_queryProcessor.AddCallback(DB.Characters.AsyncQuery(stmt).WithCallback(result =>
|
||||
{
|
||||
SendPacket(new CheckCharacterNameAvailabilityResult(checkCharacterNameAvailability.SequenceIndex, !result.IsEmpty() ? ResponseCodes.CharCreateNameInUse : ResponseCodes.Success));
|
||||
}));
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.RequestForcedReactions)]
|
||||
void HandleRequestForcedReactions(RequestForcedReactions requestForcedReactions)
|
||||
{
|
||||
@@ -2455,13 +2459,8 @@ namespace Game
|
||||
packet.Display.HasValue = true;
|
||||
packet.Display.Value.Name = factionChangeInfo.Name;
|
||||
packet.Display.Value.SexID = (byte)factionChangeInfo.SexID;
|
||||
packet.Display.Value.SkinID = factionChangeInfo.SkinID;
|
||||
packet.Display.Value.HairColorID = factionChangeInfo.HairColorID;
|
||||
packet.Display.Value.HairStyleID = factionChangeInfo.HairStyleID;
|
||||
packet.Display.Value.FacialHairStyleID = factionChangeInfo.FacialHairStyleID;
|
||||
packet.Display.Value.FaceID = factionChangeInfo.FaceID;
|
||||
packet.Display.Value.Customizations = factionChangeInfo.Customizations;
|
||||
packet.Display.Value.RaceID = (byte)factionChangeInfo.RaceID;
|
||||
packet.Display.Value.CustomDisplay = factionChangeInfo.CustomDisplay;
|
||||
}
|
||||
|
||||
SendPacket(packet);
|
||||
|
||||
@@ -62,12 +62,12 @@ namespace Game
|
||||
garrison.SendBlueprintAndSpecializationData();
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.GarrisonGetBuildingLandmarks)]
|
||||
void HandleGarrisonGetBuildingLandmarks(GarrisonGetBuildingLandmarks garrisonGetBuildingLandmarks)
|
||||
[WorldPacketHandler(ClientOpcodes.GarrisonGetMapData)]
|
||||
void HandleGarrisonGetMapData(GarrisonGetMapData garrisonGetMapData)
|
||||
{
|
||||
Garrison garrison = _player.GetGarrison();
|
||||
if (garrison != null)
|
||||
garrison.SendBuildingLandmarks(_player);
|
||||
garrison.SendMapData(_player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace Game
|
||||
|
||||
if (store.HasRecord(record.RecordID))
|
||||
{
|
||||
dbReply.Allow = true;
|
||||
dbReply.Status = 1;
|
||||
dbReply.Timestamp = (uint)GameTime.GetGameTime();
|
||||
store.WriteRecord(record.RecordID, GetSessionDbcLocale(), dbReply.Data);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ namespace Game
|
||||
|
||||
// Get player locked Dungeons
|
||||
foreach (var locked in Global.LFGMgr.GetLockedDungeons(_player.GetGUID()))
|
||||
lfgPlayerInfo.BlackList.Slot.Add(new LFGBlackListSlot(locked.Key, (uint)locked.Value.lockStatus, locked.Value.requiredItemLevel, (int)locked.Value.currentItemLevel));
|
||||
lfgPlayerInfo.BlackList.Slot.Add(new LFGBlackListSlot(locked.Key, (uint)locked.Value.lockStatus, locked.Value.requiredItemLevel, (int)locked.Value.currentItemLevel, 0));
|
||||
|
||||
foreach (var slot in randomDungeons)
|
||||
{
|
||||
@@ -231,7 +231,7 @@ namespace Game
|
||||
LFGBlackList lfgBlackList = new LFGBlackList();
|
||||
lfgBlackList.PlayerGuid.Set(pguid);
|
||||
foreach (var locked in Global.LFGMgr.GetLockedDungeons(pguid))
|
||||
lfgBlackList.Slot.Add(new LFGBlackListSlot(locked.Key, (uint)locked.Value.lockStatus, locked.Value.requiredItemLevel, (int)locked.Value.currentItemLevel));
|
||||
lfgBlackList.Slot.Add(new LFGBlackListSlot(locked.Key, (uint)locked.Value.lockStatus, locked.Value.requiredItemLevel, (int)locked.Value.currentItemLevel, 0));
|
||||
|
||||
lfgPartyInfo.Player.Add(lfgBlackList);
|
||||
}
|
||||
@@ -353,7 +353,7 @@ namespace Game
|
||||
|
||||
foreach (var it in joinData.lockmap)
|
||||
{
|
||||
var blackList = new LFGJoinBlackList();
|
||||
var blackList = new LFGBlackListPkt();
|
||||
blackList.PlayerGuid = it.Key;
|
||||
|
||||
foreach (var lockInfo in it.Value)
|
||||
@@ -361,8 +361,10 @@ namespace Game
|
||||
Log.outTrace(LogFilter.Lfg, "SendLfgJoinResult:: {0} DungeonID: {1} Lock status: {2} Required itemLevel: {3} Current itemLevel: {4}",
|
||||
it.Key.ToString(), (lockInfo.Key & 0x00FFFFFF), lockInfo.Value.lockStatus, lockInfo.Value.requiredItemLevel, lockInfo.Value.currentItemLevel);
|
||||
|
||||
blackList.Slots.Add(new LFGJoinBlackListSlot((int)lockInfo.Key, (int)lockInfo.Value.lockStatus, lockInfo.Value.requiredItemLevel, (int)lockInfo.Value.currentItemLevel));
|
||||
blackList.Slot.Add(new LFGBlackListSlot(lockInfo.Key, (uint)lockInfo.Value.lockStatus, lockInfo.Value.requiredItemLevel, (int)lockInfo.Value.currentItemLevel, 0));
|
||||
}
|
||||
|
||||
lfgJoinResult.BlackList.Add(blackList);
|
||||
}
|
||||
|
||||
SendPacket(lfgJoinResult);
|
||||
|
||||
@@ -732,8 +732,8 @@ namespace Game
|
||||
GetPlayer().SetPendingBind(0, 0);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.WardenData)]
|
||||
void HandleWardenDataOpcode(WardenData packet)
|
||||
[WorldPacketHandler(ClientOpcodes.Warden3Data)]
|
||||
void HandleWarden3Data(WardenData packet)
|
||||
{
|
||||
if (_warden == null || packet.Data.GetSize() == 0)
|
||||
return;
|
||||
|
||||
@@ -429,7 +429,7 @@ namespace Game
|
||||
|
||||
NewWorld packet = new NewWorld();
|
||||
packet.MapID = loc.GetMapId();
|
||||
packet.Pos = loc;
|
||||
packet.Loc.Pos = loc;
|
||||
packet.Reason = (uint)(!_player.IsBeingTeleportedSeamlessly() ? NewWorldReason.Normal : NewWorldReason.Seamless);
|
||||
SendPacket(packet);
|
||||
|
||||
|
||||
@@ -242,10 +242,13 @@ namespace Game
|
||||
if (quest == null)
|
||||
return;
|
||||
|
||||
// This is Real Item Entry, not slot id as pre 5.x
|
||||
// TODO: currency choice items
|
||||
if (packet.Choice.LootItemType != LootItemType.Item)
|
||||
return;
|
||||
|
||||
if (packet.ItemChoiceID != 0)
|
||||
{
|
||||
ItemTemplate rewardProto = Global.ObjectMgr.GetItemTemplate(packet.ItemChoiceID);
|
||||
ItemTemplate rewardProto = Global.ObjectMgr.GetItemTemplate(packet.Choice.Item.ItemID);
|
||||
if (rewardProto == null)
|
||||
{
|
||||
Log.outError(LogFilter.Network, "Error in CMSG_QUESTGIVER_CHOOSE_REWARD: player {0} ({1}) tried to get invalid reward item (Item Entry: {2}) for quest {3} (possible packet-hacking detected)", GetPlayer().GetName(), GetPlayer().GetGUID().ToString(), packet.ItemChoiceID, packet.QuestID);
|
||||
@@ -255,7 +258,7 @@ namespace Game
|
||||
bool itemValid = false;
|
||||
for (uint i = 0; i < quest.GetRewChoiceItemsCount(); ++i)
|
||||
{
|
||||
if (quest.RewardChoiceItemId[i] != 0 && quest.RewardChoiceItemId[i] == packet.ItemChoiceID)
|
||||
if (quest.RewardChoiceItemId[i] != 0 && quest.RewardChoiceItemId[i] == packet.Choice.Item.ItemID)
|
||||
{
|
||||
itemValid = true;
|
||||
break;
|
||||
@@ -269,7 +272,7 @@ namespace Game
|
||||
{
|
||||
foreach (var questPackageItem in questPackageItems)
|
||||
{
|
||||
if (questPackageItem.ItemID != packet.ItemChoiceID)
|
||||
if (questPackageItem.ItemID != packet.Choice.Item.ItemID)
|
||||
continue;
|
||||
|
||||
if (_player.CanSelectQuestPackageItem(questPackageItem))
|
||||
@@ -287,7 +290,7 @@ namespace Game
|
||||
{
|
||||
foreach (var questPackageItem in questPackageItems1)
|
||||
{
|
||||
if (questPackageItem.ItemID != packet.ItemChoiceID)
|
||||
if (questPackageItem.ItemID != packet.Choice.Item.ItemID)
|
||||
continue;
|
||||
|
||||
itemValid = true;
|
||||
@@ -324,9 +327,9 @@ namespace Game
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer().CanRewardQuest(quest, packet.ItemChoiceID, true))
|
||||
if (GetPlayer().CanRewardQuest(quest, packet.Choice.Item.ItemID, true))
|
||||
{
|
||||
GetPlayer().RewardQuest(quest, packet.ItemChoiceID, obj);
|
||||
GetPlayer().RewardQuest(quest, packet.Choice.Item.ItemID, obj);
|
||||
|
||||
switch (obj.GetTypeId())
|
||||
{
|
||||
@@ -350,7 +353,7 @@ namespace Game
|
||||
}
|
||||
|
||||
_player.PlayerTalkClass.ClearMenus();
|
||||
creatureQGiver.GetAI().QuestReward(_player, quest, packet.ItemChoiceID);
|
||||
creatureQGiver.GetAI().QuestReward(_player, quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID);
|
||||
break;
|
||||
}
|
||||
case TypeId.GameObject:
|
||||
@@ -371,7 +374,7 @@ namespace Game
|
||||
}
|
||||
|
||||
_player.PlayerTalkClass.ClearMenus();
|
||||
questGiver.GetAI().QuestReward(_player, quest, packet.ItemChoiceID);
|
||||
questGiver.GetAI().QuestReward(_player, quest, packet.Choice.LootItemType, packet.Choice.Item.ItemID);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -531,13 +531,8 @@ namespace Game
|
||||
|
||||
Guild guild = player.GetGuild();
|
||||
|
||||
mirrorImageComponentedData.SkinColor = player.m_playerData.SkinID;
|
||||
mirrorImageComponentedData.FaceVariation = player.m_playerData.FaceID;
|
||||
mirrorImageComponentedData.HairVariation = player.m_playerData.HairStyleID;
|
||||
mirrorImageComponentedData.HairColor = player.m_playerData.HairColorID;
|
||||
mirrorImageComponentedData.BeardVariation = player.m_playerData.FacialHairStyleID;
|
||||
for (int i = 0; i < PlayerConst.CustomDisplaySize; ++i)
|
||||
mirrorImageComponentedData.CustomDisplay[i] = player.m_playerData.CustomDisplayOption[i];
|
||||
foreach (var customization in player.m_playerData.Customizations)
|
||||
mirrorImageComponentedData.Customizations.Add(new ChrCustomizationChoice(customization.ChrCustomizationOptionID, customization.ChrCustomizationChoiceID));
|
||||
mirrorImageComponentedData.GuildGUID = (guild ? guild.GetGUID() : ObjectGuid.Empty);
|
||||
|
||||
byte[] itemSlots =
|
||||
|
||||
@@ -43,32 +43,33 @@ namespace Game
|
||||
SendPacket(response);
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.SupportTicketSubmitBug)]
|
||||
void HandleSupportTicketSubmitBug(SupportTicketSubmitBug packet)
|
||||
[WorldPacketHandler(ClientOpcodes.SubmitUserFeedback)]
|
||||
void HandleSubmitUserFeedback(SubmitUserFeedback userFeedback)
|
||||
{
|
||||
if (!Global.SupportMgr.GetBugSystemStatus())
|
||||
return;
|
||||
if (userFeedback.IsSuggestion)
|
||||
{
|
||||
if (!Global.SupportMgr.GetSuggestionSystemStatus())
|
||||
return;
|
||||
|
||||
BugTicket ticket = new BugTicket(GetPlayer());
|
||||
ticket.SetPosition(packet.Header.MapID, packet.Header.Position);
|
||||
ticket.SetFacing(packet.Header.Facing);
|
||||
ticket.SetNote(packet.Note);
|
||||
SuggestionTicket ticket = new SuggestionTicket(GetPlayer());
|
||||
ticket.SetPosition(userFeedback.Header.MapID, userFeedback.Header.Position);
|
||||
ticket.SetFacing(userFeedback.Header.Facing);
|
||||
ticket.SetNote(userFeedback.Note);
|
||||
|
||||
Global.SupportMgr.AddTicket(ticket);
|
||||
}
|
||||
Global.SupportMgr.AddTicket(ticket);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Global.SupportMgr.GetBugSystemStatus())
|
||||
return;
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.SupportTicketSubmitSuggestion)]
|
||||
void HandleSupportTicketSubmitSuggestion(SupportTicketSubmitSuggestion packet)
|
||||
{
|
||||
if (!Global.SupportMgr.GetSuggestionSystemStatus())
|
||||
return;
|
||||
BugTicket ticket = new BugTicket(GetPlayer());
|
||||
ticket.SetPosition(userFeedback.Header.MapID, userFeedback.Header.Position);
|
||||
ticket.SetFacing(userFeedback.Header.Facing);
|
||||
ticket.SetNote(userFeedback.Note);
|
||||
|
||||
SuggestionTicket ticket = new SuggestionTicket(GetPlayer());
|
||||
ticket.SetPosition(packet.Header.MapID, packet.Header.Position);
|
||||
ticket.SetFacing(packet.Header.Facing);
|
||||
ticket.SetNote(packet.Note);
|
||||
|
||||
Global.SupportMgr.AddTicket(ticket);
|
||||
Global.SupportMgr.AddTicket(ticket);
|
||||
}
|
||||
}
|
||||
|
||||
[WorldPacketHandler(ClientOpcodes.SupportTicketSubmitComplaint)]
|
||||
|
||||
Reference in New Issue
Block a user