Exemplo n.º 1
0
        public TestFrom()
        {
            Debuger.EnableLog = 1;//开启日志打印 0关闭 1控制台下日志 2unity3d日志 日志打印请使用Debuger.Log
            //链接登录服务器
            KWXFrom.GetIns.Login_ = this;
            KWXFrom.GetIns.InitLoginFrom("172.16.10.153", 4000);
            Random RANG = new Random();

            Console.ReadLine();
            //测试登陆
            CMD_Login LOGINitem = new CMD_Login()
            {
                UserID = (ulong)RANG.Next(1, 99999999), Password = "******", WeiXinCode = "12345"
            };

            KWXFrom.GetIns.LoginCmd.SendLoginGame(LOGINitem, null);
            Console.ReadLine();
            Debuger.Log("回车代表创建房间 其他任意键+回车 代表进入房间");
            if (Console.ReadLine() == "")
            {
                //测试创建房间
                CMD_CreateRoom creatroom = new CMD_CreateRoom()
                {
                    GameName = "CSMJ", Rule = "哈哈", RoundCount = 8
                };
                KWXFrom.GetIns.LoginCmd.SendCreatRoom(creatroom);
                Console.ReadLine();
            }
            else
            {
                Debuger.Log("请输入 房间号");
                //测试进入房间
                uint          RoomIDD = uint.Parse(Console.ReadLine());
                CMD_EnterRoom entroom = new CMD_EnterRoom()
                {
                    RoomID = RoomIDD
                };
                KWXFrom.GetIns.LoginCmd.SendEntRoom(entroom);
                m_result          = new RSP_CreateRoom();
                m_result.RoomID   = RoomIDD;
                m_result.Password = m_Loginresult.Password;
                Console.ReadLine();
            }

            int BaoLiCeShi = 0;

            while (BaoLiCeShi < 200)
            {
                //心跳测试
                CMD_HeartBeat HeartBeat_ = new CMD_HeartBeat();
                KWXFrom.GetIns.GameCmd.SendHeartBeat(HeartBeat_);
                BaoLiCeShi++;
                Debuger.Log("心跳暴力测试 次数:" + BaoLiCeShi);
                //Console.ReadLine();
            }
        }
Exemplo n.º 2
0
    public void CreateRoom()
    {
        CMD_CreateRoom creatroom = new CMD_CreateRoom()
        {
            GameName = "CSMJ", Rule = "哈哈", RoundCount = JuShu
        };

        GameManage.GetInstan.JuShu = creatroom.RoundCount;
        KWXFrom.GetIns.LoginCmd.SendCreatRoom(creatroom);
    }
Exemplo n.º 3
0
        public void SendCreatRoom(CMD_CreateRoom item)//创建房间
        {
            byte[] temp = ProtoBufSerialize <CMD_CreateRoom> .Serialize(item);

            NET_KWX.Instance_.LoginSendDate(2, temp, LOGINitem);
        }