Пример #1
0
        /// <summary>
        ///     Ereignis - Send-Button wird gedrück.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">EventArgs</param>

        private void bSend_Click(object sender, EventArgs e)
        {
            SendBinaryData.SendData("chat", textChat.Text, "platzhalter");
            // Schreibe Nachricht in Chatliste
            AddTextToChat(Program.User.Name + " @" + DateTime.Now + ": " + textChat.Text);
            textChat.Clear();
        }
Пример #2
0
        /// <summary>
        ///     Spielanfrage abhandeln.
        /// </summary>

        public static void DontAcceptGameRequest()
        {
            var gameValue   = "Spiel Anfrage gescheitert";
            var gameMessage = "stopanfrage";

            SendBinaryData.SendData("game", gameMessage, gameValue);
        }
Пример #3
0
        /// <summary>
        ///     Spielanfrage abhandeln.
        /// </summary>

        public static void GameRequest()
        {
            var gameValue   = "Spiel Anfrage";
            var gameMessage = "anfrage";

            SendBinaryData.SendData("game", gameMessage, gameValue);
        }
Пример #4
0
        /// <summary>
        ///     Spielstop abhandeln.
        /// </summary>

        public static void StopTheGame()
        {
            var gameValue   = "Spiel beenden";
            var gameMessage = "beenden";

            SendBinaryData.SendData("game", gameMessage, gameValue);

            // Game1.Dispose();
        }
Пример #5
0
        /// <summary>
        ///     Gesetzter Coin abhandeln.
        /// </summary>
        /// <param name="reihe">Einwurfreihe</param>

        public static void SetEinwurf(int reihe)
        {
            var gameValue   = Convert.ToString(reihe);
            var gameMessage = "reihe";

            SendBinaryData.SendData("game", gameMessage, gameValue);

            Program.Form1.Paint += Program.Form1.FillField;
        }
Пример #6
0
        /// <summary>
        ///     Ereignis - Enter wird gedrückt wird gedrück.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">KeyEventArgs</param>

        private void textChat_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                SendBinaryData.SendData("chat", textChat.Text, "platzhalter");
                e.Handled          = true;
                e.SuppressKeyPress = true;

                // Schreibe Nachricht in Chatliste
                AddTextToChat(Program.User.Name + " @" + DateTime.Now + ": " + textChat.Text);
                textChat.Clear();
            }
        }
Пример #7
0
        /// <summary>
        ///     Ereignis - Synchronisation Timer.
        /// </summary>
        /// <param name="sender">Sender</param>
        /// <param name="e">EventArgs</param>

        private void TimerSync_Tick(object sender, EventArgs e)
        {
            _timerCount++;

            try
            {
                SendBinaryData.SendData("sync", "Synchronisiere", Convert.ToString(_timerCount));
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
                throw;
            }
        }
Пример #8
0
        /// <summary>
        ///     Spielstart abhandeln.
        /// </summary>

        public static void StartTheGame()
        {
            if (GlobalVariables.MeAngefragt)
            {
                //new Game(Convert.ToString(Program.User.Name));
            }

            var startspieler = BerechneSpielerStart();

            Program.Form1.EnableGameButtons();

            var gameValue   = startspieler.Id;
            var gameMessage = "start";

            SendBinaryData.SendData("game", gameMessage, gameValue);
        }