fix(timers): Fixes multiple issue with timer wheel (#705)
* Fixed an issue where a timer truncated the link list. * Fixed an issue where a timer stopped and started itself within an OnTick causing it to remove itself from the link list, but still think it's running.
This commit is contained in:
parent
c2f853d8a8
commit
1d916fe2df
4 changed files with 68 additions and 71 deletions
|
|
@ -162,6 +162,8 @@ namespace Server
|
|||
using FileStream bin = new FileStream(dataPath, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||
BufferReader br = null;
|
||||
|
||||
var deleteAllFailures = false;
|
||||
|
||||
foreach (var entry in entities)
|
||||
{
|
||||
T t = entry.Entity;
|
||||
|
|
@ -210,11 +212,21 @@ namespace Server
|
|||
Console.WriteLine($"***** Bad deserialize of {t.GetType()} *****");
|
||||
Console.WriteLine(error);
|
||||
|
||||
Console.WriteLine("Delete the object and continue? (y/n)");
|
||||
ConsoleKey pressedKey;
|
||||
|
||||
if (Console.ReadKey(true).Key != ConsoleKey.Y)
|
||||
if (!deleteAllFailures)
|
||||
{
|
||||
throw new Exception("Deserialization failed.");
|
||||
Console.WriteLine("Delete the object and continue? (y/n/a)");
|
||||
pressedKey = Console.ReadKey(true).Key;
|
||||
|
||||
if (pressedKey == ConsoleKey.A)
|
||||
{
|
||||
deleteAllFailures = true;
|
||||
}
|
||||
else if (pressedKey != ConsoleKey.Y)
|
||||
{
|
||||
throw new Exception("Deserialization failed.");
|
||||
}
|
||||
}
|
||||
|
||||
t.Delete();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue