• [手游新项目历程]第13天-游戏玩家怪物移动同步


    GAME_MSG_PLAYER_ENTER_VIEW			=		9002,					//人物进入视野
    GAME_PLAYER_LOCATION_NOTIFY			=		9003,					//人物移动信息	
    GAME_MSG_PLAYER_MOVE				=		1005,					//C -> C 人物移动信息	
    
      _snprintf(buf, sizeof(buf)-1, "%d", DbRet["GUID"]->GetLongLong() ); 
      
    场景ID:1001 未加载!
    地图资源没有加载, 玩家430000120|地图1001
    SetSceneId
    
    修改某个值
    update player_table set x = 40
    
    http://192.168.0.26/cq10/
    
    for(Tint32 index = 0; index < attrLen; ++index)
    {
    	CommMsg::ItemInfo_Attr* attr = item.add_extraattrlist();
    	attr->set_key(bagCell.m_DynamicExtraAttr[index].Key);
    	Tint32 nValue = bagCell.m_DynamicExtraAttr[index].Value;
    	attr->set_value(nValue);
    }
    
    Extralib::Timer::DateTime::GetCurSec()
    void GamePlayer::SendEnterViewInfo( GamePlayer* pPlayer )
    
    http://192.168.0.26/cq9/
    
    void CSceneCell::SendCellEnterMsg( IRole* pPlayer, bool bIncludeNear )
    
    bool Room::HandleOnMove( IRole * pRole )
    void SyncCoord( ); //同步坐标到前端
    std::set<IRole*> m_HandleMoveList;
    bool Room::OnMove( IRole * pRole )
    	
    MonsterChangePosPlayData
    ((GamePlayer*)pRole)->GetGUID();
    
    后进的没有先进的附近玩家
    进场景获得附近玩家列表
    
    vector<GamePlayer*> NearPlayers = GetNearPlayerList();
    
    IntVector IRole::GetNearPlayersLua()
    {
    	IntVector roleidlist;
    	CSceneCell* pSceneCell = GetSceneCell();
    	if( !pSceneCell )
    		return roleidlist;
    	vector<GamePlayer*> vNear = pSceneCell->GetNearPlayerList();
    	for(vector<GamePlayer*>::iterator itr=vNear.begin();itr!=vNear.end();itr++)
    	{
    		GamePlayer* pGamePlayer = *itr;
    		roleidlist.Add(pGamePlayer->GetRoleId());
    	}
    	return roleidlist;
    }
    
    vector<GamePlayer*> GetNearPlayers();
    void GamePlayer::SendEnterViewInfo( GamePlayer* pPlayer )
    	
    	
    GAME_MSG_PLAYER_LEAVE_VIEW			=		143,					//人物离开视野
    	
    // 玩家离开地图返回
    struct MsgRoleLeaveMapRes
    {
    	t_RoleID roleId_m;
    };
    	
    共享内存 - 读写锁
    GAME_MSG_MONSTER_ENTER_VIEW			=		141,					//怪物进入视野
    	
    struct MsgEnterViewMonsterInfo
    
    GAME_MSG_MONSTER_LOCATION_RES		=		147,					//怪物移动信息
    	
    	
    移动-》添加进移动列表
     for 移动列表
     {
    	for 附近玩家列表
    	{
    		告诉他我移动了
    	}
     }

  • 相关阅读:
    mysql安装及初始密码问题
    centos7上安装erlang22.1
    共享文件夹设置
    putty免密登录
    重新开始
    单任务多线程 安全
    线程池
    多线程
    commons-IO
    打印流
  • 原文地址:https://www.cnblogs.com/byfei/p/14104306.html
Copyright © 2020-2023  润新知