Necrobot-Private / NecroBot

NecroBot2
http://necrobot2.com
Other
308 stars 230 forks source link

Add List of NSTimeZone Names(iOS 9.3.1) for player locale 0.77.1 #1987

Closed Furtif closed 7 years ago

Furtif commented 7 years ago

//TODO: need edition!!! //Ordre: TimeZone Name, Country, Language, POSIX

Source and credits

TimeZones file

Usage load ComboBox values:

            var zones = new TimeZoneIds().GetTimeZoneIds();
            foreach (var tz in zones)
            {
                cbTimeZone.Items.Add(tz.Key);
            }

            cbTimeZone.Text = settings.Auth.CurrentAuthConfig.TimeZone;

Save ComboBox Selected:

                //TimeZones for current Player
                var x = new TimeZoneIds().GetTimeZoneIds();
                _settings.Auth.CurrentAuthConfig.TimeZone = cbTimeZone.Text;
                _settings.Auth.CurrentAuthConfig.Country = x[cbTimeZone.Text].Item1;
                _settings.Auth.CurrentAuthConfig.Language = x[cbTimeZone.Text].Item2;
                _settings.Auth.CurrentAuthConfig.POSIX = x[cbTimeZone.Text].Item3;
                //

Settings result:

 "Bots": [
    {
      "AuthType": "ptc",
      "Username": "XXXXXXX",
      "Password": "YYYYYYY",
      "AutoExitBotIfAccountFlagged": false,
      "AccountLatitude": 44.101177338726977,
      "AccountLongitude": 3.0776309967041016,
      "AccountActive": true,
      "Country": "FR",
      "Language": "fr",
      "TimeZone": "Europe/Paris",
      "POSIX": "fr-fr"
    }
  ],