Esempio n. 1
0
        public override NET_RESULT_DEFINE.PACKET_EXE Execute(PacketBase pPacket, ref Peer pPlayer)
        {
            LCStatus msg = (LCStatus)pPacket;

            //Console.WriteLine("LCStatus Recv : packetId:" + msg.getPacketID() +
            //", packetSize:" + msg.getPacketSize() +
            //", 当前排队序列:" + msg.M_TurnNumber +
            //", 当前排队状态:" + msg.M_ClientStatus);

            //LogManager.Log("LCStatus Recv : packetId:" + msg.getPacketID() +
            //", packetSize:" + msg.getPacketSize() +
            //", 当前排队序列:" + msg.M_TurnNumber +
            //", 当前排队状态:" + msg.M_ClientStatus);
            LogManager.Log("RECV LCStatus: " + msg.M_ClientStatus);

            if (null == pPacket)
            {
                return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE);
            }

            NET_RESULT_DEFINE.CLIENT_TURN_STATUS res = msg.M_ClientStatus;
            switch (res)
            {
            case NET_RESULT_DEFINE.CLIENT_TURN_STATUS.CTS_NORMAL:
            {
                GameProcedure.s_ProcLogIn.ChangeToCharacterSel();
                break;
            }

            case NET_RESULT_DEFINE.CLIENT_TURN_STATUS.CTS_TURN:
            {
                int    iTurn   = msg.M_TurnNumber;
                char[] bufInfo = new char[1024];

                //memset(bufInfo, 0, sizeof(bufInfo));
                //_stprintf(bufInfo, "服务器已满,你被排在 %d 名", iTurn);
                //CGameProcedure::s_pEventSystem->PushEvent( GE_GAMELOGIN_SHOW_SYSTEM_INFO_NO_BUTTON, bufInfo);
                break;
            }
            }
            return(NET_RESULT_DEFINE.PACKET_EXE.PACKET_EXE_CONTINUE);
        }
Esempio n. 2
0
        public async Task Send()
        {
            await LCUser.BecomeWithSessionToken(user1.SessionToken);

            // 给粉丝发送状态
            LCStatus status = new LCStatus {
                Data = new Dictionary <string, object> {
                    { "image", "xxx.jpg" },
                    { "content", "hello, world" }
                }
            };
            await LCStatus.SendToFollowers(status);

            // 给某个用户发送私信
            LCStatus privateStatus = new LCStatus {
                Data = new Dictionary <string, object> {
                    { "image", "xxx.jpg" },
                    { "content", "hello, game" }
                }
            };
            await LCStatus.SendPrivately(privateStatus, user2.ObjectId);
        }
Esempio n. 3
0
        public async Task Query()
        {
            await Task.Delay(5000);

            await LCUser.BecomeWithSessionToken(user2.SessionToken);

            LCStatusCount statusCount = await LCStatus.GetCount(LCStatus.InboxTypeDefault);

            Assert.Greater(statusCount.Total, 0);
            LCStatusCount privateCount = await LCStatus.GetCount(LCStatus.InboxTypePrivate);

            Assert.Greater(privateCount.Total, 0);

            LCStatusQuery query = new LCStatusQuery(LCStatus.InboxTypeDefault);
            ReadOnlyCollection <LCStatus> statuses = await query.Find();

            foreach (LCStatus status in statuses)
            {
                Assert.AreEqual((status["source"] as LCObject).ObjectId, user1.ObjectId);
                await status.Delete();
            }

            await LCStatus.ResetUnreadCount(LCStatus.InboxTypePrivate);
        }