Giter Club home page Giter Club logo

eliteapi's Introduction

HelloWorld(); โœŒ๏ธ


An idiot admires complexity, a genius admires simplicity.

Total Time: 517 hrs 24 mins

C#                138 hrs 18 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   23.39 %
Rust              134 hrs 15 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   22.71 %
Svelte            113 hrs 40 mins โ–ˆโ–ˆโ–ˆโ–ˆโ–“โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   19.23 %
Other             73 hrs 52 mins  โ–ˆโ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   12.49 %
TypeScript        47 hrs 33 mins  โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   08.04 %
github contribution grid snake animation

eliteapi's People

Contributors

arwwarrr avatar codacy-badger avatar codingale avatar dependabot[bot] avatar dfc02187713 avatar filtik avatar fmjensen avatar github-actions[bot] avatar imgbotapp avatar leander-van-boven avatar silkypants avatar somfic avatar whalley64 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eliteapi's Issues

The logging severity level order are confusing to me.

EliteAPI.Logger.UseConsole(Severity Level) are ordered like

   Success = 0,
   Error = 1,
   Warning = 2,
   Info = 3,
   Debug = 4,
   Special = 5

This hurts my brain ;-) so i ask if there is a chance these levels cound be ordered like:

   No Logging = 0
   Success = 1,
   Info = 2,
   Warning = 3,
   Error = 4,
   Debug = 5,
   Special = 6

Where 0 would turn logging completely off.
I may be misunderstanding somthing about the logging, but I cant seem to turn logging completely off if it have been enabled...

Happy NewYear!! :-)

Support for Status.json

Hi, I would like support for the status.json file, and maybe the other .json files, in EliteAPI. I'm using this library right now and it works flawlessly, but it's missing some data that would be really nice to have.

Cheers,
Morgan

Journal monitor will not work in some cases

Current implementation of detecting Elite's journal folder will not work when:

  • User name does not match user folder name
  • Saved games folder name is localized
  • User profile folder is on a different drive

Ref: https://github.com/EliteAPI/EliteAPI/blob/c55d8cb1548c05bf7bd7f7c980c961e515b66669/EliteAPI/EliteDangerousAPI.cs#L33

Correct way to implement this would be using SHGetKnownFolderPath
https://github.com/DarkWanderer/Elite-Log-Agent/blob/414cfe9a2c4947a1fd8f5ccfc4e9a09abc8716df/Controller/SavedGamesDirectoryHelper.cs

Configuring Severity.Debug or higher leads to System.StackOverflowException

This is the output in console when using
EliteAPI.Logger.UseConsole(Severity.Debug);
as configuration:

Debug   โ”€  EliteAPI by CMDR Somfic (discord.gg/jwpFUPZ) (github.com/EliteAPI/EliteAPI).
Debug   โ”€  EliteAPI v2.2.23.879.
Debug   โ”€  Checking for updates from GitHub.
Debug   โ”€  Latest version: 2.2.23.879 (curr. 2.2.23.879).
Debug   โ”€  EliteAPI is up-to-date with the latest version.
Info    โ”€  Journal directory set to 'C:\Users\<USERNAME>\Saved Games\Frontier Developments\Elite Dangerous'.
Debug   โ”€  Searching for 'Journal.*.log' files.
Debug   โ”€  Found 'Journal.191222135652.01.log'.
Debug   โ”€  Found 'Status.json'.
Debug   โ”€  Found 'Cargo.json'.
Debug   โ”€  Found 'Shipyard.json'.
Debug   โ”€  Found 'Outfitting.json'.
Debug   โ”€  Found 'Market.json'.
Debug   โ”€  Found 'ModulesInfo.json'.
Info    โ”€  Found Journal and Status files.
Warning โ”€  Elite: Dangerous is not in-game.
Debug   โ”€  Catching up with past events from this session.
Debug   โ”€  Processing event 'Fileheader'.
Debug
Process is terminated due to StackOverflowException.

Some data to share ...

don't know how to contact you, so this is the easiest way.
I am working on some journal programming and want to share the event data i collected
I Filtered each event i have encountered over the last six months, and added them in a google sheet.
(note the timestamps are replaced with ID) each event has 2 rows: first is the fieldnames, second the values.

I hope I can help you a bit with your work.
https://docs.google.com/spreadsheets/d/1F2iLmPsce8iHYtYTCGQsHkLzVY_VJWhliyRbecCsuqU/edit?usp=sharing

Greetings Saturnine

Null exception when Status.json not found.

Orginial issue taken from StackOverFlow by Paul Draper.

