Exemplo n.º 1
0
    //这里判断是否需要更新
    /// <summary>
    /// 检测更新
    /// </summary>
    /// <returns></returns>
    private updateStatus DetectionUpdate()
    {
        GameVersion newVersion = ServerVersion();

        fileName = "/" + newVersion.Version + "GY_Mahjong.apk";
        //比较本地版本信息与服务器版本信息
        try
        {
            string[] str1 = newVersion.Version.Split('.');
            string[] str2 = Application.version.Split('.');
            for (int i = 0; i < str1.Length; i++)
            {
                if (int.Parse(str1[i]) > int.Parse(str2[i]))
                {
                    downloadPath = newVersion.url;
                    return((updateStatus)newVersion.Status);
                }
            }
            return(updateStatus.NO);
        }
        catch (System.Exception e)
        {
            OutLog.log(e.ToString());
            return(updateStatus.NotNetWork);
        }
    }
Exemplo n.º 2
0
    public bool Send(byte[] data)
    {
        //---------------------------
        Connect();
        if (!Connected)
        {
            return(false);
        }
        int i = IntToByte.bytesToInt(data, 0);

        OutLog.log(i.ToString());
        Debug.Log("协议头 : " + i.ToString() + "   当前type : " + serverType);
        if (GameInfo.sendbyte == null || GameInfo.sendbyte != data || i == CreateHead.CSXYNUM + 1)
        {
            GameInfo.sendbyte = data;
            try
            {
                return(clientSocket.Send(data) > 0);
            }
            catch (Exception ex)
            {
                Debug.Log(ex.ToString());
                return(false);
            }
        }
        else
        {
            return(true);//重复发送的情况返回 发送成功。
        }
    }
Exemplo n.º 3
0
 private void ConnectServer()
 {
     try
     {
         clientSocket.Connect(endPort);
         Start();
     }
     catch (Exception e)
     {
         OutLog.log("无法连接到服务器端,请检查您的网络!!" + e);
     }
 }
Exemplo n.º 4
0
    private void DDZNew(int news, byte[] body)
    {
        switch (news)
        {
        case CreateHead.CSXYNUMD + 2002:
            DDZData.returnCreateRoom = ProtobufUtility.DeserializeProtobuf <ddzReturnCreateRoom>(body);
            Debug.Log("22002:" + DDZData.returnCreateRoom);
            OutLog.log("22002:服务端返回房间信息");
            break;

        case CreateHead.CSXYNUMD + 2004:
            DDZData.returnAddRoom = ProtobufUtility.DeserializeProtobuf <ddzReturnAddRoom>(body);
            Debug.Log("22004:" + DDZData.returnAddRoom);
            OutLog.log("22004:服务端返回加入信息");
            break;

        case CreateHead.CSXYNUMD + 2005:
            DDZData.returnUserInfo = ProtobufUtility.DeserializeProtobuf <ddzReturnUserInfo>(body);
            Debug.Log("22005:" + DDZData.returnUserInfo);
            OutLog.log("22005:服务端主动推送加入玩家信息");
            break;

        case CreateHead.CSXYNUMD + 2006:
            DDZData.returnStartGame = ProtobufUtility.DeserializeProtobuf <ddzReturnStartGame>(body);
            Debug.Log("22006:" + DDZData.returnStartGame);
            OutLog.log("22006:服务端返回主动推送游戏开始信息");
            break;

        case CreateHead.CSXYNUMD + 2008:
            DDZData.returnStart = ProtobufUtility.DeserializeProtobuf <ddzReturnStart>(body);
            Debug.Log("22008:" + DDZData.returnStart);
            OutLog.log("22008:开始游戏");
            break;

        case CreateHead.CSXYNUMD + 2010:
            DDZData.returnCallLandlord = ProtobufUtility.DeserializeProtobuf <ddzReturnCallLandlord>(body);
            Debug.Log("22010:" + DDZData.returnCallLandlord);
            OutLog.log("22010:服务器广播叫地主信息");
            break;

        case CreateHead.CSXYNUMD + 2013:
            DDZData.returnOutCard = ProtobufUtility.DeserializeProtobuf <ddzReturnOutCard>(body);
            Debug.Log("22013:" + DDZData.returnOutCard);
            OutLog.log("22013:出牌返回信息");
            break;

        case CreateHead.CSXYNUMD + 2014:
            DDZData.returnOutCardAll = ProtobufUtility.DeserializeProtobuf <ddzReturnOutCardAll>(body);
            Debug.Log("22014:" + DDZData.returnOutCardAll);
            OutLog.log("22014:广播出牌信息");
            break;
        }
    }
Exemplo n.º 5
0
 /// <summary>
 /// 接受从服务器发来的消息,根据不同消息号,分发给不同的方法
 /// </summary>
 public void ReceiveMessage()
 {
     try
     {
         while (true)
         {
             int    count;
             byte[] data = new byte[2048];
             // ms = new MemoryStream();
             while (0 != (count = clientSocket.Receive(data)))
             {
                 ms.Write(data, 0, count);
                 if (count != data.Length)
                 {
                     break;
                 }
                 // if (count < 1024) break;
             }
             while (ms.Length > 0)
             {
                 var datainfo  = ms.ToArray();
                 int number    = IntToByte.bytesToInt(datainfo, 0); //消息号
                 int length    = IntToByte.bytesToInt(datainfo, 4); //消息长度
                 int resnumber = IntToByte.bytesToInt(datainfo, 8); //返回消息号
                 Debug.Log(number + ",长度" + length + ",包长" + datainfo.Length); OutLog.log(number + ",长度" + length + ",包长" + datainfo.Length);
                 if (number < CreateHead.CSXYNUM || number > CreateHead.CSXYNUM * 2)
                 {
                     ms = new MemoryStream();
                     break;
                 }
                 if (length > ms.Length)
                 {
                     break;
                 }
                 byte[] body = new byte[length];
                 Array.Copy(datainfo, 12, body, 0, length);
                 ms = new MemoryStream();
                 if (datainfo.Length > length + 12)
                 {
                     ms.Write(datainfo, length + 12, datainfo.Length - length - 12);
                 }
                 //  Debug.Log(number);
                 MethodsByNew(number, body);
             }
         }
     }
     catch (Exception ex)
     {
         //Debug.Log(ex.ToString());
         OutLog.log("ReceiveMessage  error" + ex.ToString());
     }
 }
Exemplo n.º 6
0
    public void OnPointerClick()
    {
        if (!agreementTge.isOn)
        {
            FICWaringPanel._instance.Show("请阅读并同意用户协议!");
            return;
        }
        GPSManager.instance.StartCrt();
        GetTestUserInfo();
        loginButton.enabled = false;

        // myShareSdk.Authorize(PlatformType.WeChat);
        //myShareSdk.GetUserInfo(PlatformType.WeChat);
        OutLog.log("点击登陆 !");
        //Txt_Loading.text = "点击登录";
    }
Exemplo n.º 7
0
 void AuthResultHandler(int reqID, ResponseState state, PlatformType type, Hashtable data)
 {
     //Txt_Loading.text = "获取授权回调";
     if (state == ResponseState.Success)
     {
         //OutLog.PrintLog(MiniJSON.jsonEncode(result));
         //授权成功的话,获取用户信息
         // Txt_Loading.text = "授权成功";
         //myShareSdk.GetUserInfo(PlatformType.WeChat);
         OutLog.log("获取授权," + state + "::" + MiniJSON.jsonEncode(data));
         if (state == ResponseState.Success)
         {
             try
             {
                 GameInfo.NickName = data["nickname"].ToString();
                 GameInfo.OpenID   = data["openid"].ToString();
                 GameInfo.HeadImg  = data["headimgurl"].ToString();
                 GameInfo.Sex      = int.Parse(data["sex"].ToString());
                 //GameInfo.province = data["province"].ToString();
                 //GameInfo.city = data["city"].ToString();
                 GameInfo.unionid = data["unionid"].ToString();
                 //OutLog.PrintLog(MiniJSON.jsonEncode(data));
                 // Txt_Loading.text = "获取用户信息成功";
                 OutLog.log("微信获取openid:" + GameInfo.OpenID);
                 GameInfo.cs.SentUserLoginMessage(GameInfo.OpenID, GameInfo.NickName, GameInfo.Sex.ToString(), GameInfo.province, GameInfo.city, GameInfo.HeadImg, GameInfo.unionid, GameInfo.Latitude);
             }
             catch (Exception ex)
             {
                 EnableLoginButtons();
                 // Txt_Loading.text = ex.ToString();
                 OutLog.log("获取用户信息出错" + ex.ToString());
             }
         }
     }
     else if (state == ResponseState.Fail)
     {
         EnableLoginButtons();
         // Txt_Loading.text = "授权失败";
         //OutLog.PrintLog("fail! error code = " + result["error_code"] + "; error msg = " + result["error_msg"]);
     }
     else if (state == ResponseState.Cancel)
     {
         EnableLoginButtons();
         //  Txt_Loading.text = "授权取消";
         //OutLog.PrintLog("cancel !");
     }
 }
Exemplo n.º 8
0
    //房卡登录模式(?微信登录模式)
    public void OnPointerClick()
    {
        if (!agreementTge.isOn)
        {
            FICWaringPanel._instance.Show("请阅读并同意用户协议!");
            return;
        }
        GPSManager.instance.StartCrt();

        //myShareSdk.GetUserInfo(PlatformType.WeChat);
        GetTestUserInfo();
        //DisableLoginButtons();

        GameInfo.loginType = LoginType.fangka;

        OutLog.log("点击登陆 !");
        Txt_Loading.text = "点击登录";
    }
Exemplo n.º 9
0
 private void GetUserInfoResultHandler(int reqID, ResponseState state, PlatformType type, Hashtable data)
 {
     //Txt_Loading.text = "获取用户信息回调";
     OutLog.log("获取用户消息," + state + "::" + MiniJSON.jsonEncode(data));
     if (state == ResponseState.Success)
     {
         try
         {
             GameInfo.NickName = data["nickname"].ToString();
             GameInfo.OpenID   = data["openid"].ToString();
             GameInfo.HeadImg  = data["headimgurl"].ToString();
             GameInfo.Sex      = int.Parse(data["sex"].ToString());
             //GameInfo.province = data["province"].ToString();
             //GameInfo.city = data["city"].ToString();
             GameInfo.unionid = data["unionid"].ToString();
             //OutLog.PrintLog(MiniJSON.jsonEncode(data));
             // Txt_Loading.text = "获取用户信息成功";
             OutLog.log("微信获取openid:" + GameInfo.OpenID);
             //Txt_Loading.text += "微信获取openid:" + GameInfo.OpenID;
             GameInfo.Latitude = UnityEngine.Random.Range(1f, 1000f).ToString() + " , " + UnityEngine.Random.Range(1f, 1000f).ToString();
             GameInfo.cs.SentUserLoginMessage(GameInfo.OpenID, GameInfo.NickName, GameInfo.Sex.ToString(), GameInfo.province, GameInfo.city, GameInfo.HeadImg, GameInfo.unionid, GameInfo.Latitude);
         }
         catch (Exception ex)
         {
             // Txt_Loading.text = ex.ToString();
             OutLog.log("获取用户信息出错" + ex.ToString());
             EnableLoginButtons();
             //Err.text = ex.StackTrace + ex.Message;
         }
     }
     else if (state == ResponseState.Cancel)
     {
         //Txt_Loading.text = "获取用户信息取消";
         OutLog.log("获取用户信息取消");
         EnableLoginButtons();
     }
     else if (state == ResponseState.Fail)
     {
         // Txt_Loading.text = "获取用户信息失败";
         OutLog.log("获取用户信息失败");
         myShareSdk.Authorize(PlatformType.WeChat);
         EnableLoginButtons();
     }
 }
