本文整理汇总了C++中LPCHARACTER::GetGMLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ LPCHARACTER::GetGMLevel方法的具体用法?C++ LPCHARACTER::GetGMLevel怎么用?C++ LPCHARACTER::GetGMLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LPCHARACTER
的用法示例。
在下文中一共展示了LPCHARACTER::GetGMLevel方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: interpret_command
void interpret_command(LPCHARACTER ch, const char * argument, size_t len)
{
if (NULL == ch)
{
sys_err ("NULL CHRACTER");
return ;
}
char cmd[128 + 1]; // buffer overflow 문제가 생기지 않도록 일부러 길이를 짧게 잡음
char new_line[256 + 1];
const char * line;
int icmd;
if (len == 0 || !*argument)
return;
double_dollar(argument, len, new_line, sizeof(new_line));
size_t cmdlen;
line = first_cmd(new_line, cmd, sizeof(cmd), &cmdlen);
for (icmd = 1; *cmd_info[icmd].command != '\n'; ++icmd)
{
if (cmd_info[icmd].command_pointer == do_cmd)
{
if (!strcmp(cmd_info[icmd].command, cmd)) // do_cmd는 모든 명령어를 쳐야 할 수 있다.
break;
}
else if (!strncmp(cmd_info[icmd].command, cmd, cmdlen))
break;
}
if (ch->GetPosition() < cmd_info[icmd].minimum_position)
{
switch (ch->GetPosition())
{
case POS_MOUNTING:
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("탄 상태에서는 할 수 없습니다."));
break;
case POS_DEAD:
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("쓰러진 상태에서는 할 수 없습니다."));
break;
case POS_SLEEPING:
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("꿈속에서 어떻게요?"));
break;
case POS_RESTING:
case POS_SITTING:
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("먼저 일어 나세요."));
break;
/*
case POS_FIGHTING:
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("목숨을 걸고 전투 중 입니다. 집중 하세요."));
break;
*/
default:
sys_err("unknown position %d", ch->GetPosition());
break;
}
return;
}
if (*cmd_info[icmd].command == '\n')
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("그런 명령어는 없습니다"));
return;
}
if (cmd_info[icmd].gm_level && cmd_info[icmd].gm_level > ch->GetGMLevel())
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("그런 명령어는 없습니다"));
return;
}
if (strncmp("phase", cmd_info[icmd].command, 5) != 0) // 히든 명령어 처리
sys_log(0, "COMMAND: %s: %s", ch->GetName(), cmd_info[icmd].command);
((*cmd_info[icmd].command_pointer) (ch, line, icmd, cmd_info[icmd].subcmd));
if (ch->GetGMLevel() >= GM_LOW_WIZARD)
{
if (cmd_info[icmd].gm_level >= GM_LOW_WIZARD)
{
if (LC_IsEurope() == true || /*LC_IsNewCIBN() == true || */LC_IsCanada() == true)
{
char buf[1024];
snprintf( buf, sizeof(buf), "%s", argument );
LogManager::instance().GMCommandLog(ch->GetPlayerID(), ch->GetName(), ch->GetDesc()->GetHostName(), g_bChannel, buf);
}
}
}
}
示例2: onDead
void CThreeWayWar::onDead(LPCHARACTER pChar, LPCHARACTER pkKiller)
{
if (false == pChar->IsPC())
return;
if (GM_PLAYER != pChar->GetGMLevel() && false == test_server)
return;
if (-1 == GetRegenFlag())
return;
DecreaseReviveTokenForPlayer( pChar->GetPlayerID() );
if (false == IsSungZiMapIndex(pChar->GetMapIndex()))
return;
if (NULL == pkKiller || true != pkKiller->IsPC())
return;
// °°Ає Б¦±№Ає °и»кЗПБц ѕКАЅ
if (pChar->GetEmpire() == pkKiller->GetEmpire())
return;
int nKillScore = GetKillScore(pkKiller->GetEmpire());
// Б¦±№ Еі ЅєДЪѕо°Ў -1АП°жїмґВ Е»¶ф±№°ЎА̱⶧№®їЎ БЎјц ГјЕ©ё¦ ЗПёй ѕИµИґЩ.
if (nKillScore >= 0)
{
nKillScore += GetKillValue(pChar->GetLevel());
SetKillScore(pkKiller->GetEmpire(), nKillScore);
}
if (nKillScore != 0 && (test_server || (nKillScore % 5) == 0))
{
char szBuf[64 + 1];
snprintf(szBuf, sizeof(szBuf), LC_TEXT("ЗцАз ЅєДЪѕо ЅЕјц±№:%d ГµБ¶±№:%d Бшіл±№:%d"),
GetKillScore(1), GetKillScore(2), GetKillScore(3));
SendNoticeMap(szBuf, GetSungziMapIndex(), false);
}
const int nVictoryScore = quest::CQuestManager::instance().GetEventFlag("threeway_war_kill_count");
if (0 == GetRegenFlag())
{
int nEliminatedEmpireCount = 0;
BYTE bLoseEmpire = 0;
for (int n = 1; n < 4; ++n)
{
if (nVictoryScore > GetKillScore(n))
{
++nEliminatedEmpireCount;
bLoseEmpire = n;
}
}
if (1 != nEliminatedEmpireCount)
return;
//----------------------
//Д«їоЖ® ГК±вИ
//----------------------
SetKillScore(1, 0);
SetKillScore(2, 0);
SetKillScore(3, 0);
SetKillScore(bLoseEmpire, -1);
quest::warp_all_to_map_my_empire_event_info * info;
//----------------------
//Е»¶ф±№°Ў ЕрАе ЅГЕ°±в : јєБцїЎј
//----------------------
info = AllocEventInfo<quest::warp_all_to_map_my_empire_event_info>();
info->m_lMapIndexFrom = GetSungziMapIndex();
info->m_lMapIndexTo = EMPIRE_START_MAP(bLoseEmpire);
info->m_x = EMPIRE_START_X(bLoseEmpire);
info->m_y = EMPIRE_START_Y(bLoseEmpire);
info->m_bEmpire = bLoseEmpire;
event_create(quest::warp_all_to_map_my_empire_event, info, PASSES_PER_SEC(10));
//----------------------
//Е»¶ф±№°Ў ЕрАе ЅГЕ°±в : Ел·ОїЎј
//----------------------
info = AllocEventInfo<quest::warp_all_to_map_my_empire_event_info>();
info->m_lMapIndexFrom = GetPassMapIndex(bLoseEmpire);
info->m_lMapIndexTo = EMPIRE_START_MAP(bLoseEmpire);
info->m_x = EMPIRE_START_X(bLoseEmpire);
info->m_y = EMPIRE_START_Y(bLoseEmpire);
info->m_bEmpire = bLoseEmpire;
event_create(quest::warp_all_to_map_my_empire_event, info, PASSES_PER_SEC(10));
//----------------------
//јєБцїЎ ЖГ±вґВ ±№°ЎїЎ ґлЗС АМѕЯ±вё¦ ё¶їХАМ ЗФ!
//----------------------
//.........这里部分代码省略.........
示例3: usableFor
bool GMCommand::usableFor(LPCHARACTER ch){
if (ch->GetGMLevel()>=minLevel){
return true;
}
return false;
}