本文整理汇总了C++中USER::SetUserAge方法的典型用法代码示例。如果您正苦于以下问题:C++ USER::SetUserAge方法的具体用法?C++ USER::SetUserAge怎么用?C++ USER::SetUserAge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USER
的用法示例。
在下文中一共展示了USER::SetUserAge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
break;
}
}
else //用户不存在
{
Msg.SetResult(ASKCHARLOGIN_LOADDB_ERROR);
Msg.SetAccount(pPacket->GetAccount());
Msg.SetPlayerID(pPacket->GetPlayerID());
Msg.SetPlayerGUID(CharGuid);
Msg.SetHoldStatus(FALSE);
pServerPlayer->SendPacket(&Msg);
Log::SaveLog( WORLD_LOGFILE, "LWAskCharLoginHandler...No User,CharGUID = %X",CharGuid) ;
return PACKET_EXE_CONTINUE;
}
}
else if(AskStatus == ALS_SENDDATA)
{
pUser = g_pOnlineUser->FindUser( CharGuid ) ;
if( pUser )
{//如果此用户存在
Log::SaveLog( WORLD_LOGFILE, "LWAskCharLoginHandler...Char Exist! CharGUID = %X",CharGuid) ;
return PACKET_EXE_CONTINUE;
}
ID_t ServerID = g_Config.SceneID2ServerID(pPacket->GetUserData()->m_Human.m_StartScene);
ServerPlayer* pFindPlayer = g_pServerManager->GetServerPlayer( ServerID ) ;
if( pFindPlayer==NULL ) //服务器维护
{
WLRetCharLogin Msg;
Msg.SetResult(ASKCHARLOGIN_SERVER_STOP);
Msg.SetAccount(pPacket->GetAccount());
Msg.SetPlayerID(pPacket->GetPlayerID());
Msg.SetPlayerGUID(CharGuid);
Msg.SetHoldStatus(FALSE);
pServerPlayer->SendPacket(&Msg);
Log::SaveLog( WORLD_LOGFILE, "LWAskCharLoginHandler...Server Stop CharGUID = %X",CharGuid) ;
return PACKET_EXE_CONTINUE;
}
pUser = g_pOnlineUser->NewUser();
if(!pUser) //满了
{
WLRetCharLogin Msg;
Msg.SetResult(ASKCHARLIST_WORLD_FULL);
Msg.SetAccount(pPacket->GetAccount());
Msg.SetPlayerID(pPacket->GetPlayerID());
Msg.SetPlayerGUID(CharGuid);
Msg.SetHoldStatus(FALSE);
pServerPlayer->SendPacket(&Msg);
Log::SaveLog( WORLD_LOGFILE, "LWAskCharLoginHandler...World Full CharGUID = %X",CharGuid) ;
return PACKET_EXE_CONTINUE;
}
pUser->CleanUp();
FULLUSERDATA* pFullUserData = g_pOnlineUser->NewData();
Assert(pFullUserData);
memcpy(pFullUserData,pPacket->GetUserData(),sizeof(FULLUSERDATA));
pUser->SetFullUserData( pFullUserData );
pUser->SetKey( pPacket->GetUserKey() );
pUser->SetUserStatus( US_HOLDUSERDATA );
pUser->ResetKickTime() ;
pUser->SetGUID( CharGuid );
pUser->SetAccount( pPacket->GetAccount() );
pUser->SetUserAge( pPacket->GetUserAge() );
g_pOnlineUser->OnUserLogin( pUser ) ;
Assert(pFullUserData->m_Human.m_StartScene!=INVALID_ID);
Assert(pFullUserData->m_Human.m_StartScene<(INT)g_Config.m_SceneInfo.m_SceneCount);
pUser->SetSceneID( pFullUserData->m_Human.m_StartScene );
WLRetCharLogin Msg;
Msg.SetResult(ASKCHARLOGIN_SUCCESS);
Msg.SetAccount(pPacket->GetAccount());
Msg.SetPlayerID(pPacket->GetPlayerID());
Msg.SetPlayerGUID(CharGuid);
Msg.SetHoldStatus(TRUE);
Msg.SetPlayerServerID(pUser->GetServerID());
pServerPlayer->SendPacket(&Msg);
Log::SaveLog( WORLD_LOGFILE, "LWAskCharLoginHandler...ALSCENDDATA GUID=%X", CharGuid) ;
return PACKET_EXE_CONTINUE;
}
Log::SaveLog( WORLD_LOGFILE, "LWAskCharLoginHandler::Execute()...GUID=%X OK",CharGuid) ;
return PACKET_EXE_CONTINUE;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR;
}