├── MSniper
├── Resources
│ ├── removeProtocol.bat
│ ├── registerProtocol.bat
│ ├── resetSnipeList.bat
│ └── msniper.ico
├── MSniperUpdater.exe1
├── Settings
│ ├── Localization
│ │ ├── Languages
│ │ │ ├── translation.en-US.json
│ │ │ ├── translation.tr-TR.json
│ │ │ ├── translation.zh-TW.json
│ │ │ ├── translation.it-IT.json
│ │ │ └── translation.es-ES.json
│ │ └── Translations.cs
│ └── Settings.cs
├── WFConsole
│ ├── ConsoleState.cs
│ ├── Dlls.cs
│ ├── FConsole.cs
│ ├── FWindow.Designer.cs
│ ├── FWindow.resx
│ └── FWindow.cs
├── App.config
├── Properties
│ ├── Settings.settings
│ ├── Settings.Designer.cs
│ ├── AssemblyInfo.cs
│ ├── Resources.resx
│ └── Resources.Designer.cs
├── MSniperInfo.cs
├── MSniperClient.cs
├── EncounterInfo.cs
├── Extensions
│ └── Extensions.cs
├── Program.cs
├── VersionCheck.cs
├── LiveFeed
│ ├── LiveFeed.cs
│ ├── LiveFeed.resx
│ └── LiveFeed.Designer.cs
├── KillSwitch.cs
├── ProtocolRegister.cs
├── Variables.cs
├── Enums
│ └── PokemonName.cs
├── Downloader.cs
└── MSniper.csproj
├── KillSwitch.txt
├── msniper1.gif
├── MSniperUpdater
├── App.config
├── Properties
│ └── AssemblyInfo.cs
├── MSniperUpdater.csproj
└── Program.cs
├── LICENSE
├── MSniper.sln
├── README.md
└── .gitignore
/MSniper/Resources/removeProtocol.bat:
--------------------------------------------------------------------------------
1 | start MSniper -remove
--------------------------------------------------------------------------------
/MSniper/Resources/registerProtocol.bat:
--------------------------------------------------------------------------------
1 | start MSniper -register
--------------------------------------------------------------------------------
/MSniper/Resources/resetSnipeList.bat:
--------------------------------------------------------------------------------
1 | start MSniper -resetallsnipelist
--------------------------------------------------------------------------------
/KillSwitch.txt:
--------------------------------------------------------------------------------
1 | Status=DISABLED;
2 | .
3 | .
4 | .
5 | project is down
6 |
--------------------------------------------------------------------------------
/msniper1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/MSniper/HEAD/msniper1.gif
--------------------------------------------------------------------------------
/MSniper/MSniperUpdater.exe1:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/MSniper/HEAD/MSniper/MSniperUpdater.exe1
--------------------------------------------------------------------------------
/MSniper/Resources/msniper.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/MSniper/HEAD/MSniper/Resources/msniper.ico
--------------------------------------------------------------------------------
/MSniper/Settings/Localization/Languages/translation.en-US.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/MSniper/HEAD/MSniper/Settings/Localization/Languages/translation.en-US.json
--------------------------------------------------------------------------------
/MSniper/Settings/Localization/Languages/translation.tr-TR.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/MSniper/HEAD/MSniper/Settings/Localization/Languages/translation.tr-TR.json
--------------------------------------------------------------------------------
/MSniper/Settings/Localization/Languages/translation.zh-TW.json:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/msx752/MSniper/HEAD/MSniper/Settings/Localization/Languages/translation.zh-TW.json
--------------------------------------------------------------------------------
/MSniper/WFConsole/ConsoleState.cs:
--------------------------------------------------------------------------------
1 | namespace MSniper.WFConsole
2 | {
3 | public enum ConsoleState
4 | {
5 | ReadLine = 0,
6 | ReadKey = 1,
7 | Closing = 2
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/MSniper/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/MSniperUpdater/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/MSniper/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MSniper/MSniperInfo.cs:
--------------------------------------------------------------------------------
1 | namespace MSniper
2 | {
3 | public class MSniperInfo
4 | {
5 | public string Id { get; set; }
6 | public double Latitude { get; set; }
7 | public double Longitude { get; set; }
8 |
9 | public override string ToString()
10 | {
11 | return $"{Id} {Latitude},{Longitude}";
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/MSniper/WFConsole/Dlls.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Runtime.InteropServices;
3 |
4 | namespace MSniper.WFConsole
5 | {
6 | public static class Dlls
7 | {
8 | [DllImport("USER32.DLL")]
9 | public static extern bool SetForegroundWindow(IntPtr hWnd);
10 |
11 | public static void BringToFront(IntPtr hWnd)
12 | {
13 | SetForegroundWindow(hWnd);
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/MSniper/MSniperClient.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace MSniper
9 | {
10 | public class MSniperClient : WebClient
11 | {
12 | protected override WebRequest GetWebRequest(Uri uri)
13 | {
14 | var w = base.GetWebRequest(uri);
15 | w.Timeout = 12345;
16 | return w;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/MSniper/EncounterInfo.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using MSniper.Enums;
7 |
8 | namespace MSniper
9 | {
10 | public class EncounterInfo : IDisposable
11 | {
12 | public short PokemonId { get; set; }
13 | public ulong EncounterId { get; set; }
14 | public string SpawnPointId { get; set; }
15 | public double Latitude { get; set; }
16 | public double Longitude { get; set; }
17 | public double Iv { get; set; }
18 | //public double Iv { get; set; }
19 |
20 | public void Dispose()
21 | {
22 | GC.SuppressFinalize(this);
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/MSniper/Extensions/Extensions.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using System.Linq;
3 |
4 | namespace MSniper.Extensions
5 | {
6 | public static class Extensions
7 | {
8 | public static string GetWindowTitle(this Process p)
9 | {
10 | try
11 | {
12 | var title = Process.GetProcessById(p.Id).MainWindowTitle;
13 | try
14 | {
15 | return title.Split('-').First().Split(' ')[2];
16 | }
17 | catch
18 | {
19 | return title;
20 | }
21 | }
22 | catch
23 | {
24 | return null;
25 | }
26 | }
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Mustafa Salih ASLIM
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/MSniper/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MSniper.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/MSniper/Program.cs:
--------------------------------------------------------------------------------
1 | using MSniper;
2 | using MSniper.Settings;
3 | using MSniper.Settings.Localization;
4 | using Newtonsoft.Json;
5 | using Newtonsoft.Json.Converters;
6 | using System;
7 | using System.Collections.Generic;
8 | using System.Diagnostics;
9 | using System.Drawing;
10 | using System.Globalization;
11 | using System.IO;
12 | using System.Linq;
13 | using System.Reflection;
14 | using System.Text;
15 | using System.Threading;
16 | using System.Threading.Tasks;
17 | using System.Windows.Forms;
18 | using MSniper.WFConsole;
19 |
20 | namespace MSniper
21 | {
22 | static class Program
23 | {
24 | public static FWindow frm { get; set; }
25 | #region form
26 | ///
27 | /// The main entry point for the application.
28 | ///
29 | [STAThread]
30 | static void Main(string[] _args)
31 | {
32 | Application.EnableVisualStyles();
33 | Application.SetCompatibleTextRenderingDefault(false);
34 | frm = new FWindow {Console = {Arguments = _args}};
35 | if (_args.Length > 0)
36 | frm.WindowState = FormWindowState.Minimized;
37 | Application.Run(frm);
38 | }
39 | #endregion
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/MSniper.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25420.1
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSniper", "MSniper\MSniper.csproj", "{24700CAC-B201-4D41-A971-146BDDB28FE8}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSniperUpdater", "MSniperUpdater\MSniperUpdater.csproj", "{92023B82-1A3F-44BB-B0C4-87CFEE4EBACE}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {24700CAC-B201-4D41-A971-146BDDB28FE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17 | {24700CAC-B201-4D41-A971-146BDDB28FE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
18 | {24700CAC-B201-4D41-A971-146BDDB28FE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
19 | {24700CAC-B201-4D41-A971-146BDDB28FE8}.Release|Any CPU.Build.0 = Release|Any CPU
20 | {92023B82-1A3F-44BB-B0C4-87CFEE4EBACE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21 | {92023B82-1A3F-44BB-B0C4-87CFEE4EBACE}.Debug|Any CPU.Build.0 = Debug|Any CPU
22 | {92023B82-1A3F-44BB-B0C4-87CFEE4EBACE}.Release|Any CPU.ActiveCfg = Release|Any CPU
23 | {92023B82-1A3F-44BB-B0C4-87CFEE4EBACE}.Release|Any CPU.Build.0 = Release|Any CPU
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/MSniperUpdater/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MSniperUpdater")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("MSniperUpdater")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("92023b82-1a3f-44bb-b0c4-87cfee4ebace")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/MSniper/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("MSniper")]
9 | [assembly: AssemblyDescription("necrobot2 pokemon sniper")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("by msx752")]
12 | [assembly: AssemblyProduct("MSniper")]
13 | [assembly: AssemblyCopyright("Copyright © 2016")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("24700cac-b201-4d41-a971-146bddb28fe8")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.6.5")]
36 | [assembly: AssemblyFileVersion("1.0.6.5")]
37 |
--------------------------------------------------------------------------------
/MSniper/VersionCheck.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Drawing;
3 | using System.Net;
4 | using System.Reflection;
5 | using System.Text.RegularExpressions;
6 |
7 | namespace MSniper
8 | {
9 | public static class VersionCheck
10 | {
11 | private static Version _rVersion = null;
12 | public static string RemoteVersion => _rVersion.ToString();
13 | public static string NameWithVersion => "MSniper.v" + RemoteVersion;
14 |
15 | public static bool IsLatest()
16 | {
17 | try
18 | {
19 | var regex = new Regex(@"\[assembly\: AssemblyVersion\(""(\d{1,})\.(\d{1,})\.(\d{1,})\.(\d{1,})""\)\]");
20 | var match = regex.Match(DownloadServerVersion());
21 |
22 | if (!match.Success)
23 | return false;
24 |
25 | var gitVersion = new Version($"{match.Groups[1]}.{match.Groups[2]}.{match.Groups[3]}.{match.Groups[4]}");
26 | _rVersion = gitVersion;
27 | if (gitVersion > Assembly.GetExecutingAssembly().GetName().Version)
28 | {
29 | return false;
30 | }
31 | }
32 | catch (Exception ex)
33 | {
34 | Program.frm.Console.WriteLine(ex.Message, Program.frm.Config.Error);
35 | return true; //better than just doing nothing when git server down
36 | }
37 |
38 | return true;
39 | }
40 |
41 | private static string DownloadServerVersion()
42 | {
43 | return Downloader.DownloadString(Variables.VersionUri);
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/MSniper/LiveFeed/LiveFeed.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using MSniper.Enums;
11 |
12 | namespace MSniper.LiveFeed
13 | {
14 | public partial class LiveFeed : Form
15 | {
16 | public LiveFeed()
17 | {
18 | InitializeComponent();
19 | CheckForIllegalCrossThreadCalls = false;
20 | }
21 |
22 | private void LiveFeed_Load(object sender, EventArgs e)
23 | {
24 |
25 | var lst = Enum.GetValues(typeof(PokemonId)).Cast().ToList();
26 | foreach (var item in lst)
27 | cmbPokemons.Items.Add(item);
28 |
29 | for (var i = 0; i <= 100; i++)
30 | cmbIv.Items.Add(i);
31 |
32 | //for (int i = 0; i < 100; i++)
33 | //{
34 | // ListViewItem item1 = new ListViewItem("Snorlax");
35 | // item1.SubItems.Add("100");
36 | // listPokemons.Items.Add(item1);
37 | //}
38 | listPokemons.AutoResizeColumns(ColumnHeaderAutoResizeStyle.HeaderSize);
39 | }
40 |
41 | private void btnSearch_Click(object sender, EventArgs e)
42 | {
43 | var IVPercent = -1;
44 | var success1 = int.TryParse(cmbIv.Text, out IVPercent);
45 | //if (!success1)
46 | //{ MessageBox.Show("Wrong IV%"); return; }
47 | if (!(IVPercent >= 0 && IVPercent <= 100))
48 | { MessageBox.Show("IV% min0 max100"); return; }
49 | }
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/MSniper/KillSwitch.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Net;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 |
8 | namespace MSniper
9 | {
10 | public class KillSwitch
11 | {
12 | ///
13 | /// reference from
14 | /// https://github.com/Necrobot-Private/NecroBot/blob/master/PoGo.NecroBot.CLI/Program.cs
15 | ///
16 | ///
17 | public static bool CheckKillSwitch()
18 | {
19 | try
20 | {
21 | var strResponse = Downloader.DownloadString(Variables.StrKillSwitchUri);
22 |
23 | if (strResponse == null)
24 | return false;
25 |
26 | var strSplit = strResponse.Split(';');
27 |
28 | if (strSplit.Length > 1)
29 | {
30 | var strStatus = strSplit[0];
31 | var strReason = strSplit[1];
32 |
33 | if (strStatus.Contains("DISABLED"))
34 | {
35 | Program.frm.Console.WriteLine(strReason + $"\n");
36 |
37 | Program.frm.Console.WriteLine("The msniper will now close, please press enter to continue", System.Drawing.Color.Wheat);
38 | Program.frm.Console.ReadLine();
39 | Program.frm.Shutdown(1);
40 | return true;
41 | }
42 | }
43 | else
44 | return false;
45 | }
46 | catch (WebException)
47 | {
48 | // ignored
49 | }
50 | return false;
51 | }
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://discord.gg/7FWyWVp)
2 | [](https://github.com/msx752/MSniper/releases)
3 | [](https://github.com/msx752/MSniper/releases/latest)
4 | [](https://github.com/msx752/MSniper/blob/master/LICENSE.md)
5 |
6 | # MSniper
7 | - Live Snipe with [MService](https://github.com/msx752/msniper-location-service) for [NecroBot2](https://github.com/Necrobot-Private/NecroBot)
8 | - was used [Special: WindowsForms.Console](https://github.com/msx752/WindowsForms.Console)
9 |
10 | ##### be careful using bot will cause ban, using bot your own risk
11 |
12 | 
13 |
14 | - [Description](https://msx752.github.io/MSniper/#description)
15 | - [Configuration](https://msx752.github.io/MSniper/#configuration)
16 | - [File Information](https://msx752.github.io/MSniper/#file-information)
17 | - [Protocols](https://msx752.github.io/MSniper/#protocols)
18 | - [Features](https://msx752.github.io/MSniper/#features)
19 | - [Advantage](https://msx752.github.io/MSniper/#advantage)
20 | - [Supported Languages](https://github.com/msx752/MSniper/tree/master/MSniper/Settings/Localization/Languages)
21 | - [Important](https://msx752.github.io/MSniper/#important)
22 | - [Frequently asked questions](https://msx752.github.io/MSniper/#frequently-asked-questions)
23 | - [Usage](https://msx752.github.io/MSniper/#usage)
24 |
25 | ### Requirements
26 | - [NecroBot](https://github.com/Necrobot-Private/NecroBot/releases/latest) `v1.0.0.0 or Upper`
27 |
28 | #### Download Latest Version
29 | - [MSniper Latest](https://github.com/msx752/MSniper/releases/latest)
30 |
--------------------------------------------------------------------------------
/MSniper/ProtocolRegister.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.Win32;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Windows.Forms;
6 |
7 | namespace MSniper
8 | {
9 | public static class Protocol
10 | {
11 | private static readonly List Protocols = new List() { "msniper", "pokesniper2" };
12 | public static void Delete()
13 | {
14 | try
15 | {
16 | foreach (var protocolName in Protocols)
17 | {
18 | if (Registry.ClassesRoot.OpenSubKey(protocolName) != null)
19 | Registry.ClassesRoot.DeleteSubKeyTree(protocolName, true);
20 | }
21 | }
22 | catch (Exception e)
23 | {
24 | throw e;
25 | }
26 | }
27 |
28 | public static bool IsRegistered()
29 | {
30 | return Protocols.All(protocolName => Registry.ClassesRoot.OpenSubKey(protocolName) != null);
31 | }
32 |
33 | //not necessary
34 | //public static void isProtocolExists(string protocolName)
35 | //{
36 | // if (Registry.ClassesRoot.OpenSubKey(protocolName) == null)
37 | // {
38 | // RegisterUrl(protocolName);
39 | // }
40 | // else
41 | // {
42 | // DeleteUrl(protocolName);
43 | // RegisterUrl(protocolName);
44 | // }
45 | //}
46 |
47 | public static void Register()
48 | {
49 | try
50 | {
51 | foreach (var protocolName in Protocols)
52 | {
53 | var nkey = Registry.ClassesRoot.CreateSubKey(protocolName);
54 | nkey.SetValue(null, $"URL:{protocolName} protocol");
55 | nkey.SetValue("URL Protocol", string.Empty);
56 | Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell");
57 | Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell\\open");
58 | nkey = Registry.ClassesRoot.CreateSubKey(protocolName + "\\Shell\\open\\command");
59 |
60 | nkey.SetValue(null, "\"" + Application.ExecutablePath + "\" \"%1\"");
61 | nkey.Close();
62 | }
63 | }
64 | catch (Exception e)
65 | {
66 | throw e;
67 | }
68 | }
69 | }
70 | }
--------------------------------------------------------------------------------
/MSniper/Variables.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Globalization;
4 | using System.IO;
5 | using System.Reflection;
6 | using System.Windows.Forms;
7 |
8 | namespace MSniper
9 | {
10 | public static class Variables
11 | {
12 | public static string BotExeName => "necrobot";
13 | public static string By => "Msx752";
14 | public static string CurrentVersion => Assembly.GetExecutingAssembly().GetName().Version.ToString();
15 | public static string ExecutablePath => Application.ExecutablePath;
16 | public static string FileLink => $"{GithubProjectUri}/releases/download/{{0}}/{ProgramName}.v{{0}}.zip";
17 | public static string GithubProjectUri => $"https://github.com/{By}/{ProgramName}";
18 | public static string GithubRawUri => $"https://raw.githubusercontent.com/{By}/{ProgramName}";
19 | public static string GithubIoUri => $"https://github.com/{By}/{ProgramName}/";
20 | //
21 | public static string SnipeWebsite => $"http://msniper.com/";
22 | public static string MinRequireVersion => "1.0.0.0";
23 | public static string ProgramName => "MSniper";
24 | public static string SettingPath => Path.Combine(Application.StartupPath, SettingsFileName);
25 | public static string SettingsFileName => "Settings.json";
26 | public static string SnipeFileName => "SnipeMS.json";
27 | public static string StartupPath => Path.GetDirectoryName(ExecutablePath);
28 |
29 | public static string StrKillSwitchUri =
30 | "https://raw.githubusercontent.com/Necrobot-Private/NecroBot/master/KillSwitch.txt";
31 | //$"https://raw.githubusercontent.com/{By}/{ProgramName}/master/KillSwitch.txt";
32 |
33 | public static List SupportedLanguages => new List()
34 | {
35 | new CultureInfo("tr-TR"),
36 | new CultureInfo("zh-TW"),
37 | new CultureInfo("en-US"),
38 | new CultureInfo("es-ES"),
39 | new CultureInfo("it-IT")
40 | };
41 |
42 | public static string TempPath => Path.Combine(Application.StartupPath, "temp");
43 | public static string TempRarFileUri => Path.Combine(TempPath, VersionCheck.NameWithVersion + ".zip");
44 | public static string TranslationsPath => Path.Combine(Variables.TempPath, "Languages");
45 | public static string TranslationUri => $"{GithubRawUri}/master/{ProgramName}/Settings/Localization/Languages/translation.{{0}}.json";
46 | public static string VersionUri => $"{GithubRawUri}/master/{ProgramName}/Properties/AssemblyInfo.cs";
47 | }
48 | }
--------------------------------------------------------------------------------
/MSniperUpdater/MSniperUpdater.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {92023B82-1A3F-44BB-B0C4-87CFEE4EBACE}
8 | Exe
9 | Properties
10 | MSniperUpdater
11 | MSniperUpdater
12 | v4.5.2
13 | 512
14 | true
15 |
16 |
17 | AnyCPU
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | AnyCPU
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
63 |
--------------------------------------------------------------------------------
/MSniperUpdater/Program.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Diagnostics;
3 | using System.IO;
4 | using System.IO.Compression;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading;
8 | using System.Threading.Tasks;
9 | using System.Windows.Forms;
10 | using static System.Console;
11 |
12 | namespace MSniperUpdater
13 | {
14 | internal class Program
15 | {
16 | public static void Main(string[] args)
17 | {
18 | //args = new string[] { "MSniper.v1.0.5" };
19 | if (args.Length > 0)
20 | {
21 | var plist = Process.GetProcessesByName("msniper");
22 | WriteLine("killing msniper.exe....");
23 | foreach (var t in plist)
24 | {
25 | try
26 | {
27 | while (true)
28 | {
29 | for (var i2 = 0; i2 < 10; i2++)
30 | {
31 | Thread.Sleep(200);
32 | t.Kill();
33 | break;
34 | }
35 | break;
36 | }
37 |
38 | }
39 | catch { }
40 | }
41 |
42 | Thread.Sleep(500);
43 | var deleteList = new string[] {
44 | "msniper.exe",
45 | "Newtonsoft.Json.dll",
46 | "registerProtocol.bat",
47 | "removeProtocol.bat",
48 | "resetSnipeList.bat"
49 | };
50 | WriteLine("deleting old files....");
51 | foreach (var item in deleteList)
52 | {
53 | try
54 | {
55 | while (true)
56 | {
57 | for (var i2 = 0; i2 < 10; i2++)
58 | {
59 | var delete = Path.Combine(Application.StartupPath, item);
60 | Thread.Sleep(200);
61 | File.Delete(delete);
62 | break;
63 | }
64 | break;
65 | }
66 | }
67 | catch { }
68 | }
69 | WriteLine("copying NEW files....");
70 | Thread.Sleep(300);
71 | var copyList = Directory.GetFiles(Application.StartupPath, $"temp\\{args[0]}\\");
72 | foreach (var item in copyList)
73 | {
74 | var f = new FileInfo(item);
75 | var newDir = Path.Combine(Application.StartupPath, f.Name);
76 | File.Copy(f.FullName, newDir, true);
77 | }
78 | WriteLine("TEMP DELETING....");
79 | Thread.Sleep(100);
80 | var tempFolder = Directory.GetParent(Directory.GetParent(copyList[0]).ToString()).ToString();
81 | try
82 | {
83 | Directory.Delete(tempFolder, true);
84 | }
85 | catch
86 | {
87 | Directory.Delete(tempFolder, true);
88 | }
89 | WriteLine("STARTING MSNIPER....");
90 | var runExe = Path.Combine(Application.StartupPath, "msniper.exe");
91 | Task.Run(() =>
92 | {
93 | var psi = new ProcessStartInfo(runExe);
94 | var proc = new Process {StartInfo = psi};
95 | proc.Start();
96 | proc.WaitForExit();
97 | });
98 | Thread.Sleep(2000);
99 | Process.GetCurrentProcess().Kill();
100 | }
101 | else
102 | {
103 | WriteLine("\t runs with parameter");
104 | WriteLine("\t runs with parameter");
105 | }
106 |
107 | //Console.ReadLine();
108 | }
109 | }
110 | }
111 |
--------------------------------------------------------------------------------
/MSniper/Enums/PokemonName.cs:
--------------------------------------------------------------------------------
1 | namespace MSniper.Enums
2 | {
3 | public enum PokemonId
4 | {
5 | Missingno = 0,
6 | Bulbasaur = 1,
7 | Ivysaur = 2,
8 | Venusaur = 3,
9 | Charmander = 4,
10 | Charmeleon = 5,
11 | Charizard = 6,
12 | Squirtle = 7,
13 | Wartortle = 8,
14 | Blastoise = 9,
15 | Caterpie = 10,
16 | Metapod = 11,
17 | Butterfree = 12,
18 | Weedle = 13,
19 | Kakuna = 14,
20 | Beedrill = 15,
21 | Pidgey = 16,
22 | Pidgeotto = 17,
23 | Pidgeot = 18,
24 | Rattata = 19,
25 | Raticate = 20,
26 | Spearow = 21,
27 | Fearow = 22,
28 | Ekans = 23,
29 | Arbok = 24,
30 | Pikachu = 25,
31 | Raichu = 26,
32 | Sandshrew = 27,
33 | Sandslash = 28,
34 | NidoranFemale = 29,
35 | Nidorina = 30,
36 | Nidoqueen = 31,
37 | NidoranMale = 32,
38 | Nidorino = 33,
39 | Nidoking = 34,
40 | Clefairy = 35,
41 | Clefable = 36,
42 | Vulpix = 37,
43 | Ninetales = 38,
44 | Jigglypuff = 39,
45 | Wigglytuff = 40,
46 | Zubat = 41,
47 | Golbat = 42,
48 | Oddish = 43,
49 | Gloom = 44,
50 | Vileplume = 45,
51 | Paras = 46,
52 | Parasect = 47,
53 | Venonat = 48,
54 | Venomoth = 49,
55 | Diglett = 50,
56 | Dugtrio = 51,
57 | Meowth = 52,
58 | Persian = 53,
59 | Psyduck = 54,
60 | Golduck = 55,
61 | Mankey = 56,
62 | Primeape = 57,
63 | Growlithe = 58,
64 | Arcanine = 59,
65 | Poliwag = 60,
66 | Poliwhirl = 61,
67 | Poliwrath = 62,
68 | Abra = 63,
69 | Kadabra = 64,
70 | Alakazam = 65,
71 | Machop = 66,
72 | Machoke = 67,
73 | Machamp = 68,
74 | Bellsprout = 69,
75 | Weepinbell = 70,
76 | Victreebel = 71,
77 | Tentacool = 72,
78 | Tentacruel = 73,
79 | Geodude = 74,
80 | Graveler = 75,
81 | Golem = 76,
82 | Ponyta = 77,
83 | Rapidash = 78,
84 | Slowpoke = 79,
85 | Slowbro = 80,
86 | Magnemite = 81,
87 | Magneton = 82,
88 | Farfetchd = 83,
89 | Doduo = 84,
90 | Dodrio = 85,
91 | Seel = 86,
92 | Dewgong = 87,
93 | Grimer = 88,
94 | Muk = 89,
95 | Shellder = 90,
96 | Cloyster = 91,
97 | Gastly = 92,
98 | Haunter = 93,
99 | Gengar = 94,
100 | Onix = 95,
101 | Drowzee = 96,
102 | Hypno = 97,
103 | Krabby = 98,
104 | Kingler = 99,
105 | Voltorb = 100,
106 | Electrode = 101,
107 | Exeggcute = 102,
108 | Exeggutor = 103,
109 | Cubone = 104,
110 | Marowak = 105,
111 | Hitmonlee = 106,
112 | Hitmonchan = 107,
113 | Lickitung = 108,
114 | Koffing = 109,
115 | Weezing = 110,
116 | Rhyhorn = 111,
117 | Rhydon = 112,
118 | Chansey = 113,
119 | Tangela = 114,
120 | Kangaskhan = 115,
121 | Horsea = 116,
122 | Seadra = 117,
123 | Goldeen = 118,
124 | Seaking = 119,
125 | Staryu = 120,
126 | Starmie = 121,
127 | MrMime = 122,
128 | Scyther = 123,
129 | Jynx = 124,
130 | Electabuzz = 125,
131 | Magmar = 126,
132 | Pinsir = 127,
133 | Tauros = 128,
134 | Magikarp = 129,
135 | Gyarados = 130,
136 | Lapras = 131,
137 | Ditto = 132,
138 | Eevee = 133,
139 | Vaporeon = 134,
140 | Jolteon = 135,
141 | Flareon = 136,
142 | Porygon = 137,
143 | Omanyte = 138,
144 | Omastar = 139,
145 | Kabuto = 140,
146 | Kabutops = 141,
147 | Aerodactyl = 142,
148 | Snorlax = 143,
149 | Articuno = 144,
150 | Zapdos = 145,
151 | Moltres = 146,
152 | Dratini = 147,
153 | Dragonair = 148,
154 | Dragonite = 149,
155 | Mewtwo = 150,
156 | Mew = 151
157 | }
158 | }
--------------------------------------------------------------------------------
/MSniper/Settings/Localization/Languages/translation.it-IT.json:
--------------------------------------------------------------------------------
1 | {
2 | "TranslationStrings": [
3 | {
4 | "Key": "title",
5 | "Value": "[{0} v{1}] - by {2}"
6 | },
7 | {
8 | "Key": "description",
9 | "Value": "{0} - v{1} Pokemon Sniper Manuale - by {2}"
10 | },
11 | {
12 | "Key": "gitHubProject",
13 | "Value": "Progetto GitHub {0}"
14 | },
15 | {
16 | "Key": "currentVersion",
17 | "Value": "Versione corrente: {0}"
18 | },
19 | {
20 | "Key": "protocolNotFound",
21 | "Value": "Protocollo non trovato - Perfavore esegui per una volta {0}"
22 | },
23 | {
24 | "Key": "shutdownMsg",
25 | "Value": "Il programma si chiuderà in {0} secondi"
26 | },
27 | {
28 | "Key": "latestVersion",
29 | "Value": "Versione più recente"
30 | },
31 | {
32 | "Key": "newVersion",
33 | "Value": "NUOVA VERSIONE"
34 | },
35 | {
36 | "Key": "downloadLink",
37 | "Value": "LINK DOWNLOAD"
38 | },
39 | {
40 | "Key": "autoDownloadMsg",
41 | "Value": "PREMI 'D' PER SCARICARE AUTOMATICAMENTE LA NUOVA VERSIONE O QUALSIASI ALTRO TASTO PER USCIRE.."
42 | },
43 | {
44 | "Key": "warning",
45 | "Value": "ATTENZIONE"
46 | },
47 | {
48 | "Key": "warningShutdownProcess",
49 | "Value": "Qualsiasi MSniper.exe verrà chiuso mentre si scaricherà"
50 | },
51 | {
52 | "Key": "integrateMsg",
53 | "Value": "{0} ha integrato NecroBot v{1} o superiore"
54 | },
55 | {
56 | "Key": "anyNecroBotNotFound",
57 | "Value": "Nessus NecroBot in esecuzione..."
58 | },
59 | {
60 | "Key": "runBeforeMSniper",
61 | "Value": "NecroBot deve essere eseguito prima di MSniper"
62 | },
63 | {
64 | "Key": "protocolRegistered",
65 | "Value": "Protocollo REGISTRATO correttamente:"
66 | },
67 | {
68 | "Key": "protocolDeleted",
69 | "Value": "Protocollo CANCELLATO correttamente:"
70 | },
71 | {
72 | "Key": "removeAllSnipe",
73 | "Value": "cancellato per {0}"
74 | },
75 | {
76 | "Key": "removeAllSnipeFinished",
77 | "Value": "Cancellando il contatore dei processi completati:{0}.."
78 | },
79 | {
80 | "Key": "unknownLinkFormat",
81 | "Value": "formato link sconosciuto"
82 | },
83 | {
84 | "Key": "customPasteDesc",
85 | "Value": "\t\tINCOLLA APPUNTI PERSONALIZZATO ATTIVATO"
86 | },
87 | {
88 | "Key": "customPasteFormat",
89 | "Value": "format: NomePokemon Latitudine,Longitudine"
90 | },
91 | {
92 | "Key": "waitingDataMsg",
93 | "Value": "in attesa dei dati.."
94 | },
95 | {
96 | "Key": "customPasteWrongFormat",
97 | "Value": "formato errato. riprova o premi 'E' per uscire.."
98 | },
99 | {
100 | "Key": "incompatibleVersionMsg",
101 | "Value": "Versione di Necrobot incompatibile per {0}"
102 | },
103 | {
104 | "Key": "sendingPokemonToNecroBot",
105 | "Value": "Inviato a {3}: {0} {1},{2}"
106 | },
107 | {
108 | "Key": "alreadySnipped",
109 | "Value": "{0}\t\tGià sniperato..."
110 | },
111 | {
112 | "Key": "downloadingNewVersion",
113 | "Value": "iniziando a scaricare {0} attendere prego..."
114 | },
115 | {
116 | "Key": "downloadFinished",
117 | "Value": "download completato..."
118 | },
119 | {
120 | "Key": "decompressingNewFile",
121 | "Value": "estraendo..."
122 | },
123 | {
124 | "Key": "oldFilesChangingWithNews",
125 | "Value": "aggiornando i file..."
126 | },
127 | {
128 | "Key": "subsequentProcessing",
129 | "Value": "Il processamento sequenziale finirà in {0} secondi o Chiudi il programma"
130 | },
131 | {
132 | "Key": "wrongPokemonName",
133 | "Value": "Pokemon '{0}' non definito"
134 | },
135 | {
136 | "Key": "activeBots",
137 | "Value": "NecroBot Attivi"
138 | },
139 | {
140 | "Key": "howTo",
141 | "Value": "Come"
142 | },
143 | {
144 | "Key": "configuration",
145 | "Value": "Configurazione"
146 | },
147 | {
148 | "Key": "usage",
149 | "Value": "Uso"
150 | },
151 | {
152 | "Key": "askedQuestions",
153 | "Value": "Domande richieste"
154 | },
155 | {
156 | "Key": "advantage",
157 | "Value": "Vantaggio"
158 | },
159 | {
160 | "Key": "fileInformation",
161 | "Value": "Informazioni file"
162 | },
163 | {
164 | "Key": "features",
165 | "Value": "Caratteristiche"
166 | },
167 | {
168 | "Key": "projectsLink",
169 | "Value": "Link progetto"
170 | },
171 | {
172 | "Key": "getLiveFeed",
173 | "Value": "Ottieni feed in tempo reale"
174 | },
175 | {
176 | "Key": "donate",
177 | "Value": "Dona"
178 | }
179 | ]
180 | }
181 |
--------------------------------------------------------------------------------
/MSniper/Settings/Localization/Languages/translation.es-ES.json:
--------------------------------------------------------------------------------
1 | {
2 | "TranslationStrings": [
3 | {
4 | "Key": "title",
5 | "Value": "[{0} v{1}] - Por {2}"
6 | },
7 | {
8 | "Key": "description",
9 | "Value": "{0} - v{1} Sniper Manual Pokemon - Por {2}"
10 | },
11 | {
12 | "Key": "gitHubProject",
13 | "Value": "GitHub Project {0}"
14 | },
15 | {
16 | "Key": "currentVersion",
17 | "Value": "Version Actual: {0}"
18 | },
19 | {
20 | "Key": "protocolNotFound",
21 | "Value": "Protocolo no encontrado - Porfavor, inicie el protocolo una vez {0}"
22 | },
23 | {
24 | "Key": "shutdownMsg",
25 | "Value": "El programa se cerrara en {0} segundos"
26 | },
27 | {
28 | "Key": "latestVersion",
29 | "Value": "Ultima Version"
30 | },
31 | {
32 | "Key": "newVersion",
33 | "Value": "NUEVA VERSION"
34 | },
35 | {
36 | "Key": "downloadLink",
37 | "Value": "ENLACE DE DESCARGA"
38 | },
39 | {
40 | "Key": "autoDownloadMsg",
41 | "Value": "PRESIONE 'D' PARA AUTODESCARGAR LA ACTUALIZACION. O CUALQUIER OTRA TECLA PARA SALIR.."
42 | },
43 | {
44 | "Key": "warning",
45 | "Value": "ADVERTENCIA"
46 | },
47 | {
48 | "Key": "warningShutdownProcess",
49 | "Value": "Todos los procesos seran detenidos para la actualizacion"
50 | },
51 | {
52 | "Key": "integrateMsg",
53 | "Value": "{0} Integracion con Necrobot v{1} o superior"
54 | },
55 | {
56 | "Key": "anyNecroBotNotFound",
57 | "Value": "No se puede encontrar a Necrobot en funcionamiento..."
58 | },
59 | {
60 | "Key": "runBeforeMSniper",
61 | "Value": "Necrobot debe estar corriendo antes de ejecutar MSniper"
62 | },
63 | {
64 | "Key": "protocolRegistered",
65 | "Value": "Protocolo Satisfactoriamente REGISTRADO:"
66 | },
67 | {
68 | "Key": "protocolDeleted",
69 | "Value": "Protocol Satisfactoriamente ELIMINADO:"
70 | },
71 | {
72 | "Key": "removeAllSnipe",
73 | "Value": "Eliminado por {0}"
74 | },
75 | {
76 | "Key": "removeAllSnipeFinished",
77 | "Value": "Finalezaremos en :{0}.."
78 | },
79 | {
80 | "Key": "unknownLinkFormat",
81 | "Value": "Formato de enlace Desconocido"
82 | },
83 | {
84 | "Key": "customPasteDesc",
85 | "Value": "\t\tMODO MANUAL ACTIVADO"
86 | },
87 | {
88 | "Key": "customPasteFormat",
89 | "Value": "Formato: Pokemon Latitud, Longitud"
90 | },
91 | {
92 | "Key": "waitingDataMsg",
93 | "Value": "Esperando datos.."
94 | },
95 | {
96 | "Key": "customPasteWrongFormat",
97 | "Value": "Formato errado, intentelo de nuevo o presione 'E' para salir.."
98 | },
99 | {
100 | "Key": "incompatibleVersionMsg",
101 | "Value": "Version Incompatible de NecroBot {0}"
102 | },
103 | {
104 | "Key": "sendingPokemonToNecroBot",
105 | "Value": "Enviando a {3}: {0} {1},{2}"
106 | },
107 | {
108 | "Key": "alreadySnipped",
109 | "Value": "{0}\t\tYa se esta Snipeando..."
110 | },
111 | {
112 | "Key": "downloadingNewVersion",
113 | "Value": "Comenzando Descarga {0} Porfavor Espere..."
114 | },
115 | {
116 | "Key": "downloadFinished",
117 | "Value": "Descarga Finalizada..."
118 | },
119 | {
120 | "Key": "decompressingNewFile",
121 | "Value": "Descomprimiendo..."
122 | },
123 | {
124 | "Key": "oldFilesChangingWithNews",
125 | "Value": "Reemplazando archivos..."
126 | },
127 | {
128 | "Key": "subsequentProcessing",
129 | "Value": "Terminaremos en {0} segundos, puede cerrar el programa"
130 | },
131 | {
132 | "Key": "wrongPokemonName",
133 | "Value": "Pokemon '{0}' no definida"
134 | },
135 | {
136 | "Key": "activeBots",
137 | "Value": "Bots Activos"
138 | },
139 | {
140 | "Key": "howTo",
141 | "Value": "Ayuda"
142 | },
143 | {
144 | "Key": "configuration",
145 | "Value": "Configuración"
146 | },
147 | {
148 | "Key": "usage",
149 | "Value": "Uso"
150 | },
151 | {
152 | "Key": "askedQuestions",
153 | "Value": "Preguntas solicitadas"
154 | },
155 | {
156 | "Key": "advantage",
157 | "Value": "Avanzado"
158 | },
159 | {
160 | "Key": "fileInformation",
161 | "Value": "Informacion de Archivos"
162 | },
163 | {
164 | "Key": "features",
165 | "Value": "Funciones"
166 | },
167 | {
168 | "Key": "projectsLink",
169 | "Value": "Enlace del Proyecto"
170 | },
171 | {
172 | "Key": "getLiveFeed",
173 | "Value": "Opten Informacion en Vivo"
174 | },
175 | {
176 | "Key": "donate",
177 | "Value": "Donar"
178 | }
179 | ]
180 | }
181 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 |
4 | # User-specific files
5 | *.suo
6 | *.user
7 | *.userosscache
8 | *.sln.docstates
9 |
10 | # User-specific files (MonoDevelop/Xamarin Studio)
11 | *.userprefs
12 |
13 | # Build results
14 | [Dd]ebug/
15 | [Dd]ebugPublic/
16 | [Rr]elease/
17 | [Rr]eleases/
18 | x64/
19 | x86/
20 | bld/
21 | [Bb]in/
22 | [Oo]bj/
23 | [Ll]og/
24 |
25 | # Visual Studio 2015 cache/options directory
26 | .vs/
27 | # Uncomment if you have tasks that create the project's static files in wwwroot
28 | #wwwroot/
29 |
30 | # MSTest test Results
31 | [Tt]est[Rr]esult*/
32 | [Bb]uild[Ll]og.*
33 |
34 | # NUNIT
35 | *.VisualState.xml
36 | TestResult.xml
37 |
38 | # Build Results of an ATL Project
39 | [Dd]ebugPS/
40 | [Rr]eleasePS/
41 | dlldata.c
42 |
43 | # DNX
44 | project.lock.json
45 | artifacts/
46 |
47 | *_i.c
48 | *_p.c
49 | *_i.h
50 | *.ilk
51 | *.meta
52 | *.obj
53 | *.pch
54 | *.pdb
55 | *.pgc
56 | *.pgd
57 | *.rsp
58 | *.sbr
59 | *.tlb
60 | *.tli
61 | *.tlh
62 | *.tmp
63 | *.tmp_proj
64 | *.log
65 | *.vspscc
66 | *.vssscc
67 | .builds
68 | *.pidb
69 | *.svclog
70 | *.scc
71 |
72 | # Chutzpah Test files
73 | _Chutzpah*
74 |
75 | # Visual C++ cache files
76 | ipch/
77 | *.aps
78 | *.ncb
79 | *.opendb
80 | *.opensdf
81 | *.sdf
82 | *.cachefile
83 | *.VC.db
84 | *.VC.VC.opendb
85 |
86 | # Visual Studio profiler
87 | *.psess
88 | *.vsp
89 | *.vspx
90 | *.sap
91 |
92 | # TFS 2012 Local Workspace
93 | $tf/
94 |
95 | # Guidance Automation Toolkit
96 | *.gpState
97 |
98 | # ReSharper is a .NET coding add-in
99 | _ReSharper*/
100 | *.[Rr]e[Ss]harper
101 | *.DotSettings.user
102 |
103 | # JustCode is a .NET coding add-in
104 | .JustCode
105 |
106 | # TeamCity is a build add-in
107 | _TeamCity*
108 |
109 | # DotCover is a Code Coverage Tool
110 | *.dotCover
111 |
112 | # NCrunch
113 | _NCrunch_*
114 | .*crunch*.local.xml
115 | nCrunchTemp_*
116 |
117 | # MightyMoose
118 | *.mm.*
119 | AutoTest.Net/
120 |
121 | # Web workbench (sass)
122 | .sass-cache/
123 |
124 | # Installshield output folder
125 | [Ee]xpress/
126 |
127 | # DocProject is a documentation generator add-in
128 | DocProject/buildhelp/
129 | DocProject/Help/*.HxT
130 | DocProject/Help/*.HxC
131 | DocProject/Help/*.hhc
132 | DocProject/Help/*.hhk
133 | DocProject/Help/*.hhp
134 | DocProject/Help/Html2
135 | DocProject/Help/html
136 |
137 | # Click-Once directory
138 | publish/
139 |
140 | # Publish Web Output
141 | *.[Pp]ublish.xml
142 | *.azurePubxml
143 | # TODO: Comment the next line if you want to checkin your web deploy settings
144 | # but database connection strings (with potential passwords) will be unencrypted
145 | *.pubxml
146 | *.publishproj
147 |
148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
149 | # checkin your Azure Web App publish settings, but sensitive information contained
150 | # in these scripts will be unencrypted
151 | PublishScripts/
152 |
153 | # NuGet Packages
154 | *.nupkg
155 | # The packages folder can be ignored because of Package Restore
156 | **/packages/*
157 | # except build/, which is used as an MSBuild target.
158 | !**/packages/build/
159 | # Uncomment if necessary however generally it will be regenerated when needed
160 | #!**/packages/repositories.config
161 | # NuGet v3's project.json files produces more ignoreable files
162 | *.nuget.props
163 | *.nuget.targets
164 |
165 | # Microsoft Azure Build Output
166 | csx/
167 | *.build.csdef
168 |
169 | # Microsoft Azure Emulator
170 | ecf/
171 | rcf/
172 |
173 | # Windows Store app package directories and files
174 | AppPackages/
175 | BundleArtifacts/
176 | Package.StoreAssociation.xml
177 | _pkginfo.txt
178 |
179 | # Visual Studio cache files
180 | # files ending in .cache can be ignored
181 | *.[Cc]ache
182 | # but keep track of directories ending in .cache
183 | !*.[Cc]ache/
184 |
185 | # Others
186 | ClientBin/
187 | ~$*
188 | *~
189 | *.dbmdl
190 | *.dbproj.schemaview
191 | *.pfx
192 | *.publishsettings
193 | node_modules/
194 | orleans.codegen.cs
195 |
196 | # Since there are multiple workflows, uncomment next line to ignore bower_components
197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
198 | #bower_components/
199 |
200 | # RIA/Silverlight projects
201 | Generated_Code/
202 |
203 | # Backup & report files from converting an old project file
204 | # to a newer Visual Studio version. Backup files are not needed,
205 | # because we have git ;-)
206 | _UpgradeReport_Files/
207 | Backup*/
208 | UpgradeLog*.XML
209 | UpgradeLog*.htm
210 |
211 | # SQL Server files
212 | *.mdf
213 | *.ldf
214 |
215 | # Business Intelligence projects
216 | *.rdl.data
217 | *.bim.layout
218 | *.bim_*.settings
219 |
220 | # Microsoft Fakes
221 | FakesAssemblies/
222 |
223 | # GhostDoc plugin setting file
224 | *.GhostDoc.xml
225 |
226 | # Node.js Tools for Visual Studio
227 | .ntvs_analysis.dat
228 |
229 | # Visual Studio 6 build log
230 | *.plg
231 |
232 | # Visual Studio 6 workspace options file
233 | *.opt
234 |
235 | # Visual Studio LightSwitch build output
236 | **/*.HTMLClient/GeneratedArtifacts
237 | **/*.DesktopClient/GeneratedArtifacts
238 | **/*.DesktopClient/ModelManifest.xml
239 | **/*.Server/GeneratedArtifacts
240 | **/*.Server/ModelManifest.xml
241 | _Pvt_Extensions
242 |
243 | # Paket dependency manager
244 | .paket/paket.exe
245 | paket-files/
246 |
247 | # FAKE - F# Make
248 | .fake/
249 |
250 | # JetBrains Rider
251 | .idea/
252 | *.sln.iml
253 |
--------------------------------------------------------------------------------
/MSniper/Settings/Settings.cs:
--------------------------------------------------------------------------------
1 | using Newtonsoft.Json;
2 | using Newtonsoft.Json.Converters;
3 | using System;
4 | using System.Drawing;
5 | using System.IO;
6 | using System.Threading;
7 |
8 |
9 | namespace MSniper.Settings
10 | {
11 | public interface IConfigs
12 | {
13 | string TranslationLanguageCode { get; set; }
14 | int CloseDelaySec { get; set; }
15 | bool DownloadNewVersion { get; set; }
16 | Color Error { get; }
17 | string ErrorColor { get; set; }
18 | Color Highlight { get; }
19 | string HighlightColor { get; set; }
20 | Color Notification { get; }
21 | string NotificationColor { get; set; }
22 | bool ShowActiveBots { get; set; }
23 | Color Success { get; }
24 | string SuccessColor { get; set; }
25 | Color Warning { get; }
26 | string WarningColor { get; set; }
27 | bool AutoCultureDetect { get; set; }
28 | void Save(string fullPath);
29 | }
30 |
31 | public class Configs : IConfigs
32 | {
33 | public string TranslationLanguageCode { get; set; } = "en-US";
34 | public bool AutoCultureDetect { get; set; } = true;
35 | public int CloseDelaySec { get; set; } = 10;
36 | public bool DownloadNewVersion { get; set; } = true;
37 | public bool ShowActiveBots { get; set; } = true;
38 |
39 | public string ErrorColor { get; set; } = ColorToHex(Color.FromArgb(255, 0x20, 0));
40 |
41 | public string HighlightColor { get; set; } = ColorToHex(Color.White);
42 |
43 | public string NotificationColor { get; set; } = ColorToHex(Color.FromArgb(0, 0xfa, 0xbf));
44 |
45 | public string SuccessColor { get; set; } = ColorToHex(Color.FromArgb(0, 255, 0));
46 |
47 | public string WarningColor { get; set; } = ColorToHex(Color.FromArgb(0xff, 0xc8, 0));
48 |
49 |
50 | [JsonIgnore]
51 | public Color Error => HexToColor(ErrorColor);
52 |
53 | [JsonIgnore]
54 | public Color Highlight => HexToColor(HighlightColor);
55 |
56 | [JsonIgnore]
57 | public Color Notification => HexToColor(NotificationColor);
58 |
59 | [JsonIgnore]
60 | public Color Success => HexToColor(SuccessColor);
61 |
62 | [JsonIgnore]
63 | public Color Warning => HexToColor(WarningColor);
64 |
65 | public static string ColorToHex(Color c)
66 | {
67 | return $"#{c.R.ToString("X2")}{c.G.ToString("X2")}{c.B.ToString("X2")}";
68 | }
69 | public static Color HexToColor(string hex)
70 | {
71 | return ColorTranslator.FromHtml(hex);
72 | }
73 |
74 | public static Configs Load()
75 | {
76 | var settings = new Configs();
77 | var configFile = Variables.SettingPath;
78 | if (!File.Exists(configFile)) return settings;
79 | try
80 | {
81 | //if the file exists, load the settings
82 | var input = "";
83 | var count = 0;
84 | while (true)
85 | {
86 | try
87 | {
88 | input = File.ReadAllText(configFile);
89 |
90 | break;
91 | }
92 | catch (Exception exception)
93 | {
94 | if (count > 10)
95 | {
96 | //sometimes we have to wait close to config.json for access
97 | Program.frm.Console.WriteLine("configFile: " + exception.Message, Color.Red);
98 | }
99 | count++;
100 | Thread.Sleep(1000);
101 | }
102 | };
103 |
104 | var jsonSettings = new JsonSerializerSettings();
105 | jsonSettings.Converters.Add(new StringEnumConverter { CamelCaseText = true });
106 | jsonSettings.ObjectCreationHandling = ObjectCreationHandling.Replace;
107 |
108 | try
109 | {
110 | settings = JsonConvert.DeserializeObject(input, jsonSettings);
111 | SaveFiles(settings);
112 | }
113 | catch (JsonSerializationException exception)
114 | {
115 | Program.frm.Console.WriteLine("Settings.json WRONG FORMAT: " + exception.Message, Color.Red);
116 | Program.frm.Delay(30);
117 | }
118 | }
119 | catch (JsonReaderException exception)
120 | {
121 | Program.frm.Console.WriteLine("JSON Exception: " + exception.Message, Color.Red);
122 | return settings;
123 | }
124 |
125 | return settings;
126 | }
127 |
128 | public static void SaveFiles(Configs settings)
129 | {
130 | settings.Save(Variables.SettingPath);
131 | }
132 |
133 | public void Save(string fullPath)
134 | {
135 | var output = JsonConvert.SerializeObject(this, Formatting.Indented,
136 | new StringEnumConverter { CamelCaseText = true });
137 |
138 | var folder = Path.GetDirectoryName(fullPath);
139 | if (folder != null && !Directory.Exists(folder))
140 | {
141 | Directory.CreateDirectory(folder);
142 | }
143 |
144 | File.WriteAllText(fullPath, output);
145 | }
146 | }
147 | }
--------------------------------------------------------------------------------
/MSniper/Downloader.cs:
--------------------------------------------------------------------------------
1 | using MSniper.Settings.Localization;
2 | using System;
3 | using System.Diagnostics;
4 | using System.Drawing;
5 | using System.IO;
6 | using System.IO.Compression;
7 | using System.Text;
8 | using System.Threading;
9 | using System.Windows.Forms;
10 |
11 | namespace MSniper
12 | {
13 | public static class Downloader
14 | {
15 | public static byte[] DownloadData(string url)
16 | {
17 | using (var w = new MSniperClient())
18 | {
19 | w.Encoding = Encoding.Unicode;
20 | return w.DownloadData(url);
21 | }
22 | }
23 |
24 | public static void DownloadNewVersion()
25 | {
26 | Program.frm.Console.WriteLine(Program.frm.Culture.GetTranslation(TranslationString.DownloadingNewVersion, VersionCheck.NameWithVersion), Program.frm.Config.Success);
27 | var downloaded = GetFile(VersionCheck.RemoteVersion);
28 | Program.frm.Console.WriteLine(Program.frm.Culture.GetTranslation(TranslationString.DownloadFinished), Program.frm.Config.Success);
29 | WriteFile(downloaded, Variables.TempRarFileUri);
30 | Program.frm.Console.WriteLine(Program.frm.Culture.GetTranslation(TranslationString.DecompressingNewFile), Program.frm.Config.Success);
31 | DecompressZip(Variables.TempRarFileUri);
32 | Program.frm.Console.WriteLine(Program.frm.Culture.GetTranslation(TranslationString.OldFilesChangingWithNews), Program.frm.Config.Success);
33 | ChangeWithOldFiles();
34 | }
35 |
36 | public static string DownloadString(string url)
37 | {
38 | using (var w = new MSniperClient())
39 | {
40 | return w.DownloadString(url);
41 | }
42 | }
43 |
44 | ///
45 | /// running batch
46 | ///
47 | ///
48 | ///
49 | private static void ChangeWithOldFiles()
50 | {
51 | //https://github.com/msx752/MSniper/blob/master/MSniper/MSniperUpdater.exe1?raw=true
52 | string url = $"{Variables.GithubProjectUri}/blob/master/MSniper/MSniperUpdater.exe1?raw=true";
53 | var updater = Path.Combine(Application.StartupPath, "MSniperUpdater.exe");
54 | var updaterData = DownloadData(url);
55 | File.WriteAllBytes(updater, updaterData);
56 | Thread.Sleep(500);
57 | var psi = new ProcessStartInfo(updater, VersionCheck.NameWithVersion);
58 | var proc = new Process {StartInfo = psi};
59 | proc.Start();
60 | proc.WaitForExit();
61 | Process.GetCurrentProcess().Kill();
62 | }
63 |
64 | private static void CreateEmptyFile(string fullpath)
65 | {
66 | if (!Directory.Exists(Path.GetDirectoryName(fullpath)))
67 | {
68 | Directory.CreateDirectory(Path.GetDirectoryName(fullpath));
69 | }
70 | if (File.Exists(fullpath)) return;
71 | var sw = new StreamWriter(fullpath, false);
72 | sw.Write(' ');
73 | sw.Close();
74 | }
75 |
76 | /////
77 | ///// returns fileupdater.bat full path
78 | /////
79 | /////
80 | /////
81 | //private static string CreateUpdaterBatch()
82 | //{
83 | // var path = Path.Combine(Variables.TempPath, "fileUpdater.bat");
84 | // var sb = new StringBuilder();
85 | // sb.AppendLine("@echo off");
86 | // sb.AppendLine("ECHO ### FILES CHANGING ###");
87 | // sb.AppendLine($"ECHO ### {VersionCheck.NameWithVersion}.exe ###");
88 | // sb.AppendLine("ECHO .");
89 | // sb.AppendLine("taskkill /F /IM \"MSniper.exe\"");
90 | // sb.AppendLine("timeout /t 1");
91 | // sb.AppendLine($"xcopy /s/y/e/q/r \"%cd%\\temp\\{VersionCheck.NameWithVersion}\" \"%cd%\"");
92 | // sb.AppendLine("timeout /t 1");
93 | // sb.AppendLine("del /S \"..\\registerProtocol.bat\"");
94 | // sb.AppendLine("del /S \"..\\removeProtocol.bat\"");
95 | // sb.AppendLine("del /S \"..\\resetSnipeList.bat\"");
96 | // sb.AppendLine("del /S \"..\\Newtonsoft.Json.dll\"");
97 | // sb.AppendLine("timeout /t 1");
98 | // sb.AppendLine("start \"\" \"%cd%\\MSniper.exe\"");
99 | // sb.AppendLine("ECHO ### FINISHED ###");
100 | // File.WriteAllText(path, sb.ToString());
101 | // return path;
102 | //}
103 |
104 | private static void DecompressZip(string zipFullPath)
105 | {
106 | using (var archive = ZipFile.OpenRead(zipFullPath))
107 | {
108 | foreach (var entry in archive.Entries)
109 | {
110 | var path = Path.Combine(Variables.TempPath, VersionCheck.NameWithVersion, entry.FullName);
111 | CreateEmptyFile(path);
112 | entry.ExtractToFile(path, true);
113 | }
114 | }
115 | }
116 |
117 | private static byte[] GetFile(string fileVersion)
118 | {
119 | try
120 | {
121 | var url = string.Format(Variables.FileLink, fileVersion);
122 | var downloadedFile = DownloadData(url);
123 | return downloadedFile;
124 | }
125 | catch (Exception ex)
126 | {
127 | try
128 | {
129 | return GetFile(VersionCheck.RemoteVersion.Substring(0, 5));
130 | }
131 | catch { }
132 | Program.frm.Console.WriteLine(ex.Message, Program.frm.Config.Error);
133 | return null;
134 | }
135 | }
136 |
137 | private static void WriteFile(byte[] bytes, string fullpath)
138 | {
139 | CreateEmptyFile(fullpath);
140 | File.WriteAllBytes(fullpath, bytes);
141 | }
142 | }
143 | }
--------------------------------------------------------------------------------
/MSniper/LiveFeed/LiveFeed.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/MSniper/LiveFeed/LiveFeed.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MSniper.LiveFeed
2 | {
3 | partial class LiveFeed
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.cmbPokemons = new System.Windows.Forms.ComboBox();
32 | this.lvlPokemonFilter = new System.Windows.Forms.Label();
33 | this.btnSearch = new System.Windows.Forms.Button();
34 | this.listPokemons = new System.Windows.Forms.ListView();
35 | this.clPokemonName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
36 | this.clPokemonIV = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
37 | this.cmbIv = new System.Windows.Forms.ComboBox();
38 | this.lblIvFilter = new System.Windows.Forms.Label();
39 | this.btnClear = new System.Windows.Forms.Button();
40 | this.SuspendLayout();
41 | //
42 | // cmbPokemons
43 | //
44 | this.cmbPokemons.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
45 | this.cmbPokemons.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
46 | this.cmbPokemons.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
47 | this.cmbPokemons.FormattingEnabled = true;
48 | this.cmbPokemons.Location = new System.Drawing.Point(4, 20);
49 | this.cmbPokemons.Name = "cmbPokemons";
50 | this.cmbPokemons.Size = new System.Drawing.Size(121, 21);
51 | this.cmbPokemons.TabIndex = 0;
52 | //
53 | // lvlPokemonFilter
54 | //
55 | this.lvlPokemonFilter.AutoSize = true;
56 | this.lvlPokemonFilter.Location = new System.Drawing.Point(21, 2);
57 | this.lvlPokemonFilter.Name = "lvlPokemonFilter";
58 | this.lvlPokemonFilter.Size = new System.Drawing.Size(77, 13);
59 | this.lvlPokemonFilter.TabIndex = 1;
60 | this.lvlPokemonFilter.Text = "Pokemon Filter";
61 | //
62 | // btnSearch
63 | //
64 | this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
65 | this.btnSearch.Location = new System.Drawing.Point(202, 4);
66 | this.btnSearch.Name = "btnSearch";
67 | this.btnSearch.Size = new System.Drawing.Size(95, 37);
68 | this.btnSearch.TabIndex = 2;
69 | this.btnSearch.Text = "Search";
70 | this.btnSearch.UseVisualStyleBackColor = true;
71 | this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
72 | //
73 | // listPokemons
74 | //
75 | this.listPokemons.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
76 | this.clPokemonName,
77 | this.clPokemonIV});
78 | this.listPokemons.Cursor = System.Windows.Forms.Cursors.Hand;
79 | this.listPokemons.FullRowSelect = true;
80 | this.listPokemons.GridLines = true;
81 | this.listPokemons.HoverSelection = true;
82 | this.listPokemons.Location = new System.Drawing.Point(1, 45);
83 | this.listPokemons.Name = "listPokemons";
84 | this.listPokemons.Size = new System.Drawing.Size(199, 368);
85 | this.listPokemons.TabIndex = 3;
86 | this.listPokemons.UseCompatibleStateImageBehavior = false;
87 | this.listPokemons.View = System.Windows.Forms.View.Details;
88 | //
89 | // clPokemonName
90 | //
91 | this.clPokemonName.Text = "Pokemon Name";
92 | this.clPokemonName.Width = 95;
93 | //
94 | // clPokemonIV
95 | //
96 | this.clPokemonIV.Text = "IV";
97 | this.clPokemonIV.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
98 | this.clPokemonIV.Width = 23;
99 | //
100 | // cmbIv
101 | //
102 | this.cmbIv.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
103 | this.cmbIv.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
104 | this.cmbIv.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
105 | this.cmbIv.FormattingEnabled = true;
106 | this.cmbIv.Location = new System.Drawing.Point(140, 19);
107 | this.cmbIv.Name = "cmbIv";
108 | this.cmbIv.Size = new System.Drawing.Size(56, 21);
109 | this.cmbIv.TabIndex = 0;
110 | //
111 | // lblIvFilter
112 | //
113 | this.lblIvFilter.AutoSize = true;
114 | this.lblIvFilter.Location = new System.Drawing.Point(141, 1);
115 | this.lblIvFilter.Name = "lblIvFilter";
116 | this.lblIvFilter.Size = new System.Drawing.Size(50, 13);
117 | this.lblIvFilter.TabIndex = 1;
118 | this.lblIvFilter.Text = "IV% Filter";
119 | //
120 | // btnClear
121 | //
122 | this.btnClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
123 | this.btnClear.Location = new System.Drawing.Point(202, 47);
124 | this.btnClear.Name = "btnClear";
125 | this.btnClear.Size = new System.Drawing.Size(95, 37);
126 | this.btnClear.TabIndex = 2;
127 | this.btnClear.Text = "Clear";
128 | this.btnClear.UseVisualStyleBackColor = true;
129 | //
130 | // LiveFeed
131 | //
132 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
133 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
134 | this.ClientSize = new System.Drawing.Size(302, 415);
135 | this.Controls.Add(this.listPokemons);
136 | this.Controls.Add(this.btnClear);
137 | this.Controls.Add(this.btnSearch);
138 | this.Controls.Add(this.lblIvFilter);
139 | this.Controls.Add(this.lvlPokemonFilter);
140 | this.Controls.Add(this.cmbIv);
141 | this.Controls.Add(this.cmbPokemons);
142 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
143 | this.Name = "LiveFeed";
144 | this.Text = "LiveFeed";
145 | this.Load += new System.EventHandler(this.LiveFeed_Load);
146 | this.ResumeLayout(false);
147 | this.PerformLayout();
148 |
149 | }
150 |
151 | #endregion
152 |
153 | private System.Windows.Forms.ComboBox cmbPokemons;
154 | private System.Windows.Forms.Label lvlPokemonFilter;
155 | private System.Windows.Forms.Button btnSearch;
156 | private System.Windows.Forms.ListView listPokemons;
157 | private System.Windows.Forms.ColumnHeader clPokemonName;
158 | private System.Windows.Forms.ColumnHeader clPokemonIV;
159 | private System.Windows.Forms.ComboBox cmbIv;
160 | private System.Windows.Forms.Label lblIvFilter;
161 | private System.Windows.Forms.Button btnClear;
162 | }
163 | }
--------------------------------------------------------------------------------
/MSniper/MSniper.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | AnyCPU
7 | {24700CAC-B201-4D41-A971-146BDDB28FE8}
8 | WinExe
9 | Properties
10 | MSniper
11 | MSniper
12 | v4.5.2
13 | 512
14 | true
15 | publish\
16 | true
17 | Disk
18 | false
19 | Foreground
20 | 7
21 | Days
22 | false
23 | false
24 | true
25 | 0
26 | 1.0.0.%2a
27 | false
28 | false
29 | true
30 |
31 |
32 | AnyCPU
33 | true
34 | full
35 | false
36 | bin\Debug\
37 | TRACE;DEBUG
38 | prompt
39 | 4
40 |
41 |
42 | AnyCPU
43 | pdbonly
44 | true
45 | bin\Release\
46 | TRACE
47 | prompt
48 | 4
49 |
50 |
51 | Resources\msniper.ico
52 |
53 |
54 | true
55 |
56 |
57 |
58 | False
59 | D:\Github_SourceTree\MSniper\master\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 | Form
82 |
83 |
84 | LiveFeed.cs
85 |
86 |
87 | Component
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 | Component
100 |
101 |
102 | Form
103 |
104 |
105 | FWindow.cs
106 |
107 |
108 |
109 | LiveFeed.cs
110 |
111 |
112 | ResXFileCodeGenerator
113 | Resources.Designer.cs
114 | Designer
115 |
116 |
117 | True
118 | Resources.resx
119 | True
120 |
121 |
122 | FWindow.cs
123 |
124 |
125 | SettingsSingleFileGenerator
126 | Settings.Designer.cs
127 |
128 |
129 | True
130 | Settings.settings
131 | True
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 | False
154 | Microsoft .NET Framework 4.5.2 %28x86 and x64%29
155 | true
156 |
157 |
158 | False
159 | .NET Framework 3.5 SP1
160 | false
161 |
162 |
163 |
164 |
165 |
166 |
167 |
174 |
--------------------------------------------------------------------------------
/MSniper/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\Newtonsoft.Json.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
123 |
124 |
125 | ..\Resources\registerProtocol.bat;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1254
126 |
127 |
128 | ..\Resources\removeProtocol.bat;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1254
129 |
130 |
131 | ..\Resources\resetSnipeList.bat;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;windows-1254
132 |
133 |
134 | ..\settings\localization\languages\translation.en-us.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16
135 |
136 |
137 | ..\settings\localization\languages\translation.es-es.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16
138 |
139 |
140 | ..\settings\localization\languages\translation.tr-tr.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16
141 |
142 |
143 | ..\settings\localization\languages\translation.it-it.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8
144 |
145 |
146 | ..\settings\localization\languages\translation.zh-tw.json;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16
147 |
148 |
149 | ..\Resources\msniper.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
150 |
151 |
--------------------------------------------------------------------------------
/MSniper/WFConsole/FConsole.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Drawing;
5 | using System.Linq;
6 | using System.Threading;
7 | using System.Windows.Forms;
8 |
9 | namespace MSniper.WFConsole
10 | {
11 | public class FConsole : RichTextBox
12 | {
13 | public FConsole()
14 | {
15 | KeyDown += FConsole_KeyDown;
16 | TextChanged += FConsole_TextChanged;
17 | LinkClicked += FConsole_LinkClicked;
18 | MouseDown += FConsole_MouseDown;
19 | MouseMove += FConsole_MouseMove;
20 | MouseUp += FConsole_MouseUp;
21 | InitializeFConsole();
22 | }
23 |
24 | private void FConsole_MouseUp(object sender, MouseEventArgs e)
25 | {
26 | if (!InputEnable)
27 | { Select(Text.Length, 0); }
28 | }
29 |
30 | private void FConsole_MouseMove(object sender, MouseEventArgs e)
31 | {
32 | if (!InputEnable)
33 | Select(Text.Length, 0);
34 | }
35 |
36 | private void FConsole_MouseDown(object sender, MouseEventArgs e)
37 | {
38 | if (e.Button == MouseButtons.Right&& InputEnable)
39 | {
40 | MultiplePaste();
41 | }
42 | else
43 | {
44 | if (!InputEnable)
45 | Select(Text.Length, 0);
46 | }
47 | }
48 |
49 | public string[] Arguments { get; set; }
50 |
51 | public Color HyperlinkColor { get; set; }
52 |
53 | public ConsoleState State { get; set; }
54 |
55 | public string Title { get { if (Parent != null) return Parent.Text; else return ""; } set { if (Parent != null) Parent.Text = value; } }
56 |
57 | private char CurrentKey { get; set; }
58 |
59 | private string CurrentLine { get; set; }
60 |
61 | private int ReadPoint { get; set; }
62 |
63 | private List recentlist { get; set; }
64 |
65 | private int RecentCount { get; set; }
66 |
67 | private bool InputEnable { get; set; }
68 |
69 | private bool Pause { get; set; }
70 |
71 | public void InitializeFConsole()
72 | {
73 | Name = "Console";
74 | Text = Name;
75 | Title = Name;
76 | Arguments = new string[0];
77 | BackColor = Color.Black;
78 | ForeColor = Color.FromArgb(0xdf, 0xd8, 0xc2);
79 | Dock = DockStyle.Fill;
80 | BorderStyle = BorderStyle.None;
81 | ReadOnly = true;
82 | Font = new Font("consolas", 10);
83 | MinimumSize = new Size(470, 200);
84 | ScrollBars = RichTextBoxScrollBars.Vertical;
85 | Pause = false;
86 | InputEnable = false;
87 | if (Parent != null)
88 | {
89 | //Parent.MinimumSize = MinimumSize;
90 | ((Form) Parent).WindowState = FormWindowState.Normal;
91 | Parent.BackColor = BackColor;
92 | }
93 | DetectUrls = true;
94 | recentlist = new List();
95 | }
96 |
97 | public string RecentUndo()
98 | {
99 | if (recentlist.Count > 0)
100 | {
101 | RecentCount--;
102 | HistoryJumper();
103 | return recentlist[RecentCount];
104 | }
105 | else
106 | {
107 | return "";
108 | }
109 | }
110 |
111 | public void HistoryJumper()
112 | {
113 | if (RecentCount >= recentlist.Count)
114 | RecentCount = recentlist.Count - 1;
115 | else if (RecentCount < 0)
116 | RecentCount = 0;
117 | }
118 |
119 | public string RecentRedo()
120 | {
121 | if (recentlist.Count > 0)
122 | {
123 | RecentCount++;
124 | HistoryJumper();
125 | return recentlist[RecentCount];
126 | }
127 | else
128 | {
129 | return "";
130 | }
131 | }
132 |
133 | private void FConsole_KeyDown(object sender, KeyEventArgs e)
134 | {
135 | if (State == ConsoleState.Closing)
136 | {
137 | e.SuppressKeyPress = true;
138 | return;
139 | }
140 |
141 | if ((e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) && State == ConsoleState.ReadLine)
142 | {
143 | if (recentlist.Count != 0)
144 | {
145 | var recentText = string.Empty;
146 | if (e.KeyCode == Keys.Up)
147 | {
148 | recentText = RecentUndo();
149 | }
150 | else if (e.KeyCode == Keys.Down)
151 | {
152 | recentText = RecentRedo();
153 | }
154 | SelectLastLine();
155 | SelectedText = recentText;
156 | }
157 | e.SuppressKeyPress = true;
158 | return;
159 | }
160 | else
161 | {
162 | Select(TextLength, 0);
163 | if (e.KeyData == (Keys.Control | Keys.V))
164 | {
165 | MultiplePaste();
166 | e.SuppressKeyPress = true;
167 | }
168 | else if ((int)e.KeyCode == (int)Keys.Enter && InputEnable == true && State == ConsoleState.ReadLine)
169 | {
170 | Cursor = Cursors.WaitCursor;
171 | ReadOnly = true;
172 | CurrentLine = Lines[Lines.Count() - 1];
173 | recentlist.Add(CurrentLine);
174 | WriteLine("");
175 | InputEnable = false;
176 | e.SuppressKeyPress = true;
177 | }
178 | else if (InputEnable == true && State == ConsoleState.ReadKey)
179 | {
180 | ReadOnly = true;
181 | CurrentKey = (char)e.KeyCode;
182 | InputEnable = false;
183 | }
184 | else if ((int)e.KeyCode == (int)Keys.Escape && InputEnable == false)//esc exit
185 | {
186 | Pause = false;
187 | }
188 | else if ((int)e.KeyCode == (int)Keys.Space && InputEnable == false)//space pause
189 | {
190 | Pause = !Pause;
191 | }
192 | else if ((int)e.KeyCode == (int)Keys.Back && InputEnable == true && ReadPoint + 1 > TextLength)
193 | {
194 | e.SuppressKeyPress = true;
195 | }
196 | }
197 | }
198 |
199 | private void MultiplePaste()
200 | {
201 | ReadOnly = true;
202 | CurrentLine = Clipboard.GetText();
203 | InputEnable = false;
204 | }
205 |
206 | public char ReadKey()
207 | {
208 | CurrentKey = ' ';
209 | ReadPoint = Text.Length;
210 | InputEnable = true;
211 | ReadOnly = false;
212 | State = ConsoleState.ReadKey;
213 | while (InputEnable) Thread.Sleep(1);
214 |
215 | return CurrentKey;
216 | }
217 |
218 | public string ReadLine()
219 | {
220 | CurrentLine = "";
221 | ReadPoint = TextLength;
222 | InputEnable = true;
223 | ReadOnly = false;
224 | State = ConsoleState.ReadLine;
225 | while (InputEnable) Thread.Sleep(1);
226 | Cursor = Cursors.IBeam;
227 | return CurrentLine;
228 | }
229 |
230 | public void SelectLastLine()
231 | {
232 | if (Lines.Any())
233 | {
234 | var line = Lines.Count() - 1;
235 | var s1 = GetFirstCharIndexOfCurrentLine();
236 | var s2 = line < Lines.Count() - 1 ?
237 | GetFirstCharIndexFromLine(line + 1) - 1 :
238 | Text.Length;
239 | Select(s1, s2 - s1);
240 | }
241 | }
242 |
243 | public void UpdateLine(int line, string message, Color? color = null)
244 | {
245 | ReadOnly = true;
246 | if (!color.HasValue)
247 | color = ForeColor;
248 | SelectLastLine();
249 | SetText(message, color);
250 | }
251 |
252 | public void Write(string message, Color? color = null)
253 | {
254 | while (Pause) Thread.Sleep(1);
255 | Select(TextLength, 0);
256 | SetText(message, color);
257 | DeselectAll();
258 | }
259 |
260 | public void SetText(string message, Color? color = null)
261 | {
262 | if (!color.HasValue)
263 | color = ForeColor;
264 | SelectionColor = color.Value;
265 | SelectedText = message;
266 | }
267 |
268 | public void WriteLine(string message, Color? color = null)
269 | {
270 | Write(message + Environment.NewLine, color);
271 | }
272 |
273 | private void FConsole_LinkClicked(object sender, LinkClickedEventArgs e)
274 | {
275 | Process.Start(e.LinkText);
276 | }
277 |
278 | private void FConsole_TextChanged(object sender, EventArgs e)
279 | {
280 | //string re1 = "((?:http|https)(?::\\/{2}[\\w]+)(?:[\\/|\\.]?)(?:[^\\s\"]*))";
281 | //Regex hyperlink = new Regex(re1, RegexOptions.IgnoreCase | RegexOptions.Singleline);
282 | //bool update = false;
283 | //foreach (Match m in hyperlink.Matches(Text))
284 | //{
285 | // Hyperlink hpl = new Hyperlink(m.Index, m.Index + m.Length, m.Value);
286 | // if (Hyperlinks.Where(p => p.ToString() == hpl.ToString()).Count() == 0)
287 | // {
288 | // Select(m.Index, m.Length);
289 | // SelectionColor = HyperlinkColor;
290 | // Font f = SelectionFont;
291 | // Font f2 = new Font(f.FontFamily, f.Size - 1.5f, FontStyle.Underline | FontStyle.Bold | FontStyle.Italic);
292 | // SelectionFont = f2;
293 | // Hyperlinks.Add(hpl);
294 | // update = true;
295 | // }
296 | //}
297 | //if (update)
298 | // SelectLastLine();
299 | }
300 | }
301 | }
--------------------------------------------------------------------------------
/MSniper/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace MSniper.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MSniper.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
65 | ///
66 | internal static System.Drawing.Icon msniper {
67 | get {
68 | object obj = ResourceManager.GetObject("msniper", resourceCulture);
69 | return ((System.Drawing.Icon)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Byte[].
75 | ///
76 | internal static byte[] Newtonsoft_Json {
77 | get {
78 | object obj = ResourceManager.GetObject("Newtonsoft_Json", resourceCulture);
79 | return ((byte[])(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Looks up a localized string similar to start MSniper -register.
85 | ///
86 | internal static string registerProtocol {
87 | get {
88 | return ResourceManager.GetString("registerProtocol", resourceCulture);
89 | }
90 | }
91 |
92 | ///
93 | /// Looks up a localized string similar to start MSniper -remove.
94 | ///
95 | internal static string removeProtocol {
96 | get {
97 | return ResourceManager.GetString("removeProtocol", resourceCulture);
98 | }
99 | }
100 |
101 | ///
102 | /// Looks up a localized string similar to start MSniper -resetallsnipelist.
103 | ///
104 | internal static string resetSnipeList {
105 | get {
106 | return ResourceManager.GetString("resetSnipeList", resourceCulture);
107 | }
108 | }
109 |
110 | ///
111 | /// Looks up a localized string similar to {
112 | /// "TranslationStrings": [
113 | /// {
114 | /// "Key": "title",
115 | /// "Value": "[{0} v{1}] - by {2}"
116 | /// },
117 | /// {
118 | /// "Key": "description",
119 | /// "Value": "{0} - v{1} Manual Pokemon Sniper - by {2}"
120 | /// },
121 | /// {
122 | /// "Key": "gitHubProject",
123 | /// "Value": "Github Project {0}"
124 | /// },
125 | /// {
126 | /// "Key": "currentVersion",
127 | /// "Value": "Current Version: {0}"
128 | /// },
129 | /// {
130 | /// "Key": "protocolNotFound",
131 | /// "Value": "Protocol not found - Please run once {0}"
132 | /// },
133 | /// {
134 | /// "Key": "sh [rest of string was truncated]";.
135 | ///
136 | internal static string translation_en_US {
137 | get {
138 | return ResourceManager.GetString("translation_en_US", resourceCulture);
139 | }
140 | }
141 |
142 | ///
143 | /// Looks up a localized string similar to {
144 | /// "TranslationStrings": [
145 | /// {
146 | /// "Key": "title",
147 | /// "Value": "[{0} v{1}] - Por {2}"
148 | /// },
149 | /// {
150 | /// "Key": "description",
151 | /// "Value": "{0} - v{1} Sniper Manual Pokemon - Por {2}"
152 | /// },
153 | /// {
154 | /// "Key": "gitHubProject",
155 | /// "Value": "GitHub Project {0}"
156 | /// },
157 | /// {
158 | /// "Key": "currentVersion",
159 | /// "Value": "Version Actual: {0}"
160 | /// },
161 | /// {
162 | /// "Key": "protocolNotFound",
163 | /// "Value": "Protocolo no encontrado - Porfavor, inicie el protocolo una vez {0}"
164 | /// [rest of string was truncated]";.
165 | ///
166 | internal static string translation_es_ES {
167 | get {
168 | return ResourceManager.GetString("translation_es_ES", resourceCulture);
169 | }
170 | }
171 |
172 | ///
173 | /// Looks up a localized string similar to {
174 | /// "TranslationStrings": [
175 | /// {
176 | /// "Key": "title",
177 | /// "Value": "[{0} v{1}] - by {2}"
178 | /// },
179 | /// {
180 | /// "Key": "description",
181 | /// "Value": "{0} - v{1} Pokemon Sniper Manuale - by {2}"
182 | /// },
183 | /// {
184 | /// "Key": "gitHubProject",
185 | /// "Value": "Progetto GitHub {0}"
186 | /// },
187 | /// {
188 | /// "Key": "currentVersion",
189 | /// "Value": "Versione corrente: {0}"
190 | /// },
191 | /// {
192 | /// "Key": "protocolNotFound",
193 | /// "Value": "Protocollo non trovato - Perfavore esegui per una volta {0}"
194 | /// },
195 | /// [rest of string was truncated]";.
196 | ///
197 | internal static string translation_it_IT {
198 | get {
199 | return ResourceManager.GetString("translation_it_IT", resourceCulture);
200 | }
201 | }
202 |
203 | ///
204 | /// Looks up a localized string similar to {
205 | /// "TranslationStrings": [
206 | /// {
207 | /// "Key": "title",
208 | /// "Value": "[{0} v{1}] - by {2}"
209 | /// },
210 | /// {
211 | /// "Key": "description",
212 | /// "Value": "{0} - v{1} Manuel Pokemon Avcı - by {2}"
213 | /// },
214 | /// {
215 | /// "Key": "gitHubProject",
216 | /// "Value": "GitHub Projesi {0}"
217 | /// },
218 | /// {
219 | /// "Key": "currentVersion",
220 | /// "Value": "Şuanki Versiyon: {0}"
221 | /// },
222 | /// {
223 | /// "Key": "protocolNotFound",
224 | /// "Value": "Protokol bulunamadı - Lütfen bir kere {0} 'yi çalıştırın"
225 | /// },
226 | /// {
227 | /// [rest of string was truncated]";.
228 | ///
229 | internal static string translation_tr_TR {
230 | get {
231 | return ResourceManager.GetString("translation_tr_TR", resourceCulture);
232 | }
233 | }
234 |
235 | ///
236 | /// Looks up a localized string similar to {
237 | /// "TranslationStrings": [
238 | /// {
239 | /// "Key": "title",
240 | /// "Value": "[{0} v{1}] - by {2}"
241 | /// },
242 | /// {
243 | /// "Key": "description",
244 | /// "Value": "{0} - v{1} 手動狙擊器 - by {2}"
245 | /// },
246 | /// {
247 | /// "Key": "gitHubProject",
248 | /// "Value": "GitHub 專案連結 {0}"
249 | /// },
250 | /// {
251 | /// "Key": "currentVersion",
252 | /// "Value": "目前版本: {0}"
253 | /// },
254 | /// {
255 | /// "Key": "protocolNotFound",
256 | /// "Value": "Protocol 未被找到 - 請先執行一次 {0}"
257 | /// },
258 | /// {
259 | /// "Key": "shutdownMsg",
260 | /// "Value": "程序將關閉於 {0} 秒"
261 | /// [rest of string was truncated]";.
262 | ///
263 | internal static string translation_zh_TW {
264 | get {
265 | return ResourceManager.GetString("translation_zh_TW", resourceCulture);
266 | }
267 | }
268 | }
269 | }
270 |
--------------------------------------------------------------------------------
/MSniper/WFConsole/FWindow.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace MSniper.WFConsole
2 | {
3 | partial class FWindow
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FWindow));
32 | this.activeBotsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
33 | this.linksToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
34 | this.configurationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
35 | this.usageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
36 | this.askedQuestionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
37 | this.advantageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
38 | this.fileInformationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
39 | this.featuresToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
40 | this.projectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
41 | this.mSniperLatestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
42 | this.necroBotLatestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
43 | this.msniperServiceToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
44 | this.getFeedsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
45 | this.donateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
46 | this.menuStrip1 = new System.Windows.Forms.MenuStrip();
47 | this.Console = new MSniper.WFConsole.FConsole();
48 | this.menuStrip1.SuspendLayout();
49 | this.SuspendLayout();
50 | //
51 | // activeBotsToolStripMenuItem
52 | //
53 | this.activeBotsToolStripMenuItem.Name = "activeBotsToolStripMenuItem";
54 | this.activeBotsToolStripMenuItem.Size = new System.Drawing.Size(110, 20);
55 | this.activeBotsToolStripMenuItem.Text = "Active NecroBots";
56 | //
57 | // linksToolStripMenuItem
58 | //
59 | this.linksToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
60 | this.configurationToolStripMenuItem,
61 | this.usageToolStripMenuItem,
62 | this.askedQuestionsToolStripMenuItem,
63 | this.advantageToolStripMenuItem,
64 | this.fileInformationToolStripMenuItem,
65 | this.featuresToolStripMenuItem});
66 | this.linksToolStripMenuItem.Name = "linksToolStripMenuItem";
67 | this.linksToolStripMenuItem.Size = new System.Drawing.Size(60, 20);
68 | this.linksToolStripMenuItem.Text = "How To";
69 | //
70 | // configurationToolStripMenuItem
71 | //
72 | this.configurationToolStripMenuItem.Name = "configurationToolStripMenuItem";
73 | this.configurationToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
74 | this.configurationToolStripMenuItem.Text = "Configuration";
75 | //
76 | // usageToolStripMenuItem
77 | //
78 | this.usageToolStripMenuItem.Name = "usageToolStripMenuItem";
79 | this.usageToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
80 | this.usageToolStripMenuItem.Text = "Usage";
81 | //
82 | // askedQuestionsToolStripMenuItem
83 | //
84 | this.askedQuestionsToolStripMenuItem.Name = "askedQuestionsToolStripMenuItem";
85 | this.askedQuestionsToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
86 | this.askedQuestionsToolStripMenuItem.Text = "Asked Questions";
87 | //
88 | // advantageToolStripMenuItem
89 | //
90 | this.advantageToolStripMenuItem.Name = "advantageToolStripMenuItem";
91 | this.advantageToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
92 | this.advantageToolStripMenuItem.Text = "Advantage";
93 | //
94 | // fileInformationToolStripMenuItem
95 | //
96 | this.fileInformationToolStripMenuItem.Name = "fileInformationToolStripMenuItem";
97 | this.fileInformationToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
98 | this.fileInformationToolStripMenuItem.Text = "File Information";
99 | //
100 | // featuresToolStripMenuItem
101 | //
102 | this.featuresToolStripMenuItem.Name = "featuresToolStripMenuItem";
103 | this.featuresToolStripMenuItem.Size = new System.Drawing.Size(162, 22);
104 | this.featuresToolStripMenuItem.Text = "Features";
105 | //
106 | // projectToolStripMenuItem
107 | //
108 | this.projectToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
109 | this.mSniperLatestToolStripMenuItem,
110 | this.necroBotLatestToolStripMenuItem,
111 | this.msniperServiceToolStripMenuItem});
112 | this.projectToolStripMenuItem.Name = "projectToolStripMenuItem";
113 | this.projectToolStripMenuItem.Size = new System.Drawing.Size(86, 20);
114 | this.projectToolStripMenuItem.Text = "Projects Link";
115 | //
116 | // mSniperLatestToolStripMenuItem
117 | //
118 | this.mSniperLatestToolStripMenuItem.Name = "mSniperLatestToolStripMenuItem";
119 | this.mSniperLatestToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
120 | this.mSniperLatestToolStripMenuItem.Text = "MSniper";
121 | //
122 | // necroBotLatestToolStripMenuItem
123 | //
124 | this.necroBotLatestToolStripMenuItem.Name = "necroBotLatestToolStripMenuItem";
125 | this.necroBotLatestToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
126 | this.necroBotLatestToolStripMenuItem.Text = "NecroBot";
127 | //
128 | // msniperServiceToolStripMenuItem
129 | //
130 | this.msniperServiceToolStripMenuItem.Name = "msniperServiceToolStripMenuItem";
131 | this.msniperServiceToolStripMenuItem.Size = new System.Drawing.Size(155, 22);
132 | this.msniperServiceToolStripMenuItem.Text = "MSniperService";
133 | //
134 | // getFeedsToolStripMenuItem
135 | //
136 | this.getFeedsToolStripMenuItem.Name = "getFeedsToolStripMenuItem";
137 | this.getFeedsToolStripMenuItem.Size = new System.Drawing.Size(89, 20);
138 | this.getFeedsToolStripMenuItem.Text = "Get Live Feed";
139 | this.getFeedsToolStripMenuItem.Visible = false;
140 | //
141 | // donateToolStripMenuItem
142 | //
143 | this.donateToolStripMenuItem.Name = "donateToolStripMenuItem";
144 | this.donateToolStripMenuItem.Size = new System.Drawing.Size(57, 20);
145 | this.donateToolStripMenuItem.Text = "Donate";
146 | //
147 | // menuStrip1
148 | //
149 | this.menuStrip1.BackColor = System.Drawing.SystemColors.AppWorkspace;
150 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
151 | this.activeBotsToolStripMenuItem,
152 | this.linksToolStripMenuItem,
153 | this.projectToolStripMenuItem,
154 | this.donateToolStripMenuItem,
155 | this.getFeedsToolStripMenuItem});
156 | this.menuStrip1.Location = new System.Drawing.Point(0, 0);
157 | this.menuStrip1.Name = "menuStrip1";
158 | this.menuStrip1.Size = new System.Drawing.Size(578, 24);
159 | this.menuStrip1.TabIndex = 1;
160 | this.menuStrip1.Text = "menuStrip1";
161 | //
162 | // Console
163 | //
164 | this.Console.Arguments = new string[0];
165 | this.Console.BackColor = System.Drawing.Color.Black;
166 | this.Console.BorderStyle = System.Windows.Forms.BorderStyle.None;
167 | this.Console.Dock = System.Windows.Forms.DockStyle.Fill;
168 | this.Console.Font = new System.Drawing.Font("Consolas", 10F);
169 | this.Console.ForeColor = System.Drawing.Color.Gray;
170 | this.Console.HyperlinkColor = System.Drawing.Color.Empty;
171 | this.Console.Location = new System.Drawing.Point(0, 24);
172 | this.Console.MinimumSize = new System.Drawing.Size(100, 200);
173 | this.Console.Name = "Console";
174 | this.Console.ReadOnly = true;
175 | this.Console.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
176 | this.Console.Size = new System.Drawing.Size(578, 287);
177 | this.Console.State = MSniper.WFConsole.ConsoleState.ReadLine;
178 | this.Console.TabIndex = 0;
179 | this.Console.Text = "";
180 | this.Console.Title = "MSniper";
181 | //
182 | // FWindow
183 | //
184 | this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
185 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
186 | this.BackColor = System.Drawing.SystemColors.Control;
187 | this.ClientSize = new System.Drawing.Size(578, 311);
188 | this.Controls.Add(this.Console);
189 | this.Controls.Add(this.menuStrip1);
190 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
191 | this.MainMenuStrip = this.menuStrip1;
192 | this.Name = "FWindow";
193 | this.Text = "MSniper";
194 | this.Load += new System.EventHandler(this.FWindow_Load);
195 | this.menuStrip1.ResumeLayout(false);
196 | this.menuStrip1.PerformLayout();
197 | this.ResumeLayout(false);
198 | this.PerformLayout();
199 |
200 | }
201 |
202 |
203 | #endregion
204 |
205 | public FConsole Console;
206 | private System.Windows.Forms.ToolStripMenuItem activeBotsToolStripMenuItem;
207 | private System.Windows.Forms.ToolStripMenuItem linksToolStripMenuItem;
208 | private System.Windows.Forms.ToolStripMenuItem configurationToolStripMenuItem;
209 | private System.Windows.Forms.ToolStripMenuItem usageToolStripMenuItem;
210 | private System.Windows.Forms.ToolStripMenuItem askedQuestionsToolStripMenuItem;
211 | private System.Windows.Forms.ToolStripMenuItem advantageToolStripMenuItem;
212 | private System.Windows.Forms.ToolStripMenuItem fileInformationToolStripMenuItem;
213 | private System.Windows.Forms.ToolStripMenuItem featuresToolStripMenuItem;
214 | private System.Windows.Forms.ToolStripMenuItem projectToolStripMenuItem;
215 | private System.Windows.Forms.ToolStripMenuItem mSniperLatestToolStripMenuItem;
216 | private System.Windows.Forms.ToolStripMenuItem necroBotLatestToolStripMenuItem;
217 | private System.Windows.Forms.ToolStripMenuItem getFeedsToolStripMenuItem;
218 | private System.Windows.Forms.ToolStripMenuItem donateToolStripMenuItem;
219 | private System.Windows.Forms.MenuStrip menuStrip1;
220 | private System.Windows.Forms.ToolStripMenuItem msniperServiceToolStripMenuItem;
221 | }
222 | }
--------------------------------------------------------------------------------
/MSniper/Settings/Localization/Translations.cs:
--------------------------------------------------------------------------------
1 | using MSniper.Properties;
2 | using Newtonsoft.Json;
3 | using Newtonsoft.Json.Converters;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Globalization;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Threading;
10 |
11 | namespace MSniper.Settings.Localization
12 | {
13 | //code revised and getting from https://github.com/Necrobot-Private/NecroBot/blob/master/PoGo.NecroBot.Logic/Common/Translations.cs
14 |
15 | public enum TranslationString
16 | {
17 | Title,
18 | Description,
19 | GitHubProject,
20 | CurrentVersion,
21 | ProtocolNotFound,
22 | ShutdownMsg,
23 | LatestVersion,
24 | NewVersion,
25 | DownloadLink,
26 | AutoDownloadMsg,
27 | Warning,
28 | WarningShutdownProcess,
29 | IntegrateMsg,
30 | AnyNecroBotNotFound,
31 | RunBeforeMSniper,
32 | ProtocolRegistered,
33 | ProtocolDeleted,
34 | RemoveAllSnipe,
35 | RemoveAllSnipeFinished,
36 | UnknownLinkFormat,
37 | CustomPasteDesc,
38 | CustomPasteFormat,
39 | WaitingDataMsg,
40 | CustomPasteWrongFormat,
41 | IncompatibleVersionMsg,
42 | SendingPokemonToNecroBot,
43 | AlreadySnipped,
44 | DownloadingNewVersion,
45 | DownloadFinished,
46 | DecompressingNewFile,
47 | OldFilesChangingWithNews,
48 | SubsequentProcessing,
49 | WrongPokemonName,
50 | ActiveBots,
51 | HowTo,
52 | Configuration,
53 | Usage,
54 | AskedQuestions,
55 | Advantage,
56 | FileInformation,
57 | Features,
58 | ProjectsLink,
59 | GetLiveFeed,
60 | Donate,
61 | CanNotAccessProcess,
62 | SnipeWebsite
63 | }
64 |
65 | public interface ITranslation
66 | {
67 | string GetTranslation(TranslationString translationString, params object[] data);
68 |
69 | string GetTranslation(TranslationString translationString);
70 | }
71 |
72 | ///
73 | /// default language: english
74 | ///
75 | public class Translation : ITranslation
76 | {
77 | [JsonProperty("TranslationStrings",
78 | ItemTypeNameHandling = TypeNameHandling.Arrays,
79 | ItemConverterType = typeof(KeyValuePairConverter),
80 | ObjectCreationHandling = ObjectCreationHandling.Replace,
81 | DefaultValueHandling = DefaultValueHandling.Populate)]
82 | private readonly List> _translationStrings = new List
83 | >
84 | {
85 | new KeyValuePair(TranslationString.Title, "[{0} v{1}] - by {2}"),
86 | new KeyValuePair(TranslationString.Description, "{0} - v{1} Manual Pokemon Sniper - by {2}"),
87 | new KeyValuePair(TranslationString.GitHubProject, "Github Project {0}"),
88 | new KeyValuePair(TranslationString.SnipeWebsite, "Snipe Website {0}"),
89 | new KeyValuePair(TranslationString.CurrentVersion, "Current Version: {0}"),
90 | new KeyValuePair(TranslationString.ProtocolNotFound, "Protocol not found - Please run once {0}"),
91 | new KeyValuePair(TranslationString.ShutdownMsg, "Program is closing in {0} seconds"),
92 | new KeyValuePair(TranslationString.LatestVersion, "Latest Version"),
93 | new KeyValuePair(TranslationString.NewVersion, "NEW VERSION"),
94 | new KeyValuePair(TranslationString.DownloadLink, "DOWNLOAD LINK"),
95 | new KeyValuePair(TranslationString.AutoDownloadMsg, "PRESS 'D' TO AUTOMATIC DOWNLOAD NEW VERSION OR PRESS ANY KEY FOR EXIT.."),
96 | new KeyValuePair(TranslationString.Warning, "WARNING"),
97 | new KeyValuePair(TranslationString.WarningShutdownProcess, "All MSniper.exe will shutdown while downloading"),
98 | new KeyValuePair(TranslationString.IntegrateMsg, "{0} integrated NecroBot v{1} or upper"),
99 | new KeyValuePair(TranslationString.AnyNecroBotNotFound, "Any running NecroBot not found..."),
100 | new KeyValuePair(TranslationString.RunBeforeMSniper, "Necrobot must be running before MSniper"),
101 | new KeyValuePair(TranslationString.ProtocolRegistered, "Protocol Successfully REGISTERED:"),
102 | new KeyValuePair(TranslationString.ProtocolDeleted, "Protocol Successfully DELETED:"),
103 | new KeyValuePair(TranslationString.RemoveAllSnipe, "deleted for {0}"),
104 | new KeyValuePair(TranslationString.RemoveAllSnipeFinished, "deleting finished process count:{0}.."),
105 | new KeyValuePair(TranslationString.UnknownLinkFormat, "unknown link format"),
106 | new KeyValuePair(TranslationString.CustomPasteDesc, "\t\tCUSTOM PASTE ACTIVE"),
107 | new KeyValuePair(TranslationString.CustomPasteFormat, "format: PokemonName Latitude,Longitude"),
108 | new KeyValuePair(TranslationString.WaitingDataMsg, "waiting data.."),
109 | new KeyValuePair(TranslationString.CustomPasteWrongFormat, "wrong format retry or write 'E' for quit.."),
110 | new KeyValuePair(TranslationString.IncompatibleVersionMsg, "Incompatible NecroBot version for {0}"),
111 | new KeyValuePair(TranslationString.SendingPokemonToNecroBot, "Sending to {3}: {0} {1},{2}"),
112 | new KeyValuePair(TranslationString.AlreadySnipped, "{0}\t\tAlready Snipped..."),
113 | new KeyValuePair(TranslationString.DownloadingNewVersion, "starting to download {0} please wait..."),
114 | new KeyValuePair(TranslationString.DownloadFinished, "download finished..."),
115 | new KeyValuePair(TranslationString.DecompressingNewFile,"decompressing now..."),
116 | new KeyValuePair(TranslationString.OldFilesChangingWithNews,"files changing now..."),
117 | new KeyValuePair(TranslationString.SubsequentProcessing, "Subsequent processing passing in {0} seconds or Close the Program"),
118 | new KeyValuePair(TranslationString.WrongPokemonName,"Pokemon '{0}' not defined"),
119 | new KeyValuePair(TranslationString.ActiveBots,"Active NecroBots"),
120 | new KeyValuePair(TranslationString.HowTo,"How To"),
121 | new KeyValuePair(TranslationString.Configuration,"Configuration"),
122 | new KeyValuePair(TranslationString.Usage,"Usage"),
123 | new KeyValuePair(TranslationString.AskedQuestions,"Asked Questions"),
124 | new KeyValuePair(TranslationString.Advantage,"Advantage"),
125 | new KeyValuePair(TranslationString.FileInformation,"File Information"),
126 | new KeyValuePair(TranslationString.Features,"Features"),
127 | new KeyValuePair(TranslationString.ProjectsLink,"Projects Link"),
128 | new KeyValuePair(TranslationString.GetLiveFeed,"Get Live Feed"),
129 | new KeyValuePair(TranslationString.Donate,"Donate"),
130 | new KeyValuePair(TranslationString.CanNotAccessProcess,"can not access to {0}.exe({1}), killing")
131 | };
132 |
133 | public static void CultureNotFound(IConfigs logicSettings, ref string translationsLanguageCode)
134 | {
135 | Program.frm.Console.WriteLine(
136 | $"[ {logicSettings.TranslationLanguageCode} ] language not found in program",
137 | logicSettings.Error);
138 | if (!logicSettings.AutoCultureDetect)
139 | {
140 | Program.frm.Console.WriteLine(
141 | $"you can set TRUE 'AutoDetectCulture' in settings.json",
142 | logicSettings.Notification);
143 | }
144 | Thread.Sleep(1000);
145 | Program.frm.Console.WriteLine(
146 | $"now using default language [ {new Configs().TranslationLanguageCode} ]..",
147 | logicSettings.Success);
148 | translationsLanguageCode = new Configs().TranslationLanguageCode;
149 | Program.frm.Delay(3);
150 | }
151 |
152 | public static string GetTranslationFromServer(string languageCode)
153 | {
154 | try
155 | {
156 | return Downloader.DownloadString(string.Format(Variables.TranslationUri, languageCode));
157 | }
158 | catch
159 | {
160 | return null;
161 | }
162 | }
163 |
164 | public static Translation Load(IConfigs logicSettings)
165 | {
166 | return Load(logicSettings, new Translation());
167 | }
168 |
169 | public static Translation Load(IConfigs logicSettings, Translation translations)
170 | {
171 | try
172 | {
173 | //var culture = CultureInfo.CreateSpecificCulture("tr-TR");
174 | //CultureInfo.DefaultThreadCurrentCulture = culture;
175 | //Thread.CurrentThread.CurrentCulture = culture;
176 |
177 | string translationsLanguageCode = string.Empty;
178 | try
179 | {
180 | translationsLanguageCode = new CultureInfo(logicSettings.TranslationLanguageCode).ToString();
181 | }
182 | catch (CultureNotFoundException ex)
183 | {
184 | CultureNotFound(logicSettings, ref translationsLanguageCode);
185 | }
186 | if (logicSettings.AutoCultureDetect)
187 | {
188 | var strCulture = Variables.SupportedLanguages
189 | .Find(p => p.Name == Thread.CurrentThread.CurrentCulture.Name ||
190 | p.TwoLetterISOLanguageName ==
191 | Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName);
192 | if (strCulture != null)
193 | {
194 | translationsLanguageCode = strCulture.Name;
195 | Program.frm.Console.WriteLine($"automatic supported culture detected: {strCulture.Name}",
196 | logicSettings.Success);
197 | }
198 | }
199 | var input = string.Empty;
200 |
201 | if (
202 | Variables.SupportedLanguages.FindIndex(
203 | p =>
204 | string.Equals(p.ToString(), translationsLanguageCode,
205 | StringComparison.CurrentCultureIgnoreCase)) == -1)
206 | {
207 | input = GetTranslationFromServer(logicSettings.TranslationLanguageCode); //developer mode
208 | if (input == null)
209 | {
210 | CultureNotFound(logicSettings, ref translationsLanguageCode);
211 | }
212 | }
213 | if (string.IsNullOrEmpty(input))
214 | input =
215 | Resources.ResourceManager.GetString($"translation_{translationsLanguageCode.Replace("-", "_")}");
216 |
217 | var jsonSettings = new JsonSerializerSettings();
218 | jsonSettings.Converters.Add(new StringEnumConverter { CamelCaseText = true });
219 | jsonSettings.ObjectCreationHandling = ObjectCreationHandling.Replace;
220 | jsonSettings.DefaultValueHandling = DefaultValueHandling.Populate;
221 |
222 | translations = JsonConvert.DeserializeObject(input, jsonSettings);
223 |
224 | //TODO make json to fill default values as it won't do it now
225 | new Translation()._translationStrings.Where(
226 | item => translations._translationStrings.All(a => a.Key != item.Key))
227 | .ToList()
228 | .ForEach(translations._translationStrings.Add);
229 | }
230 | catch (Exception ex)
231 | {
232 | Program.frm.Console.WriteLine("");
233 | Program.frm.Console.WriteLine($"[ERROR] Issue loading translations: {ex.ToString()}",
234 | logicSettings.Error);
235 | Program.frm.Delay(7);
236 | }
237 |
238 | return translations;
239 | }
240 |
241 | public string GetTranslation(TranslationString translationString, params object[] data)
242 | {
243 | var translation = _translationStrings.FirstOrDefault(t => t.Key.Equals(translationString)).Value;
244 | return translation != default(string)
245 | ? string.Format(translation, data)
246 | : $"Translation for {translationString} is missing";
247 | }
248 |
249 | public string GetTranslation(TranslationString translationString)
250 | {
251 | var translation = _translationStrings.FirstOrDefault(t => t.Key.Equals(translationString)).Value;
252 | return translation != default(string)
253 | ? translation
254 | : $"Translation for {translationString} is missing";
255 | }
256 |
257 | public void Save(string languageCode)
258 | {
259 | string fullPath = $"{Variables.TranslationsPath}\\translation.{languageCode}.json";
260 | var output = JsonConvert.SerializeObject(this, Formatting.Indented,
261 | new StringEnumConverter { CamelCaseText = true });
262 |
263 | var folder = Path.GetDirectoryName(fullPath);
264 | if (folder != null && !Directory.Exists(folder))
265 | {
266 | Directory.CreateDirectory(folder);
267 | }
268 |
269 | File.WriteAllText(fullPath, output);
270 | }
271 | }
272 | }
--------------------------------------------------------------------------------
/MSniper/WFConsole/FWindow.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 | 17, 17
122 |
123 |
124 |
125 |
126 | AAABAAMAEBAAAAAAIABoBAAANgAAACAgAAAAACAAqBAAAJ4EAAAwMAAAAAAgAKglAABGFQAAKAAAABAA
127 | AAAgAAAAAQAgAAAAAABABAAAAAAAAAAAAAAAAAAAAAAAAP///wH///8B////Af///wHi4eAz4uHgaeLh
128 | 4H3MyuGV1NPhi+Lh4Hfh4eBf4d/fG////wH///8B////Af///wH///8B////Af///wH///8B////ARcR
129 | 7AMhGexLIxvs3yMa7MsfGOwx////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
130 | /wEhGetjIxvs9yQc7f8kHO3/Ixvs6SEY7D////8B////Af///wH///8B29vUA////wH///8B////Af//
131 | /wEhGOtJIxvs9SQc7f8jG+zxIxvs9yQc7f8jG+zlIBjrJ////wH///8B////Af///wH///8B////Af//
132 | /wEfFuwVIxvs3SQc7f8jG+3/IRrsgSIa7KEkHO3/JBzt/yIb7LcbFusH////Af///wH///8B////Af//
133 | /wH///8BIhnsbyMb7P8kHO3/Ixvs6R8Y6hkhGOsvIxvs9SQc7f8jG+z9IRnrQf///wH///8B////Af//
134 | /wH///8B////ASEZ60kjG+3/Ixvs/yIa64kFA6sDExDYAyIa7KkjG+3/Ixvs+x8Y6jH///8B////Af//
135 | /wH///8B////AQkFpAUfFuwNIxvs3yMb7OsgF+shEgyqURILqjkhGew3Ixvs9SMb7M0dFu4H////Af//
136 | /wH///8B////Af///wERC6lZEAqsDSIa7JMiGuyRDgetBxMMqssTDKqtGQ3RBSIa7K8iGux9DwmpDQ4J
137 | qCH///8B////Af///wH///8BEwyqoxILqkkgGOsxHxjrIRILqlETDKv/Ewyq+RILqjMgGOw1HxfsJxML
138 | qk8SC6pZ////Af///wH///8B////ARMNqrUTDKqh////AQ4IqwkTDKrDFA2r/xQNq/8TDKqlDAm4Bf//
139 | /wETDKqrEwyrbf///wH///8B////Af///wEUDavBEwyq6xELqBESC6pJEwyq+xQNq/8UDav/Ewyr9REL
140 | qi8QCqgXEwyq8RMMqoH///8B////Af///wH///8BEw2qvRMMqv0SC6pbEwyqvRQNq/8UDav/FA2r/xQN
141 | q/8TDKqhEgyqZxMNqv0TDKqB////Af///wH///8B////ARIMqiERC6pJEQuqVxMMqr0TDKr7FA2r/xQN
142 | q/8TDKr1EwyqqREKqUURDKk7DwqnD////wH///8B////Af///wH///8B////Af///wELBqMDEQuoKxMM
143 | qrETDKqTEAqoHw0GoAP///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
144 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wEAAP//AAD//wAA//8AAP//AAD//wAA
145 | //8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//AAD//wAA//8AAP//KAAAACAAAABAAAAAAQAgAAAA
146 | AACAEAAAAAAAAAAAAAAAAAAAAAAAAP///wH///8B////Af///wH///8B////Af///wHZ2dkD4ODfMeLh
147 | 4IPh4d+v4uHgyePh4Nni4eHj4uHg6+Pi4e3i4eDr4uHg5+Lh4N3i4eDP4uHhueHh35fi4N9b1tXVB///
148 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
149 | /wHj4+AH4+LgD+Hg3hXh4OAX4+HgGeLh4RuioOQnX1nnU3Bq5kHNzOEd4uHgGeHg4Bnh4OAV4eHfEeDg
150 | 3wv///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
151 | /wH///8B////Af///wH///8B////Af///wEaCvUDHRfrIyEZ7JcjG+znIhrs0SAX7GkbEe0P////Af//
152 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
153 | /wH///8B////Af///wH///8B////Af///wH///8BFxHsBR8X7T8iGuzHIxvs/SQc7f8kHO3/Ixvs9SAZ
154 | 7JUeF+4b////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
155 | /wH///8B////Af///wH///8B////Af///wH///8B////ARUL6gUfF+pPIhrs3SQc7f8kHO3/JBzt/yQc
156 | 7f8kHO3/Ixvs/SIZ7K0dFO0j////Af///wH///8B////Af///wH///8B////Af///wH///8B////Ad7e
157 | 3gP///8B////Af///wH///8B////Af///wH///8B////Af///wEPD+EDHxjqVSMb7eEjG+3/JBzt/yQc
158 | 7f8kHO3/JBzt/yQc7f8kHO3/Ixvs/SIa7LEfFuwl////Af///wH///8B////Af///wH///8B////Af//
159 | /wH///8B2NjOB////wH///8B////Af///wH///8B////Af///wH///8BCQX4AyAW6kEiG+vZIxvs/yQc
160 | 7f8kHO3/JBzt/yMb7P0jG+z9JBzt/yQc7f8kHO3/Ixvs+SIZ7KUaE+0X////Af///wH///8B////Af//
161 | /wH///8B////Af///wHc3MoD////Af///wH///8B////Af///wH///8B////Af///wEeFOofIhrswyMb
162 | 7P0kHO3/JBzt/yQc7f8jG+z9IhrsxyIa7N0jG+3/JBzt/yQc7f8kHO3/Ixvs9yIZ638TDuEH////Af//
163 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BFxHvCyEZ
164 | 7IckG+3/JBzt/yQc7f8kHO3/JBzt/yIb7OsgGOtZIRnsgyMb7PskHO3/JBzt/yQc7f8kHO3/Ixvs7R4X
165 | 6TsTEt0D////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
166 | /wEgF+tHIxvs7yQc7f8kHO3/JBzt/yQc7f8jG+3/IRrrqx0X6xMfGewvIhrs1SQc7f8kHO3/JBzt/yQc
167 | 7f8kHO3/IhrstxsW7BP///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
168 | /wH///8BHhTrESIa7K0jG+z/JBzt/yQc7f8kHO3/Ixvs/yMb7O8gGOpPGBbqAx8U6gkhGeuDIxvt+yQc
169 | 7f8kHO3/JBzt/yQc7f8jG+z3IBjqVxER2AP///8B////Af///wH///8B////Af///wH///8B////Af//
170 | /wH///8B////Af///wEfF+snIhrs1yQc7f8kHO3/JBzt/yQc7f8jG+z9IhrsuRwW7BP///8B////ASAX
171 | 6jEiGuzdIxvs/yQc7f8kHO3/JBzt/yQc7f8iGuyjFQzpB////wH///8B////Af///wH///8B////Af//
172 | /wH///8B////Af///wH///8B////ARsV7A8iGuyxIxvt/yQc7f8kHO3/Ixvt/yMb7PEhGOtdIBTqA///
173 | /wH///8BGhbqByEZ65MjG+z7JBzt/yQc7f8kHO3/Ixvs/yAZ64EYB+UF////Af///wH///8B////Af//
174 | /wH///8B////Af///wH///8B////Af///wH///8BGQzlAyAY62MjG+39JBzt/yQc7f8jG+z9Ihrrvx0V
175 | 6Rf///8BAACdBwAAnQP///8BHxfsNyMa7OEjG+3/JBzt/yQc7f8jG+zzHRboO////wH///8B////Af//
176 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BIBfsJyMb7N8kHO3/JBzt/yMa
177 | 7O8hGOxj////AQ0AoQMRDKpZEQqrO////wEUEe0FIRnslyMb7PkkHO3/JBzt/yIa7L0dFu4T////Af//
178 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wEAAJ8DCgakDf///wEcFe4NIhrsoSQc
179 | 7f8jG+z/IhrsvSAX6h////8BEQqpIxMMq8USDKqbEAanDf///wEhGOw/Ixrs3SMb7f8jG+3/Ihrrdx0V
180 | 6wX///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////AQgBqA0PCalnDQamCRUV
181 | 6QMgGetVIxvs/SMb7PMhGetrGAzmAwAApQMSDKlvEwyq9RMMquMRCqk9////AR8U6AshGeubIxvs+yMb
182 | 7PUfFuov////AQ4HpgkKBqUZ////Af///wH///8B////Af///wH///8B////Af///wH///8BDgqoIxMM
183 | qs0QCqol////ARwW6xsjGuzdIhrsxR8Y6SH///8BDgepGRMMqscUDav/Ew2q+xIMqpkOAqoH////ASAZ
184 | 60MiGuzlIhrswxsV6w3///8BDwmoJw8JqWv///8B////Af///wH///8B////Af///wH///8B////Af//
185 | /wETDKlBEwyq+RIMqmX///8BFRPsByAZ7JEgGexrFRXqAw4HqAMSCqphEwyr+xQNq/8UDav/Ewyq6RAK
186 | qTP///8BIBjvDSEZ65cgGOx1Dwr2A////wESC6ptEguqo////wH///8B////Af///wH///8B////Af//
187 | /wH///8B////ARMMqVcTDKr7EwyqsQsFpw3///8BHxXoKxsV6hX///8BDQioGxIMqsMTDKv/FA2r/xQN
188 | q/8TDKr9EwyqkQwGrAv///8BHRbrMRwU6yX///8BDwaoERMMqr0SC6rB////Af///wH///8B////Af//
189 | /wH///8B////Af///wH///8BEwypZxMMqv0TDKrlEQqpM////wEMANUD////AQkGqAURC6lbEwyq+RQN
190 | q/8UDav/FA2r/xQNq/8TDKrhDwqpM////wEPD+0DDQ3kA////wERC6k7Ewyq6xIMq9P///8B////Af//
191 | /wH///8B////Af///wH///8B////Af///wETDapxEw2q/RMMqvsSC6l1////Af///wH///8BDgirGRMM
192 | qrcUDav/FA2r/xQNq/8UDav/FA2r/xQNq/8SDKuFDQisC////wH///8B////ARMLqYcTDKv/Ewyr4///
193 | /wH///8B////Af///wH///8B////Af///wH///8B////ARQNq4MUDav/FA2r/xMMqr0NBqcJ////AQAA
194 | nwMRC6lXEwyq8xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xMMq9sOCqkx////Af///wELB6YREwyr0RQN
195 | q/8TDKrzAACoC////wH///8B////Af///wH///8B////Af///wH///8BFA2rgxQNq/8UDav/Ewyq7REM
196 | qDv///8BDQepFRMMqrUUDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/Ewyr/xILqoUJBacJ////AREL
197 | qE0TDKrzFA2r/xMMqvMIAqQV////Af///wH///8B////Af///wH///8B////Af///wEUDauDFA2r/xQN
198 | q/8TDar7Egyqg////wESC6lVEwyq7RQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/Ewyq2Q8K
199 | py////8BEgypnxQMqv8UDav/Ewyq9QsFphn///8B////Af///wH///8B////Af///wH///8B////ARMN
200 | qn0TDKrzEw2r/RQNq/8TDKrPDAalGRMMqq8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQN
201 | q/8TDar7EguqgwsEqhkTDKvhFA2r/xMNqvkTDKrhCgWlFf///wH///8B////Af///wH///8B////Af//
202 | /wH///8BEQ2qLRILqlMRC6p7EgyqoRMMqsMQCqp1Ewyq7RQMqv8UDav/FA2r/xQNq/8UDav/FA2r/xQN
203 | q/8UDav/FA2r/xMMqv8TDKrVEAqpWxIMqacRC6mFEgypYRAKqDkAAKQD////Af///wH///8B////Af//
204 | /wH///8B////Af///wH///8B////Af///wEAAKQFCAClCQoDph8QCqhfEwyqpxMMqu8UDav/FA2r/xQN
205 | q/8UDav/FA2r/xQNq/8TDKrZEwuqkRAJp0EFAJsLAACrBf///wH///8B////Af///wH///8B////Af//
206 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wEMB6IJDgmnJxIM
207 | qIETDKrhEw2r/xMMq/sTDKrHEQuoXQwIqBkPB6IF////Af///wH///8B////Af///wH///8B////Af//
208 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
209 | /wH///8BCQSkBxILqU0TDaubEgyqbQ8IqhsAAKoD////Af///wH///8B////Af///wH///8B////Af//
210 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
211 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
212 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
213 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
214 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wEAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
215 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
216 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAwAAAAYAAAAAEA
217 | IAAAAAAAgCUAAAAAAAAAAAAAAAAAAAAAAAD///8B////Af///wH///8B////Af///wH///8B////Af//
218 | /wH///8B////AdXV1QPe3t0l4uDgZ+Hh4JPi4N+x4uHgyePi4NXj4uDf4+Hg5+Lh4e/i4eDz4uHg9+Pi
219 | 4ffj4uH34uHg8+Lh4O/i4eDp4uHg4eLh4NXj4uLH4eHgteHg4Jfi4OBr4d7eLc7OzgX///8B////Af//
220 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
221 | /wH///8B////Af///wH///8B////AeLi4gPj4+AV4+PgO+Pi4FPh4N5p4eDgd+Hg4IHi4d+H4+HgjeLh
222 | 4ZHh4OCT4N/gld7d35fg3uCV4eDgk+Pi4I/i4eCL4uHgh+Hg34Hh4OB34uHfbeHh31Xh4d893t7eGd/f
223 | 3wP///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
224 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
225 | /wH///8B////Af///wENCusJHxftMyAX61sgFupFGBHoFQcH8AP///8B////Af///wH///8B////Af//
226 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
227 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
228 | /wH///8B////Af///wH///8B////ARYW6BEeF+tdIhrsuyMb7OUiGuvRIBjrhx4S7S0cAP8F////Af//
229 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
230 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
231 | /wH///8B////Af///wH///8B////Af///wEZAP8FHRTtJyEY64EiG+zhIxvs+yQc7f8jG+z9Ixvs8SEZ
232 | 7LkdFetFDQ3kC////wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
233 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
234 | /wH///8B////Af///wH///8B////Af///wH///8B////ARcR7AseFuxBIRrsryMb7PMjG+z/JBzt/yQc
235 | 7f8kHO3/JBzt/yMb7P0hGuzXIBntaR4W7hkQDPID////Af///wH///8B////Af///wH///8B////Af//
236 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
237 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BGRDpDR8W6k0iGeu9Ixvs+SQc
238 | 7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8jG+z9Ixrs3yAY7HscFO0hFQzyA////wH///8B////Af//
239 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Aejo6AP///8B////Af//
240 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wEWC+kJHhfrUyIa
241 | 7MMjG+37JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBvt/yMa7OEgGOt/HRPsH///
242 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////AdTU
243 | 1Af///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////AQ8P
244 | 4QcgFug9IRrrxyMb7fskHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yMb
245 | 7P8jGuzjIRjsexoT6xP///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
246 | /wH///8B////AdfXyQn///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
247 | /wH///8BFQDqBR8U6DUhGumzIxvs+yQc7f8kHO3/JBzt/yQc7f8kHO3/Ixvt/yMb7f8jG+3/JBzt/yQc
248 | 7f8kHO3/JBzt/yQc7f8kG+3/Ixrs5SEY7F8TCfUN////Af///wH///8B////Af///wH///8B////Af//
249 | /wH///8B////Af///wH///8B////AdnZxQP///8B////Af///wH///8B////Af///wH///8B////Af//
250 | /wH///8B////Af///wEIBfcDHBTsKSIZ66EjG+z1JBzt/yQc7f8kHO3/JBzt/yQc7f8jG+3/Ixvs+yIa
251 | 7PEjGuz3Ixvs/yQc7f8kHO3/JBzt/yQc7f8kHO3/Ixvs/yEZ69MeF+lNFBPsCf///wH///8B////Af//
252 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
253 | /wH///8B////Af///wH///8B////ARMJ9QMeFOobIRjrgyMb7OskHO3/JBzt/yQc7f8kHO3/JBzt/yQc
254 | 7f8jG+z/Ihrs5yIa66UiGuvBIxvs9yMb7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQb7PsjGuu7HhjqORAM
255 | 3gX///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
256 | /wH///8B////Af///wH///8B////Af///wH///8B////ARgQ8AsgGOxZIxrs1SQb7f8kHO3/JBzt/yQc
257 | 7f8kHO3/JBzt/yQc7f8jG+z7IRrrux4Y60sgGetxIhrt4SMb7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
258 | 7f8jG+zxIRnrjxwW5x8SEtsD////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
259 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BGRLsAx4W6i0iGeuvIxvs+yQc
260 | 7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8iGuztIRjsexwU6xUfGOw3IhrstSMb7PkkHO3/JBzt/yQc
261 | 7f8kHO3/JBzt/yQc7f8kG+3/Ihrs2yAY61sZE+sJ////Af///wH///8B////Af///wH///8B////Af//
262 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BHgv1CyEY
263 | 63MjG+zvJBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yMb7f0iGuvFHhjrPxUV6gMcGewPIRnrdSIa
264 | 7OkkHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/Ixvt+yEa7KscF+wj////Af///wH///8B////Af//
265 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
266 | /wH///8BHBTvJyIa688jG+z/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yMb7PUhGemHGBbqD///
267 | /wH///8BIBbqNyIa7L8jG+z9JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yMb6+0fF+ldEg3TBf//
268 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
269 | /wH///8B////Af///wEeBOAHIBjqcSMb7P0kHO3/JBzt/yQc7f8kHO3/JBzt/yQc7f8kHO3/Ixvs/SIa
270 | 7MkfF+w7////Af///wH///8BFQDqCSEY63cjG+ztIxvs/yQc7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
271 | 7f8iGuvDGxbpFf///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
272 | /wH///8B////Af///wH///8B////Af///wETE+sHIBjseyMb7P0kHO3/JBzt/yQc7f8kHO3/JBzt/yQc
273 | 7f8jG+3/Ixvs7yEa640XFOwP////Af///wH///8B////AR4X6DMiGuvDIxvs+yQc7f8kHO3/JBzt/yQc
274 | 7f8kHO3/JBzt/yQc7f8iGuzrGRDqIf///wH///8B////Af///wH///8B////Af///wH///8B////Af//
275 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wEAAP8DHhfsQSIa7O8kHO3/JBzt/yQc
276 | 7f8kHO3/JBzt/yQc7f8jG+z9IhrryyAX6kkgFOoD////Af///wH///8B////ARkW6gsgGOuDIhrs6yMb
277 | 7f8kHO3/JBzt/yQc7f8kHO3/JBzt/yMb7f8hGezDGw/pGf///wH///8B////Af///wH///8B////Af//
278 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BHxXmHSIZ
279 | 68EjG+3/JBzt/yQc7f8kHO3/JBzt/yMb7f8iGuzvIBnrkR8W7Bv///8B////Af///wH///8B////ARoU
280 | 6gMeF+s/IhrsxSMb7PskHO3/JBzt/yQc7f8kHO3/JBzt/yIb7PsfGet/Gg3fCf///wH///8B////Af//
281 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
282 | /wH///8BFw/tCyAZ7HkiG+37JBzt/yQc7f8kHO3/JBzt/yMb7f0iGuzPIBfqTx0S5wf///8BAACcAwAA
283 | nQsAAJ0F////Af///wEeFu0VIRjshyMa7OsjG+3/JBzt/yQc7f8kHO3/JBzt/yIa6+cdFedJEwzXA///
284 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
285 | /wH///8B////Af///wH///8BGRHuAx8X7EEiGuzdJBzt/yQc7f8kHO3/Ixvs/yIa7O8hGOyRHxbuHf//
286 | /wH///8BDwupFRAMqlEQCao3DQOqB////wEUEe0FHhfsQSIa7MMjG+z7Ixvt/yQc7f8kHO3/Ixvs/yIZ
287 | 7K8eFu4j////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
288 | /wH///8B////Af///wH///8B////Af///wH///8B////ASAW7SMiGuynIxvt/SQc7f8kHO3/Ixvs/SIa
289 | 7M8hGOtRGQ3lB////wEPBqYFEQqpQRINq7ESDKuLEAmqG////wH///8BIRbrFyIZ7IUjGu3rIxvs/yQc
290 | 7f8kHO3/Ixvs8yEZ7HUbE+8N////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
291 | /wH///8B////Af///wH///8B////Af///wH///8BCQalDwkGow////8B////ARkU7w0hGuxxIxvs7yQc
292 | 7f8kHO3/Ixvs8yIa7JcfFukf////Af///wEQB6kREgyqgRMMq+0TDKrJEQqpSREHqAX///8BIBDvBSEY
293 | 7EciGuzFIxvs+yQc7f8jG+3/Ixvs1yEZ6ksfFugF////Af///wH///8B////Af///wH///8B////Af//
294 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wEHAKcFDgioQQ4Ip0cKBKMJ////ARYW
295 | 6AUfGetFIhrszSMb7f8kHO3/Ihrs1SAY61UXC+YF////Af///wEQCqk5EwypvxQNq/8TDarzEgyqiQ8G
296 | pRX///8B////AR8V6RchGeqNIhrs7yQc7f8jG+39IRrsqx4W6iUREe0D////AQwGpAcJBKITAACdA///
297 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wEKBKgLEAqqbREK
298 | qpMRCaod////AQwM8gMcF+shIRnroSMb7PkjG+z7IhnroRsW6hv///8B////AQAApQsQCqp1Ew2q8xQN
299 | q/8UDav/EwyqyRALqT////8B////AR4P4AMfGOpJIhrszyMb7f8jG+zvIhnsex4U6g3///8B////ARAI
300 | qR0OCKhPBQWlD////wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
301 | /wEPDKgVEgyqlxMMqt0QC6o/AwGqA////wEaE+wNIRjtayMb7eUiG+zlIBjpVRYW6QP///8B////ARAI
302 | qS8SDKq9FA2r/xQNq/8UDav/Ew2r+xAKqoMOAqoP////Af///wEdEeYRIRnskSIa7PciGuzTHxnrRxYT
303 | 6wX///8BAwGlAw8JqEURCqmZDQeoH////wH///8B////Af///wH///8B////Af///wH///8B////Af//
304 | /wH///8B////Af///wESC6ohEwyqsRQNq/8RC6p9DgmqCf///wEUFOoFHhjsNyEa7L0hGeytFRXqEf//
305 | /wH///8BDwSoDxILqm8TDKv5FA2r/xQNq/8UDav/FA2r/xMMqs8QDKk7DwClA////wH///8BIBrtPSIZ
306 | 69chGeynGhHwG////wH///8BDwipCxEKqoUSDKrBDgqpLf///wH///8B////Af///wH///8B////Af//
307 | /wH///8B////Af///wH///8B////Af///wETDKkpEwyqwxQNq/8TDKq9DQmoF////wH///8BHBbrFyAY
308 | 63cfF+xV////Af///wEAAKQDDgmoMxMMqrkTDKv9FA2r/xQNq/8UDav/FA2r/xMMqvkSC6p7EQWoE///
309 | /wH///8BHA7/CyAY648gF+pnGhPrC////wH///8BEAeoHRMLqs0SDKrRDwqoPf///wH///8B////Af//
310 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wETDKkvEwyq0RQNq/8TDKvvDwipQ///
311 | /wH///8BHRPhBx0T5ycYFOkT////Af///wELB6gREAupaxMMqukUDav/FA2r/xQNq/8UDav/FA2r/xQN
312 | qv0TDKvFEQmrOwAArwX///8B////ARoV6jMaE+slEBDuBf///wH///8BEQmpUxQMqvcTDKrdEQqqSf//
313 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wETDKk1Ewyq3RQN
314 | q/8UDav/Egqqi////wH///8B////AQ8A2QX///8B////AQAAqQMPCqkvEgyqsxMMqvsUDav/FA2r/xQN
315 | q/8UDav/FA2r/xQNq/8TDKrtEQypeQ0IpxX///8B////AQ8P7QcODuIF////Af///wH///8BEgypnxQN
316 | q/8TDKvlEgurU////wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
317 | /wETDak5Ewyq5RQNq/8UDav/EgyqyQkAnhP///8B////Af///wH///8B////AQ8KqA0RDKlnEwyq3xQN
318 | q/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8TDar9EwyqwQ4KqzcAALYF////Af///wH///8B////Af//
319 | /wEMBqYdEgyq5RQNq/8TDKvtEgusWf///wH///8B////Af///wH///8B////Af///wH///8B////Af//
320 | /wH///8B////Af///wEUDas9FA2q7xQNq/8UDav/Ewyq9xALqFX///8B////Af///wH///8BBQKuAw8I
321 | qy8TDKq1FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/Ewyr6xILq30PCasT////Af//
322 | /wH///8B////Af///wETCqhrEwyq+RQNq/8TDKv3EgyqZf///wH///8B////Af///wH///8B////Af//
323 | /wH///8B////Af///wH///8B////Af///wEUDatDFA2r/xQNq/8UDav/Ewyr+xIMqpMNB6gJ////Af//
324 | /wH///8BCwanDREKqmcTDKrjFA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xMM
325 | q70OCak5BweiBf///wH///8B////AQkFpRETDKuvFAyr/RQNq/8UDav/EguqdwAApgX///8B////Af//
326 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wEUDatDFA2r/xQNq/8UDav/Ew2r/RMM
327 | qskPCqgt////Af///wH///8BDgipJxIMqqkUDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQN
328 | q/8UDav/FA2r/xMMq+0RC6p1CwenD////wH///8B////ARAKqD8TDKrfFA2r/xQNq/8UDav/EQuqfQMA
329 | pwn///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wEUDatDFA2r/xQN
330 | q/8UDav/FA2r/xMMqukSDKljAACSA////wEAAJIFEAqrWxMMqukUDav/FA2r/xQNq/8UDav/FA2r/xQN
331 | q/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8TDKq5DwipMf///wH///8BAAChBxIMqHkTDKrxFA2r/xQN
332 | q/8UDav/EgupgwkEpAv///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
333 | /wEUDatDFA2r/xQNq/8UDav/FA2r/xMNqvUSDKqVDgmnFf///wEOB6gXEguqoxQNq/8UDav/FA2r/xQN
334 | q/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8TDKr1EQupbQAAmQf///8BDgumIxMM
335 | qrUUDar9FA2r/xQNq/8UDav/EguqhwsFpw3///8B////Af///wH///8B////Af///wH///8B////Af//
336 | /wH///8B////Af///wEUDatDFA2r/xQNq/8UDav/FA2r/xMNq/8TDKrPEQqpPQYCjQcQCqZJEwyq+xQN
337 | q/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/EgypxQ8H
338 | qyEEAKcDEAypTxMMqt0UDav/FA2r/xQNq/8UDav/EguqhwsFpg3///8B////Af///wH///8B////Af//
339 | /wH///8B////Af///wH///8B////Af///wETDao/Ew2q6xMMq+8TDav9FA2r/xQNq/8TDKrpEQuqaQ4H
340 | piUSDKmhFA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQN
341 | q/8UDav/FA2r/xEKqV8LBKkbEQurhxMNq/UUDav/Ew2q/RMMqvETDKrjEQuqcQoFpQv///8B////Af//
342 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wESDaohEgyqcRIMqnkSDKqdEgyrsxIM
343 | qskTDKrXEgyqmxAKqmkTDKrnFA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQN
344 | q/8UDav/FA2r/xQNq/8UDav/FA2r/xIMqbkQCalJEguqoRMMqsMSDKqzEgyqnxIMqH0RC6hbDQmoIwAA
345 | owP///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wEJCaoDCwaqCQwH
346 | ogkGBqkRDAmpIQ4KqTsRC6lVEAqpWw8JqWkRC6q5FA2q7xQNq/8UDav/FA2r/xQNq/8UDav/FA2r/xQN
347 | q/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/Ewyq2xILqZMNB6U3DwmoQw8KpzUMCKYhBwenDw0K
348 | pAkLAJoHAACOA////wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
349 | /wH///8B////Af///wH///8B////AQAArQMFAKMFCACmCQoEpBUNCagtEQqoVRILqZETDKrbFA2r/xQN
350 | q/8UDav/FA2r/xQNq/8UDav/FA2r/xQNq/8UDav/Ew2r8RMMqrUTC6pzEAmoPw8IoRsHAJsHAAClAwAA
351 | pwP///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
352 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8BCwOkBQwI
353 | og8NCKYtEAqncRMMqckTDKr3FA2r/xQNq/8UDav/Ewyr+xMMqvESDKmfDgmoSwsHpxsPB6IJBwKhA///
354 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
355 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
356 | /wH///8B////Af///wH///8BAABmAwwGohsRC6h5Ewyr3xMNq/MTDKrlEgyroQ8Iqj0AAKoJ////Af//
357 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
358 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
359 | /wH///8B////Af///wH///8B////Af///wH///8B////AQAAvgMOB6cfEwyrYRMNq38RDKpVDQarHQYA
360 | mgP///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
361 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
362 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
363 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
364 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
365 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
366 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
367 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
368 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
369 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
370 | /wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af///wH///8B////Af//
371 | /wEAAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAA
372 | AAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA
373 | //8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAA
374 | AAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA
375 | //8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAA
376 | AAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8AAAAAAAD//wAAAAAAAP//AAAAAAAA
377 | //8AAAAAAAD//wAAAAAAAP//AAAAAAAA//8=
378 |
379 |
380 |
--------------------------------------------------------------------------------
/MSniper/WFConsole/FWindow.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Diagnostics;
4 | using System.Globalization;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Reflection;
8 | using System.Text;
9 | using System.Text.RegularExpressions;
10 | using System.Threading;
11 | using System.Threading.Tasks;
12 | using System.Windows.Forms;
13 | using MSniper.Enums;
14 | using MSniper.Extensions;
15 | using MSniper.Settings;
16 | using MSniper.Settings.Localization;
17 | using Newtonsoft.Json;
18 | using Newtonsoft.Json.Converters;
19 |
20 | namespace MSniper.WFConsole
21 | {
22 | public partial class FWindow : Form
23 | {
24 | #region form
25 |
26 | public FWindow()
27 | {
28 | InitializeComponent();
29 | CheckForIllegalCrossThreadCalls = false;
30 | FormClosed += FWindow_FormClosed;
31 |
32 | #region menustrip actions
33 |
34 | getFeedsToolStripMenuItem.Click += delegate (object sender, EventArgs e)
35 | {
36 | //if (RunningNormally && BotCount > 0)
37 | //{
38 | //LFeed = new LiveFeed.LiveFeed();
39 | //LFeed.ShowDialog();
40 | //LFeed.Dispose();
41 | //}
42 | //else
43 | //{
44 | // MessageBox.Show("necrobot not found or uninitialized normally");
45 | //}
46 | };
47 | donateToolStripMenuItem.Click += delegate (object sender, EventArgs e)
48 | {
49 | Process.Start($"{Variables.GithubIoUri}#donation");
50 | };
51 | mSniperLatestToolStripMenuItem.Click += delegate (object sender, EventArgs e)
52 | {
53 | Process.Start($"{Variables.GithubProjectUri}");
54 | };
55 | msniperServiceToolStripMenuItem.Click += delegate (object sender, EventArgs e)
56 | {
57 | Process.Start("https://github.com/msx752/msniper-location-service");
58 | };
59 | necroBotLatestToolStripMenuItem.Click += delegate (object sender, EventArgs e)
60 | {
61 | Process.Start("https://github.com/Necrobot-Private/NecroBot");
62 | };
63 | featuresToolStripMenuItem.Click += delegate (object sender, EventArgs e)
64 | {
65 | Process.Start($"{Variables.GithubIoUri}#features");
66 | };
67 | configurationToolStripMenuItem.Click += delegate (object sender, EventArgs e)
68 | {
69 | Process.Start($"{Variables.GithubIoUri}#configuration");
70 | };
71 | usageToolStripMenuItem.Click += delegate (object sender, EventArgs e)
72 | {
73 | Process.Start($"{Variables.GithubIoUri}#usage");
74 | };
75 | askedQuestionsToolStripMenuItem.Click += delegate (object sender, EventArgs e)
76 | {
77 | Process.Start($"{Variables.GithubIoUri}#frequently-asked-questions");
78 | };
79 | advantageToolStripMenuItem.Click += delegate (object sender, EventArgs e)
80 | {
81 | Process.Start($"{Variables.GithubIoUri}#advantage");
82 | };
83 | fileInformationToolStripMenuItem.Click += delegate (object sender, EventArgs e)
84 | {
85 | Process.Start($"{Variables.GithubIoUri}#file-information");
86 | };
87 |
88 | #endregion menustrip actions
89 |
90 | Console.InitializeFConsole();
91 | }
92 |
93 | private void FWindow_FormClosed(object sender, FormClosedEventArgs e) => Process.GetCurrentProcess().Kill();
94 |
95 | private void FWindow_Load(object sender, EventArgs e)
96 | {
97 | this.Main();
98 | }
99 |
100 | #endregion form
101 |
102 | public LiveFeed.LiveFeed LFeed { get; set; }
103 |
104 | public int BotCount { get; set; }
105 |
106 | public bool RunningNormally { get; set; }
107 |
108 | public Configs Config { get; set; }
109 |
110 | public Translation Culture { get; set; }
111 |
112 | public Process[] GetNecroBotProcesses()
113 | {
114 | var plist = Process.GetProcesses()
115 | .Where(x =>
116 | x.ProcessName.ToLower().StartsWith(Variables.BotExeName) &&
117 | !x.ProcessName.ToLower().EndsWith(".vshost") &&
118 | !x.ProcessName.ToLower().EndsWith(".gui") &&
119 | !x.ProcessName.ToLower().EndsWith(".guı")
120 | ).ToArray();
121 | BotCount = plist.Count();
122 | return plist;
123 | }
124 |
125 | public void CheckNecroBots(bool shutdownMSniper)
126 | {
127 | if (GetNecroBotProcesses().Any()) return;
128 | Console.WriteLine(string.Empty.PadRight(10) + Culture.GetTranslation(TranslationString.AnyNecroBotNotFound), Config.Error);
129 | Console.WriteLine(string.Empty.PadRight(5) + $" *{Culture.GetTranslation(TranslationString.RunBeforeMSniper)}*", Config.Error);
130 | Console.WriteLine("--------------------------------------------------------");
131 | if (shutdownMSniper)
132 | Shutdown();
133 | }
134 |
135 | public void Delay(int seconds, bool isShutdownMsg = false)
136 | {
137 | for (var i = seconds; i >= 0; i--)
138 | {
139 | var ts = TranslationString.ShutdownMsg;
140 | if (!isShutdownMsg)
141 | ts = TranslationString.SubsequentProcessing;
142 |
143 | Console.UpdateLine(Console.Lines.Count() - 1,
144 | Culture != null
145 | ? Culture.GetTranslation(ts, i)
146 | : $"Subsequent processing passing in {i} seconds or Close the Program");
147 |
148 | Thread.Sleep(1000);
149 | }
150 | }
151 |
152 | public void ExportReferences()
153 | {
154 | try
155 | {
156 | var path = Path.Combine(Application.StartupPath, "Newtonsoft.Json.dll");
157 | if (!File.Exists(path))
158 | File.WriteAllBytes(path, Properties.Resources.Newtonsoft_Json);
159 | path = Path.Combine(Application.StartupPath, "registerProtocol.bat");
160 | if (!File.Exists(path))
161 | File.WriteAllText(path, Properties.Resources.registerProtocol);
162 | path = Path.Combine(Application.StartupPath, "removeProtocol.bat");
163 | if (!File.Exists(path))
164 | File.WriteAllText(path, Properties.Resources.removeProtocol);
165 | path = Path.Combine(Application.StartupPath, "resetSnipeList.bat");
166 | if (!File.Exists(path))
167 | File.WriteAllText(path, Properties.Resources.resetSnipeList);
168 | }
169 | catch (Exception)
170 | {
171 |
172 | }
173 | }
174 |
175 | public void LoadConfigurations()
176 | {
177 | Config = LoadConfigs();
178 | Culture = LoadCulture(Config);
179 |
180 | #region controls culture
181 | activeBotsToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.ActiveBots);
182 | linksToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.HowTo);
183 | configurationToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.Configuration);
184 | usageToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.Usage);
185 | askedQuestionsToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.AskedQuestions);
186 | advantageToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.Advantage);
187 | fileInformationToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.FileInformation);
188 | featuresToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.Features);
189 | projectToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.ProjectsLink);
190 | getFeedsToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.GetLiveFeed);
191 | donateToolStripMenuItem.Text = Culture.GetTranslation(TranslationString.Donate);
192 |
193 | #endregion
194 |
195 | ////ExportDefaultTranslation(); //needs for translation information
196 | }
197 |
198 | public void Helper(bool withParams)
199 | {
200 | Console.WriteLine("\n--------------------------------------------------------");
201 | Console.WriteLine(Culture.GetTranslation(TranslationString.Description,
202 | Variables.ProgramName, Variables.CurrentVersion, Variables.By));
203 | Console.WriteLine(Culture.GetTranslation(TranslationString.GitHubProject,
204 | Variables.GithubIoUri),
205 | Config.Warning);
206 | Console.WriteLine(Culture.GetTranslation(TranslationString.SnipeWebsite,
207 | Variables.SnipeWebsite),
208 | Config.Warning);
209 | Console.WriteLine(Culture.GetTranslation(TranslationString.SnipeWebsite,
210 | "http://mypogosnipers.com/"),
211 | Config.Warning);
212 | Console.Write(Culture.GetTranslation(TranslationString.CurrentVersion,
213 | Assembly.GetEntryAssembly().GetName().Version.ToString()),
214 | Config.Highlight);
215 | if (Protocol.IsRegistered() == false && withParams == false)
216 | {
217 | Console.WriteLine(" ");
218 | Console.WriteLine(Culture.GetTranslation(TranslationString.ProtocolNotFound,
219 | "registerProtocol.bat"),
220 | Config.Error);
221 | Shutdown();
222 | }
223 |
224 | if (VersionCheck.IsLatest())
225 | {
226 | Console.WriteLine($"\t* {Culture.GetTranslation(TranslationString.LatestVersion)} *", Config.Highlight);
227 | }
228 | else
229 | {
230 | Console.WriteLine(string.Format($"* {Culture.GetTranslation(TranslationString.NewVersion)}: {{0}} *", VersionCheck.RemoteVersion), Config.Success);
231 |
232 | var downloadlink = Variables.GithubProjectUri + "/releases/latest";
233 | Console.WriteLine(string.Format($"* {Culture.GetTranslation(TranslationString.DownloadLink)}: {{0}} *", downloadlink), Config.Warning);
234 | if (Config.DownloadNewVersion && withParams == false)
235 | {
236 | Console.WriteLine(Culture.GetTranslation(TranslationString.AutoDownloadMsg), Config.Notification);
237 | Console.Write($"{Culture.GetTranslation(TranslationString.Warning)}:", Config.Error);
238 | Console.WriteLine(Culture.GetTranslation(TranslationString.WarningShutdownProcess), Config.Highlight);
239 | var c = Console.ReadKey();
240 | if (c == 'd' || c == 'D')
241 | {
242 | Downloader.DownloadNewVersion();
243 | }
244 | Shutdown();
245 | }
246 | }
247 | Console.WriteLine(Culture.GetTranslation(TranslationString.IntegrateMsg,
248 | Variables.ProgramName, Variables.MinRequireVersion), Config.Notification);
249 | Console.WriteLine("--------------------------------------------------------");
250 | }
251 |
252 | public void ShowActiveBots()
253 | {
254 | if (Config.ShowActiveBots)
255 | {
256 | Task.Run(() =>
257 | {
258 | do
259 | {
260 | try
261 | {
262 | var plist = GetNecroBotProcesses();
263 | activeBotsToolStripMenuItem.Visible = plist.Length != 0;
264 | IsActiveBotsAlive();
265 | foreach (var item in plist)
266 | {
267 | var username = item.GetWindowTitle();
268 | if (string.IsNullOrEmpty(username))
269 | continue;
270 |
271 | var btn = new ToolStripMenuItem(username) { Tag = item.MainWindowHandle };
272 | btn.Click += delegate (object sender, EventArgs e)
273 | {
274 | var id = int.Parse(btn.Tag.ToString());
275 | Dlls.BringToFront(new IntPtr(id));
276 | };
277 | var isExists = ActiveBotsContains(btn.Tag as IntPtr?);
278 | if (isExists == -1)
279 | {
280 | activeBotsToolStripMenuItem.DropDownItems.Add(btn);
281 | }
282 | else
283 | {
284 | if (btn.Text == activeBotsToolStripMenuItem.DropDownItems[isExists].Text) continue;
285 | activeBotsToolStripMenuItem.DropDownItems.RemoveAt(isExists);
286 | activeBotsToolStripMenuItem.DropDownItems.Add(btn);
287 | }
288 | }
289 | }
290 | catch { }
291 | Thread.Sleep(5000);
292 | } while (true);
293 | });
294 | }
295 | else
296 | {
297 | activeBotsToolStripMenuItem.Visible = false;
298 | }
299 | }
300 |
301 | private void IsActiveBotsAlive()
302 | {
303 | for (var i = 0; i < activeBotsToolStripMenuItem.DropDownItems.Count; i++)
304 | {
305 | var prc = GetNecroBotProcesses()
306 | .FirstOrDefault(p => p.MainWindowHandle.ToString() == activeBotsToolStripMenuItem.DropDownItems[i].Tag.ToString());
307 | if (prc == null)
308 | {
309 | activeBotsToolStripMenuItem.DropDownItems.RemoveAt(i);
310 | }
311 | }
312 | }
313 |
314 | private int ActiveBotsContains(IntPtr? intptr)
315 | {
316 | for (var i = 0; i < activeBotsToolStripMenuItem.DropDownItems.Count; i++)
317 | {
318 | if (intptr != null && activeBotsToolStripMenuItem.DropDownItems[i].Tag.ToString() == intptr.Value.ToString())
319 | return i;
320 | }
321 | return -1;
322 | }
323 |
324 | public void Main()
325 | {
326 | Task.Run(() =>
327 | {
328 | Console.Clear();
329 | if (KillSwitch.CheckKillSwitch())
330 | return;
331 | ExportReferences();
332 | LoadConfigurations();
333 | ShowActiveBots();
334 | Console.Title = Culture.GetTranslation(TranslationString.Title,
335 | Variables.ProgramName, Variables.CurrentVersion, Variables.By
336 | );
337 | Helper(Console.Arguments.Length != 0);
338 | CheckNecroBots(Console.Arguments.Length != 1);
339 | //Console.Arguments = new string[] { "msniper://Ivysaur/-33.890835,151.223859" };//for debug mode
340 | //args = new string[] { "-registerp" };//for debug mode
341 | //Console.Arguments = new string[] { "msniper://Staryu/8694528382595630333/89c258978a1/40.781605427526415,-73.961284780417373/51.31" };
342 | if (Console.Arguments.Length == 1)
343 | {
344 | RunningNormally = false;
345 | switch (Console.Arguments.First())
346 | {
347 | case "-register":
348 | Runas(Variables.ExecutablePath, "-registerp");
349 | break;
350 |
351 | case "-registerp":
352 | Protocol.Register();
353 | Console.WriteLine(Culture.GetTranslation(TranslationString.ProtocolRegistered), Config.Success);
354 | break;
355 |
356 | case "-remove":
357 | Runas(Variables.ExecutablePath, "-removep");
358 | break;
359 |
360 | case "-removep":
361 | Protocol.Delete();
362 | Console.WriteLine(Culture.GetTranslation(TranslationString.ProtocolDeleted), Config.Success);
363 | break;
364 |
365 | case "-resetallsnipelist":
366 | RemoveAllSnipeMsjson();
367 | break;
368 |
369 | default:
370 | var re0 = "(msniper://)"; //protocol
371 | var re1 = "((?:\\w+))";//pokemon name
372 | var re2 = "(\\/)";//separator
373 | var re3 = "(\\d+)";
374 | var re4 = "(\\/)";//separator
375 | var re5 = "((?:[a-zA-Z0-9]*))";
376 | var re6 = "(\\/)";//separator
377 | var re7 = "([+-]?\\d*\\.\\d+)(?![-+0-9\\.])";//lat
378 | var re8 = "(,)";//separator
379 | var re9 = "([+-]?\\d*\\.\\d+)(?![-+0-9\\.])";//lon
380 | var re10 = "(\\/)";//separator
381 | var re11 = "(\\d*(\\.)?\\d+)";
382 |
383 | var r = new Regex(re0 + re1 + re2 + re3 + re4 + re5 + re6 + re7 + re8 + re9 + re10 + re11, RegexOptions.IgnoreCase | RegexOptions.Singleline);
384 | var m = r.Match(Console.Arguments.First());
385 | if (m.Success)
386 | {
387 | Snipe(m);
388 | break;
389 | }
390 | re0 = "(msniper://|pokesniper2://)"; //protocol
391 | r = new Regex(re0 + re1 + re6 + re7 + re8 + re9, RegexOptions.IgnoreCase | RegexOptions.Singleline);
392 | m = r.Match(Console.Arguments.First());
393 | if (m.Success)
394 | {
395 | Snipe(m, true);
396 | break;
397 | }
398 |
399 | Console.WriteLine(Culture.GetTranslation(TranslationString.UnknownLinkFormat), Config.Error);
400 |
401 | break;
402 | }
403 | }
404 | else if (Console.Arguments.Length == 0)
405 | {
406 | //RunningNormally = true;
407 | //Console.WriteLine("manual snipe disabled - please use http://msniper.com", System.Drawing.Color.Green);
408 | //Console.WriteLine("--------------------------------------------------------");
409 | //RunningNormally = true;
410 | Console.WriteLine(Culture.GetTranslation(TranslationString.CustomPasteDesc));
411 | Console.WriteLine(Culture.GetTranslation(TranslationString.CustomPasteFormat));
412 | Console.WriteLine("--------------------------------------------------------");
413 | do
414 | {
415 | Console.WriteLine(Culture.GetTranslation(TranslationString.WaitingDataMsg), Config.Highlight);
416 | var snipping = Console.ReadLine();
417 | CheckNecroBots(true);
418 | //snipping = "dragonite 37.766627 , -122.403677";//for debug mode (spaces are ignored)
419 | if (snipping.ToLower() == "e")
420 | break;
421 | snipping = "msniper://" + snipping;
422 | snipping = snipping.Replace("\r\n", "\r\nmsniper://");
423 | var re0 = "(msniper://)"; //protocol
424 | var re1 = "((?:\\w+\\s*))";//pokemon name
425 | var re6 = "( )";//separator
426 | var re7 = "([+-]?\\d*\\.\\d+)(?![-+0-9\\.])";//lat
427 | var re8 = "(\\s*,\\s*)";//separator
428 | var re9 = "([+-]?\\d*\\.\\d+)(?![-+0-9\\.])";//lon
429 |
430 | var r = new Regex(re0 + re1 + re6 + re7 + re8 + re9, RegexOptions.IgnoreCase | RegexOptions.Singleline);
431 |
432 | var error = true;
433 | foreach (Match m in r.Matches(snipping))
434 | {
435 | if (!m.Success) continue;
436 | var pokemonN = m.Groups[2].ToString().Replace(" ", "");
437 | error = false;
438 | var prkmnm = PokemonId.Abra;
439 | var verified = Enum.TryParse(pokemonN,true, out prkmnm);
440 | if (verified)
441 | Snipe(m, true);
442 | else
443 | Console.WriteLine(Culture.GetTranslation(TranslationString.WrongPokemonName, pokemonN), Config.Error);
444 | }
445 | if (error)
446 | Console.WriteLine(Culture.GetTranslation(TranslationString.CustomPasteWrongFormat), Config.Error);
447 | }
448 | while (true);
449 | }
450 | Shutdown();
451 | });
452 | }
453 |
454 | public void RemoveAllSnipeMsjson()
455 | {
456 | var plist = GetNecroBotProcesses();
457 | foreach (var item in plist)
458 | {
459 | var pathRemote = GetSnipeMsPath(Path.GetDirectoryName(item.MainModule.FileName));
460 | if (File.Exists(pathRemote))
461 | {
462 | FileDelete(pathRemote);
463 | var val = item.MainWindowTitle.Split('-').First().Split(' ')[2];
464 | Console.WriteLine(Culture.GetTranslation(TranslationString.RemoveAllSnipe, val), Config.Success);
465 | }
466 | }
467 | Console.WriteLine(Culture.GetTranslation(TranslationString.RemoveAllSnipeFinished, plist.Count()), Config.Success);
468 | }
469 |
470 | public void Runas(string executablepath, string parameters, bool afterKillSelf = true)
471 | {
472 | var psi = new ProcessStartInfo(Application.ExecutablePath)
473 | {
474 | Verb = "runas",
475 | Arguments = parameters
476 | };
477 | Process.Start(psi);
478 | if (afterKillSelf)
479 | Process.GetCurrentProcess().Kill();
480 | }
481 |
482 | public void Shutdown()
483 | {
484 | Shutdown(Config.CloseDelaySec);
485 | }
486 |
487 | public void Shutdown(int seconds)
488 | {
489 | Console.State = ConsoleState.Closing;
490 | Delay(seconds, true);
491 | Process.GetCurrentProcess().Kill();
492 | }
493 |
494 | public void Snipe(Match m, bool oldMethod = false)
495 | {
496 | try
497 | {
498 | var pList = GetNecroBotProcesses();
499 | foreach (var t in pList)
500 | {
501 | var username = t.GetWindowTitle();
502 | if (string.IsNullOrEmpty(username))
503 | continue;
504 |
505 | if (!IsBotUpperThan094(t.MainModule.FileVersionInfo))
506 | {
507 | Console.WriteLine(Culture.GetTranslation(TranslationString.IncompatibleVersionMsg, username), Config.Error);
508 | continue;
509 | }
510 | var pathRemote = GetSnipeMsPath(Path.GetDirectoryName(t.MainModule.FileName));
511 | var mSniperLocation = ReadSnipeMs(pathRemote);
512 | EncounterInfo newPokemon;
513 | if (!oldMethod)
514 | {
515 | newPokemon = new EncounterInfo()
516 | {
517 | PokemonId = (short)(PokemonId)Enum.Parse(typeof(PokemonId), m.Groups[2].ToString()),
518 | EncounterId = ulong.Parse(m.Groups[4].ToString()),
519 | SpawnPointId = m.Groups[6].ToString(),
520 | Latitude = double.Parse(m.Groups[8].Value, CultureInfo.InvariantCulture),
521 | Longitude = double.Parse(m.Groups[10].Value, CultureInfo.InvariantCulture),
522 | Iv = double.Parse(m.Groups[12].Value, CultureInfo.InvariantCulture),
523 | };
524 | }
525 | else
526 | {
527 | var prkmnm = PokemonId.Abra;
528 | var verified = Enum.TryParse(m.Groups[2].ToString(), true, out prkmnm);
529 | newPokemon = new EncounterInfo()
530 | {
531 | PokemonId = (short)prkmnm,
532 | Latitude = double.Parse(m.Groups[4].Value, CultureInfo.InvariantCulture),
533 | Longitude = double.Parse(m.Groups[6].Value, CultureInfo.InvariantCulture),
534 | };
535 | }
536 |
537 | if (!oldMethod && mSniperLocation.FindIndex(p => p.EncounterId == newPokemon.EncounterId && p.SpawnPointId == newPokemon.SpawnPointId) == -1)
538 | {
539 | mSniperLocation.Add(newPokemon);
540 | if (WriteSnipeMs(mSniperLocation, pathRemote))
541 | {
542 | Console.WriteLine(Culture.GetTranslation(TranslationString.SendingPokemonToNecroBot,
543 | ((PokemonId)newPokemon.PokemonId).ToString(),
544 | newPokemon.Latitude,
545 | newPokemon.Longitude,
546 | username), Config.Success);
547 | }
548 | }
549 | else if (oldMethod && mSniperLocation.FindIndex(p =>
550 | p.PokemonId == newPokemon.PokemonId &&
551 | Math.Abs(p.Latitude - newPokemon.Latitude) < 15 &&
552 | Math.Abs(p.Longitude - newPokemon.Longitude) < 15) == -1)
553 | {
554 | mSniperLocation.Add(newPokemon);
555 | if (WriteSnipeMs(mSniperLocation, pathRemote))
556 | {
557 | Console.WriteLine(Culture.GetTranslation(TranslationString.SendingPokemonToNecroBot,
558 | ((PokemonId)newPokemon.PokemonId).ToString(),
559 | newPokemon.Latitude,
560 | newPokemon.Longitude,
561 | username), Config.Success);
562 | }
563 | }
564 | else
565 | {
566 | Console.WriteLine(
567 | Culture.GetTranslation(TranslationString.AlreadySnipped, newPokemon.Latitude + "," + newPokemon.Longitude),
568 | Config.Error);
569 | }
570 | }
571 | }
572 | catch (Exception ex)
573 | {
574 | Console.WriteLine(ex.Message, Config.Error);
575 | }
576 | }
577 |
578 | private static void ExportDefaultTranslation()
579 | {
580 | // this method only using for information \temp\languages\translation.en.json
581 | var culture = new Translation();
582 | culture.Save("en");
583 | Process.GetCurrentProcess().Kill();
584 | }
585 |
586 | private static string GetSnipeMsPath(string necroBotExePath) => Path.Combine(necroBotExePath, Variables.SnipeFileName);
587 |
588 | private static Configs LoadConfigs()
589 | {
590 |
591 | var settings = new Configs();
592 | if (File.Exists(Variables.SettingPath))
593 | {
594 | settings = Configs.Load();
595 | }
596 | else
597 | {
598 | Configs.SaveFiles(settings);
599 | }
600 | return settings;
601 | }
602 |
603 | private static List ReadSnipeMs(string path)
604 | {
605 | if (File.Exists(path))
606 | {
607 | var jsn = "";
608 | do
609 | {
610 | try
611 | {
612 | jsn = File.ReadAllText(path, Encoding.UTF8);
613 | break;
614 | }
615 | catch { Thread.Sleep(200); }
616 | }
617 | while (true);//waiting access
618 | return JsonConvert.DeserializeObject>(jsn);
619 | }
620 | else
621 | {
622 | return new List();
623 | }
624 | }
625 |
626 | private static bool WriteSnipeMs(List mSniperLocation, string path)
627 | {
628 | do
629 | {
630 | try
631 | {
632 | var sw = new StreamWriter(path, false, Encoding.UTF8);
633 | sw.WriteLine(JsonConvert.SerializeObject(
634 | mSniperLocation,
635 | Formatting.Indented,
636 | new StringEnumConverter { CamelCaseText = true }));
637 | sw.Close();
638 | return true;
639 | break;
640 | }
641 | catch { Thread.Sleep(200); }
642 | }
643 | while (true);//waiting access
644 | }
645 |
646 | private static void FileDelete(string path)
647 | {
648 | do
649 | {
650 | try
651 | {
652 | File.Delete(path);
653 | break;
654 | }
655 | catch { }
656 | } while (true);//waiting access
657 | }
658 |
659 | private bool IsBotUpperThan094(FileVersionInfo fversion) => new Version(fversion.FileVersion) >= new Version(Variables.MinRequireVersion);
660 |
661 | private Translation LoadCulture(Configs settings) => Translation.Load(settings);
662 | }
663 | }
--------------------------------------------------------------------------------