示例#1
0
    private void OnEnable()
    {
        PlayerMyController.Instance.EnabledWindowCount++;
        CGetMessage msgPull = new CGetMessage
        {
            option   = "inventory",
            userdbid = World.Instance.selfDbid
        };

        World.Instance.myinventory = null;
        Client.Instance.Send(msgPull);
        StartCoroutine(ShowItems());
    }
示例#2
0
        private void OnRecvGetMessage(IChannel channel, Message message)
        {
            CGetMessage request  = message as CGetMessage;
            SGetMessage response = new SGetMessage();
            var         conn     = db.Instance.Connect();

            switch (request.option)
            {
            case "inventory":
                response.invent = db.Instance.GetInventory(request.userdbid, conn);
                break;

            case "market":
                response.items = db.Instance.GetMyMarket(request.userdbid, conn);
                break;
            }
            response.option = request.option;
            channel.Send(response);
            Console.WriteLine("Backend : Finish OnRecvBuy");
        }