void OnBtnClickOK() { if (string.IsNullOrEmpty(m_inputName.label.text)) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5136)); return; } if (m_inputName.label.text.Length > 6) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5138)); return; } if (m_inputName.label.text.StartsWith(PlayerInfo.DEFAULT_NAME1) || m_inputName.label.text.StartsWith(PlayerInfo.DEFAULT_NAME2)) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5135)); return; } if (SensitiveFilterManager.getInstance().check(m_inputName.label.text)) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5137)); return; } SendChangeNameMsg(); }
void Test_BadWord() { bool reuslt = false; reuslt = SensitiveFilterManager.getInstance().check("$"); Debug.Log("result = " + reuslt); }
//确定更改名字 void OnClickOKChangeName() { if (string.IsNullOrEmpty(m_inputName.value)) { return; } if (m_inputName.value == Core.Data.playerManager.NickName) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(25128)); return; } if (Core.Data.playerManager.Stone < COST_STONE) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(35006)); return; } if (m_inputName.label.text.Length > 6) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(5138)); return; } bool check = SensitiveFilterManager.getInstance().check(m_inputName.value); if (check) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(75003)); return; } SendChangeUserInfoMsg(new ChangeUserInfoParam(Core.Data.playerManager.PlayerID, 2, m_inputName.value)); tipName.SetActive(false); }
//发送邮件 public void SendEmail() { if (mInput.value.Length == 0) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9069)); return; } bool check = SensitiveFilterManager.getInstance().check(mInput.value); if (check) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(75003)); return; } ComLoading.Open(); HttpTask task = new HttpTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.SEND_EMAIL, new SendEmailParam(Core.Data.playerManager.PlayerID, this.sendPlayerID, mInput.value)); task.afterCompleted = (BaseHttpRequest request, BaseResponse response) => { ComLoading.Close(); if (response != null && response.status != BaseResponse.ERROR) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(9059)); OnBtnClick("Close"); } else if (response.status == BaseResponse.ERROR) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getNetworkErrorString(response.errorCode)); OnBtnClick("Close"); } }; task.ErrorOccured = (BaseHttpRequest request, string error) => { ComLoading.Close(); Debug.Log("SendMegRequest is error!"); }; task.DispatchToRealHandler(); }
public void SendWorldChat(string _Content) { if (SensitiveFilterManager.getInstance().check(_Content, false)) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(75003)); return; } if (string.IsNullOrEmpty(_Content)) { SQYAlertViewMove.CreateAlertViewMove(Core.Data.stringManager.getString(75002)); return; } SocketTask task = new SocketTask(ThreadType.MainThread, TaskResponse.Default_Response); task.AppendCommonParam(RequestType.SOCK_WORLDCHAT, new SockSendWorldChatParam(_Content)); task.ErrorOccured = SocketResp_Error; task.afterCompleted = SocketResp_UI; task.DispatchToRealHandler(); ComLoading.Open(); }