Ejemplo n.º 1
0
        public void Handle(SimpleProto data)
        {
            PlayerEntity player = SingletonManager.Get <FreeUiManager>().Contexts1.player.flagSelfEntity;

            if (player != null)
            {
                FreeData fd = (FreeData)player.freeData.FreeData;
                if (fd != null)
                {
                    byte[] bs = new byte[data.Ins.Count];
                    for (int i = 0; i < bs.Length; i++)
                    {
                        bs[i] = (byte)data.Ins[i];
                    }
                    try
                    {
                        List <ISkill> skills = (List <ISkill>)SerializeUtil.ByteToObject(bs);
                        foreach (var skill in skills)
                        {
                            fd.GetUnitSkill().AddSkill(skill);
                        }
                    }catch (Exception e)
                    {
                        _logger.ErrorFormat("client skill initial failed.\n{0}", e.StackTrace);
                    }
                }
            }
        }
Ejemplo n.º 2
0
 public virtual com.wd.free.item.FreeItem Clone()
 {
     if (cloneBytes == null)
     {
         cloneBytes = SerializeUtil.ObjectToByte(this);
     }
     com.wd.free.item.FreeItem fi = (com.wd.free.item.FreeItem)SerializeUtil.ByteToObject(cloneBytes);
     fi.gridHeight = this.gridHeight;
     fi.gridWidth  = this.gridHeight;
     return(fi);
 }
Ejemplo n.º 3
0
        private static object GetGameObject(string name)
        {
            CacheGameObject(name);

            return(SerializeUtil.ByteToObject(cache[name]));
        }
Ejemplo n.º 4
0
 public virtual com.cpkf.yyjd.tools.sql.WhereSQL Clone()
 {
     return((com.cpkf.yyjd.tools.sql.WhereSQL)SerializeUtil.ByteToObject(SerializeUtil.ObjectToByte(this)));
 }