zoukankan      html  css  js  c++  java
  • [手游新项目历程]第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 附近玩家列表
    	{
    		告诉他我移动了
    	}
     }

  • 相关阅读:
    Sqlserver 迁移数据库批量迁移作业(Job)
    在VS2010开发的MVC3 应用程序中设定默认的浏览器
    创建继承自System.Web.UI.WebControls.WebControl基类的控件类
    遍历页面控件
    @fontface
    加密配置节点
    视图状态的程序分块
    BlogEngine.NET 1.5的BlogProvider、DbBlogProvider
    避免target特性
    SCOPE_IDENTITY、IDENT_CURRENT 、@@IDENTITY
  • 原文地址:https://www.cnblogs.com/byfei/p/14104306.html
Copyright © 2011-2022 走看看