Switches to Kestrel (#102)
This commit is contained in:
parent
70fddfebde
commit
2c0d97cd36
141 changed files with 1040 additions and 1679 deletions
|
|
@ -30,7 +30,7 @@ namespace Server.Misc
|
|||
if (!Enabled || IsExempt(ourAddress))
|
||||
return true;
|
||||
|
||||
List<NetState> netStates = NetState.Instances;
|
||||
List<NetState> netStates = TcpServer.Instances;
|
||||
|
||||
int count = 0;
|
||||
|
||||
|
|
@ -50,4 +50,4 @@ namespace Server.Misc
|
|||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace Server.Commands.Generic
|
|||
List<object> list = new List<object>();
|
||||
List<IPAddress> addresses = new List<IPAddress>();
|
||||
|
||||
List<NetState> states = NetState.Instances;
|
||||
List<NetState> states = TcpServer.Instances;
|
||||
|
||||
for (int i = 0; i < states.Count; ++i)
|
||||
{
|
||||
|
|
@ -60,4 +60,4 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ namespace Server.Commands.Generic
|
|||
|
||||
List<object> list = new List<object>();
|
||||
|
||||
List<NetState> states = NetState.Instances;
|
||||
List<NetState> states = TcpServer.Instances;
|
||||
|
||||
for (int i = 0; i < states.Count; ++i)
|
||||
{
|
||||
|
|
@ -61,4 +61,4 @@ namespace Server.Commands.Generic
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -671,7 +671,7 @@ namespace Server.Commands
|
|||
|
||||
public static void BroadcastMessage(AccessLevel ac, int hue, string message)
|
||||
{
|
||||
foreach (NetState state in NetState.Instances)
|
||||
foreach (NetState state in TcpServer.Instances)
|
||||
{
|
||||
Mobile m = state.Mobile;
|
||||
|
||||
|
|
@ -743,7 +743,7 @@ namespace Server.Commands
|
|||
[Description("View some stats about the server.")]
|
||||
public static void Stats_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
e.Mobile.SendMessage("Open Connections: {0}", NetState.Instances.Count);
|
||||
e.Mobile.SendMessage("Open Connections: {0}", TcpServer.Instances.Count);
|
||||
e.Mobile.SendMessage("Mobiles: {0}", World.Mobiles.Count);
|
||||
e.Mobile.SendMessage("Items: {0}", World.Items.Count);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ namespace Server.Engines.Help
|
|||
|
||||
bool isStaffOnline = false;
|
||||
|
||||
foreach (NetState ns in NetState.Instances)
|
||||
foreach (NetState ns in TcpServer.Instances)
|
||||
{
|
||||
Mobile m = ns.Mobile;
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ namespace Server.Gumps
|
|||
AddLabel(150, 170, LabelHue, Firewall.List.Count.ToString());
|
||||
|
||||
AddLabel(20, 190, LabelHue, "Clients:");
|
||||
AddLabel(150, 190, LabelHue, NetState.Instances.Count.ToString());
|
||||
AddLabel(150, 190, LabelHue, TcpServer.Instances.Count.ToString());
|
||||
|
||||
AddLabel(20, 210, LabelHue, "Mobiles:");
|
||||
AddLabel(150, 210, LabelHue, World.Mobiles.Count.ToString());
|
||||
|
|
@ -380,7 +380,7 @@ namespace Server.Gumps
|
|||
{
|
||||
if (m_List == null)
|
||||
{
|
||||
List<NetState> states = NetState.Instances.ToList();
|
||||
List<NetState> states = TcpServer.Instances;
|
||||
states.Sort(NetStateComparer.Instance);
|
||||
|
||||
m_List = states.ToList<object>();
|
||||
|
|
@ -1932,7 +1932,7 @@ namespace Server.Gumps
|
|||
|
||||
if (level > AccessLevel.Player)
|
||||
{
|
||||
List<NetState> clients = NetState.Instances;
|
||||
List<NetState> clients = TcpServer.Instances;
|
||||
int count = 0;
|
||||
|
||||
for (int i = 0; i < clients.Count; ++i)
|
||||
|
|
@ -2020,7 +2020,7 @@ namespace Server.Gumps
|
|||
}
|
||||
else
|
||||
{
|
||||
List<NetState> instances = NetState.Instances;
|
||||
List<NetState> instances = TcpServer.Instances;
|
||||
|
||||
for (int i = 0; i < instances.Count; ++i)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ namespace Server.Gumps
|
|||
string filter = string.IsNullOrWhiteSpace(rawFilter) ? null : rawFilter.Trim().ToLower();
|
||||
|
||||
List<Mobile> list = new List<Mobile>();
|
||||
List<NetState> states = NetState.Instances;
|
||||
List<NetState> states = TcpServer.Instances;
|
||||
|
||||
for ( int i = 0; i < states.Count; ++i )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ namespace Server.Misc
|
|||
|
||||
try
|
||||
{
|
||||
List<NetState> states = NetState.Instances;
|
||||
List<NetState> states = TcpServer.Instances;
|
||||
|
||||
op.WriteLine("- Count: {0}", states.Count);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ namespace Server.Misc
|
|||
|
||||
public static void FoodDecay()
|
||||
{
|
||||
foreach (NetState state in NetState.Instances)
|
||||
foreach (NetState state in TcpServer.Instances)
|
||||
{
|
||||
HungerDecay(state.Mobile);
|
||||
ThirstDecay(state.Mobile);
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ namespace Server
|
|||
{
|
||||
m_LevelOverride = value;
|
||||
|
||||
for (int i = 0; i < NetState.Instances.Count; ++i)
|
||||
for (int i = 0; i < TcpServer.Instances.Count; ++i)
|
||||
{
|
||||
NetState ns = NetState.Instances[i];
|
||||
NetState ns = TcpServer.Instances[i];
|
||||
Mobile m = ns.Mobile;
|
||||
|
||||
m?.CheckLightLevels(false);
|
||||
|
|
@ -69,12 +69,12 @@ namespace Server
|
|||
Clock.GetTime(from.Map, from.X, from.Y, out int hours, out int minutes);
|
||||
|
||||
/* OSI times:
|
||||
*
|
||||
*
|
||||
* Midnight -> 3:59 AM : Night
|
||||
* 4:00 AM -> 11:59 PM : Day
|
||||
*
|
||||
*
|
||||
* RunUO times:
|
||||
*
|
||||
*
|
||||
* 10:00 PM -> 11:59 PM : Scale to night
|
||||
* Midnight -> 3:59 AM : Night
|
||||
* 4:00 AM -> 5:59 AM : Scale to day
|
||||
|
|
@ -102,9 +102,9 @@ namespace Server
|
|||
|
||||
protected override void OnTick()
|
||||
{
|
||||
for (int i = 0; i < NetState.Instances.Count; ++i)
|
||||
for (int i = 0; i < TcpServer.Instances.Count; ++i)
|
||||
{
|
||||
NetState ns = NetState.Instances[i];
|
||||
NetState ns = TcpServer.Instances[i];
|
||||
Mobile m = ns.Mobile;
|
||||
|
||||
m?.CheckLightLevels(false);
|
||||
|
|
@ -130,4 +130,4 @@ namespace Server
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ namespace Server.Misc
|
|||
|
||||
private static void EventSink_Login(LoginEventArgs args)
|
||||
{
|
||||
int userCount = NetState.Instances.Count;
|
||||
int userCount = TcpServer.Instances.Count;
|
||||
int itemCount = World.Items.Count;
|
||||
int mobileCount = World.Mobiles.Count;
|
||||
|
||||
|
|
@ -27,4 +27,4 @@ namespace Server.Misc
|
|||
mobileCount, mobileCount == 1 ? "" : "s");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ using Server.Network;
|
|||
|
||||
namespace Server.Misc
|
||||
{
|
||||
public class ServerList
|
||||
public static class ServerList
|
||||
{
|
||||
/*
|
||||
* The default setting for Address, a value of 'null', will use your local IP address. If all of your local IP addresses
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System.Net;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server
|
||||
{
|
||||
|
|
@ -15,8 +16,7 @@ namespace Server
|
|||
|
||||
public static void RegisterListeners()
|
||||
{
|
||||
for (int i = 0; i < m_ListenerEndPoints.Length; i++)
|
||||
Core.MessagePump.AddListener(m_ListenerEndPoints[i]);
|
||||
TcpServer.Listeners.AddRange(m_ListenerEndPoints);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -316,10 +316,7 @@ namespace Server
|
|||
|
||||
private static void ProcessDisplayCase(Map map, StaticTile[] tiles, int x, int y)
|
||||
{
|
||||
ShopFlags flags = ShopFlags.None;
|
||||
|
||||
for (int i = 0; i < tiles.Length; ++i)
|
||||
flags |= ProcessDisplayedItem(tiles[i].ID);
|
||||
ShopFlags flags = tiles.Aggregate(ShopFlags.None, (current, t) => current | ProcessDisplayedItem(t.ID));
|
||||
|
||||
if (flags != ShopFlags.None)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ namespace Server.Misc
|
|||
else
|
||||
type = 2;
|
||||
|
||||
List<NetState> states = NetState.Instances;
|
||||
List<NetState> states = TcpServer.Instances;
|
||||
|
||||
Packet weatherPacket = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ namespace Server.Misc
|
|||
|
||||
int index = 0;
|
||||
|
||||
foreach (Mobile m in NetState.Instances.Where(state => state.Mobile != null).Select(state => state.Mobile))
|
||||
foreach (Mobile m in TcpServer.Instances.Where(state => state.Mobile != null).Select(state => state.Mobile))
|
||||
{
|
||||
++index;
|
||||
|
||||
|
|
@ -181,4 +181,4 @@ namespace Server.Misc
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MailKit" Version="2.4.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="3.1.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Connections.Abstractions" Version="3.1.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.3" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="3.1.3" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace Server.Misc
|
|||
{
|
||||
Mobile from = e.Mobile;
|
||||
|
||||
if (from?.AccessLevel < AccessLevel.Counselor)
|
||||
if (from == null || from.AccessLevel < AccessLevel.Counselor)
|
||||
return;
|
||||
|
||||
if (HasDisconnected(from))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue