fix(core): Tightens the network stack (#479)
- [X] Removes network pause/resume - [X] Adds back packet profiler - [X] Adds state machine to keep track and trace netstates - [X] Changes NetState.Running back to using an interlock exchange - [X] Adds preliminary packet throttling support ### Packet Throttling - `[GetThrottle <packetId>` to get the delay in milliseconds for that packet - `[SetThrottle <packetId> <delay>` to set the delay in milliseconds for that packet The settings are saved to `Configuration/throttles.json`
This commit is contained in:
parent
1736469ac0
commit
8903028b5f
36 changed files with 1018 additions and 405 deletions
|
|
@ -911,14 +911,13 @@ namespace Server.Commands.Generic
|
|||
if (list.Count > 20)
|
||||
{
|
||||
CommandLogging.Enabled = false;
|
||||
NetState.Pause();
|
||||
NetState.FlushAll();
|
||||
}
|
||||
|
||||
base.ExecuteList(e, list);
|
||||
|
||||
if (list.Count > 20)
|
||||
{
|
||||
NetState.Resume();
|
||||
flushToLog = true;
|
||||
CommandLogging.Enabled = true;
|
||||
}
|
||||
|
|
@ -1250,7 +1249,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
AddResponse($"They have been {(m_Ban ? "banned" : "kicked")}.");
|
||||
|
||||
targState.Disconnect();
|
||||
targState.Disconnect($"Banned by {from}.");
|
||||
|
||||
if (m_Ban)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -201,15 +201,13 @@ namespace Server.Commands
|
|||
list.Count == 1 ? "" : "s"
|
||||
);
|
||||
|
||||
NetState.Pause();
|
||||
NetState.FlushAll();
|
||||
|
||||
for (var i = 0; i < list.Count; ++i)
|
||||
{
|
||||
list[i].Delete();
|
||||
}
|
||||
|
||||
NetState.Resume();
|
||||
|
||||
from.SendMessage("You have deleted {0} object{1}.", list.Count, list.Count == 1 ? "" : "s");
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ using Server.Engines.Quests.Haven;
|
|||
using Server.Engines.Quests.Necro;
|
||||
using Server.Engines.Spawners;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Utilities;
|
||||
|
||||
namespace Server.Commands
|
||||
|
|
@ -27,6 +28,8 @@ namespace Server.Commands
|
|||
|
||||
m_Mobile.SendMessage("Generating world decoration, please wait.");
|
||||
|
||||
NetState.FlushAll();
|
||||
|
||||
Generate("Data/Decoration/Britannia", Map.Trammel, Map.Felucca);
|
||||
Generate("Data/Decoration/Trammel", Map.Trammel);
|
||||
Generate("Data/Decoration/Felucca", Map.Felucca);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using Server.Engines.Quests.Haven;
|
|||
using Server.Engines.Quests.Necro;
|
||||
using Server.Engines.Spawners;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
using Server.Utilities;
|
||||
|
||||
namespace Server.Commands
|
||||
|
|
@ -28,6 +29,8 @@ namespace Server.Commands
|
|||
|
||||
m_Mobile.SendMessage("Generating world decoration, please wait.");
|
||||
|
||||
NetState.FlushAll();
|
||||
|
||||
Generate("Data/Decoration/RuinedMaginciaTram", Map.Trammel);
|
||||
Generate("Data/Decoration/RuinedMaginciaFel", Map.Felucca);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ using System.IO;
|
|||
using System.Text.Json.Serialization;
|
||||
using Server.Items;
|
||||
using Server.Json;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
|
|
@ -68,6 +69,9 @@ namespace Server.Commands
|
|||
var from = e.Mobile;
|
||||
|
||||
from.SendMessage("Generating teleporters, please wait.");
|
||||
|
||||
NetState.FlushAll();
|
||||
|
||||
var c = new TeleportersCreator();
|
||||
|
||||
if (!ProcessTeleporterData(from, c.CreateTeleporter))
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Server.Items;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
|
|
@ -28,6 +29,8 @@ namespace Server.Commands
|
|||
var list = new List<SignEntry>();
|
||||
from.SendMessage("Generating signs, please wait.");
|
||||
|
||||
NetState.FlushAll();
|
||||
|
||||
using (var ip = new StreamReader(cfg))
|
||||
{
|
||||
string line;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue