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); } } } }
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); }
private static object GetGameObject(string name) { CacheGameObject(name); return(SerializeUtil.ByteToObject(cache[name])); }
public virtual com.cpkf.yyjd.tools.sql.WhereSQL Clone() { return((com.cpkf.yyjd.tools.sql.WhereSQL)SerializeUtil.ByteToObject(SerializeUtil.ObjectToByte(this))); }