Skip to content

Commit

Permalink
add additional crash logging, no new functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mhwlng committed Aug 10, 2021
1 parent cb64ba2 commit 22103be
Show file tree
Hide file tree
Showing 81 changed files with 340 additions and 537 deletions.
1 change: 1 addition & 0 deletions Elite/App.xaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Application x:Class="Elite.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
DispatcherUnhandledException ="AppDispatcherUnhandledException"
ShutdownMode="OnExplicitShutdown">
<Application.Resources>

Expand Down
28 changes: 28 additions & 0 deletions Elite/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
using SharpDX.DirectInput;
using System.Collections.Specialized;
using System.Linq;
using System.Windows.Threading;


// ReSharper disable StringLiteralTypo
Expand Down Expand Up @@ -273,8 +274,35 @@ private static void MigrateSettings()
}
}


void AppDomainUnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs ea)
{
Exception ex = (Exception)ea.ExceptionObject;

Log.Error($"AppDomainUnhandledExceptionHandler: {ex}");
}

void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
{
Log.Error($"Application_ThreadException: {e.Exception}");

}

void AppDispatcherUnhandledException(object
sender, DispatcherUnhandledExceptionEventArgs e)
{
Log.Error($"AppDispatcherUnhandledException: {e.Exception}");
}

protected override void OnStartup(StartupEventArgs evtArgs)
{

AppDomain.CurrentDomain.UnhandledException += AppDomainUnhandledExceptionHandler;

System.Windows.Forms.Application.ThreadException += Application_ThreadException;

Application.Current.DispatcherUnhandledException += AppDispatcherUnhandledException;

const string appName = "Fip-Elite";

_mutex = new Mutex(true, appName, out var createdNew);
Expand Down
36 changes: 18 additions & 18 deletions Elite/Data.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,24 +503,24 @@ public static void HandleStatusEvents(object sender, StatusFileEvent evt)
StatusData.Pips[1] = evt.Pips.Engine;
StatusData.Pips[2] = evt.Pips.Weapons;

StatusData.OnFoot = (evt.Flags2 & StatusFlags2.OnFoot) != 0;
StatusData.InTaxi = (evt.Flags2 & StatusFlags2.InTaxi) != 0;
StatusData.InMulticrew = (evt.Flags2 & StatusFlags2.InMulticrew) != 0;
StatusData.OnFootInStation = (evt.Flags2 & StatusFlags2.OnFootInStation) != 0;
StatusData.OnFootOnPlanet = (evt.Flags2 & StatusFlags2.OnFootOnPlanet) != 0;
StatusData.AimDownSight = (evt.Flags2 & StatusFlags2.AimDownSight) != 0;
StatusData.LowOxygen = (evt.Flags2 & StatusFlags2.LowOxygen) != 0;
StatusData.LowHealth = (evt.Flags2 & StatusFlags2.LowHealth) != 0;
StatusData.Cold = (evt.Flags2 & StatusFlags2.Cold) != 0;
StatusData.Hot = (evt.Flags2 & StatusFlags2.Hot) != 0;
StatusData.VeryCold = (evt.Flags2 & StatusFlags2.VeryCold) != 0;
StatusData.VeryHot = (evt.Flags2 & StatusFlags2.VeryHot) != 0;

StatusData.GlideMode = (evt.Flags2 & StatusFlags2.GlideMode) != 0;
StatusData.OnFootInHangar = (evt.Flags2 & StatusFlags2.OnFootInHangar) != 0;
StatusData.OnFootSocialSpace = (evt.Flags2 & StatusFlags2.OnFootSocialSpace) != 0;
StatusData.OnFootExterior = (evt.Flags2 & StatusFlags2.OnFootExterior) != 0;
StatusData.BreathableAtmosphere = (evt.Flags2 & StatusFlags2.BreathableAtmosphere) != 0;
StatusData.OnFoot = (evt.Flags2 & MoreStatusFlags.OnFoot) != 0;
StatusData.InTaxi = (evt.Flags2 & MoreStatusFlags.InTaxi) != 0;
StatusData.InMulticrew = (evt.Flags2 & MoreStatusFlags.InMulticrew) != 0;
StatusData.OnFootInStation = (evt.Flags2 & MoreStatusFlags.OnFootInStation) != 0;
StatusData.OnFootOnPlanet = (evt.Flags2 & MoreStatusFlags.OnFootOnPlanet) != 0;
StatusData.AimDownSight = (evt.Flags2 & MoreStatusFlags.AimDownSight) != 0;
StatusData.LowOxygen = (evt.Flags2 & MoreStatusFlags.LowOxygen) != 0;
StatusData.LowHealth = (evt.Flags2 & MoreStatusFlags.LowHealth) != 0;
StatusData.Cold = (evt.Flags2 & MoreStatusFlags.Cold) != 0;
StatusData.Hot = (evt.Flags2 & MoreStatusFlags.Hot) != 0;
StatusData.VeryCold = (evt.Flags2 & MoreStatusFlags.VeryCold) != 0;
StatusData.VeryHot = (evt.Flags2 & MoreStatusFlags.VeryHot) != 0;

StatusData.GlideMode = (evt.Flags2 & MoreStatusFlags.GlideMode) != 0;
StatusData.OnFootInHangar = (evt.Flags2 & MoreStatusFlags.OnFootInHangar) != 0;
StatusData.OnFootSocialSpace = (evt.Flags2 & MoreStatusFlags.OnFootSocialSpace) != 0;
StatusData.OnFootExterior = (evt.Flags2 & MoreStatusFlags.OnFootExterior) != 0;
StatusData.BreathableAtmosphere = (evt.Flags2 & MoreStatusFlags.BreathableAtmosphere) != 0;

var shipData = Ships.GetCurrentShip();
if (shipData != null)
Expand Down
4 changes: 2 additions & 2 deletions Elite/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.6.0")]
[assembly: AssemblyFileVersion("1.8.6.0")]
[assembly: AssemblyVersion("1.8.7.0")]
[assembly: AssemblyFileVersion("1.8.7.0")]

[assembly: log4net.Config.XmlConfigurator(Watch = true)]
7 changes: 2 additions & 5 deletions EliteJournalReader/Events/BookDropshipEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@

namespace EliteJournalReader.Events
{
//The "BookDropship" event contains:

/*
*/
public class BookDropshipEvent : JournalEvent<BookDropshipEvent.BookDropshipEventArgs>
{
public BookDropshipEvent() : base("BookDropship") { }

public class BookDropshipEventArgs : JournalEventArgs
{
public long Cost { get; set; }

public string DestinationSystem { get; set; }

public string DestinationLocation { get; set; }
}
}
Expand Down
10 changes: 2 additions & 8 deletions EliteJournalReader/Events/BookTaxiEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,16 @@

namespace EliteJournalReader.Events
{
//The "BookTaxi" event contains:

/*
{"timestamp":"2021-03-31T22:00:17Z","event":"BookTaxi",
"Cost":100,
"DestinationSystem":"Adityan",
"DestinationLocation":"Konscak Penal colony"}
*/
public class BookTaxiEvent : JournalEvent<BookTaxiEvent.BookTaxiEventArgs>
{
public BookTaxiEvent() : base("BookTaxi") { }

public class BookTaxiEventArgs : JournalEventArgs
{
public long Cost { get; set; }

public string DestinationSystem { get; set; }

public string DestinationLocation { get; set; }
}
}
Expand Down
8 changes: 4 additions & 4 deletions EliteJournalReader/Events/BountyEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ namespace EliteJournalReader.Events
{
// When written: player is awarded a bounty for a kill
//Parameters:
// Rewards: an array of Faction names and the Reward values, as the target can have multiple bounties payable by different factions
// VictimFaction: the victims faction
// TotalReward
// SharedWithOthers: if credit for the kill is shared with other players, this has the number of other players involved
// Rewards: an array of Faction names and the Reward values, as the target can have multiple bounties payable by different factions
// VictimFaction: the victims faction
// TotalReward
// SharedWithOthers: if credit for the kill is shared with other players, this has the number of other players involved
public class BountyEvent : JournalEvent<BountyEvent.BountyEventArgs>
{
public BountyEvent() : base("Bounty") { }
Expand Down
12 changes: 1 addition & 11 deletions EliteJournalReader/Events/BuyMicroResourcesEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,6 @@

namespace EliteJournalReader.Events
{
//The "BuyMicroResources" event contains:

/*
{"timestamp":"2021-03-31T20:02:53Z","event":"BuyMicroResources",
"Name":"amm_grenade_shield",
"Name_Localised":"Shield Projector",
"Category":"Consumable",
"Count":1,
"Price":2000,
"MarketID":3221558784}
*/
public class BuyMicroResourcesEvent : JournalEvent<BuyMicroResourcesEvent.BuyMicroResourcesEventArgs>
{
public BuyMicroResourcesEvent() : base("BuyMicroResources") { }
Expand All @@ -27,6 +16,7 @@ public class BuyMicroResourcesEventArgs : JournalEventArgs
public string Name { get; set; }
public string Name_Localised { get; set; }
public string Category { get; set; }
public string Category_Localised { get; set; }
public int Count { get; set; }
public long Price { get; set; }
public long MarketID { get; set; }
Expand Down
10 changes: 3 additions & 7 deletions EliteJournalReader/Events/BuySuitEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,18 @@

namespace EliteJournalReader.Events
{
//The "BuySuit" event contains:

/*
{ "timestamp":"2021-04-10T12:13:43Z", "event":"BuySuit", "Name":"UtilitySuit_Class1", "Name_Localised":"Maverick Suit", "Price":150000 }
*/
public class BuySuitEvent : JournalEvent<BuySuitEvent.BuySuitEventArgs>
{
public BuySuitEvent() : base("BuySuit") { }

public class BuySuitEventArgs : JournalEventArgs
{
{
public string Name { get; set; }
public string Name_Localised { get; set; }
public long Price { get; set; }

public string SuitID { get; set; }

public string[] SuitMods { get; set; }
}
}
}
15 changes: 3 additions & 12 deletions EliteJournalReader/Events/BuyWeaponEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,18 @@

namespace EliteJournalReader.Events
{
//The "BuyWeapon" event contains:

/*
{"timestamp":"2021-03-31T10:24:47Z","event":"BuyWeapon",
"Name":"Wpn_M_Launcher_Rocket_SAuto",
"Name_Localised":"Karma L-6",
"Price":175000}
*/
public class BuyWeaponEvent : JournalEvent<BuyWeaponEvent.BuyWeaponEventArgs>
{
public BuyWeaponEvent() : base("BuyWeapon") { }

public class BuyWeaponEventArgs : JournalEventArgs
{
{
public string Name { get; set; }
public string Name_Localised { get; set; }
public long Price { get; set; }

public string SuitModuleID { get; set; }

public int Class { get; set; }
public string Class { get; set; }
public string[] WeaponMods { get; set; }
}
}
}
5 changes: 0 additions & 5 deletions EliteJournalReader/Events/CancelDropshipEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

namespace EliteJournalReader.Events
{
//The "CancelDropship" event contains:
/*
*/

public class CancelDropshipEvent : JournalEvent<CancelDropshipEvent.CancelDropshipEventArgs>
{
public CancelDropshipEvent() : base("CancelDropship") { }
Expand Down
6 changes: 0 additions & 6 deletions EliteJournalReader/Events/CancelTaxiEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@

namespace EliteJournalReader.Events
{
//The "CancelTaxi" event contains:
/*
{"timestamp":"2021-03-31T19:14:46Z","event":"CancelTaxi",
"Refund":100}
*/

public class CancelTaxiEvent : JournalEvent<CancelTaxiEvent.CancelTaxiEventArgs>
{
public CancelTaxiEvent() : base("CancelTaxi") { }
Expand Down
2 changes: 1 addition & 1 deletion EliteJournalReader/Events/CarrierJumpRequestEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ namespace EliteJournalReader.Events
{
//When written: If you should ever reset your game
//Parameters:
// Name: commander name
// Name: commander name
public class CarrierJumpRequestEvent : JournalEvent<CarrierJumpRequestEvent.CarrierJumpRequestEventArgs>
{
public CarrierJumpRequestEvent() : base("CarrierJumpRequest") { }
Expand Down
4 changes: 2 additions & 2 deletions EliteJournalReader/Events/CollectCargoEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace EliteJournalReader.Events
{
//When Written: when scooping cargo from space or planet surface
//Parameters:
// Type: cargo type
// Stolen: whether stolen goods
// Type: cargo type
// Stolen: whether stolen goods
public class CollectCargoEvent : JournalEvent<CollectCargoEvent.CollectCargoEventArgs>
{
public CollectCargoEvent() : base("CollectCargo") { }
Expand Down
9 changes: 2 additions & 7 deletions EliteJournalReader/Events/CollectItemsEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,19 @@

namespace EliteJournalReader.Events
{
//The "CollectItems" event contains:

/*
* { "timestamp":"2021-05-02T08:43:16Z", "event":"CollectItems", "Name":"personaldocuments", "Name_Localised":"Personal Documents", "Type":"Item", "OwnerID":0, "Count":1, "Stolen":false }
*/
public class CollectItemsEvent : JournalEvent<CollectItemsEvent.CollectItemsEventArgs>
{
public CollectItemsEvent() : base("CollectItems") { }

public class CollectItemsEventArgs : JournalEventArgs
{
{
public string Name { get; set; }
public string Name_Localised { get; set; }
public string Type { get; set; }
public string Type_Localised { get; set; }
public long OwnerID { get; set; }
public int Count { get; set; }
public bool Stolen { get; set; }

}
}
}
17 changes: 2 additions & 15 deletions EliteJournalReader/Events/CreateSuitLoadoutEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@

namespace EliteJournalReader.Events
{
//The "CreateSuitLoadout" event contains:

/*
{"timestamp":"2021-03-31T10:30:33Z","event":"CreateSuitLoadout",
"LoadoutID":4293000003,
"LoadoutName":"Rocket Launcher with Kinetic Side Arm",
"Modules":[
{"SlotName":"PrimaryWeapon1",
"ModuleName":"wpn_m_launcher_rocket_sauto",
"ModuleName_Localised":"Karma L-6"},
]}
*/

public class CreateSuitLoadoutEvent : JournalEvent<CreateSuitLoadoutEvent.CreateSuitLoadoutEventArgs>
{
public CreateSuitLoadoutEvent() : base("CreateSuitLoadout") { }
Expand All @@ -37,8 +24,8 @@ public struct Module
public string SuitName { get; set; }
public string LoadoutID { get; set; }
public string LoadoutName { get; set; }

public Module[] Modules { get; set; }
public List<Module> Modules { get; set; }
public string[] SuitMods;
}
}
}
6 changes: 3 additions & 3 deletions EliteJournalReader/Events/CrewAssignEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ namespace EliteJournalReader.Events
{
//When Written: when changing the task assignment of a member of crew
//Parameters:
// Name
// Role
// Name
// Role
public class CrewAssignEvent : JournalEvent<CrewAssignEvent.CrewAssignEventArgs>
{
public CrewAssignEvent() : base("CrewAssign") { }

public class CrewAssignEventArgs : JournalEventArgs
{
public string Name { get; set; }
public int CrewID { get; set; }
public long CrewID { get; set; }
public string Role { get; set; }
}
}
Expand Down
4 changes: 2 additions & 2 deletions EliteJournalReader/Events/CrewFireEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ namespace EliteJournalReader.Events
{
//When Written: when dismissing a member of crew
//Parameters:
// Name
// Name
public class CrewFireEvent : JournalEvent<CrewFireEvent.CrewFireEventArgs>
{
public CrewFireEvent() : base("CrewFire") { }

public class CrewFireEventArgs : JournalEventArgs
{
public string Name { get; set; }
public int CrewID { get; set; }
public long CrewID { get; set; }
}
}
}
Loading

0 comments on commit 22103be

Please sign in to comment.