/// <summary> /// 完成输入 创建昵称 /// </summary> private void OnClickComplete() { if (!DetectionPrivacy()) { return; } //是否为空 if (string.IsNullOrEmpty(_inputNick)) { //昵称不能为空! StaticData.CreateToastTips(LocalizationDefineHelper.GetStringNameById(120201)); return; } // if (_randomNick != _inputNick) { bool isBlockFont = ShieldWordTool.BlockFont(ref _inputNick); //bool isBlockFont = false; //是否有屏蔽字符 if (isBlockFont) { // Debug.Log("昵称含有敏感字符!"); StaticData.CreateToastTips(LocalizationDefineHelper.GetStringNameById(120202)); _inputNick = string.Empty; _inputNickText.text = _inputNick; _inputFieldNick.text = _inputNick; return; } } //发起请求 RequestNiceAndIconVerification(); }
private void Init() { //ShieldWordTool.InitBlockFonts(); //TextAsset textAsset = await ABManager.GetAssetAsync<TextAsset>("blockthesaurus"); TextAsset textAsset = Resources.Load <TextAsset>("ShieldWord/BlockThesaurus"); string text = textAsset.text; ShieldWordTool.InitBlockFonts(null, text); }
/// <summary> /// 发送输入信息 /// </summary> private void OnSendBtn() { if (string.IsNullOrWhiteSpace(_InputFieldStr)) { ClearInputField(); return; } if (ShieldWordTool.BlockFont(ref _InputFieldStr)) { Debug.Log("处理屏蔽字"); } _sendBtn.enabled = false; if (_timeCountDownComponent == null) { CreationTimer(); } _sendBtnMaskImage.fillAmount = 1; _isBeTimeUnlock = true; StartCountingTime(StaticData.configExcel.GetVertical().ChatSendCD); switch (_currType) { case 0: ChatTool.NotifyServerWorldChatMessage(_InputFieldStr, SendSuccess, SendFailed); break; case 1: if (_currPrivateChatIndex != 0) { ChatTool.NotifyServerPrivateChatMessage(_currPrivateChatIndex, _InputFieldStr, PrivateSendSuccess, PrivateSendFailed); } else { StaticData.CreateToastTips(StaticData.GetMultilingual(120261)); } break; case 2: ChatTool.NotifyServerRoomChatMessage(_InputFieldStr, RoomChatSendSuccess, RoomChatSendFailed); break; } }