private void displayPositionSelector()
        {
            // Display Position Selector
            LocationSelector locationSelect = new LocationSelector();

            locationSelect.ShowDialog();

            // Check if Position was Selected
            try
            {
                if (!locationSelect.setPos)
                {
                    throw new ArgumentException();
                }

                // Persisting the Initial Position
                client.SaveLatLng(locationSelect.lat, locationSelect.lng);
                client.SetCoordinates(locationSelect.lat, locationSelect.lng, UserSettings.Default.DefaultAltitude);
            }
            catch
            {
                MessageBox.Show("You need to declare a valid starting location.", "Safety Check");
                MessageBox.Show("To protect your account of a possible soft ban, the software will close.", "Safety Check");
                Application.Exit();
            }

            // Display Starting Location
            Logger.Write($"Starting in Location Lat: {UserSettings.Default.DefaultLatitude} Lng: {UserSettings.Default.DefaultLongitude}");

            // Close the Location Window
            locationSelect.Close();
        }
Exemplo n.º 2
0
        private void DisplayPositionSelector()
        {
            // Display Position Selector
            LocationSelector locationSelect = new LocationSelector();

            locationSelect.ShowDialog();

            // Check if Position was Selected
            try
            {
                if (!locationSelect.setPos)
                {
                    throw new ArgumentException();
                }

                // Persisting the Initial Position
                _client.SaveLatLng(locationSelect.lat, locationSelect.lng);
                _client.SetCoordinates(locationSelect.lat, locationSelect.lng, UserSettings.Default.DefaultAltitude);
            }
            catch (Exception ex)
            {
                // Write a Detailed Log Report
                ErrorReportCreator.Create("Выбор локации", "Невозможно выбрать локацию", ex);

                MessageBox.Show(@"Обозначьте правильную стартовую локацию.", @"Проверка безопасности");
                MessageBox.Show(@"Чтобы избежать бана, программа завершает свою работу.", @"Проверка безопасности");
                Application.Exit();
            }

            // Display Starting Location
            Logger.Write($"Стартовая точка Lat(Широта): {UserSettings.Default.DefaultLatitude} Lng(Долгота): {UserSettings.Default.DefaultLongitude}");

            // Close the Location Window
            locationSelect.Close();

            // Setup MiniMap
            SetupLocationMap();
        }
Exemplo n.º 3
0
        private void DisplayPositionSelector()
        {
            // Display Position Selector
            LocationSelector locationSelect = new LocationSelector();

            locationSelect.ShowDialog();

            // Check if Position was Selected
            try
            {
                if (!locationSelect.setPos)
                {
                    throw new ArgumentException();
                }

                // Persisting the Initial Position
                _client.SaveLatLng(locationSelect.lat, locationSelect.lng);
                _client.SetCoordinates(locationSelect.lat, locationSelect.lng, UserSettings.Default.DefaultAltitude);
            }
            catch (Exception ex)
            {
                // Write a Detailed Log Report
                ErrorReportCreator.Create("SelectLocation", "Unable To Select Location", ex);

                MessageBox.Show(@"You need to declare a valid starting location.", @"Safety Check");
                MessageBox.Show(@"To protect your account of a possible soft ban, the software will close.", @"Safety Check");
                Application.Exit();
            }

            // Display Starting Location
            Logger.Write($"Starting in Location Lat: {UserSettings.Default.DefaultLatitude} Lng: {UserSettings.Default.DefaultLongitude}");

            // Close the Location Window
            locationSelect.Close();

            // Setup MiniMap
            SetupLocationMap();
        }
Exemplo n.º 4
0
        private void displayPositionSelector()
        {
            // Display Position Selector
            LocationSelector locationSelect = new LocationSelector();
            locationSelect.ShowDialog();

            // Check if Position was Selected
            try
            {
                if (!locationSelect.setPos)
                    throw new ArgumentException();

                // Persisting the Initial Position
                client.SaveLatLng(locationSelect.lat, locationSelect.lng);
                client.SetCoordinates(locationSelect.lat, locationSelect.lng, UserSettings.Default.DefaultAltitude);
            }
            catch
            {
                MessageBox.Show("You need to declare a valid starting location.", "Safety Check");
                MessageBox.Show("To protect your account of a possible soft ban, the software will close.", "Safety Check");
                Application.Exit();
            }

            // Display Starting Location
            Logger.Write($"Starting in Location Lat: {UserSettings.Default.DefaultLatitude} Lng: {UserSettings.Default.DefaultLongitude}");

            // Close the Location Window
            locationSelect.Close();
        }
Exemplo n.º 5
0
        private void DisplayPositionSelector()
        {
            // Display Position Selector
            LocationSelector locationSelect = new LocationSelector();
            locationSelect.ShowDialog();

            // Check if Position was Selected
            try
            {
                if (!locationSelect.setPos)
                    throw new ArgumentException();

                // Persisting the Initial Position
                _client.SaveLatLng(locationSelect.lat, locationSelect.lng);
                _client.SetCoordinates(locationSelect.lat, locationSelect.lng, UserSettings.Default.DefaultAltitude);
            }
            catch(Exception ex)
            {
                // Write a Detailed Log Report
                ErrorReportCreator.Create("SelectLocation", "Unable To Select Location", ex);

                MessageBox.Show(@"You need to declare a valid starting location.", @"Safety Check");
                MessageBox.Show(@"To protect your account of a possible soft ban, the software will close.", @"Safety Check");
                Application.Exit();
            }

            // Display Starting Location
            Logger.Write($"Starting in Location Lat: {UserSettings.Default.DefaultLatitude} Lng: {UserSettings.Default.DefaultLongitude}");

            // Close the Location Window
            locationSelect.Close();

            // Setup MiniMap
            SetupLocationMap();
        }
Exemplo n.º 6
0
        private void DisplayPositionSelector()
        {
            // Display Position Selector
            LocationSelector locationSelect = new LocationSelector();
            locationSelect.ShowDialog();

            // Check if Position was Selected
            try
            {
                if (!locationSelect.setPos)
                    throw new ArgumentException();

                // Persisting the Initial Position
                _client.SaveLatLng(locationSelect.lat, locationSelect.lng);
                _client.SetCoordinates(locationSelect.lat, locationSelect.lng, UserSettings.Default.DefaultAltitude);
            }
            catch(Exception ex)
            {
                // Exception Notification
                APINotifications.SendNotification(ex.Message, ex.GetType().ToString(), 0);

                // Write a Detailed Log Report
                File.WriteAllText(Directory.GetCurrentDirectory() + "\\Location.ErrorLog." + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".txt",
                    ex.Message + Environment.NewLine + Environment.NewLine + ex.StackTrace);

                MessageBox.Show(@"You need to declare a valid starting location.", @"Safety Check");
                MessageBox.Show(@"To protect your account of a possible soft ban, the software will close.", @"Safety Check");
                Application.Exit();
            }

            // Display Starting Location
            Logger.Write($"Starting in Location Lat: {UserSettings.Default.DefaultLatitude} Lng: {UserSettings.Default.DefaultLongitude}");

            // Close the Location Window
            locationSelect.Close();

            // Setup MiniMap
            SetupLocationMap();
        }