本文整理汇总了C++中ADDTOCALLSTACK函数的典型用法代码示例。如果您正苦于以下问题:C++ ADDTOCALLSTACK函数的具体用法?C++ ADDTOCALLSTACK怎么用?C++ ADDTOCALLSTACK使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ADDTOCALLSTACK函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ADDTOCALLSTACK
void CStoneMember::SetTitle( LPCTSTR pTitle )
{
ADDTOCALLSTACK("CStoneMember::SetTitle");
m_sTitle = pTitle;
}
示例2: ADDTOCALLSTACK
bool CChat::JoinChannel(CChatChanMember * pMember, lpctstr pszChannel, lpctstr pszPassword)
{
ADDTOCALLSTACK("CChat::JoinChannel");
ASSERT(pMember != nullptr);
CClient * pMemberClient = pMember->GetClient();
ASSERT(pMemberClient != nullptr);
// Are we in a channel now?
CChatChannel * pCurrentChannel = pMember->GetChannel();
if (pCurrentChannel != nullptr)
{
// Is it the same channel as the one I'm already in?
if (strcmp(pszChannel, pCurrentChannel->GetName()) == 0)
{
// Tell them and return
pMember->SendChatMsg(CHATMSG_AlreadyInConference, pszChannel);
return false;
}
}
CChatChannel * pNewChannel = FindChannel(pszChannel);
if (pNewChannel == nullptr)
{
pMemberClient->addChatSystemMessage(CHATMSG_NoConference, pszChannel );
return false;
}
// If there's a password, is it the correct one?
if (strcmp(pNewChannel->GetPassword(), pszPassword) != 0)
{
pMemberClient->addChatSystemMessage(CHATMSG_IncorrectPassword);
return false;
}
// Leave the old channel 1st
// Remove from old channel (if any)
if (pCurrentChannel != nullptr)
{
// Remove myself from the channels list of members
pCurrentChannel->RemoveMember(pMember);
// If noone is left, tell the chat system to delete it from memory
if (pCurrentChannel->m_Members.size() <= 0)
{
// Am I the last one here? Delete it from all other clients?
DeleteChannel(pCurrentChannel);
}
// Since we left, clear all members from our client that might be in our list from the channel we just left
pMemberClient->addChatSystemMessage(CHATMSG_ClearMemberList);
}
// Now join a new channel
// Add all the members of the channel to the clients list of channel participants
pNewChannel->SendMembers(pMember);
// Add ourself to the channels list of members
if (!pNewChannel->AddMember(pMember))
return false;
// Set the channel name title bar
pMemberClient->addChatSystemMessage(CHATMSG_UpdateChannelBar, pszChannel);
// Now send out my name to all clients in this channel
pNewChannel->SendThisMember(pMember);
return true;
}
示例3: ADDTOCALLSTACK
void CItemVendable::SetPlayerVendorPrice( DWORD lPrice )
{
ADDTOCALLSTACK("CItemVendable::SetPlayerVendorPrice");
// This can only be inside a vendor container.
m_price = maximum(lPrice, 0);
}
示例4: ADDTOCALLSTACK
bool CChar::Use_Eat( CItem * pItemFood, short iQty )
{
ADDTOCALLSTACK("CChar::Use_Eat");
// What we can eat should depend on body type.
// How much we can eat should depend on body size and current fullness.
//
// ??? monsters should be able to eat corpses / raw meat
// IT_FOOD or IT_FOOD_RAW
// NOTE: Some foods like apples are stackable !
if ( !CanMove(pItemFood) )
{
SysMessageDefault(DEFMSG_FOOD_CANTMOVE);
return false;
}
if ( Stat_GetMax(STAT_FOOD) == 0 )
{
SysMessageDefault(DEFMSG_FOOD_CANTEAT);
return false;
}
// Is this edible by me ?
if ( !Food_CanEat(pItemFood) )
{
SysMessageDefault(DEFMSG_FOOD_RCANTEAT);
return false;
}
if ( Stat_GetVal(STAT_FOOD) >= Stat_GetMax(STAT_FOOD) )
{
SysMessageDefault(DEFMSG_FOOD_CANTEATF);
return false;
}
Use_EatQty(pItemFood, iQty);
LPCTSTR pMsg;
int index = IMULDIV(Stat_GetVal(STAT_FOOD), 5, Stat_GetMax(STAT_FOOD));
switch ( index )
{
case 0:
pMsg = g_Cfg.GetDefaultMsg(DEFMSG_FOOD_FULL_1);
break;
case 1:
pMsg = g_Cfg.GetDefaultMsg(DEFMSG_FOOD_FULL_2);
break;
case 2:
pMsg = g_Cfg.GetDefaultMsg(DEFMSG_FOOD_FULL_3);
break;
case 3:
pMsg = g_Cfg.GetDefaultMsg(DEFMSG_FOOD_FULL_4);
break;
case 4:
pMsg = g_Cfg.GetDefaultMsg(DEFMSG_FOOD_FULL_5);
break;
case 5:
default:
pMsg = g_Cfg.GetDefaultMsg(DEFMSG_FOOD_FULL_6);
break;
}
SysMessage(pMsg);
return true;
}
示例5: ADDTOCALLSTACK
bool CClient::r_WriteVal(LPCTSTR pszKey, CGString &sVal, CTextConsole *pSrc)
{
ADDTOCALLSTACK("CClient::r_WriteVal");
EXC_TRY("WriteVal");
if ( !strnicmp("CTAG.", pszKey, 5) )
{
if ( pszKey[4] != '.' )
return false;
pszKey += 5;
CVarDefCont *pVar = m_TagDefs.GetKey(pszKey);
sVal = pVar ? pVar->GetValStr() : "";
return true;
}
if ( !strnicmp("CTAG0.", pszKey, 6) )
{
if ( pszKey[5] != '.' )
return false;
pszKey += 6;
CVarDefCont *pVar = m_TagDefs.GetKey(pszKey);
sVal = pVar ? pVar->GetValStr() : "0";
return true;
}
int index;
if ( !strnicmp("TARGP", pszKey, 5) && ((pszKey[5] == '\0') || (pszKey[5] == '.')) )
index = CC_TARGP;
else if ( !strnicmp("SCREENSIZE", pszKey, 10) && ((pszKey[10] == '\0') || (pszKey[10] == '.')) )
index = CC_SCREENSIZE;
else if ( !strnicmp("REPORTEDCLIVER", pszKey, 14) && ((pszKey[14] == '\0') || (pszKey[14] == '.')) )
index = CC_REPORTEDCLIVER;
else
index = FindTableSorted(pszKey, sm_szLoadKeys, COUNTOF(sm_szLoadKeys) - 1);
switch ( index )
{
case CC_ALLMOVE:
sVal.FormatVal(IsPriv(PRIV_ALLMOVE));
break;
case CC_ALLSHOW:
sVal.FormatVal(IsPriv(PRIV_ALLSHOW));
break;
case CC_CLIENTIS3D:
sVal.FormatVal(m_NetState->isClient3D());
break;
case CC_CLIENTISKR:
sVal.FormatVal(m_NetState->isClientKR());
break;
case CC_CLIENTISSA:
sVal.FormatVal(m_NetState->isClientEnhanced());
break;
case CC_CLIENTVERSION:
{
TCHAR szVersion[128];
sVal = m_Crypt.WriteClientVerString(m_Crypt.GetClientVer(), szVersion);
break;
}
case CC_DEBUG:
sVal.FormatVal(IsPriv(PRIV_DEBUG));
break;
case CC_DETAIL:
sVal.FormatVal(IsPriv(PRIV_DETAIL));
break;
case CC_GM:
sVal.FormatVal(IsPriv(PRIV_GM));
break;
case CC_HEARALL:
sVal.FormatVal(IsPriv(PRIV_HEARALL));
break;
case CC_LASTEVENT:
sVal.FormatLLVal(m_timeLastEvent.GetTimeRaw());
break;
case CC_PRIVSHOW:
sVal.FormatVal(!IsPriv(PRIV_PRIV_NOSHOW));
break;
case CC_REPORTEDCLIVER:
{
pszKey += 14;
GETNONWHITESPACE(pszKey);
DWORD dwCliVer = m_NetState->getReportedVersion();
if ( pszKey[0] == '\0' )
{
// Return full version string (eg: 5.0.2d)
TCHAR szVersion[128];
sVal = CCrypt::WriteClientVerString(dwCliVer, szVersion);
}
else
{
// Return raw version number (eg: 5.0.2d = 5000204)
sVal.FormatUVal(dwCliVer);
}
break;
}
case CC_SCREENSIZE:
{
if ( pszKey[10] == '.' )
{
pszKey += 10;
//.........这里部分代码省略.........
示例6: ADDTOCALLSTACK
bool CChar::NPC_OnHearPetCmdTarg( int iCmd, CChar * pSrc, CObjBase * pObj, const CPointMap & pt, LPCTSTR pszArgs )
{
ADDTOCALLSTACK("CChar::NPC_OnHearPetCmdTarg");
// Pet commands that required a target.
if ( iCmd == PC_FOLLOW || iCmd == PC_STAY || iCmd == PC_STOP )
{
// Pet friends can use only these commands
if ( ! NPC_IsOwnedBy( pSrc ) && Memory_FindObjTypes( pSrc, MEMORY_FRIEND ) == NULL )
return false;
}
else
{
// All others commands are avaible only to pet owner
if ( ! NPC_IsOwnedBy( pSrc, true ) )
return false;
}
if ( m_fIgnoreNextPetCmd == true )
{
m_fIgnoreNextPetCmd = false;
return(false);
}
bool fSuccess = false; // No they won't do it.
// Could be NULL
CItem * pItemTarg = dynamic_cast<CItem*>(pObj);
CChar * pCharTarg = dynamic_cast<CChar*>(pObj);
switch ( iCmd )
{
case PC_GO:
// Go to the location x,y
if ( ! pt.IsValidPoint())
break;
m_Act_p = pt;
fSuccess = Skill_Start( NPCACT_GOTO );
break;
case PC_GUARD:
if ( pObj == NULL )
break;
m_Act_Targ = pObj->GetUID();
fSuccess = Skill_Start( NPCACT_GUARD_TARG );
break;
case PC_TRANSFER:
// transfer ownership via the transfer command.
if ( pCharTarg == NULL )
break;
if ( pCharTarg->IsClient() )
{
if ( IsSetOF(OF_PetSlots) )
{
if ( !pCharTarg->FollowersUpdate(this, static_cast<short>(maximum(1, GetDefNum("FOLLOWERSLOTS", true, true))), true) )
{
pSrc->SysMessageDefault( DEFMSG_PETSLOTS_TRY_TRANSFER );
break;
}
}
fSuccess = NPC_PetSetOwner( pCharTarg );
}
break;
case PC_KILL:
case PC_ATTACK:
// Attack the target.
if ( pCharTarg == NULL )
break;
// refuse to attack friends.
if ( NPC_IsOwnedBy( pCharTarg, true ))
{
fSuccess = false; // take no commands
break;
}
fSuccess = pCharTarg->OnAttackedBy( pSrc, 1, true ); // we know who told them to do this.
if ( fSuccess )
{
fSuccess = Fight_Attack( pCharTarg, true );
}
break;
case PC_FOLLOW:
if ( pCharTarg == NULL )
break;
m_Act_Targ = pCharTarg->GetUID();
fSuccess = Skill_Start( NPCACT_FOLLOW_TARG );
break;
case PC_FRIEND:
// Not the same as owner,
if ( pCharTarg == NULL )
break;
Memory_AddObjTypes( pCharTarg, MEMORY_FRIEND );
break;
case PC_PRICE: // "PRICE" the vendor item.
if ( pItemTarg == NULL )
break;
if ( ! NPC_IsVendor())
//.........这里部分代码省略.........