EliteJourneyReader 1.0.1
dotnet add package EliteJourneyReader --version 1.0.1
NuGet\Install-Package EliteJourneyReader -Version 1.0.1
<PackageReference Include="EliteJourneyReader" Version="1.0.1" />
<PackageVersion Include="EliteJourneyReader" Version="1.0.1" />
<PackageReference Include="EliteJourneyReader" />
paket add EliteJourneyReader --version 1.0.1
#r "nuget: EliteJourneyReader, 1.0.1"
#:package EliteJourneyReader@1.0.1
#addin nuget:?package=EliteJourneyReader&version=1.0.1
#tool nuget:?package=EliteJourneyReader&version=1.0.1
EliteJourneyReader
EliteJourneyReader is a library for game Elite Dangerous written in .Net for interacting with in-game events with easy-to-use interface and customizable options.
How does it work?
When an event happens in-game, a file in %userprofile%\Saved Games\Frontier Developments\Elite Dangerous\
is appended (or new file is created) with json message of this in-game event along with event description (json properties).
Each in-game event is unique, has (mostly) different properties and is triggered by different actions.
EliteJourneyReader is capable of listening to these file changes, processing new in-game messages and exposing all necessary for you to easily react upon it.
Even without having supported all in-game event messages, EliteJourneyReader is fully capable of reacting to all messages, supported or not.
This is supported with OnAnyEvent
event. This event is raised every time an in-game event is triggered.
From here, you will get the base properties that every message has, like what type of event was triggered and when it was triggered,
along with json value of message that raised the event.
Code sample
In order for EliteJourneyReader to work, you need to register it's services through DI first:
services.ConfigureJourneyReader();
You can set options to your liking, for example to disable default reading of messages right from application start:
services.ConfigureJourneyReader(options =>
{
options.AutoStartProcessingMessages = false;
});
If you are not familiar with DI design pattern, it is explained in official microsoft documentation for .NET dependency injection. You can also check how it's done in <c>WpfSampleApp</c> in this solution.
Reacting to event not directly supported by EliteJourneyReader:
public MainWindow(IEliteJourneyProvider eliteJourneyProvider)
{
eliteJourneyProvider.OnAnyEvent += EliteJourneyProviderOnAnyEvent;
}
private void EliteJourneyProviderOnAnyEvent(JourneyEventMessage message, string jsonMessage)
{
if (message.EventType == "ReceiveText")
{
//do something
}
}
Even though not much is given to us from message
argument, we get the full jsonMessage
:
{
"timestamp":"2023-05-30T17:17:56Z",
"event":"ReceiveText",
"From":"",
"Message":"$COMMS_entered:#name=HIP 64726;",
"Message_Localised":"Entered Channel: HIP 64726",
"Channel":"npc"
}
We can then deserialize jsonMessage
e.g. using Newtonsoft json:
var message = JsonConvert.DeserializeObject<ReceiveTextMessage>(jsonMessage);
Once you have deserialized the message, it's only up to you what to do!
Reacting to supported event
For supported events it's even easier - we have all the types and even handled in EliteJourneyReader.
public MainWindow(IEliteJourneyProvider eliteJourneyProvider)
{
eliteJourneyProvider.OnFriendsChange += OnFriendsChange;
}
private void OnFriendsChange(object? sender, FriendsEventMessage friendsChangeMessage)
{
//"Your friend {username} is {online/offline/...}"
Console.WriteLine($"Your friend {friendsChangeMessage.FriendName} is {friendsChangeMessage.Status}!");
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- Microsoft.Extensions.Configuration (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection (>= 7.0.0)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 7.0.0)
- Newtonsoft.Json (>= 13.0.2)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
1.0.0 Added support for new message types
Added possibility to set:
* Json serializer settings when deserializing message
* Auto start processing messages on startup (default is true)
* Start or stop reading file changes (enables or disables reading / processing of new messages)
* Directory path (default is the same as default Journal files location)
Internal code changes
0.1.8 Added option to change journal directory