Example #1
0
        public void ProcessLine(string line)
        {
            if (string.IsNullOrEmpty(line))
            {
                return;
            }

            string lLine = line.TrimEnd('\n').TrimEnd('\r');

            if (Verbose)
            {
                Console.Error.WriteLine("STATUS: W< " + lLine);
            }

            string[] lCmds = lLine.Split('\t');

            if (lCmds.Length < 2)
            {
                Server.SendLine("?\t");
                return;
            }

            if (lCmds[0] == "disconnect")
            {
                Server.Disconnect();
                return;
            }

            if (lCmds[0] == "terminate")
            {
                Server.Terminate = true;
                Server.Disconnect();
                return;
            }

            List <string> lParameters = new List <string>();

            for (int lIndex = 2; lIndex < lCmds.Length; lIndex++)
            {
                lParameters.Add(lCmds[lIndex]);
            }

            WorkerFunctions.Execute(lCmds[1], lCmds[0], lParameters, Board, SearchEngine, Server.SendLine);
        }
Example #2
0
 public void OnCompletion(SearchStatus searchStatus)
 {
     WorkerFunctions.Respond(Proxy, ID, (searchStatus.Status == SearchStatusType.Completed), CoordinateSystem.ToString2(searchStatus.BestMove, searchStatus.BoardSize) + "\t" + searchStatus.BestValue.ToString(), true);
 }