private void processSocketMsg(SocketMsg <Dictionary <string, string> > msg) { if (msg == null || msg.data == null) { Debug.Log("message is null"); return; } dicRegLogRespon = msg.data.data as Dictionary <string, string>; switch (msg.data.type) { case SocketEventType.InitConnect: accountHandler.OnReceive(ReqEventType.init, msg.target); //_wabData.ThreadStart(); break; case SocketEventType.PassWordLogin: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("login error"); return; } if (accountHandler.OnReceive(ReqEventType.login, dicRegLogRespon["desc"])) { if (dicRegLogRespon.ContainsKey("token")) { // CacheData.Instance().Token= dicRegLogRespon["token"].ToString(); PlayerPrefs.SetString("token", dicRegLogRespon["token"].ToString()); } WebData.isLogin = true; } break; case SocketEventType.CodeLogin: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("codeLogin error"); return; } if (accountHandler.OnReceive(ReqEventType.login, dicRegLogRespon["desc"])) { if (dicRegLogRespon.ContainsKey("token")) { //CacheData.Instance().Token= dicRegLogRespon["token"].ToString(); PlayerPrefs.SetString("token", dicRegLogRespon["token"].ToString()); } WebData.isLogin = true; } break; case SocketEventType.Regist: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("reg error"); return; } accountHandler.OnReceive(ReqEventType.regist, dicRegLogRespon["desc"]); break; case "voice": // setHandler.OnReceive(ReqEventType.voiceset, msg.data.t); break; case SocketEventType.ChangPassWord: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("expw error"); return; } setHandler.OnReceive(ReqEventType.expw, dicRegLogRespon["desc"]); break; case SocketEventType.SetExchangePassWord: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("expwshop error"); return; } setHandler.OnReceive(ReqEventType.expw, dicRegLogRespon["desc"]); break; case SocketEventType.SendMt: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("sendmt error"); return; } commerceHander.OnReceive(ReqEventType.commerce_sendmt, dicRegLogRespon); break; case SocketEventType.AddFriend: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("addfriend error"); return; } friendHandler.OnReceive(ReqEventType.addfriend, dicRegLogRespon["desc"]); break; case SocketEventType.LikeFriend: // friendHandler.OnReceive(ReqEventType.likefriend, msg.data.t["desc"]); break; //case SocketEventType.SearchFriend: // SquareUser searchUser = msg.data.t as SquareUser; // friendHandler.OnReceive(ReqEventType.searchfriend, msg.data.t); // break; case SocketEventType.GetCode: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("code")) { Debug.LogError("getCode error"); return; } accountHandler.OnReceive(ReqEventType.identy, msg.data.data["code"]); break; case SocketEventType.ForgerPassWord: //忘记密码响应和修改一样 //setHandler.OnReceive(ReqEventType) if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("pwforget error"); return; } setHandler.OnReceive(ReqEventType.expw, dicRegLogRespon["desc"]); break; case SocketEventType.PropertyInfo: break; case SocketEventType.TransferAccount: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("transferaccount error"); return; } accountHandler.OnReceive(ReqEventType.transfer, dicRegLogRespon["desc"]); break; case "recharge": break; case SocketEventType.InvestInfo: if (dicRegLogRespon == null || !dicRegLogRespon.ContainsKey("desc")) { Debug.LogError("playerInvest error"); return; } investHandler.OnReceive(ReqEventType.invest_req, dicRegLogRespon["desc"]); break; default: break; } }
/// <summary> /// 账户 /// </summary> /// <param name="msg"></param> private void processSocketMsg(SocketMsg <Dictionary <string, object> > msg) { if (msg?.data == null) { Debug.Log("message is null"); return; } dicRegLogRespon = msg.data.data as Dictionary <string, object>; switch (msg.data.type) { case SocketEventType.InitConnect: accountHandler.OnReceive(ReqEventType.init, msg.target); //_wabData.ThreadStart(); break; case SocketEventType.PassWordLogin: if (accountHandler.OnReceive(ReqEventType.login, msg.data.code)) { if (dicRegLogRespon.ContainsKey("token")) { // CacheData.Instance().Token= dicRegLogRespon["token"].ToString(); PlayerPrefs.SetString("token", dicRegLogRespon["token"].ToString()); PlayerPrefs.SetString("playerId", dicRegLogRespon["playerId"].ToString()); } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_ACTIVE, true); WebData.isLogin = true; } break; case SocketEventType.CodeLogin: if (accountHandler.OnReceive(ReqEventType.login, msg.data.code)) { if (dicRegLogRespon.ContainsKey("token")) { //CacheData.Instance().Token= dicRegLogRespon["token"].ToString(); PlayerPrefs.SetString("token", dicRegLogRespon["token"].ToString()); PlayerPrefs.SetString("playerId", dicRegLogRespon["playerId"].ToString()); } WebData.isLogin = true; } break; case SocketEventType.Regist: accountHandler.OnReceive(ReqEventType.regist, msg.data.code); break; case SocketEventType.ChangPassWord: setHandler.OnReceive(ReqEventType.expw, msg.data.code); break; case SocketEventType.ChangeShopPass: setHandler.OnReceive(ReqEventType.expwshop, msg.data.code); break; case SocketEventType.SendMt: commerceHander.OnReceive(ReqEventType.commerce_sendmt, msg.data.code); break; case SocketEventType.AddFriend: friendHandler.OnReceive(ReqEventType.addfriend, msg.data.code); break; case SocketEventType.LikeFriend: // friendHandler.OnReceive(ReqEventType.likefriend, msg.data.t["code"]); break; //case SocketEventType.SearchFriend: // SquareUser searchUser = msg.data.t as SquareUser; // friendHandler.OnReceive(ReqEventType.searchfriend, msg.data.t); // break; case SocketEventType.GetCode: accountHandler.OnReceive(ReqEventType.identy, msg.data.data["code"]); break; case SocketEventType.ForgerPassWord: accountHandler.OnReceive(ReqEventType.pwforget, msg.data.code); break; case SocketEventType.PropertyInfo: PropertyInfo propertyInfo = new PropertyInfo(); propertyInfo.accumulated_total_income = double.Parse(msg.data.data["total_income"].ToString()); propertyInfo.total_property = msg.data.data["total_property"].ToString(); propertyInfo.total_usdt = msg.data.data["total_usdt"].ToString(); propertyInfo.total_mt = msg.data.data["total_mt"].ToString(); propertyInfo.available_usdt = msg.data.data["available_usdt"].ToString(); propertyInfo.available_mt = msg.data.data["available_mt"].ToString(); propertyInfo.frozen_usdt = msg.data.data["frozen_usdt"].ToString(); propertyInfo.frozen_mt = msg.data.data["frozen_mt"].ToString(); //propertyInfo.commerce_lv = msg.data.data["commerce_lv"].ToString(); propertyInfo.commerce_member = msg.data.data["commerce_member"].ToString(); propertyInfo.invite = msg.data.data["invite"].ToString(); accountHandler.OnReceive(ReqEventType.property, propertyInfo); break; case SocketEventType.TransferAccount: accountHandler.OnReceive(ReqEventType.transfer, msg.data); break; case SocketEventType.Recharge: //accountHandler break; case SocketEventType.PlayerInvest: investHandler.OnReceive(ReqEventType.invest_req, msg.data.data); break; case SocketEventType.AddTree: commerceHander.OnReceive(ReqEventType.commerce_in, msg.data.code); break; case SocketEventType.CommercePrompt: commerceHander.OnReceive(ReqEventType.commercePrompt, msg.data.code); break; case SocketEventType.JoinCommerce: commerceHander.OnReceive(ReqEventType.permission_commerce, msg.data.code); break; case SocketEventType.BuyMt: commerceHander.OnReceive(ReqEventType.buyMt, msg.data.code); break; case SocketEventType.CheckMoney: accountHandler.OnReceive(ReqEventType.checkMoney, msg.data); break; case SocketEventType.ConfirmPass: accountHandler.OnReceive(ReqEventType.confirmPass, msg.data.code); break; case SocketEventType.Reply: accountHandler.OnReceive(ReqEventType.checkLogin, msg.data.code); break; case SocketEventType.TokenLogin: accountHandler.OnReceive(ReqEventType.checkLogin, msg.data.code); break; //case SocketEventType.PlayerInvest: // accountHandler.OnReceive(ReqEventType.invest_req, msg.data.data); // break; case SocketEventType.InvestInfo: investHandler.OnReceive(ReqEventType.invest_info, msg.data.data); break; case SocketEventType.HasReadMessage: accountHandler.OnReceive(ReqEventType.ReadState, msg.data.data["messages"]); break; default: break; } }
protected internal override void Execute(int eventCode, object message) { //发一次请求触发一次点击音效,(排除点赞,可提取,商会升级) Dispatch(AreaCode.UI, UIEvent.TEST_PANEL_ACTIVE, message?.ToString()); if (eventCode == ReqEventType.likefriend) { Dispatch(AreaCode.AUDIO, AudioEvent.PLAY_CLICK_AUDIO, "LikeVoice"); } else { Dispatch(AreaCode.AUDIO, AudioEvent.PLAY_CLICK_AUDIO, "ClickVoice"); } //初始化联接操作 if (_wabData.WebSocket == null || eventCode == ReqEventType.init) { _wabData.OpenWebSocket(); //登入断线重连 if (PlayerPrefs.HasKey("token") && _wabData.WebSocket.IsAlive) { Dictionary <string, string> logMsg = new Dictionary <string, string>() { // ["token"] = CacheData.Instance().Token ["token"] = PlayerPrefs.GetString("token") }; _wabData.SendMsg(logMsg); } return; } if (_wabData.WebSocket != null && _wabData.WebSocket.IsAlive) { Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); switch (eventCode) { case ReqEventType.pwlogin: //密码登入操作 socketMsg = accountRequestMsg.ReqPWLoginMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.idlogin: //验证码登入 socketMsg = accountRequestMsg.ReqIDLoginMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.regist: //注册操作 socketMsg = accountRequestMsg.ReqRegMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.pwforget: //忘记密码 socketMsg = accountRequestMsg.ReqForgetMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.addfriend: //添加好友 socketMsg = friendRequestMsg.ReqAddFriendMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.identy: //获取验证码 socketMsg = accountRequestMsg.ReqGetIdentityMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.expw: //修改密码 socketMsg = setRequestMsg.ReqPWChangeMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.expwshop: //设置交易密码 socketMsg = setRequestMsg.ReqExPwShopMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; //case ReqEventType.voiceset: // //音效设置 // socketMsg = setRequestMsg.ReqVoiceSetMsg(message); // _wabData.SendMsg(socketMsg); // break; case ReqEventType.searchfriend: //搜索用户 socketMsg = friendRequestMsg.ReqSearchUserMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.likefriend: //好友点赞 socketMsg = friendRequestMsg.ReqLikeFriendMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.applytofriend: //申请通过/拒绝 socketMsg = friendRequestMsg.ReqAgreeFriendMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.property: //测试资产请求 socketMsg = accountRequestMsg.ReqPropertyTestMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.nextgrouds: //换一批 socketMsg = friendRequestMsg.ReqNextUserList(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.commerce_member: //商会成员信息请求 reqCommerceSocketMsg = commerceRequsetMsg.ReqCommerceMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.commerce_in: //商会加入请求 reqCommerceSocketMsg = commerceRequsetMsg.ReqComeCommerceMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.transfer: reqTrasferSocketMsg = accountRequestMsg.ReqTransferMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqTrasferSocketMsg); break; case ReqEventType.recharge: socketMsg = accountRequestMsg.ReqRechargeMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.commerce_sendmt: reqCommerceSocketMsg = commerceRequsetMsg.ReqSendMTMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.invest_req: socketMsg = investRequestMsg.ReqInvestMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.squarefriend: socketMsg = friendRequestMsg.ReqSearchUserMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.menu_req: socketMsg = accountRequestMsg.ReqMenuMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.change_expwshop: socketMsg = setRequestMsg.ReqPWShopChangeMsg(message); _wabData.SendMsg(socketMsg); break; case ReqEventType.applyfriend: socketMsg = friendRequestMsg.ReqApplyFriendList(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.exit: socketMsg = accountRequestMsg.ReqExitMsg(null); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); _wabData.WebSocket.Close(1000, "Bye!"); Dispatch(AreaCode.SCENE, UIEvent.LOG_ACTIVE, true); break; default: break; } } else { Debug.LogError("连接断开"); } }
protected internal override void Execute(int eventCode, object message) { //发一次请求触发一次点击音效,(排除点赞,可提取,商会升级) if (PlayerPrefs.GetString("GameAudioIsOpen") == "open") { if (eventCode == ReqEventType.likefriend) { Dispatch(AreaCode.AUDIO, AudioEvent.LIKE_CLICK_AUDIO, "LikeVoice"); } else if (eventCode == ReqEventType.cach_withdrawal) { Dispatch(AreaCode.AUDIO, AudioEvent.EXACTABLE_AUDIO, "ExactableVoice"); } else { Dispatch(AreaCode.AUDIO, AudioEvent.PLAY_CLICK_AUDIO, "ClickVoice"); } } // Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); //初始化联接操作 if (_wabData.WebSocket == null || eventCode == ReqEventType.init) { if (PlayerPrefs.HasKey("username")) { CacheData.Instance().Username = PlayerPrefs.GetString("username"); } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.OpenWebSocket(); //登入断线重连 if (PlayerPrefs.HasKey("token") && _wabData.WebSocket.IsAlive) { _wabData.WebSocket.Send("token&&" + CacheData.Instance().Username); } // // ["token"] = CacheData.Instance().Token // ["token"] = PlayerPrefs.GetString("token") // }; // _wabData.SendMsg(logMsg); //} return; } if (_wabData.WebSocket != null && _wabData.WebSocket.IsAlive) { switch (eventCode) { case ReqEventType.pwlogin: //密码登入操作 socketMsg = accountRequestMsg.ReqPWLoginMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.idlogin: //验证码登入 socketMsg = accountRequestMsg.ReqIDLoginMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.regist: //注册操作 socketMsg = accountRequestMsg.ReqRegMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.pwforget: //忘记密码 socketMsg = accountRequestMsg.ReqForgetMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.addfriend: //添加好友 socketMsg = friendRequestMsg.ReqAddFriendMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.identy: //获取验证码 socketMsg = accountRequestMsg.ReqGetIdentityMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.expw: //修改密码 socketMsg = setRequestMsg.ReqPWChangeMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.expwshop: //设置交易密码 socketMsg = setRequestMsg.ReqExPwShopMsg(message); //socketMsg = setRequestMsg.ReqPWChangeMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; //case ReqEventType.voiceset: // //音效设置 // socketMsg = setRequestMsg.ReqVoiceSetMsg(message); // _wabData.SendMsg(socketMsg); // break; case ReqEventType.searchfriend: //搜索用户 socketMsg = friendRequestMsg.ReqSearchUserMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.likefriend: //好友点赞 socketMsg = friendRequestMsg.ReqLikeFriendMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.applytofriend: //申请通过/拒绝 socketMsg = friendRequestMsg.ReqAgreeFriendMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.property: //测试资产请求 socketMsg = accountRequestMsg.ReqPropertyTestMsg(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.nextgrouds: //换一批 socketMsg = friendRequestMsg.ReqNextUserList(message); if (socketMsg == null) { return; } Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); _wabData.SendMsg(socketMsg); break; case ReqEventType.commerce_member: //商会成员信息请求 reqCommerceSocketMsg = commerceRequsetMsg.ReqCommerceMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqCommerceSocketMsg); Dispatch(AreaCode.UI, UIEvent.LOAD_PANEL_HINDED, true); break; case ReqEventType.commerce_in: //商会加入请求 reqCommerceSocketMsg = commerceRequsetMsg.ReqComeCommerceMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqCommerceSocketMsg); break; case ReqEventType.transfer: reqTrasferSocketMsg = accountRequestMsg.ReqTransferMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqTrasferSocketMsg); break; case ReqEventType.recharge: socketMsg = accountRequestMsg.ReqRechargeMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.commerce_sendmt: reqCommerceSocketMsg = commerceRequsetMsg.ReqSendMTMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqCommerceSocketMsg); break; case ReqEventType.invest_req: socketMsg = investRequestMsg.ReqInvestMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.squarefriend: socketMsg = friendRequestMsg.ReqSquareMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.menu_req: socketMsg = accountRequestMsg.ReqMenuMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.change_expwshop: socketMsg = setRequestMsg.ReqPWShopChangeMsg(message); _wabData.SendMsg(socketMsg); break; case ReqEventType.applyfriend: socketMsg = friendRequestMsg.ReqApplyFriendList(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.permission_commerce: reqCommerceSocketMsg = commerceRequsetMsg.ReqPermissionCommerceMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqCommerceSocketMsg); break; case ReqEventType.buyMt: reqCommerceSocketMsg = commerceRequsetMsg.ReqBuyMTMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqCommerceSocketMsg); break; case ReqEventType.confirmPass: socketMsg = accountRequestMsg.ReqCheckPass(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.checkMoney: socketMsg = accountRequestMsg.ReqCheckMoney(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.commerceSendMT: reqCommerceSocketMsg = commerceRequsetMsg.ReqSendAllMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqCommerceSocketMsg); break; case ReqEventType.auto_send: reqCommerceSocketMsg = commerceRequsetMsg.ReqSendAutoMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(reqCommerceSocketMsg); break; case ReqEventType.ExchangeCenter: reqCommerceSocketMsg = commerceRequsetMsg.ReqExchangeCenterMsg(message); if (reqCommerceSocketMsg == null) { return; } _wabData.SendMsg(reqCommerceSocketMsg); break; case ReqEventType.Extract: socketMsg = investRequestMsg.ReqExtractInfoMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.invest_info: socketMsg = investRequestMsg.ReqInvestInfoMsg(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.GetTradeCord: socketMsg = accountRequestMsg.ReqTradeRecord(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.GetMessage: socketMsg = accountRequestMsg.ReqMessage(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.ReadState: socketMsg = accountRequestMsg.ReqHasReadMessage(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.GetLike: socketMsg = friendRequestMsg.ReqLikeFriend(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.listfriend: socketMsg = friendRequestMsg.ReqFriendList(message); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); break; case ReqEventType.exit: socketMsg = accountRequestMsg.ReqExitMsg(null); if (socketMsg == null) { return; } _wabData.SendMsg(socketMsg); //_wabData.WebSocket.Close(1000, "Bye!"); // SceneManager.LoadScene("login"); //clean cache CacheData.CleanCache(); break; default: break; } } else { Debug.LogError("连接断开"); StartCoroutine(ReConnect()); } }