mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
Dropped old code.
This commit is contained in:
parent
5895cb38e3
commit
83b41546aa
7 changed files with 159 additions and 401 deletions
|
|
@ -81,9 +81,7 @@ void Channel::Join(uint64 p, const char *pass)
|
|||
|
||||
if(plr)
|
||||
{
|
||||
if(HasFlag(CHANNEL_FLAG_LFG) &&
|
||||
sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER &&
|
||||
(plr->GetGroup() || plr->m_lookingForGroup.Empty()) )
|
||||
if(HasFlag(CHANNEL_FLAG_LFG) && sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER )
|
||||
{
|
||||
MakeNotInLfg(&data);
|
||||
SendToOne(&data, p);
|
||||
|
|
|
|||
|
|
@ -821,13 +821,6 @@ void WorldSession::HandleSetFactionAtWarOpcode( WorldPacket & recv_data )
|
|||
GetPlayer()->GetReputationMgr().SetAtWar(repListID, flag);
|
||||
}
|
||||
|
||||
void WorldSession::HandleMeetingStoneInfoOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
DEBUG_LOG( "WORLD: Received CMSG_MEETING_STONE_INFO" );
|
||||
|
||||
SendLfgUpdate(0, 0, 0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleTutorialFlagOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
uint32 iFlag;
|
||||
|
|
|
|||
|
|
@ -24,303 +24,115 @@
|
|||
#include "ObjectMgr.h"
|
||||
#include "World.h"
|
||||
|
||||
static void AttemptJoin(Player* _player)
|
||||
{
|
||||
// skip not can autojoin cases and player group case
|
||||
if (!_player->m_lookingForGroup.canAutoJoin() || _player->GetGroup())
|
||||
return;
|
||||
|
||||
//TODO: Guard Player Map
|
||||
HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
|
||||
{
|
||||
Player *plr = iter->second;
|
||||
|
||||
// skip enemies and self
|
||||
if (!plr || plr==_player || plr->GetTeam() != _player->GetTeam())
|
||||
continue;
|
||||
|
||||
//skip players not in world
|
||||
if (!plr->IsInWorld())
|
||||
continue;
|
||||
|
||||
// skip not auto add, not group leader cases
|
||||
if (!plr->GetSession()->LookingForGroup_auto_add || (plr->GetGroup() && plr->GetGroup()->GetLeaderGuid() != plr->GetObjectGuid()))
|
||||
continue;
|
||||
|
||||
// skip non auto-join or empty slots, or non compatible slots
|
||||
if (!plr->m_lookingForGroup.more.canAutoJoin() || !_player->m_lookingForGroup.HaveInSlot(plr->m_lookingForGroup.more))
|
||||
continue;
|
||||
|
||||
// attempt create group, or skip
|
||||
if (!plr->GetGroup())
|
||||
{
|
||||
Group* group = new Group;
|
||||
if (!group->Create(plr->GetObjectGuid(), plr->GetName()))
|
||||
{
|
||||
delete group;
|
||||
continue;
|
||||
}
|
||||
|
||||
sObjectMgr.AddGroup(group);
|
||||
}
|
||||
|
||||
// stop at success join
|
||||
if(plr->GetGroup()->AddMember(_player->GetObjectGuid(), _player->GetName()))
|
||||
{
|
||||
if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
|
||||
_player->LeaveLFGChannel();
|
||||
break;
|
||||
}
|
||||
// full
|
||||
else
|
||||
{
|
||||
if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER )
|
||||
plr->LeaveLFGChannel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void AttemptAddMore(Player* _player)
|
||||
{
|
||||
// skip not group leader case
|
||||
if (_player->GetGroup() && _player->GetGroup()->GetLeaderGuid() != _player->GetObjectGuid())
|
||||
return;
|
||||
|
||||
if(!_player->m_lookingForGroup.more.canAutoJoin())
|
||||
return;
|
||||
|
||||
//TODO: Guard Player map
|
||||
HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
|
||||
{
|
||||
Player *plr = iter->second;
|
||||
|
||||
// skip enemies and self
|
||||
if (!plr || plr==_player || plr->GetTeam() != _player->GetTeam())
|
||||
continue;
|
||||
|
||||
if(!plr->IsInWorld())
|
||||
continue;
|
||||
|
||||
// skip not auto join or in group
|
||||
if(!plr->GetSession()->LookingForGroup_auto_join || plr->GetGroup() )
|
||||
continue;
|
||||
|
||||
if(!plr->m_lookingForGroup.HaveInSlot(_player->m_lookingForGroup.more))
|
||||
continue;
|
||||
|
||||
// attempt create group if need, or stop attempts
|
||||
if(!_player->GetGroup())
|
||||
{
|
||||
Group* group = new Group;
|
||||
if(!group->Create(_player->GetObjectGuid(), _player->GetName()))
|
||||
{
|
||||
delete group;
|
||||
return; // can't create group (??)
|
||||
}
|
||||
|
||||
sObjectMgr.AddGroup(group);
|
||||
}
|
||||
|
||||
// stop at join fail (full)
|
||||
if(!_player->GetGroup()->AddMember(plr->GetObjectGuid(), plr->GetName()) )
|
||||
{
|
||||
if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
|
||||
_player->LeaveLFGChannel();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// joined
|
||||
if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER )
|
||||
plr->LeaveLFGChannel();
|
||||
|
||||
// and group full
|
||||
if(_player->GetGroup()->IsFull() )
|
||||
{
|
||||
if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
|
||||
_player->LeaveLFGChannel();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WorldSession::HandleLfgJoinOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
DEBUG_LOG("CMSG_LFG_JOIN");
|
||||
LookingForGroup_auto_join = true;
|
||||
|
||||
uint8 counter1, counter2;
|
||||
uint8 dungeonsCount, counter2;
|
||||
std::string comment;
|
||||
|
||||
recv_data >> Unused<uint32>(); // lfg roles
|
||||
recv_data >> Unused<uint8>(); // unk1 (unused?)
|
||||
recv_data >> Unused<uint8>(); // unk2 (unused?)
|
||||
recv_data >> Unused<uint8>(); // lua: GetLFGInfoLocal
|
||||
recv_data >> Unused<uint8>(); // lua: GetLFGInfoLocal
|
||||
|
||||
recv_data >> counter1;
|
||||
for (uint8 i = 0; i < counter1; i++)
|
||||
recv_data >> Unused<uint32>(); // queue block? (type/zone?)
|
||||
recv_data >> dungeonsCount;
|
||||
for (uint8 i = 0; i < dungeonsCount; ++i)
|
||||
recv_data >> Unused<uint32>(); // dungeons id/type
|
||||
|
||||
recv_data >> counter2;
|
||||
for (uint8 i = 0; i < counter2; i++)
|
||||
recv_data >> Unused<uint8>(); // unk (unused?)
|
||||
recv_data >> counter2; // lua: GetLFGInfoLocal
|
||||
for (uint8 i = 0; i < counter2; ++i)
|
||||
recv_data >> Unused<uint8>(); // lua: GetLFGInfoLocal
|
||||
|
||||
recv_data >> comment; // lfg comment
|
||||
|
||||
if(!_player) // needed because STATUS_AUTHED
|
||||
return;
|
||||
|
||||
AttemptJoin(_player);
|
||||
//SendLfgJoinResult(ERR_LFG_OK);
|
||||
//SendLfgUpdate(1);
|
||||
}
|
||||
|
||||
void WorldSession::HandleLfgLeaveOpcode( WorldPacket & /*recv_data*/ )
|
||||
{
|
||||
DEBUG_LOG("CMSG_LFG_LEAVE");
|
||||
LookingForGroup_auto_join = false;
|
||||
}
|
||||
|
||||
void WorldSession::HandleSearchLfgJoinOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
DEBUG_LOG("CMSG_SEARCH_LFG_JOIN");
|
||||
LookingForGroup_auto_add = true;
|
||||
DEBUG_LOG("CMSG_LFG_SEARCH_JOIN");
|
||||
|
||||
recv_data >> Unused<uint32>(); // join id?
|
||||
uint32 temp, entry;
|
||||
recv_data >> temp;
|
||||
|
||||
if(!_player) // needed because STATUS_AUTHED
|
||||
return;
|
||||
entry = (temp & 0x00FFFFFF);
|
||||
LfgType type = LfgType((temp >> 24) & 0x000000FF);
|
||||
|
||||
AttemptAddMore(_player);
|
||||
//SendLfgResult(type, entry);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSearchLfgLeaveOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
DEBUG_LOG("CMSG_SEARCH_LFG_LEAVE");
|
||||
LookingForGroup_auto_add = false;
|
||||
DEBUG_LOG("CMSG_LFG_SEARCH_LEAVE");
|
||||
|
||||
recv_data >> Unused<uint32>(); // join id?
|
||||
}
|
||||
|
||||
void WorldSession::HandleLfgClearOpcode( WorldPacket & /*recv_data */ )
|
||||
{
|
||||
// empty packet
|
||||
DEBUG_LOG("CMSG_CLEAR_LOOKING_FOR_GROUP");
|
||||
|
||||
for(int i = 0; i < MAX_LOOKING_FOR_GROUP_SLOT; ++i)
|
||||
_player->m_lookingForGroup.slots[i].Clear();
|
||||
|
||||
if( sWorld.getConfig(CONFIG_BOOL_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
|
||||
_player->LeaveLFGChannel();
|
||||
|
||||
SendLfgUpdate(0, 0, 0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleLfmClearOpcode( WorldPacket & /*recv_data */)
|
||||
{
|
||||
// empty packet
|
||||
DEBUG_LOG("CMSG_CLEAR_LOOKING_FOR_MORE");
|
||||
|
||||
_player->m_lookingForGroup.more.Clear();
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetLfmOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
DEBUG_LOG("CMSG_SET_LOOKING_FOR_MORE");
|
||||
//recv_data.hexlike();
|
||||
uint32 temp, entry, type;
|
||||
uint8 unk1;
|
||||
uint8 unk2[3];
|
||||
|
||||
recv_data >> temp >> unk1 >> unk2[0] >> unk2[1] >> unk2[2];
|
||||
|
||||
entry = ( temp & 0x00FFFFFF);
|
||||
type = ( (temp >> 24) & 0x000000FF);
|
||||
|
||||
_player->m_lookingForGroup.more.Set(entry,type);
|
||||
DEBUG_LOG("LFM set: temp %u, zone %u, type %u", temp, entry, type);
|
||||
|
||||
if(LookingForGroup_auto_add)
|
||||
AttemptAddMore(_player);
|
||||
|
||||
SendLfgResult(type, entry, 1);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetLfgCommentOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
DEBUG_LOG("CMSG_SET_LFG_COMMENT");
|
||||
//recv_data.hexlike();
|
||||
|
||||
std::string comment;
|
||||
recv_data >> comment;
|
||||
DEBUG_LOG("LFG comment %s", comment.c_str());
|
||||
|
||||
_player->m_lookingForGroup.comment = comment;
|
||||
}
|
||||
|
||||
void WorldSession::HandleLookingForGroup(WorldPacket& recv_data)
|
||||
void WorldSession::SendLfgResult(LfgType type, uint32 entry)
|
||||
{
|
||||
DEBUG_LOG("MSG_LOOKING_FOR_GROUP");
|
||||
//recv_data.hexlike();
|
||||
uint32 type, entry, unk;
|
||||
|
||||
recv_data >> type >> entry >> unk;
|
||||
DEBUG_LOG("MSG_LOOKING_FOR_GROUP: type %u, entry %u, unk %u", type, entry, unk);
|
||||
|
||||
if(LookingForGroup_auto_add)
|
||||
AttemptAddMore(_player);
|
||||
|
||||
if(LookingForGroup_auto_join)
|
||||
AttemptJoin(_player);
|
||||
|
||||
SendLfgResult(type, entry, 0);
|
||||
SendLfgUpdate(0, 1, 0);
|
||||
}
|
||||
|
||||
void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
|
||||
{
|
||||
/*uint32 number = 0;
|
||||
|
||||
WorldPacket data(MSG_LOOKING_FOR_GROUP);
|
||||
WorldPacket data(SMSG_LFG_SEARCH_RESULTS);
|
||||
data << uint32(type); // type
|
||||
data << uint32(entry); // entry from LFGDungeons.dbc
|
||||
|
||||
data << uint8(0);
|
||||
if(uint8)
|
||||
uint8 isGuidsPresent = 0;
|
||||
data << uint8(isGuidsPresent);
|
||||
if(isGuidsPresent)
|
||||
{
|
||||
uint32 count1;
|
||||
for(count1)
|
||||
uint32 guids_count = 0;
|
||||
data << uint32(guids_count);
|
||||
for(uint32 i = 0; i < guids_count; ++i)
|
||||
{
|
||||
uint64; // player guid
|
||||
data << uint64(0); // player/group guid
|
||||
}
|
||||
}
|
||||
|
||||
data << uint32(0); // count2
|
||||
data << uint32(0);
|
||||
for(count2)
|
||||
uint32 groups_count = 1;
|
||||
data << uint32(groups_count); // groups count
|
||||
data << uint32(groups_count); // groups count (total?)
|
||||
|
||||
for(uint32 i = 0; i < groups_count; ++i)
|
||||
{
|
||||
uint64 // not player guid
|
||||
uint32 flags;
|
||||
data << uint64(1); // group guid
|
||||
|
||||
uint32 flags = 0x92;
|
||||
data << uint32(flags); // flags
|
||||
|
||||
if(flags & 0x2)
|
||||
{
|
||||
data << uint8(0); // string
|
||||
data << uint8(0); // comment string, max len 256
|
||||
}
|
||||
|
||||
if(flags & 0x10)
|
||||
{
|
||||
data << uint8(0);
|
||||
for(uint32 j = 0; j < 3; ++j)
|
||||
data << uint8(0); // roles
|
||||
}
|
||||
if(flags & 0x20)
|
||||
|
||||
if(flags & 0x80)
|
||||
{
|
||||
for(int i = 0; i < 3; ++i)
|
||||
{
|
||||
data << uint8(0);
|
||||
}
|
||||
data << uint64(0); // instance guid
|
||||
data << uint32(0); // completed encounters
|
||||
}
|
||||
}
|
||||
|
||||
size_t count3_pos = data.wpos();
|
||||
data << uint32(0); // count3
|
||||
data << uint32(0); // unk
|
||||
uint32 playersCount = 2;
|
||||
data << uint32(playersCount); // players count
|
||||
data << uint32(playersCount); // players count (total?)
|
||||
|
||||
//TODO: Guard Player map
|
||||
HashMapHolder<Player>::MapType const& players = sObjectAccessor.GetPlayers();
|
||||
|
|
@ -334,14 +146,9 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
|
|||
if(!plr->IsInWorld())
|
||||
continue;
|
||||
|
||||
if(!plr->m_lookingForGroup.HaveInSlot(entry, type))
|
||||
continue;
|
||||
|
||||
++number;
|
||||
|
||||
data << plr->GetObjectGuid(); // guid
|
||||
|
||||
uint32 flags = 0x1FF;
|
||||
uint32 flags = 0xFF;
|
||||
data << uint32(flags); // flags
|
||||
|
||||
if(flags & 0x1)
|
||||
|
|
@ -350,108 +157,107 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
|
|||
data << uint8(plr->getClass());
|
||||
data << uint8(plr->getRace());
|
||||
|
||||
for(int i = 0; i < 3; ++i)
|
||||
data << uint8(0); // spent talents count in specific tab
|
||||
for(uint32 i = 0; i < 3; ++i)
|
||||
data << uint8(0); // talent spec x/x/x
|
||||
|
||||
data << uint32(0); // resistances1
|
||||
data << uint32(0); // armor
|
||||
data << uint32(0); // spd/heal
|
||||
data << uint32(0); // spd/heal
|
||||
data << uint32(0); // combat_rating9
|
||||
data << uint32(0); // combat_rating10
|
||||
data << uint32(0); // combat_rating11
|
||||
data << float(0); // mp5
|
||||
data << float(0); // unk
|
||||
data << uint32(0); // attack power
|
||||
data << uint32(0); // stat1
|
||||
data << uint32(0); // maxhealth
|
||||
data << uint32(0); // maxpower1
|
||||
data << uint32(0); // unk
|
||||
data << float(0); // unk
|
||||
data << uint32(0); // unk
|
||||
data << uint32(0); // unk
|
||||
data << uint32(0); // unk
|
||||
data << uint32(0); // unk
|
||||
data << uint32(0); // combat_rating20
|
||||
data << uint32(0); // unk
|
||||
data << uint32(0); // HasteMelee
|
||||
data << uint32(0); // HasteRanged
|
||||
data << uint32(0); // HasteSpell
|
||||
data << float(0); // MP5
|
||||
data << float(0); // MP5 Combat
|
||||
data << uint32(0); // AttackPower
|
||||
data << uint32(0); // Agility
|
||||
data << uint32(0); // Health
|
||||
data << uint32(0); // Mana
|
||||
data << uint32(0); // Unk1
|
||||
data << float(0); // Unk2
|
||||
data << uint32(0); // Defence
|
||||
data << uint32(0); // Dodge
|
||||
data << uint32(0); // Block
|
||||
data << uint32(0); // Parry
|
||||
data << uint32(0); // Crit
|
||||
data << uint32(0); // Expertise
|
||||
}
|
||||
|
||||
if(flags & 0x2)
|
||||
data << plr->m_lookingForGroup.comment; // comment
|
||||
data << ""; // comment
|
||||
|
||||
if(flags & 0x4)
|
||||
data << uint8(0); // unk
|
||||
data << uint8(0); // group leader
|
||||
|
||||
if(flags & 0x8)
|
||||
data << uint64(0); // guid from count2 block, not player guid
|
||||
data << uint64(1); // group guid
|
||||
|
||||
if(flags & 0x10)
|
||||
data << uint8(0); // unk
|
||||
data << uint8(0); // roles
|
||||
|
||||
if(flags & 0x20)
|
||||
data << uint8(plr->m_lookingForGroup.roles); // roles
|
||||
|
||||
if(flags & 0x40)
|
||||
data << uint32(plr->GetZoneId()); // areaid
|
||||
|
||||
if(flags & 0x100)
|
||||
data << uint8(0); // LFG/LFM flag?
|
||||
if(flags & 0x40)
|
||||
data << uint8(0); // status
|
||||
|
||||
if(flags & 0x80)
|
||||
{
|
||||
for(uint8 j = 0; j < MAX_LOOKING_FOR_GROUP_SLOT; ++j)
|
||||
data << uint64(0); // instance guid
|
||||
data << uint32(0); // completed encounters
|
||||
}
|
||||
}
|
||||
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::SendLfgJoinResult(LfgJoinResult result)
|
||||
{
|
||||
WorldPacket data(SMSG_LFG_JOIN_RESULT, 0);
|
||||
data << uint32(result);
|
||||
data << uint32(0); // ERR_LFG_ROLE_CHECK_FAILED_TIMEOUT = 3, ERR_LFG_ROLE_CHECK_FAILED_NOT_VIABLE = (value - 3 == result)
|
||||
|
||||
if(result == ERR_LFG_NO_SLOTS_PARTY)
|
||||
{
|
||||
uint8 count1 = 0;
|
||||
data << uint8(count1); // players count?
|
||||
for(uint32 i = 0; i < count1; ++i)
|
||||
{
|
||||
data << uint64(0); // player guid?
|
||||
uint32 count2 = 0;
|
||||
for(uint32 j = 0; j < count2; ++j)
|
||||
{
|
||||
data << uint32(plr->m_lookingForGroup.slots[j].entry | (plr->m_lookingForGroup.slots[j].type << 24));
|
||||
data << uint32(0); // dungeon id/type
|
||||
data << uint32(0); // lock status?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data.put<uint32>(count3_pos, number); // fill count placeholder
|
||||
|
||||
SendPacket(&data);*/
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
void WorldSession::HandleSetLfgOpcode( WorldPacket & recv_data )
|
||||
void WorldSession::SendLfgUpdate(uint8 type)
|
||||
{
|
||||
DEBUG_LOG("CMSG_SET_LOOKING_FOR_GROUP");
|
||||
recv_data.hexlike();
|
||||
uint32 slot, temp, entry, type;
|
||||
uint8 roles, unk1;
|
||||
|
||||
recv_data >> slot >> temp >> roles >> unk1;
|
||||
|
||||
entry = ( temp & 0x00FFFFFF);
|
||||
type = ( (temp >> 24) & 0x000000FF);
|
||||
|
||||
if(slot >= MAX_LOOKING_FOR_GROUP_SLOT)
|
||||
return;
|
||||
|
||||
_player->m_lookingForGroup.slots[slot].Set(entry, type);
|
||||
_player->m_lookingForGroup.roles = roles;
|
||||
DEBUG_LOG("LFG set: looknumber %u, temp %X, type %u, entry %u", slot, temp, type, entry);
|
||||
|
||||
if(LookingForGroup_auto_join)
|
||||
AttemptJoin(_player);
|
||||
|
||||
//SendLfgResult(type, entry, 0);
|
||||
SendLfgUpdate(0, 1, 0);
|
||||
}
|
||||
|
||||
void WorldSession::HandleLfgSetRoles(WorldPacket &recv_data)
|
||||
{
|
||||
DEBUG_LOG("CMSG_LFG_SET_ROLES");
|
||||
|
||||
uint8 roles;
|
||||
recv_data >> roles;
|
||||
|
||||
_player->m_lookingForGroup.roles = roles;
|
||||
}
|
||||
|
||||
void WorldSession::SendLfgUpdate(uint8 /*unk1*/, uint8 /*unk2*/, uint8 /*unk3*/)
|
||||
{
|
||||
// disabled
|
||||
/*WorldPacket data(SMSG_LFG_UPDATE, 3);
|
||||
data << uint8(unk1);
|
||||
data << uint8(unk2);
|
||||
data << uint8(unk3);
|
||||
SendPacket(&data);*/
|
||||
WorldPacket data(type ? SMSG_LFG_UPDATE_PLAYER : SMSG_LFG_UPDATE_PARTY, 0);
|
||||
uint8 updateType = 5;
|
||||
data << uint8(updateType);
|
||||
uint8 extra = 1;
|
||||
data << uint8(extra);
|
||||
if(extra)
|
||||
{
|
||||
data << uint8(0);
|
||||
data << uint8(0);
|
||||
data << uint8(0);
|
||||
if(!type)
|
||||
{
|
||||
data << uint8(0);
|
||||
for(uint32 i = 0; i < 3; ++i)
|
||||
data << uint8(0);
|
||||
}
|
||||
uint8 count = 1;
|
||||
data << count;
|
||||
for(uint32 i = 0; i < count; ++i)
|
||||
data << uint32(0x02000166);
|
||||
data << "";
|
||||
}
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -688,7 +688,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
|
|||
/*0x293*/ { "SMSG_LFG_OFFER_CONTINUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x294*/ { "CMSG_MEETINGSTONE_CHEAT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x295*/ { "SMSG_MEETINGSTONE_SETQUEUE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x296*/ { "CMSG_MEETINGSTONE_INFO", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleMeetingStoneInfoOpcode },
|
||||
/*0x296*/ { "CMSG_LFG_GET_STATUS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x297*/ { "SMSG_MEETINGSTONE_COMPLETE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x298*/ { "SMSG_MEETINGSTONE_IN_PROGRESS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x299*/ { "SMSG_MEETINGSTONE_MEMBER_ADDED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
|
|
@ -904,10 +904,10 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
|
|||
/*0x36B*/ { "CMSG_LFG_SET_NEEDS", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x36C*/ { "CMSG_LFG_SET_BOOT_VOTE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x36D*/ { "SMSG_LFG_BOOT_PLAYER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x36E*/ { "CMSG_LFD_PLAYER_LOCK_INFO_REQUEST", STATUS_UNHANDLED,PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x36E*/ { "CMSG_LFG_GET_PLAYER_INFO", STATUS_UNHANDLED,PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x36F*/ { "SMSG_LFG_PLAYER_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x370*/ { "CMSG_LFG_TELEPORT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x371*/ { "CMSG_LFD_PARTY_LOCK_INFO_REQUEST", STATUS_UNHANDLED,PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x371*/ { "CMSG_LFG_GET_PARTY_INFO", STATUS_UNHANDLED,PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x372*/ { "SMSG_LFG_PARTY_INFO", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x373*/ { "SMSG_TITLE_EARNED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x374*/ { "CMSG_SET_TITLE", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleSetTitleOpcode },
|
||||
|
|
@ -1234,8 +1234,8 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] =
|
|||
/*0x4B5*/ { "SMSG_ITEM_REFUND_RESULT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4B6*/ { "CMSG_CORPSE_MAP_POSITION_QUERY", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleCorpseMapPositionQueryOpcode},
|
||||
/*0x4B7*/ { "SMSG_CORPSE_MAP_POSITION_QUERY_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4B8*/ { "CMSG_LFG_SET_ROLES_2", STATUS_LOGGEDIN, PROCESS_THREADUNSAFE, &WorldSession::HandleLfgSetRoles },
|
||||
/*0x4B9*/ { "UMSG_UNKNOWN_1209", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4B8*/ { "CMSG_UNUSED5", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4B9*/ { "CMSG_UNUSED6", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4BA*/ { "CMSG_CALENDAR_CONTEXT_EVENT_SIGNUP", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL },
|
||||
/*0x4BB*/ { "SMSG_CALENDAR_ACTION_PENDING", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
/*0x4BC*/ { "SMSG_EQUIPMENT_SET_LIST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide },
|
||||
|
|
|
|||
|
|
@ -415,55 +415,6 @@ enum LfgRoles
|
|||
DAMAGE = 0x08
|
||||
};
|
||||
|
||||
struct LookingForGroupSlot
|
||||
{
|
||||
LookingForGroupSlot() : entry(0), type(0) {}
|
||||
bool Empty() const { return !entry && !type; }
|
||||
void Clear() { entry = 0; type = 0; }
|
||||
void Set(uint32 _entry, uint32 _type ) { entry = _entry; type = _type; }
|
||||
bool Is(uint32 _entry, uint32 _type) const { return entry == _entry && type == _type; }
|
||||
bool canAutoJoin() const { return entry && (type == LFG_TYPE_DUNGEON || type == LFG_TYPE_HEROIC_DUNGEON); }
|
||||
|
||||
uint32 entry;
|
||||
uint32 type;
|
||||
};
|
||||
|
||||
#define MAX_LOOKING_FOR_GROUP_SLOT 3
|
||||
|
||||
struct LookingForGroup
|
||||
{
|
||||
LookingForGroup() {}
|
||||
bool HaveInSlot(LookingForGroupSlot const& slot) const { return HaveInSlot(slot.entry, slot.type); }
|
||||
bool HaveInSlot(uint32 _entry, uint32 _type) const
|
||||
{
|
||||
for(int i = 0; i < MAX_LOOKING_FOR_GROUP_SLOT; ++i)
|
||||
if(slots[i].Is(_entry, _type))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool canAutoJoin() const
|
||||
{
|
||||
for(int i = 0; i < MAX_LOOKING_FOR_GROUP_SLOT; ++i)
|
||||
if(slots[i].canAutoJoin())
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Empty() const
|
||||
{
|
||||
for(int i = 0; i < MAX_LOOKING_FOR_GROUP_SLOT; ++i)
|
||||
if(!slots[i].Empty())
|
||||
return false;
|
||||
return more.Empty();
|
||||
}
|
||||
|
||||
LookingForGroupSlot slots[MAX_LOOKING_FOR_GROUP_SLOT];
|
||||
LookingForGroupSlot more;
|
||||
std::string comment;
|
||||
uint8 roles;
|
||||
};
|
||||
|
||||
enum RaidGroupError
|
||||
{
|
||||
ERR_RAID_GROUP_NONE = 0,
|
||||
|
|
@ -2303,8 +2254,6 @@ class MANGOS_DLL_SPEC Player : public Unit
|
|||
void SetAtLoginFlag(AtLoginFlags f) { m_atLoginFlags |= f; }
|
||||
void RemoveAtLoginFlag(AtLoginFlags f, bool in_db_also = false);
|
||||
|
||||
LookingForGroup m_lookingForGroup;
|
||||
|
||||
// Temporarily removed pet cache
|
||||
uint32 GetTemporaryUnsummonedPetNumber() const { return m_temporaryUnsummonedPetNumber; }
|
||||
void SetTemporaryUnsummonedPetNumber(uint32 petnumber) { m_temporaryUnsummonedPetNumber = petnumber; }
|
||||
|
|
|
|||
|
|
@ -81,8 +81,7 @@ bool WorldSessionFilter::Process(WorldPacket* packet)
|
|||
|
||||
/// WorldSession constructor
|
||||
WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8 expansion, time_t mute_time, LocaleConstant locale) :
|
||||
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
|
||||
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion), _logoutTime(0),
|
||||
m_muteTime(mute_time), _player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion), _logoutTime(0),
|
||||
m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_playerSave(false),
|
||||
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(sObjectMgr.GetIndexForLocale(locale)),
|
||||
m_latency(0), m_tutorialState(TUTORIALDATA_UNCHANGED)
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ class MovementInfo;
|
|||
class WorldSession;
|
||||
|
||||
struct OpcodeHandler;
|
||||
enum LfgType;
|
||||
|
||||
enum AccountDataType
|
||||
{
|
||||
|
|
@ -129,6 +130,28 @@ enum PartyResult
|
|||
ERR_PARTY_LFG_TELEPORT_IN_COMBAT = 30
|
||||
};
|
||||
|
||||
enum LfgJoinResult
|
||||
{
|
||||
ERR_LFG_OK = 0x00,
|
||||
ERR_LFG_ROLE_CHECK_FAILED = 0x01,
|
||||
ERR_LFG_GROUP_FULL = 0x02,
|
||||
ERR_LFG_NO_LFG_OBJECT = 0x04,
|
||||
ERR_LFG_NO_SLOTS_PLAYER = 0x05,
|
||||
ERR_LFG_NO_SLOTS_PARTY = 0x06,
|
||||
ERR_LFG_MISMATCHED_SLOTS = 0x07,
|
||||
ERR_LFG_PARTY_PLAYERS_FROM_DIFFERENT_REALMS = 0x08,
|
||||
ERR_LFG_MEMBERS_NOT_PRESENT = 0x09,
|
||||
ERR_LFG_GET_INFO_TIMEOUT = 0x0A,
|
||||
ERR_LFG_INVALID_SLOT = 0x0B,
|
||||
ERR_LFG_DESERTER_PLAYER = 0x0C,
|
||||
ERR_LFG_DESERTER_PARTY = 0x0D,
|
||||
ERR_LFG_RANDOM_COOLDOWN_PLAYER = 0x0E,
|
||||
ERR_LFG_RANDOM_COOLDOWN_PARTY = 0x0F,
|
||||
ERR_LFG_TOO_MANY_MEMBERS = 0x10,
|
||||
ERR_LFG_CANT_USE_DUNGEONS = 0x11,
|
||||
ERR_LFG_ROLE_CHECK_FAILED2 = 0x12,
|
||||
};
|
||||
|
||||
enum ChatRestrictionType
|
||||
{
|
||||
ERR_CHAT_RESTRICTED = 0,
|
||||
|
|
@ -158,6 +181,7 @@ class PacketFilter
|
|||
protected:
|
||||
WorldSession * const m_pSession;
|
||||
};
|
||||
|
||||
//process only thread-safe packets in Map::Update()
|
||||
class MapSessionFilter : public PacketFilter
|
||||
{
|
||||
|
|
@ -202,8 +226,9 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
void SendNotification(const char *format,...) ATTR_PRINTF(2,3);
|
||||
void SendNotification(int32 string_id,...);
|
||||
void SendPetNameInvalid(uint32 error, const std::string& name, DeclinedName *declinedName);
|
||||
void SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type);
|
||||
void SendLfgUpdate(uint8 unk1, uint8 unk2, uint8 unk3);
|
||||
void SendLfgResult(LfgType type, uint32 entry);
|
||||
void SendLfgJoinResult(LfgJoinResult result);
|
||||
void SendLfgUpdate(uint8 type);
|
||||
void SendPartyResult(PartyOperation operation, const std::string& member, PartyResult res);
|
||||
void SendAreaTriggerMessage(const char* Text, ...) ATTR_PRINTF(2,3);
|
||||
void SendSetPhaseShift(uint32 phaseShift);
|
||||
|
|
@ -331,11 +356,6 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
void SendPetitionShowList(ObjectGuid guid);
|
||||
void SendSaveGuildEmblem( uint32 msg );
|
||||
|
||||
// Looking For Group
|
||||
// TRUE values set by client sending CMSG_LFG_SET_AUTOJOIN and CMSG_LFM_CLEAR_AUTOFILL before player login
|
||||
bool LookingForGroup_auto_join;
|
||||
bool LookingForGroup_auto_add;
|
||||
|
||||
void BuildPartyMemberStatsChangedPacket(Player *player, WorldPacket *data);
|
||||
|
||||
void DoLootRelease(ObjectGuid lguid);
|
||||
|
|
@ -372,7 +392,6 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
// new
|
||||
void HandleMoveUnRootAck(WorldPacket& recvPacket);
|
||||
void HandleMoveRootAck(WorldPacket& recvPacket);
|
||||
void HandleLookingForGroup(WorldPacket& recvPacket);
|
||||
|
||||
// new inspect
|
||||
void HandleInspectOpcode(WorldPacket& recvPacket);
|
||||
|
|
@ -452,7 +471,6 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
void HandleSetActionButtonOpcode(WorldPacket& recvPacket);
|
||||
|
||||
void HandleGameObjectUseOpcode(WorldPacket& recPacket);
|
||||
void HandleMeetingStoneInfoOpcode(WorldPacket& recPacket);
|
||||
void HandleGameobjectReportUse(WorldPacket& recvPacket);
|
||||
|
||||
void HandleNameQueryOpcode(WorldPacket& recvPacket);
|
||||
|
|
@ -722,7 +740,6 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
void HandleMinimapPingOpcode(WorldPacket& recv_data);
|
||||
void HandleRandomRollOpcode(WorldPacket& recv_data);
|
||||
void HandleFarSightOpcode(WorldPacket& recv_data);
|
||||
void HandleSetLfgOpcode(WorldPacket& recv_data);
|
||||
void HandleSetDungeonDifficultyOpcode(WorldPacket& recv_data);
|
||||
void HandleSetRaidDifficultyOpcode(WorldPacket& recv_data);
|
||||
void HandleMoveSetCanFlyAckOpcode(WorldPacket& recv_data);
|
||||
|
|
@ -730,11 +747,7 @@ class MANGOS_DLL_SPEC WorldSession
|
|||
void HandleLfgLeaveOpcode(WorldPacket& recv_data);
|
||||
void HandleSearchLfgJoinOpcode(WorldPacket& recv_data);
|
||||
void HandleSearchLfgLeaveOpcode(WorldPacket& recv_data);
|
||||
void HandleLfgClearOpcode(WorldPacket& recv_data);
|
||||
void HandleLfmClearOpcode(WorldPacket& recv_data);
|
||||
void HandleSetLfmOpcode(WorldPacket& recv_data);
|
||||
void HandleSetLfgCommentOpcode(WorldPacket& recv_data);
|
||||
void HandleLfgSetRoles(WorldPacket& recv_data);
|
||||
void HandleSetTitleOpcode(WorldPacket& recv_data);
|
||||
void HandleRealmSplitOpcode(WorldPacket& recv_data);
|
||||
void HandleTimeSyncResp(WorldPacket& recv_data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue