コード例 #1
0
        public void Broadcast(Connection source, string message)
        {
            if (ShouldFilter(message))
            {
                return;
            }
            var sourceInfo = source == null ? ChatSource.ServerSource : ChatSource.GetSourceFromConnection(source);

            for (int i = 0, l = connections.Count; i < l; i++)
            {
                connections[i].protocol.OnChatMessage(sourceInfo, message);
            }
        }
コード例 #2
0
        private void UpdateTableView()
        {
            Debug.WriteLine("DidEnterTableView");

            if (ViewModel.Chat?.Messages?.Count > 0)
            {
                var source = new ChatSource(_tableView, ViewModel.Chat);
                _tableView.Source = source;
                _tableView.ReloadData();

                source.ScrolledTopEvent -= OnSource_ScrollTopEvent;
                source.ScrolledTopEvent += OnSource_ScrollTopEvent;
            }
        }
コード例 #3
0
    private void AddChat(string coach, ChatSource source, string text)
    {
        string colour;

        switch (source)
        {
        case ChatSource.Home: colour = "#ff0000"; break;

        case ChatSource.Away: colour = "#0000ff"; break;

        default: colour = "#336633"; break;
        }
        string line = $"<<{colour}>{TextPanelHandler.SanitizeText(coach)}</color>> {TextPanelHandler.SanitizeText(text)}";

        AddChatText(line);
    }
コード例 #4
0
ファイル: FFB.cs プロジェクト: rlegendi/FFBUnity
        internal void AddChatEntry(string coach, string text)
        {
            ChatSource source = ChatSource.Spectator;

            if (string.Equals(FFB.Instance.Model.HomeCoach.Name, coach))
            {
                source = ChatSource.Home;
            }
            if (string.Equals(FFB.Instance.Model.AwayCoach.Name, coach))
            {
                source = ChatSource.Away;
            }

            ChatEntry entry = new ChatEntry(coach, source, text);

            ChatText.Add(entry);
            TriggerChatChanged(entry);
        }
コード例 #5
0
    private void AddChat(string coach, ChatSource source, string text)
    {
        if (this.panelType == FFB.LogPanelType.Chat)
        {
            string colour;
            switch (source)
            {
            case ChatSource.Home: colour = "#ff0000"; break;

            case ChatSource.Away: colour = "#0000ff"; break;

            default: colour = "#336633"; break;
            }
            string line = $"<<{colour}>{TextPanelHandler.SanitizeText(coach)}</color>> {TextPanelHandler.SanitizeText(text)}";
            AddText(line, 0);
            OnScroll(Vector2.zero);
        }
    }
コード例 #6
0
        private void CloseChat_Click(object sender, RoutedEventArgs e)
        {
            ChatSource cs = (sender as MenuItem).Tag as ChatSource;

            _chat.CloseChat(cs);
        }
コード例 #7
0
ファイル: ChatEntry.cs プロジェクト: rlegendi/FFBUnity
 public ChatEntry(string coach, ChatSource source, string text)
 {
     Coach  = coach;
     Source = source;
     Text   = text;
 }