コード例 #1
0
ファイル: client.cs プロジェクト: madragonse/MAKARON_Client
 private void connectToServer()
 {
     try
     {
         this.connector = new TCP_Connector(this.serverPort, this.serverIP);
         this.connector.Connect();
         this.KeepConnectionAlive();
         this.panelConnected.Visible = true;
         this.panelConnect.Visible   = false;
         this.panelLOrSU.Visible     = true;
     }
     catch (Exception)
     {
         this.labelConnectingError.Visible = true;
     }
 }
コード例 #2
0
ファイル: client.cs プロジェクト: madragonse/MAKARON_Client
        private void BMB_Load(object sender, EventArgs e)
        {
            this.input               = new Input();
            this.cornerPoint         = new PointF(0, 0);
            this.buttonReady.Visible = false;

            // Add image to refresh button
            String currPath = System.IO.Directory.GetCurrentDirectory();

            currPath = Directory.GetParent(currPath).Parent.Parent.FullName;
            //this.refreshLobbyListButton.Image= Image.FromFile(currPath+"\\refresh_icon.png");
            //this.refreshLobbyListButton.ImageAlign = ContentAlignment.MiddleCenter;
            //this.window = CreateGraphics();
            this.addLobbyButton.TextAlign = ContentAlignment.MiddleCenter;

            //hide add lobby panel
            this.addLobbyPanel.Visible = false;
            this.label2.Visible        = false;
            populateGameList();
            this.availableGamesBox.SelectedIndex = 0;

            this.connector   = new TCP_Connector();
            this.package     = new Package();
            this.cpackage    = new Communication_Package();
            this.pingPackage = new Communication_Package();
            pingPackage.SetTypePING();
            this.gamePackages = new Queue();

            this.choosenGame = 0;

            this.mainLoopThread = new Thread(MainLoop);
            this.mainLoopThread.IsBackground = true;
            this.mainLoopThread.Start();

            audio = new SoundPlayer(BMB.Properties.Resources.gnome);


            //TEST
            sww = Stopwatch.StartNew();
            this.updateFormDelegate = new update(updateForm);
        }