Exemplo n.º 1
0
        protected override void DoDecode(byte[] data, ref int unLen)
        {
            var info = new AttachedInfo();

            info.id    = (uint)VUInt32.Instance.Decode(data, ref unLen); //entity unique id
            info.props = new List <EntityPropertyValue>();
            if (GetEntity != null)
            {
                var entity = GetEntity(info.id);
                if (entity != null)
                {
                    while (unLen < data.Length)
                    {
//还有数据就解析
                        var index = VUInt16.Instance.Decode(data, ref unLen);
                        EntityDefProperties prop;
                        var flag = entity.Properties.TryGetValue((ushort)index, out prop);
                        if (flag)
                        {
                            info.props.Add(new EntityPropertyValue(prop, prop.VType.Decode(data, ref unLen)));
                        }
                    }
                }
            }
            Arguments = new object[1] {
                info
            };
            if (RPCMsgLogManager.IsRecord)
            {
                RPCMsgLogManager.Receive(MSGIDType.CLIENT_OTHER_ENTITY_ATTRI_SYNC, Arguments);
            }
        }
Exemplo n.º 2
0
        protected override void DoDecode(byte[] data, ref int unLen)
        {
            var info = new AttachedInfo();

            info.id    = (uint)VUInt32.Instance.Decode(data, ref unLen); //entity unique id
            info.props = new List <KeyValuePair <EntityDefProperties, object> >();
            var entityParent = MogoWorld.Entities.GetValueOrDefault(info.id, null);

            if (entityParent != null)
            {
                var entity = entityParent.entity;
                while (unLen < data.Length)
                {//还有数据就解析
                    var index = VUInt16.Instance.Decode(data, ref unLen);
                    EntityDefProperties prop;
                    var flag = entity.Properties.TryGetValue((ushort)index, out prop);
                    if (flag)
                    {
                        info.props.Add(new KeyValuePair <EntityDefProperties, object>(prop, prop.VType.Decode(data, ref unLen)));
                    }
                }
            }
            //LoggerHelper.Debug("other attr sync : " + info.props.Count);
            Arguments = new object[2] {
                entityParent, info
            };
        }
        protected override void DoDecode(byte[] data, ref int unLen)
        {
            if (MogoWorld.thePlayer == null)
            {
                return;
            }
            var info = new AttachedInfo();

            info.props = new List <KeyValuePair <EntityDefProperties, object> >();
            var entity = MogoWorld.thePlayer.entity;

            if (entity != null)
            {
                while (unLen < data.Length)
                {//还有数据就解析
                    var index = VUInt16.Instance.Decode(data, ref unLen);
                    EntityDefProperties prop;
                    var flag = entity.Properties.TryGetValue((ushort)index, out prop);
                    if (flag)
                    {
                        info.props.Add(new KeyValuePair <EntityDefProperties, object>(prop, prop.VType.Decode(data, ref unLen)));
                    }
                }
            }
            Arguments = new object[1] {
                info
            };
        }
Exemplo n.º 4
0
 protected override void DoDecode(byte[] data, ref int unLen)
 {
     if (MogoWorld.thePlayer == null)
         return;
     var info = new AttachedInfo();
     info.props = new List<KeyValuePair<EntityDefProperties, object>>();
     var entity = MogoWorld.thePlayer.entity;
     if (entity != null)
     {
         while (unLen < data.Length)
         {//还有数据就解析
             var index = VUInt16.Instance.Decode(data, ref unLen);
             EntityDefProperties prop;
             var flag = entity.Properties.TryGetValue((ushort)index, out prop);
             if (flag)
                 info.props.Add(new KeyValuePair<EntityDefProperties, object>(prop, prop.VType.Decode(data, ref unLen)));
         }
     }
     Arguments = new object[1] { info };
 }
Exemplo n.º 5
0
 protected override void DoDecode(byte[] data, ref int unLen)
 {
     var info = new AttachedInfo();
     info.id = (uint)VUInt32.Instance.Decode(data, ref unLen); //entity unique id
     info.props = new List<KeyValuePair<EntityDefProperties, object>>();
     var entityParent = MogoWorld.Entities.GetValueOrDefault(info.id, null);
     if (entityParent != null)
     {
         var entity = entityParent.entity;
         while (unLen < data.Length)
         {//还有数据就解析
             var index = VUInt16.Instance.Decode(data, ref unLen);
             EntityDefProperties prop;
             var flag = entity.Properties.TryGetValue((ushort)index, out prop);
             if (flag)
                 info.props.Add(new KeyValuePair<EntityDefProperties, object>(prop, prop.VType.Decode(data, ref unLen)));
         }
     }
     //LoggerHelper.Debug("other attr sync : " + info.props.Count);
     Arguments = new object[2] { entityParent, info };
 }