Example #1
0
        public Form1()
        {
            InitializeComponent();

            _tcpClient = new SVSTcpClient();
            _tcpClient.OnConnected += OnConnected;
            _tcpClient.OnDisconnected += OnDisconnected;
            _tcpClient.OnRxData += OnRxData;

            _tcpServer = new TcpServer();
            _tcpServer.Port = 2100;
            _tcpServer.Open();
            _tcpServer.OnDataAvailable += _tcpServer_OnDataAvailable;
            _tcpServer.OnConnect += _tcpServer_OnConnect;
            _tcpServer.OnError += _tcpServer_OnError;
            svsPayload = new byte[11];

            ConnectLed.State = LBLed.LedState.Off;
            ConnectLed.Show();

            Address.SetAddressBytes(new byte[]{192,168,1,113});
            IpPort.Text = "80";
            comboType.SelectedIndex = 0;
            comboCommand.SelectedIndex = 0;
            comboParameters.SelectedIndex = 0;
            selectedCamera.Text = "0";
            cmdMutex = new Mutex();

            textTurretAngle.Text = "0";
            comboHatches.SelectedIndex = 0;
            comboBattleShort.SelectedIndex = 0;
        }
Example #2
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();
        }