Skip to content

Commit

Permalink
Locale fix
Browse files Browse the repository at this point in the history
  • Loading branch information
5andr0 committed Jul 29, 2016
1 parent 41d01f4 commit 5e3b4c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion PogoLocationFeeder/Config/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace PoGo.LocationFeeder.Settings
public class GlobalSettings
{
//public ulong ServerId = 206065054846681088;
public List<string> ServerChannels = new List<string> { "snipers", "high_iv_pokemon", "rare_pokemon" };
public List<string> ServerChannels = new List<string> { "sniping", "high_iv_pokemon", "rare_pokemon" };
public string DiscordToken = "";
public int Port = 16969;
public bool useToken = false;
Expand Down
11 changes: 6 additions & 5 deletions PogoLocationFeeder/Helper/MessageParser.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using POGOProtos.Enums;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;

namespace PogoLocationFeeder.Helper
Expand Down Expand Up @@ -33,21 +34,21 @@ public List<SniperInfo> parseMessage(string message)

private bool parseGeoCoordinates(string input)
{
Match match = Regex.Match(input, @"(?<lat>\-?\d+(\.\d+)+),\s*(?<long>\-?\d+(\.\d+)+)");
Match match = Regex.Match(input, @"(?<lat>\-?\d+[\,\.]\d+),\s*(?<long>\-?\d+[\,\.]\d+)");
if (match.Success)
{
sniperInfo.latitude = Convert.ToDouble(match.Groups["lat"].Value);
sniperInfo.longitude = Convert.ToDouble(match.Groups["long"].Value);
sniperInfo.latitude = Convert.ToDouble(match.Groups["lat"].Value.Replace(',', '.'), CultureInfo.InvariantCulture);
sniperInfo.longitude = Convert.ToDouble(match.Groups["long"].Value.Replace(',', '.'), CultureInfo.InvariantCulture);
}
return match.Success;
}

private void parseIV(string input)
{
Match match = Regex.Match(input, @"(\d+\.?\d*)\%?\s?IV", RegexOptions.IgnoreCase);
Match match = Regex.Match(input, @"(\d+[\,\.]?\d*)\%?\s?IV", RegexOptions.IgnoreCase);
if (match.Success)
{
sniperInfo.iv = Convert.ToDouble(match.Groups[1].Value);
sniperInfo.iv = Convert.ToDouble(match.Groups[1].Value.Replace(',', '.'), CultureInfo.InvariantCulture);
}
}

Expand Down

1 comment on commit 5e3b4c8

@romkazor
Copy link

@romkazor romkazor commented on 5e3b4c8 Jul 29, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, i use necrobot 0.3.3 from NecronomiconCoding channel
PogoLocationFeeder work fine, the parser is work, but any change i made in necro settings is reset when i start it.

This settings not save

"SnipeAtPokestops": true,
"SnipeLocationServer": "localhost",
"SnipeLocationServerPort": 16969,
"UseSnipeLocationServer": true,
"UseTransferIVForSnipe": false,
"MinDelayBetweenSnipes": 20000,

Please sign in to comment.