Exemplo n.º 1
0
        void JoinUnlimitedGroup()
        {
            if (!user9527.IsOnline())
            {
                logger.DebugFormat("{0} offline, quit!", user9527.AppAccount);
                return;
            }

            user9527.JoinUnlimitedGroup(29516394685530112);
            Thread.Sleep(3 * 1000);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 加入不存在的无限大群测试
        /// </summary>
        void JoinInexistentUnlimitedGroup()
        {
            if (!leijun.IsOnline())
            {
                logger.ErrorFormat("{0} offline, quit!", leijun.AppAccount);
                return;
            }

            leijun.JoinUnlimitedGroup(12311111111111111L);
            logger.InfoFormat("JoinInexistentUnlimitedGroup, {0}, topicId:{1}", leijun.AppAccount, 12311111111111111L);
            Thread.Sleep(100);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 发送无限大群消息测试
        /// </summary>
        void SendUnlimitedGroupMessage()
        {
            if (!leijun.IsOnline())
            {
                logger.DebugFormat("{0} offline, quit!", leijun.AppAccount);
                return;
            }
            long topicId = long.Parse(leijun.CreateUnlimitedGroup("test"));

            Thread.Sleep(100);

            if (topicId == 0)
            {
                logger.ErrorFormat("SendUnlimitedGroupMessage CreateUnlimitedGroup error , {0}-->{1},uuid:{2}", leijun.AppAccount, topicId, leijun.Uuid);
                return;
            }
            if (!linbin.IsOnline())
            {
                logger.DebugFormat("{0} offline, quit!", linbin.AppAccount);
                return;
            }
            linbin.JoinUnlimitedGroup(topicId);
            Thread.Sleep(2000);
            leijun.QueryUnlimitedGroups();
            Thread.Sleep(2000);
            linbin.QueryUnlimitedGroups();
            String result = leijun.GetUnlimitedGroupUsersNum(topicId);

            logger.InfoFormat("SendUnlimitedGroupMessage  result:{0}", result);
            String userListResult = leijun.GetUnlimitedGroupUsers(4535345345);

            logger.InfoFormat("SendUnlimitedGroupMessage userListResult:{0}", userListResult);
            String packetId = null;

            for (int i = 0; i < 20; i++)
            {
                packetId = leijun.SendUnlimitedGroupMessage(topicId, UTF8Encoding.Default.GetBytes("Hi,everybody!" + DateTime.Now.ToString("u")));
                logger.DebugFormat("SendUnlimitedGroupMessage, {0}-->{1}, PacketId:{2},uuid:{3},uuid2:{4}", leijun.AppAccount, topicId, packetId, leijun.Uuid, linbin.Uuid);
                Thread.Sleep(10);
            }
            Thread.Sleep(20000);
            linbin.QuitUnlimitedGroup(topicId);
            Thread.Sleep(1000);

            bool dismissFlag = leijun.DismissUnlimitedGroup(topicId);

            logger.InfoFormat("SendUnlimitedGroupMessage, DismissUnlimitedGroup AppAccount:{0}-->topicId:{1}, PacketId:{2},uuid:{3},uuid2:{4}", leijun.AppAccount, topicId, packetId, leijun.Uuid, linbin.Uuid);

            Thread.Sleep(1000);

            //if (dismissFlag)
            //{
            //    logger.InfoFormat("DismissUnlimitedGroup sucesss, {0} topicId:{1},uuid:{2}", leijun.AppAccount, topicId, leijun.Uuid);
            //    //测试不存在的情况
            //    packetId = leijun.SendUnlimitedGroupMessage(topicId, UTF8Encoding.Default.GetBytes("Hi,everybody!" + DateTime.Now.ToString("u")));
            //}
            //else
            //{
            //    logger.InfoFormat("DismissUnlimitedGroup fail, {0} topicId:{1},uuid:{2}", leijun.AppAccount, topicId, leijun.Uuid);
            //}
        }