Example #1
0
    // Update is called once per frame
    void Update()
    {
        ByteBuffer buffer = MyUtilTools.tryToLogic("AdminMemberSearch");

        if (buffer != null)
        {
            int size = buffer.ReadInt();
            if (size > 0)
            {
                selectIndex = 0;
                users.Clear();
                for (int i = 0; i < size; i++)
                {
                    MainData.UserData user = new MainData.UserData();
                    user.deserialize(buffer);
                    users.Add(user);
                }
                refresh();
            }
            else
            {
                DialogUtil.tip("查找不到相关数据");
            }
        }
        buffer = MyUtilTools.tryToLogic("AdminUserResetPwd");
        if (buffer != null)
        {
            DialogUtil.tip(buffer.ReadString(), true);
        }
        buffer = MyUtilTools.tryToLogic("AdminUserCommit");
        if (buffer != null)
        {
            DialogUtil.tip("提交成功", true);
        }
    }
Example #2
0
    public static void deserializeAll(ByteBuffer data)
    {
        int size = data.ReadInt();

        for (int i = 0; i < size; i++)
        {
            MainData.UserData user = new MainData.UserData();
            user.deserialize(data);
            datas.Add(user);
        }
    }
Example #3
0
    // Update is called once per frame
    void Update()
    {
        int count_mjfk = 0, count_mjqr = 0;

        foreach (DealBody.Order order in orders)
        {
            if (order.state == 1)
            {
                count_mjfk++;
            }
            else if (order.state == 4)
            {
                count_mjqr++;
            }
        }
        bool flag = count_mjfk != mjfk.FindChild("suns").childCount || count_mjqr != mjqr.FindChild("suns").childCount;

        if (flag)
        {
            refresh();
        }
        ByteBuffer buffer = MyUtilTools.tryToLogic("AdminLookUser");

        if (buffer != null)
        {
            MainData.UserData user = new MainData.UserData();
            user.deserialize(buffer);
            refreshUser(user);
        }
        buffer = MyUtilTools.tryToLogic("AdminOrderRevoke");
        if (buffer != null)
        {
            DialogUtil.tip("撤销成功", true);
        }
        buffer = MyUtilTools.tryToLogic("AdminDealOrderUpdate");
        if (buffer != null)
        {
            DialogUtil.tip("操作成功", true);
        }
        Transform right = transform.FindChild("right");

        if (orders.Count == 0)
        {
            right.FindChild("order-help").gameObject.SetActive(false);
            right.FindChild("appraise").gameObject.SetActive(false);
            right.FindChild("user-look").gameObject.SetActive(false);
            return;
        }
    }
Example #4
0
    public static void deserializeModuleOne(ByteBuffer data)
    {
        byte flag = data.ReadByte();

        MainData.UserData user = new MainData.UserData();
        user.deserialize(data);
        if (flag == JustRun.ADD_FLAG)
        {
            datas.Add(user);
        }
        else if (flag == JustRun.DEL_FLAG)
        {
            for (int i = 0; i < datas.Count; i++)
            {
                MainData.UserData _user = datas[i];
                if (user.id == _user.id)
                {
                    datas.Remove(_user);
                    break;
                }
            }
        }
    }