当前位置: 首页>>代码示例>>C++>>正文


C++ GreenSystemMessage函数代码示例

本文整理汇总了C++中GreenSystemMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ GreenSystemMessage函数的具体用法?C++ GreenSystemMessage怎么用?C++ GreenSystemMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GreenSystemMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GreenSystemMessage

bool ChatHandler::HandleInfoCommand(const char* args, WorldSession *m_session)
{
	WorldPacket data;

	
	uint32 clientsNum = (uint32)sWorld.GetSessionCount();

	int gm = 0;
	int count = 0;
	int avg = 0;
	PlayerStorageMap::const_iterator itr;
	objmgr._playerslock.AcquireReadLock();
	for (itr = objmgr._players.begin(); itr != objmgr._players.end(); itr++)
	{
		if(itr->second->GetSession())
		{
			count++;
			avg += itr->second->GetSession()->GetLatency();
			if(itr->second->GetSession()->GetPermissionCount())
				gm++;
		}			
	}
	objmgr._playerslock.ReleaseReadLock();
	GreenSystemMessage(m_session, "Server Uptime: |r%s", sWorld.GetUptimeString().c_str());
	GreenSystemMessage(m_session, "Current Players: |r%d (%d GMs, %d queued)", clientsNum, gm,  0);
	GreenSystemMessage(m_session, "Average Latency: |r%.3fms", (float)((float)avg / (float)count));
	return true;
}
开发者ID:Vanj-crew,项目名称:HearthStone-Emu,代码行数:28,代码来源:Level0.cpp

示例2: RedSystemMessage

bool ChatHandler::HandleReviveStringcommand(const char* args, WorldSession* m_session)
{
	Player* plr = objmgr.GetPlayer(args, false);
	if(!plr)
	{
		RedSystemMessage(m_session, "Could not find player %s.", args);
		return true;
	}

	if(plr->IsDead())
	{
		if(plr->GetInstanceID() == m_session->GetPlayer()->GetInstanceID())
			plr->RemoteRevive();
		else
			sEventMgr.AddEvent(plr, &Player::RemoteRevive, EVENT_PLAYER_REST, 1, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);

		GreenSystemMessage(m_session, "Revived player %s.", args);
		sGMLog.writefromsession(m_session, "revived player %s", args);
	}
	else
	{
		GreenSystemMessage(m_session, "Player %s is not dead.", args);
	}
	return true;
}
开发者ID:RAlexis,项目名称:ArcEmu_MoP,代码行数:25,代码来源:Level2.cpp

示例3: GreenSystemMessage

bool ChatHandler::HandleGMTicketToggleTicketSystemStatusCommand(const char* args, WorldSession *m_session)
{
	if(sWorld.toggleGMTicketStatus())
		GreenSystemMessage(m_session, "TicketSystem enabled.");
	else
		GreenSystemMessage(m_session, "TicketSystem disabled.");
	return true;
}
开发者ID:miklasiak,项目名称:projekt,代码行数:8,代码来源:GMTicketCommands.cpp

示例4: GreenSystemMessage

//.gm list
bool ChatHandler::HandleGMListCommand(const char* /*args*/, WorldSession* m_session)
{
    bool print_headline = true;

    bool is_gamemaster = m_session->GetPermissionCount() != 0;

    objmgr._playerslock.AcquireReadLock();
    for (PlayerStorageMap::const_iterator itr = objmgr._players.begin(); itr != objmgr._players.end(); ++itr)
    {
        if (itr->second->GetSession()->GetPermissionCount())
        {
            if (!worldConfig.gm.listOnlyActiveGms)
            {
                if (print_headline)
                    GreenSystemMessage(m_session, "The following GMs are on this server:");

                if (worldConfig.gm.hidePermissions && !is_gamemaster)
                    SystemMessage(m_session, " - %s", itr->second->GetName());
                else
                    SystemMessage(m_session, " - %s [%s]", itr->second->GetName(), itr->second->GetSession()->GetPermissions());

                print_headline = false;
            }
            else if (worldConfig.gm.listOnlyActiveGms && itr->second->isGMFlagSet())
            {
                if (itr->second->isGMFlagSet())
                {
                    if (print_headline)
                        GreenSystemMessage(m_session, "The following GMs are active on this server:");

                    if (worldConfig.gm.hidePermissions && !is_gamemaster)
                        SystemMessage(m_session, " - %s", itr->second->GetName());
                    else
                        SystemMessage(m_session, " - %s [%s]", itr->second->GetName(), itr->second->GetSession()->GetPermissions());

                    print_headline = false;
                }
                else
                {
                    SystemMessage(m_session, "No GMs are currently logged in on this server.");
                    print_headline = false;
                }
            }
        }
    }
    objmgr._playerslock.ReleaseReadLock();

    if (print_headline)
    {
        if (!worldConfig.gm.listOnlyActiveGms)
            SystemMessage(m_session, "No GMs are currently logged in on this server.");
        else
            SystemMessage(m_session, "No GMs are currently active on this server.");
    }

    return true;
}
开发者ID:armm77,项目名称:AscEmu,代码行数:58,代码来源:GameMasterCommands.cpp

