Skip to content

Commit fe98d8b

Browse files
Add source code for V1
1 parent b07f0d3 commit fe98d8b

File tree

18 files changed

+1013
-0
lines changed

18 files changed

+1013
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
bin/
2+
obj/
3+
/packages/
4+
riderModule.iml
5+
/_ReSharper.Caches/

EveRAT.sln

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EveRAT", "EveRAT\EveRAT.csproj", "{C263355F-2014-4D00-B99D-2F4B1853E3B8}"
4+
EndProject
5+
Global
6+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
7+
Debug|Any CPU = Debug|Any CPU
8+
Release|Any CPU = Release|Any CPU
9+
EndGlobalSection
10+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
11+
{C263355F-2014-4D00-B99D-2F4B1853E3B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
12+
{C263355F-2014-4D00-B99D-2F4B1853E3B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
13+
{C263355F-2014-4D00-B99D-2F4B1853E3B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
14+
{C263355F-2014-4D00-B99D-2F4B1853E3B8}.Release|Any CPU.Build.0 = Release|Any CPU
15+
EndGlobalSection
16+
EndGlobal

EveRAT/.idea/.idea.MIGoatChecker.dir/.idea/.gitignore

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EveRAT/.idea/.idea.MIGoatChecker.dir/.idea/encodings.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EveRAT/.idea/.idea.MIGoatChecker.dir/.idea/indexLayout.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EveRAT/.idea/.idea.MIGoatChecker.dir/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

EveRAT/Data/EveESI.cs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/// Author : Sébastien Duruz
2+
/// Date : 03.05.2023
3+
4+
using ESI.NET;
5+
using ESI.NET.Enumerations;
6+
using ESI.NET.Models.Universe;
7+
using Microsoft.Extensions.Options;
8+
using Structure = ESI.NET.Models.Sovereignty.Structure;
9+
10+
namespace EveContractsFetcher.Data
11+
{
12+
/// <summary>
13+
/// Class EveESI
14+
/// </summary>
15+
public class EveESI
16+
{
17+
/// <summary>
18+
/// ESI Client
19+
/// </summary>
20+
public EsiClient Client { get; set; }
21+
22+
/// <summary>
23+
/// Expiration of the current SystemKills Data
24+
/// </summary>
25+
public DateTime? CurrentExpires { get; set; }
26+
27+
/// <summary>
28+
/// Start of the current SystemKills Data
29+
/// </summary>
30+
public DateTime? CurrentLastModified { get; set; }
31+
32+
/// <summary>
33+
/// Custom Constructor
34+
/// </summary>
35+
/// <param name="clientId">ClientId</param>
36+
/// <param name="secretKey">SecretKey</param>
37+
/// <param name="callbackUrl">callbackUrl</param>
38+
/// <param name="userAgent">userAgent</param>
39+
public EveESI(string clientId, string secretKey, string callbackUrl, string userAgent)
40+
{
41+
IOptions<EsiConfig> config = Options.Create(new EsiConfig()
42+
{
43+
EsiUrl = "https://esi.evetech.net/",
44+
DataSource = DataSource.Tranquility,
45+
ClientId = clientId,
46+
SecretKey = secretKey,
47+
CallbackUrl = callbackUrl,
48+
UserAgent = userAgent
49+
});
50+
Client = new EsiClient(config);
51+
}
52+
53+
/// <summary>
54+
/// Fetch the current kills for systems
55+
/// </summary>
56+
public async Task<List<Kills>> FetchCurrentKills()
57+
{
58+
CurrentExpires = (await Client.Universe.Kills()).Expires;
59+
CurrentLastModified = (await Client.Universe.Kills()).LastModified;
60+
61+
return (await Client.Universe.Kills()).Data;
62+
}
63+
64+
/// <summary>
65+
/// Fetch the current Sovereignty for systems
66+
/// </summary>
67+
public async Task<List<Structure>> FetchCurrentSov()
68+
{
69+
return (await Client.Sovereignty.Structures()).Data;
70+
}
71+
}
72+
}

0 commit comments

Comments
 (0)