Inital Commit

This commit is contained in:
Ubuntu
2026-07-07 13:40:15 -04:00
parent 73701ff86e
commit b491e327dc
83 changed files with 8591 additions and 6895 deletions
+10
View File
@@ -192,6 +192,16 @@ namespace Server
totalDamage += (int)((double)totalDamage * .1);
}
if (Core.HS && type == DamageType.Spell)
{
if (from?.FindItemOnLayer(Layer.MiddleTorso) is SpellFocusingSash spellSash)
{
spellSash.ValidateTarget(from, m, out var sdiOffset);
totalDamage += Scale(totalDamage, sdiOffset);
}
}
if (totalDamage < 1)
totalDamage = 1;
}
+3 -3
View File
@@ -139,7 +139,7 @@ namespace Server.Misc
return;
}
var ns = states.Find(o => o.Account != null && o.Mobile != null && Insensitive.StartsWith(sub, o.Mobile.RawName));
var ns = states.FirstOrDefault(o => o.Account != null && o.Mobile != null && Insensitive.StartsWith(sub, o.Mobile.RawName));
if (ns != null)
{
@@ -163,7 +163,7 @@ namespace Server.Misc
return;
}
var ns = states.Find(o => o.Account != null && o.Mobile != null && Insensitive.StartsWith(sub, o.Mobile.RawName));
var ns = states.FirstOrDefault(o => o.Account != null && o.Mobile != null && Insensitive.StartsWith(sub, o.Mobile.RawName));
if (ns != null)
{
@@ -523,4 +523,4 @@ namespace Server.Misc
World.Broadcast(hue, false, ac, message);
}
}
}
}
+1 -1
View File
@@ -212,7 +212,7 @@ namespace Server.Misc
try
{
List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
op.WriteLine("- Count: {0}", states.Count);
+1 -1
View File
@@ -43,7 +43,7 @@ namespace Server
PacketHandlers.SingleClickProps = true; // single click for everything is overriden to check object property list
}
Mobile.ActionDelay = Core.TOL ? 500 : Core.AOS ? 750 : 500;
Mobile.ActionDelay = Core.TOL ? 500 : Core.AOS ? 1000 : 500;
Mobile.AOSStatusHandler = AOS.GetStatus;
}
}
+7 -10
View File
@@ -125,8 +125,6 @@ namespace Server
}
}
public static readonly LootPackItem[] HeritageSovereign = new[] {new LootPackItem(typeof(HeritageSovereign), 1)};
public static readonly LootPackItem[] Gold = new[] {new LootPackItem(typeof(Gold), 1)};
public static readonly LootPackItem[] Instruments = new[] {new LootPackItem(typeof(BaseInstrument), 1)};
@@ -340,7 +338,7 @@ namespace Server
new[]
{
new LootPackEntry(true, Gold, 100.00, "1d10+10"), new LootPackEntry(false, AosMagicItemsPoor, 0.02, 1, 5, 0, 90),
new LootPackEntry(false, Instruments, 0.02, 1), new LootPackEntry(true, HeritageSovereign, 1, "1d10+1")
new LootPackEntry(false, Instruments, 0.02, 1)
});
public static readonly LootPack AosMeager =
@@ -350,7 +348,7 @@ namespace Server
new LootPackEntry(true, Gold, 100.00, "3d10+20"),
new LootPackEntry(false, AosMagicItemsMeagerType1, 1.00, 1, 2, 0, 10),
new LootPackEntry(false, AosMagicItemsMeagerType2, 0.20, 1, 5, 0, 90),
new LootPackEntry(false, Instruments, 0.10, 1), new LootPackEntry(true, HeritageSovereign, 1, "1d10+5")
new LootPackEntry(false, Instruments, 0.10, 1)
});
public static readonly LootPack AosAverage =
@@ -361,7 +359,7 @@ namespace Server
new LootPackEntry(false, AosMagicItemsAverageType1, 5.00, 1, 4, 0, 20),
new LootPackEntry(false, AosMagicItemsAverageType1, 2.00, 1, 3, 0, 50),
new LootPackEntry(false, AosMagicItemsAverageType2, 0.50, 1, 5, 0, 90),
new LootPackEntry(false, Instruments, 0.40, 1), new LootPackEntry(true, HeritageSovereign, 1, "1d10+10")
new LootPackEntry(false, Instruments, 0.40, 1)
});
public static readonly LootPack AosRich =
@@ -371,8 +369,7 @@ namespace Server
new LootPackEntry(true, Gold, 100.00, "10d10+150"),
new LootPackEntry(false, AosMagicItemsRichType1, 20.00, 1, 4, 0, 40),
new LootPackEntry(false, AosMagicItemsRichType1, 10.00, 1, 5, 0, 60),
new LootPackEntry(false, AosMagicItemsRichType2, 1.00, 1, 5, 0, 90), new LootPackEntry(false, Instruments, 1.00, 1),
new LootPackEntry(true, HeritageSovereign, 10, "1d10+1")
new LootPackEntry(false, AosMagicItemsRichType2, 1.00, 1, 5, 0, 90), new LootPackEntry(false, Instruments, 1.00, 1)
});
public static readonly LootPack AosFilthyRich =
@@ -384,7 +381,7 @@ namespace Server
new LootPackEntry(false, AosMagicItemsFilthyRichType1, 33.00, 1, 4, 0, 60),
new LootPackEntry(false, AosMagicItemsFilthyRichType2, 20.00, 1, 5, 0, 75),
new LootPackEntry(false, AosMagicItemsFilthyRichType2, 5.00, 1, 5, 0, 100),
new LootPackEntry(false, Instruments, 2.00, 1), new LootPackEntry(true, HeritageSovereign, 10, "1d10+5")
new LootPackEntry(false, Instruments, 2.00, 1)
});
public static readonly LootPack AosUltraRich =
@@ -398,7 +395,7 @@ namespace Server
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 25, 100),
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 25, 100),
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 35, 100),
new LootPackEntry(false, Instruments, 2.00, 1), new LootPackEntry(true, HeritageSovereign, 10, "1d10+10")
new LootPackEntry(false, Instruments, 2.00, 1)
});
public static readonly LootPack AosSuperBoss =
@@ -416,7 +413,7 @@ namespace Server
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 33, 100),
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 50, 100),
new LootPackEntry(false, AosMagicItemsUltraRich, 100.00, 1, 5, 50, 100),
new LootPackEntry(false, Instruments, 2.00, 1), new LootPackEntry(true, HeritageSovereign, 20, "1d10+10")
new LootPackEntry(false, Instruments, 2.00, 1)
});
#endregion
+15 -180
View File
@@ -7,64 +7,20 @@ using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Threading;
using Server.Network;
#endregion
namespace Server.Misc
{
public class ServerList
{
/*
* The default setting for Address, a value of 'null', will use your local IP address. If all of your local IP addresses
* are private network addresses and AutoDetect is 'true' then ServUO will attempt to discover your public IP address
* for you automatically.
*
* If you do not plan on allowing clients outside of your LAN to connect, you can set AutoDetect to 'false' and leave
* Address set to 'null'.
*
* If your public IP address cannot be determined, you must change the value of Address to your public IP address
* manually to allow clients outside of your LAN to connect to your server. Address can be either an IP address or
* a hostname that will be resolved when ServUO starts.
*
* If you want players outside your LAN to be able to connect to your server and you are behind a router, you must also
* forward TCP port 2593 to your private IP address. The procedure for doing this varies by manufacturer but generally
* involves configuration of the router through your web browser.
*
* ServerList will direct connecting clients depending on both the address they are connecting from and the address and
* port they are connecting to. If it is determined that both ends of a connection are private IP addresses, ServerList
* will direct the client to the local private IP address. If a client is connecting to a local public IP address, they
* will be directed to whichever address and port they initially connected to. This allows multihomed servers to function
* properly and fully supports listening on multiple ports. If a client with a public IP address is connecting to a
* locally private address, the server will direct the client to either the AutoDetected IP address or the manually entered
* IP address or hostname, whichever is applicable. Loopback clients will be directed to loopback.
*
* If you would like to listen on additional ports (i.e. 22, 23, 80, for clients behind highly restrictive egress
* firewalls) or specific IP adddresses you can do so by modifying the file SocketOptions.cs found in this directory.
*/
{
public static string ServerName = Config.Get("Server.Name", "My Shard");
public static readonly string Address = Config.Get("Server.Address", default(string));
public static readonly bool AutoDetect = Config.Get("Server.AutoDetect", true);
public static string ServerName = Config.Get("Server.Name", "My Shard");
private static IPAddress _PublicAddress;
private static readonly Regex _AddressPattern = new Regex(@"([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})");
public static void Initialize()
{
if (Address == null)
{
if (AutoDetect)
{
AutoDetection();
}
}
else
{
Resolve(Address, out _PublicAddress);
}
public static IPAddress Address => Config.Get("Server.Address", IPAddress.Loopback);
public static void Initialize()
{
EventSink.ServerList += EventSink_ServerList;
}
@@ -80,15 +36,15 @@ namespace Server.Misc
var localAddress = ipep.Address;
var localPort = ipep.Port;
if (IsPrivateNetwork(localAddress))
{
ipep = (IPEndPoint)s.RemoteEndPoint;
if (!IPAddress.IsLoopback(localAddress) && IsPrivateNetwork(localAddress))
{
ipep = (IPEndPoint)s.RemoteEndPoint;
if (!IsPrivateNetwork(ipep.Address) && _PublicAddress != null)
{
localAddress = _PublicAddress;
}
}
if (!IsPrivateNetwork(ipep.Address))
{
localAddress = Address;
}
}
e.AddServer(ServerName, new IPEndPoint(localAddress, localPort));
}
@@ -98,67 +54,6 @@ namespace Server.Misc
}
}
public static string[] IPServices =
{
"http://services.servuo.com/ip.php", "http://api.ipify.org",
"http://checkip.dyndns.org/"
};
private static void AutoDetection()
{
if (!HasPublicIPAddress())
{
Utility.PushColor(ConsoleColor.Yellow);
Console.WriteLine("ServerList: Auto-detecting public IP address...");
_PublicAddress = FindPublicAddress(IPServices);
if (_PublicAddress != null)
{
Console.WriteLine("ServerList: Done: '{0}'", _PublicAddress);
}
else
{
_PublicAddress = IPAddress.Any;
Console.WriteLine("ServerList: Failed: reverting to private IP address...");
}
Utility.PopColor();
}
}
private static void Resolve(string addr, out IPAddress outValue)
{
if (IPAddress.TryParse(addr, out outValue))
{
return;
}
try
{
var iphe = Dns.GetHostEntry(addr);
if (iphe.AddressList.Length > 0)
{
outValue = iphe.AddressList[iphe.AddressList.Length - 1];
}
}
catch
{ }
}
private static bool HasPublicIPAddress()
{
var adapters = NetworkInterface.GetAllNetworkInterfaces();
var uips = adapters.Select(a => a.GetIPProperties())
.SelectMany(p => p.UnicastAddresses.Cast<IPAddressInformation>(), (p, u) => u.Address);
return
uips.Any(
ip => !IPAddress.IsLoopback(ip) && ip.AddressFamily != AddressFamily.InterNetworkV6 && !IsPrivateNetwork(ip));
}
private static bool IsPrivateNetwork(IPAddress ip)
{
// 10.0.0.0/8
@@ -199,65 +94,5 @@ namespace Server.Misc
return false;
}
public static IPAddress FindPublicAddress(params string[] services)
{
if (services == null || services.Length == 0)
{
services = IPServices;
}
if (services == null || services.Length == 0)
{
return null;
}
IPAddress ip = null;
Uri uri;
string data;
Match match;
foreach (var service in services.Where(s => !String.IsNullOrWhiteSpace(s)))
{
try
{
uri = new Uri(service);
Console.WriteLine("ServerList: >>> {0}", uri.Host);
using (var client = new WebClient())
{
data = client.DownloadString(uri);
}
Console.WriteLine("ServerList: <<< {0}", data);
match = _AddressPattern.Match(data);
if (!match.Success || !IPAddress.TryParse(match.Value, out ip))
{
ip = null;
}
}
catch (UriFormatException)
{
Console.WriteLine("ServerList: Invalid IP service Uri '{0}'", service);
ip = null;
}
catch
{
ip = null;
}
if (ip != null)
{
break;
}
}
return ip;
}
}
}
+1 -1
View File
@@ -25,7 +25,7 @@ namespace System
{
get
{
return String.Format("{0:D2}:{1:D2}:{2:D2} ", DateTime.Now.Hour, DateTime.Now.Minute, DateTime.Now.Second);
return String.Format("{0:D2}:{1:D2}:{2:D2} ", DateTime.UtcNow.Hour, DateTime.UtcNow.Minute, DateTime.UtcNow.Second);
}
}
public static void Initialize()
+2 -2
View File
@@ -381,7 +381,7 @@ namespace Server.Misc
else
type = 2;
List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
Packet weatherPacket = null;
@@ -471,4 +471,4 @@ namespace Server.Misc
int version = reader.ReadInt();
}
}
}
}