本文整理汇总了C++中Channel::AttemptJoin方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::AttemptJoin方法的具体用法?C++ Channel::AttemptJoin怎么用?C++ Channel::AttemptJoin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::AttemptJoin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleChannelJoin
void WorldSession::HandleChannelJoin(WorldPacket& recvPacket)
{
CHECK_INWORLD_RETURN
CHECK_PACKET_SIZE(recvPacket, 1);
std::string channelname, pass;
uint32 channel_id;
recvPacket >> channel_id;
recvPacket.readBit(); // has voice
recvPacket.readBit(); // zone update
uint8 channelLength = recvPacket.readBits(8);
uint8 passwordLength = recvPacket.readBits(8);
channelname = recvPacket.ReadString(channelLength);
pass = recvPacket.ReadString(passwordLength);
if (sWorld.settings.gm.gmClientChannelName.size() && !stricmp(sWorld.settings.gm.gmClientChannelName.c_str(), channelname.c_str()) && !GetPermissionCount())
return;
Channel* channel = channelmgr.GetCreateChannel(channelname.c_str(), _player, channel_id);
if (channel == nullptr)
return;
channel->AttemptJoin(_player, pass.c_str());
LogDebugFlag(LF_OPCODE, "ChannelJoin %s", channelname.c_str());
}
示例2: HandleChannelJoin
void WorldSession::HandleChannelJoin(WorldPacket& recvPacket)
{
CHECK_INWORLD_RETURN
CHECK_PACKET_SIZE(recvPacket, 1);
std::string channelname, pass;
uint32 dbc_id = 0;
uint16 crap; // crap = some sort of channel type?
Channel* chn;
recvPacket >> dbc_id >> crap;
recvPacket >> channelname;
recvPacket >> pass;
if (sWorld.GmClientChannel.size() && !stricmp(sWorld.GmClientChannel.c_str(), channelname.c_str()) && !GetPermissionCount())
return;
chn = channelmgr.GetCreateChannel(channelname.c_str(), _player, dbc_id);
if (chn == NULL)
return;
chn->AttemptJoin(_player, pass.c_str());
Log.Debug("ChannelJoin", "%s", channelname.c_str());
}
示例3: HandleChannelJoin
void WorldSession::HandleChannelJoin(WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket, 1);
string channelname,pass;
uint32 dbc_id = 0;
uint16 crap; // crap = some sort of channel type?
uint32 i;
Channel * chn;
recvPacket >> dbc_id >> crap;
recvPacket >> channelname;
recvPacket >> pass;
if(!stricmp(channelname.c_str(), "LookingForGroup") && !sWorld.m_lfgForNonLfg)
{
// make sure we have lfg dungeons
for(i = 0; i < 3; ++i)
{
if(_player->LfgDungeonId[i] != 0)
break;
}
if(i == 3)
return; // don't join lfg
}
if( sWorld.GmClientChannel.size() && !stricmp(sWorld.GmClientChannel.c_str(), channelname.c_str()) && !GetPermissionCount())
return;
chn = channelmgr.GetCreateChannel(channelname.c_str(), _player, dbc_id);
if(chn == NULL)
return;
chn->AttemptJoin(_player, pass.c_str());
Log.Debug("ChannelJoin", "%s", channelname.c_str());
}
示例4: HandleChannelJoin
void WorldSession::HandleChannelJoin(WorldPacket& recvPacket)
{
CHECK_PACKET_SIZE(recvPacket, 1);
string channelname,pass;
uint32 dbc_id = 0;
uint16 crap; // crap = some sort of channel type? Actually it seems that this is 2 bytes and not 1 uint16
Channel * chn;
recvPacket >> crap; // seems like 00 and 01
recvPacket >> dbc_id;
recvPacket >> channelname;
recvPacket >> pass;
if(!stricmp(channelname.c_str(), "LookingForGroup") && !sWorld.m_lfgForNonLfg)
{
/* // make sure we have lfg dungeons
for(uint32 i = 0; i < MAX_LFG_QUEUE_ID; ++i)
{
if(_player->LfgDungeonId[i] != 0)
break;
}
if(i == MAX_LFG_QUEUE_ID)
return; // don't join lfg
*/
//are we looking to any dungeons at all ?
if( _player->LFG_dungeons.begin() == NULL )
return;
}
if( sWorld.GmClientChannel.size() && !stricmp(sWorld.GmClientChannel.c_str(), channelname.c_str()) && !GetPermissionCount())
{
return;
}
chn = channelmgr.GetCreateChannel(channelname.c_str(), _player, dbc_id);
if(chn == NULL)
{
return;
}
chn->AttemptJoin(_player, pass.c_str());
Log.Debug("ChannelJoin", "%s", channelname.c_str());
}