本文整理汇总了C++中WorldSession::SystemMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ WorldSession::SystemMessage方法的具体用法?C++ WorldSession::SystemMessage怎么用?C++ WorldSession::SystemMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WorldSession
的用法示例。
在下文中一共展示了WorldSession::SystemMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleAccountMuteCommand
bool ChatHandler::HandleAccountMuteCommand(const char* args, WorldSession* m_session)
{
if (!*args)
return false;
char* pAccount = (char*)args;
char* pDuration = strchr(pAccount, ' ');
if (pDuration == NULL)
return false;
*pDuration = 0;
++pDuration;
uint32_t timeperiod = Util::GetTimePeriodFromString(pDuration);
if (timeperiod == 0)
return false;
uint32 banned = (uint32)UNIXTIME + timeperiod;
sLogonCommHandler.setAccountMute(pAccount, banned);
std::string tsstr = Util::GetDateTimeStringFromTimeStamp(timeperiod + (uint32)UNIXTIME);
GreenSystemMessage(m_session, "Account '%s' has been muted until %s. The change will be effective immediately.", pAccount,
tsstr.c_str());
sGMLog.writefromsession(m_session, "mutex account %s until %s", pAccount, Util::GetDateTimeStringFromTimeStamp(timeperiod + (uint32)UNIXTIME).c_str());
WorldSession* pSession = sWorld.getSessionByAccountName(pAccount);
if (pSession != NULL)
{
pSession->m_muted = banned;
pSession->SystemMessage("Your voice has been muted until %s by a GM. Until this time, you will not be able to speak in any form.", tsstr.c_str());
}
return true;
}
示例2: HandleAccountUnmuteCommand
bool ChatHandler::HandleAccountUnmuteCommand(const char* args, WorldSession* m_session)
{
sLogonCommHandler.setAccountMute(args, 0);
GreenSystemMessage(m_session, "Account '%s' has been unmuted.", args);
sGMLog.writefromsession(m_session, "unmuted account %s", args);
WorldSession* pSession = sWorld.getSessionByAccountName(args);
if (pSession != NULL)
{
pSession->m_muted = 0;
pSession->SystemMessage("Your voice has restored. You may speak again.");
}
return true;
}