2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 16:33:43 -04:00

Update Status, Power now look nice, also shows est refuel time

Status now shows alerts when taking damage
JournalService support more journals
Added enums to frontend, not quite working
Added More examples to Explorer component
This commit is contained in:
2024-05-15 01:00:56 +10:00
parent bd811c861c
commit 2ac1a927ca
11 changed files with 310 additions and 39 deletions

View File

@ -1,26 +0,0 @@
namespace Pulsar.Utils;
public sealed class HttpClient
{
private HttpClient()
{ }
private static readonly Lazy<System.Net.Http.HttpClient> lazy = new Lazy<System.Net.Http.HttpClient>(() => new System.Net.Http.HttpClient());
public static System.Net.Http.HttpClient Client => lazy.Value;
public static string GetString(string url)
{
return lazy.Value.GetStringAsync(url).Result;
}
public static HttpResponseMessage SendRequest(HttpRequestMessage request)
{
return lazy.Value.SendAsync(request).Result;
}
public static Task<HttpResponseMessage> SendRequestAsync(HttpRequestMessage request)
{
return lazy.Value.SendAsync(request);
}
}

View File

@ -288,6 +288,59 @@ public class JournalConverter(ILogger logger) : JsonConverter<JournalBase>
return JsonSerializer.Deserialize<MaterialDiscovered>(ref reader)!;
case "storedships":
return JsonSerializer.Deserialize<StoredShips>(ref reader)!;
case "scanorganic":
return JsonSerializer.Deserialize<ScanOrganic>(ref reader)!;
case "market":
return JsonSerializer.Deserialize<Market>(ref reader)!;
case "missioncompleted":
return JsonSerializer.Deserialize<MissionCompleted>(ref reader)!;
case "sellshiponrebuy":
return JsonSerializer.Deserialize<SellShipOnRebuy>(ref reader)!;
case "missionaccepted":
return JsonSerializer.Deserialize<MissionAccepted>(ref reader)!;
case "approachsettlement":
return JsonSerializer.Deserialize<ApproachSettlement>(ref reader)!;
case "screenshot":
return JsonSerializer.Deserialize<Screenshot>(ref reader)!;
case "moduleswap":
return JsonSerializer.Deserialize<ModuleSwap>(ref reader)!;
case "underattack":
return JsonSerializer.Deserialize<UnderAttack>(ref reader)!;
case "datascanned":
return JsonSerializer.Deserialize<DataScanned>(ref reader)!;
case "dockingdenied":
return JsonSerializer.Deserialize<DockingDenied>(ref reader)!;
case "fetchremotemodule":
return JsonSerializer.Deserialize<FetchRemoteModule>(ref reader)!;
case "engineercontribution":
return JsonSerializer.Deserialize<EngineerContribution>(ref reader)!;
case "collectcargo":
return JsonSerializer.Deserialize<CollectCargo>(ref reader)!;
case "moduleretrieve":
return JsonSerializer.Deserialize<ModuleRetrieve>(ref reader)!;
case "marketbuy":
return JsonSerializer.Deserialize<MarketBuy>(ref reader)!;
case "selldrones":
return JsonSerializer.Deserialize<SellDrones>(ref reader)!;
case "interdicted":
return JsonSerializer.Deserialize<Interdicted>(ref reader)!;
case "sellorganicdata":
return JsonSerializer.Deserialize<SellOrganicData>(ref reader)!;
case "wingadd":
return JsonSerializer.Deserialize<WingAdd>(ref reader)!;
case "winginvite":
return JsonSerializer.Deserialize<WingInvite>(ref reader)!;
case "wingjoin":
return JsonSerializer.Deserialize<WingJoin>(ref reader)!;
case "wingleave":
return JsonSerializer.Deserialize<WingLeave>(ref reader)!;
case "bounty":
return JsonSerializer.Deserialize<Bounty>(ref reader)!;
case "commitcrime":
return JsonSerializer.Deserialize<CommitCrime>(ref reader)!;
case "modulestore":
return JsonSerializer.Deserialize<ModuleStore>(ref reader)!;
default:
logger.LogWarning("Unknown Journal event type {EventName}", eventName);
return JsonSerializer.Deserialize<JournalBase>(ref reader)!;