mirror of
https://github.com/araxiaonline/TrinityCore2.git
synced 2026-06-19 14:29:33 -04:00
Implement some opcodes. Big thx to TOM_RUS.
--HG-- branch : trunk
This commit is contained in:
@@ -258,7 +258,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
||||
uint32 sideb = player->GetTeam();
|
||||
if (sidea != sideb)
|
||||
{
|
||||
SendPlayerNotFoundNotice(to);
|
||||
SendWrongFactionNotice();
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -734,3 +734,23 @@ void WorldSession::SendPlayerNotFoundNotice(std::string name)
|
||||
data << name;
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendPlayerAmbiguousNotice(std::string name)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAT_PLAYER_AMBIGUOUS, name.size()+1);
|
||||
data << name;
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendWrongFactionNotice()
|
||||
{
|
||||
WorldPacket data(SMSG_CHAT_WRONG_FACTION, 0);
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendChatRestrictedNotice(ChatRestrictionType restriction)
|
||||
{
|
||||
WorldPacket data(SMSG_CHAT_RESTRICTED, 1);
|
||||
data << uint8(restriction);
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
+27
-21
@@ -48,10 +48,11 @@ class Aura;
|
||||
|
||||
void WorldSession::SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res)
|
||||
{
|
||||
WorldPacket data(SMSG_PARTY_COMMAND_RESULT, (8+member.size()+1));
|
||||
WorldPacket data(SMSG_PARTY_COMMAND_RESULT, (4+member.size()+1+4+4));
|
||||
data << (uint32)operation;
|
||||
data << member;
|
||||
data << (uint32)res;
|
||||
data << uint32(0); // LFD cooldown related (used with ERR_PARTY_LFG_BOOT_COOLDOWN_S and ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S)
|
||||
|
||||
SendPacket(&data);
|
||||
}
|
||||
@@ -66,7 +67,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
// cheating
|
||||
if (!normalizePlayerName(membername))
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_CANT_FIND_TARGET);
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_BAD_PLAYER_NAME_S);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -75,7 +76,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
// no player
|
||||
if (!player)
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_CANT_FIND_TARGET);
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_BAD_PLAYER_NAME_S);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -88,18 +89,18 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
// can't group with
|
||||
if (!sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP) && GetPlayer()->GetTeam() != player->GetTeam())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_TARGET_UNFRIENDLY);
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_PLAYER_WRONG_FACTION);
|
||||
return;
|
||||
}
|
||||
if (GetPlayer()->GetInstanceId() != 0 && player->GetInstanceId() != 0 && GetPlayer()->GetInstanceId() != player->GetInstanceId() && GetPlayer()->GetMapId() == player->GetMapId())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_NOT_IN_YOUR_INSTANCE);
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_TARGET_NOT_IN_INSTANCE_S);
|
||||
return;
|
||||
}
|
||||
// just ignore us
|
||||
if (player->GetInstanceId() != 0 && player->GetDungeonDifficulty() != GetPlayer()->GetDungeonDifficulty())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_TARGET_IGNORE_YOU);
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_IGNORING_YOU_S);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -119,7 +120,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
// player already in another group or invited
|
||||
if (group2 || player->GetGroupInvite())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_ALREADY_IN_GROUP);
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_ALREADY_IN_GROUP_S);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -128,13 +129,13 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
// not have permissions for invite
|
||||
if (group->isRaidGroup() && !group->IsLeader(GetPlayer()->GetGUID()) && !group->IsAssistant(GetPlayer()->GetGUID()))
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, "", PARTY_RESULT_YOU_NOT_LEADER);
|
||||
SendPartyResult(PARTY_OP_INVITE, "", ERR_NOT_LEADER);
|
||||
return;
|
||||
}
|
||||
// not have place
|
||||
if (group->IsFull())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, "", PARTY_RESULT_PARTY_FULL);
|
||||
SendPartyResult(PARTY_OP_INVITE, "", ERR_GROUP_FULL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -168,11 +169,16 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket & recv_data)
|
||||
|
||||
// ok, we do it
|
||||
WorldPacket data(SMSG_GROUP_INVITE, 10); // guess size
|
||||
data << uint8(1); // ok
|
||||
data << GetPlayer()->GetName();
|
||||
data << uint8(1); // invited/already in group flag
|
||||
data << GetPlayer()->GetName(); // max len 48
|
||||
data << uint32(0); // unk
|
||||
data << uint8(0); // count
|
||||
//for(int i = 0; i < count; ++i)
|
||||
// data << uint32(0);
|
||||
data << uint32(0); // unk
|
||||
player->GetSession()->SendPacket(&data);
|
||||
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, PARTY_RESULT_OK);
|
||||
SendPartyResult(PARTY_OP_INVITE, membername, ERR_PARTY_RESULT_OK);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupAcceptOpcode(WorldPacket & /*recv_data*/)
|
||||
@@ -195,7 +201,7 @@ void WorldSession::HandleGroupAcceptOpcode(WorldPacket & /*recv_data*/)
|
||||
// not have place
|
||||
if (group->IsFull())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, "", PARTY_RESULT_PARTY_FULL);
|
||||
SendPartyResult(PARTY_OP_INVITE, "", ERR_GROUP_FULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -241,7 +247,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
uint64 guid;
|
||||
recv_data >> guid;
|
||||
recv_data.read_skip<uint8>();
|
||||
recv_data.read_skip<std::string>(); // reason
|
||||
|
||||
//can't uninvite yourself
|
||||
if (guid == GetPlayer()->GetGUID())
|
||||
@@ -251,7 +257,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
PartyResult res = GetPlayer()->CanUninviteFromGroup();
|
||||
if (res != PARTY_RESULT_OK)
|
||||
if (res != ERR_PARTY_RESULT_OK)
|
||||
{
|
||||
SendPartyResult(PARTY_OP_LEAVE, "", res);
|
||||
return;
|
||||
@@ -273,7 +279,7 @@ void WorldSession::HandleGroupUninviteGuidOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
SendPartyResult(PARTY_OP_LEAVE, "", PARTY_RESULT_NOT_IN_YOUR_PARTY);
|
||||
SendPartyResult(PARTY_OP_LEAVE, "", ERR_TARGET_NOT_IN_GROUP_S);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
|
||||
@@ -293,7 +299,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
|
||||
PartyResult res = GetPlayer()->CanUninviteFromGroup();
|
||||
if (res != PARTY_RESULT_OK)
|
||||
if (res != ERR_PARTY_RESULT_OK)
|
||||
{
|
||||
SendPartyResult(PARTY_OP_LEAVE, "", res);
|
||||
return;
|
||||
@@ -315,7 +321,7 @@ void WorldSession::HandleGroupUninviteOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
SendPartyResult(PARTY_OP_LEAVE, membername, PARTY_RESULT_NOT_IN_YOUR_PARTY);
|
||||
SendPartyResult(PARTY_OP_LEAVE, membername, ERR_TARGET_NOT_IN_GROUP_S);
|
||||
}
|
||||
|
||||
void WorldSession::HandleGroupSetLeaderOpcode(WorldPacket & recv_data)
|
||||
@@ -345,7 +351,7 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/)
|
||||
|
||||
if (_player->InBattleGround())
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, "", PARTY_RESULT_INVITE_RESTRICTED);
|
||||
SendPartyResult(PARTY_OP_INVITE, "", ERR_INVITE_RESTRICTED);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -353,7 +359,7 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/)
|
||||
/********************/
|
||||
|
||||
// everything's fine, do it
|
||||
SendPartyResult(PARTY_OP_LEAVE, GetPlayer()->GetName(), PARTY_RESULT_OK);
|
||||
SendPartyResult(PARTY_OP_LEAVE, GetPlayer()->GetName(), ERR_PARTY_RESULT_OK);
|
||||
|
||||
GetPlayer()->RemoveFromGroup();
|
||||
}
|
||||
@@ -505,7 +511,7 @@ void WorldSession::HandleGroupRaidConvertOpcode(WorldPacket & /*recv_data*/)
|
||||
/********************/
|
||||
|
||||
// everything's fine, do it (is it 0 (PARTY_OP_INVITE) correct code)
|
||||
SendPartyResult(PARTY_OP_INVITE, "", PARTY_RESULT_OK);
|
||||
SendPartyResult(PARTY_OP_INVITE, "", ERR_PARTY_RESULT_OK);
|
||||
group->ConvertToRaid();
|
||||
}
|
||||
|
||||
|
||||
@@ -854,17 +854,30 @@ void WorldSession::HandleBuyBankSlotOpcode(WorldPacket& recvPacket)
|
||||
|
||||
BankBagSlotPricesEntry const* slotEntry = sBankBagSlotPricesStore.LookupEntry(slot);
|
||||
|
||||
WorldPacket data(SMSG_BUY_BANK_SLOT_RESULT, 4);
|
||||
|
||||
if (!slotEntry)
|
||||
{
|
||||
data << uint32(ERR_BANKSLOT_FAILED_TOO_MANY);
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 price = slotEntry->price;
|
||||
|
||||
if (_player->GetMoney() < price)
|
||||
{
|
||||
data << uint32(ERR_BANKSLOT_INSUFFICIENT_FUNDS);
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
_player->SetBankBagSlotCount(slot);
|
||||
_player->ModifyMoney(-int32(price));
|
||||
|
||||
data << uint32(ERR_BANKSLOT_OK);
|
||||
SendPacket(&data);
|
||||
|
||||
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BUY_BANK_SLOT);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1326,7 +1326,7 @@ enum Opcodes
|
||||
UMSG_UNKNOWN_1287 = 0x507, // not found
|
||||
CMSG_UNKNOWN_1288 = 0x508, // lua: SetAllowLowLevelRaid
|
||||
CMSG_UNKNOWN_1289 = 0x509, // lua: SetAllowLowLevelRaid
|
||||
SMSG_UNKNOWN_1290 = 0x50A, // camera shake?
|
||||
SMSG_CAMERA_SHAKE = 0x50A, // uint32 SpellEffectCameraShakes.dbc index, uint32
|
||||
SMSG_UNKNOWN_1291 = 0x50B, // some item update packet?
|
||||
UMSG_UNKNOWN_1292 = 0x50C, // not found
|
||||
UMSG_UNKNOWN_1293 = 0x50D, // not found - disconnect
|
||||
|
||||
+4
-4
@@ -21637,15 +21637,15 @@ PartyResult Player::CanUninviteFromGroup() const
|
||||
{
|
||||
const Group* grp = GetGroup();
|
||||
if (!grp)
|
||||
return PARTY_RESULT_YOU_NOT_IN_GROUP;
|
||||
return ERR_NOT_IN_GROUP;
|
||||
|
||||
if (!grp->IsLeader(GetGUID()) && !grp->IsAssistant(GetGUID()))
|
||||
return PARTY_RESULT_YOU_NOT_LEADER;
|
||||
return ERR_NOT_LEADER;
|
||||
|
||||
if (InBattleGround())
|
||||
return PARTY_RESULT_INVITE_RESTRICTED;
|
||||
return ERR_INVITE_RESTRICTED;
|
||||
|
||||
return PARTY_RESULT_OK;
|
||||
return ERR_PARTY_RESULT_OK;
|
||||
}
|
||||
|
||||
void Player::SetBattleGroundRaid(Group* group, int8 subgroup)
|
||||
|
||||
@@ -79,6 +79,14 @@ enum PlayerUnderwaterState
|
||||
UNDERWATER_EXIST_TIMERS = 0x10
|
||||
};
|
||||
|
||||
enum BuyBankSlotResult
|
||||
{
|
||||
ERR_BANKSLOT_FAILED_TOO_MANY = 0,
|
||||
ERR_BANKSLOT_INSUFFICIENT_FUNDS = 1,
|
||||
ERR_BANKSLOT_NOTBANKER = 2,
|
||||
ERR_BANKSLOT_OK = 3
|
||||
};
|
||||
|
||||
enum PlayerSpellState
|
||||
{
|
||||
PLAYERSPELL_UNCHANGED = 0,
|
||||
|
||||
+42
-12
@@ -76,22 +76,49 @@ struct AccountData
|
||||
enum PartyOperation
|
||||
{
|
||||
PARTY_OP_INVITE = 0,
|
||||
PARTY_OP_LEAVE = 2
|
||||
PARTY_OP_LEAVE = 2,
|
||||
PARTY_OP_SWAP = 4
|
||||
};
|
||||
|
||||
enum PartyResult
|
||||
{
|
||||
PARTY_RESULT_OK = 0,
|
||||
PARTY_RESULT_CANT_FIND_TARGET = 1,
|
||||
PARTY_RESULT_NOT_IN_YOUR_PARTY = 2,
|
||||
PARTY_RESULT_NOT_IN_YOUR_INSTANCE = 3,
|
||||
PARTY_RESULT_PARTY_FULL = 4,
|
||||
PARTY_RESULT_ALREADY_IN_GROUP = 5,
|
||||
PARTY_RESULT_YOU_NOT_IN_GROUP = 6,
|
||||
PARTY_RESULT_YOU_NOT_LEADER = 7,
|
||||
PARTY_RESULT_TARGET_UNFRIENDLY = 8,
|
||||
PARTY_RESULT_TARGET_IGNORE_YOU = 9,
|
||||
PARTY_RESULT_INVITE_RESTRICTED = 13
|
||||
ERR_PARTY_RESULT_OK = 0,
|
||||
ERR_BAD_PLAYER_NAME_S = 1,
|
||||
ERR_TARGET_NOT_IN_GROUP_S = 2,
|
||||
ERR_TARGET_NOT_IN_INSTANCE_S = 3,
|
||||
ERR_GROUP_FULL = 4,
|
||||
ERR_ALREADY_IN_GROUP_S = 5,
|
||||
ERR_NOT_IN_GROUP = 6,
|
||||
ERR_NOT_LEADER = 7,
|
||||
ERR_PLAYER_WRONG_FACTION = 8,
|
||||
ERR_IGNORING_YOU_S = 9,
|
||||
ERR_LFG_PENDING = 12,
|
||||
ERR_INVITE_RESTRICTED = 13,
|
||||
ERR_GROUP_SWAP_FAILED = 14, // if (PartyOperation == PARTY_OP_SWAP) ERR_GROUP_SWAP_FAILED else ERR_INVITE_IN_COMBAT
|
||||
ERR_INVITE_UNKNOWN_REALM = 15,
|
||||
ERR_INVITE_NO_PARTY_SERVER = 16,
|
||||
ERR_INVITE_PARTY_BUSY = 17,
|
||||
ERR_PARTY_TARGET_AMBIGUOUS = 18,
|
||||
ERR_PARTY_LFG_INVITE_RAID_LOCKED = 19,
|
||||
ERR_PARTY_LFG_BOOT_LIMIT = 20,
|
||||
ERR_PARTY_LFG_BOOT_COOLDOWN_S = 21,
|
||||
ERR_PARTY_LFG_BOOT_IN_PROGRESS = 22,
|
||||
ERR_PARTY_LFG_BOOT_TOO_FEW_PLAYERS = 23,
|
||||
ERR_PARTY_LFG_BOOT_NOT_ELIGIBLE_S = 24,
|
||||
ERR_RAID_DISALLOWED_BY_LEVEL = 25,
|
||||
ERR_PARTY_LFG_BOOT_IN_COMBAT = 26,
|
||||
ERR_VOTE_KICK_REASON_NEEDED = 27,
|
||||
ERR_PARTY_LFG_BOOT_DUNGEON_COMPLETE = 28,
|
||||
ERR_PARTY_LFG_BOOT_LOOT_ROLLS = 29,
|
||||
ERR_PARTY_LFG_TELEPORT_IN_COMBAT = 30
|
||||
};
|
||||
|
||||
enum ChatRestrictionType
|
||||
{
|
||||
ERR_CHAT_RESTRICTED = 0,
|
||||
ERR_CHAT_THROTTLED = 1,
|
||||
ERR_USER_SQUELCHED = 2,
|
||||
ERR_YELL_RESTRICTED = 3
|
||||
};
|
||||
|
||||
/// Player session in the World
|
||||
@@ -555,6 +582,9 @@ class WorldSession
|
||||
bool processChatmessageFurtherAfterSecurityChecks(std::string&, uint32);
|
||||
void HandleMessagechatOpcode(WorldPacket& recvPacket);
|
||||
void SendPlayerNotFoundNotice(std::string name);
|
||||
void SendPlayerAmbiguousNotice(std::string name);
|
||||
void SendWrongFactionNotice();
|
||||
void SendChatRestrictedNotice(ChatRestrictionType restriction);
|
||||
void HandleTextEmoteOpcode(WorldPacket& recvPacket);
|
||||
void HandleChatIgnoredOpcode(WorldPacket& recvPacket);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user