Skip to content

Commit

Permalink
Core/PacketIO: Fix SMSG_TRANSFER_ABORTED
Browse files Browse the repository at this point in the history
Picked from: https://github.com/vmangos/core

Co-authored-by: brotalnia <brotalnia@gmail.com>

vmangos/core@b9b006d
  • Loading branch information
Exxenoz authored and killerwife committed Jul 3, 2024
1 parent bdda342 commit bd9ba1b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/game/Entities/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18080,10 +18080,10 @@ void Player::SendTransferAbortedByLockStatus(MapEntry const* mapEntry, AreaTrigg
GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(LANG_LEVEL_MINREQUIRED), miscRequirement);
break;
case AREA_LOCKSTATUS_ZONE_IN_COMBAT:
GetSession()->SendTransferAborted(mapEntry->MapID, TRANSFER_ABORT_ZONE_IN_COMBAT);
GetSession()->SendTransferAborted(TRANSFER_ABORT_ZONE_IN_COMBAT);
break;
case AREA_LOCKSTATUS_INSTANCE_IS_FULL:
GetSession()->SendTransferAborted(mapEntry->MapID, TRANSFER_ABORT_MAX_PLAYERS);
GetSession()->SendTransferAborted(TRANSFER_ABORT_MAX_PLAYERS);
break;
case AREA_LOCKSTATUS_QUEST_NOT_COMPLETED:
if (mapEntry->IsContinent()) // do not report anything for quest areatrigge
Expand All @@ -18098,7 +18098,7 @@ void Player::SendTransferAbortedByLockStatus(MapEntry const* mapEntry, AreaTrigg
GetSession()->SendAreaTriggerMessage(GetSession()->GetMangosString(LANG_LEVEL_MINREQUIRED_AND_ITEM), at->requiredLevel, sObjectMgr.GetItemPrototype(miscRequirement)->Name1);
break;
case AREA_LOCKSTATUS_TOO_MANY_INSTANCE:
GetSession()->SendTransferAborted(mapEntry->MapID, TRANSFER_ABORT_TOO_MANY_INSTANCES);
GetSession()->SendTransferAborted(TRANSFER_ABORT_TOO_MANY_INSTANCES);
break;
case AREA_LOCKSTATUS_NOT_ALLOWED:
case AREA_LOCKSTATUS_RAID_LOCKED:
Expand Down
8 changes: 3 additions & 5 deletions src/game/Server/WorldSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,12 +1182,10 @@ void WorldSession::SaveTutorialsData()
}

// Send chat information about aborted transfer (mostly used by Player::SendTransferAbortedByLockstatus())
void WorldSession::SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg) const
void WorldSession::SendTransferAborted(TransferAbortReason reason) const
{
WorldPacket data(SMSG_TRANSFER_ABORTED, 4 + 2);
data << uint32(mapid);
data << uint8(reason); // transfer abort reason
data << uint8(0); // arg. not used
WorldPacket data(SMSG_TRANSFER_ABORTED, 1);
data << uint8(reason);
SendPacket(data);
}

Expand Down
4 changes: 3 additions & 1 deletion src/game/Server/WorldSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include <mutex>
#include <memory>

enum TransferAbortReason;

This comment has been minimized.

Copy link
@insunaa

insunaa Jul 3, 2024

Contributor

change to

enum TransferAbortReason : uint8;

here
and to

enum TransferAbortReason : uint8
{
...

in Player.h to fix

alternatively move the enum entirely from Player.h to WorldSession.h

This comment has been minimized.

Copy link
@killerwife

killerwife Jul 3, 2024

Contributor

Ill resolve all compilation issues when im done later today.


struct ItemPrototype;
struct AuctionEntry;
struct AuctionHouseEntry;
Expand Down Expand Up @@ -221,7 +223,7 @@ class WorldSession
void SendPetNameInvalid(uint32 error, const std::string& name) const;
void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res) const;
void SendAreaTriggerMessage(const char* Text, ...) const ATTR_PRINTF(2, 3);
void SendTransferAborted(uint32 mapid, uint8 reason, uint8 arg = 0) const;
void SendTransferAborted(TransferAbortReason reason) const;
void SendQueryTimeResponse() const;

bool IsInitialZoneUpdated() { return m_initialZoneUpdated; }
Expand Down

0 comments on commit bd9ba1b

Please sign in to comment.