servuo/Scripts/Misc/SocketOptions.cs
TrueUO f608d123a4
Bug Fixes (#4762)
-Fixed issue where client helpers could bypass the container gump and add items directly to the seed box
-SearedFireAntGoo is no longer stackable
-Blue NPC's (mainly vendors, not initial innocent) can no longer be attacked on trammel maps
-Aggressors/Aggressed from pet masters now works properly. This was suspected to crated large numbers to redundant aggressor/aggressed added to a mobiles aggressor/aggressed lists
-Aggressive action for healing a mobile while fighting another mobile has been re-enabled
-AuraDamage is now a harmful act, ie those affected will aggro on your pet!
-MLDryads should no longer attack other wild creatures during Blackthorn Invasion Instance
-More code cleanup
2020-04-21 17:25:24 -07:00

41 lines
1.4 KiB
C#

using Server.Network;
using System.Net;
using System.Net.Sockets;
namespace Server
{
public class SocketOptions
{
public static readonly int Port = Config.Get("Server.Port", 2593);
private static readonly IPEndPoint[] m_ListenerEndPoints = new IPEndPoint[]
{
new IPEndPoint(IPAddress.Any, Port), // Default: Listen on port 2593 on all IP addresses
// Examples:
// new IPEndPoint( IPAddress.Any, 80 ), // Listen on port 80 on all IP addresses
// new IPEndPoint( IPAddress.Parse( "1.2.3.4" ), 2593 ), // Listen on port 2593 on IP address 1.2.3.4
};
public static bool NagleEnabled = false;// Should the Nagle algorithm be enabled? This may reduce performance
public static int CoalesceBufferSize = 512;// MSS that the core will use when buffering packets
public static void Initialize()
{
SendQueue.CoalesceBufferSize = CoalesceBufferSize;
EventSink.SocketConnect += EventSink_SocketConnect;
Listener.EndPoints = m_ListenerEndPoints;
}
private static void EventSink_SocketConnect(SocketConnectEventArgs e)
{
if (!e.AllowConnection)
return;
if (!NagleEnabled)
e.Socket.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.NoDelay, 1); // RunUO uses its own algorithm
}
}
}