I'm attempting to use the API provided by https://github.com/EliteAPI/EliteAPI, and have created a simple application as per the example provided on . This was working exactly as expected yesterday, until for some reason my desktop crashed, and since then the application crashes with a NullReferenceException whenever it tries to create a new EliteDangerousAPI object:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

using EliteAPI;
using EliteAPI.Events;

namespace Elite_PI_Server
{
    class Program
    {
        private static EliteDangerousAPI EliteAPI;

        static void Main(string[] args)
        {
            DirectoryInfo playerJournalFolder = new DirectoryInfo(
            $@"C:\Users\{Environment.UserName}\Saved Games\Frontier 
Developments\Elite Dangerous");

            EliteAPI = new EliteDangerousAPI( playerJournalFolder );

            EliteAPI.Start();
        }
    }
}

I stripped the code down to the above, I had a friend test this code on his machine, and it runs fine. It ran fine on my machine until the crash I spoke of.

System.NullReferenceException
  HResult=0x80004003
  Message=Object reference not set to an instance of an object.
  Source=EliteAPI
  StackTrace:
   at EliteAPI.Status.StatusWatcher.Update()
   at EliteAPI.Status.StatusWatcher..ctor(EliteDangerousAPI api)
   at EliteAPI.EliteDangerousAPI.Reset()
   at EliteAPI.EliteDangerousAPI..ctor(DirectoryInfo JournalDirectory, Boolean SkipCatchUp)
   at Elite_PI_Server.Program.Main(String[] args) in     C:\Users\paul\source\repos\Elite-PI-Server-Console\Elite-PI-Server\Program.cs:line 22

For reference, i'm using Visual Studio Community Edition 2017 15.9.7. Any suggestions as to what I could try would be appreciated.

Considering the code was proven to work on another machine, I've attempted a few other heavy-handed methods which might seem a bit overkill:

I've tried uninstalling the nuget package for EliteAPI, clearing the nuget package cache and reinstalling.

I've tried completely reinstalling Visual Studio, and cleaning up the install with https://github.com/Microsoft/VisualStudioUninstaller.

Any suggestions would be highly appreciated. I feel like either something has become corrupt when my machine died, or i'm doing something stupid.

SAASignalsFound event missing

Hello, me again. Found another missing event.
Journal entry: { "timestamp":"2020-08-21T13:40:27Z", "event":"SAASignalsFound", "BodyName":"TZ Arietis 3 A Ring", "SystemAddress":13864825529761, "BodyID":25, "Signals":[ { "Type":"Monazite", "Count":1 }, { "Type":"Platinum", "Count":2 }, { "Type":"Painite", "Count":1 } ] }

Target invocation Exception

 Could not convert json to EventBase
  Target invocation  - Exception has been thrown by the target of an invocation.

 [{Json: { "timestamp":"2020-08-29T13:07:58Z", "event":"ShipTargeted", "TargetLocked":true, "Ship":"
 anaconda", "ScanStage":1, "PilotName":"$cmdr_decorate:#name=Tinvanno [RoA];", "PilotName_Localised"
 :"CMDR Tinvanno [RoA]", "PilotRank":"Elite", "SquadronID":"ROAR" }}]

