Example #1
0
    public static IList MsgToServerList(MsgUnPacker unpacker)
    {
        IList list   = new ArrayList();
        int   msgLen = unpacker.PopInt();

        for (int i = 0; i < msgLen; i++)
        {
            ServerItem item = new ServerItem();
            item.Id    = unpacker.PopInt();
            item.Name  = unpacker.PopString();
            item.Ip    = unpacker.PopString();
            item.Count = unpacker.PopInt();
            list.Add(item);
        }
        return(list);
    }
Example #2
0
    static int PopInt(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        MsgUnPacker obj = (MsgUnPacker)LuaScriptMgr.GetNetObjectSelf(L, 1, "MsgUnPacker");
        int         o   = obj.PopInt();

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Example #3
0
    public static IList MsgToRoleList(MsgUnPacker unpacker)
    {
        IList list    = new ArrayList();
        int   roleLen = unpacker.PopInt();

        for (int i = 0; i < roleLen; i++)
        {
            RoleItem role = new RoleItem();
            role.Id      = unpacker.PopInt();
            role.OwnerId = unpacker.PopInt();
            role.Role_id = unpacker.PopString();
            role.Name    = unpacker.PopString();
            role.Level   = unpacker.PopInt();
            role.Gender  = unpacker.PopInt();
            list.Add(role);
        }
        return(list);
    }
Example #4
0
    public int GetInt(int index)
    {
        MsgUnPacker _unpacker = new MsgUnPacker(this.buff);

        _unpacker.skip(index);
        int rst = _unpacker.PopInt();

        _unpacker.Close();
        return(rst);
    }
Example #5
0
    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);
    }
Example #6
0
    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);
        }
    }
Example #7
0
    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);
    }
Example #8
0
    public static IList MsgToEquipItem(MsgUnPacker unpacker)
    {
        IList list = new ArrayList();
        int   len  = unpacker.PopInt();

        for (int i = 0; i < len; i++)
        {
            EquipItem item = new EquipItem();
            item.Id          = unpacker.PopInt();
            item.OwnerId     = unpacker.PopInt();
            item.EquipId     = unpacker.PopInt();
            item.Level       = unpacker.PopInt();
            item.Amount      = unpacker.PopInt();
            item.IsDress     = unpacker.PopBool();
            item.IsMan       = unpacker.PopBool();
            item.Type        = unpacker.PopString();
            item.EquipType   = unpacker.PopString();
            item.Price       = unpacker.PopInt();
            item.Star        = unpacker.PopInt();
            item.Quality     = unpacker.PopInt();
            item.EffectType  = unpacker.PopString();
            item.EffectValue = unpacker.PopInt();
            item.Hp          = unpacker.PopInt();
            item.Damage      = unpacker.PopInt();
            item.Fc          = unpacker.PopInt();
            list.Add(EquipMgr.Instance.ComposeTask(item));
        }
        return(list);
    }
Example #9
0
    internal static Player MsgToPlayer(MsgUnPacker unpacker)
    {
        Player player = new Player();

        player.Id           = unpacker.PopInt();
        player.Username     = unpacker.PopString();
        player.PhoneNum     = unpacker.PopString();
        player.Level        = unpacker.PopInt();
        player.Fc           = unpacker.PopInt();
        player.Exp          = unpacker.PopInt();
        player.DiamondCount = unpacker.PopInt();
        player.GoldCount    = unpacker.PopInt();
        player.Vit          = unpacker.PopInt();
        player.Toughen      = unpacker.PopInt();
        player.Hp           = unpacker.PopInt();
        player.Damage       = unpacker.PopInt();
        player.Vip          = unpacker.PopInt();
        return(player);
    }