private bool onSendChatMessage(ChatMessageSender.SendChatMessage evt) { bool flag = false; EmoteDefinition[] emoteDefinitionsFromMessage = EmoteManager.GetEmoteDefinitionsFromMessage(evt.Message); for (int i = 0; i < emoteDefinitionsFromMessage.Length; i++) { if (emoteDefinitionsList.Contains(emoteDefinitionsFromMessage[i])) { emoteDefinitionsList.Remove(emoteDefinitionsFromMessage[i]); } emoteDefinitionsList.Insert(0, emoteDefinitionsFromMessage[i]); flag = true; } while (emoteDefinitionsList.Count > RecentEmotesMaxCount) { emoteDefinitionsList.RemoveAt(emoteDefinitionsList.Count - 1); } List <string> value = DefinitionsToStrings(emoteDefinitionsList); DisplayNamePlayerPrefs.SetList("RecentEmotesServiceList", value); if (flag) { eventDispatcher.DispatchEvent(default(RecentEmotesUpdated)); } return(false); }
private bool onSendChatMessage(ChatMessageSender.SendChatMessage evt) { if (chatActivityData.IsChatActive) { Service.Get <EventDispatcher>().DispatchEvent(default(ChatServiceEvents.SendChatActivityCancel)); } chatActivityData.OnSendChatMessage(); return(false); }
private bool OnChatMessage(ChatMessageSender.SendChatMessage evt) { if (evt.Message.Trim() == Expression.Trim()) { evt.Quest.QuestId = Service.Get <QuestService>().ActiveQuest.Id; evt.Quest.Objective = base.State.Name; base.Fsm.Event(MatchEvent); } else { base.Fsm.Event(FailedMatchEvent); } return(false); }
private bool onSendChatMessage(ChatMessageSender.SendChatMessage evt) { showChatMessage(base.localSessionId, evt.Message, (!(evt.SizzleClip == null)) ? evt.SizzleClip.Id : 0, isAwaitingModeration: true, evt.IsChatPhrase); return(false); }
private bool onSendChatMessage(ChatMessageSender.SendChatMessage evt) { hideIndicatorForChat(); return(false); }
private bool onSendChatMessage(ChatMessageSender.SendChatMessage evt) { int num = 0; switch (MatchType) { case ExpressionMatchType.ANY: { string text = trimWhitSpaceAndEmotes(evt.Message); for (int i = 0; i < Emotes.Length; i++) { num += evt.Message.Split(EmoteManager.GetEmoteChar(Emotes[i])).Length - 1; } for (int i = 0; i < Texts.Length; i++) { string text2 = trimWhitSpaceAndEmotes(Texts[i]); num += text.Split(new string[1] { text2 }, StringSplitOptions.None).Length - 1; } if (!(evt.SizzleClip != null)) { break; } for (int i = 0; i < SizzleClips.Length; i++) { if (evt.SizzleClip.Id == SizzleClips[i].Id) { num++; break; } } break; } case ExpressionMatchType.ALL: { string text = trimWhitSpaceAndEmotes(evt.Message); if (Emotes.Length + Texts.Length > 0) { num = evt.Message.Length; } else if (SizzleClips.Length > 0) { num = 1; } for (int i = 0; i < Emotes.Length; i++) { if (num <= 0) { break; } num = Math.Min(num, evt.Message.Split(EmoteManager.GetEmoteChar(Emotes[i])).Length - 1); } for (int i = 0; i < Texts.Length; i++) { if (num <= 0) { break; } string text2 = trimWhitSpaceAndEmotes(Texts[i]); num = Math.Min(num, text.Split(new string[1] { text2 }, StringSplitOptions.None).Length - 1); } if (!(evt.SizzleClip != null)) { break; } for (int i = 0; i < SizzleClips.Length; i++) { if (num <= 0) { break; } if (evt.SizzleClip.Id != SizzleClips[i].Id) { num = 0; } } break; } case ExpressionMatchType.ONLY: if (Texts.Length + Emotes.Length > 1 || SizzleClips.Length > 1 || Texts.Length + Emotes.Length + SizzleClips.Length == 0) { } if (Emotes.Length == 1) { if (evt.Message.Trim() == EmoteManager.GetEmoteString(Emotes[0])) { num = 1; } } else if (Texts.Length == 1) { string text = trimWhitSpace(evt.Message); if (text.Equals(trimWhitSpace(Texts[0]))) { num = 1; } } if (SizzleClips.Length == 1) { if (Texts.Length + Emotes.Length == 0) { num = 1; } if (num == 1) { num = ((evt.SizzleClip != null && SizzleClips[0].Id == evt.SizzleClip.Id) ? 1 : 0); } } break; } if (num == 0 && Texts.Length == 0 && Emotes.Length == 0 && SizzleClips.Length == 0) { num = 1; } if (num > 0) { if (MatchCounting == ExpressionMatchCounting.ONE_PER_MESSAGE) { num = 1; } for (int i = 0; i < num; i++) { taskIncrement(); } } return(false); }