示例5: GreenSystemMessage

bool ChatHandler::HandleInfoCommand(const char* args, WorldSession *m_session)
{
	WorldPacket data;


	//uint32 clientsNum = (uint32)sWorld.GetSessionCount();

	int gm = 0;
	int count = 0;
	int avg = 0;
	PlayerStorageMap::const_iterator itr;
	objmgr._playerslock.AcquireReadLock();
	for (itr = objmgr._players.begin(); itr != objmgr._players.end(); itr++)
	{
		if(itr->second->GetSession())
		{
			count++;
			avg += itr->second->GetSession()->GetLatency();
			if(itr->second->GetSession()->GetPermissionCount())
				gm++;
		}
	}
	objmgr._playerslock.ReleaseReadLock();
	GreenSystemMessage(m_session, "Server Revision: |r%sArcEmu r%u/%s-%s-%s %s(www.arcemu.org)", MSG_COLOR_WHITE,
		BUILD_REVISION, CONFIG, PLATFORM_TEXT, ARCH, MSG_COLOR_LIGHTBLUE);
	GreenSystemMessage(m_session, "Server Uptime: |r%s", sWorld.GetUptimeString().c_str());
	GreenSystemMessage(m_session, "Current Players: |r%d (%d GMs) (%d Peak)", count, gm,(int)sWorld.PeakSessionCount);
	GreenSystemMessage(m_session, "Active Thread Count: |r%u", ThreadPool.GetActiveThreadCount());
	GreenSystemMessage(m_session, "Free Thread Count: |r%u", ThreadPool.GetFreeThreadCount());
	GreenSystemMessage(m_session, "Average Latency: |r%.3fms", (float)((float)avg / (float)count));
	GreenSystemMessage(m_session, "SQL Query Cache Size (World): |r%u queries delayed", WorldDatabase.GetQueueSize());
	GreenSystemMessage(m_session, "SQL Query Cache Size (Character): |r%u queries delayed", CharacterDatabase.GetQueueSize());
	
	return true;
}
开发者ID:Naqvamp,项目名称:Underworld_Core,代码行数:35,代码来源:Level0.cpp

示例6: GetSelectedPlayer

//.guild removeplayer
bool ChatHandler::HandleGuildRemovePlayerCommand(const char* /*args*/, WorldSession* m_session)
{
    Player* selected_player = GetSelectedPlayer(m_session, true, true);
    if (selected_player == nullptr)
        return true;

#if VERSION_STRING != Cata
    if (selected_player->IsInGuild())
    {
        RedSystemMessage(m_session, "%s not in a guild.", selected_player->GetName());
        return true;
    }
#else
    if (selected_player->GetGuild())
    {
        RedSystemMessage(m_session, "%s not in a guild.", selected_player->GetName());
        return true;
    }
#endif

#if VERSION_STRING != Cata
    if (selected_player->GetGuild()->GetGuildLeader() != selected_player->getGuidLow() || !m_session->GetPlayer()->isGMFlagSet())
    {
        RedSystemMessage(m_session, "Only guild leaders and gms can remove players from a guild!");
        return true;
    }

    GreenSystemMessage(m_session, "Kicked %s from Guild: %s", selected_player->GetName(), selected_player->GetGuild()->getGuildName());

    if (selected_player != m_session->GetPlayer())
        sGMLog.writefromsession(m_session, "Kicked %s from Guild %s", selected_player->GetName(), selected_player->GetGuild()->getGuildName());

    selected_player->GetGuild()->RemoveGuildMember(selected_player->getPlayerInfo(), selected_player->GetSession());
#else
    if (selected_player->GetGuild()->getLeaderGUID() != selected_player->getGuid() || !m_session->GetPlayer()->isGMFlagSet())
    {
        RedSystemMessage(m_session, "Only guild leaders and gms can remove players from a guild!");
        return true;
    }

    GreenSystemMessage(m_session, "Kicked %s from Guild: %s", selected_player->GetName(), selected_player->GetGuild()->getName().c_str());

    if (selected_player != m_session->GetPlayer())
        sGMLog.writefromsession(m_session, "Kicked %s from Guild %s", selected_player->GetName(), selected_player->GetGuild()->getName().c_str());

    selected_player->GetGuild()->handleRemoveMember(selected_player->GetSession(), selected_player->getGuid());
#endif
    return true;
}
开发者ID:armm77,项目名称:AscEmu,代码行数:50,代码来源:GuildCommands.cpp

