本文整理汇总了C++中USER::GetOldSceneID方法的典型用法代码示例。如果您正苦于以下问题:C++ USER::GetOldSceneID方法的具体用法?C++ USER::GetOldSceneID怎么用?C++ USER::GetOldSceneID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USER
的用法示例。
在下文中一共展示了USER::GetOldSceneID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
Msg.SetPlayerID( pPacket->GetPlayerID() ) ;
Msg.SetReturn( UDR_NOTFINDUSERDATA ) ;
pServerPlayer->SendPacket( &Msg ) ;
}
break ;
case US_HOLDUSERDATA:
{
WGRetUserData Msg ;
Msg.SetPlayerID( pPacket->GetPlayerID() ) ;
Msg.SetReturn( UDR_USERDATA ) ;
Msg.SetUserData( pUser->GetFullUserData() ) ;
Msg.SetPlayerAge( pUser->GetUserAge() );
g_pOnlineUser->DelData( pUser->GetFullUserData() ) ;//回收数据块
pUser->SetFullUserData( NULL );
pUser->SetUserStatus( US_NORMAL );
pUser->ResetKickTime();
pServerPlayer->SendPacket( &Msg ) ;
if( OldPlayerID != INVALID_ID )
{
WGNotifyUser MsgNotify ;
MsgNotify.SetGUID( pOldUser->GetGUID() ) ;
MsgNotify.SetStatus( WGNotifyUser::NUS_REMOVE ) ;
pServerPlayer->SendPacket( &MsgNotify ) ;
}
}
break ;
case US_CHANGESCENE:
{
BOOL KickPlayerFromOldServer = FALSE;
SceneID_t nOldSceneID = pUser->GetOldSceneID();
ID_t nOldServerID;
if( nOldSceneID != INVALID_ID && nOldSceneID < (SceneID_t)g_Config.m_SceneInfo.m_SceneCount )
{
nOldServerID = g_Config.m_SceneInfo.m_pScene[nOldSceneID].m_ServerID;
ServerPlayer* pOldServerPlayer = g_pServerManager->GetServerPlayer( nOldServerID );
if( pOldServerPlayer )
{
WGNotifyUser MsgNotify ;
MsgNotify.SetGUID( pUser->GetGUID() ) ;
MsgNotify.SetStatus( WGNotifyUser::NUS_REMOVE ) ;
pOldServerPlayer->SendPacket( &MsgNotify ) ;
KickPlayerFromOldServer = TRUE;
}
}
if( KickPlayerFromOldServer )
Log::SaveLog( WORLD_LOGFILE, "GWAskUserDataHandler...Kick OldPlayer GUID=%X OldScene=%d OldServer=%d Success", pUser->GetGUID(), nOldSceneID, nOldServerID ) ;
else
Log::SaveLog( WORLD_LOGFILE, "GWAskUserDataHandler...Kick OldPlayer GUID=%X OldScene=%d OldServer=%d Faild!!", pUser->GetGUID(), nOldSceneID, nOldServerID ) ;
WGRetUserData Msg ;
Msg.SetPlayerID( pPacket->GetPlayerID() ) ;
Msg.SetReturn( UDR_USERDATA ) ;
Msg.SetUserData( pUser->GetFullUserData() ) ;
Msg.SetPlayerAge( pUser->GetUserAge() );
g_pOnlineUser->DelData( pUser->GetFullUserData() ) ;//回收数据块
pUser->SetFullUserData( NULL );
pUser->SetUserStatus( US_NORMAL );
pUser->ResetKickTime();
pServerPlayer->SendPacket( &Msg ) ;
}