本文整理汇总了C++中USER::GetSceneID方法的典型用法代码示例。如果您正苦于以下问题:C++ USER::GetSceneID方法的具体用法?C++ USER::GetSceneID怎么用?C++ USER::GetSceneID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USER
的用法示例。
在下文中一共展示了USER::GetSceneID方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
//.........这里部分代码省略.........
Log::SaveLog( WORLD_LOGFILE, "GWTeamRetApplyHandler...Team Full sGUID=%X lGUID=%X",
sGuid, lGuid );
}
else if( pTeam->Leader()->m_Member != lGuid )
{ //队长GUID和队伍中记录的队长GUID不符
WGTeamError sMsg;
sMsg.SetPlayerID( pSourUser->GetPlayerID() );
sMsg.SetGUID( pLeaderUser->GetGUID() );
sMsg.SetErrorCode( TEAM_ERROR_APPLYLEADERGUIDERROR );
pSourServerPlayer->SendPacket( &sMsg );
WGTeamError lMsg;
lMsg.SetPlayerID( pLeaderUser->GetPlayerID() );
lMsg.SetGUID( pLeaderUser->GetGUID() );
lMsg.SetErrorCode( TEAM_ERROR_APPLYLEADERGUIDERROR );
pLeaderServerPlayer->SendPacket( &lMsg );
Log::SaveLog( WORLD_LOGFILE, "GWTeamRetApplyHandler...Team Full sGUID=%X lGUID=%X",
sGuid, lGuid );
}
else
{ //加入
//将玩家加入队伍
TEAMMEMBER Member;
Member.m_Member = sGuid;
pTeam->AddMember( &Member );
//设置玩家队伍信息
pSourUser->SetTeamID( pTeam->GetTeamID() );
WGTeamResult Msg1; // 发给新队员的
Msg1.SetPlayerID( pSourUser->GetPlayerID() );
Msg1.SetTeamID( tid );
WGTeamResult Msg2; // 发给每个队员的
Msg2.SetReturn( TEAM_RESULT_MEMBERENTERTEAM );
Msg2.SetTeamID( tid );
Msg2.SetGUID( sGuid );
Msg2.SetGUIDEx( pSourUser->GetPlayerID() ); // 将玩家的 PlayerID 传回
Msg2.SetSceneID( pSourUser->GetSceneID() );
Msg2.SetName( pSourUser->GetName() );
Msg2.SetIcon( pSourUser->GetPortrait() );
Msg2.SetDataID( pSourUser->GetSex() );
//通知所有组内的玩家
for( int i=0; i<pTeam->MemberCount(); i++ )
{
TEAMMEMBER* pMember = pTeam->Member( i );
if( pMember==NULL )
{
Assert(FALSE);
continue;
}
USER* pUser = g_pOnlineUser->FindUser( pMember->m_Member );
if( pUser==NULL )
{
Assert(FALSE);
continue;
}
ID_t ServerID = pUser->GetServerID();
ServerPlayer* pServerPlayer = g_pServerManager->GetServerPlayer( ServerID );
if( pServerPlayer==NULL )
{
Assert(FALSE);
continue;
}
Msg2.SetPlayerID( pUser->GetPlayerID() );
pServerPlayer->SendPacket( &Msg2 );
if( pMember->m_Member != sGuid )
{ // 将自己以外的玩家传给新玩家
Msg1.SetReturn( TEAM_RESULT_TEAMREFRESH );
Msg1.SetName( pUser->GetName() );
Msg1.SetIcon( pUser->GetPortrait() );
Msg1.SetDataID( pUser->GetSex() );
Msg1.SetGUID( pMember->m_Member );
Msg1.SetGUIDEx( pUser->GetPlayerID() ); // 将玩家的 PlayerID 传回
Msg1.SetSceneID( pUser->GetSceneID() );
pSourServerPlayer->SendPacket( &Msg1 );
}
}//end for
Log::SaveLog( WORLD_LOGFILE, "GWTeamRetApplyHandler...Success! sGUID=%X lGUID=%X",
sGuid, lGuid );
}
}
return PACKET_EXE_CONTINUE;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR;
}
示例2: Execute
//.........这里部分代码省略.........
pUser->AddRelation( Relation.GetTargetGUID(), &RUser );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_NEWGOODFRIEND:
{ // 加入一个亲密好友
pUser->AddGoodFriend( pRelationPacket->m_RelationGUID.GetTargetGUID() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_RELATIONONLINE:
{ // 获取密友的在线列表
Msg.GetRelation()->m_Type = RET_ONLINELIST;
RETURN_ONLINE_LIST* pSend = &(Msg.GetRelation()->m_RelationOnline);
pSend->CleanUp();
pUser->FillOnlineList(pSend);
}
break;
case REQ_MODIFYMOOD:
{
pUser->SetMood( pRelationPacket->m_ModifyMood.GetMood() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_MODIFYSETTINGS:
{
pUser->SetSettings( pRelationPacket->m_Settings.GetSettings() );
return PACKET_EXE_CONTINUE;
}
break;
case REQ_NOTIFY_ADDTEMPFRIEND:
{
REQUEST_VIEW_PLAYER& Recv = pRelationPacket->m_ViewPlayer;
if ( strlen(Recv.GetTargetName()) > 0 )
{
pTargetUser = g_pOnlineUser->FindUser( Recv.GetTargetName() );
}
if ( pTargetUser == NULL )
{ // 玩家可能不存在也可能不在线,由 Server 来判断
Log::SaveLog( WORLD_LOGFILE, "GWRelationHandler...User GUID=%s not find!",
Recv.GetTargetName() );
return PACKET_EXE_CONTINUE;
}
Msg.GetRelation()->m_Type = RET_NOTIFY_ADDTEMPFRIEND;
REQUEST_VIEW_PLAYER* pSend = &(Msg.GetRelation()->m_PlayerName);
pSend->CleanUp();
pSend->SetTargetName( pUser->GetName() );
}
break;
default :
{
Assert(FALSE);
return PACKET_EXE_CONTINUE;
}
}
if ( uErr > 0 )
{
Msg.GetRelation()->m_Type = uErr;
}
if ( pRelationData != NULL && pTargetUser != NULL )
{
pRelationData->SetGUID( pTargetUser->GetGUID() );
pRelationData->SetName( pTargetUser->GetName() );
pRelationData->SetLevel( pTargetUser->GetLevel() );
pRelationData->SetMenPai( pTargetUser->GetMenpai() );
pRelationData->SetPortrait( pTargetUser->GetPortrait() );
pRelationData->SetGuildID( pTargetUser->GetGuildID() );
pRelationData->SetGuildName( g_pGuildManager->GetGuildName(pTargetUser->GetGuildID()) );
if ( pTargetUser->UserStatus() == US_NORMAL )
{ // 只有在线才发剩余信息
pRelationData->SetOnlineFlag(1);
pRelationData->SetMood( pTargetUser->GetMood() );
pRelationData->SetTitle( pTargetUser->GetTitle() );
pRelationData->SetSceneID( pTargetUser->GetSceneID() );
if ( pTargetUser->GetTeamID() != INVALID_ID )
{
Team* pTeam = g_pTeamList->GetTeam( pTargetUser->GetTeamID() );
if ( pTeam != NULL )
{
pRelationData->SetTeamSize( pTeam->MemberCount() );
}
}
}
}
pServerPlayer->SendPacket( &Msg );
return PACKET_EXE_CONTINUE;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR;
}
示例3: Execute
//.........这里部分代码省略.........
Msg.SetPlayerID( pLeader->GetPlayerID() );
pLeaderServerPlayer->SendPacket( &Msg );
}
Log::SaveLog( WORLD_LOGFILE, "GWTeamRetInviteHandler...DestInTeam SourGUID=%X DestGUID=%X",
sGuid, dGuid );
}
else if( pSourUser->GetTeamID()==INVALID_ID )
{//邀请人和被邀请人都无队伍
TeamID_t tid = g_pTeamList->CreateTeam( );
Assert( tid!=INVALID_ID );
Team* pTeam = g_pTeamList->GetTeam( tid );
Assert( pTeam );
if ( pSourUser->GetGUID() == pDestUser->GetGUID() )
{
//将玩家加入队伍中
TEAMMEMBER Member;
Member.m_Member = sGuid;
pTeam->AddMember( &Member );
//设置玩家队伍数据
pSourUser->SetTeamID( tid );
//返回结果
WGTeamResult Msg;
Msg.SetPlayerID( pSourUser->GetPlayerID() );
Msg.SetReturn( TEAM_RESULT_MEMBERENTERTEAM );
Msg.SetGUID( sGuid );
Msg.SetTeamID( tid );
Msg.SetGUIDEx( pSourUser->GetPlayerID() ); // 将玩家的 PlayerID 传回
Msg.SetIcon( pSourUser->GetPortrait() );
Msg.SetSceneID( pSourUser->GetSceneID() );
Msg.SetDataID( pSourUser->GetSex() );
pSourServerPlayer->SendPacket( &Msg );
Log::SaveLog( WORLD_LOGFILE, "GWTeamRetInviteHandler...CreateTeam GUID=%X TeamID=%d",
sGuid, tid );
}
else
{
//将玩家加入队伍中
TEAMMEMBER sMember;
sMember.m_Member = sGuid;
pTeam->AddMember( &sMember );
TEAMMEMBER dMember;
dMember.m_Member = dGuid;
pTeam->AddMember( &dMember );
//设置玩家队伍数据
pSourUser->SetTeamID( tid );
pDestUser->SetTeamID( tid );
//返回结果
WGTeamResult sMsg1;
sMsg1.SetPlayerID( pSourUser->GetPlayerID() );
sMsg1.SetReturn( TEAM_RESULT_TEAMREFRESH );
sMsg1.SetGUID( sGuid );
sMsg1.SetTeamID( tid );
sMsg1.SetGUIDEx( pSourUser->GetPlayerID() ); // 将玩家的 PlayerID 传回
sMsg1.SetSceneID( pSourUser->GetSceneID() );
pSourServerPlayer->SendPacket( &sMsg1 );
示例4: Execute
//.........这里部分代码省略.........
// if( pUser==NULL )
// {//如果队员离线,则用户数据是空
// continue;
// }
// ID_t ServerID = pUser->GetServerID();
// ServerPlayer* pServerPlayer = g_pServerManager->GetServerPlayer( ServerID );
// if( pServerPlayer==NULL )
// {
// Assert(FALSE);
// continue;
// }
// Msg2.SetPlayerID( pUser->GetPlayerID() );
// pServerPlayer->SendPacket( &Msg2 );
// }
// Log::SaveLog( WORLD_LOGFILE, "GWTeamLeaderRetInviteHandler...AgreeAndInvite! sGUID=%X dGUID=%X lGUID=%X",
// sGuid, dGuid, lGuid );
//}
{
//原先是不用被邀请者同意,直接添加到队伍中,现在得被邀请者同意才能添加到队伍中
ID_t DestServerID = pDestUser->GetServerID();
ServerPlayer* pDestServerPlayer = g_pServerManager->GetServerPlayer( DestServerID );
if( pDestServerPlayer )
{
//向被邀请人发送邀请消息
WGTeamAskInvite Msg;
Msg.SetPlayerID( pDestUser->GetPlayerID() );
Msg.SetGUID( lGuid );//在这得改成队长的ID否则又是队员邀请,进入了死循环
if ( pSourUser->GetTeamID() != INVALID_ID )
{
Team* pTeam = g_pTeamList->GetTeam( pSourUser->GetTeamID() );
Assert( pTeam );
for( INT i=0; i<pTeam->MemberCount(); ++i )
{
WGTeamAskInvite::InviterInfo info;
TEAMMEMBER* pMember = pTeam->Member( i );
if( pMember == NULL )
{
Assert(FALSE);
continue ;
}
USER* pUser = g_pOnlineUser->FindUser( pMember->m_Member );
if( pUser == NULL )
{//如果队员离线,则用户数据是空
info.m_PlayerID = INVALID_ID;
//continue ;
}
else
info.m_PlayerID = pUser->GetPlayerID();
info.m_NickSize = (UCHAR)strlen(pMember->m_Name);
strncpy( (CHAR*)info.m_szNick, pMember->m_Name, info.m_NickSize );
info.m_uFamily = pMember->m_uFamily;
info.m_Scene = pMember->m_SceneID;
info.m_Level = pMember->m_Level;
info.m_uDataID = pMember->m_uDataID;
Msg.AddInviterInfo( info );
}
}
else
{
// Msg.SetMemberCount( 1 );
WGTeamAskInvite::InviterInfo info;
info.m_PlayerID = pSourUser->GetPlayerID();
info.m_NickSize = (UCHAR)strlen(pSourUser->GetName());
strncpy( (CHAR*)info.m_szNick, pSourUser->GetName(), info.m_NickSize );
info.m_uFamily = pSourUser->GetMenpai();
info.m_Scene = pSourUser->GetSceneID();
info.m_Level = pSourUser->GetLevel();
info.m_uDataID = pSourUser->GetSex();
Msg.AddInviterInfo( info );
}
pDestServerPlayer->SendPacket( &Msg );
}
else
{
Assert(FALSE);
}
Log::SaveLog( WORLD_LOGFILE, "GWTeamLeaderRetInviteHandler...AskInvite SourGUID=%X DestGUID=%X",
sGuid, dGuid );
}
}
return PACKET_EXE_CONTINUE;
__LEAVE_FUNCTION
return PACKET_EXE_ERROR;
}
示例5: Execute
uint GWTeamInviteHandler::Execute( GWTeamInvite* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
ServerPlayer* pSourServerPlayer = (ServerPlayer*)pPlayer;
GUID_t sGuid = pPacket->GetSourGUID();
USER* pSourUser = g_pOnlineUser->FindUser( sGuid );
if( pSourUser==NULL )
{
Log::SaveLog( WORLD_LOGFILE, "GWTeamInviteHandler...User Sour GUID=%X not find!",
sGuid );
return PACKET_EXE_CONTINUE;
}
USER* pDestUser = g_pOnlineUser->FindUser( pPacket->GetDestName() );
if( pDestUser==NULL )
{
Log::SaveLog( WORLD_LOGFILE, "GWTeamInviteHandler...User Dest Name=%s not find!",
pPacket->GetDestName() );
return PACKET_EXE_CONTINUE;
}
GUID_t dGuid = pDestUser->GetGUID();
if( pSourUser->IsEnemy( pDestUser->GetUserCampData() ) )
{
Log::SaveLog( WORLD_LOGFILE, "GWTeamInviteHandler...Sour Name=%s, Dest Name=%s are enemy!",
pSourUser->GetName(), pDestUser->GetName() );
return PACKET_EXE_CONTINUE;
}
// 设置了拒绝被邀请
if( pDestUser->IsRefuseTeamInvite() )
{
WGTeamError Msg;
Msg.SetPlayerID( pSourUser->GetPlayerID() );
Msg.SetGUID(sGuid);
Msg.SetErrorCode(TEAM_ERROR_REFUSEINVITESETTING);
pSourServerPlayer->SendPacket( &Msg );
Log::SaveLog( WORLD_LOGFILE, "GWTeamInviteHandler...DestGUID=%X refuse to be invited. ",
dGuid );
return PACKET_EXE_CONTINUE;
}
if( pDestUser->GetTeamID() != INVALID_ID )
{//被邀请人已经属于某个队伍了
WGTeamError Msg;
Msg.SetPlayerID( pSourUser->GetPlayerID() );
Msg.SetGUID(sGuid);
Msg.SetErrorCode(TEAM_ERROR_INVITEDESTHASTEAM);
pSourServerPlayer->SendPacket( &Msg );
Log::SaveLog( WORLD_LOGFILE, "GWTeamInviteHandler...DestInTeam SourGUID=%X DestGUID=%X",
sGuid, dGuid );
}
else if( sGuid==dGuid && pSourUser->GetTeamID()==INVALID_ID )
{//邀请人和被邀请人属于同一个人, 且不属于某个队伍
//自建队伍
TeamID_t tid = g_pTeamList->CreateTeam( );
Assert( tid!=INVALID_ID );
Team* pTeam = g_pTeamList->GetTeam( tid );
Assert( pTeam );
//将玩家加入队伍中
TEAMMEMBER Member;
Member.m_Member = sGuid;
pTeam->AddMember( &Member );
//设置玩家队伍数据
pSourUser->SetTeamID( tid );
//返回结果
WGTeamResult Msg;
Msg.SetPlayerID( pSourUser->GetPlayerID() );
Msg.SetReturn( TEAM_RESULT_MEMBERENTERTEAM );
Msg.SetGUID( sGuid );
Msg.SetTeamID( tid );
Msg.SetGUIDEx( pSourUser->GetPlayerID() ); // 将玩家的 PlayerID 传回
Msg.SetSceneID( pSourUser->GetSceneID() );
Msg.SetDataID( pSourUser->GetSex() );
Msg.SetIcon( pSourUser->GetPortrait() );
pSourServerPlayer->SendPacket( &Msg );
Log::SaveLog( WORLD_LOGFILE, "GWTeamInviteHandler...CreateTeam GUID=%X TeamID=%d",
sGuid, tid );
}
else
{
if ( pSourUser->GetTeamID() != INVALID_ID )
{
//邀请人已经有一个队伍
Team* pTeam = g_pTeamList->GetTeam( pSourUser->GetTeamID() );
Assert( pTeam );
//.........这里部分代码省略.........
示例6: Execute
uint GWAskTeamInfoHandler::Execute( GWAskTeamInfo* pPacket, Player* pPlayer )
{
__ENTER_FUNCTION
ServerPlayer* pServerPlayer = (ServerPlayer*)pPlayer;
GUID_t guid = pPacket->GetGUID(); // 被请求信息的玩家的 GUID
USER* pUser = g_pOnlineUser->FindUser( guid );
if( pUser == NULL )
{
Log::SaveLog( WORLD_LOGFILE, "GWAskTeamInfoHandler...User GUID=%X not find!",
guid );
return PACKET_EXE_CONTINUE;
}
if( pUser->GetTeamID() == INVALID_ID )
{
return PACKET_EXE_CONTINUE;
}
Team* pTeam = g_pTeamList->GetTeam( pUser->GetTeamID() );
if( pTeam==NULL )
{
Assert(FALSE) ;
return PACKET_EXE_CONTINUE ;
}
else
{
TEAMMEMBER Member;
Member.m_Member = pUser->GetGUID();
if ( pTeam->IsMember( &Member ) == FALSE )
{ // 某些情况下,玩家保存了过期的队伍号
AssertEx( FALSE, "过期队伍号,忽略。" );
return PACKET_EXE_CONTINUE;
}
}
WGTeamList Msg;
Msg.SetPlayerID(pPacket->GetPlayerID());
Msg.SetTeamID( pUser->GetTeamID() );
Msg.SetGUID( guid );
WGTeamResult MsgtoEveryMember; // 通知其他队员某人进入新场景了
MsgtoEveryMember.SetReturn( TEAM_RESULT_ENTERSCENE );
MsgtoEveryMember.SetTeamID( pTeam->GetTeamID() );
MsgtoEveryMember.SetGUID( pUser->GetGUID() );
MsgtoEveryMember.SetGUIDEx( pUser->GetPlayerID() );
MsgtoEveryMember.SetIcon( pUser->GetPortrait() );
MsgtoEveryMember.SetSceneID( pUser->GetSceneID() );
for(int i=0; i<pTeam->MemberCount(); ++i)
{
TEAMMEMBER* pMember = pTeam->Member( i );
if( pMember==NULL )
{
Assert(FALSE);
continue;
}
USER* pDestUser = g_pOnlineUser->FindUser( pMember->m_Member );
if( pDestUser==NULL )
{
Assert(FALSE);
continue;
}
ID_t ServerID = pDestUser->GetServerID() ;
ServerPlayer* pDestServerPlayer = g_pServerManager->GetServerPlayer( ServerID ) ;
if( pDestServerPlayer==NULL )
{
Assert(FALSE) ;
continue ;
}
if( pUser->GetGUID() != pDestUser->GetGUID() )
{
MsgtoEveryMember.SetPlayerID( pDestUser->GetPlayerID() ) ;
pDestServerPlayer->SendPacket( &MsgtoEveryMember );
}
TEAM_LIST_ENTRY entry;
entry.SetGUID( pDestUser->GetGUID() );
entry.SetSceneID( pDestUser->GetSceneID() );
entry.SetExtraID( pDestUser->GetPlayerID() );
entry.SetName( pDestUser->GetName() );
entry.SetIcon( pDestUser->GetPortrait() );
entry.SetDataID( pDestUser->GetSex() );
Msg.AddTeamMember( entry );
}
pServerPlayer->SendPacket( &Msg );
if ( pTeam->GetFollowedmemberCount()>0 )
{
GUID_t* FollowedMembers = pTeam->GetFollowedMembers();
BOOL flag;
//.........这里部分代码省略.........