Replacing Networking (#271)
- [X] Removing Kestrel & Libuv - [X] Cleaning up NetState - [X] Removing System.IO.Pipelines - [X] Cleaning up packet reading - [X] Adds a maximum of 5000 sockets (configurable) to prevent OOM - [X] Replaces the AsyncState with a thread-safe wrapped boolean called NetworkState - [X] Removes Parallel.ForEach (no perf gain) - [X] Removes custom houses compression on another thread - [X] Test high load scenarios Bumps release version
This commit is contained in:
parent
8603e31023
commit
369a27b800
47 changed files with 1780 additions and 1569 deletions
|
|
@ -1,9 +1,8 @@
|
|||
using System;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class ProtocolExtensions
|
||||
public static class ProtocolExtensions
|
||||
{
|
||||
private static readonly PacketHandler[] m_Handlers = new PacketHandler[0x100];
|
||||
|
||||
|
|
@ -17,15 +16,8 @@ namespace Server.Misc
|
|||
m_Handlers[packetID] = new PacketHandler(packetID, 0, ingame, onReceive);
|
||||
}
|
||||
|
||||
public static PacketHandler GetHandler(int packetID)
|
||||
{
|
||||
if (packetID >= 0 && packetID < m_Handlers.Length)
|
||||
{
|
||||
return m_Handlers[packetID];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
public static PacketHandler GetHandler(int packetID) =>
|
||||
packetID >= 0 && packetID < m_Handlers.Length ? m_Handlers[packetID] : null;
|
||||
|
||||
public static void DecodeBundledPacket(NetState state, PacketReader reader)
|
||||
{
|
||||
|
|
@ -37,9 +29,8 @@ namespace Server.Misc
|
|||
{
|
||||
if (ph.Ingame && state.Mobile == null)
|
||||
{
|
||||
Console.WriteLine(
|
||||
"Client: {0}: Sent ingame packet (0xF0x{1:X2}) before having been attached to a mobile",
|
||||
state,
|
||||
state.WriteConsole(
|
||||
"Sent ingame packet (0xF0x{0:X2}) before having been attached to a mobile",
|
||||
packetID
|
||||
);
|
||||
state.Dispose();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue