Skip to content

Commit

Permalink
Updated dotnet version
Browse files Browse the repository at this point in the history
  • Loading branch information
squaresmile committed Sep 23, 2024
1 parent 9346f9a commit 746c0df
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: 5.0.x
dotnet-version: 8
- name: Publish
run: dotnet publish -r win-x64 -c Release -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true
run: dotnet publish -r win-x64 -c Release
- name: Make folder and zip up
run: zip -j -9 ./WizardParser.zip ./WizardParser/bin/Release/netcoreapp5.0/win-x64/publish/WizardParser.exe
run: zip -j -9 ./WizardParser.zip ./WizardParser/bin/Release/net8.0/win-x64/publish/WizardParser.exe
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
28 changes: 19 additions & 9 deletions WizardParser/Program.cs
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
using System;
using System.Linq;
using Newtonsoft.Json;
using System.Net;
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json.Linq;
using System.Net.Http;

namespace WizardParser
{
class Program
{
static readonly HttpClient client = new HttpClient();

public static string GetStringSync(string url)
{
var webRequest = new HttpRequestMessage(HttpMethod.Get, url) { };
var response = client.Send(webRequest);
using var reader = new StreamReader(response.Content.ReadAsStream());
{
return reader.ReadToEnd();
}
}

static void Main()
{
WebClient web = new WebClient();
string nice_servant = web.DownloadString("https://api.atlasacademy.io/export/JP/nice_servant_lang_en.json");
string niceClassRelation = web.DownloadString("https://api.atlasacademy.io/export/JP/NiceClassRelation.json");
string niceEnums = web.DownloadString("https://api.atlasacademy.io/export/JP/nice_enums.json");
string niceClassAttack = web.DownloadString("https://api.atlasacademy.io/export/JP/NiceClassAttackRate.json");
string niceAttributeRelation = web.DownloadString("https://api.atlasacademy.io/export/JP/NiceAttributeRelation.json");
string nice_servant = GetStringSync("https://api.atlasacademy.io/export/JP/nice_servant_lang_en.json");
string niceClassRelation = GetStringSync("https://api.atlasacademy.io/export/JP/NiceClassRelation.json");
string niceEnums = GetStringSync("https://api.atlasacademy.io/export/JP/nice_enums.json");
string niceClassAttack = GetStringSync("https://api.atlasacademy.io/export/JP/NiceClassAttackRate.json");
string niceAttributeRelation = GetStringSync("https://api.atlasacademy.io/export/JP/NiceAttributeRelation.json");

JArray servantData = JsonConvert.DeserializeObject<JArray>(nice_servant);
JObject classRelation = JsonConvert.DeserializeObject<JObject>(niceClassRelation);
Expand Down Expand Up @@ -140,8 +151,7 @@ public static Servant GenerateServant(JToken svt, Dictionary<string, int> classN
else if (s.id == 336)
{
s.hasDamagingNp = true;
var web = new WebClient();
string bazettNp = web.DownloadString("https://api.atlasacademy.io/nice/JP/NP/1001150");
string bazettNp = GetStringSync("https://api.atlasacademy.io/nice/JP/NP/1001150");
var n = npStruct(JsonConvert.DeserializeObject<JObject>(bazettNp));
var r = s.nps.FirstOrDefault(x => x.mods.SequenceEqual(n.mods));
if ((r is null) || (r is not null && r.npCardType != n.npCardType))
Expand Down
10 changes: 8 additions & 2 deletions WizardParser/WizardParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<PublishSingleFile>true</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<PublishReadyToRun>true</PublishReadyToRun>
<IncludeNativeLibrariesForSelfExtract>true</IncludeNativeLibrariesForSelfExtract>
<EnableCompressionInSingleFile>true</EnableCompressionInSingleFile>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

</Project>

0 comments on commit 746c0df

Please sign in to comment.