本文整理汇总了C++中Channel::Say方法的典型用法代码示例。如果您正苦于以下问题:C++ Channel::Say方法的具体用法?C++ Channel::Say怎么用?C++ Channel::Say使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Channel
的用法示例。
在下文中一共展示了Channel::Say方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleGMTicketListCommand
bool ChatHandler::HandleGMTicketListCommand(const char* args, WorldSession *m_session)
{
Player *cplr = m_session->GetPlayer();
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), cplr);
if(!chn)
return false;
chn->Say(cplr, "GmTicket 2", cplr, true);
for(GmTicketList::iterator itr = objmgr.GM_TicketList.begin(); itr != objmgr.GM_TicketList.end(); itr++)
{
if((*itr)->deleted)
continue;
Player* plr = objmgr.GetPlayer((uint32)(*itr)->playerGuid);
if( plr == NULL )
continue;
// Player* aplr = ((*itr)->assignedToPlayer == 0 ? NULL : objmgr.GetPlayer((uint32)(*itr)->assignedToPlayer));
std::stringstream ss;
uint32 zone = 0;
if(plr->IsInWorld())
{
zone = plr->GetZoneId();
}
ss << "GmTicket 0," << (*itr)->name << "," << (*itr)->level << ",0," << zone;
chn->Say(cplr, ss.str().c_str(), cplr, true);
}
return true;
}
示例2: HandleGMTicketGetByIdCommand
bool ChatHandler::HandleGMTicketGetByIdCommand(const char* args, WorldSession *m_session)
{
uint64 ticketGuid = (args ? atoi(args) : 0);
if(!ticketGuid)
{
RedSystemMessage(m_session, "You must specify a ticket id.");
return true;
}
Player *cplr = m_session->GetPlayer();
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), cplr);
if(!chn)
return false;
GM_Ticket *ticket = objmgr.GetGMTicket(ticketGuid);
if(ticket == NULL || ticket->deleted)
{
chn->Say(cplr, "GmTicket:0:Ticket not found.", cplr, true);
return true;
}
char* msg = new char[ticket->message.size() + 1];
strcpy(msg, ticket->message.c_str());
char * start = msg, *end;
bool firstLine = true;
for(;;)
{
end = strchr(start, '\n');
if(!end)
break;
*end = '\0';
std::stringstream ss;
ss << "GmTicket:" << (firstLine ? GM_TICKET_CHAT_OPCODE_CONTENT : GM_TICKET_CHAT_OPCODE_APPENDCONTENT);
ss << ":" << ticket->guid;
ss << ":" << start;
chn->Say(cplr, ss.str().c_str(), cplr, true);
firstLine = false;
start = end + 1;
}
if(*start != '\0')
{
std::stringstream ss;
ss << "GmTicket:" << (firstLine ? GM_TICKET_CHAT_OPCODE_CONTENT : GM_TICKET_CHAT_OPCODE_APPENDCONTENT);
ss << ":" << ticket->guid;
ss << ":" << start;
chn->Say(cplr, ss.str().c_str(), cplr, true);
}
delete[] msg;
return true;
}
示例3: HandleGMTicketDeletePermanentCommand
bool ChatHandler::HandleGMTicketDeletePermanentCommand(const char* args, WorldSession* m_session)
{
uint64 ticketGuid = (args ? atoi(args) : 0);
if(!ticketGuid)
{
RedSystemMessage(m_session, "You must specify a ticket id.");
return true;
}
Player* cplr = m_session->GetPlayer();
Channel* chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), cplr);
if(!chn)
return false;
GM_Ticket* ticket = objmgr.GetGMTicket(ticketGuid);
if(ticket == NULL)
{
chn->Say(cplr, "GmTicket:0:Ticket not found.", cplr, true);
return true;
}
Player* plr = NULL;
if(!ticket->deleted)
{
plr = objmgr.GetPlayer((uint32)ticket->playerGuid);
std::stringstream ss;
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_REMOVED;
ss << ":" << ticket->guid;
chn->Say(cplr, ss.str().c_str(), NULL, true);
objmgr.RemoveGMTicket(ticket->guid);
}
objmgr.DeleteGMTicketPermanently(ticket->guid);
ticket = NULL;
if(plr != NULL && plr->IsInWorld())
{
// Notify player about removing ticket
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
data << uint32(9);
plr->GetSession()->SendPacket(&data);
// Response - Send GM Survey
WorldPacket datab(SMSG_GM_TICKET_STATUS_UPDATE, 1);
datab << uint32(3);
plr->GetSession()->SendPacket(&datab);
//plr->GetSession()->GetPlayer()->OutPacketToSet( SMSG_GM_TICKET_STATUS_UPDATE, 1, SENDSURVEY,true);
SystemMessageToPlr(plr, "You have been selected to fill out a GM Performance Survey. Please respond truthfully to the questions that you are asked and include the Game Masters name to your comment.");
}
return true;
}
示例4: HandleGMTicketCommentCommand
bool ChatHandler::HandleGMTicketCommentCommand(const char* args, WorldSession *m_session)
{
uint64 ticketGuid;
int argc = 1;
char* comment = NULL;
char* guidString = (char*)args;
// Parse arguments
char* space = (char*)strchr(args, ' ');
if(space)
{
*space = '\0';
comment = space + 1;
argc = 2;
}
ticketGuid = atoi(guidString);
if(!ticketGuid)
{
RedSystemMessage(m_session, "You must specify a ticket id.");
return true;
}
Player *cplr = m_session->GetPlayer();
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), cplr);
if(!chn)
return false;
GM_Ticket *ticket = objmgr.GetGMTicket(ticketGuid);
if(ticket == NULL || ticket->deleted)
{
chn->Say(cplr, "GmTicket:0:Ticket not found.", cplr, true);
return true;
}
if(ticket->assignedToPlayer != 0 && ticket->assignedToPlayer != cplr->GetGUID() && !cplr->GetSession()->CanUseCommand('z'))
{
chn->Say(cplr, "GmTicket:0:Ticket is assigned to another GM.", cplr, true);
return true;
}
ticket->comment = (argc == 1 ? "" : comment);
objmgr.UpdateGMTicket(ticket);
std::stringstream ss;
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_COMMENT;
ss << ":" << ticket->guid;
ss << ":" << cplr->GetName();
ss << ":" << ticket->comment;
chn->Say(cplr, ss.str().c_str(), NULL, true);
return true;
}
示例5: HandleGMTicketRemoveByIdCommand
bool ChatHandler::HandleGMTicketRemoveByIdCommand(const char* args, WorldSession *m_session)
{
uint64 ticketGuid = (args ? atoi(args) : 0);
if(!ticketGuid)
{
RedSystemMessage(m_session, "You must specify a ticket id.");
return true;
}
Player *cplr = m_session->GetPlayer();
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), cplr);
if(!chn)
return false;
GM_Ticket *ticket = objmgr.GetGMTicket(ticketGuid);
if(ticket == NULL || ticket->deleted)
{
chn->Say(cplr, "GmTicket:0:Ticket not found.", cplr, true);
return true;
}
if(ticket->assignedToPlayer != 0 && ticket->assignedToPlayer != cplr->GetGUID() && !cplr->GetSession()->CanUseCommand('z'))
{
chn->Say(cplr, "GmTicket:0:Ticket is assigned to another GM.", cplr, true);
return true;
}
Player* plr = objmgr.GetPlayer((uint32)ticket->playerGuid);
std::stringstream ss;
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_REMOVED;
ss << ":" << ticket->guid;
chn->Say(cplr, ss.str().c_str(), NULL, true);
objmgr.RemoveGMTicket(ticket->guid);
if(!plr)
return true;
if(!plr->IsInWorld())
return true;
// Notify player about removing ticket
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
data << uint32(9);
plr->GetSession()->SendPacket( &data );
return true;
}
示例6: HandleGMTicketCreateOpcode
void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
{
CHECK_INWORLD_RETURN
uint32 map;
float x, y, z;
std::string message = "";
std::string message2 = "";
GM_Ticket *ticket = new GM_Ticket;
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
// recv Data
recv_data >> map;
recv_data >> x;
recv_data >> y;
recv_data >> z;
recv_data >> message;
recv_data >> message2;
// Remove pending tickets
objmgr.RemoveGMTicketByPlayer(GetPlayer()->GetGUID());
ticket->guid = uint64( objmgr.GenerateTicketID() );
ticket->playerGuid = GetPlayer()->GetGUID();
ticket->map = map;
ticket->posX = x;
ticket->posY = y;
ticket->posZ = z;
ticket->message = message;
ticket->timestamp = (uint32)UNIXTIME;
ticket->name = GetPlayer()->GetName();
ticket->level = GetPlayer()->getLevel();
ticket->deleted = false;
ticket->assignedToPlayer = 0;
ticket->comment = "";
// Add a new one
objmgr.AddGMTicket(ticket, false);
// Response - no errors
data << uint32(2);
SendPacket(&data);
// send message indicating new ticket
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(),GetPlayer());
if(chn)
{
std::stringstream ss;
#ifdef GM_TICKET_MY_MASTER_COMPATIBLE
ss << "GmTicket 5, " << ticket->name;
#else
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_NEWTICKET;
ss << ":" << ticket->guid;
ss << ":" << ticket->level;
ss << ":" << ticket->name;
#endif
chn->Say(_player, ss.str().c_str(), NULL, true);
}
}
示例7: HandleGMTicketDeleteOpcode
void WorldSession::HandleGMTicketDeleteOpcode(WorldPacket & recv_data)
{
CHECK_INWORLD_RETURN
GM_Ticket* ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
// Remove Tickets from Player
objmgr.RemoveGMTicketByPlayer(GetPlayer()->GetGUID());
// Response - no errors
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
data << uint32(9);
SendPacket(&data);
// send message to gm_sync_chan
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), GetPlayer());
if(chn && ticket != NULL)
{
std::stringstream ss;
#ifdef GM_TICKET_MY_MASTER_COMPATIBLE
ss << "GmTicket 1," << ticket->name;
#else
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_REMOVED;
ss << ":" << ticket->guid;
#endif
chn->Say(_player, ss.str().c_str(), NULL, true);
}
}
示例8: HandleGMTicketReleaseCommand
bool ChatHandler::HandleGMTicketReleaseCommand(const char* args, WorldSession *m_session)
{
uint64 ticketGuid = (args ? atoi(args) : 0);
if(!ticketGuid)
{
RedSystemMessage(m_session, "You must specify a ticket id.");
return true;
}
Player *cplr = m_session->GetPlayer();
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), cplr);
if(!chn)
return false;
GM_Ticket *ticket = objmgr.GetGMTicket(ticketGuid);
if(ticket == NULL || ticket->deleted)
{
chn->Say(cplr, "GmTicket:0:Ticket not found.", cplr, true);
return true;
}
if(ticket->assignedToPlayer == 0)
{
chn->Say(cplr, "GmTicket:0:Ticket not assigned to a GM.", cplr, true);
return true;
}
Player *plr = objmgr.GetPlayer((uint32)ticket->assignedToPlayer);
if(!cplr->GetSession()->CanUseCommand('z') && plr != NULL && plr->IsInWorld() && plr->GetSession()->CanUseCommand('z'))
{
chn->Say(cplr, "GmTicket:0:You can not release tickets from admins.", cplr, true);
return true;
}
ticket->assignedToPlayer = 0;
objmgr.UpdateGMTicket(ticket);
std::stringstream ss;
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_RELEASED;
ss << ":" << ticket->guid;
chn->Say(cplr, ss.str().c_str(), NULL, true);
return true;
}
示例9: HandleGMTicketRemoveByIdCommand
bool ChatHandler::HandleGMTicketRemoveByIdCommand(const char* args, WorldSession* m_session)
{
if(!*args)
return false;
Player* cplr = m_session->GetPlayer();
Channel* chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), cplr);
if(!chn)
return false;
Player* plr = objmgr.GetPlayer(args, true);
if(plr == NULL)
{
RedSystemMessage(m_session, "Player not found.");
return true;
}
GM_Ticket* ticket = objmgr.GetGMTicketByPlayer(plr->GetGUID());
if(ticket == NULL || ticket->deleted)
{
RedSystemMessage(m_session, "Ticket not found.");
return true;
}
std::stringstream ss;
ss << "GmTicket 1," << ticket->name;
chn->Say(cplr, ss.str().c_str(), NULL, true);
objmgr.RemoveGMTicket(ticket->guid);
if(!plr)
return true;
if(!plr->IsInWorld())
return true;
// Notify player about removing ticket
WorldPacket data(SMSG_GMTICKET_DELETETICKET, 4);
data << uint32(9);
plr->GetSession()->SendPacket(&data);
// Response - Send GM Survey
WorldPacket datab(SMSG_GM_TICKET_STATUS_UPDATE, 1);
datab << uint32(3);
plr->GetSession()->SendPacket(&datab);
return true;
}
示例10: HandleGMTicketUpdateOpcode
void WorldSession::HandleGMTicketUpdateOpcode(WorldPacket & recv_data)
{
CHECK_INWORLD_RETURN
std::string message = "";
WorldPacket data(SMSG_GMTICKET_UPDATETEXT, 4);
// recv Data
recv_data >> message;
// Update Ticket
GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(GetPlayer()->GetGUID());
if(!ticket) // Player doesn't have a GM Ticket yet
{
// Response - error couldn't find existing Ticket
data << uint32(1);
SendPacket(&data);
return;
}
ticket->message = message;
ticket->timestamp = (uint32)UNIXTIME;
objmgr.UpdateGMTicket(ticket);
// Response - no errors
data << uint32(2);
SendPacket(&data);
#ifndef GM_TICKET_MY_MASTER_COMPATIBLE
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(),GetPlayer());
if(chn)
{
std::stringstream ss;
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_UPDATED;
ss << ":" << ticket->guid;
chn->Say(_player, ss.str().c_str(), NULL, true);
}
#endif
}
示例11: HandleGMTicketCreateOpcode
void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
{
uint32 type;
float x, y, z;
std::string message = "";
std::string message2 = "";
GM_Ticket *ticket = new GM_Ticket;
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
// recv Data
recv_data >> type;
recv_data >> x;
recv_data >> y;
recv_data >> z;
recv_data >> message;
recv_data >> message2;
// Create new Ticket and store it
objmgr.remGMTicket(GetPlayer()->GetGUID());
ticket->guid = GetPlayer()->GetGUID();
ticket->type = type;
ticket->posX = x;
ticket->posY = y;
ticket->posZ = z;
ticket->message = message;
ticket->timestamp = (uint32)UNIXTIME;
ticket->name = GetPlayer()->GetName();
ticket->level = GetPlayer()->getLevel();
objmgr.remGMTicket(GetPlayer()->GetGUID());
objmgr.AddGMTicket(ticket,false);
// Response - no errors
data << uint32(2);
SendPacket(&data);
#ifdef CLUSTERING
std::stringstream str;
str << "GmTicket 5," << GetPlayer()->GetName();
string strmessage = str.str();
WorldPacket data2(ICMSG_CHANNEL_ACTION, 1 + sWorld.getGmClientChannel().size() + 4 + strmessage.size() + 4 + 1);
data2 << uint8(CHANNEL_SAY);
data2 << sWorld.getGmClientChannel();
data2 << GetPlayer()->GetLowGUID();
data2 << strmessage;
data2 << uint32(NULL);
data2 << bool(true);
sClusterInterface.SendPacket(&data2);
#else
// send message indicating new ticket
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(),GetPlayer());
if(chn)
{
char msg[100];
snprintf(msg, 100, "GmTicket 5,%s", GetPlayer()->GetName());
chn->Say(_player, msg, NULL, true);
}
#endif
}
示例12: HandleGMTicketCreateOpcode
void WorldSession::HandleGMTicketCreateOpcode(WorldPacket & recv_data)
{
uint32 type;
uint8 unk1;
float x, y, z;
std::string message = "";
std::string message2 = "";
GM_Ticket *ticket = new GM_Ticket;
WorldPacket data(SMSG_GMTICKET_CREATE, 4);
// recv Data
recv_data >> type;
recv_data >> unk1;
recv_data >> x;
recv_data >> y;
recv_data >> z;
recv_data >> message;
recv_data >> message2;
/*if (type == GM_TICKET_TYPE_BEHAVIOR_HARASSMENT)
{
// more magic
uint32 unk1;
uint32 unk2;
uint32 unk3;
string unk4;
recv_data >> unk1; // count of something
for (int i = 0; i < unk1; i++)
{
recv_data >> unk2
// do something with unk2
}
recv_data >> unk3;
if (unk3)
recv_data >> unk4;
}*/
// Create new Ticket and store it
objmgr.remGMTicket(GetPlayer()->GetGUID());
ticket->guid = GetPlayer()->GetGUID();
ticket->type = type;
ticket->posX = x;
ticket->posY = y;
ticket->posZ = z;
ticket->message = message;
ticket->timestamp = (uint32)UNIXTIME;
ticket->name = GetPlayer()->GetName();
ticket->level = GetPlayer()->getLevel();
objmgr.remGMTicket(GetPlayer()->GetGUID());
objmgr.AddGMTicket(ticket,false);
// Response - no errors
data << uint32(2);
SendPacket(&data);
// send message indicating new ticket
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(),GetPlayer());
if(chn)
{
char msg[100];
snprintf(msg, 100, "GmTicket 5,%s", GetPlayer()->GetName());
chn->Say(_player, msg, NULL, true);
}
}
示例13: HandleMessagechatOpcode
//.........这里部分代码省略.........
data = sChatHandler.FillMessageData(CHAT_MSG_AFK, LANG_UNIVERSAL, reason.c_str(), playercache->GetGUID(), _player->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_GM) ? 4 : 0);
SendPacket(data);
delete data;
}
else if(playercache->HasFlag(CACHE_PLAYER_FLAGS, PLAYER_FLAG_DND))
{
// Has DND flag, autorespond.
std::string reason;
playercache->GetStringValue(CACHE_AFK_DND_REASON, reason);
data = sChatHandler.FillMessageData(CHAT_MSG_DND, LANG_UNIVERSAL, reason.c_str(), playercache->GetGUID(), playercache->HasFlag(CACHE_PLAYER_FLAGS, PLAYER_FLAG_GM) ? 4 : 0);
SendPacket(data);
delete data;
}
playercache->DecRef();
}
break;
case CHAT_MSG_CHANNEL:
{
if(g_chatFilter->Parse(msg) == true)
{
SystemMessage("Your chat message was blocked by a server-side filter.");
return;
}
if(sChatHandler.ParseCommands(msg.c_str(), this) > 0)
break;
chn = channelmgr.GetChannel(channel.c_str(), GetPlayer());
if(chn)
{
//g_chatFilter->ParseEscapeCodes((char*)pMsg, (chn->m_flags & CHANNEL_PACKET_ALLOWLINKS)>0 );
chn->Say(GetPlayer(), msg.c_str(), NULL, false);
}
}
break;
case CHAT_MSG_AFK:
{
std::string reason = "";
recv_data >> reason;
GetPlayer()->SetAFKReason(reason);
if(g_chatFilter->Parse(msg) == true)
{
SystemMessage("Your chat message was blocked by a server-side filter.");
return;
}
/* WorldPacket *data, WorldSession* session, uint32 type, uint32 language, const char *channelName, const char *message*/
if(GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAG_AFK))
{
GetPlayer()->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAG_AFK);
if(sWorld.GetKickAFKPlayerTime())
sEventMgr.RemoveEvents(GetPlayer(), EVENT_PLAYER_SOFT_DISCONNECT);
}
else
{
GetPlayer()->SetFlag(PLAYER_FLAGS, PLAYER_FLAG_AFK);
if(GetPlayer()->m_bg)
GetPlayer()->m_bg->RemovePlayer(GetPlayer(), false);
if(sWorld.GetKickAFKPlayerTime())
sEventMgr.AddEvent(GetPlayer(), &Player::SoftDisconnect, EVENT_PLAYER_SOFT_DISCONNECT, sWorld.GetKickAFKPlayerTime(), 1, 0);
示例14: LogoutPlayer
void WorldSession::LogoutPlayer(bool Save)
{
Player* pPlayer = GetPlayer();
if (_loggingOut)
return;
_loggingOut = true;
if (_player != NULL)
{
_player->SetFaction(_player->GetInitialFactionId());
objmgr.RemovePlayer(_player);
_player->ok_to_remove = true;
sHookInterface.OnLogout(pPlayer);
if (_player->DuelingWith)
_player->DuelingWith->EndDuel(DUEL_WINNER_RETREAT);
if (_player->m_currentLoot && _player->IsInWorld())
{
Object* obj = _player->GetMapMgr()->_GetObject(_player->m_currentLoot);
if (obj != NULL)
{
switch (obj->getObjectTypeId())
{
case TYPEID_UNIT:
static_cast <Creature*>(obj)->loot.looters.erase(_player->getGuidLow());
break;
case TYPEID_GAMEOBJECT:
GameObject* go = static_cast<GameObject*>(obj);
if (!go->IsLootable())
break;
GameObject_Lootable* pLGO = static_cast<GameObject_Lootable*>(go);
pLGO->loot.looters.erase(_player->getGuidLow());
break;
}
}
}
#ifndef GM_TICKET_MY_MASTER_COMPATIBLE
GM_Ticket* ticket = objmgr.GetGMTicketByPlayer(_player->getGuid());
if (ticket != NULL)
{
// Send status change to gm_sync_channel
Channel* chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), _player);
if (chn)
{
std::stringstream ss;
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_ONLINESTATE;
ss << ":" << ticket->guid;
ss << ":0";
chn->Say(_player, ss.str().c_str(), NULL, true);
}
}
#endif
// part channels
_player->CleanupChannels();
auto transport = _player->GetTransport();
if (transport != nullptr)
{
transport->RemovePassenger(_player);
}
// cancel current spell
for (uint8_t i = 0; i < CURRENT_SPELL_MAX; ++i)
{
if (_player->getCurrentSpell(CurrentSpellType(i)) != nullptr)
_player->interruptSpellWithSpellType(CurrentSpellType(i));
}
_player->Social_TellFriendsOffline();
// Decrement the global player count
sWorld.decrementPlayerCount(_player->GetTeam());
if (_player->m_bgIsQueued)
BattlegroundManager.RemovePlayerFromQueues(_player);
// Repop or Resurrect and remove from battlegrounds
if (_player->m_bg)
{
if (pPlayer->getDeathState() == JUST_DIED)
pPlayer->RemoteRevive();
if (pPlayer->getDeathState() != ALIVE)
pPlayer->ResurrectPlayer();
_player->m_bg->RemovePlayer(_player, true);
}
else if (_player->IsDead() && _player->getDeathState() == JUST_DIED)
_player->RepopRequestedPlayer();
// Issue a message telling all guild members that this player signed
// off
#if VERSION_STRING != Cata
//.........这里部分代码省略.........
示例15: FullLogin
//.........这里部分代码省略.........
sLog.outDetail( "WORLD: Created new player for existing players (%s)", plr->GetName() );
// Login time, will be used for played time calc
plr->m_playedtime[2] = (uint32)UNIXTIME;
//Issue a message telling all guild members that this player has signed on
if(plr->IsInGuild())
{
Guild *pGuild = plr->m_playerInfo->guild;
if(pGuild)
{
WorldPacket data(50);
data.Initialize(SMSG_GUILD_EVENT);
data << uint8(GUILD_EVENT_MOTD);
data << uint8(0x01);
if(pGuild->GetMOTD())
data << pGuild->GetMOTD();
else
data << uint8(0);
SendPacket(&data);
pGuild->LogGuildEvent(GUILD_EVENT_HASCOMEONLINE, 1, plr->GetName());
}
}
// Send online status to people having this char in friendlist
_player->Social_TellFriendsOnline();
// send friend list (for ignores)
_player->Social_SendFriendList(7);
#ifndef GM_TICKET_MY_MASTER_COMPATIBLE
GM_Ticket * ticket = objmgr.GetGMTicketByPlayer(_player->GetGUID());
if(ticket != NULL)
{
//Send status change to gm_sync_channel
Channel *chn = channelmgr.GetChannel(sWorld.getGmClientChannel().c_str(), _player);
if(chn)
{
std::stringstream ss;
ss << "GmTicket:" << GM_TICKET_CHAT_OPCODE_ONLINESTATE;
ss << ":" << ticket->guid;
ss << ":1";
chn->Say(_player, ss.str().c_str(), NULL, true);
}
}
#endif
// Send MOTD
_player->BroadcastMessage(sWorld.GetMotd());
// Send revision (if enabled)
#ifdef WIN32
_player->BroadcastMessage("Powered by: %sArcEmu %s r%u/%s-Win-%s %s(Please report ALL bugs to www.ArcEmu.org/forums/)", MSG_COLOR_WHITE, BUILD_TAG,
BUILD_REVISION, CONFIG, ARCH, MSG_COLOR_LIGHTBLUE);
#else
_player->BroadcastMessage("Powered by: %sArcEmu %s r%u/%s-%s %s(Please report ALL bugs to www.ArcEmu.org/forums/)", MSG_COLOR_WHITE, BUILD_TAG,
BUILD_REVISION, PLATFORM_TEXT, ARCH, MSG_COLOR_LIGHTBLUE);
#endif
if(sWorld.SendStatsOnJoin || HasGMPermissions() )
{
_player->BroadcastMessage("Online Players: %s%u |rPeak: %s%u|r Accepted Connections: %s%u",
MSG_COLOR_WHITE, sWorld.GetSessionCount(), MSG_COLOR_WHITE, sWorld.PeakSessionCount, MSG_COLOR_WHITE, sWorld.mAcceptedConnections);
}
//Set current RestState
if( plr->m_isResting) // We are resting at an inn , turn on Zzz
plr->ApplyPlayerRestState(true);
//Calculate rest bonus if there is time between lastlogoff and now
if( plr->m_timeLogoff > 0 && plr->GetUInt32Value(UNIT_FIELD_LEVEL) < plr->GetUInt32Value(PLAYER_FIELD_MAX_LEVEL)) // if timelogoff = 0 then it's the first login
{
uint32 currenttime = (uint32)UNIXTIME;
uint32 timediff = currenttime - plr->m_timeLogoff;
//Calculate rest bonus
if( timediff > 0 )
plr->AddCalculatedRestXP(timediff);
}
#ifdef CLUSTERING
plr->SetInstanceID(forced_instance_id);
plr->SetMapId(forced_map_id);
#else
sHookInterface.OnEnterWorld2(_player);
#endif
if(info->m_Group)
info->m_Group->Update();
if(enter_world && !_player->GetMapMgr())
{
plr->AddToWorld();
}
objmgr.AddPlayer(_player);
if(info->m_Group == NULL)
plr->SendDungeonDifficulty();
}