<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Net.Sockets;

namespace Buildstation_Server.Class
{
    class ClientTracker
    {
        TcpClient Client;

        public ClientTracker(TcpClient Client)
        {
            this.Client = Client;
        }

        string Data;
        string[] DataSplit;

        public void Connect()
        {
            StreamReader SR = new StreamReader(Client.GetStream());
            StreamWriter SW = new StreamWriter(Client.GetStream());

            while (true)
            {
                Data = SR.ReadLine();
                DataSplit = Data.Split(';');

                if (Data == "Sorter;Disconnect")    // Perhaps not nesasary, but I'm doing it anyway.
                {
                    Client.Close();
                    break;
                }

                NetworkThread.NetworkSorters[DataSplit[0]].NewTrafic(DataSplit[1], this);
            }
        }

        public void SendMessage(string Sorter, string Message)
        {
            StreamWriter SW = new StreamWriter(Client.GetStream());
            string MessageCompiled = Sorter + ";" + Message;
            SW.WriteLine(MessageCompiled);
            SW.Flush();
        }

        /// <summary>
        /// Allows you to send multiple messages at once. Probably more efficent.
        /// </summary>
        /// <param name="Sorter">The sorter in the client you want to access.</param>
        /// <param name="Message">The message you want to send.</param>
        public void SendMessage(string Sorter, string[] Message)
        {
            StreamWriter SW = new StreamWriter(Client.GetStream());
            int Progress = 0;
            string MessageCompiled;

            while (Progress >= Message.Length)
            {
                if (Progress == Message.Length)
                    break;<commit_msg>Debug text<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Net.Sockets;

namespace Buildstation_Server.Class
{
    class ClientTracker
    {
        TcpClient Client;

        public ClientTracker(TcpClient Client)
        {
            this.Client = Client;
        }

        string Data;
        string[] DataSplit;

        public void Connect()
        {
            StreamReader SR = new StreamReader(Client.GetStream());
            StreamWriter SW = new StreamWriter(Client.GetStream());

            while (true)
            {
                Data = SR.ReadLine();
                DataSplit = Data.Split(';');

                if (Data == "Sorter;Disconnect")    // Perhaps not nesasary, but I'm doing it anyway.
                {
                    Client.Close();
                    break;
                }

                NetworkThread.NetworkSorters[DataSplit[0]].NewTrafic(DataSplit[1], this);
            }
        }

        public void SendMessage(string Sorter, string Message)
        {
            StreamWriter SW = new StreamWriter(Client.GetStream());
            string MessageCompiled = Sorter + ";" + Message;
            SW.WriteLine(MessageCompiled);
            SW.Flush();
            Console.WriteLine("Sending message of " + MessageCompiled);
        }

        /// <summary>
        /// Allows you to send multiple messages at once. Probably more efficent.
        /// </summary>
        /// <param name="Sorter">The sorter in the client you want to access.</param>
        /// <param name="Message">The message you want to send.</param>
        public void SendMessage(string Sorter, string[] Message)
        {
            StreamWriter SW = new StreamWriter(Client.GetStream());
            int Progress = 0;
            string MessageCompiled;

            while (Progress >= Message.Length)
            {
                if (Progress == Message.Length)
                    break;
{'fraction_non_alphanumeric': 0.09992486851990984, 'fraction_numerical': 0.0015026296018031556, 'mean_word_length': 1.6715719063545151, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3213425', 'n_tokens_mistral': 1014, 'n_tokens_neox': 972, 'n_words': 262}