示例7: GetSelectedPlayer

//.pet removespell
bool ChatHandler::HandlePetRemoveSpellCommand(const char* args, WorldSession* m_session)
{
    Player* selected_player = GetSelectedPlayer(m_session, true, true);
    if (selected_player == nullptr)
        return true;

    if (selected_player->GetSummon() == nullptr)
    {
        RedSystemMessage(m_session, "%s has no pet.", selected_player->GetName());
        return true;
    }

    if (!*args)
        return false;

    uint32 SpellId = atol(args);
    SpellInfo* spell_entry = sSpellCustomizations.GetSpellInfo(SpellId);
    if (spell_entry == nullptr)
    {
        RedSystemMessage(m_session, "Invalid spell id requested.");
        return true;
    }

    std::list<Pet*> summons = selected_player->GetSummons();
    for (std::list<Pet*>::iterator itr = summons.begin(); itr != summons.end(); ++itr)
    {
        (*itr)->RemoveSpell(SpellId);
    }

    GreenSystemMessage(m_session, "Removed spell %u from %s's pet.", SpellId, selected_player->GetName());

    return true;
}
开发者ID:master312,项目名称:AscEmu,代码行数:34,代码来源:PetCommands.cpp

示例8: GreenSystemMessage

bool ChatHandler::HandleGMListCommand(const char* args, WorldSession *m_session)
{
	WorldPacket data;
	bool first = true;

	WorldSession *gm_session;
	SessionSet::iterator itr;

	sWorld.gmList_lock.AcquireReadLock();	
	for (itr = sWorld.gmList.begin(); itr != sWorld.gmList.end();)
	{
		gm_session = (*itr);
		++itr;
		if(first)
			GreenSystemMessage(m_session, "There are following active GMs on this server:");
		first = false;

		if(gm_session->GetPlayer() && m_session != gm_session)
			SystemMessage(m_session, "%s [%s]", gm_session->GetPlayer()->GetName(), gm_session->GetPermissions());
	}
	sWorld.gmList_lock.ReleaseReadLock();
	if(first)
		SystemMessage(m_session, "There are no GMs currently logged in on this server.");

	return true;
}
开发者ID:Ballwinkle,项目名称:Ascent_NG,代码行数:26,代码来源:Level0.cpp

示例9: RedSystemMessage

bool ChatHandler::HandleTicketDeleteCommand(const char* args, WorldSession* m_session)
{
    if (!args)
    {
        RedSystemMessage(m_session, "You need to specify a ticket ID");
        return false;
    }

    Player* player = m_session->GetPlayer();

    uint32 ticketID = atol(args);

    QueryResult* result = CharacterDatabase.Query("SELECT * FROM gm_tickets WHERE ticketid = %u AND deleted = 1", ticketID);

    if (!result)
    {
        RedSystemMessage(m_session, "Ticket %u is not available in gm_tickets table or not closed!", ticketID);
        return false;
    }

    delete result;

    CharacterDatabase.Execute("DELETE FROM gm_tickets WHERE ticketid = %u", ticketID);
    GreenSystemMessage(m_session, "Ticket %u is deleted", ticketID);
    sGMLog.writefromsession(m_session, "deleted ticket %u ", ticketID);

    return true;
}
开发者ID:master312,项目名称:AscEmu,代码行数:28,代码来源:TicketCommands.cpp

示例10: snprintf

bool ChatHandler::HandleInvisibleCommand(const char *args, WorldSession *m_session)
{
	char msg[256];
	Player* pChar =m_session->GetPlayer();

	snprintf(msg, 256, "Invisibility and Invincibility are now ");
	if(pChar->m_isGmInvisible)
	{
		pChar->m_isGmInvisible = false;
		pChar->m_invisible = false;
		pChar->bInvincible = false;
		pChar->Social_TellFriendsOnline();
		if( pChar->m_bg )
		{
			pChar->m_bg->RemoveInvisGM();
		}
		snprintf(msg, 256, "%s OFF.", msg);
	} else {
		pChar->m_isGmInvisible = true;
		pChar->m_invisible = true;
		pChar->bInvincible = true;
		pChar->Social_TellFriendsOffline();
		if( pChar->m_bg )
		{
			pChar->m_bg->AddInvisGM();
		}
		snprintf(msg, 256, "%s ON.", msg);
	}

	snprintf(msg, 256, "%s You may have to leave and re-enter this zone for changes to take effect.", msg);

	GreenSystemMessage(m_session, (const char*)msg);
	return true;
}
开发者ID:Chero,项目名称:abcwow,代码行数:34,代码来源:Level2.cpp

