Exemplo n.º 1
0
        private void button_joinGame_Click(object sender, RoutedEventArgs e)
        {
            LismanService.GameManagerClient client = new LismanService.GameManagerClient();
            int idGame = client.JoinGame(SingletonAccount.getSingletonAccount().User);

            if (idGame > 0)
            {
                Lobby lobby = new Lobby(idGame);
                lobby.Show();
                this.Close();
            }
            else
            {
                MessageBox.Show(Properties.Resources.message_nogames_found);
            }
        }
Exemplo n.º 2
0
        private void btn_exitGame_Click(object sender, RoutedEventArgs e)
        {
            MultiplayerHome homeMultiplayer = new MultiplayerHome();

            LismanService.GameManagerClient clientGame = new LismanService.GameManagerClient();

            try
            {
                clientGame.LeaveGame(SingletonAccount.getSingletonAccount().User, idGame);
                client.LeaveChat(SingletonAccount.getSingletonAccount().User, idGame);
                homeMultiplayer.Show();
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(Properties.Resources.server_connection_error);
                Logger.log.Warn("Error en funcion exit game " + ex.Message);
            }
        }
Exemplo n.º 3
0
        private void button_newGame_Click(object sender, RoutedEventArgs e)
        {
            LismanService.GameManagerClient client = new LismanService.GameManagerClient();

            try
            {
                int idGame = client.CreateGame(SingletonAccount.getSingletonAccount().User);
                if (idGame > 0)
                {
                    Lobby lobby = new Lobby(idGame);
                    lobby.Show();
                    this.Close();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error de conexión con el servidor, por favor intente mas tarde");
                Logger.log.Error("Function new game" + ex.Message);
            }
        }