public void read(MemoryStream msdata)
 {
     PBuff.readLoop(msdata, list);
 }
Exemple #2
0
        //场景角色信息修改
        private void Fun_4_10(INetData data)
        {
            var mapRoleUpdateMsg = new MapRoleUpdateMsg_4_10();

            mapRoleUpdateMsg.read(data.GetMemoryStream());
            Log.info(this, "-Fun_4_10()收到场景中角色信息修改:" + mapRoleUpdateMsg.id);

            PlayerVo changeVo = (mapRoleUpdateMsg.id == MeVo.instance.Id)
                ? MeVo.instance
                : PlayerMgr.instance.getPlayer(mapRoleUpdateMsg.id);

            Log.info(this, "-Fun_4_10()Meid: " + MeVo.instance.Id);
            Log.info(this, "-Fun_4_10()mapRoleUpdateMsg.id: " + mapRoleUpdateMsg.id);
            Log.info(this, "-Fun_4_10()changeVO: " + changeVo);
            if (changeVo == null)
            {
                return;
            }
            foreach (PItem item in mapRoleUpdateMsg.changeList)
            {
                if (item.key == MapTypeConst.ROLE_HP_CHANGE_KEY)
                {
                    changeVo.CurHp = item.value[0];
                }
                else if (item.key == MapTypeConst.ROLE_HP_FULL_CHANGE_KEY)
                {
                    changeVo.Hp = item.value[0];
                }
                else if (item.key == MapTypeConst.ROLE_MP_CHANGE_KEY)
                {
                    changeVo.CurMp = item.value[0];
                }
                else if (item.key == MapTypeConst.ROLE_MP_FULL_CHANGE_KEY)
                {
                    changeVo.Mp = item.value[0];
                }
                else if (item.key == MapTypeConst.ROLE_LV_CHANGE_KEY)
                {
                    changeVo.Level = (byte)item.value[0];
                }
                else if (item.key == MapTypeConst.Role_BUFF_LIST_CHANGE_KEY)
                {
                    //注:与后端约定buff的list<uint>的uint=id*100+lvl;
                    //对buff列表进行判断增删;
                    List <PBuff> tmpPbList = new List <PBuff>();
                    PBuff        tmpPb     = null;
                    uint         tmpBid    = 0;
                    uint         tmpBlv    = 0;
                    foreach (uint tmpValue in item.value)
                    {
                        tmpBlv    = tmpValue % 100;
                        tmpBid    = (tmpValue - tmpBlv) / 100;
                        tmpPb     = new PBuff();
                        tmpPb.id  = tmpBid;
                        tmpPb.lvl = (byte)tmpBlv;
                        tmpPbList.Add(tmpPb);
                    }
                    BuffManager.Instance.AddBuff(changeVo.Id.ToString(), tmpPbList, true);
                }
                else if (item.key == MapTypeConst.RolePetChange)
                {
                    changeVo.PetId = item.value[0];
                }
            }
            if (mapRoleUpdateMsg.id == MeVo.instance.Id)
            {
                MeVo.instance.DataUpdate(MeVo.DataHpMpUpdate);
            }
        }
Exemple #3
0
 public void read(MemoryStream msdata)
 {
     proto_util.readLoopUInt(msdata, power);
     PNationGwy.readLoop(msdata, gwy);
     PBuff.readLoop(msdata, buff);
 }