Skip to content

Commit

Permalink
1) Worked on sluggish movement after some time (no clue yet).
Browse files Browse the repository at this point in the history
2) Updated static data.
3) Aded safeguards to Geography.ExportAgents for a missing agent's data.
  • Loading branch information
wvdvegt committed Oct 25, 2023
1 parent fcee267 commit 826b0c4
Show file tree
Hide file tree
Showing 25 changed files with 796 additions and 710 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,4 @@ ModelManifest.xml
/tools/XmlGenerator/*.sqlite
/Remote.txt
/tools/XmlGenerator/sqlite-latest.sqlite.bz2
*.diff
8 changes: 4 additions & 4 deletions src/EVEMon.Common/Controls/ControlExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static bool IsDesignModeHosted(this Control control)
/// <param name="parent">The parent.</param>
public static void SuspendDrawing(this Control parent)
{
NativeMethods.SendMessage(parent.Handle, NativeMethods.WM_SETREDRAW, IntPtr.Zero, IntPtr.Zero);
//NativeMethods.SendMessage(parent.Handle, NativeMethods.WM_SETREDRAW, IntPtr.Zero, IntPtr.Zero);
}

/// <summary>
Expand All @@ -38,8 +38,8 @@ public static void SuspendDrawing(this Control parent)
/// <param name="parent">The parent.</param>
public static void ResumeDrawing(this Control parent)
{
NativeMethods.SendMessage(parent.Handle, NativeMethods.WM_SETREDRAW, (IntPtr)1, IntPtr.Zero);
parent.Refresh();
//NativeMethods.SendMessage(parent.Handle, NativeMethods.WM_SETREDRAW, (IntPtr)1, IntPtr.Zero);
//parent.Refresh();
}
}
}
}
4 changes: 0 additions & 4 deletions src/EVEMon.Common/Controls/NoFlickerListBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ public class NoFlickerListBox : ListBox
public NoFlickerListBox() : base()
{
pointerDown = DateTime.MinValue;

#warning VEG EXPERIMENT set doublebuffered to true.

DoubleBuffered = true;
}

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions src/EVEMon.Common/EveMonClient.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static partial class EveMonClient
/// Occurs when the collection of a character implant set changed.
/// </summary>
public static event EventHandler<CharacterChangedEventArgs> CharacterImplantSetCollectionChanged;

/// <summary>
/// Occurs when an account status has been updated.
/// </summary>
Expand Down Expand Up @@ -128,7 +128,7 @@ public static partial class EveMonClient
/// Occurs when a character info has been updated.
/// </summary>
public static event EventHandler<CharacterChangedEventArgs> CharacterInfoUpdated;

/// <summary>
/// Occurs when a character skill queue has been updated.
/// </summary>
Expand Down Expand Up @@ -263,7 +263,7 @@ public static partial class EveMonClient
/// Occurs when the notifications of a character have been updated.
/// </summary>
public static event EventHandler<CharacterChangedEventArgs> CharacterEVENotificationsUpdated;

/// <summary>
/// Occurs when the text of a character contacts have been updated.
/// </summary>
Expand Down Expand Up @@ -566,7 +566,7 @@ internal static void OnCharacterListUpdated(ESIKey esiKey)
Settings.Save();
CharacterListUpdated?.ThreadSafeInvoke(null, new ESIKeyInfoChangedEventArgs(esiKey));
}

/// <summary>
/// Called when the character implant set collection changed.
/// </summary>
Expand Down Expand Up @@ -932,7 +932,7 @@ internal static void OnCharacterEVENotificationsUpdated(Character character)
Settings.Save();
CharacterEVENotificationsUpdated?.ThreadSafeInvoke(null, new CharacterChangedEventArgs(character));
}

/// <summary>
/// Called when the character contacts updated.
/// </summary>
Expand Down
30 changes: 30 additions & 0 deletions src/EVEMon.Common/Extensions/EventHandlerExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Threading;

namespace EVEMon.Common.Extensions
{
Expand All @@ -22,9 +25,18 @@ public static void ThreadSafeInvoke(this EventHandler eventHandler, object sende
if (eventHandler == null)
return;

Stopwatch sw = new Stopwatch();
sw.Start();

Stopwatch time = new Stopwatch();
List<KeyValuePair<long, string>> timing = new List<KeyValuePair<long, string>>();

// Get each subscriber in turn
foreach (EventHandler handler in eventHandler.GetInvocationList().Cast<EventHandler>())
{
time.Reset();
time.Start();

// Get the object containing the subscribing method
// If the target doesn't implement ISyncronizeInvoke, this will be null
ISynchronizeInvoke sync = handler.Target as ISynchronizeInvoke;
Expand All @@ -36,13 +48,31 @@ public static void ThreadSafeInvoke(this EventHandler eventHandler, object sende
// This is preferable to using Invoke so that if an exception is thrown its presented
// in the context of the handler, not the current thread
IAsyncResult result = sync.BeginInvoke(handler, new[] { sender, e });
//veg
//Thread.Sleep(1);
sync.EndInvoke(result);
continue;
}

// No it doesn't, so invoke the handler directly
handler.Invoke(sender, e);

timing.Add(new KeyValuePair<long, string>(time.ElapsedTicks, $"{handler.Method.DeclaringType.FullName}.{handler.Method.Name}"));

//System.Windows.Forms.Application.DoEvents();

//veg
//Thread.Sleep(1);
}

sw.Stop();

foreach (KeyValuePair<long, string> kvp in timing.OrderBy(p => p.Key).Reverse().Take(5))
{
EveMonClient.Trace($"{kvp.Key} - {kvp.Value}");
}

EveMonClient.Trace($"ThreadSafeInvoke: { sw.ElapsedMilliseconds} ms for {eventHandler.GetInvocationList().Length} delegates");
}

/// <summary>
Expand Down
12 changes: 6 additions & 6 deletions src/EVEMon.Common/Resources/MD5Sums.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
c3e6655e8322fa6f3cf0632fe60786c9 *eve-blueprints-en-US.xml.gzip
1696c1353c8f093cc80e7fd8cb168802 *eve-blueprints-en-US.xml.gzip
540000f7c111354769a54fa31e57d411 *eve-certificates-en-US.xml.gzip
0d58b21ab445f316241589ef91fffc24 *eve-geography-en-US.xml.gzip
e4c1c54c78c0fa96ab5f794f910f9fec *eve-items-en-US.xml.gzip
f6d92ef6e5eff757d6243a2d7634e2ed *eve-geography-en-US.xml.gzip
60b547da64a2c8c8b25786e66de0bc19 *eve-items-en-US.xml.gzip
3668b50996fc40a0c0853fec427b5712 *eve-masteries-en-US.xml.gzip
1f6ae9f613fd26b08d5ec206d0958d79 *eve-properties-en-US.xml.gzip
adb83f4fc55f61a58548dcb924a91cfe *eve-reprocessing-en-US.xml.gzip
727a781211b138cf331afed346692962 *eve-skills-en-US.xml.gzip
d01964a405b26a8178c5bf6eb3d18024 *eve-properties-en-US.xml.gzip
f68c0ffcffb71e030264f3561d4ea711 *eve-reprocessing-en-US.xml.gzip
1d77a55aff0610b6200a18acb937dc12 *eve-skills-en-US.xml.gzip
Binary file modified src/EVEMon.Common/Resources/eve-blueprints-en-US.xml.gzip
Binary file not shown.
Binary file modified src/EVEMon.Common/Resources/eve-geography-en-US.xml.gzip
Binary file not shown.
Binary file modified src/EVEMon.Common/Resources/eve-items-en-US.xml.gzip
Binary file not shown.
Binary file modified src/EVEMon.Common/Resources/eve-properties-en-US.xml.gzip
Binary file not shown.
Binary file modified src/EVEMon.Common/Resources/eve-reprocessing-en-US.xml.gzip
Binary file not shown.
Binary file modified src/EVEMon.Common/Resources/eve-skills-en-US.xml.gzip
Binary file not shown.
8 changes: 6 additions & 2 deletions src/EVEMon.Common/Serialization/Flags.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<invFlags xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<invFlags xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<rowset name="flags" key="flagID" columns="flagID,flagName,flagText">
<row flagID="0" flagName="None" flagText="None" />
<row flagID="1" flagName="Wallet" flagText="Wallet" />
Expand Down Expand Up @@ -89,7 +89,7 @@
<row flagID="131" flagName="SubSystem6" flagText="Sub system slot 6" />
<row flagID="132" flagName="SubSystem7" flagText="Sub system slot 7" />
<row flagID="133" flagName="SpecializedFuelBay" flagText="Specialized Fuel Bay" />
<row flagID="134" flagName="SpecializedOreHold" flagText="Specialized Ore Hold" />
<row flagID="134" flagName="SpecializedAsteroidHold" flagText="Specialized Asteroid Hold" />
<row flagID="135" flagName="SpecializedGasHold" flagText="Specialized Gas Hold" />
<row flagID="136" flagName="SpecializedMineralHold" flagText="Specialized Mineral Hold" />
<row flagID="137" flagName="SpecializedSalvageHold" flagText="Specialized Salvage Hold" />
Expand Down Expand Up @@ -135,5 +135,9 @@
<row flagID="178" flagName="Raffles" flagText="Raffles Hangar" />
<row flagID="179" flagName="FrigateEscapeBay" flagText="Frigate escape bay Hangar" />
<row flagID="180" flagName="StructureDeedBay" flagText="Structure Deed Bay" />
<row flagID="181" flagName="SpecializedIceHold" flagText="Specialized Ice Hold" />
<row flagID="182" flagName="SpecializedAsteroidHold" flagText="Specialized Asteroid Hold" />
<row flagID="183" flagName="MobileDepot" flagText="Mobile Depot" />
<row flagID="184" flagName="CorpProjectsHangar" flagText="Corporation Projects Hangar" />
</rowset>
</invFlags>
2 changes: 1 addition & 1 deletion src/EVEMon.Common/Service/EveIDToName.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private static void Import(IEnumerable<SerializableCharacterNameListItem> entiti
private static Task UpdateOnOneSecondTickAsync()
{
// Is a save requested and is the last save older than 10s ?
if (s_savePending && DateTime.UtcNow > s_lastSaveTime.AddSeconds(10))
if (s_savePending && DateTime.UtcNow > s_lastSaveTime.AddSeconds(30))
return SaveImmediateAsync();

return Task.CompletedTask;
Expand Down
22 changes: 21 additions & 1 deletion src/EVEMon.Common/Threading/Dispatcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,32 @@ public static void Schedule(TimeSpan time, Action action)
timer.Start();
}

private static object locker = new object();

/// <summary>
/// Occurs on every second, when the timer ticks.
/// </summary>
private static void OneSecondTickTimer_Tick(object sender, EventArgs e)
{
EveMonClient.UpdateOnOneSecondTick();
s_oneSecondTimer.Stop();

if (Monitor.TryEnter(locker))
{
try
{
EveMonClient.UpdateOnOneSecondTick();
}
finally
{
Monitor.Exit(locker);
}
}
else
{
EveMonClient.Trace($"Skipped OneSecondTickTimer_Tick()");
}

s_oneSecondTimer.Start();
}
}
}
14 changes: 9 additions & 5 deletions src/EVEMon/CharacterMonitoring/CharacterMonitorBody.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,17 @@ private void OnDisposed(object sender, EventArgs e)
/// </summary>
private void UpdateFrequentControls()
{
SuspendLayout();
//veg
//SuspendLayout();
try
{
// Hides or shows the warning about a character with no API key
warningLabel.Visible = !m_character.Identity.ESIKeys.Any();
}
finally
{
ResumeLayout(false);
//veg
//ResumeLayout(false);
Refresh();
}
}
Expand All @@ -183,7 +185,8 @@ private void UpdateInfrequentControls()
if (!Visible)
return;

SuspendLayout();
//veg
//SuspendLayout();
try
{
// Reset the text filter
Expand Down Expand Up @@ -227,8 +230,9 @@ private void UpdateInfrequentControls()
}
finally
{
ResumeLayout(false);
Refresh();
//veg
//ResumeLayout(false);
//Refresh();
}
}

Expand Down
12 changes: 8 additions & 4 deletions src/EVEMon/CharacterMonitoring/CharacterMonitorFooter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,17 @@ private void OnDisposed(object sender, EventArgs e)
/// </summary>
private void UpdateFrequentControls()
{
SuspendLayout();
//veg
//SuspendLayout();
try
{
// Update the training controls
UpdateTrainingControls();
}
finally
{
ResumeLayout(false);
//veg
//ResumeLayout(false);
}
}

Expand Down Expand Up @@ -241,15 +243,17 @@ private void UpdateInfrequentControls()
if (!Visible)
return;

SuspendLayout();
//veg
//SuspendLayout();
try
{
// "Update Calendar" button
btnAddToCalendar.Visible = Settings.Calendar.Enabled;
}
finally
{
ResumeLayout(false);
//veg
//ResumeLayout(false);
}
}

Expand Down
Loading

0 comments on commit 826b0c4

Please sign in to comment.