internal static IList MsgToSkillList(MsgUnPacker unpacker) { IList list = new ArrayList(); int skillLen = unpacker.PopInt(); for (int i = 0; i < skillLen; i++) { SkillItem skill = new SkillItem(); skill.Id = unpacker.PopInt(); skill.OwnerID = unpacker.PopInt(); skill.SkillID = unpacker.PopInt(); skill.RoleType = unpacker.PopString(); skill.Type = unpacker.PopString(); skill.Pos = unpacker.PopString(); skill.ColdTime = unpacker.PopInt(); skill.Fc = unpacker.PopInt(); skill.Level = unpacker.PopInt(); SkillMgr.Instance.ComposeSkill(skill); list.Add(skill); } return(list); }
public void HandleMsg(MsgHandlerMgr ctx, MsgUnPacker unpacker) { UITools.log("MsgFilterHandler"); int status = unpacker.PopInt(); if (status == MsgProtocol.Error) { UITools.log("MsgFilterHandler === > Error"); string msg = unpacker.PopString(); unpacker.Close(); UITools.log(msg); UITools.ShowMsg(msg); } else if (status == MsgProtocol.Success) { ctx.NextHandler(unpacker); } }
public static IList MsgToTaskList(MsgUnPacker unpacker) { IList list = new ArrayList(); int taskLen = unpacker.PopInt(); for (int i = 0; i < taskLen; i++) { TaskEntity task = new TaskEntity(); task.Id = unpacker.PopInt(); task.TaskId = unpacker.PopInt(); task.OwnerId = unpacker.PopInt(); task.Type = unpacker.PopString(); task.Status = unpacker.PopInt(); task.GoldCount = unpacker.PopInt(); task.DiamondCount = unpacker.PopInt(); task.CurStage = unpacker.PopInt(); task.TotalStage = unpacker.PopInt(); list.Add(TaskMgr.Instance.ComposeTask(task)); } return(list); }