Skip to content

Commit

Permalink
2.03
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitaly Sushilov authored and Vitaly Sushilov committed Dec 16, 2017
1 parent 09b8902 commit 03939ca
Show file tree
Hide file tree
Showing 43 changed files with 2,444 additions and 767 deletions.
6 changes: 4 additions & 2 deletions Client/EvaJima/EveJima.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\2.02.5\</OutputPath>
<OutputPath>bin\x86\2.03.1\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
Expand Down Expand Up @@ -177,7 +177,9 @@
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\EvaJimaCore\EveJimaCore.csproj">
Expand Down
2 changes: 1 addition & 1 deletion Client/EvaJima/Version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.02
2.03
12 changes: 12 additions & 0 deletions Client/EvaJimaCore/BLL/EveJimaMessages.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using EvaJimaCore;

namespace EveJimaCore.BLL
{
public class EveJimaMessages
{
public string Get(string key)
{
return Tools.GetValue(key, Global.ApplicationSettings.LanguageId);
}
}
}
31 changes: 21 additions & 10 deletions Client/EvaJimaCore/EveJimaCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
<Compile Include="BLL\Map\MapTools.cs" />
<Compile Include="BLL\Map\MapUpdateHistory.cs" />
<Compile Include="BLL\Map\PilotLocation.cs" />
<Compile Include="BLL\EveJimaMessages.cs" />
<Compile Include="BLL\MetricsWriter.cs" />
<Compile Include="BLL\Navigator\Path.cs" />
<Compile Include="BLL\PathFinder.cs" />
Expand All @@ -106,6 +107,16 @@
<Compile Include="EveJimaPresenter.cs" />
<Compile Include="Infrastructure\CrestApiFunctions.cs" />
<Compile Include="Infrastructure\LazyLogger.cs" />
<Compile Include="Localization\English.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>English.resx</DependentUpon>
</Compile>
<Compile Include="Localization\Russian.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Russian.resx</DependentUpon>
</Compile>
<Compile Include="Logic\MapInformation\AMapInformationModel.cs" />
<Compile Include="Logic\MapInformation\AMapInformationPresenter.cs" />
<Compile Include="Logic\MapInformation\IAMapInformationModel.cs" />
Expand Down Expand Up @@ -251,12 +262,6 @@
<Compile Include="WhlControls\whlRouter.Designer.cs">
<DependentUpon>whlRouter.cs</DependentUpon>
</Compile>
<Compile Include="WhlControls\windowMapSettings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="WhlControls\windowMapSettings.Designer.cs">
<DependentUpon>windowMapSettings.cs</DependentUpon>
</Compile>
<Compile Include="WhlControls\windowMessage.cs">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -351,6 +356,14 @@
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Localization\English.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>English.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Localization\Russian.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Russian.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Logic\MapInformation\MapControl.resx">
<DependentUpon>MapControl.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -449,9 +462,6 @@
<EmbeddedResource Include="WhlControls\whlVersion.resx">
<DependentUpon>whlVersion.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WhlControls\windowMapSettings.resx">
<DependentUpon>windowMapSettings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="WhlControls\windowMessage.resx">
<DependentUpon>windowMessage.cs</DependentUpon>
</EmbeddedResource>
Expand Down Expand Up @@ -519,9 +529,10 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="RoadMap\TasksStack.txt" />
<Content Include="Versions\202\2.02.txt" />
<Content Include="Versions\202\Release.html" />
<Content Include="Versions\203\2.03.txt" />
<Content Include="Versions\203\Release.html" />
<Content Include="Versions\Release.html" />
<Content Include="Versions\Tasks.txt" />
<Content Include="Versions\1.35.txt" />
Expand Down
8 changes: 8 additions & 0 deletions Client/EvaJimaCore/Global.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public static class Global
{
private static readonly ILog Log = LogManager.GetLogger(typeof(Global));

public static EveJimaMessages Messages;

public static WorkEnvironment WorkEnvironment;

public static ApplicationSettings ApplicationSettings;
Expand All @@ -31,6 +33,8 @@ public static class Global

public static EveJimaPresenter Presenter;

public static EsiAuthorization EsiTools;

public static void Initialization()
{
ApplicationSettings = new ApplicationSettings();
Expand All @@ -40,6 +44,8 @@ public static void Initialization()

WorkEnvironment = new WorkEnvironment();

Messages = new EveJimaMessages();

Metrics = new MetricsWriter();

Pilots = new PilotsEntity();
Expand All @@ -56,6 +62,8 @@ public static void Initialization()

Presenter = new EveJimaPresenter();

EsiTools = new EsiAuthorization(ApplicationSettings.Authorization_ClientId, ApplicationSettings.Authorization_ClientSecret);

}

public static void Dispose()
Expand Down
34 changes: 33 additions & 1 deletion Client/EvaJimaCore/Infrastructure/EsiAuthorization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,39 @@ public dynamic GetSolarSystemInfo(string systemId)
}
}


public dynamic GetCorporationInfo(string corporationId)
{
Log.DebugFormat("[EsiAuthorization.GetCorporationInfo] started. systemId = {0}", corporationId);

try
{
var url = "https://esi.tech.ccp.is/latest/corporations/names/?corporation_ids=" + corporationId + "&datasource=tranquility";

var httpWebRequest = (HttpWebRequest)WebRequest.Create(url);

httpWebRequest.Method = "GET";
httpWebRequest.Headers.Add("Authorization", "Bearer " + AccessToken);
httpWebRequest.ContentType = "application/json";

var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();

result = result.Substring(1, result.Length - 2);

Log.DebugFormat("[EsiAuthorization.GetCorporationInfo] result = {0}", result);

return JObject.Parse(result);

}
}
catch (Exception ex)
{
Log.ErrorFormat("Critical error in [EsiAuthorization.GetCorporationInfo] systemId = {1} Exception is {0}", ex, corporationId);
return null;
}
}

public dynamic GetLocation(long pilotId)
{
Expand Down
20 changes: 20 additions & 0 deletions Client/EvaJimaCore/Infrastructure/Tools.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
using System;
using System.Collections.Generic;
using System.Diagnostics.Eventing.Reader;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net;
using System.Reflection;
using System.Resources;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Serialization;
using EvaJimaCore;
using EveJimaCore.Localization;
using log4net;
using EveJimaUniverse;
using Newtonsoft.Json;
Expand Down Expand Up @@ -231,5 +235,21 @@ public static T CloneObject<T>(this T source)

return JsonConvert.DeserializeObject<T>(JsonConvert.SerializeObject(source), deserializeSettings);
}

public static string GetValue(string key, int language)
{

switch(language)
{
case 1:
return English.ResourceManager.GetString(key);

case 2:
return Russian.ResourceManager.GetString(key);

default:
return English.ResourceManager.GetString(key);
}
}
}
}
Loading

0 comments on commit 03939ca

Please sign in to comment.