// Start Server.
 private void button2_Click(object sender, EventArgs e)
 {
     ServerWindow serverWindow = new ServerWindow();
     DialogResult = System.Windows.Forms.DialogResult.Abort;
     this.Hide();
     Owner.Owner = serverWindow;
     serverWindow.Show();
 }
Beispiel #2
0
        // Start Server.
        private void btnStartServer_Click(object sender, EventArgs e)
        {
            ServerWindow serverWindow = new ServerWindow();

            DialogResult = System.Windows.Forms.DialogResult.Abort;
            this.Hide();
            Owner.Owner = serverWindow;
            serverWindow.Show();
        }
        public DraftServer(ServerWindow serverWindow, string setFilename, int packs, int numCommonsInPack, int numUncommonsInPack, int numRaresInPack, float mythicPercentage)
        {
            this.serverWindow = serverWindow;
            ParseText(File.ReadAllText(setFilename));
            serverWindow.PrintLine("Loaded set: " + setName + ".");
            this.packs = packs;
            this.numCommonsInPack = numCommonsInPack;
            this.numUncommonsInPack = numUncommonsInPack;
            this.numRaresInPack = numRaresInPack;
            this.mythicPercentage = mythicPercentage;

            server = new TcpServer();
            server.Port = 10024;
            server.OnConnect += OnConnect;
            server.OnDisconnect += OnDisconnect;
            server.OnDataAvailable += OnDataAvailable;
            server.Open();
        }
Beispiel #4
0
        public DraftServer(ServerWindow serverWindow, string setFilename, int packs, int numCommonsInPack, int numUncommonsInPack, int numRaresInPack, float mythicPercentage)
        {
            this.serverWindow = serverWindow;
            ParseText(File.ReadAllText(setFilename));
            serverWindow.PrintLine("Loaded set: " + setName + ".");
            this.packs              = packs;
            this.numCommonsInPack   = numCommonsInPack;
            this.numUncommonsInPack = numUncommonsInPack;
            this.numRaresInPack     = numRaresInPack;
            this.mythicPercentage   = mythicPercentage;

            server                  = new TcpServer();
            server.Port             = 10024;
            server.OnConnect       += OnConnect;
            server.OnDisconnect    += OnDisconnect;
            server.OnDataAvailable += OnDataAvailable;
            server.Open();
        }
        public DraftServer(ServerWindow serverWindow, string filename, int packs, int numLandsInPack, int numNonLandsInPack)
        {
            this.serverWindow = serverWindow;
            var landsThenNonlands = ReadCardPool(File.ReadAllText(filename));

            serverWindow.PrintLine("Loaded cube: " + cubeName + ".");
            this.packs             = packs;
            this.numLandsInPack    = numLandsInPack;
            this.numNonLandsInPack = numNonLandsInPack;

            server = new TcpServer {
                Port = Util.PORT
            };
            server.OnConnect       += OnConnect;
            server.OnDisconnect    += OnDisconnect;
            server.OnDataAvailable += OnDataAvailable;
            server.Open();

            serverWindow.PrintLine("Fetching card information, this might take a while...");
            cards = ReadCardInfo(landsThenNonlands);
        }