Exemplo n.º 10
0
    void LoadConfigFile()
    {
        if (!File.Exists(Application.persistentDataPath + "/Config.xml"))
        {
            TextAsset txt      = Resources.Load <TextAsset>("Configs/Config");
            byte[]    DataInfo = txt.bytes;
            using (FileStream fs = new FileStream(Application.persistentDataPath + "/Config.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite))
            {
                fs.Write(DataInfo, 0, DataInfo.Length);
            }
        }
        XmlDocument xml = new XmlDocument();

        xml.Load(Application.persistentDataPath + "/Config.xml");
        XmlNode ip = xml.SelectSingleNode("/data/SeverIP");

        Debug.Log("当前列表服务器IP:" + ip.InnerText);
        OutLog.Log("当前列表服务器IP:" + ip.InnerText);

        //GameInfo.listIp = ip.InnerText;
        //10.10.20.82
        //GameInfo.listIp = "47.104.183.97";
        GameInfo.listIp = "192.168.1.100";

        //XmlNode port = xml.SelectSingleNode("data/SeverPort");
        XmlNode port = xml.SelectSingleNode("data/SeverPort");

        Debug.Log("当前列表服务器prot:" + port.InnerText);
        OutLog.Log("当前列表服务器prot:" + port.InnerText);

        //GameInfo.listPort = port.InnerText;
        GameInfo.listPort = "2018";

        XmlNode certificat = xml.SelectSingleNode("data/Certificate");

        GameInfo.certificate = certificat.InnerText;
        OutLog.log("读取证书:" + GameInfo.certificate);
    }
Exemplo n.º 11
0
    /// <summary>
    /// 从服务器获取最新版本信息
    /// </summary>
    GameVersion ServerVersion()
    {
        GameVersion json = new GameVersion();
        WebClient   webC = new WebClient();

        byte[] data     = new byte[2014];
        string dataPath = "http://download.gzqyrj.com/Version/api/Values/GetVersion";

        try
        {
            data = webC.DownloadData(dataPath);
        }
        catch (System.Exception e)
        {
            OutLog.log("serverVersion error" + e);
            return(json);
        }
        string dataStr = Encoding.UTF8.GetString(data);

        json = JsonUtility.FromJson <GameVersion>(dataStr) as GameVersion;

        return(json);
    }
Exemplo n.º 12
0
    private void GetTestUserInfo()
    {
        GameInfo.Sex      = 0;// UnityEngine.Random.Range(1,3);
        GameInfo.province = "贵州";
        GameInfo.city     = "贵阳";
        GameInfo.unionid  = GameInfo.OpenID;
        GameInfo.NickName = "测试用户" + GameInfo.OpenID.Substring(0, 3);
        Debug.Log("登录");
        GameInfo.HeadImg = GameInfo.Sex == 1 ? headimg[UnityEngine.Random.Range(5, headimg.Length)] : headimg[UnityEngine.Random.Range(0, 5)];
        Debug.Log(GameInfo.Latitude);
        GameInfo.cs.SentUserLoginMessage(GameInfo.OpenID, GameInfo.NickName, GameInfo.Sex.ToString(), GameInfo.province, GameInfo.city, GameInfo.HeadImg, GameInfo.unionid, GameInfo.Latitude);
        OutLog.log("测试用户登录,openid:" + GameInfo.OpenID);
        //微信
        //GameInfo.Sex = int.Parse(data["sex"].ToString());
        //GameInfo.province = data["province"].ToString();
        //GameInfo.city = data["city"].ToString();
        //GameInfo.unionid = data["unionid"].ToString();

        //GameInfo.NickName = "测试用户";
        //GameInfo.OpenID = "abcdefghighklmn789654123";
        //GameInfo.HeadImg = "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1491977284065&di=2df0abbda86b7c08d617ccebc795222a&imgtype=0&src=http%3A%2F%2Fimg01.appcms.cc%2F20140729%2Ft01a%2Ft01a1b9594e2775c715.png";
        //GameInfo.cs.SentUserLoginMessage(GameInfo.OpenID, GameInfo.NickName, GameInfo.Sex.ToString(), GameInfo.province, GameInfo.city, GameInfo.HeadImg, GameInfo.unionid);
    }
Exemplo n.º 13
0
 public void SendDataToServer(byte[] sendData)
 {
     if (clientSocket != null)
     {
         if (clientSocket.Connected)
         {
             if (JudgeIsChangeSelfIpChange())
             {
                 clientSocket.Send(sendData);
             }
             else
             {
                 if (!GameInfo.isAllreadyStart)
                 {
                     FICWaringPanel._instance.Show("您的IP发生改变,房间已解散或退出,点击确定返回大厅!");
                     FICWaringPanel._instance.WarnningMethods = delegate { SceneManager.LoadScene("Scene_Hall"); };
                     nowSelfIp = Network.player.ipAddress;
                     ReconnnectServer();
                 }
                 else
                 {
                     AddServer();
                 }
             }
         }
         else
         {
             OutLog.log("clientsocket 没有连接,不能发送");
             AddServer();
         }
     }
     else
     {
         OutLog.log("clientsocket 为空,不能发送");
     }
 }
Exemplo n.º 14
0
    /// <summary>
    /// 当缺一门的牌确定后,将非缺门牌遮罩,只显示缺门牌,并排序到最右侧1-39筒。41-79条,81-119万,最开始调用的一次,之后的用其他方法
    /// </summary>
    /// <param name="queType"></param>
    public void OnQueYiMenButtonClick(GameInfo.QueType queType, bool ispaixu = true)
    {//每次调用的时候,清空所有遮罩,生成特定遮罩//修改为遍历所有手牌,而不只是清空masklist ,多个杠牌会出错??
        try
        {
            for (int i = 0; i < myCards.shouPaiGOList.Count; i++)
            {
                myCards.shouPaiGOList[i].GetComponent <MeshRenderer>().material.color = startGame.resetColor;
                myCards.shouPaiGOList[i].GetComponent <MJ_Event>().isCanOut           = true;
            }
        }
        catch (System.Exception ex)
        {
            OutLog.log("清空所有遮罩,异常!!!!!!!!!!!" + ex.ToString());
        }
        maskList.Clear();
        isHaveTiao = false;
        isHaveTong = false;
        isHaveWan  = false;

        switch (queType)
        {
        case GameInfo.QueType.Tong:
            foreach (GameObject item in myCards.shouPaiGOList)
            {
                if (item != null)
                {
                    if (item.GetComponent <MJ_SP>().HS < 10)
                    {
                        isHaveTong = true;
                        item.GetComponent <MJ_SP>().HS += 200;
                    }
                }
            }
            if (ispaixu)
            {
                myCards.SortAllShouPai();
            }
            foreach (GameObject item in myCards.shouPaiGOList)
            {
                if (item != null)
                {
                    if (item.GetComponent <MJ_SP>().HS > 200)
                    {
                        item.GetComponent <MJ_SP>().HS -= 200;
                    }
                    else if (isHaveTong)
                    {
                        item.GetComponent <MeshRenderer>().material.color = startGame.darkColor;
                        item.GetComponent <MJ_Event>().isCanOut           = false;
                        maskList.Add(item.gameObject);
                    }
                }
            }

            break;

        case GameInfo.QueType.Tiao:
            foreach (GameObject item in myCards.shouPaiGOList)
            {
                if (item != null)
                {
                    if (item.GetComponent <MJ_SP>().HS > 10 && item.GetComponent <MJ_SP>().HS < 20)
                    {
                        isHaveTiao = true;
                        item.GetComponent <MJ_SP>().HS += 200;
                    }
                }
            }
            if (ispaixu)
            {
                // GameInfo.PaiXu(myCards.shouPaiGOList, GameInfo.MJ_S_Flode);// 先排序,后减掉权重
                myCards.SortAllShouPai();
            }
            foreach (GameObject item in myCards.shouPaiGOList)
            {
                if (item != null)
                {
                    if (item.GetComponent <MJ_SP>().HS > 200)
                    {
                        item.GetComponent <MJ_SP>().HS -= 200;
                    }
                    else if (isHaveTiao)
                    {
                        item.GetComponent <MeshRenderer>().material.color = startGame.darkColor;
                        item.GetComponent <MJ_Event>().isCanOut           = false;
                        maskList.Add(item.gameObject);
                    }
                }
            }
            break;

        case GameInfo.QueType.Wan:
            foreach (GameObject item in myCards.shouPaiGOList)
            {
                if (item != null)
                {
                    if (item.GetComponent <MJ_SP>().HS > 20)
                    {
                        isHaveWan = true;
                    }
                }
            }
            if (ispaixu)
            {
                //GameInfo.PaiXu(myCards.shouPaiGOList, GameInfo.MJ_S_Flode);
                myCards.SortAllShouPai();
            }
            foreach (GameObject item in myCards.shouPaiGOList)
            {
                if (item != null)
                {
                    if (item.GetComponent <MJ_SP>().HS < 20 && isHaveWan)
                    {
                        item.GetComponent <MeshRenderer>().material.color = startGame.darkColor;
                        item.GetComponent <MJ_Event>().isCanOut           = false;
                        maskList.Add(item.gameObject);
                    }
                }
            }

            break;

        case GameInfo.QueType.no:
            if (ispaixu)
            {
                //GameInfo.PaiXu(myCards.shouPaiGOList, GameInfo.MJ_S_Flode);
                myCards.SortAllShouPai();
            }
            break;
        }
    }
Exemplo n.º 15
0
    // Update is called once per frame
    void Update()
    {
        if (GameInfo.returnGetRoomCard != null)
        {
            GameInfo.userRoomCard      = GameInfo.returnGetRoomCard.UserRoomCard;
            RoomCardNum.text           = GameInfo.userRoomCard + "";
            GameInfo.returnGetRoomCard = null;
        }
        //返回公告信息
        if (GameInfo.returnAnnouncement != null)
        {
            GameInfo.announcementInfo   = GameInfo.returnAnnouncement.announcement;
            GameInfo.returnAnnouncement = null;
        }
        if (GameInfo.returnServerIP != null)
        {
            GameInfo.ip     = GameInfo.returnServerIP.ip;
            GameInfo.port   = GameInfo.returnServerIP.port;
            GameInfo.status = GameInfo.returnServerIP.Status;

            OutLog.log("马上断开socket链接");
            GameInfo.cs.Closed();
            SendAddServer sendAddServer = new SendAddServer();//..CreateBuilder()
            sendAddServer.openid  = GameInfo.OpenID;
            sendAddServer.unionid = GameInfo.unionid;

            Debug.Log(GameInfo.OpenID);
            byte[] body = ProtobufUtility.GetByteFromProtoBuf(sendAddServer);
            byte[] data = CreateHead.CreateMessage(CreateHead.CSXYNUM + 1011, body.Length, 0, body);
            GameInfo.cs.serverType = ServerType.GameServer;

            OutLog.log("马上重新socket链接");
            GameInfo.cs.Send(data);

            OutLog.log("已经重新socket链接");
            if (GameInfo.status == 2)
            {
                GameInfo.room_id = int.Parse(GameInfo.returnServerIP.RoomID);
                Recon_Pel.SetActive(true);

                GameInfo.recon = true;
                isClosed       = true;
                print("断线重连");
                //提示用户有断线重联的情况, 跳转场景
                reconTip.SetActive(true);
                Invoke("ReEnterRoom", 3);
            }
            GameInfo.returnServerIP = null;
        }
        if (GameInfo.returnAddServer != null)
        {
            GameInfo.addStatus       = GameInfo.returnAddServer.status;
            GameInfo.returnAddServer = null;
        }
        if (Input.GetKeyUp(KeyCode.Escape))
        {
            FICWaringPanel._instance.ShowQuit();
            FICWaringPanel._instance.WarnningMethods = delegate { Application.Quit(); };
        }
        if (GameInfo.returnGameOperation != null)
        {
            ShowOperationStatus();
        }
    }
Exemplo n.º 16
0
    private void GYMJNew(int news, byte[] body)
    {
        switch (news)
        {
        case 12002:    //服务器返回房间信息
            GameInfo.returnCreatRoom = ProtobufUtility.DeserializeProtobuf <DNL.ReturnCreateRoom>(body);
            Debug.Log("12002:" + "返回房间信息" + GameInfo.returnCreatRoom.ToString());
            OutLog.log("12002:" + GameInfo.returnCreatRoom.ToString());
            break;

        case 10001:    //心跳

            GameInfo.UserHearbeat = 0;
            break;

        case 12004:    //服务器返回加入信息
            GameInfo.returnAddRoom = ProtobufUtility.DeserializeProtobuf <DNL.ReturnAddRoom>(body);
            Debug.Log("12004:" + GameInfo.returnAddRoom.ToString());
            OutLog.log("12004:服务器返回加入信息");
            break;

        case 12005:    //服务器主动推送加入玩家信息
            var returnUserInfo = ProtobufUtility.DeserializeProtobuf <DNL.ReturnUserInfo>(body);
            GameInfo.returnUserInfo = returnUserInfo;
            Debug.Log("12005:" + "服务端主动推送加入玩家信息" + returnUserInfo.ToString());
            OutLog.log("12005:服务端主动推送加入玩家信息");
            break;

        case 12006:    //服务器返回主动推送游戏开始信息
            var returnStartGame = ProtobufUtility.DeserializeProtobuf <DNL.ReturnStartGame>(body);
            GameInfo.returnStartGame = returnStartGame;
            Debug.Log("12006:" + "服务端推送游戏开始信息" + returnStartGame.ToString());
            OutLog.log("12006:服务端推送游戏开始信息");
            break;

        case 12008:    //服务器返回开始游戏
            var returnStart = ProtobufUtility.DeserializeProtobuf <DNL.ReturnStart>(body);
            GameInfo.returnStart = returnStart;
            Debug.Log("12008:" + "开始游戏" + returnStart.ToString());
            OutLog.log("12008:开始游戏");
            break;

        case 12010:    //服务器返回开始游戏
            var returnTTorTH = ProtobufUtility.DeserializeProtobuf <ReturnTTATH>(body);
            GameInfo.returnTTOrTH = returnTTorTH;
            Debug.Log("12010:" + "返回打出叫牌的集合" + returnTTorTH.ToString());
            OutLog.log("12010:返回打出叫牌的集合");
            break;

        case 13009:    //返回出牌信息,出牌方,出牌的花色
            var returnMsg = ProtobufUtility.DeserializeProtobuf <ReturnMsg>(body);
            GameInfo.returnMsg = returnMsg;
            Debug.Log("13009:" + "下发打出牌的消息" + returnMsg.ToString());
            OutLog.log("13009:下发打出牌的消息");
            break;

        case 13008:    //返回碰杠胡摸 四个信息和 方位
            var returnAll = ProtobufUtility.DeserializeProtobuf <ReturnAll>(body);
            GameInfo.returnAll = returnAll;
            Debug.Log("13008:" + "下发碰杠胡消息" + returnAll.ToString());
            OutLog.log("13008:下发碰杠胡消息");
            break;

        case CreateHead.CSXYNUM + 3003:    //返回摸牌
            var returnMP = ProtobufUtility.DeserializeProtobuf <ReturnMP>(body);
            GameInfo.returnMP = returnMP;
            Debug.Log(CreateHead.CSXYNUM + 3003 + "返回摸牌 " + returnMP.ToString());
            OutLog.log("13003:返回摸牌");
            break;

        case CreateHead.CSXYNUM + 4002:    //返回下发碰杠胡消息
            var returnPeng = ProtobufUtility.DeserializeProtobuf <ReturnPeng>(body);
            GameInfo.returnPeng = returnPeng;
            Debug.Log(CreateHead.CSXYNUM + 4002 + "下发碰杠胡后消息" + returnPeng.ToString());
            OutLog.log("14002:下发碰杠胡后消息");
            break;

        case CreateHead.CSXYNUM + 5002:    //返回听牌方位
            var returnBTMsg = ProtobufUtility.DeserializeProtobuf <ReturnBTMsg>(body);
            GameInfo.returnBTMSG = returnBTMsg;
            Debug.Log(CreateHead.CSXYNUM + 5002 + "返回听牌方位" + returnBTMsg.ToString());
            OutLog.log("15002:返回听牌方位");
            break;

        case CreateHead.CSXYNUM + 5013:    //返回听牌方位
            var returnTT = ProtobufUtility.DeserializeProtobuf <ReturnTT>(body);
            GameInfo.returnTT = returnTT;
            Debug.Log(CreateHead.CSXYNUM + 5013 + "返回天听方位(所有人)" + returnTT.ToString());
            OutLog.log("15013:返回天听方位(所有人)");
            break;

        case CreateHead.CSXYNUM + 6001:    //返回是否、
            var returnRecon = ProtobufUtility.DeserializeProtobuf <ReturnRecon>(body);
            GameInfo.returnRecon = returnRecon;
            Debug.Log(CreateHead.CSXYNUM + 6001 + "判断是否断线重连" + returnRecon.ToString());
            OutLog.log("16001:判断是否断线重连");
            break;

        case CreateHead.CSXYNUM + 7001:    //返回断线前消息
            var returnConnData = ProtobufUtility.DeserializeProtobuf <ReturnConnData>(body);
            GameInfo.returnConnData = returnConnData;
            Debug.Log(CreateHead.CSXYNUM + 7001 + "返回断线前信息" + returnConnData.ToString());
            OutLog.log("17001:返回断线前信息");
            break;

        case CreateHead.CSXYNUM + 7002:    //返回重新发牌信息
            var returnMsgList = ProtobufUtility.DeserializeProtobuf <ReturnMsgList>(body);
            GameInfo.returnMsgList = returnMsgList;
            Debug.Log(CreateHead.CSXYNUM + 7002 + "返回重发信息" + returnMsgList.ToString());
            OutLog.log("17002:返回重发信息");
            break;

        case CreateHead.CSXYNUM + 7004:    //返回活跃用户
            while (true)
            {
                if (GameInfo.returnHyUser == null)
                {
                    var returnHyUser = ProtobufUtility.DeserializeProtobuf <ReturnHyUser>(body);
                    GameInfo.returnHyUser = returnHyUser;
                    Debug.Log(CreateHead.CSXYNUM + 7004 + "返回活跃用户" + returnHyUser.ToString());
                    OutLog.log("17004:返回活跃用户");
                    break;
                }
                else
                {
                    Thread.Sleep(200);
                }
            }
            break;

        case CreateHead.CSXYNUM + 7005:    //返回翻鸡牌
            var returnFJ = ProtobufUtility.DeserializeProtobuf <ReturnFJ>(body);
            GameInfo.returnFJ = returnFJ;
            Debug.Log(CreateHead.CSXYNUM + 7005 + "返回翻鸡牌" + returnFJ.ToString());
            OutLog.log("17005:返回翻鸡牌");
            break;

        case CreateHead.CSXYNUM + 2009:    //返回打出叫牌的集合
            var returnTP = ProtobufUtility.DeserializeProtobuf <ReturnTP>(body);
            GameInfo.returnTP = returnTP;
            Debug.Log(CreateHead.CSXYNUM + 2009 + "返回打出叫牌的集合" + returnTP.ToString());
            OutLog.log("12009:返回打出叫牌的集合");
            break;

        case CreateHead.CSXYNUM + 7009:    //返回结算信息(全体)
            var returnJS = ProtobufUtility.DeserializeProtobuf <ReturnJS>(body);
            GameInfo.returnJS = returnJS;
            Debug.Log(CreateHead.CSXYNUM + 7009 + "返回结算信息(全体)" + returnJS.ToString());
            OutLog.log("17009:返回结算信息(全体)");
            break;

        case CreateHead.CSXYNUM + 5004:    //返回请求解散房间信息(所有人接收,客户端自主判断是否显示)
            var returnJSMsg = ProtobufUtility.DeserializeProtobuf <ReturnJSMsg>(body);
            GameInfo.returnJSMsg = returnJSMsg;
            Debug.Log(CreateHead.CSXYNUM + 5004 + "返回请求解散房间信息" + returnJSMsg.ToString());
            OutLog.log("15004:返回请求解散房间信息");
            break;

        case CreateHead.CSXYNUM + 5006:    //返回单个用户同意解散房间信息
            var returnJSByOnew = ProtobufUtility.DeserializeProtobuf <ReturnJSByOnew>(body);
            GameInfo.returnJSByOnew = returnJSByOnew;
            Debug.Log(CreateHead.CSXYNUM + 5006 + "返回单个用户同意信息" + returnJSByOnew.ToString());
            OutLog.log("15006:返回单个用户同意信息");
            break;

        case CreateHead.CSXYNUM + 5007:    //返回集体消息是否解散房间
            var returnALLIdea = ProtobufUtility.DeserializeProtobuf <ReturnAllIdea>(body);
            GameInfo.returnALLIdea = returnALLIdea;
            Debug.Log(CreateHead.CSXYNUM + 5007 + "返回集体消息是否解散房间" + returnALLIdea.ToString());
            OutLog.log("15007:返回集体消息是否解散房间");
            break;

        case CreateHead.CSXYNUM + 5009:    //服务端返回退出玩家
            var returnRemoveUser = ProtobufUtility.DeserializeProtobuf <ReturnRemoveUser>(body);
            GameInfo.returnRemoveUser = returnRemoveUser;
            Debug.Log(CreateHead.CSXYNUM + 5009 + "服务端返回退出玩家" + returnRemoveUser.ToString());
            OutLog.log("15009:服务端返回退出玩家");
            break;

        case CreateHead.CSXYNUM + 7003:    //返回房间信息
            var returnRoomMsg = ProtobufUtility.DeserializeProtobuf <ReturnRoomMsg>(body);
            GameInfo.returnRoomMsg = returnRoomMsg;
            Debug.Log(CreateHead.CSXYNUM + 7003 + "返回房间信息" + returnRoomMsg.ToString());
            OutLog.log("17003:返回房间信息");
            break;

        case CreateHead.CSXYNUM + 7008:    //玩家手牌集合
            var returnUserSPai = ProtobufUtility.DeserializeProtobuf <ReturnUserSPai>(body);
            GameInfo.returnUserSPai = returnUserSPai;
            Debug.Log(CreateHead.CSXYNUM + 7008 + "玩家手牌集合" + returnUserSPai.ToString());
            OutLog.log("17008:玩家手牌集合");
            break;

        case CreateHead.CSXYNUM + 5012:    //服务器下发定缺信息
            var returnAYM = ProtobufUtility.DeserializeProtobuf <ReturnAYM>(body);
            GameInfo.returnAYM = returnAYM;
            Debug.Log(CreateHead.CSXYNUM + 5012 + "返回缺牌信息" + returnAYM.ToString());
            OutLog.log("15012:返回缺牌信息");
            break;

        case CreateHead.CSXYNUM + 5015:    //返回胡牌(替换原3008的胡
            var returnHByType = ProtobufUtility.DeserializeProtobuf <ReturnHByType>(body);
            GameInfo.returnHByType = returnHByType;
            Debug.Log(CreateHead.CSXYNUM + 5015 + "返回胡牌" + returnHByType.ToString());
            OutLog.log("15015:返回胡牌");
            break;

        case CreateHead.CSXYNUM + 7006:    //返回剩余牌堆数目
            var returnPaiCount = ProtobufUtility.DeserializeProtobuf <ReturnPaiCount>(body);
            GameInfo.returnPaiCount = returnPaiCount;
            Debug.Log(CreateHead.CSXYNUM + 7006 + "返回剩余牌堆数" + returnPaiCount.ToString());
            OutLog.log("17006:返回剩余牌堆数");
            break;

        case CreateHead.CSXYNUM + 5014:
            var returnDJS = ProtobufUtility.DeserializeProtobuf <ReturnDJS>(body);
            GameInfo.returnDJS = returnDJS;
            Debug.Log(CreateHead.CSXYNUM + 5014 + "大结算信息" + returnDJS.ToString());
            OutLog.log("15014:大结算信息");
            break;

        case CreateHead.CSXYNUM + 5018:
            var returnZR = ProtobufUtility.DeserializeProtobuf <ReturnZR>(body);
            GameInfo.returnZR = returnZR;
            Debug.Log(CreateHead.CSXYNUM + 5018 + "下发责任鸡消息" + returnZR.ToString());
            OutLog.log("15018:下发责任鸡消息");
            break;

        case CreateHead.CSXYNUM + 5020:
            var returnZhuang = ProtobufUtility.DeserializeProtobuf <ReturnZhuang>(body);
            GameInfo.returnZhuang = returnZhuang;
            Debug.Log(CreateHead.CSXYNUM + 5020 + "返回庄" + returnZhuang.ToString());
            OutLog.log("15020:返回庄");
            break;

        case CreateHead.CSXYNUM + 5021:
            var returnHType = ProtobufUtility.DeserializeProtobuf <ReturnHType>(body);
            GameInfo.returnHType = returnHType;
            Debug.Log(CreateHead.CSXYNUM + 5021 + "返回胡信息" + returnHType.ToString());
            OutLog.log("15021:返回胡信息");
            break;

        case CreateHead.CSXYNUM + 5022:
            var returnGang = ProtobufUtility.DeserializeProtobuf <ReturnGang>(body);
            GameInfo.returnGang = returnGang;
            Debug.Log(CreateHead.CSXYNUM + 5022 + "返回杠消息" + returnGang.ToString());
            OutLog.log("15022:返回杠消息");
            break;

        case CreateHead.CSXYNUM + 7090:
            var returnRoomAdd = ProtobufUtility.DeserializeProtobuf <ReturnRoomAdd>(body);
            GameInfo.returnRoomAdd = returnRoomAdd;
            Debug.Log(CreateHead.CSXYNUM + 7090 + "返回加入房间状态" + returnRoomAdd.ToString());
            OutLog.log("17090:返回加入房间状态");
            break;

        case CreateHead.CSXYNUM + 7091:
            var returnDis = ProtobufUtility.DeserializeProtobuf <ReturnDis>(body);
            GameInfo.returnDis = returnDis;
            Debug.Log(CreateHead.CSXYNUM + 7091 + "返回用户距离" + returnDis.ToString());
            OutLog.log(returnDis.FW + "与" + returnDis.FWT + "相距:" + returnDis.dis);
            Debug.Log(returnDis.FW + "与" + returnDis.FWT + "相距:" + returnDis.dis);
            break;

        case CreateHead.CSXYNUM + 7092:
            var returnIsJ = ProtobufUtility.DeserializeProtobuf <ReturnIsJ>(body);
            GameInfo.returnIsJ = returnIsJ;
            Debug.Log(CreateHead.CSXYNUM + 7092 + "返回是否有相近用户" + returnIsJ.ToString());
            OutLog.log("17092:返回是否有相近用户");
            break;

        case CreateHead.CSXYNUM + 7093:
            var returnIPSame = ProtobufUtility.DeserializeProtobuf <ReturnIPSame>(body);
            GameInfo.returnIPSame = returnIPSame;
            Debug.Log(CreateHead.CSXYNUM + 7093 + "返回是否有相同IP" + returnIPSame.ToString());
            OutLog.log("17093:返回是否有相同IP");
            break;

        case CreateHead.CSXYNUM + 8003:
            var returnVoice = ProtobufUtility.DeserializeProtobuf <ReturnVoice>(body);
            GameInfo.returnVoice = returnVoice;
            Debug.Log(CreateHead.CSXYNUM + 8003 + "返回语音信息" + returnVoice.ToString());
            OutLog.log("18003:返回语音信息");
            break;

        case CreateHead.CSXYNUM + 8004:
            var returnConnectionStatus = ProtobufUtility.DeserializeProtobuf <ReturnConnectionStatus>(body);
            GameInfo.returnConnectionStatus = returnConnectionStatus;
            Debug.Log(CreateHead.CSXYNUM + 8004 + "返回连接状态" + returnConnectionStatus.ToString());
            OutLog.log(CreateHead.CSXYNUM + 8004 + returnConnectionStatus.ToString());
            break;

        case CreateHead.CSXYNUM + +7095:
            var returnIsJ5Seconds = ProtobufUtility.DeserializeProtobuf <ReturnIsJ5Seconds>(body);
            GameInfo.returnIsJ5Seconds = returnIsJ5Seconds;
            Debug.Log(CreateHead.CSXYNUM + 7095 + "每五秒返回是否有相近用户" + returnIsJ5Seconds.ToString());
            OutLog.log(CreateHead.CSXYNUM + 7095 + returnIsJ5Seconds.ToString());
            break;

        case CreateHead.CSXYNUM + +7096:
            var returnIPSame5Seconds = ProtobufUtility.DeserializeProtobuf <ReturnIPSame5Seconds>(body);
            GameInfo.returnIPSame5Seconds = returnIPSame5Seconds;
            Debug.Log(CreateHead.CSXYNUM + 7096 + "每五秒返回是否y有相同IP" + returnIPSame5Seconds.ToString());
            OutLog.log(CreateHead.CSXYNUM + 7096 + returnIPSame5Seconds.ToString());
            break;

        case CreateHead.CSXYNUM + +7097:
            var returnCloseGPS = ProtobufUtility.DeserializeProtobuf <ReturnCloseGPS>(body);
            GameInfo.returnCloseGPS = returnCloseGPS;
            Debug.Log(CreateHead.CSXYNUM + 7097 + "返回是否开启GPS" + returnCloseGPS.ToString());
            OutLog.log(CreateHead.CSXYNUM + 7097 + returnCloseGPS.ToString());
            break;

        case CreateHead.CSXYNUM + +7098:
            var returnCloseGPS5Seconds = ProtobufUtility.DeserializeProtobuf <ReturnCloseGPS5Seconds>(body);
            GameInfo.returnCloseGPS5Seconds = returnCloseGPS5Seconds;
            Debug.Log(CreateHead.CSXYNUM + 7098 + "返回是否开启GPS" + returnCloseGPS5Seconds.ToString());
            OutLog.log(CreateHead.CSXYNUM + 7098 + returnCloseGPS5Seconds.ToString());
            break;

        case CreateHead.CSXYNUM + +2011:
            var returnManaged = ProtobufUtility.DeserializeProtobuf <ReturnManaged>(body);
            GameInfo.returnManaged = returnManaged;
            Debug.Log(CreateHead.CSXYNUM + 2011 + "返回十秒出牌" + returnManaged.ToString());
            OutLog.log(CreateHead.CSXYNUM + 2011 + returnManaged.ToString());
            break;

        case CreateHead.CSXYNUM + +5010:
            var returnDisbandedFailure = ProtobufUtility.DeserializeProtobuf <ReturnDisbandedFailure>(body);
            GameInfo.returnDisbandedFailure = returnDisbandedFailure;
            Debug.Log(CreateHead.CSXYNUM + 5010 + "解散失败后,返回状态" + returnDisbandedFailure.ToString());
            OutLog.log("15010:解散失败后,返回状态");
            break;
        }
    }
Exemplo n.º 17
0
    /// <summary>
    /// 端口连接
    /// </summary>
    public void Connect()
    {
        IPAddress ipaddress;
        EndPoint  point;

        if (clientSocket != null && clientSocket.Connected)
        {
            return;
        }
        if (clientSocket != null)
        {
            try
            {
                clientSocket.Shutdown(SocketShutdown.Both);
            }
            catch (Exception)
            {
            }
            clientSocket.Close();
        }
        clientSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
        switch (GameInfo.cs.serverType)
        {
        case ServerType.ListServer:
            Debug.Log("列表服务器");
            ipaddress = IPAddress.Parse(GameInfo.listIp);
            point     = new IPEndPoint(ipaddress, int.Parse(GameInfo.listPort));
            OutLog.log("列表服务器" + GameInfo.listIp + GameInfo.listPort);
            break;

        case ServerType.GameServer:
            Debug.Log("游戏服务器");
            ipaddress = IPAddress.Parse(GameInfo.ip);
            point     = new IPEndPoint(ipaddress, int.Parse(GameInfo.port));
            OutLog.log("游戏服务器" + GameInfo.listIp + GameInfo.listPort);
            break;

        default:
            ipaddress = IPAddress.Parse(GameInfo.listIp);
            point     = new IPEndPoint(ipaddress, int.Parse(GameInfo.listPort));
            Debug.Log("服务器类型错误");
            break;
        }
        try
        {
            clientSocket.Connect(point);
        }
        catch (Exception e)
        {
            Debug.Log("连接失败" + e);
            return;
        }

        clientSocket.Blocking = true;
        if (!clientSocket.Connected)
        {
            Closed();
            Debug.Log("connect time out");
            OutLog.log("connect time out");
        }
        else
        {
            Debug.Log("connectSuccess");
            OutLog.log("connectSuccess");
            if (myThread != null)
            {
                myThread.Abort();
            }
            myThread = new Thread(new ThreadStart(ReceiveMessage));
            myThread.IsBackground = true;
            myThread.Start();
        }
    }
Exemplo n.º 18
0
    private void ListNew(int news, byte[] body)
    {
        switch (news)
        {
        case 11002:    //服务器返回登录信息
            GameInfo.returnlogin = ProtobufUtility.DeserializeProtobuf <ReturnLogin>(body);
            Debug.Log("11002:" + GameInfo.returnlogin);
            OutLog.log("11002:登录");
            break;

        //case CreateHead.CSXYNUM + 1://心跳
        case 10001:    //心跳

            GameInfo.UserHearbeat = 0;
            break;

        case CreateHead.CSXYNUM + 1010:
            var returnServerIP = ProtobufUtility.DeserializeProtobuf <ReturnServerIP>(body);
            GameInfo.returnServerIP = returnServerIP;
            Debug.Log(CreateHead.CSXYNUM + 1010 + "服务器返回IP和端口" + returnServerIP.ip.ToString() + " ," + returnServerIP.port);
            OutLog.log("11010:服务器返回IP和端口");
            break;

        case CreateHead.CSXYNUM + 1012:
            var returnAddServer = ProtobufUtility.DeserializeProtobuf <ReturnAddServer>(body);
            GameInfo.returnAddServer = returnAddServer;
            Debug.Log(CreateHead.CSXYNUM + 1012 + "连接上服务器后,服务器返回状态" + returnAddServer.ToString());
            OutLog.log("11012:连接上服务器后,服务器返回状态");
            break;

        case CreateHead.CSXYNUM + 8001:
            var returnAnnouncement = ProtobufUtility.DeserializeProtobuf <ReturnAnnouncement>(body);
            GameInfo.returnAnnouncement = returnAnnouncement;
            Debug.Log(CreateHead.CSXYNUM + 8001 + "返回公告信息" + returnAnnouncement.ToString());
            OutLog.log("18001:返回公告信息");
            break;

        case CreateHead.CSXYNUM + +9002:
            var returnUserRecord = ProtobufUtility.DeserializeProtobuf <ReturnUserRecord>(body);
            GameInfo.returnUserRecord = returnUserRecord;
            Debug.Log(CreateHead.CSXYNUM + 9002 + "返回用户战绩列表" + returnUserRecord.ToString());
            OutLog.log("19002:返回用户战绩列表");
            break;

        case CreateHead.CSXYNUM + +9004:
            var returnGetUserGamePlayback = ProtobufUtility.DeserializeProtobuf <ReturnGetUserGamePlayback>(body);
            GameInfo.returnGetUserGamePlayback = returnGetUserGamePlayback;
            Debug.Log(CreateHead.CSXYNUM + 9004 + "根据牌桌信息ID返回多局牌集合" + returnGetUserGamePlayback.ToString());
            OutLog.log("19004:根据牌桌信息ID返回多局牌集合");
            break;

        case CreateHead.CSXYNUM + +1031:
            var returnGroupInfo = ProtobufUtility.DeserializeProtobuf <ReturnGroupInfo>(body);
            GameInfo.returnGroupInfo = returnGroupInfo;
            Debug.Log(CreateHead.CSXYNUM + 1031 + "返回朋友圈信息" + returnGroupInfo.ToString());
            OutLog.log("11031:返回朋友圈信息");
            break;

        case CreateHead.CSXYNUM + +1061:
            var returnGroupApplyInfo = ProtobufUtility.DeserializeProtobuf <ReturnGroupApplyInfo>(body);
            GameInfo.returnGroupApplyInfo = returnGroupApplyInfo;
            Debug.Log(CreateHead.CSXYNUM + 1061 + "返回申请记录" + returnGroupApplyInfo.ToString());
            OutLog.log("11061:返回申请记录");
            break;

        case CreateHead.CSXYNUM + +1051:
            var returnPlayerList = ProtobufUtility.DeserializeProtobuf <ReturnPlayerList>(body);
            GameInfo.returnPlayerList = returnPlayerList;
            Debug.Log(CreateHead.CSXYNUM + 1051 + "获取圈内玩家列表" + returnPlayerList.ToString());
            OutLog.log("11051:获取圈内玩家列表");
            break;

        case CreateHead.CSXYNUM + +1052:
            var returnRecordList = ProtobufUtility.DeserializeProtobuf <ReturnRecordList>(body);
            GameInfo.returnRecordList = returnRecordList;
            Debug.Log(CreateHead.CSXYNUM + 1052 + "圈内玩家最近开房记录" + returnRecordList.ToString());
            OutLog.log("11052:圈内玩家最近开房记录");
            break;

        case CreateHead.CSXYNUM + +1081:
            var returnLobbyInfo = ProtobufUtility.DeserializeProtobuf <ReturnLobbyInfo>(body);
            GameInfo.returnLobbyInfo = returnLobbyInfo;
            Debug.Log(CreateHead.CSXYNUM + 1081 + "返回大厅信息" + returnLobbyInfo.ToString());
            OutLog.log("11081:返回大厅信息");
            break;

        case CreateHead.CSXYNUM + +1021:
            var returnGameOperation = ProtobufUtility.DeserializeProtobuf <ReturnGameOperation>(body);
            GameInfo.returnGameOperation = returnGameOperation;
            Debug.Log(CreateHead.CSXYNUM + 1021 + "返回操作是否成功" + returnGameOperation.ToString());
            OutLog.log("11021:返回操作是否成功");
            break;

        case CreateHead.CSXYNUM + +1041:
            var returnApplyToJoin = ProtobufUtility.DeserializeProtobuf <ReturnApplyToJoin>(body);
            GameInfo.returnApplyToJoin = returnApplyToJoin;
            Debug.Log(CreateHead.CSXYNUM + 1021 + "返回申请结果" + returnApplyToJoin.ToString());
            OutLog.log("11021:返回申请结果");
            break;

        case CreateHead.CSXYNUM + +1091:
            var returnQuitGroup = ProtobufUtility.DeserializeProtobuf <ReturnQuitGroup>(body);
            GameInfo.returnQuitGroup = returnQuitGroup;
            Debug.Log(CreateHead.CSXYNUM + 1091 + "返回退出结果" + returnQuitGroup.ToString());
            OutLog.log("11091:返回退出结果");
            break;

        case CreateHead.CSXYNUM + +1023:
            var returnGetRoomCard = ProtobufUtility.DeserializeProtobuf <ReturnGetRoomCard>(body);
            GameInfo.returnGetRoomCard = returnGetRoomCard;
            Debug.Log(CreateHead.CSXYNUM + 1023 + "返回房卡信息" + returnGetRoomCard.ToString());
            OutLog.log("11023:返回房卡信息");
            break;

        case CreateHead.CSXYNUM + +1104:
            var returnMessgae = ProtobufUtility.DeserializeProtobuf <ReturnMessgae>(body);
            GameInfo.returnMessgae = returnMessgae;
            Debug.Log(CreateHead.CSXYNUM + 1104 + "返回消息" + returnMessgae.ToString());
            OutLog.log("11104:返回消息");
            break;

        case CreateHead.CSXYNUM + +1033:
            var returnGroupInfoByGroupID = ProtobufUtility.DeserializeProtobuf <ReturnGroupInfoByGroupID>(body);
            GameInfo.returnGroupInfoByGroupID = returnGroupInfoByGroupID;
            Debug.Log(CreateHead.CSXYNUM + 1033 + "根据圈子ID返回朋友圈信息" + returnGroupInfoByGroupID.ToString());
            OutLog.log("11033:根据圈子ID返回朋友圈信息");
            break;

        case CreateHead.CSXYNUM + +1035:
            var returnGroupUserInfoByGroupID = ProtobufUtility.DeserializeProtobuf <ReturnGroupUserInfoByGroupID>(body);
            GameInfo.returnGroupUserInfoByGroupID = returnGroupUserInfoByGroupID;
            Debug.Log(CreateHead.CSXYNUM + 1035 + "根据圈子ID返回朋友圈用户信息" + returnGroupUserInfoByGroupID.ToString());
            OutLog.log("11035:根据圈子ID返回朋友圈用户信息");
            break;

        case CreateHead.CSXYNUM + +1111:
            var returnMessgaeList = ProtobufUtility.DeserializeProtobuf <ReturnMessgaeList>(body);
            GameInfo.returnMessgaeList = returnMessgaeList;
            Debug.Log(CreateHead.CSXYNUM + 1111 + "服务器返回消息集合" + returnMessgaeList.ToString());
            OutLog.log("11111: 服务器返回消息集合 ");
            break;
        }
    }
Exemplo n.º 19
0
    public void MethodsByNew(int news, byte[] body)
    {
        Debug.Log("newsNumber" + news.ToString());
        GameInfo.UserHearbeat = 0;
        switch (news)
        {
        case 11002:    //服务器返回登录信息
            //GameInfo.returnlogin = ReturnLogin.ParseFrom(body);
            GameInfo.returnlogin = ProtobufUtility.DeserializeProtobuf <ReturnLogin>(body);
            // Debug.Log("11002:" + GameInfo.returnlogin.Loginstat);
            OutLog.log("11002:登录");
            break;

        case 12002:    //服务器返回房间信息
            //GameInfo.returnCreatRoom = ReturnCreateRoom.ParseFrom(body);
            GameInfo.returnCreatRoom = ProtobufUtility.DeserializeProtobuf <ReturnCreateRoom>(body);
            Debug.Log("12002:" + "返回房间信息" + GameInfo.returnCreatRoom.ToString());
            //OutLog.log("12002:" + GameInfo.returnCreatRoom.ToString());
            break;

        case 12004:    //服务器返回加入信息
                       // GameInfo.returnAddRoom = ReturnAddRoom.ParseFrom(body);
            GameInfo.returnAddRoom = ProtobufUtility.DeserializeProtobuf <ReturnAddRoom>(body);
            Debug.Log("12004:" + GameInfo.returnAddRoom.ToString());
            OutLog.log("12004:服务器返回加入信息");
            break;

        case 12005:    //服务器主动推送加入玩家信息
            //var returnUserInfo = ReturnUserInfo.ParseFrom(body);
            var returnUserInfo = ProtobufUtility.DeserializeProtobuf <ReturnUserInfo>(body);
            GameInfo.returnUserInfo = returnUserInfo;
            Debug.Log("12005:" + "服务端主动推送加入玩家信息" + returnUserInfo.ToString());
            OutLog.log("12005:服务端主动推送加入玩家信息");
            break;

        case 12006:    //服务器返回主动推送游戏开始信息
                       // var returnStartGame = ReturnStartGame.ParseFrom(body);
            var returnStartGame = ProtobufUtility.DeserializeProtobuf <ReturnStartGame>(body);
            GameInfo.returnStartGame = returnStartGame;
            Debug.Log("12006:" + "服务端推送游戏开始信息" + returnStartGame.ToString());
            OutLog.log("12006:服务端推送游戏开始信息");
            break;

        case 12008:    //服务器返回开始游戏
            //var returnStart = ReturnStart.ParseFrom(body);
            var returnStart = ProtobufUtility.DeserializeProtobuf <ReturnStart>(body);
            GameInfo.returnStart = returnStart;
            Debug.Log("12008:" + "开始游戏" + returnStart.ToString());
            OutLog.log("12008:开始游戏");
            break;

        case 12010:    //服务器返回开始游戏
            //var returnTTorTH = ReturnTTATH.ParseFrom(body);
            var returnTTorTH = ProtobufUtility.DeserializeProtobuf <ReturnTTATH>(body);
            GameInfo.returnTTOrTH = returnTTorTH;
            Debug.Log("12010:" + "返回打出叫牌的集合" + returnTTorTH.ToString());
            OutLog.log("12010:返回打出叫牌的集合");
            break;

        case 13009:    //返回出牌信息,出牌方,出牌的花色
            //var returnMsg = ReturnMsg.ParseFrom(body);
            var returnMsg = ProtobufUtility.DeserializeProtobuf <ReturnMsg>(body);
            GameInfo.returnMsg = returnMsg;
            Debug.Log("13009:" + "下发打出牌的消息" + returnMsg.ToString());
            OutLog.log("13009:下发打出牌的消息");
            break;

        case 13008:    //返回碰杠胡摸 四个信息和 方位
                       //var returnAll = ReturnAll.ParseFrom(body);
            var returnAll = ProtobufUtility.DeserializeProtobuf <ReturnAll>(body);
            GameInfo.returnAll = returnAll;
            Debug.Log("13008:" + "下发碰杠胡消息" + returnAll.ToString());
            OutLog.log("13008:下发碰杠胡消息");
            break;

        case CreateHead.CSXYNUM + 3003:    //返回摸牌
            //var returnMP = ReturnMP.ParseFrom(body);
            var returnMP = ProtobufUtility.DeserializeProtobuf <ReturnMP>(body);
            GameInfo.returnMP = returnMP;
            Debug.Log(CreateHead.CSXYNUM + 3003 + "返回摸牌 " + returnMP.ToString());
            OutLog.log("13003:返回摸牌");
            break;

        case CreateHead.CSXYNUM + 4002:    //返回下发碰杠胡消息
            //var returnPeng = ReturnPeng.ParseFrom(body);
            var returnPeng = ProtobufUtility.DeserializeProtobuf <ReturnPeng>(body);
            GameInfo.returnPeng = returnPeng;
            Debug.Log(CreateHead.CSXYNUM + 4002 + "下发碰杠胡后消息" + returnPeng.ToString());
            OutLog.log("14002:下发碰杠胡后消息");
            break;

        case CreateHead.CSXYNUM + 5002:    //返回听牌方位
            //var returnBTMsg = ReturnBTMsg.ParseFrom(body);
            var returnBTMsg = ProtobufUtility.DeserializeProtobuf <ReturnBTMsg>(body);
            GameInfo.returnBTMSG = returnBTMsg;
            Debug.Log(CreateHead.CSXYNUM + 5002 + "返回听牌方位" + returnBTMsg.ToString());
            OutLog.log("15002:返回听牌方位");
            break;

        case CreateHead.CSXYNUM + 5013:    //返回听牌方位
            //var returnTT = ReturnTT.ParseFrom(body);
            var returnTT = ProtobufUtility.DeserializeProtobuf <ReturnTT>(body);
            GameInfo.returnTT = returnTT;
            Debug.Log(CreateHead.CSXYNUM + 5013 + "返回天听方位(所有人)" + returnTT.ToString());
            OutLog.log("15013:返回天听方位(所有人)");
            break;

        case CreateHead.CSXYNUM + 6001:    //返回是否、
            //var returnRecon = ReturnRecon.ParseFrom(body);
            var returnRecon = ProtobufUtility.DeserializeProtobuf <ReturnRecon>(body);
            GameInfo.returnRecon = returnRecon;
            Debug.Log(CreateHead.CSXYNUM + 6001 + "判断是否断线重连" + returnRecon.ToString());
            OutLog.log("16001:判断是否断线重连");
            break;

        case CreateHead.CSXYNUM + 7001:    //返回断线前消息
            //var returnConnData = ReturnConnData.ParseFrom(body);
            var returnConnData = ProtobufUtility.DeserializeProtobuf <ReturnConnData>(body);
            GameInfo.returnConnData = returnConnData;
            Debug.Log(CreateHead.CSXYNUM + 7001 + "返回断线前信息" + returnConnData.ToString());
            OutLog.log("17001:返回断线前信息");
            break;

        case CreateHead.CSXYNUM + 7002:    //返回重新发牌信息
            //var returnMsgList = ReturnMsgList.ParseFrom(body);
            var returnMsgList = ProtobufUtility.DeserializeProtobuf <ReturnMsgList>(body);
            GameInfo.returnMsgList = returnMsgList;
            //  Debug.Log(CreateHead.CSXYNUM + 7002 + "返回重发信息" + returnMsgList.ToString());
            OutLog.log("17002:返回重发信息");
            break;

        case CreateHead.CSXYNUM + 7004:    //返回活跃用户
            if (GameInfo.returnHyUser == null)
            {
                //var returnHyUser = ReturnHyUser.ParseFrom(body);
                var returnHyUser = ProtobufUtility.DeserializeProtobuf <ReturnHyUser>(body);
                GameInfo.returnHyUser = returnHyUser;
                Debug.Log(CreateHead.CSXYNUM + 7004 + "返回活跃用户" + returnHyUser.ToString());
                OutLog.log("17004:返回活跃用户");
                break;
            }

            break;

        case CreateHead.CSXYNUM + 7005:    //返回翻鸡牌
            //var returnFJ = ReturnFJ.ParseFrom(body);
            var returnFJ = ProtobufUtility.DeserializeProtobuf <ReturnFJ>(body);
            GameInfo.returnFJ = returnFJ;
            Debug.Log(CreateHead.CSXYNUM + 7005 + "返回翻鸡牌" + returnFJ.ToString());
            OutLog.log("17005:返回翻鸡牌");
            break;

        case CreateHead.CSXYNUM + 2009:    //返回打出叫牌的集合
            //var returnTP = ReturnTP.ParseFrom(body);
            var returnTP = ProtobufUtility.DeserializeProtobuf <ReturnTP>(body);
            GameInfo.returnTP = returnTP;
            Debug.Log(CreateHead.CSXYNUM + 2009 + "返回打出叫牌的集合" + returnTP.ToString());
            OutLog.log("12009:返回打出叫牌的集合");
            break;

        case CreateHead.CSXYNUM + 7009:    //返回结算信息(全体)
            //var returnJS = ReturnJS.ParseFrom(body);
            var returnJS = ProtobufUtility.DeserializeProtobuf <ReturnJS>(body);
            GameInfo.returnJS = returnJS;
            //  Debug.Log(CreateHead.CSXYNUM + 7009 + "返回结算信息(全体)" + returnJS.ToString());
            OutLog.log("17009:返回结算信息(全体)");
            break;

        case CreateHead.CSXYNUM + 5004:    //返回请求解散房间信息(所有人接收,客户端自主判断是否显示)
            //var returnJSMsg = ReturnJSMsg.ParseFrom(body);
            var returnJSMsg = ProtobufUtility.DeserializeProtobuf <ReturnJSMsg>(body);
            GameInfo.returnJSMsg = returnJSMsg;
            //  Debug.Log(CreateHead.CSXYNUM + 5004 + "返回请求解散房间信息" + returnJSMsg.ToString());
            OutLog.log("15004:返回请求解散房间信息");
            break;

        case CreateHead.CSXYNUM + 5006:    //返回单个用户同意解散房间信息
            //var returnJSByOnew = ReturnJSByOnew.ParseFrom(body);
            var returnJSByOnew = ProtobufUtility.DeserializeProtobuf <ReturnJSByOnew>(body);
            GameInfo.returnJSByOnew = returnJSByOnew;
            Debug.Log(CreateHead.CSXYNUM + 5006 + "返回单个用户同意信息" + returnJSByOnew.ToString());
            OutLog.log("15006:返回单个用户同意信息");
            break;

        case CreateHead.CSXYNUM + 5007:    //返回集体消息是否解散房间
            //var returnALLIdea = ReturnAllIdea.ParseFrom(body);
            var returnALLIdea = ProtobufUtility.DeserializeProtobuf <ReturnAllIdea>(body);
            GameInfo.returnALLIdea = returnALLIdea;
            Debug.Log(CreateHead.CSXYNUM + 5007 + "返回集体消息是否解散房间" + returnALLIdea.ToString());
            OutLog.log("15007:返回集体消息是否解散房间");
            break;

        case CreateHead.CSXYNUM + 5009:    //服务端返回退出玩家
            //var returnRemoveUser = ReturnRemoveUser.ParseFrom(body);
            var returnRemoveUser = ProtobufUtility.DeserializeProtobuf <ReturnRemoveUser>(body);
            GameInfo.returnRemoveUser = returnRemoveUser;
            Debug.Log(CreateHead.CSXYNUM + 5009 + "服务端返回退出玩家" + returnRemoveUser.ToString());
            OutLog.log("15009:服务端返回退出玩家");
            break;

        case CreateHead.CSXYNUM + 7003:    //返回房间信息
            //var returnRoomMsg = ReturnRoomMsg.ParseFrom(body);
            var returnRoomMsg = ProtobufUtility.DeserializeProtobuf <ReturnRoomMsg>(body);
            GameInfo.returnRoomMsg = returnRoomMsg;
            Debug.Log(CreateHead.CSXYNUM + 7003 + "返回房间信息" + returnRoomMsg.ToString());
            OutLog.log("17003:返回房间信息");
            break;

        case CreateHead.CSXYNUM + 7008:    //玩家手牌集合
            //var returnUserSPai = ReturnUserSPai.ParseFrom(body);
            var returnUserSPai = ProtobufUtility.DeserializeProtobuf <ReturnUserSPai>(body);
            GameInfo.returnUserSPai = returnUserSPai;
            Debug.Log(CreateHead.CSXYNUM + 7008 + "玩家手牌集合" + returnUserSPai.ToString());
            OutLog.log("17008:玩家手牌集合");
            break;

        case CreateHead.CSXYNUM + 5012:    //服务器下发定缺信息
            //var returnAYM = ReturnAYM.ParseFrom(body);
            var returnAYM = ProtobufUtility.DeserializeProtobuf <ReturnAYM>(body);
            GameInfo.returnAYM = returnAYM;
            Debug.Log(CreateHead.CSXYNUM + 5012 + "返回缺牌信息" + returnAYM.ToString());
            OutLog.log("15012:返回缺牌信息");
            break;

        case CreateHead.CSXYNUM + 5015:    //返回胡牌(替换原3008的胡
            //var returnHByType = ReturnHByType.ParseFrom(body);
            var returnHByType = ProtobufUtility.DeserializeProtobuf <ReturnHByType>(body);
            GameInfo.returnHByType = returnHByType;
            Debug.Log(CreateHead.CSXYNUM + 5015 + "返回胡牌" + returnHByType.ToString());
            OutLog.log("15015:返回胡牌");
            break;

        case CreateHead.CSXYNUM + 7006:    //返回剩余牌堆数目
            //var returnPaiCount = ReturnPaiCount.ParseFrom(body);
            var returnPaiCount = ProtobufUtility.DeserializeProtobuf <ReturnPaiCount>(body);
            GameInfo.returnPaiCount = returnPaiCount;
            Debug.Log(CreateHead.CSXYNUM + 7006 + "返回剩余牌堆数" + returnPaiCount.ToString());
            OutLog.log("17006:返回剩余牌堆数");
            break;

        case CreateHead.CSXYNUM + 1:    //心跳
            GameInfo.UserHearbeat = 0;
            break;

        case CreateHead.CSXYNUM + 5014:
            //var returnDJS = ReturnDJS.ParseFrom(body);
            var returnDJS = ProtobufUtility.DeserializeProtobuf <ReturnDJS>(body);
            GameInfo.returnDJS = returnDJS;
            Debug.Log(CreateHead.CSXYNUM + 5014 + "大结算信息" + returnDJS.ToString());
            OutLog.log("15014:大结算信息");
            break;

        case CreateHead.CSXYNUM + 5018:
            //var returnZR = ReturnZR.ParseFrom(body);
            var returnZR = ProtobufUtility.DeserializeProtobuf <ReturnZR>(body);
            GameInfo.returnZR = returnZR;
            Debug.Log(CreateHead.CSXYNUM + 5018 + "下发责任鸡消息" + returnZR.ToString());
            OutLog.log("15018:下发责任鸡消息");
            break;

        case CreateHead.CSXYNUM + 5020:
            //var returnZhuang = ReturnZhuang.ParseFrom(body);
            var returnZhuang = ProtobufUtility.DeserializeProtobuf <ReturnZhuang>(body);
            GameInfo.returnZhuang = returnZhuang;
            Debug.Log(CreateHead.CSXYNUM + 5020 + "返回庄" + returnZhuang.ToString());
            OutLog.log("15020:返回庄");
            break;

        case CreateHead.CSXYNUM + 5021:
            //var returnHType = ReturnHType.ParseFrom(body);
            var returnHType = ProtobufUtility.DeserializeProtobuf <ReturnHType>(body);
            GameInfo.returnHType = returnHType;
            Debug.Log(CreateHead.CSXYNUM + 5021 + "返回胡信息" + returnHType.ToString());
            OutLog.log("15021:返回胡信息");
            break;

        case CreateHead.CSXYNUM + 5022:
            //var returnGang = ReturnGang.ParseFrom(body);
            var returnGang = ProtobufUtility.DeserializeProtobuf <ReturnGang>(body);
            GameInfo.returnGang = returnGang;
            Debug.Log(CreateHead.CSXYNUM + 5022 + "返回杠消息" + returnGang.ToString());
            OutLog.log("15022:返回杠消息");
            break;

        case CreateHead.CSXYNUM + 7090:
            //var returnRoomAdd = ReturnRoomAdd.ParseFrom(body);
            var returnRoomAdd = ProtobufUtility.DeserializeProtobuf <ReturnRoomAdd>(body);
            GameInfo.returnRoomAdd = returnRoomAdd;
            Debug.Log(CreateHead.CSXYNUM + 7090 + "返回加入房间状态" + returnRoomAdd.ToString());
            OutLog.log("17090:返回加入房间状态");
            break;

        case CreateHead.CSXYNUM + 7091:
            //var returnDis = ReturnDis.ParseFrom(body);
            var returnDis = ProtobufUtility.DeserializeProtobuf <ReturnDis>(body);
            GameInfo.returnDis = returnDis;
            Debug.Log(CreateHead.CSXYNUM + 7091 + "返回用户距离" + returnDis.ToString());
            OutLog.log(returnDis.FW + "与" + returnDis.FWT + "相距:" + returnDis.dis);
            Debug.Log(returnDis.FW + "与" + returnDis.FWT + "相距:" + returnDis.dis);
            break;

        case CreateHead.CSXYNUM + 7092:
            //var returnIsJ = ReturnIsJ.ParseFrom(body);
            var returnIsJ = ProtobufUtility.DeserializeProtobuf <ReturnIsJ>(body);
            GameInfo.returnIsJ = returnIsJ;
            Debug.Log(CreateHead.CSXYNUM + 7092 + "返回是否有相近用户" + returnIsJ.ToString());
            OutLog.log("17092:返回是否有相近用户");
            break;

        case CreateHead.CSXYNUM + 7093:
            //var returnIPSame = ReturnIPSame.ParseFrom(body);
            var returnIPSame = ProtobufUtility.DeserializeProtobuf <ReturnIPSame>(body);
            GameInfo.returnIPSame = returnIPSame;
            Debug.Log(CreateHead.CSXYNUM + 7093 + "返回是否有相同IP" + returnIPSame.ToString());
            OutLog.log("17093:返回是否有相同IP");
            break;

        case CreateHead.CSXYNUM + 1010:
            //var returnServerIP = ReturnServerIP.ParseFrom(body);
            var returnServerIP = ProtobufUtility.DeserializeProtobuf <ReturnServerIP>(body);
            GameInfo.returnServerIP = returnServerIP;
            Debug.Log(CreateHead.CSXYNUM + 1010 + "服务器返回IP和端口" + returnServerIP.ToString());
            OutLog.log("11010:服务器返回IP和端口");
            break;

        case CreateHead.CSXYNUM + 1012:
            //var returnAddServer = ReturnAddServer.ParseFrom(body);
            var returnAddServer = ProtobufUtility.DeserializeProtobuf <ReturnAddServer>(body);
            GameInfo.returnAddServer = returnAddServer;
            Debug.Log(CreateHead.CSXYNUM + 1012 + "连接上服务器后,服务器返回状态" + returnAddServer.ToString());
            OutLog.log("11012:连接上服务器后,服务器返回状态");
            break;

        case CreateHead.CSXYNUM + 8001:
            //var returnAnnouncement = ReturnAnnouncement.ParseFrom(body);
            var returnAnnouncement = ProtobufUtility.DeserializeProtobuf <ReturnAnnouncement>(body);
            GameInfo.returnAnnouncement = returnAnnouncement;
            Debug.Log(CreateHead.CSXYNUM + 8001 + "返回公告信息" + returnAnnouncement.ToString());
            OutLog.log("18001:返回公告信息");
            break;

        case CreateHead.CSXYNUM + 8003:
            //var returnVoice = ReturnVoice.ParseFrom(body);
            var returnVoice = ProtobufUtility.DeserializeProtobuf <ReturnVoice>(body);
            GameInfo.returnVoice = returnVoice;
            Debug.Log(CreateHead.CSXYNUM + 8003 + "返回语音信息" + returnVoice.ToString());
            OutLog.log("18003:返回语音信息");
            break;

        case CreateHead.CSXYNUM + 8004:
            //var returnConnectionStatus = ReturnConnectionStatus.ParseFrom(body);
            var returnConnectionStatus = ProtobufUtility.DeserializeProtobuf <ReturnConnectionStatus>(body);
            GameInfo.returnConnectionStatus = returnConnectionStatus;
            Debug.Log(CreateHead.CSXYNUM + 8004 + "返回连接状态" + returnConnectionStatus.ToString());
            //OutLog.log(CreateHead.CSXYNUM + 8004 + returnConnectionStatus.ToString() );
            break;

        case CreateHead.CSXYNUM + +9002:
            //var returnUserRecord = ReturnUserRecord.ParseFrom(body);
            var returnUserRecord = ProtobufUtility.DeserializeProtobuf <ReturnUserRecord>(body);
            GameInfo.returnUserRecord = returnUserRecord;
            Debug.Log(CreateHead.CSXYNUM + 9002 + "返回用户战绩列表" + returnUserRecord.ToString());
            OutLog.log("19002:返回用户战绩列表");
            break;

        case CreateHead.CSXYNUM + +9004:
            //var returnGetUserGamePlayback = ReturnGetUserGamePlayback.ParseFrom(body);
            var returnGetUserGamePlayback = ProtobufUtility.DeserializeProtobuf <ReturnGetUserGamePlayback>(body);
            GameInfo.returnGetUserGamePlayback = returnGetUserGamePlayback;
            Debug.Log(CreateHead.CSXYNUM + 9004 + "根据牌桌信息ID返回多局牌集合" + returnGetUserGamePlayback.ToString());
            OutLog.log("19004:根据牌桌信息ID返回多局牌集合");
            break;

        case CreateHead.CSXYNUM + +7095:
            //var returnIsJ5Seconds = ReturnIsJ5Seconds.ParseFrom(body);
            var returnIsJ5Seconds = ProtobufUtility.DeserializeProtobuf <ReturnIsJ5Seconds>(body);
            GameInfo.returnIsJ5Seconds = returnIsJ5Seconds;
            Debug.Log(CreateHead.CSXYNUM + 7095 + "每五秒返回是否有相近用户" + returnIsJ5Seconds.ToString());
            //OutLog.log(CreateHead.CSXYNUM + 7095 + returnIsJ5Seconds.ToString() );
            break;

        case CreateHead.CSXYNUM + +7096:
            //var returnIPSame5Seconds = ReturnIPSame5Seconds.ParseFrom(body);
            var returnIPSame5Seconds = ProtobufUtility.DeserializeProtobuf <ReturnIPSame5Seconds>(body);
            GameInfo.returnIPSame5Seconds = returnIPSame5Seconds;
            Debug.Log(CreateHead.CSXYNUM + 7096 + "每五秒返回是否y有相同IP" + returnIPSame5Seconds.ToString());
            //OutLog.log(CreateHead.CSXYNUM + 7096 + returnIPSame5Seconds.ToString() );
            break;

        case CreateHead.CSXYNUM + +7097:
            //var returnCloseGPS = ReturnCloseGPS.ParseFrom(body);
            var returnCloseGPS = ProtobufUtility.DeserializeProtobuf <ReturnCloseGPS>(body);
            GameInfo.returnCloseGPS = returnCloseGPS;
            Debug.Log(CreateHead.CSXYNUM + 7097 + "返回是否开启GPS" + returnCloseGPS.ToString());
            //OutLog.log(CreateHead.CSXYNUM + 7097 + returnCloseGPS.ToString() );
            break;

        case CreateHead.CSXYNUM + +7098:
            var returnCloseGPS5Seconds = ProtobufUtility.DeserializeProtobuf <ReturnCloseGPS5Seconds>(body);
            GameInfo.returnCloseGPS5Seconds = returnCloseGPS5Seconds;
            Debug.Log(CreateHead.CSXYNUM + 7098 + "返回是否开启GPS" + returnCloseGPS5Seconds.ToString());
            //OutLog.log(CreateHead.CSXYNUM + 7098 + returnCloseGPS5Seconds.ToString() );
            break;

        case CreateHead.CSXYNUM + +2011:
            //var returnManaged = ReturnManaged.ParseFrom(body);
            var returnManaged = ProtobufUtility.DeserializeProtobuf <ReturnManaged>(body);
            GameInfo.returnManaged = returnManaged;
            Debug.Log(CreateHead.CSXYNUM + 2011 + "返回十秒出牌" + returnManaged.ToString());
            //OutLog.log(CreateHead.CSXYNUM + 2011 + returnManaged.ToString() );
            break;

        case CreateHead.CSXYNUM + +5010:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnDisbandedFailure = ProtobufUtility.DeserializeProtobuf <ReturnDisbandedFailure>(body);
            GameInfo.returnDisbandedFailure = returnDisbandedFailure;
            Debug.Log(CreateHead.CSXYNUM + 5010 + "解散失败后,返回状态" + returnDisbandedFailure.ToString());
            OutLog.log("15010:解散失败后,返回状态");
            break;

        case CreateHead.CSXYNUM + +1031:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnGroupInfo = ProtobufUtility.DeserializeProtobuf <ReturnGroupInfo>(body);
            GameInfo.returnGroupInfo = returnGroupInfo;
            Debug.Log(CreateHead.CSXYNUM + 1031 + "返回朋友圈信息" + returnGroupInfo.ToString());
            OutLog.log("11031:返回朋友圈信息");
            break;

        case CreateHead.CSXYNUM + +1061:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnGroupApplyInfo = ProtobufUtility.DeserializeProtobuf <ReturnGroupApplyInfo>(body);
            GameInfo.returnGroupApplyInfo = returnGroupApplyInfo;
            Debug.Log(CreateHead.CSXYNUM + 1061 + "返回申请记录" + returnGroupApplyInfo.ToString());
            OutLog.log("11061:返回申请记录");
            break;

        case CreateHead.CSXYNUM + +1051:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnPlayerList = ProtobufUtility.DeserializeProtobuf <ReturnPlayerList>(body);
            GameInfo.returnPlayerList = returnPlayerList;
            Debug.Log(CreateHead.CSXYNUM + 1051 + "获取圈内玩家列表" + returnPlayerList.ToString());
            OutLog.log("11051:获取圈内玩家列表");
            break;

        case CreateHead.CSXYNUM + +1052:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnRecordList = ProtobufUtility.DeserializeProtobuf <ReturnRecordList>(body);
            GameInfo.returnRecordList = returnRecordList;
            Debug.Log(CreateHead.CSXYNUM + 1052 + "圈内玩家最近开房记录" + returnRecordList.ToString());
            OutLog.log("11052:圈内玩家最近开房记录");
            break;

        case CreateHead.CSXYNUM + +1081:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnLobbyInfo = ProtobufUtility.DeserializeProtobuf <ReturnLobbyInfo>(body);
            GameInfo.returnLobbyInfo = returnLobbyInfo;
            Debug.Log(CreateHead.CSXYNUM + 1081 + "返回大厅信息" + returnLobbyInfo.ToString());
            OutLog.log("11081:返回大厅信息");
            break;

        case CreateHead.CSXYNUM + +1021:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnGameOperation = ProtobufUtility.DeserializeProtobuf <ReturnGameOperation>(body);
            GameInfo.returnGameOperation = returnGameOperation;
            Debug.Log(CreateHead.CSXYNUM + 1021 + "返回操作是否成功" + returnGameOperation.ToString());
            OutLog.log("11021:返回操作是否成功");
            break;

        case CreateHead.CSXYNUM + +1041:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnApplyToJoin = ProtobufUtility.DeserializeProtobuf <ReturnApplyToJoin>(body);
            GameInfo.returnApplyToJoin = returnApplyToJoin;
            Debug.Log(CreateHead.CSXYNUM + 1021 + "返回申请结果" + returnApplyToJoin.ToString());
            OutLog.log("11021:返回申请结果");
            break;

        case CreateHead.CSXYNUM + +1091:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnQuitGroup = ProtobufUtility.DeserializeProtobuf <ReturnQuitGroup>(body);
            GameInfo.returnQuitGroup = returnQuitGroup;
            Debug.Log(CreateHead.CSXYNUM + 1091 + "返回退出结果" + returnQuitGroup.ToString());
            OutLog.log("11091:返回退出结果");
            break;

        case CreateHead.CSXYNUM + +1023:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnGetRoomCard = ProtobufUtility.DeserializeProtobuf <ReturnGetRoomCard>(body);
            GameInfo.returnGetRoomCard = returnGetRoomCard;
            Debug.Log(CreateHead.CSXYNUM + 1023 + "返回房卡信息" + returnGetRoomCard.ToString());
            OutLog.log("11023:返回房卡信息");
            break;

        case CreateHead.CSXYNUM + +1104:
            //var returnDisbandedFailure = ReturnDisbandedFailure.ParseFrom(body);
            var returnMessgae = ProtobufUtility.DeserializeProtobuf <ReturnMessgae>(body);
            GameInfo.returnMessgae = returnMessgae;
            Debug.Log(CreateHead.CSXYNUM + 1104 + "返回消息" + returnMessgae.ToString());
            OutLog.log("11104:返回消息");
            break;
        }
    }