本文整理汇总了C++中P_PLAYER::setAccount方法的典型用法代码示例。如果您正苦于以下问题:C++ P_PLAYER::setAccount方法的具体用法?C++ P_PLAYER::setAccount怎么用?C++ P_PLAYER::setAccount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类P_PLAYER
的用法示例。
在下文中一共展示了P_PLAYER::setAccount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wpAccount_removecharacter
/*
\method account.removecharacter
\param player The player that should be removed from this account.
\description Removes a player from this account.
*/
static PyObject* wpAccount_removecharacter( wpAccount* /*self*/, PyObject* args )
{
if ( !checkArgChar( 0 ) )
{
PyErr_BadArgument();
return 0;
}
P_PLAYER pChar = dynamic_cast<P_PLAYER>( getArgChar( 0 ) );
if ( pChar )
{
pChar->setAccount( 0 );
}
Py_RETURN_TRUE;
}
示例2: reload
void cAccounts::reload()
{
QMap< SERIAL, QString > characcnames;
QStringList sockaccnames;
cCharIterator iterChars;
P_CHAR pc;
for( pc = iterChars.first(); pc; pc = iterChars.next() )
{
P_PLAYER pp = dynamic_cast<P_PLAYER>(pc);
if( pp && pp->account() )
{
characcnames.insert( pp->serial(), pp->account()->login() );
}
}
cUOSocket* mSock = NULL;
for( mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next() )
{
if( mSock->account() )
sockaccnames.push_back( mSock->account()->login() );
else
sockaccnames.push_back( QString() );
}
clear();
load();
QMap< SERIAL, QString >::Iterator it = characcnames.begin();
while( it != characcnames.end() )
{
P_PLAYER pp = dynamic_cast<P_PLAYER>(FindCharBySerial( it.key() ));
if( pp )
pp->setAccount( getRecord( it.data() ), false );
++it;
}
QStringList::iterator sit = sockaccnames.begin();
for( mSock = cNetwork::instance()->first(); mSock; mSock = cNetwork::instance()->next() )
{
if( !(*sit).isNull() )
mSock->setAccount( getRecord( (*sit) ) );
++sit;
}
}