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

Initial Commit

This commit is contained in:
2024-04-13 15:54:59 +10:00
parent 8e178cbb7b
commit 63ed43f4af
459 changed files with 8039 additions and 20504 deletions

View File

@ -1,46 +1,43 @@
using System;
using System.Collections.Immutable;
using System.Text;
using System.Text;
using System.Text.Json;
namespace Observatory.Framework.Files
{
public static class JournalUtilities
{
public static string GetEventType(string line)
{
var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(line));
string result = string.Empty;
namespace Observatory.Framework.Files.Journal;
try
public static class JournalUtilities
{
public static string GetEventType(string line)
{
var reader = new Utf8JsonReader(Encoding.UTF8.GetBytes(line));
var result = string.Empty;
try
{
while (reader.Read())
{
while (reader.Read())
if (reader.TokenType == JsonTokenType.PropertyName && reader.GetString() == "event")
{
if (reader.TokenType == JsonTokenType.PropertyName && reader.GetString() == "event")
{
reader.Read();
result = reader.GetString();
}
reader.Read();
result = reader.GetString();
}
}
catch
{
result = "InvalidJson";
}
return result;
}
public static string CleanScanEvent(string line)
catch
{
return line.Replace("\"RotationPeriod\":inf,", "");
result = "InvalidJson";
}
public const string ObsoleteMessage = "Unused in Elite Dangerous 3.7+, may appear in legacy journal data.";
public const string UnusedMessage = "Documented by Frontier, but no occurances of this value ever found in real journal data.";
return result;
}
}
public static string CleanScanEvent(string line)
{
return line.Replace("\"RotationPeriod\":inf,", "");
}
public const string ObsoleteMessage = "Unused in Elite Dangerous 3.7+, may appear in legacy journal data.";
public const string UnusedMessage = "Documented by Frontier, but no occurances of this value ever found in real journal data.";
}