Example #1
0
        public LobbyForm(string n, Color c) : base()
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox     = false;
            this.MinimizeBox     = false;

            lobbyConnector = new FormConnector(this);
            MainForm.mainConnector.ConnectForm(this);
            name                = n;
            color               = c;
            L_form              = this;
            MessageBox.KeyDown += new KeyEventHandler(MessageBox_KeyDown);
        }
Example #2
0
        public LobbyForm(string n, Color c)
            : base()
        {
            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.MinimizeBox = false;

            lobbyConnector = new FormConnector(this);
            MainForm.mainConnector.ConnectForm(this);
            name = n;
            color = c;
            L_form = this;
            MessageBox.KeyDown += new KeyEventHandler(MessageBox_KeyDown);
        }
Example #3
0
        private void buttonLogIn_Click(object sender, EventArgs e)
        {
            //NetOutgoingMessage sendMsg;

            //sendMsg = Program.netclient.CreateMessage();

            //sendMsg.Write(Program.guid.ToString() + ";" + textBoxName.Text);
            //Program.netclient.SendMessage(sendMsg, NetDeliveryMethod.ReliableSequenced);
            Program.ConnectToServer();
            Program.ConnectPlayerToLobby(textBoxName.Text, Color.FromName(colorBox.Text));
            //Program.ConnectPlayerToGame(textBoxName.Text, Color.FromName(colorBox.Text), "justWatching");
            //sollte zuerst lobby und dann mainform sein-> spieler wird beim anmelden aber sofort auf spielfeld gesetzt...
            MainForm Main = new MainForm();
            LobbyForm Lobby = new LobbyForm(textBoxName.Text,Color.FromName(colorBox.Items[colorBox.SelectedIndex].ToString()));

            this.Hide();
            Main.Show();
            Lobby.Show();

               //Lobby.SetDesktopLocation(Main.Location.X + Main.Size.Width, Main.Location.Y);
            Lobby.Location = new Point(Main.Left + Main.Width + 20, Main.Top);
            //this.Show();
            //this.Dispose();
        }
Example #4
0
        private void buttonLogIn_Click(object sender, EventArgs e)
        {
            //NetOutgoingMessage sendMsg;

            //sendMsg = Program.netclient.CreateMessage();

            //sendMsg.Write(Program.guid.ToString() + ";" + textBoxName.Text);
            //Program.netclient.SendMessage(sendMsg, NetDeliveryMethod.ReliableSequenced);
            Program.ConnectToServer();
            Program.ConnectPlayerToLobby(textBoxName.Text, Color.FromName(colorBox.Text));
            //Program.ConnectPlayerToGame(textBoxName.Text, Color.FromName(colorBox.Text), "justWatching");
            //sollte zuerst lobby und dann mainform sein-> spieler wird beim anmelden aber sofort auf spielfeld gesetzt...
            MainForm  Main  = new MainForm();
            LobbyForm Lobby = new LobbyForm(textBoxName.Text, Color.FromName(colorBox.Items[colorBox.SelectedIndex].ToString()));

            this.Hide();
            Main.Show();
            Lobby.Show();

            //Lobby.SetDesktopLocation(Main.Location.X + Main.Size.Width, Main.Location.Y);
            Lobby.Location = new Point(Main.Left + Main.Width + 20, Main.Top);
            //this.Show();
            //this.Dispose();
        }