示例11: strchr

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;
}
开发者ID:armm77,项目名称:AscEmu,代码行数:35,代码来源:AccountCommands.cpp

示例12: GreenSystemMessage

bool ChatHandler::HandleGMListCommand(const char* args, WorldSession *m_session)
{
	WorldPacket data;
	bool first = true;

	PlayerStorageMap::const_iterator itr;
	objmgr._playerslock.AcquireReadLock();
	for (itr = objmgr._players.begin(); itr != objmgr._players.end(); itr++)
	{
		if(itr->second->GetSession()->GetPermissionCount())
		{
			if(first)
				GreenSystemMessage(m_session, "There are following active GMs on this server:");

			SystemMessage(m_session, "%s [%s]", itr->second->GetName(), itr->second->GetSession()->GetPermissions());

			first = false;
		}
	}
	objmgr._playerslock.ReleaseReadLock();

	if(first)
		SystemMessage(m_session, "There are no GMs currently logged in on this server.");

	return true;
}
开发者ID:AwkwardDev,项目名称:ascent_classic,代码行数:26,代码来源:Level0.cpp

示例13: getSelectedChar

bool ChatHandler::HandleUnlearnCommand(const char* args, WorldSession * m_session)
{
    Player * plr = getSelectedChar(m_session, true);
    if (plr == 0)
        return true;

    uint32 SpellId = atol(args);
    if (SpellId == 0)
    {
        RedSystemMessage(m_session, "You must specify a spell id.");
        return true;
    }

    sGMLog.writefromsession(m_session, "removed spell %u from %s", SpellId, plr->GetName());

    if (plr->HasSpell(SpellId))
    {
        GreenSystemMessageToPlr(plr, "Removed spell %u.", SpellId);
        GreenSystemMessage(m_session, "Removed spell %u from %s.", SpellId, plr->GetName());
        plr->removeSpell(SpellId, false, false, 0);
    }
    else
    {
        RedSystemMessage(m_session, "That player does not have spell %u learnt.", SpellId);
    }

    return true;
}
开发者ID:Nupper,项目名称:AscEmu_Vanilla,代码行数:28,代码来源:Level1.cpp

示例14: ParseAccBanArgs

bool ChatHandler::HandleAccountBannedCommand(const char* args, WorldSession* m_session)
{
    if (!*args)
        return false;
    char* pAccount = (char*)args;
    char* pReason;
    char* pDuration;
    ParseAccBanArgs(pAccount, &pDuration, &pReason);
    uint32_t timeperiod = 0;
    if (pDuration != NULL)
    {
        timeperiod = Util::GetTimePeriodFromString(pDuration);
        if (timeperiod == 0)
            return false;
    }
    uint32 banned = (timeperiod ? (uint32)UNIXTIME + timeperiod : 1);

    char emptystring = 0;
    if (pReason == NULL)
        pReason = &emptystring;

    sLogonCommHandler.setAccountBanned(pAccount, banned, pReason);

    GreenSystemMessage(m_session, "Account '%s' has been banned %s%s for reason : %s. The change will be effective immediately.", pAccount,
                       timeperiod ? "until " : "forever", timeperiod ? Util::GetDateTimeStringFromTimeStamp(timeperiod + (uint32)UNIXTIME).c_str() : "", pReason);

    sWorld.disconnectSessionByAccountName(pAccount, m_session);
    sGMLog.writefromsession(m_session, "banned account %s until %s", pAccount, timeperiod ? Util::GetDateTimeStringFromTimeStamp(timeperiod + (uint32)UNIXTIME).c_str() : "permanent");
    return true;
}
开发者ID:armm77,项目名称:AscEmu,代码行数:30,代码来源:AccountCommands.cpp

示例15: GreenSystemMessage

Player * ChatHandler::getSelectedChar(WorldSession *m_session, bool showerror)
{
	uint64 guid;
	Player *chr;
	
	guid = m_session->GetPlayer()->GetSelection();
	
	if (guid == 0)
	{
		if(showerror) 
			GreenSystemMessage(m_session, "Auto-targeting self.");
		chr = m_session->GetPlayer(); // autoselect
	}
	else
		chr = m_session->GetPlayer()->GetMapMgr()->GetPlayer(guid);
	
	if(chr == NULL)
	{
		if(showerror) 
			RedSystemMessage(m_session, "This command requires that you select a player.");
		return NULL;
	}

	return chr;
}
开发者ID:Sylica2013,项目名称:Antrix,代码行数:25,代码来源:Chat.cpp


注:本文中的GreenSystemMessage函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。