Exemplo n.º 1
0
        public static int ConnectToCGOS(string name, string pPwd, int pNbr)
        {
            GoBoard lGoBoard = new GoBoard(9);
            GTPGoBoard lGTPGoBoard = new GTPGoBoard(lGoBoard);
            GTPCommCGOS lGTPCommCGOS = new GTPCommCGOS("cgos.boardspace.net", 6867, name, pPwd, pNbr, true);
            GTPEngine lGTPEngine = new GTPEngine(lGTPGoBoard, lGTPCommCGOS);

            lGTPCommCGOS.Run();

            return 0;
        }
Exemplo n.º 2
0
        public static int ConnectToCGOS(string name, string pPwd, int pNbr)
        {
            GoBoard     lGoBoard     = new GoBoard(9);
            GTPGoBoard  lGTPGoBoard  = new GTPGoBoard(lGoBoard);
            GTPCommCGOS lGTPCommCGOS = new GTPCommCGOS("cgos.boardspace.net", 6867, name, pPwd, pNbr, true);
            GTPEngine   lGTPEngine   = new GTPEngine(lGTPGoBoard, lGTPCommCGOS);

            lGTPCommCGOS.Run();

            return(0);
        }
Exemplo n.º 3
0
        public static GTPInternalResponse GTPCGOSConnect(GTPGoBoard gtpGoBoard, GTPCommand gtpCommand)
        {
            if (gtpCommand.GetParameterCount() < 2)
                return MissingParameterResponse();

            string lName = gtpCommand.GetParameter(0);
            string lPwd = gtpCommand.GetParameter(1);

            int lNbrGames = 1;

            if (gtpCommand.GetParameterCount() >= 3)
                if (!gtpCommand.GetParameter(2, ref lNbrGames))
                    return InvalidParameterResponse();

            if (lNbrGames <= 0)
                return InvalidParameterResponse();

            GTPCommCGOS lGTPCommCGOS = new GTPCommCGOS(gtpGoBoard.CGOSAddress, gtpGoBoard.CGOSPortNbr, lName, lPwd, lNbrGames, true);

            //			if (!lGTPCommCGOS.Connected)
            //				return new GTPInternalResponse(false, "unable to connect");

            GTPEngine lGTPEngine = new GTPEngine(gtpGoBoard, lGTPCommCGOS);

            lGTPCommCGOS.Run();

            return new GTPInternalResponse(true);
        }