Core/PacketIO: Renamed a bunch of opcodes based on more research (only those added after 6.0)

Port From (https://github.com/TrinityCore/TrinityCore/commit/f922c6e7a46a7c712daaaef9b1a72ca865fbe94b)
This commit is contained in:
hondacrx
2020-09-22 20:05:58 -04:00
parent 184915abc2
commit d40c2938a3
65 changed files with 552 additions and 527 deletions
+26 -27
View File
@@ -20,7 +20,6 @@ using Framework.Database;
using Framework.Dynamic;
using Game.DataStorage;
using Game.Entities;
using Game.Mails;
using Game.Networking;
using Game.Networking.Packets;
using System;
@@ -165,17 +164,17 @@ namespace Game
SendAuctionHello(hello.Guid, unit);
}
[WorldPacketHandler(ClientOpcodes.AuctionListBidderItems)]
void HandleAuctionListBidderItems(AuctionListBidderItems listBidderItems)
[WorldPacketHandler(ClientOpcodes.AuctionListBiddedItems)]
void HandleAuctionListBiddedItems(AuctionListBiddedItems listBiddedItems)
{
AuctionThrottleResult throttle = Global.AuctionHouseMgr.CheckThrottle(_player, listBidderItems.TaintedBy.HasValue);
AuctionThrottleResult throttle = Global.AuctionHouseMgr.CheckThrottle(_player, listBiddedItems.TaintedBy.HasValue);
if (throttle.Throttled)
return;
Creature creature = GetPlayer().GetNPCIfCanInteractWith(listBidderItems.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None);
Creature creature = GetPlayer().GetNPCIfCanInteractWith(listBiddedItems.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None);
if (!creature)
{
Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionListBidderItems - {listBidderItems.Auctioneer} not found or you can't interact with him.");
Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionListBidderItems - {listBiddedItems.Auctioneer} not found or you can't interact with him.");
return;
}
@@ -185,10 +184,10 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionListBidderItemsResult result = new AuctionListBidderItemsResult();
AuctionListBiddedItemsResult result = new AuctionListBiddedItemsResult();
Player player = GetPlayer();
auctionHouse.BuildListBidderItems(result, player, listBidderItems.Offset, listBidderItems.Sorts, listBidderItems.Sorts.Count);
auctionHouse.BuildListBiddedItems(result, player, listBiddedItems.Offset, listBiddedItems.Sorts, listBiddedItems.Sorts.Count);
result.DesiredDelay = (uint)throttle.DelayUntilNext.TotalSeconds;
SendPacket(result);
}
@@ -288,17 +287,17 @@ namespace Game
SendPacket(listItemsResult);
}
[WorldPacketHandler(ClientOpcodes.AuctionListOwnerItems)]
void HandleAuctionListOwnerItems(AuctionListOwnerItems listOwnerItems)
[WorldPacketHandler(ClientOpcodes.AuctionListOwnedItems)]
void HandleAuctionListOwnedItems(AuctionListOwnedItems listOwnedItems)
{
AuctionThrottleResult throttle = Global.AuctionHouseMgr.CheckThrottle(_player, listOwnerItems.TaintedBy.HasValue);
AuctionThrottleResult throttle = Global.AuctionHouseMgr.CheckThrottle(_player, listOwnedItems.TaintedBy.HasValue);
if (throttle.Throttled)
return;
Creature creature = GetPlayer().GetNPCIfCanInteractWith(listOwnerItems.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None);
Creature creature = GetPlayer().GetNPCIfCanInteractWith(listOwnedItems.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None);
if (!creature)
{
Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionListOwnerItems - {listOwnerItems.Auctioneer} not found or you can't interact with him.");
Log.outDebug(LogFilter.Network, $"WORLD: HandleAuctionListOwnerItems - {listOwnedItems.Auctioneer} not found or you can't interact with him.");
return;
}
@@ -308,9 +307,9 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionListOwnerItemsResult result = new AuctionListOwnerItemsResult();
AuctionListOwnedItemsResult result = new AuctionListOwnedItemsResult();
auctionHouse.BuildListOwnerItems(result, _player, listOwnerItems.Offset, listOwnerItems.Sorts, listOwnerItems.Sorts.Count);
auctionHouse.BuildListOwnedItems(result, _player, listOwnedItems.Offset, listOwnedItems.Sorts, listOwnedItems.Sorts.Count);
result.DesiredDelay = (uint)throttle.DelayUntilNext.TotalSeconds;
SendPacket(result);
}
@@ -925,17 +924,17 @@ namespace Game
DB.Characters.CommitTransaction(trans);
}
[WorldPacketHandler(ClientOpcodes.AuctionStartCommoditiesPurchase)]
void HandleAuctionStartCommoditiesPurchase(AuctionStartCommoditiesPurchase startCommoditiesPurchase)
[WorldPacketHandler(ClientOpcodes.AuctionGetCommodityQuote)]
void HandleAuctionGetCommodityQuote(AuctionGetCommodityQuote getCommodityQuote)
{
AuctionThrottleResult throttle = Global.AuctionHouseMgr.CheckThrottle(_player, startCommoditiesPurchase.TaintedBy.HasValue, AuctionCommand.PlaceBid);
AuctionThrottleResult throttle = Global.AuctionHouseMgr.CheckThrottle(_player, getCommodityQuote.TaintedBy.HasValue, AuctionCommand.PlaceBid);
if (throttle.Throttled)
return;
Creature creature = GetPlayer().GetNPCIfCanInteractWith(startCommoditiesPurchase.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None);
Creature creature = GetPlayer().GetNPCIfCanInteractWith(getCommodityQuote.Auctioneer, NPCFlags.Auctioneer, NPCFlags2.None);
if (!creature)
{
Log.outError(LogFilter.Network, "WORLD: HandleAuctionStartCommoditiesPurchase - {startCommoditiesPurchase.Auctioneer.ToString()} not found or you can't interact with him.");
Log.outError(LogFilter.Network, $"WORLD: HandleAuctionStartCommoditiesPurchase - {getCommodityQuote.Auctioneer} not found or you can't interact with him.");
return;
}
@@ -945,19 +944,19 @@ namespace Game
AuctionHouseObject auctionHouse = Global.AuctionHouseMgr.GetAuctionsMap(creature.GetFaction());
AuctionCommodityQuote auctionCommodityQuote = new AuctionCommodityQuote();
AuctionGetCommodityQuoteResult commodityQuoteResult = new AuctionGetCommodityQuoteResult();
CommodityQuote quote = auctionHouse.CreateCommodityQuote(_player, (uint)startCommoditiesPurchase.ItemID, startCommoditiesPurchase.Quantity);
CommodityQuote quote = auctionHouse.CreateCommodityQuote(_player, (uint)getCommodityQuote.ItemID, getCommodityQuote.Quantity);
if (quote != null)
{
auctionCommodityQuote.TotalPrice.Set(quote.TotalPrice);
auctionCommodityQuote.Quantity.Set(quote.Quantity);
auctionCommodityQuote.QuoteDuration.Set((int)(quote.ValidTo - GameTime.GetGameTimeSteadyPoint()).TotalMilliseconds);
commodityQuoteResult.TotalPrice.Set(quote.TotalPrice);
commodityQuoteResult.Quantity.Set(quote.Quantity);
commodityQuoteResult.QuoteDuration.Set((int)(quote.ValidTo - GameTime.GetGameTimeSteadyPoint()).TotalMilliseconds);
}
auctionCommodityQuote.DesiredDelay = (uint)throttle.DelayUntilNext.TotalSeconds;
commodityQuoteResult.DesiredDelay = (uint)throttle.DelayUntilNext.TotalSeconds;
SendPacket(auctionCommodityQuote);
SendPacket(commodityQuoteResult);
}
public void SendAuctionHello(ObjectGuid guid, Creature unit)
+1 -1
View File
@@ -62,7 +62,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.AzeriteEssenceActivateEssence)]
void HandleAzeriteEssenceActivateEssence(AzeriteEssenceActivateEssence azeriteEssenceActivateEssence)
{
AzeriteEssenceSelectionResult activateEssenceResult = new AzeriteEssenceSelectionResult();
ActivateEssenceFailed activateEssenceResult = new ActivateEssenceFailed();
activateEssenceResult.AzeriteEssenceID = azeriteEssenceActivateEssence.AzeriteEssenceID;
Item item = _player.GetItemByEntry(PlayerConst.ItemIdHeartOfAzeroth, ItemSearchLocation.InEquipment);
+5 -5
View File
@@ -221,9 +221,9 @@ namespace Game
if (bg.IsArena())
return;
PVPLogDataMessage pvpLogData = new PVPLogDataMessage();
bg.BuildPvPLogDataPacket(out pvpLogData.Data);
SendPacket(pvpLogData);
PVPMatchStatisticsMessage pvpMatchStatistics = new PVPMatchStatisticsMessage();
bg.BuildPvPLogDataPacket(out pvpMatchStatistics.Data);
SendPacket(pvpMatchStatistics);
}
[WorldPacketHandler(ClientOpcodes.BattlefieldList)]
@@ -581,8 +581,8 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestRatedBattlefieldInfo)]
void HandleRequestRatedBattlefieldInfo(RequestRatedBattlefieldInfo packet)
{
RatedBattlefieldInfo ratedBattlefieldInfo = new RatedBattlefieldInfo();
SendPacket(ratedBattlefieldInfo);
RatedPvpInfo ratedPvpInfo = new RatedPvpInfo();
SendPacket(ratedPvpInfo);
}
[WorldPacketHandler(ClientOpcodes.GetPvpOptionsEnabled, Processing = PacketProcessing.Inplace)]
+5 -5
View File
@@ -31,13 +31,13 @@ namespace Game
Global.ServiceMgr.Dispatch(this, request.Method.GetServiceHash(), request.Method.Token, request.Method.GetMethodId(), new CodedInputStream(request.Data));
}
[WorldPacketHandler(ClientOpcodes.BattlenetRequestRealmListTicket, Status = SessionStatus.Authed)]
void HandleBattlenetRequestRealmListTicket(RequestRealmListTicket requestRealmListTicket)
[WorldPacketHandler(ClientOpcodes.ChangeRealmTicket, Status = SessionStatus.Authed)]
void HandleBattlenetChangeRealmTicket(ChangeRealmTicket changeRealmTicket)
{
SetRealmListSecret(requestRealmListTicket.Secret);
SetRealmListSecret(changeRealmTicket.Secret);
RealmListTicket realmListTicket = new RealmListTicket();
realmListTicket.Token = requestRealmListTicket.Token;
ChangeRealmTicketResponse realmListTicket = new ChangeRealmTicketResponse();
realmListTicket.Token = changeRealmTicket.Token;
realmListTicket.Allow = true;
realmListTicket.Ticket = new Framework.IO.ByteBuffer();
realmListTicket.Ticket.WriteCString("WorldserverRealmListTicket");
+7 -7
View File
@@ -692,13 +692,13 @@ namespace Game
// Send PVPSeason
{
PVPSeason season = new PVPSeason();
season.PreviousSeason = (WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId) - (WorldConfig.GetBoolValue(WorldCfg.ArenaSeasonInProgress) ? 1 : 0));
SeasonInfo seasonInfo = new SeasonInfo();
seasonInfo.PreviousSeason = (WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId) - (WorldConfig.GetBoolValue(WorldCfg.ArenaSeasonInProgress) ? 1 : 0));
if (WorldConfig.GetBoolValue(WorldCfg.ArenaSeasonInProgress))
season.CurrentSeason = WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId);
seasonInfo.CurrentSeason = WorldConfig.GetIntValue(WorldCfg.ArenaSeasonId);
SendPacket(season);
SendPacket(seasonInfo);
}
SQLResult resultGuild = holder.GetResult(PlayerLoginQueryLoad.Guild);
@@ -792,7 +792,7 @@ namespace Game
stmt.AddValue(0, pCurrChar.GetGUID().GetCounter());
GetQueryProcessor().AddCallback(DB.Characters.AsyncQuery(stmt)).WithCallback(favoriteAuctionResult =>
{
AuctionFavoriteItems favoriteItems = new AuctionFavoriteItems();
AuctionFavoriteList favoriteItems = new AuctionFavoriteList();
if (!favoriteAuctionResult.IsEmpty())
{
do
@@ -2432,12 +2432,12 @@ namespace Game
{
if (result == ResponseCodes.Success)
{
CharCustomizeResponse response = new CharCustomizeResponse(customizeInfo);
CharCustomizeSuccess response = new CharCustomizeSuccess(customizeInfo);
SendPacket(response);
}
else
{
CharCustomizeFailed failed = new CharCustomizeFailed();
CharCustomizeFailure failed = new CharCustomizeFailure();
failed.Result = (byte)result;
failed.CharGUID = customizeInfo.CharGUID;
SendPacket(failed);
+1 -1
View File
@@ -586,7 +586,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestPartyMemberStats)]
void HandleRequestPartyMemberStats(RequestPartyMemberStats packet)
{
PartyMemberState partyMemberStats = new PartyMemberState();
PartyMemberFullState partyMemberStats = new PartyMemberFullState();
Player player = Global.ObjAccessor.FindConnectedPlayer(packet.TargetGUID);
if (!player)
+2 -2
View File
@@ -67,14 +67,14 @@ namespace Game
{
var hotfixes = Global.DB2Mgr.GetHotfixData();
HotfixResponse hotfixQueryResponse = new HotfixResponse();
HotfixConnect hotfixQueryResponse = new HotfixConnect();
foreach (HotfixRecord hotfixRecord in hotfixQuery.Hotfixes)
{
if (hotfixes.Contains(hotfixRecord))
{
var storage = Global.DB2Mgr.GetStorage(hotfixRecord.TableHash);
HotfixResponse.HotfixData hotfixData = new HotfixResponse.HotfixData();
HotfixConnect.HotfixData hotfixData = new HotfixConnect.HotfixData();
hotfixData.Record = hotfixRecord;
if (storage != null && storage.HasRecord((uint)hotfixRecord.RecordID))
{
+3 -3
View File
@@ -1072,7 +1072,7 @@ namespace Game
{
// TODO: Implement sorting
// Placeholder to prevent completely locking out bags clientside
SendPacket(new SortBagsResult());
SendPacket(new BagCleanupFinished());
}
[WorldPacketHandler(ClientOpcodes.SortBankBags)]
@@ -1080,7 +1080,7 @@ namespace Game
{
// TODO: Implement sorting
// Placeholder to prevent completely locking out bags clientside
SendPacket(new SortBagsResult());
SendPacket(new BagCleanupFinished());
}
[WorldPacketHandler(ClientOpcodes.SortReagentBankBags)]
@@ -1088,7 +1088,7 @@ namespace Game
{
// TODO: Implement sorting
// Placeholder to prevent completely locking out bags clientside
SendPacket(new SortBagsResult());
SendPacket(new BagCleanupFinished());
}
[WorldPacketHandler(ClientOpcodes.RemoveNewItem)]
+1 -1
View File
@@ -648,7 +648,7 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.RequestWorldQuestUpdate)]
void HandleRequestWorldQuestUpdate(RequestWorldQuestUpdate packet)
{
WorldQuestUpdate response = new WorldQuestUpdate();
WorldQuestUpdateResponse response = new WorldQuestUpdateResponse();
// @todo: 7.x Has to be implemented
//response.WorldQuestUpdates.push_back(WorldPackets::Quest::WorldQuestUpdateInfo(lastUpdate, questID, timer, variableID, value));
+14 -14
View File
@@ -29,24 +29,24 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.LearnTalents)]
void HandleLearnTalents(LearnTalents packet)
{
LearnTalentsFailed learnTalentsFailed = new LearnTalentsFailed();
LearnTalentFailed learnTalentFailed = new LearnTalentFailed();
bool anythingLearned = false;
foreach (uint talentId in packet.Talents)
{
TalentLearnResult result = _player.LearnTalent(talentId, ref learnTalentsFailed.SpellID);
TalentLearnResult result = _player.LearnTalent(talentId, ref learnTalentFailed.SpellID);
if (result != 0)
{
if (learnTalentsFailed.Reason == 0)
learnTalentsFailed.Reason = (uint)result;
if (learnTalentFailed.Reason == 0)
learnTalentFailed.Reason = (uint)result;
learnTalentsFailed.Talents.Add((ushort)talentId);
learnTalentFailed.Talents.Add((ushort)talentId);
}
else
anythingLearned = true;
}
if (learnTalentsFailed.Reason != 0)
SendPacket(learnTalentsFailed);
if (learnTalentFailed.Reason != 0)
SendPacket(learnTalentFailed);
if (anythingLearned)
GetPlayer().SendTalentsInfoData();
@@ -55,24 +55,24 @@ namespace Game
[WorldPacketHandler(ClientOpcodes.LearnPvpTalents)]
void HandleLearnPvpTalents(LearnPvpTalents packet)
{
LearnPvpTalentsFailed learnPvpTalentsFailed = new LearnPvpTalentsFailed();
LearnPvpTalentFailed learnPvpTalentFailed = new LearnPvpTalentFailed();
bool anythingLearned = false;
foreach (var pvpTalent in packet.Talents)
{
TalentLearnResult result = _player.LearnPvpTalent(pvpTalent.PvPTalentID, pvpTalent.Slot, ref learnPvpTalentsFailed.SpellID);
TalentLearnResult result = _player.LearnPvpTalent(pvpTalent.PvPTalentID, pvpTalent.Slot, ref learnPvpTalentFailed.SpellID);
if (result != 0)
{
if (learnPvpTalentsFailed.Reason == 0)
learnPvpTalentsFailed.Reason = (uint)result;
if (learnPvpTalentFailed.Reason == 0)
learnPvpTalentFailed.Reason = (uint)result;
learnPvpTalentsFailed.Talents.Add(pvpTalent);
learnPvpTalentFailed.Talents.Add(pvpTalent);
}
else
anythingLearned = true;
}
if (learnPvpTalentsFailed.Reason != 0)
SendPacket(learnPvpTalentsFailed);
if (learnPvpTalentFailed.Reason != 0)
SendPacket(learnPvpTalentFailed);
if (anythingLearned)
_player.SendTalentsInfoData();
+3 -3
View File
@@ -24,10 +24,10 @@ namespace Game
{
public partial class WorldSession
{
[WorldPacketHandler(ClientOpcodes.UiTimeRequest, Status = SessionStatus.Authed, Processing = PacketProcessing.Inplace)]
void HandleUITimeRequest(UITimeRequest packet)
[WorldPacketHandler(ClientOpcodes.ServerTimeOffsetRequest, Status = SessionStatus.Authed, Processing = PacketProcessing.Inplace)]
void HandleServerTimeOffsetRequest(ServerTimeOffsetRequest packet)
{
UITime response = new UITime();
ServerTimeOffset response = new ServerTimeOffset();
response.Time = (uint)Time.UnixTime;
SendPacket(response);
}
+8 -8
View File
@@ -23,26 +23,26 @@ namespace Game
{
public partial class WorldSession
{
[WorldPacketHandler(ClientOpcodes.UpdateWowTokenAuctionableList)]
void HandleUpdateListedAuctionableTokens(UpdateListedAuctionableTokens updateListedAuctionableTokens)
[WorldPacketHandler(ClientOpcodes.CommerceTokenGetLog)]
void HandleCommerceTokenGetLog(CommerceTokenGetLog commerceTokenGetLog)
{
UpdateListedAuctionableTokensResponse response = new UpdateListedAuctionableTokensResponse();
CommerceTokenGetLogResponse response = new CommerceTokenGetLogResponse();
// @todo: fix 6.x implementation
response.UnkInt = updateListedAuctionableTokens.UnkInt;
response.UnkInt = commerceTokenGetLog.UnkInt;
response.Result = TokenResult.Success;
SendPacket(response);
}
[WorldPacketHandler(ClientOpcodes.RequestWowTokenMarketPrice)]
void HandleRequestWowTokenMarketPrice(RequestWowTokenMarketPrice requestWowTokenMarketPrice)
[WorldPacketHandler(ClientOpcodes.CommerceTokenGetMarketPrice)]
void HandleCommerceTokenGetMarketPrice(CommerceTokenGetMarketPrice commerceTokenGetMarketPrice)
{
WowTokenMarketPriceResponse response = new WowTokenMarketPriceResponse();
CommerceTokenGetMarketPriceResponse response = new CommerceTokenGetMarketPriceResponse();
// @todo: 6.x fix implementation
response.CurrentMarketPrice = 300000000;
response.UnkInt = requestWowTokenMarketPrice.UnkInt;
response.UnkInt = commerceTokenGetMarketPrice.UnkInt;
response.Result = TokenResult.Success;
//packet.ReadUInt32("UnkInt32");
@@ -294,7 +294,7 @@ namespace Game
public void SendOpenTransmogrifier(ObjectGuid guid)
{
SendPacket(new OpenTransmogrifier(guid));
SendPacket(new TransmogrifyNPC(guid));
}
}
}