  Json reader  - Could not convert string to integer: ROAR. Path 'SquadronID', line 1, position 254.
 1: at EliteAPI.Event.Provider.EventProvider.ProcessJsonEvent(String json)
 2: at EliteAPI.Event.Provider.EventProvider.InvokeFromJsonMethod(MethodBase method, String json)
 3: at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder,
 Object[] parameters, CultureInfo culture)
 4: at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters,
 Object[] arguments)
 5: at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig,
 Boolean constructor)```

Make EliteAPI implement interfaces

Hi,

I'm working on a little project with your API which is great by the way and I think it would be nice if EliteAPI came packaged with interfaces like IEliteDangerousAPI for dependency injection for example.

Deluge of [WARN]s - good luck

Under normal operation, there are lots of warnings from the API. I have collated all the warnings from my output into two lists, one being vastly smaller than the other. I have tried to keep duplicates to a minimum for brevity, but it is possible I missed some. (There were tons of repetitive Pip warnings)

List including tracebacks: https://pastebin.com/jDUKYSs1

Condensed list: https://pastebin.com/VAJmD7YS

Hope this is useful, or if you already knew about this then perhaps it could be a checklist.

Events passed to AllEvents from JournalParser are JSON objects

I noticed on startup - that the event passed from the JournalParser.ProcessJson method is the raw JSON object, as opposed to the event that is parsed parsedEvent.

This seems like the event object that is parsed successfully should also be passed along to the AllEvents handler, as the individual event handler is fired with this same object as well.

See: #43

missing fields from more recent ED log versions ?

see changelog in :

http://hosting.zaonce.net/community/journal/v26/Journal-Manual-v26.pdf

I'm not seeing for example :

MissionAcceptedInfo:
DestinationStation
NewDestinationSystem
NewDestinationStation
Wing
Donation
Donated
Target
TargetType
TargetFaction
KillCount

CargoInfo:
CollectCargoInfo:
EjectCargoInfo:
MissionId

FSDJumpInfo
Body

3 new status flags:
29 536870912 2000 0000 Altitude from Average radius
30 1073741824 4000 0000 fsdJump
31 2147483648 8000 0000 srvHighBeam

etc.

Buildtools renames JsonProperties to ...Info

{ "timestamp":"2020-12-23T12:13:22Z", "event":"CarrierStats", "CarrierID":3704238848, "Callsign":"J5G-61H", "Name":"ASCENSION", "DockingAccess":"friends", "AllowNotorious":true, "FuelLevel":632, "JumpRangeCurr":500.000000, "JumpRangeMax":500.000000, "PendingDecommission":false, "SpaceUsage":{ "TotalCapacity":25000, "Crew":930, "Cargo":78, "CargoSpaceReserved":0, "ShipPacks":0, "ModulePacks":0, "FreeSpace":23992 }, "Finance":{ "CarrierBalance":151643910, "ReserveBalance":47556164, "AvailableBalance":104087746, "ReservePercent":31, "TaxRate":100 }, "Crew":[ { "CrewRole":"BlackMarket", "Activated":false }, { "CrewRole":"Captain", "Activated":true, "Enabled":true, "CrewName":"Fred Bloggs" }, { "CrewRole":"Refuel", "Activated":true, "Enabled":true, "CrewName":"Janely Anthony" }, { "CrewRole":"Repair", "Activated":true, "Enabled":true, "CrewName":"Kenley Clayton" }, { "CrewRole":"Rearm", "Activated":true, "Enabled":true, "CrewName":"Claire Combs" }, { "CrewRole":"Commodities", "Activated":true, "Enabled":true, "CrewName":"Fred Bloggs" }, { "CrewRole":"VoucherRedemption", "Activated":false }, { "CrewRole":"Exploration", "Activated":false }, { "CrewRole":"Shipyard", "Activated":false }, { "CrewRole":"Outfitting", "Activated":false }, { "CrewRole":"CarrierFuel", "Activated":true, "Enabled":true, "CrewName":"Fred Bloggs" } ], "ShipPacks":[  ], "ModulePacks":[  ] }

StationType enum is incomplete

The StationType enum is missing both Ocellus and FleetCarrier entries, causing a crash when docking at either of those station types.
I also noticed that the DockingDeniedReason is missing a RestrictedAccess entry for when Fleet Carriers deny you access.

Keybindings support

Read the set keybindings and output them like in 2.3.

Perhaps use variable keypresses for the VA plugin?

I get "Could not invoke status event 'HasLatlong'" after EliteAPI.Start()

This shows up in the console:
Error โ”ฌ Could not invoke status event 'HasLatlong', it might not have been added yet. โ”œ Object reference not set to an instance of an object. โ•ž at EliteAPI.Status.StatusWatcher.TriggerIfDifferent(GameStatus oldStatus, GameStatus newStatus)

Logging is configured like EliteAPI.Logger.UseConsole(Severity.Info)

Am i doing something wrong?

Event for ship status?

Hi, this library seems great so far!

Is there an event for the change of the ship status?
I hope I can detect when my ship is not masslocked anymore.

EliteMacro seems to disrupt VoiceMacro installation

Steps: I installed VoiceMacro 1.3.1, then installed EliteMacro v2.2.14.870. When running VoiceMacro I now receive this error:

image

Exiting that shows:

image

Having the installer in the same folder seems to resolve the issue. I ran the repair tool and I can now use the tool as expected.

image

Add logging event

Create event for logging, which can be used for EliteVA and console logging.

Crash on NavRoute event

[23:05:58.021 TRACE] [EliteAPI.Event.Provider.EventProvider]
Could not convert json to EventBase
Key not found - The given key was not present in the dictionary.
[{Json: { "timestamp":"2020-08-19T21:59:09Z", "event":"NavRoute" }}]
1: at EliteAPI.Event.Provider.EventProvider.ProcessJsonEvent(String json)
2: at EliteAPI.Event.Provider.EventProvider.GetFromJsonMethod(String eventName)
3: at System.Collections.Concurrent.ConcurrentDictionary`2.get_Item(TKey key)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.