Switches to Kestrel (#102)

This commit is contained in:
Kamron Batman 2020-04-12 20:57:48 -07:00 committed by GitHub
parent 70fddfebde
commit 2c0d97cd36
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
141 changed files with 1040 additions and 1679 deletions

View file

@ -202,7 +202,7 @@ namespace Server.Misc
try
{
List<NetState> states = NetState.Instances;
List<NetState> states = TcpServer.Instances;
op.WriteLine("- Count: {0}", states.Count);

View file

@ -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);

View file

@ -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
}
}
}
}
}

View file

@ -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");
}
}
}
}

View file

@ -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

View file

@ -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);
}
}
}

View file

@ -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)
{

View file

@ -263,7 +263,7 @@ namespace Server.Misc
else
type = 2;
List<NetState> states = NetState.Instances;
List<NetState> states = TcpServer.Instances;
Packet weatherPacket = null;

View file

@ -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
}
}
}
}
}