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
+5 -3
View File
@@ -1,10 +1,12 @@
/Ultima.dll
/Ultima.pdb
/Ultima.dll.mdb
/Ultima/bin
/Ultima/obj
/Server.dll
/Server/bin
/Server/obj
/Scripts.dll
/Scripts/bin
/Scripts/obj
/Scripts/Output
@@ -29,7 +31,7 @@
*.pdb
*.exe
*.exe.mdb
*.mdb
*.sh
*.suo
*.idea
+1 -1
View File
@@ -1,6 +1,6 @@
# The displayed name of the shard
Name=The Forging
Name=Code Name: The Forging
# 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'
+54 -54
View File
@@ -159,7 +159,7 @@ Drawer 0x0A2C
1493 1610 40
1579 1584 20
1579 1584 40
1469 1704 0
# 1469 1704 0
1493 1620 40
1386 1800 0
1426 1752 10
@@ -187,9 +187,9 @@ Drawer 0x0A34
1460 1705 0
1416 1555 30
1184 1715 0
1454 1705 0
# 1454 1705 0
1507 1595 10
1448 1707 0
# 1448 1707 0
1624 1584 -20
1537 1739 35
1537 1744 35
@@ -665,7 +665,7 @@ LampPost1 0x0B20
1500 1701 20
1472 1623 20
1471 1676 0
1472 1696 0
# 1472 1696 0
1472 1636 20
1501 1543 28
1432 1665 10
@@ -702,7 +702,7 @@ LampPost3 0x0B24
1439 1754 -3
1694 1556 40
1691 1578 11
1484 1723 0
# 1484 1723 0
1665 1608 13
1669 1557 30
1670 1626 -5
@@ -749,7 +749,7 @@ LampPost3 0x0B24
1588 1685 10
1498 1626 10
1552 1751 15
1472 1704 0
# 1472 1704 0
1552 1608 10
1615 1672 19
1567 1576 20
@@ -1426,7 +1426,7 @@ PottedTree1 0x11C9
1656 1606 20
1678 1590 7
1342 1657 50
1452 1704 0
# 1452 1704 0
1450 1678 0
1254 1696 0
1576 1594 40
@@ -1443,7 +1443,7 @@ PottedTree1 0x11C9
1158 1622 0
1390 1806 0
1480 1580 20
1470 1704 0
# 1470 1704 0
1486 1580 20
1544 1736 15
1542 1680 30
@@ -1531,11 +1531,11 @@ PottedPlant 0x11CA
# flowerpot
PottedPlant1 0x11CB
1454 1709 9
# 1454 1709 9
1384 1804 5
1603 1715 29
1545 1709 30
1460 1709 9
# 1460 1709 9
1452 1682 9
1600 1524 47
1452 1614 29
@@ -1545,9 +1545,9 @@ PottedPlant2 0x11CC
1446 1649 19
1456 1725 16
1605 1716 30
1466 1709 9
# 1466 1709 9
1471 1580 29
1452 1709 9
# 1452 1709 9
1594 1655 19
1388 1816 5
1550 1767 19
@@ -1934,7 +1934,7 @@ Fork 0x09A3
1331 1604 54
1387 1817 2
1403 1817 4
1452 1708 6
# 1452 1708 6
1509 1599 14
1547 1715 24
1600 1515 44
@@ -1977,7 +1977,7 @@ Knife 0x09A5
1331 1604 54
1387 1817 2
1403 1817 4
1452 1708 6
# 1452 1708 6
1509 1599 14
1547 1715 24
1600 1515 44
@@ -2105,11 +2105,11 @@ Spoon 0x09C3
# bottle of wine
BeverageBottle 0x09C7 (Content=Wine)
1452 1707 6
1454 1707 6
# 1452 1707 6
# 1454 1707 6
1456 1723 12
1460 1707 6
1466 1707 6
# 1460 1707 6
# 1466 1707 6
1468 1514 24
1469 1515 24
1509 1598 14
@@ -2222,11 +2222,11 @@ Plate 0x09D7
1342 1605 54
1344 1603 54
1344 1605 54
1452 1708 6
1454 1708 6
# 1452 1708 6
# 1454 1708 6
1456 1724 12
1460 1708 6
1466 1708 6
# 1460 1708 6
# 1466 1708 6
1467 1514 24
1467 1515 24
1470 1514 24
@@ -2371,11 +2371,11 @@ Fork 0x09F5
1261 1884 4
1388 1817 2
1404 1817 4
1453 1708 20
1454 1708 6
# 1453 1708 20
# 1454 1708 6
1456 1724 12
1460 1708 6
1466 1708 6
# 1460 1708 6
# 1466 1708 6
1510 1599 14
1548 1715 24
1601 1515 44
@@ -2419,10 +2419,10 @@ Knife 0x09F7
1261 1884 4
1388 1817 2
1404 1817 4
1454 1708 6
# 1454 1708 6
1456 1724 12
1460 1708 6
1466 1708 6
# 1460 1708 6
# 1466 1708 6
1510 1599 14
1548 1715 24
1601 1515 44
@@ -2459,10 +2459,10 @@ Spoon 0x09F8
# spoon
Spoon 0x09F9
1454 1708 6
# 1454 1708 6
1456 1724 12
1460 1708 6
1466 1708 6
# 1460 1708 6
# 1466 1708 6
1510 1599 14
1548 1715 24
1601 1515 44
@@ -2524,13 +2524,13 @@ CandleLarge 0x0B1A
1412 1617 34
1412 1717 24
1430 1752 16
1448 1704 6
# 1448 1704 6
1452 1609 26
1453 1682 6
1454 1704 6
# 1454 1704 6
1456 1720 12
1460 1704 6
1466 1704 6
# 1466 1704 6
1471 1576 26
1473 1609 26
1482 1586 26
@@ -2983,7 +2983,7 @@ BambooChair 0x0B5D
1420 1580 30
1455 1708 0
1461 1708 0
1467 1708 0
# 1467 1708 0
1472 1562 30
1475 1738 0
1475 1739 0
@@ -3299,20 +3299,20 @@ Barrel 0x0E77
1408 1806 5
1408 1807 0
1408 1807 5
1472 1720 0
1472 1721 0
1472 1722 0
1473 1720 0
1473 1724 0
1473 1725 0
1474 1725 0
1477 1721 0
1477 1722 0
1478 1721 0
1478 1722 0
1480 1725 0
1481 1724 0
1481 1725 0
# 1472 1720 0
# 1472 1721 0
# 1472 1722 0
# 1473 1720 0
# 1473 1724 0
# 1473 1725 0
# 1474 1725 0
# 1477 1721 0
# 1477 1722 0
# 1478 1721 0
# 1478 1722 0
# 1480 1725 0
# 1481 1724 0
# 1481 1725 0
1560 1742 15
1560 1743 15
1560 1743 20
@@ -4147,7 +4147,7 @@ PewterMug 0x0FFF
1435 1713 24
1435 1716 24
1435 1721 24
1452 1707 6
# 1452 1707 6
1468 1515 24
1469 1515 24
1497 1677 24
@@ -4176,10 +4176,10 @@ PewterMug 0x1000
1429 1713 26
1429 1715 26
1429 1717 26
1454 1707 6
# 1454 1707 6
1456 1723 12
1460 1707 6
1466 1707 6
# 1460 1707 6
# 1466 1707 6
1468 1514 24
1489 1686 26
1491 1686 26
+21 -51
View File
@@ -1,5 +1,25 @@
{
"Featured": [
{
"Type": "Server.Items.OilOfRestoration",
"NameLines": ["Oil of Restoration"],
"Tooltip": 0,
"TooltipText": "Use this item to allow your tempered equipment to be repaired again. This item will be consumed upon use.",
"ItemID": 7192,
"GumpID": 0,
"Hue": 241,
"Price": 5000
},
{
"Type": "Server.Items.ForgedPardon",
"NameLines": ["1116234"],
"Tooltip": 1116235,
"TooltipText": "",
"ItemID": 10289,
"GumpID": 0,
"Hue": 1177,
"Price": 2500
},
{
"Type": "Server.Items.RoyalMintBox",
"NameLines": ["Royal Mint Processing Box"],
@@ -8,7 +28,7 @@
"ItemID": 2472,
"GumpID": 0,
"Hue": 2713,
"Price": 5000
"Price": 1500
},
{
"Type": "Server.Items.VirtueShield",
@@ -294,56 +314,6 @@
"Hue": 0,
"Price": 1500
},
{
"Type": "Server.Items.HoodedBritanniaRobe",
"NameLines": ["1125155"],
"Tooltip": 1158016,
"TooltipText": "",
"ItemID": 41131,
"GumpID": 0,
"Hue": 0,
"Price": 1500
},
{
"Type": "Server.Items.HoodedBritanniaRobe",
"NameLines": ["1125155"],
"Tooltip": 1158016,
"TooltipText": "",
"ItemID": 41132,
"GumpID": 0,
"Hue": 0,
"Price": 1500
},
{
"Type": "Server.Items.HoodedBritanniaRobe",
"NameLines": ["1125155"],
"Tooltip": 1158016,
"TooltipText": "",
"ItemID": 41133,
"GumpID": 0,
"Hue": 0,
"Price": 1500
},
{
"Type": "Server.Items.HoodedBritanniaRobe",
"NameLines": ["1125155"],
"Tooltip": 1158016,
"TooltipText": "",
"ItemID": 41134,
"GumpID": 0,
"Hue": 0,
"Price": 1500
},
{
"Type": "Server.Items.HoodedBritanniaRobe",
"NameLines": ["1125155"],
"Tooltip": 1158016,
"TooltipText": "",
"ItemID": 41135,
"GumpID": 0,
"Hue": 0,
"Price": 1500
},
{
"Type": "Server.Items.HaochisPigment",
"NameLines": ["1071249", "1157275"],
-1
View File
@@ -302,7 +302,6 @@
0 4762 1552 1728 37 #1016310
0 4765 1552 1728 34 #1016310
0 4765 1532 1705 33 #1016310
0 4765 1485 1709 15 #1016310
0 4761 1488 1731 15 #1016310
0 4764 1468 1732 15 #1016310
0 4764 1441 1732 19 #1016310
BIN
View File
Binary file not shown.
+35 -28
View File
@@ -1,41 +1,48 @@
MCS=mcs
CSC=dotnet csc
EXENAME=ServUO
CURPATH=`pwd`
SRVPATH=${CURPATH}/Server
SDKPATH=${CURPATH}/Ultima
REFS=System.Drawing.dll
CURPATH=$(shell pwd)
SRVPATH=$(CURPATH)/Server
SDKPATH=$(CURPATH)/Ultima
REFS=/usr/lib/mono/4.8-api/System.Drawing.dll
NOWARNS=0618,0219,0414,1635
PHONY : default build clean run
PHONY: default build clean run
default: run
debug:
${MCS} -target:library -out:${CURPATH}/Ultima.dll -r:${REFS} -nowarn:${NOWARNS} -d:DEBUG -d:MONO -d:ServUO -d:NEWTIMERS -nologo -debug -unsafe -recurse:${SDKPATH}/*.cs
${MCS} -win32icon:${SRVPATH}/servuo.ico -r:${CURPATH}/Ultima.dll,${REFS} -nowarn:${NOWARNS} -target:exe -out:${CURPATH}/${EXENAME}.exe -d:DEBUG -d:MONO -d:ServUO -d:NEWTIMERS -nologo -debug -unsafe -recurse:${SRVPATH}/*.cs
sed -i.bak -e 's/<!--//g; s/-->//g' ${EXENAME}.exe.config
debug: Ultima.dll ServUO.exe
<TAB>sed -i.bak -e 's/<!--//g; s/-->//g' $(EXENAME).exe.config
run: build
${CURPATH}/${EXENAME}.sh
<TAB>$(CURPATH)/$(EXENAME).sh
build: ${EXENAME}.sh
build: ServUO.exe
<TAB>echo "#!/bin/sh" > $(CURPATH)/$(EXENAME).sh
<TAB>echo "dotnet $(CURPATH)/$(EXENAME).exe" >> $(CURPATH)/$(EXENAME).sh
<TAB>chmod a+x $(CURPATH)/$(EXENAME).sh
<TAB>sed -i.bak -e 's/<!--//g; s/-->//g' $(EXENAME).exe.config
clean:
rm -f ${EXENAME}.sh
rm -f ${EXENAME}.exe
rm -f ${EXENAME}.exe.mdb
rm -f Ultima.dll
rm -f Ultima.dll.mdb
rm -f *.bin
<TAB>rm -f $(EXENAME).sh
<TAB>rm -f $(EXENAME).exe
<TAB>rm -f Ultima.dll
<TAB>rm -rf obj bin
<TAB>rm -f *.bin
Ultima.dll: Ultima/*.cs
${MCS} -target:library -out:${CURPATH}/Ultima.dll -r:${REFS} -nowarn:${NOWARNS} -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:${SDKPATH}/*.cs
Ultima.dll:
<TAB>$(CSC) -target:library -out:$(CURPATH)/Ultima.dll \
-r:$(REFS) -nowarn:$(NOWARNS) \
-d:ServUO -d:NEWTIMERS \
-nologo -optimize -unsafe \
-langversion:latest \
-recurse:$(SDKPATH)/*.cs
${EXENAME}.exe: Ultima.dll Server/*.cs
${MCS} -win32icon:${SRVPATH}/servuo.ico -r:${CURPATH}/Ultima.dll,${REFS} -nowarn:${NOWARNS} -target:exe -out:${CURPATH}/${EXENAME}.exe -d:MONO -d:ServUO -d:NEWTIMERS -nologo -optimize -unsafe -recurse:${SRVPATH}/*.cs
${EXENAME}.sh: ${EXENAME}.exe
echo "#!/bin/sh" > ${CURPATH}/${EXENAME}.sh
echo "mono ${CURPATH}/${EXENAME}.exe" >> ${CURPATH}/${EXENAME}.sh
chmod a+x ${CURPATH}/${EXENAME}.sh
sed -i.bak -e 's/<!--//g; s/-->//g' ${EXENAME}.exe.config
ServUO.exe: Ultima.dll
<TAB>$(CSC) -win32icon:$(SRVPATH)/servuo.ico \
-r:$(CURPATH)/Ultima.dll -r:$(REFS) \
-nowarn:$(NOWARNS) \
-target:exe -out:$(CURPATH)/$(EXENAME).exe \
-d:ServUO -d:NEWTIMERS \
-nologo -optimize -unsafe \
-langversion:latest \
-recurse:$(SRVPATH)/*.cs
+10 -19
View File
@@ -19,35 +19,26 @@ ServUO is a community driven Ultima Online Server Emulator written in C#.
#### Windows
Run `Compile.WIN - Debug.bat` for development, attaching a debugger and/or extended output.
Run `_windebug.bat` for development, attaching a debugger and/or extended output.
Run `Compile.WIN - Release.bat` for production environment (-debug is still a supported parameter for script debugging).
After this you can run the server by executing `ServUO.exe`.
Run `_winrelease.bat` for production environment.
#### OSX
```
brew install mono
make
```
#### Other Platforms
Run `_makedebug` for development, attaching a debugger and/or extended output.
#### Ubuntu
```
apt-get install mono-complete
make
```
Run `_makerelease` for production environment.
### Summary
1. Starting with the `/Config` directory, find and edit `Server.cfg` to set up the essentials.
2. Go through the remaining `*.cfg` files to ensure they suit your needs.
3. For Windows, run `Compile.WIN - Debug.bat` to produce `ServUO.exe`, Linux users may run `Makefile`.
4. Run `ServUO.exe` to make sure everything boots up, if everything went well, you should see your IP adress being listened on the port you specified.
5. Load up UO and login! - If you require instructions on setting up your particular client, visit the Discord and ask!
3. For Windows, run `_winrelease.bat` to produce `ServUO.exe`, OSX/Linux users may run `_makerelease`.
4. Run `ServUO`
5. ???
6. Profit!
[ServUO]: <https://www.servuo.com>
[ServUO]: <https://www.servuo.com>
Executable → Regular
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -32,7 +32,7 @@ namespace Server.Misc
if (!Enabled || IsExempt(ourAddress))
return true;
List<NetState> netStates = NetState.Instances;
IList<NetState> netStates = NetState.Instances;
int count = 0;
@@ -1,5 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Network;
namespace Server.Commands.Generic
@@ -36,7 +38,7 @@ namespace Server.Commands.Generic
ArrayList list = new ArrayList();
ArrayList addresses = new ArrayList();
System.Collections.Generic.List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
for (int i = 0; i < states.Count; ++i)
{
@@ -36,7 +36,7 @@ namespace Server.Commands.Generic
ArrayList list = new ArrayList();
List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
for (int i = 0; i < states.Count; ++i)
{
+3
View File
@@ -164,6 +164,9 @@ namespace Server.Commands
while ((line = ip.ReadLine()) != null)
{
if (string.IsNullOrEmpty(line))
continue;
string[] split = line.Split(' ');
SignEntry e = new SignEntry(
+1 -1
View File
@@ -14,7 +14,7 @@ namespace Server.Commands
public static void CheckTime_OnCommand(CommandEventArgs e)
{
Mobile m = e.Mobile;
DateTime now = DateTime.Now;
DateTime now = DateTime.UtcNow;
m.SendMessage("The Current Date And Time Is " + now + "(EST)");
}
}
+48
View File
@@ -0,0 +1,48 @@
using System;
using Server;
using Server.Items;
using Server.Engines.XmlSpawner2;
using Server.Custom;
namespace Server.Custom
{
public class DurabilityAttachment : XmlAttachment
{
public bool RepairLocked { get; set; }
public int PoFUses { get; set; }
public int MaxPoFUses { get; set; }
public DurabilityAttachment() : base()
{
}
public DurabilityAttachment(ASerial serial) : base(serial)
{
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
writer.Write(RepairLocked);
writer.Write(PoFUses);
writer.Write(MaxPoFUses);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (version >= 0)
{
RepairLocked = reader.ReadBool();
PoFUses = reader.ReadInt();
MaxPoFUses = reader.ReadInt();
}
}
}
}
+52
View File
@@ -0,0 +1,52 @@
using Server;
using Server.Items;
using Server.Engines.XmlSpawner2;
namespace Server.Custom
{
public static class DurabilityExtensions
{
private static DurabilityAttachment GetAttach(Item item)
{
var att = XmlAttach.FindAttachment(item, typeof(DurabilityAttachment)) as DurabilityAttachment;
if (att == null)
{
att = new DurabilityAttachment();
XmlAttach.AttachTo(item, att);
}
return att;
}
public static bool GetRepairLocked(this Item item)
{
return GetAttach(item).RepairLocked;
}
public static void SetRepairLocked(this Item item, bool value)
{
GetAttach(item).RepairLocked = value;
}
public static int GetPoFUses(this Item item)
{
return GetAttach(item).PoFUses;
}
public static void SetPoFUses(this Item item, int value)
{
GetAttach(item).PoFUses = value;
}
public static int GetMaxPoFUses(this Item item)
{
return GetAttach(item).MaxPoFUses;
}
public static void SetMaxPoFUses(this Item item, int value)
{
GetAttach(item).MaxPoFUses = value;
}
}
}
@@ -0,0 +1,88 @@
using System;
using Server.Items;
namespace Server.Items
{
public class ArmsofApathy2 : PlateArms
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public ArmsofApathy2() : base()
{
Name = "Arms of Apathy";
LootType = LootType.Blessed;
Weight = 5.0;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public ArmsofApathy2( Serial serial ) : base( serial )
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,88 @@
using System;
namespace Server.Items
{
[FlipableAttribute(0x1450, 0x1455)]
public class GlovesofInjustice2 : PlateGloves
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public GlovesofInjustice2()
: base()
{
this.Weight = 2.0;
this.Name = "Goves of Injustice";
LootType = LootType.Blessed;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public GlovesofInjustice2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,86 @@
using System;
namespace Server.Items
{
public class HeartofObsidian2 : PlateChest
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public HeartofObsidian2()
: base()
{
this.Name = "Heart of Obsidian";
LootType = LootType.Blessed;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public HeartofObsidian2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,89 @@
using System;
namespace Server.Items
{
public class HelmofIgnorance2 : NorseHelm
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public HelmofIgnorance2()
: base()
{
this.Name = "Helm of Ignorance";
LootType = LootType.Blessed;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public HelmofIgnorance2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 4;
}
}
public override int BaseFireResistance
{
get
{
return 9;
}
}
public override int BaseColdResistance
{
get
{
return 3;
}
}
public override int BasePoisonResistance
{
get
{
return 6;
}
}
public override int BaseEnergyResistance
{
get
{
return 8;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,87 @@
using System;
namespace Server.Items
{
public class LegsofSloth2 : PlateLegs
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public LegsofSloth2()
: base()
{
this.Name = "Legs of Sloth";
LootType = LootType.Blessed;
this.SetHue = 1109;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public LegsofSloth2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,86 @@
using System;
namespace Server.Items
{
public class UnbendingNeck2 : PlateGorget
{
public override bool IsArtifact { get { return true; } }
[Constructable]
public UnbendingNeck2()
: base()
{
this.SetHue = 1109;
this.Name = "Unbending Neck";
LootType = LootType.Blessed;
this.Attributes.RegenHits = 1;
this.Attributes.AttackChance = 5;
this.SetAttributes.ReflectPhysical = 25;
this.SetAttributes.NightSight = 1;
this.SetSkillBonuses.SetValues(0, SkillName.Swords, 10);
this.SetSelfRepair = 3;
this.SetPhysicalBonus = 2;
this.SetFireBonus = 5;
this.SetColdBonus = 5;
this.SetPoisonBonus = 3;
this.SetEnergyBonus = 5;
}
public UnbendingNeck2(Serial serial)
: base(serial)
{
}
public override int BasePhysicalResistance
{
get
{
return 8;
}
}
public override int BaseFireResistance
{
get
{
return 5;
}
}
public override int BaseColdResistance
{
get
{
return 5;
}
}
public override int BasePoisonResistance
{
get
{
return 7;
}
}
public override int BaseEnergyResistance
{
get
{
return 5;
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write((int)0); // version
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
}
}
}
@@ -0,0 +1,47 @@
using System;
using Server;
namespace Server.Items
{
public class ViceInfusedShield : BaseShield
{
public override int BasePhysicalResistance{ get{ return 0; } }
public override int BaseFireResistance{ get{ return 1; } }
public override int BaseColdResistance{ get{ return 0; } }
public override int BasePoisonResistance{ get{ return 0; } }
public override int BaseEnergyResistance{ get{ return 0; } }
public override int InitMinHits{ get{ return 50; } }
public override int InitMaxHits{ get{ return 65; } }
public override int AosStrReq{ get{ return 90; } }
public override int ArmorBase{ get{ return 23; } }
[Constructable]
public ViceInfusedShield() : base( 11009 )
{
Weight = 8.0;
Hue = 1109;
Name = "Vice Infused Shield";
}
public ViceInfusedShield( Serial serial ) : base(serial)
{
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int)0 );//version
}
}
}
+338
View File
@@ -0,0 +1,338 @@
//// D&D style Death Knight by Pappa Smurf ////
//// Thanks to the Following ////
//// David from RunUO.com for giving me an interest in Timers ////
//// oO_Sithid_Oo from RunUO.com for proof reading and pointing out my mistakes ////
//// and helping with the timer ////
//// TMSTKSBK for putting up with me complaining about my timers not working ////
//// The RunUO Dev Team for creating RunUO without which this script would be pointless ////
//// A_Li_N from RunUO for suggesting using a DateTime Method instead of a timer ////
//// Updated on 11/16/2008 to include new Abilities and Updates for RunUO 2.0 SVN 301 ////
//// Damage and Armor Rating calcuations, Additional Loot Drops added. ////
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
using System;
using Server.Mobiles;
using Server.Spells.Necromancy;
using Server;
using System.Collections;
using Server.Items;
using Server.Misc;
using Server.Network;
using Server.Targeting;
using Server.Spells;
using Server.Engines.CannedEvil;
namespace Server.Mobiles
{
[CorpseName("corpse of Dupre")]
public class FallenDupre : BaseChampion
{
public override ChampionSkullType SkullType { get { return ChampionSkullType.Despair; } }
public override WeaponAbility GetWeaponAbility()
{
switch (Utility.Random(2))
{
default:
case 1: return WeaponAbility.DoubleStrike;
case 2: return WeaponAbility.ArmorIgnore;
}
}
private DateTime m_NextPowerWordKillTime;
[CommandProperty(AccessLevel.GameMaster)]
public DateTime NextPowerWordKillTime
{
get
{
return m_NextPowerWordKillTime;
}
set
{
m_NextPowerWordKillTime = value;
}
}
public override bool ClickTitle { get { return false; } }
[Constructable]
public FallenDupre(): base(AIType.AI_Melee)
{
Name = "Dupre";
Title = "Fallen Champion of the Virtues";
Body = 744;
Hue = 0x4001;
SetStr(488, 620);
SetDex(121, 170);
SetInt(498, 657);
SetHits(12000 , 15000);
SetStam(102, 300);
SetDamage(10, 20);
SetDamageType(ResistanceType.Physical, 25);
SetDamageType(ResistanceType.Energy, 50);
SetResistance(ResistanceType.Physical, 35);
SetResistance(ResistanceType.Fire, 50);
SetResistance(ResistanceType.Cold, 60);
SetResistance(ResistanceType.Poison, 25);
SetResistance(ResistanceType.Energy, 40);
SetSkill( SkillName.Parry, 120.0 );
SetSkill( SkillName.Swords, 120.0 );
SetSkill( SkillName.Tactics, 120.0 );
SetSkill( SkillName.Anatomy, 120.0 );
SetSkill( SkillName.Magery, 120.0);
SetSkill( SkillName.SpiritSpeak, 120.0);
SetSkill( SkillName.Healing, 120.0);
SetSkill(SkillName.EvalInt, 120.0);
SetSkill(SkillName.MagicResist, 140.0);
SetSkill(SkillName.Chivalry, 120.0);
Fame = 25000;
Karma = -25000;
AddItem(new ArmsofApathy2());
AddItem(new HeartofObsidian2());
AddItem(new GlovesofInjustice2());
AddItem(new LegsofSloth2());
AddItem(new ThighBoots());
AddItem(new Katana());
AddItem(new HelmofIgnorance2());
AddItem(new ViceInfusedShield());
AddItem(new UnbendingNeck2());
PackGold( 200, 250 );
new Nightmare().Rider = this;
}
public override Type[] UniqueList
{
get
{
return new Type[] { typeof(FangOfRactus) };
}
}
public override Type[] SharedList
{
get
{
return new Type[]
{
typeof(RoyalGuardInvestigatorsCloak),
typeof(DjinnisRing),
typeof(DetectiveBoots),
typeof(GauntletsOfAnger)
};
}
}
public override Type[] DecorativeList
{
get
{
return new Type[] { typeof(SwampTile), typeof(MonsterStatuette) };
}
}
public override MonsterStatuetteType[] StatueTypes
{
get
{
return new MonsterStatuetteType[] { MonsterStatuetteType.Slime };
}
}
public override bool OnBeforeDeath()
{
IMount mount = this.Mount;
if (mount != null)
mount.Rider = null;
if (mount is Mobile)
((Mobile)mount).Delete();
return base.OnBeforeDeath();
}
public override void GenerateLoot()
{
AddLoot(LootPack.UltraRich, 4);
AddLoot(LootPack.FilthyRich, 2);
AddLoot(LootPack.MedScrolls, 2);
switch (Utility.Random(6))
{
case 0: AddItem(new ArmsofApathy()); break;
case 1: AddItem(new HeartofObsidian()); break;
case 2: AddItem(new LegsofSloth()); break;
case 3: AddItem(new HelmofIgnorance()); break;
case 4: AddItem(new GlovesofInjustice()); break;
case 5: AddItem(new UnbendingNeck()); break;
}
}
public override bool AlwaysMurderer { get { return true; } }
public override bool AutoDispel { get { return true; } }
public override double AutoDispelChance { get { return 1.0; } }
public override bool BardImmune { get { return !Core.SE; } }
public override bool Unprovokable { get { return Core.SE; } }
public override bool Uncalmable { get { return Core.SE; } }
public override Poison PoisonImmune{ get{ return Poison.Lethal; } }
public override void OnDamage(int amount, Mobile from, bool willKill)
{
if (from != null && !willKill && amount > 5 && from.Player && 5 > Utility.Random(10))
{
string[] toSay = new string[]
{
"I sacraficed myself for the virtues, this was my reward",
"{0}, Fight me with Honor, Die like a Man!",
"{0}, You should retreat your skills are no match for mine",
"In life I stood against the evils of this world. Now I serve them to bring your doom!",
"{0}, You worm, you should be honored to die by my hand!" ,
"Tis' but a scratch!"
};
this.Say(true, String.Format(toSay[Utility.Random(toSay.Length)], from.Name));
}
base.OnDamage(amount, from, willKill);
}
public void PowerWordKill()
{
ArrayList list = new ArrayList();
foreach (Mobile m in this.GetMobilesInRange(1))
{
if (m == this || !CanBeHarmful(m))
continue;
if (m.Player)
list.Add(m);
}
foreach (Mobile m in list)
{
m.SendMessage("Dupre's corruption has given him a remarkable power over death, the ability to kill with a single word.....too bad you were listening!");
DoHarmful(m);
m.FixedParticles(0x36CB, 1, 9, 9911, 67, 5, EffectLayer.Head);
int toPowerWordKill = Utility.RandomMinMax(50000, 60000);
m.Damage(toPowerWordKill, this);
}
NextPowerWordKillTime = DateTime.Now + TimeSpan.FromMinutes(15.0);
}
public void SpawnUndeadArmy(Mobile target)
{
Map map = this.Map;
if (map == null)
return;
int knights = 0;
foreach (Mobile m in this.GetMobilesInRange(10))
{
if (m is UndeadKnight || m is WailingBanshee)
++knights;
}
if (knights < 1)
{
PlaySound(0x567);
int newUndead = Utility.Random(13);
for (int i = 0; i < newUndead; ++i)
{
BaseCreature skeleton;
switch (Utility.Random(2))
{
default:
case 0: skeleton = new WailingBanshee(); break;
case 1: skeleton = new UndeadKnight(); break;
}
skeleton.Team = this.Team;
bool validLocation = false;
Point3D loc = this.Location;
for (int j = 0; !validLocation && j < 10; ++j)
{
int x = X + Utility.Random(3) - 1;
int y = Y + Utility.Random(3) - 1;
int z = map.GetAverageZ(x, y);
if (validLocation = map.CanFit(x, y, this.Z, 16, false, false))
loc = new Point3D(x, y, Z);
else if (validLocation = map.CanFit(x, y, z, 16, false, false))
loc = new Point3D(x, y, z);
}
skeleton.MoveToWorld(loc, map);
skeleton.Combatant = target;
}
}
}
public override void OnThink()
{
if (Hits < 250 && DateTime.Now >= m_NextPowerWordKillTime)
PowerWordKill();
}
public void DoSpecialAbility(Mobile target)
{
if (Hits < 500 )
SpawnUndeadArmy(target);
}
public override void OnGotMeleeAttack(Mobile attacker)
{
base.OnGotMeleeAttack(attacker);
DoSpecialAbility(attacker);
}
public override void OnGaveMeleeAttack(Mobile defender)
{
base.OnGaveMeleeAttack(defender);
DoSpecialAbility(defender);
}
public FallenDupre( Serial serial ) : base( serial )
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
}
+19 -8
View File
@@ -21,14 +21,17 @@ namespace Server.Items
[Constructable]
public HeritageSovereign(int amount) : base(0x14EF) // ORIGINAL ITEM ID
{
LootType = LootType.Blessed;
LootType = LootType.Cursed;
Hue = 2713; // ORIGINAL HUE
Stackable = true;
Amount = amount;
UpdateName();
}
public static bool CanSearch(Mobile m)
{
return m != null && m.Region.GetLogoutDelay(m) <= TimeSpan.Zero;
}
public HeritageSovereign(Serial serial) : base(serial)
{
}
@@ -65,13 +68,21 @@ namespace Server.Items
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
if (from.AccessLevel < AccessLevel.Counselor && !CanSearch(from))
{
// Before using the in game store, you must be in a safe log-out location
// such as an inn or a house which has you on its Owner, Co-owner, or Friends list.
from.SendLocalizedMessage(1156586);
return;
}
else if (!IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1042001); // Must be in pack
return;
}
if (from is PlayerMobile pm)
else if (from is PlayerMobile pm)
{
pm.DepositSovereigns(Amount);
Delete();
@@ -161,7 +172,7 @@ namespace Server.CustomSystems
// 4. Determine Drop Chance
if (!isEndgameBoss)
{
if (Utility.RandomDouble() > 0.10)
if (Utility.RandomDouble() > 0.05)
return;
}
@@ -171,7 +182,7 @@ namespace Server.CustomSystems
if (isEndgameBoss)
{
baseReward = 200;
baseReward = 100;
}
else
{
@@ -180,9 +191,9 @@ namespace Server.CustomSystems
else if (maxHits >= 1000 && maxHits < 5000)
baseReward = 10;
else if (maxHits >= 5000 && maxHits < 10000)
baseReward = 50;
baseReward = 25;
else if (maxHits >= 10000)
baseReward = 100;
baseReward = 50;
}
if (baseReward == 0)
-45
View File
@@ -1,45 +0,0 @@
using System;
using Server;
using Server.Mobiles;
using Server.Gumps;
public class InsuranceAgent : BaseCreature
{
[Constructable]
public InsuranceAgent()
: base(AIType.AI_Vendor, FightMode.None, 0, 0, 0.2, 0.4)
{
Name = "an Insurance Agent";
Body = 0x190; // male human
Hue = Utility.RandomSkinHue();
Blessed = true; // invulnerable
CantWalk = true; // stationary
Frozen = true; // cannot be moved
Warmode = false; // never fights
}
public override void OnDoubleClick(Mobile from)
{
if (from is PlayerMobile pm && pm !=null)
{
this.Say("Here are your insurance options.");
pm.OpenItemInsuranceMenu(new ItemInsuranceMenuGump(pm, pm.Items, null, 0));
}
}
public InsuranceAgent(Serial serial) : base(serial) { }
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
reader.ReadInt();
}
}
+121
View File
@@ -0,0 +1,121 @@
using System;
using Server;
using Server.Items;
using Server.Targeting;
using Server.Engines.XmlSpawner2;
namespace Server.Items
{
public class OilOfRestoration : Item
{
[Constructable]
public OilOfRestoration() : base(0x1C18) // Bottle graphic
{
Name = "Oil of Restoration";
Weight = 1.0;
Hue = 241;
}
public OilOfRestoration(Serial serial) : base(serial)
{
}
public override void OnDoubleClick(Mobile from)
{
if (!IsChildOf(from.Backpack))
{
from.SendMessage("This must be in your pack to use.");
return;
}
from.SendMessage("Select an oil cloth to apply the oil to.");
from.Target = new OilClothTarget(this);
}
private class OilClothTarget : Target
{
private OilOfRestoration m_Oil;
public OilClothTarget(OilOfRestoration oil)
: base(1, false, TargetFlags.None)
{
m_Oil = oil;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Oil.Deleted)
return;
if (!(targeted is OilCloth cloth))
{
from.SendMessage("You must target an oil cloth.");
return;
}
from.SendMessage("Select the item you wish to restore.");
from.Target = new RestoreItemTarget(m_Oil, cloth);
}
}
private class RestoreItemTarget : Target
{
private OilOfRestoration m_Oil;
private OilCloth m_Cloth;
public RestoreItemTarget(OilOfRestoration oil, OilCloth cloth)
: base(1, false, TargetFlags.None)
{
m_Oil = oil;
m_Cloth = cloth;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Oil.Deleted || m_Cloth.Deleted)
return;
if (!(targeted is Item item))
{
from.SendMessage("That is not a valid item.");
return;
}
// Get durability attachment
var dura = XmlAttach.FindAttachment(item, typeof(Server.Custom.DurabilityAttachment))
as Server.Custom.DurabilityAttachment;
if (dura == null || !dura.RepairLocked)
{
from.SendMessage("That item is not tempered and does not require restoration.");
return;
}
// Remove repair lock
dura.RepairLocked = false;
// Refresh tooltip
item.InvalidateProperties();
// Consume both items
m_Oil.Delete();
m_Cloth.Delete();
from.SendMessage("The oil soaks in and restores the malleability of your item.");
from.PlaySound(0x240);
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.Write(0);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
reader.ReadInt();
}
}
}
-140
View File
@@ -1,140 +0,0 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Server
{
public static class MiniJson
{
public static object Parse(string json)
{
return new Parser(json).ParseValue();
}
private class Parser
{
private readonly string _json;
private int _index;
public Parser(string json)
{
_json = json;
}
public object ParseValue()
{
SkipWhitespace();
if (_index >= _json.Length)
return null;
char c = _json[_index];
if (c == '{') return ParseObject();
if (c == '[') return ParseArray();
if (c == '"') return ParseString();
if (char.IsDigit(c) || c == '-') return ParseNumber();
return null;
}
private Dictionary<string, object> ParseObject()
{
var dict = new Dictionary<string, object>();
_index++; // skip {
while (true)
{
SkipWhitespace();
if (_json[_index] == '}')
{
_index++;
return dict;
}
string key = ParseString();
SkipWhitespace();
_index++; // skip :
object value = ParseValue();
dict[key] = value;
SkipWhitespace();
if (_json[_index] == ',')
{
_index++;
continue;
}
if (_json[_index] == '}')
{
_index++;
return dict;
}
}
}
private List<object> ParseArray()
{
var list = new List<object>();
_index++; // skip [
while (true)
{
SkipWhitespace();
if (_json[_index] == ']')
{
_index++;
return list;
}
list.Add(ParseValue());
SkipWhitespace();
if (_json[_index] == ',')
{
_index++;
continue;
}
if (_json[_index] == ']')
{
_index++;
return list;
}
}
}
private string ParseString()
{
_index++; // skip "
int start = _index;
while (_json[_index] != '"')
_index++;
string s = _json.Substring(start, _index - start);
_index++; // skip closing "
return s;
}
private object ParseNumber()
{
int start = _index;
while (_index < _json.Length && (char.IsDigit(_json[_index]) || _json[_index] == '-'))
_index++;
string num = _json.Substring(start, _index - start);
return int.Parse(num);
}
private void SkipWhitespace()
{
while (_index < _json.Length && char.IsWhiteSpace(_json[_index]))
_index++;
}
}
}
}
-50
View File
@@ -1,50 +0,0 @@
using Server;
using Server.Gumps;
using Server.Network;
namespace Server.CustomSystems
{
public class RoyalMintGump : Gump
{
private readonly Mobile m_From;
private readonly RoyalMintOfficial m_NPC;
public RoyalMintGump(Mobile from, RoyalMintOfficial npc)
: base(50, 50)
{
m_From = from;
m_NPC = npc;
Closable = true;
Dragable = true;
AddPage(0);
AddBackground(0, 0, 350, 250, 9270);
AddLabel(110, 20, 1152, "Royal Mint Services");
AddButton(40, 70, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddLabel(80, 70, 0x34, "Consolidate Your Notes");
AddButton(40, 120, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddLabel(80, 120, 0x34, "Purchase Mint Box (5000)");
AddButton(40, 170, 4017, 4019, 0, GumpButtonType.Reply, 0);
AddLabel(80, 170, 0x34, "Close");
}
public override void OnResponse(NetState sender, RelayInfo info)
{
switch (info.ButtonID)
{
case 1:
m_NPC.ConsolidateNotes(m_From);
break;
case 2:
m_NPC.PurchaseMintBox(m_From);
break;
}
}
}
}
+8 -55
View File
@@ -15,62 +15,15 @@ namespace Server.CustomSystems
public RoyalMintOfficial()
: base(AIType.AI_Vendor, FightMode.None, 10, 1, 0.2, 0.4)
{
Title = "The Royal Mint Official";
Hue = Utility.RandomSkinHue();
Name = "Royal Mint Official";
Title = "the Sovereign Clerk";
Body = 0x190;
Hue = 33770;
if (Female = Utility.RandomBool())
{
Body = 0x191;
Name = NameList.RandomName("female");
AddItem(new PlateChest());
AddItem(new PlateArms());
AddItem(new PlateLegs());
AddItem(new Cloak(113));
switch (Utility.Random(3))
{
case 0:
AddItem(new Doublet(Utility.RandomNondyedHue()));
break;
case 1:
AddItem(new Tunic(Utility.RandomNondyedHue()));
break;
case 2:
AddItem(new BodySash(Utility.RandomNondyedHue()));
break;
}
}
else
{
Body = 0x190;
Name = NameList.RandomName("male");
AddItem(new PlateChest());
AddItem(new PlateArms());
AddItem(new PlateLegs());
AddItem(new Cloak(113));
switch (Utility.Random(3))
{
case 0:
AddItem(new Doublet(Utility.RandomNondyedHue()));
break;
case 1:
AddItem(new Tunic(Utility.RandomNondyedHue()));
break;
case 2:
AddItem(new BodySash(Utility.RandomNondyedHue()));
break;
}
}
Utility.AssignRandomHair(this);
if (Utility.RandomBool())
{
Utility.AssignRandomFacialHair(this, HairHue);
}
}
AddItem(new Robe(2713));
AddItem(new Sandals(1150));
AddItem(new GoldBracelet());
}
public RoyalMintOfficial(Serial serial) : base(serial)
{
+29 -32
View File
@@ -325,41 +325,38 @@ namespace Server.Gumps
sb.Append(((maxIOCP - curIOCP) * 100) / maxIOCP);
sb.Append("%");
List<BufferPool> pools = BufferPool.Pools;
IList<BufferPool> pools = BufferPool.Pools;
lock (pools)
for (int i = 0; i < pools.Count; ++i)
{
for (int i = 0; i < pools.Count; ++i)
{
BufferPool pool = pools[i];
string name;
int freeCount;
int initialCapacity;
int currentCapacity;
int bufferSize;
int misses;
BufferPool pool = pools[i];
string name;
int freeCount;
int initialCapacity;
int currentCapacity;
int bufferSize;
int misses;
pool.GetInfo(out name, out freeCount, out initialCapacity, out currentCapacity, out bufferSize, out misses);
pool.GetInfo(out name, out freeCount, out initialCapacity, out currentCapacity, out bufferSize, out misses);
if (sb.Length > 0)
sb.Append("<br><br>");
if (sb.Length > 0)
sb.Append("<br><br>");
sb.Append(name);
sb.Append("<br>Size: ");
sb.Append(FormatByteAmount(bufferSize));
sb.Append("<br>Capacity: ");
sb.Append(currentCapacity);
sb.Append(" (");
sb.Append(misses);
sb.Append(" misses)<br>Available: ");
sb.Append(freeCount);
sb.Append("<br>Usage: ");
sb.Append(((currentCapacity - freeCount) * 100) / currentCapacity);
sb.Append("% : ");
sb.Append(FormatByteAmount((currentCapacity - freeCount) * bufferSize));
sb.Append(" of ");
sb.Append(FormatByteAmount(currentCapacity * bufferSize));
}
sb.Append(name);
sb.Append("<br>Size: ");
sb.Append(FormatByteAmount(bufferSize));
sb.Append("<br>Capacity: ");
sb.Append(currentCapacity);
sb.Append(" (");
sb.Append(misses);
sb.Append(" misses)<br>Available: ");
sb.Append(freeCount);
sb.Append("<br>Usage: ");
sb.Append(((currentCapacity - freeCount) * 100) / currentCapacity);
sb.Append("% : ");
sb.Append(FormatByteAmount((currentCapacity - freeCount) * bufferSize));
sb.Append(" of ");
sb.Append(FormatByteAmount(currentCapacity * bufferSize));
}
this.AddLabel(20, 200, LabelHue, "Pooling:");
@@ -2041,7 +2038,7 @@ namespace Server.Gumps
if (level > AccessLevel.VIP)
{
List<NetState> clients = NetState.Instances;
IList<NetState> clients = NetState.Instances;
int count = 0;
for (int i = 0; i < clients.Count; ++i)
@@ -2178,7 +2175,7 @@ namespace Server.Gumps
}
else
{
List<NetState> instances = NetState.Instances;
IList<NetState> instances = NetState.Instances;
for (int i = 0; i < instances.Count; ++i)
{
+1 -1
View File
@@ -81,7 +81,7 @@ namespace Server.Gumps
filter = filter.ToLower();
List<Mobile> list = new List<Mobile>();
List<NetState> states = NetState.Instances;
IList<NetState> states = NetState.Instances;
for (int i = 0; i < states.Count; ++i)
{
@@ -30,7 +30,7 @@ namespace Server
Virtuoso,
Aloron,
Darden,
ForsakenVirtues
ForsakenVirtues
}
public interface ISetItem
+174 -187
View File
@@ -1,65 +1,53 @@
using System;
using Server.Network;
using Server.Targeting;
using Server.Custom; // Required for durability extension methods
namespace Server.Items
{
public class PowderOfTemperament : Item, IUsesRemaining
{
public static bool CanPOFJewelry = Config.Get("Loot.CanPOFJewelry", false);
private int m_UsesRemaining;
[Constructable]
public PowderOfTemperament()
: this(10)
public PowderOfTemperament() : this(10)
{
}
[Constructable]
public PowderOfTemperament(int charges)
: base(4102)
public PowderOfTemperament(int charges) : base(4102)
{
Weight = 1.0;
Hue = 2419;
UsesRemaining = charges;
}
public PowderOfTemperament(Serial serial)
: base(serial)
public PowderOfTemperament(Serial serial) : base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public int UsesRemaining
{
get
{
return m_UsesRemaining;
}
get { return m_UsesRemaining; }
set
{
m_UsesRemaining = value;
InvalidateProperties();
}
}
public bool ShowUsesRemaining
{
get
{
return true;
}
set
{
}
get { return true; }
set { }
}
public override int LabelNumber
{
get
{
return 1049082;
}
}// powder of fortifying
get { return 1049082; } // powder of fortifying
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
@@ -74,31 +62,13 @@ namespace Server.Items
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_UsesRemaining = reader.ReadInt();
break;
}
}
if (version == 0)
m_UsesRemaining = reader.ReadInt();
}
public override void AddUsesRemainingProperties(ObjectPropertyList list)
{
list.Add(1060584, m_UsesRemaining.ToString()); // uses remaining: ~1_val~
}
public virtual void DisplayDurabilityTo(Mobile m)
{
LabelToAffix(m, 1017323, AffixType.Append, ": " + m_UsesRemaining.ToString()); // Durability
}
public override void OnSingleClick(Mobile from)
{
DisplayDurabilityTo(from);
base.OnSingleClick(from);
list.Add(1060584, m_UsesRemaining.ToString());
}
public override void OnDoubleClick(Mobile from)
@@ -106,12 +76,13 @@ namespace Server.Items
if (IsChildOf(from.Backpack))
from.Target = new InternalTarget(this);
else
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
from.SendLocalizedMessage(1042001); // Must be in pack
}
private class InternalTarget : Target
{
private readonly PowderOfTemperament m_Powder;
private PowderOfTemperament m_Powder;
public InternalTarget(PowderOfTemperament powder)
: base(2, false, TargetFlags.None)
{
@@ -122,153 +93,169 @@ namespace Server.Items
{
if (m_Powder.Deleted || m_Powder.UsesRemaining <= 0)
{
from.SendLocalizedMessage(1049086); // You have used up your powder of temperament.
from.SendLocalizedMessage(1049086); // used up
return;
}
if (targeted is Item)
Item item = targeted as Item;
if (item == null)
{
Item item = (Item)targeted;
bool noGo = false;
int antique = 0;
if (!Server.Engines.Craft.Repair.AllowsRepair(item, null) || (item is BaseJewel && !CanPOFJewelry))
{
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
return;
}
#region SA
if (item is BaseWeapon)
{
if (((BaseWeapon)item).Attributes.Brittle > 0 || ((BaseWeapon)item).NegativeAttributes.Brittle > 0)
noGo = true;
antique = ((BaseWeapon)item).NegativeAttributes.Antique;
}
else if (item is BaseArmor)
{
if (((BaseArmor)item).Attributes.Brittle > 0 || ((BaseArmor)item).NegativeAttributes.Brittle > 0)
noGo = true;
antique = ((BaseArmor)item).NegativeAttributes.Antique;
}
else if (item is BaseClothing)
{
if (((BaseClothing)item).Attributes.Brittle > 0 || ((BaseClothing)item).NegativeAttributes.Brittle > 0)
noGo = true;
antique = ((BaseClothing)item).NegativeAttributes.Antique;
}
else if (item is BaseJewel)
{
if (((BaseJewel)item).Attributes.Brittle > 0 || ((BaseJewel)item).NegativeAttributes.Brittle > 0)
noGo = true;
antique = ((BaseJewel)item).NegativeAttributes.Antique;
}
else if (item is BaseTalisman && ((BaseTalisman)item).Attributes.Brittle > 0)
{
noGo = true;
}
if (noGo)
{
from.SendLocalizedMessage(1149799); //That cannot be used on brittle items.
return;
}
#endregion
if (targeted is IDurability)
{
IDurability wearable = (IDurability)targeted;
if (!wearable.CanFortify)
{
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
return;
}
if ((item.IsChildOf(from.Backpack) || (Core.ML && item.Parent == from)) && m_Powder.IsChildOf(from.Backpack))
{
int origMaxHP = wearable.MaxHitPoints;
int origCurHP = wearable.HitPoints;
if (origMaxHP > 0)
{
int initMaxHP = antique <= 0 ? 255 : antique == 1 ? 250 : antique == 2 ? 200 : 150;
wearable.UnscaleDurability();
if (wearable.MaxHitPoints < initMaxHP)
{
if (antique > 0)
{
wearable.MaxHitPoints = initMaxHP;
wearable.HitPoints += initMaxHP;
}
else
{
int bonus = initMaxHP - wearable.MaxHitPoints;
if (bonus > 10)
bonus = 10;
wearable.MaxHitPoints += bonus;
wearable.HitPoints += bonus;
}
wearable.ScaleDurability();
if (wearable.MaxHitPoints > 255)
wearable.MaxHitPoints = 255;
if (wearable.HitPoints > 255)
wearable.HitPoints = 255;
if (wearable.MaxHitPoints > origMaxHP)
{
from.SendLocalizedMessage(1049084); // You successfully use the powder on the item.
from.PlaySound(0x247);
--m_Powder.UsesRemaining;
if (m_Powder.UsesRemaining <= 0)
{
from.SendLocalizedMessage(1049086); // You have used up your powder of fortifying.
m_Powder.Delete();
}
if (antique > 0)
{
if (item is BaseWeapon) ((BaseWeapon)item).NegativeAttributes.Antique++;
if (item is BaseArmor) ((BaseArmor)item).NegativeAttributes.Antique++;
if (item is BaseJewel) ((BaseJewel)item).NegativeAttributes.Antique++;
if (item is BaseClothing) ((BaseClothing)item).NegativeAttributes.Antique++;
}
}
else
{
wearable.MaxHitPoints = origMaxHP;
wearable.HitPoints = origCurHP;
from.SendLocalizedMessage(1049085); // The item cannot be improved any further.
}
}
else
{
from.SendLocalizedMessage(1049085); // The item cannot be improved any further.
wearable.ScaleDurability();
}
}
else
{
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
}
}
else
{
from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
}
}
from.SendLocalizedMessage(1042001);
return;
}
else
// Jewelry cannot be fortified (OSI)
if (item is BaseJewel)
{
from.SendLocalizedMessage(1049083); // You cannot use the powder on that item.
from.SendLocalizedMessage(1049083);
return;
}
// Brittle or Antique items cannot be fortified (OSI)
if (IsBrittle(item) || IsAntique(item))
{
from.SendLocalizedMessage(1049083);
return;
}
IDurability wearable = targeted as IDurability;
if (wearable == null || !wearable.CanFortify)
{
from.SendLocalizedMessage(1049083);
return;
}
if (!(item.IsChildOf(from.Backpack) || (Core.ML && item.Parent == from)) || !m_Powder.IsChildOf(from.Backpack))
{
from.SendLocalizedMessage(1049085);
return;
}
// ===============================
// HARD CAP CHECK — OSI ACCURATE
// ===============================
int oldMax = wearable.MaxHitPoints;
if (oldMax >= 255)
{
from.SendMessage("This item cannot be fortified any further.");
return;
}
// ===============================
// APPLY +10 DURABILITY (CAPPED)
// ===============================
int delta = 10;
if (oldMax + delta > 255)
delta = 255 - oldMax;
if (delta <= 0)
{
from.SendMessage("This item cannot be fortified any further.");
return;
}
int newMax = oldMax + delta;
wearable.MaxHitPoints = newMax;
wearable.HitPoints += delta;
if (wearable.HitPoints > wearable.MaxHitPoints)
wearable.HitPoints = wearable.MaxHitPoints;
// ===============================================
// REMOVE SELF REPAIR ON FIRST PoF USE
// ===============================================
if (item is BaseWeapon bw)
{
bw.WeaponAttributes.SelfRepair = 0;
}
if (item is BaseArmor ba)
{
ba.ArmorAttributes.SelfRepair = 0;
}
if (item is BaseShield bs)
{
bs.ArmorAttributes.SelfRepair = 0;
}
if (item is BaseClothing bc)
{
bc.ClothingAttributes.SelfRepair = 0;
}
// ===============================
// TRACK POF USES
// ===============================
item.SetPoFUses(item.GetPoFUses() + 1);
// ===============================
// APPLY REPAIR LOCK
// ===============================
item.SetRepairLocked(true);
from.SendMessage("You successfully fortify the item.");
from.PlaySound(0x247);
m_Powder.UsesRemaining--;
if (m_Powder.UsesRemaining <= 0)
{
from.SendLocalizedMessage(1049086);
m_Powder.Delete();
}
}
private bool IsBrittle(Item item)
{
BaseWeapon bw = item as BaseWeapon;
if (bw != null && (bw.Attributes.Brittle > 0 || bw.NegativeAttributes.Brittle > 0))
return true;
BaseArmor ba = item as BaseArmor;
if (ba != null && (ba.Attributes.Brittle > 0 || ba.NegativeAttributes.Brittle > 0))
return true;
BaseClothing bc = item as BaseClothing;
if (bc != null && (bc.Attributes.Brittle > 0 || bc.NegativeAttributes.Brittle > 0))
return true;
BaseJewel bj = item as BaseJewel;
if (bj != null && (bj.Attributes.Brittle > 0 || bj.NegativeAttributes.Brittle > 0))
return true;
BaseTalisman bt = item as BaseTalisman;
if (bt != null && bt.Attributes.Brittle > 0)
return true;
return false;
}
private bool IsAntique(Item item)
{
BaseWeapon bw = item as BaseWeapon;
if (bw != null && bw.NegativeAttributes.Antique > 0)
return true;
BaseArmor ba = item as BaseArmor;
if (ba != null && ba.NegativeAttributes.Antique > 0)
return true;
BaseClothing bc = item as BaseClothing;
if (bc != null && bc.NegativeAttributes.Antique > 0)
return true;
BaseJewel bj = item as BaseJewel;
if (bj != null && bj.NegativeAttributes.Antique > 0)
return true;
return false;
}
}
}
+54 -42
View File
@@ -284,7 +284,7 @@ namespace Server.Items
}
}
public virtual bool CanAlter { get { return true; } }
public virtual bool CanAlter { get { return true; } }
public virtual bool UseIntOrDexProperty
{
@@ -424,7 +424,7 @@ namespace Server.Items
if (m_Protection != ArmorProtectionLevel.Regular)
ar += 10 + (5 * (int)m_Protection);
switch ( m_Resource )
switch (m_Resource)
{
case CraftResource.DullCopper:
ar += 2;
@@ -1298,7 +1298,7 @@ namespace Server.Items
{
get
{
switch ( Layer )
switch (Layer)
{
default:
case Layer.Neck:
@@ -1327,7 +1327,7 @@ namespace Server.Items
public int GetProtOffset()
{
switch ( m_Protection )
switch (m_Protection)
{
case ArmorProtectionLevel.Guarding:
return 1;
@@ -1372,10 +1372,10 @@ namespace Server.Items
{
int bonus = 0;
if (m_Quality == ItemQuality.Exceptional &&!(this is GargishLeatherWingArmor))
if (m_Quality == ItemQuality.Exceptional && !(this is GargishLeatherWingArmor))
bonus += 20;
switch ( m_Durability )
switch (m_Durability)
{
case ArmorDurabilityLevel.Durable:
bonus += 20;
@@ -1630,7 +1630,7 @@ namespace Server.Items
PlayerConstructed = 0x01000000,
xAbsorptionAttributes = 0x02000000,
xWeaponAttributes = 0x04000000,
NegativeAttributes = 0x08000000,
NegativeAttributes = 0x08000000,
Altered = 0x10000000,
TalismanProtection = 0x20000000,
EngravedText = 0x40000000
@@ -1903,7 +1903,7 @@ namespace Server.Items
int version = reader.ReadInt();
switch ( version )
switch (version)
{
case 15:
case 14:
@@ -2198,7 +2198,8 @@ namespace Server.Items
if (m_ArmorBase == RevertArmorBase)
m_ArmorBase = -1;
/*m_BodyPos = (ArmorBodyType)*/reader.ReadInt();
/*m_BodyPos = (ArmorBodyType)*/
reader.ReadInt();
if (version < 4)
{
@@ -2217,7 +2218,7 @@ namespace Server.Items
{
OreInfo info;
switch ( reader.ReadInt() )
switch (reader.ReadInt())
{
default:
case 0:
@@ -2682,7 +2683,7 @@ namespace Server.Items
{
int oreType;
switch ( m_Resource )
switch (m_Resource)
{
case CraftResource.DullCopper: oreType = 1053108; break; // dull copper
case CraftResource.ShadowIron: oreType = 1053107; break; // shadow iron
@@ -2701,7 +2702,7 @@ namespace Server.Items
case CraftResource.GreenScales: oreType = 1060819; break; // green
case CraftResource.WhiteScales: oreType = 1060821; break; // white
case CraftResource.BlueScales: oreType = 1060815; break; // blue
case CraftResource.OakWood: oreType = 1072533; break; // oak
case CraftResource.OakWood: oreType = 1072533; break; // oak
case CraftResource.AshWood: oreType = 1072534; break; // ash
case CraftResource.YewWood: oreType = 1072535; break; // yew
case CraftResource.Heartwood: oreType = 1072536; break; // heartwood
@@ -2794,6 +2795,17 @@ namespace Server.Items
{
base.AddNameProperties(list);
// ===============================================
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
// ===============================================
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
as Server.Custom.DurabilityAttachment;
if (dura != null && dura.RepairLocked)
{
list.Add("Tempered — Cannot be repaired");
}
#region Factions
FactionEquipment.AddFactionProperties(this, list);
#endregion
@@ -2896,13 +2908,13 @@ namespace Server.Items
if (m_TalismanProtection != null && !m_TalismanProtection.IsEmpty && m_TalismanProtection.Amount > 0)
list.Add(1072387, "{0}\t{1}", m_TalismanProtection.Name != null ? m_TalismanProtection.Name.ToString() : "Unknown", m_TalismanProtection.Amount); // ~1_NAME~ Protection: +~2_val~%
if ((prop = m_AosArmorAttributes.SoulCharge) != 0)
if ((prop = m_AosArmorAttributes.SoulCharge) != 0)
list.Add(1113630, prop.ToString()); // Soul Charge ~1_val~%
if((prop = m_AosArmorAttributes.ReactiveParalyze) != 0)
if ((prop = m_AosArmorAttributes.ReactiveParalyze) != 0)
list.Add(1112364); // reactive paralyze
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%
if ((prop = m_SAAbsorptionAttributes.EaterCold) != 0)
@@ -2920,7 +2932,7 @@ namespace Server.Items
if ((prop = m_SAAbsorptionAttributes.EaterDamage) != 0)
list.Add(1113598, prop.ToString()); // Damage Eater ~1_Val~%
if ((prop = m_SAAbsorptionAttributes.ResonanceFire) != 0)
if ((prop = m_SAAbsorptionAttributes.ResonanceFire) != 0)
list.Add(1113691, prop.ToString()); // Fire Resonance ~1_val~%
if ((prop = m_SAAbsorptionAttributes.ResonanceCold) != 0)
@@ -2935,40 +2947,40 @@ namespace Server.Items
if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%
if ((prop = m_AosAttributes.SpellChanneling) != 0)
if ((prop = m_AosAttributes.SpellChanneling) != 0)
list.Add(1060482); // spell channeling
if ((prop = m_AosArmorAttributes.SelfRepair) != 0)
if ((prop = m_AosArmorAttributes.SelfRepair) != 0)
list.Add(1060450, prop.ToString()); // self repair ~1_val~
if ((prop = m_AosAttributes.NightSight) != 0)
if ((prop = m_AosAttributes.NightSight) != 0)
list.Add(1060441); // night sight
if ((prop = m_AosAttributes.BonusStr) != 0)
if ((prop = m_AosAttributes.BonusStr) != 0)
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
if ((prop = m_AosAttributes.BonusDex) != 0)
if ((prop = m_AosAttributes.BonusDex) != 0)
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
if ((prop = m_AosAttributes.BonusInt) != 0)
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
if ((prop = m_AosAttributes.BonusHits) != 0)
if ((prop = m_AosAttributes.BonusHits) != 0)
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
if ((prop = m_AosAttributes.BonusStam) != 0)
if ((prop = m_AosAttributes.BonusStam) != 0)
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
if ((prop = m_AosAttributes.BonusMana) != 0)
if ((prop = m_AosAttributes.BonusMana) != 0)
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
if ((prop = m_AosAttributes.RegenHits) != 0)
if ((prop = m_AosAttributes.RegenHits) != 0)
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
if ((prop = m_AosAttributes.RegenStam) != 0)
if ((prop = m_AosAttributes.RegenStam) != 0)
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
if ((prop = m_AosAttributes.RegenMana) != 0)
@@ -2977,7 +2989,7 @@ namespace Server.Items
if ((prop = (GetLuckBonus() + m_AosAttributes.Luck)) != 0)
list.Add(1060436, prop.ToString()); // luck ~1_val~
if ((prop = m_AosAttributes.EnhancePotions) != 0)
if ((prop = m_AosAttributes.EnhancePotions) != 0)
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
@@ -2986,42 +2998,42 @@ namespace Server.Items
if (this is SurgeShield && ((SurgeShield)this).Surge > SurgeType.None)
list.Add(1153098, ((SurgeShield)this).Charges.ToString());
if ((prop = m_AosAttributes.AttackChance) != 0)
if ((prop = m_AosAttributes.AttackChance) != 0)
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
if ((prop = m_AosAttributes.WeaponDamage) != 0)
if ((prop = m_AosAttributes.WeaponDamage) != 0)
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
if ((prop = m_AosAttributes.DefendChance) != 0)
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
if ((prop = m_AosAttributes.CastRecovery) != 0)
if ((prop = m_AosAttributes.CastRecovery) != 0)
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
if ((prop = m_AosAttributes.CastSpeed) != 0)
if ((prop = m_AosAttributes.CastSpeed) != 0)
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
if ((prop = m_AosAttributes.SpellDamage) != 0)
if ((prop = m_AosAttributes.SpellDamage) != 0)
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
if ((prop = m_AosAttributes.LowerManaCost) != 0)
if ((prop = m_AosAttributes.LowerManaCost) != 0)
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
if ((prop = m_AosAttributes.LowerRegCost) != 0)
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
AddResistanceProperties(list);
if ((prop = m_AosArmorAttributes.MageArmor) != 0)
if ((prop = m_AosArmorAttributes.MageArmor) != 0)
list.Add(1060437); // mage armor
if ((prop = GetLowerStatReq()) != 0)
if ((prop = GetLowerStatReq()) != 0)
list.Add(1060435, prop.ToString()); // lower requirements ~1_val~%
if ((prop = ComputeStatReq(StatType.Str)) > 0)
@@ -3122,15 +3134,15 @@ namespace Server.Items
#region Mondain's Legacy
if (!Core.ML || !craftItem.ForceNonExceptional)
{
if (typeRes == null)
typeRes = craftItem.Resources.GetAt(0).ItemType;
if (typeRes == null)
typeRes = craftItem.Resources.GetAt(0).ItemType;
Resource = CraftResources.GetFromType(typeRes);
Resource = CraftResources.GetFromType(typeRes);
}
#endregion
if (typeRes == null || craftItem.ForceNonExceptional)
typeRes = craftItem.Resources.GetAt(0).ItemType;
typeRes = craftItem.Resources.GetAt(0).ItemType;
PlayerConstructed = true;
@@ -1,5 +1,7 @@
using System;
using Server.Network;
using Server.Engines.XmlSpawner2;
namespace Server.Items
{
@@ -69,6 +71,16 @@ namespace Server.Items
public override void AddNameProperties(ObjectPropertyList list)
{
base.AddNameProperties(list);
// ===============================================
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
// ===============================================
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
as Server.Custom.DurabilityAttachment;
if (dura != null && dura.RepairLocked)
{
list.Add("Tempered — Cannot be repaired");
}
if (Core.EJ && LastParryChance > 0)
{
@@ -5,6 +5,8 @@ using Server.Engines.Craft;
using Server.Factions;
using Server.Network;
using Server.Mobiles;
using Server.Engines.XmlSpawner2;
namespace Server.Items
{
@@ -78,7 +80,7 @@ namespace Server.Items
public virtual bool CanFortify { get { return !IsImbued && NegativeAttributes.Antique < 4; } }
public virtual bool CanRepair { get { return m_NegativeAttributes.NoRepair == 0; } }
public virtual bool CanAlter { get { return true; } }
public virtual bool CanAlter { get { return true; } }
private int m_MaxHitPoints;
private int m_HitPoints;
@@ -362,10 +364,10 @@ namespace Server.Items
public AosArmorAttributes ClothingAttributes { get { return m_AosClothingAttributes; } set { } }
[CommandProperty(AccessLevel.GameMaster)]
public AosSkillBonuses SkillBonuses { get { return m_AosSkillBonuses; } set { } }
public AosSkillBonuses SkillBonuses { get { return m_AosSkillBonuses; } set { } }
[CommandProperty(AccessLevel.GameMaster)]
public AosElementAttributes Resistances { get { return m_AosResistances; } set { } }
public AosElementAttributes Resistances { get { return m_AosResistances; } set { } }
[CommandProperty(AccessLevel.GameMaster)]
public SAAbsorptionAttributes SAAbsorptionAttributes { get { return m_SAAbsorptionAttributes; } set { } }
@@ -955,7 +957,7 @@ namespace Server.Items
{
int oreType;
switch ( m_Resource )
switch (m_Resource)
{
case CraftResource.DullCopper:
oreType = 1053108;
@@ -1071,6 +1073,16 @@ namespace Server.Items
public override void AddNameProperties(ObjectPropertyList list)
{
base.AddNameProperties(list);
// ===============================================
// DURABILITY TOOLTIP: TEMPERED / REPAIR LOCKED
// ===============================================
var dura = XmlAttach.FindAttachment(this, typeof(Server.Custom.DurabilityAttachment))
as Server.Custom.DurabilityAttachment;
if (dura != null && dura.RepairLocked)
{
list.Add("Tempered — Cannot be repaired");
}
#region Factions
FactionEquipment.AddFactionProperties(this, list);
@@ -1123,7 +1135,7 @@ namespace Server.Items
if ((prop = ArtifactRarity) > 0)
list.Add(1061078, prop.ToString()); // artifact rarity ~1_val~
#region SA
#region SA
if ((prop = m_SAAbsorptionAttributes.EaterFire) != 0)
list.Add(1113593, prop.ToString()); // Fire Eater ~1_Val~%
@@ -1157,7 +1169,7 @@ namespace Server.Items
if ((prop = m_SAAbsorptionAttributes.ResonanceKinetic) != 0)
list.Add(1113695, prop.ToString()); // Kinetic Resonance ~1_val~%
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
if ((prop = m_SAAbsorptionAttributes.CastingFocus) != 0)
list.Add(1113696, prop.ToString()); // Casting Focus ~1_val~%
#endregion
@@ -1209,90 +1221,90 @@ namespace Server.Items
if ((prop = m_AosAttributes.SpellChanneling) != 0)
list.Add(1060482); // spell channeling
if ((prop = m_AosClothingAttributes.SelfRepair) != 0)
if ((prop = m_AosClothingAttributes.SelfRepair) != 0)
list.Add(1060450, prop.ToString()); // self repair ~1_val~
if ((prop = m_AosAttributes.NightSight) != 0)
if ((prop = m_AosAttributes.NightSight) != 0)
list.Add(1060441); // night sight
if ((prop = m_AosAttributes.BonusStr) != 0)
list.Add(1060485, prop.ToString()); // strength bonus ~1_val~
if ((prop = m_AosAttributes.BonusDex) != 0)
if ((prop = m_AosAttributes.BonusDex) != 0)
list.Add(1060409, prop.ToString()); // dexterity bonus ~1_val~
if ((prop = m_AosAttributes.BonusInt) != 0)
if ((prop = m_AosAttributes.BonusInt) != 0)
list.Add(1060432, prop.ToString()); // intelligence bonus ~1_val~
if ((prop = m_AosAttributes.BonusHits) != 0)
if ((prop = m_AosAttributes.BonusHits) != 0)
list.Add(1060431, prop.ToString()); // hit point increase ~1_val~
if ((prop = m_AosAttributes.BonusStam) != 0)
if ((prop = m_AosAttributes.BonusStam) != 0)
list.Add(1060484, prop.ToString()); // stamina increase ~1_val~
if ((prop = m_AosAttributes.BonusMana) != 0)
if ((prop = m_AosAttributes.BonusMana) != 0)
list.Add(1060439, prop.ToString()); // mana increase ~1_val~
if ((prop = m_AosAttributes.RegenHits) != 0)
list.Add(1060444, prop.ToString()); // hit point regeneration ~1_val~
if ((prop = m_AosAttributes.RegenStam) != 0)
if ((prop = m_AosAttributes.RegenStam) != 0)
list.Add(1060443, prop.ToString()); // stamina regeneration ~1_val~
if ((prop = m_AosAttributes.RegenMana) != 0)
if ((prop = m_AosAttributes.RegenMana) != 0)
list.Add(1060440, prop.ToString()); // mana regeneration ~1_val~
if ((prop = m_AosAttributes.Luck) != 0)
if ((prop = m_AosAttributes.Luck) != 0)
list.Add(1060436, prop.ToString()); // luck ~1_val~
if ((prop = m_AosAttributes.EnhancePotions) != 0)
if ((prop = m_AosAttributes.EnhancePotions) != 0)
list.Add(1060411, prop.ToString()); // enhance potions ~1_val~%
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
if ((prop = m_AosAttributes.ReflectPhysical) != 0)
list.Add(1060442, prop.ToString()); // reflect physical damage ~1_val~%
if ((prop = m_AosAttributes.AttackChance) != 0)
if ((prop = m_AosAttributes.AttackChance) != 0)
list.Add(1060415, prop.ToString()); // hit chance increase ~1_val~%
if ((prop = m_AosAttributes.WeaponSpeed) != 0)
list.Add(1060486, prop.ToString()); // swing speed increase ~1_val~%
if ((prop = m_AosAttributes.WeaponDamage) != 0)
if ((prop = m_AosAttributes.WeaponDamage) != 0)
list.Add(1060401, prop.ToString()); // damage increase ~1_val~%
if ((prop = m_AosAttributes.DefendChance) != 0)
if ((prop = m_AosAttributes.DefendChance) != 0)
list.Add(1060408, prop.ToString()); // defense chance increase ~1_val~%
if ((prop = m_AosAttributes.CastRecovery) != 0)
if ((prop = m_AosAttributes.CastRecovery) != 0)
list.Add(1060412, prop.ToString()); // faster cast recovery ~1_val~
if ((prop = m_AosAttributes.CastSpeed) != 0)
if ((prop = m_AosAttributes.CastSpeed) != 0)
list.Add(1060413, prop.ToString()); // faster casting ~1_val~
if ((prop = m_AosAttributes.SpellDamage) != 0)
if ((prop = m_AosAttributes.SpellDamage) != 0)
list.Add(1060483, prop.ToString()); // spell damage increase ~1_val~%
if ((prop = m_AosAttributes.LowerManaCost) != 0)
if ((prop = m_AosAttributes.LowerManaCost) != 0)
list.Add(1060433, prop.ToString()); // lower mana cost ~1_val~%
if ((prop = m_AosAttributes.LowerRegCost) != 0)
list.Add(1060434, prop.ToString()); // lower reagent cost ~1_val~%
if ((prop = m_AosAttributes.LowerAmmoCost) != 0)
list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
list.Add(1075208, prop.ToString()); // Lower Ammo Cost ~1_Percentage~%
if (Core.ML && (prop = m_AosAttributes.IncreasedKarmaLoss) != 0)
list.Add(1075210, prop.ToString()); // Increased Karma Loss ~1val~%
base.AddResistanceProperties(list);
if ((prop = m_AosClothingAttributes.MageArmor) != 0)
if ((prop = m_AosClothingAttributes.MageArmor) != 0)
list.Add(1060437); // mage armor
if ((prop = m_AosClothingAttributes.LowerStatReq) != 0)
if ((prop = m_AosClothingAttributes.LowerStatReq) != 0)
list.Add(1060435, prop.ToString()); // lower requirements ~1_val~%
if ((prop = ComputeStatReq(StatType.Str)) > 0)
if ((prop = ComputeStatReq(StatType.Str)) > 0)
list.Add(1061170, prop.ToString()); // strength requirement ~1_val~
if ((prop = m_AosClothingAttributes.DurabilityBonus) > 0)
@@ -1402,7 +1414,7 @@ namespace Server.Items
Crafter = 0x00000100,
Quality = 0x00000200,
StrReq = 0x00000400,
NegativeAttributes = 0x00000800,
NegativeAttributes = 0x00000800,
#region Imbuing
//TimesImbued = 0x12000000,
#endregion
@@ -1614,7 +1626,7 @@ namespace Server.Items
int version = reader.ReadInt();
switch ( version )
switch (version)
{
case 12:
case 11:
@@ -1633,10 +1645,10 @@ namespace Server.Items
goto case 8;
}
case 8:
{
m_IsImbued = reader.ReadBool();
goto case 7;
}
{
m_IsImbued = reader.ReadBool();
goto case 7;
}
case 7:
{
m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this, reader);
@@ -1668,7 +1680,7 @@ namespace Server.Items
}
case 6:
{
if(version == 6)
if (version == 6)
m_SAAbsorptionAttributes = new SAAbsorptionAttributes(this);
m_TimesImbued = reader.ReadInt();
@@ -1933,7 +1945,7 @@ namespace Server.Items
{
for (int i = 0; i < amount; ++i)
{
switch ( Utility.Random(5) )
switch (Utility.Random(5))
{
case 0: ++m_AosResistances.Physical; break;
case 1: ++m_AosResistances.Fire; break;
File diff suppressed because it is too large Load Diff
+10 -3
View File
@@ -119,7 +119,7 @@ namespace Server.Items
{
m_BagOfSendingHue = value;
switch ( value )
switch (value)
{
case BagOfSendingHue.Yellow:
Hue = 0x8A5;
@@ -135,7 +135,7 @@ namespace Server.Items
}
public static BagOfSendingHue RandomHue()
{
switch ( Utility.Random(3) )
switch (Utility.Random(3))
{
case 0:
return BagOfSendingHue.Yellow;
@@ -206,7 +206,7 @@ namespace Server.Items
int version = reader.ReadEncodedInt();
switch ( version )
switch (version)
{
case 1:
{
@@ -260,6 +260,13 @@ namespace Server.Items
if (m_Bag.Deleted)
return;
// Block usage anywhere in Felucca
if (from.Map == Map.Felucca)
{
from.SendMessage("A mysterious force prevents the bag from working in Felucca.");
return;
}
if (from.Region.IsPartOf<Regions.Jail>())
{
from.SendMessage("You may not do that in jail.");
+318
View File
@@ -0,0 +1,318 @@
using System;
using System.Collections.Generic;
using Server.ContextMenus;
using Server.Network;
using Server.Targeting;
namespace Server.Items
{
public enum BagOfSendingHue
{
Yellow,
Blue,
Red
}
public class BagOfSending : Item, TranslocationItem
{
private int m_Charges;
private int m_Recharges;
private BagOfSendingHue m_BagOfSendingHue;
[Constructable]
public BagOfSending()
: this(RandomHue())
{
}
[Constructable]
public BagOfSending(BagOfSendingHue hue)
: base(0xE76)
{
Weight = 2.0;
BagOfSendingHue = hue;
m_Charges = Utility.RandomMinMax(3, 9);
}
public BagOfSending(Serial serial)
: base(serial)
{
}
[CommandProperty(AccessLevel.GameMaster)]
public int Charges
{
get
{
return m_Charges;
}
set
{
if (value > MaxCharges)
m_Charges = MaxCharges;
else if (value < 0)
m_Charges = 0;
else
m_Charges = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int Recharges
{
get
{
return m_Recharges;
}
set
{
if (value > MaxRecharges)
m_Recharges = MaxRecharges;
else if (value < 0)
m_Recharges = 0;
else
m_Recharges = value;
InvalidateProperties();
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int MaxCharges
{
get
{
return 30;
}
}
[CommandProperty(AccessLevel.GameMaster)]
public int MaxRecharges
{
get
{
return 255;
}
}
public string TranslocationItemName
{
get
{
return "bag of sending";
}
}
public override int LabelNumber
{
get
{
return 1054104;
}
}// a bag of sending
[CommandProperty(AccessLevel.GameMaster)]
public BagOfSendingHue BagOfSendingHue
{
get
{
return m_BagOfSendingHue;
}
set
{
m_BagOfSendingHue = value;
switch ( value )
{
case BagOfSendingHue.Yellow:
Hue = 0x8A5;
break;
case BagOfSendingHue.Blue:
Hue = 0x8AD;
break;
case BagOfSendingHue.Red:
Hue = 0x89B;
break;
}
}
}
public static BagOfSendingHue RandomHue()
{
switch ( Utility.Random(3) )
{
case 0:
return BagOfSendingHue.Yellow;
case 1:
return BagOfSendingHue.Blue;
default:
return BagOfSendingHue.Red;
}
}
public override void GetProperties(ObjectPropertyList list)
{
base.GetProperties(list);
list.Add(1060741, m_Charges.ToString()); // charges: ~1_val~
}
public override void OnSingleClick(Mobile from)
{
base.OnSingleClick(from);
LabelTo(from, 1060741, m_Charges.ToString()); // charges: ~1_val~
}
public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, list);
if (from.Alive)
list.Add(new UseBagEntry(this, Charges > 0 && IsChildOf(from.Backpack)));
}
public override void OnDoubleClick(Mobile from)
{
if (from.Region.IsPartOf<Regions.Jail>())
{
from.SendMessage("You may not do that in jail.");
}
else if (!IsChildOf(from.Backpack))
{
MessageHelper.SendLocalizedMessageTo(this, from, 1062334, 0x59); // The bag of sending must be in your backpack.
}
else if (Charges == 0)
{
MessageHelper.SendLocalizedMessageTo(this, from, 1042544, 0x59); // This item is out of charges.
}
else
{
from.Target = new SendTarget(this);
}
}
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.WriteEncodedInt((int)1); // version
writer.WriteEncodedInt((int)m_Recharges);
writer.WriteEncodedInt((int)m_Charges);
writer.WriteEncodedInt((int)m_BagOfSendingHue);
}
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadEncodedInt();
switch ( version )
{
case 1:
{
m_Recharges = reader.ReadEncodedInt();
goto case 0;
}
case 0:
{
m_Charges = Math.Min(reader.ReadEncodedInt(), MaxCharges);
m_BagOfSendingHue = (BagOfSendingHue)reader.ReadEncodedInt();
break;
}
}
}
private class UseBagEntry : ContextMenuEntry
{
private readonly BagOfSending m_Bag;
public UseBagEntry(BagOfSending bag, bool enabled)
: base(6189)
{
m_Bag = bag;
if (!enabled)
Flags |= CMEFlags.Disabled;
}
public override void OnClick()
{
if (m_Bag.Deleted)
return;
Mobile from = Owner.From;
if (from.CheckAlive())
m_Bag.OnDoubleClick(from);
}
}
private class SendTarget : Target
{
private readonly BagOfSending m_Bag;
public SendTarget(BagOfSending bag)
: base(-1, false, TargetFlags.None)
{
m_Bag = bag;
}
protected override void OnTarget(Mobile from, object targeted)
{
if (m_Bag.Deleted)
return;
if (from.Region.IsPartOf<Regions.Jail>())
{
from.SendMessage("You may not do that in jail.");
}
else if (!m_Bag.IsChildOf(from.Backpack))
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1062334, 0x59); // The bag of sending must be in your backpack. 1054107 is gone from client, using generic response
}
else if (m_Bag.Charges == 0)
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1042544, 0x59); // This item is out of charges.
}
else if (targeted is Item)
{
Item item = (Item)targeted;
int reqCharges = 1; // (int)Math.Max(1, Math.Ceiling(item.TotalWeight / 10.0));
// change was ML, however reverted during ML period so we can put it at 1
if (!item.IsChildOf(from.Backpack))
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054152, 0x59); // You may only send items from your backpack to your bank box.
}
else if (item is BagOfSending || item is Container)
{
from.Send(new AsciiMessage(m_Bag.Serial, m_Bag.ItemID, MessageType.Regular, 0x3B2, 3, "", "You cannot send a container through the bag of sending."));
}
else if (item.LootType == LootType.Cursed)
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054108, 0x59); // The bag of sending rejects the cursed item.
}
else if (!item.VerifyMove(from) || item is Server.Engines.Quests.QuestItem || item.QuestItem)
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054109, 0x59); // The bag of sending rejects that item.
}
else if (Spells.SpellHelper.IsDoomGauntlet(from.Map, from.Location))
{
from.SendLocalizedMessage(1062089); // You cannot use that here.
}
else if (!from.BankBox.TryDropItem(from, item, false))
{
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054110, 0x59); // Your bank box is full.
}
else if (Core.ML && reqCharges > m_Bag.Charges)
{
from.SendLocalizedMessage(1079932); //You don't have enough charges to send that much weight
}
else
{
m_Bag.Charges -= (Core.ML ? reqCharges : 1);
MessageHelper.SendLocalizedMessageTo(m_Bag, from, 1054150, 0x59); // The item was placed in your bank box.
}
}
}
}
}
}
+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;
}
+2 -2
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)
{
+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()
+1 -1
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;
+1 -1
View File
@@ -284,7 +284,7 @@ namespace Server.Mobiles
int level;
double random = Utility.RandomDouble();
if (0.2 >= random)
if (0.05 >= random)
level = 20;
else if (0.4 >= random)
level = 15;
+4 -2
View File
@@ -2373,10 +2373,12 @@ namespace Server.Mobiles
}
}
}
else if (Siege.SiegeShard)
/* else if (Siege.SiegeShard)
{
list.Add(new CallbackEntry(3006168, SiegeBlessItem));
}
} */
list.Add(new CallbackEntry(3006168, SiegeBlessItem));
if (Core.ML && Alive)
{
@@ -47,6 +47,10 @@ namespace Server.Items
case ChampionSkullType.Pain:
Hue = 0x035;
break;
//Soth Skull
case ChampionSkullType.Despair:
Hue = 0x455;
break;
}
}
@@ -10,6 +10,8 @@ namespace Server.Engines.CannedEvil
Venom,
Pain,
Greed,
Death
Death,
//Dupre Skull
Despair
}
}
@@ -467,7 +467,7 @@ namespace Server.Engines.CannedEvil
{
if (RandomizeType)
{
switch (Utility.Random(5))
switch (Utility.Random(6))
{
case 0:
Type = ChampionSpawnType.Abyss; break;
@@ -479,6 +479,7 @@ namespace Server.Engines.CannedEvil
Type = ChampionSpawnType.VerminHorde; break;
case 4:
Type = ChampionSpawnType.UnholyTerror; break;
}
}
@@ -97,7 +97,6 @@ namespace Server.Engines.CleanUpBritannia
Rewards.Add(new CollectionItem(typeof(DragonHeadAddonDeed), 0x2234, 1028756, 0, 50000));
Rewards.Add(new CollectionItem(typeof(NestWithEggs), 0x1AD4, 1026868, 2415, 50000));
if (Core.HS)
{
Rewards.Add(new CollectionItem(typeof(FishermansHat), 0x1716, 1151238, 2578, 50000));
@@ -173,7 +172,6 @@ namespace Server.Engines.CleanUpBritannia
Rewards.Add(new CollectionItem(typeof(MysticsMemento), 0x2F5B, 1154744, 1912, 300000));
Rewards.Add(new CollectionItem(typeof(VollemHeldInCrystal), 0x1f19, 1113629, 1154, 500000));
Rewards.Add(new CollectionItem(typeof(ItemBlessDeed),0x14F0, 1006018, 0, 500000));
}
}
}
+15
View File
@@ -3,6 +3,7 @@ using Server.Items;
using Server.Mobiles;
using Server.Targeting;
using Server.Factions;
using Server.Custom;
namespace Server.Engines.Craft
{
@@ -225,6 +226,20 @@ namespace Server.Engines.Craft
return;
}
// ===============================
// CUSTOM REPAIR LOCK ENFORCEMENT
// ===============================
Item it = targeted as Item;
if (it != null && it.GetRepairLocked())
{
from.SendMessage("This item has been fortified and cannot be repaired until it is restored.");
if (m_Addon != null)
m_Addon.Using = false;
return;
}
if (m_CraftSystem.CanCraft(from, m_Tool, targeted.GetType()) == 1044267)
{
@@ -25,7 +25,7 @@ namespace Server
typeof(HelmOfSwiftness), typeof(PadsOfTheCuSidhe), typeof(QuiverOfRage), typeof(QuiverOfElements),
typeof(RaedsGlory), typeof(RighteousAnger), typeof(RobeOfTheEclipse), typeof(RobeOfTheEquinox),
typeof(SoulSeeker), typeof(TalonBite), typeof(TotemOfVoid), typeof(WildfireBow),
typeof(Windsong),typeof(UrcuchiallianRidingShoes)
typeof(Windsong)
};
// true - dungeon is enabled, false - dungeon is disabled
private static bool m_PalaceOfParoxysmus;
@@ -2237,8 +2237,8 @@ namespace Server.Mobiles
{
get
{
// go through all online mobiles and see if any have xmlspawner gumps open
List<NetState> states = NetState.Instances;
// go through all online mobiles and see if any have xmlspawner gumps open
IList<NetState> states = NetState.Instances;
for (int i = 0; i < states.Count; ++i)
{
+29 -30
View File
@@ -265,7 +265,7 @@ namespace Server.Spells
{
Type t = item.GetType();
if(t.IsDefined(typeof(DispellableFieldAttribute), false) || t.IsDefined(typeof(DispellableFieldAttribute), true))
if (t.IsDefined(typeof(DispellableFieldAttribute), false) || t.IsDefined(typeof(DispellableFieldAttribute), true))
{
eable.Free();
return false;
@@ -329,13 +329,13 @@ namespace Server.Spells
}
}
protected static void RemoveStatOffsetCallback(object state)
{
if (!(state is Mobile))
return;
// This call has the side-effect of updating all stats
((Mobile)state).CheckStatTimers();
}
protected static void RemoveStatOffsetCallback(object state)
{
if (!(state is Mobile))
return;
// This call has the side-effect of updating all stats
((Mobile)state).CheckStatTimers();
}
public static bool AddStatOffset(Mobile m, StatType type, int offset, TimeSpan duration)
{
@@ -365,7 +365,7 @@ namespace Server.Spells
}
target.AddStatMod(new StatMod(type, name, offset, duration));
Timer.DelayCall(duration, RemoveStatOffsetCallback, target);
Timer.DelayCall(duration, RemoveStatOffsetCallback, target);
return true;
}
@@ -401,13 +401,13 @@ namespace Server.Spells
StatMod mod = target.GetStatMod(name);
if (mod != null)
offset = Math.Max(mod.Offset, offset);
if (mod != null)
offset = Math.Max(mod.Offset, offset);
offset *= -1;
offset *= -1;
target.AddStatMod(new StatMod(type, name, offset, TimeSpan.Zero));
return true;
return true;
}
public static TimeSpan GetDuration(Mobile caster, Mobile target)
@@ -469,7 +469,7 @@ namespace Server.Spells
double percent = GetOffsetScalar(caster, target, curse);
switch( type )
switch (type)
{
case StatType.Str:
return (int)Math.Ceiling(target.RawStr * percent);
@@ -825,13 +825,13 @@ namespace Server.Spells
private static readonly bool[,] m_Rules = new bool[,]
{
/*T2A(Fel), Khaldun, Ilshenar, Wind(Tram), Wind(Fel), Dungeons(Fel), Solen(Tram), Solen(Fel), CrystalCave(Malas), Gauntlet(Malas), Gauntlet(Ferry), SafeZone, Stronghold, ChampionSpawn, Dungeons(Tokuno[Malas]), LampRoom(Doom), GuardianRoom(Doom), Heartwood, MLDungeons, SA Dungeons Tomb of Kings Maze of Death SA Entrance, Eodon*/
/* Recall From */ { false, false, true, true, false, false, true, false, false, false, false, true, true, false, true, false, false, false, false, true, true, false, false, true} ,
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, true, false, true, true, false, false, false, true },
/* Tele To */ { true, true, true, true, true, true, true, true, false, true, false, false, false, true, true, true, true, false, false, true, false, false, false, true },
/* Recall From */ { false, false, true, true, false, false, true, false, false, false, false, true, true, false, true, false, false, false, false, true, true, false, false, true} ,
/* Recall To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate From */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Gate To */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Mark In */ { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false },
/* Tele From */ { true, true, true, true, true, true, true, true, false, true, true, true, false, true, true, true, true, false, true, true, false, false, false, true },
/* Tele To */ { true, true, true, true, true, true, true, true, false, true, false, false, false, true, true, true, true, false, false, true, false, false, false, true },
};
public static void SendInvalidMessage(Mobile caster, TravelCheckType type)
@@ -866,7 +866,6 @@ namespace Server.Spells
return false;
}
if (caster != null)
{
if (caster.IsPlayer())
@@ -887,7 +886,7 @@ namespace Server.Spells
// Always allow monsters to teleport
if (caster is BaseCreature && (type == TravelCheckType.TeleportTo || type == TravelCheckType.TeleportFrom))
{
BaseCreature bc = (BaseCreature) caster;
BaseCreature bc = (BaseCreature)caster;
if (!bc.Controlled && !bc.Summoned)
return true;
@@ -1475,7 +1474,7 @@ namespace Server.Spells
int damageGiven = AOS.Damage(damageable, from, iDamage, phys, fire, cold, pois, nrgy, chaos, direct, dtype);
if(target != null)
if (target != null)
Spells.Mysticism.SpellPlagueSpell.OnMobileDamaged(target);
if (target != null && target.DFA != DFAlgorithm.Standard)
@@ -1485,7 +1484,7 @@ namespace Server.Spells
NegativeAttributes.OnCombatAction(from);
if(from != target)
if (from != target)
NegativeAttributes.OnCombatAction(target);
}
else
@@ -1747,11 +1746,11 @@ namespace Server.Spells
caster.SendLocalizedMessage(1061091); // You cannot cast that spell in this form.
return false;
}
else if (caster.Flying && !(spell is VampiricEmbraceSpell))
{
caster.SendLocalizedMessage(1112567); // You are flying.
return false;
}
else if (caster.Flying && !(spell is VampiricEmbraceSpell))
{
caster.SendLocalizedMessage(1112567); // You are flying.
return false;
}
return true;
}
Executable → Regular
View File
+34 -25
View File
@@ -1,40 +1,49 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.539
# Visual Studio Version 17
VisualStudioVersion = 17.12.35527.113
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EF956787-B078-4D19-B03B-4A8F2A4841AD}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
.travis.yml = .travis.yml
LICENSE = LICENSE
README.md = README.md
ServUO.exe.config = ServUO.exe.config
_makedebug = _makedebug
_makerelease = _makerelease
_windebug.bat = _windebug.bat
_winrelease.bat = _winrelease.bat
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ultima", "Ultima\Ultima.csproj", "{E08CFBE4-E013-44EE-8829-426D05BC083F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Scripts", "Scripts\Scripts.csproj", "{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}"
ProjectSection(ProjectDependencies) = postProject
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3} = {AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{EF956787-B078-4D19-B03B-4A8F2A4841AD}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ultima", "Ultima\Ultima.csproj", "{E08CFBE4-E013-44EE-8829-426D05BC083F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
Debug|x64 = Debug|x64
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}.Debug|Any CPU.Build.0 = Release|Any CPU
{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}.Release|Any CPU.Build.0 = Release|Any CPU
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}.Release|Any CPU.Build.0 = Release|Any CPU
{E08CFBE4-E013-44EE-8829-426D05BC083F}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{E08CFBE4-E013-44EE-8829-426D05BC083F}.Debug|Any CPU.Build.0 = Release|Any CPU
{E08CFBE4-E013-44EE-8829-426D05BC083F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E08CFBE4-E013-44EE-8829-426D05BC083F}.Release|Any CPU.Build.0 = Release|Any CPU
{E08CFBE4-E013-44EE-8829-426D05BC083F}.Debug|x64.ActiveCfg = Debug|x64
{E08CFBE4-E013-44EE-8829-426D05BC083F}.Debug|x64.Build.0 = Debug|x64
{E08CFBE4-E013-44EE-8829-426D05BC083F}.Release|x64.ActiveCfg = Release|x64
{E08CFBE4-E013-44EE-8829-426D05BC083F}.Release|x64.Build.0 = Release|x64
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}.Debug|x64.ActiveCfg = Debug|x64
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}.Debug|x64.Build.0 = Debug|x64
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}.Release|x64.ActiveCfg = Release|x64
{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}.Release|x64.Build.0 = Release|x64
{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}.Debug|x64.ActiveCfg = Debug|x64
{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}.Debug|x64.Build.0 = Debug|x64
{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}.Release|x64.ActiveCfg = Release|x64
{308EA7C6-2873-4E47-AF3F-ABBA3F8AB63E}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+1 -44
View File
@@ -4,12 +4,6 @@ using System.Resources;
using System.Runtime.InteropServices;
#endregion
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("ServUO Server")]
[assembly: AssemblyDescription("Ultima Online Server Emulator")]
[assembly: AssemblyConfiguration("")]
@@ -18,44 +12,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("0.5.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyVersion("57.4")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
+1871 -715
View File
File diff suppressed because it is too large Load Diff
+1 -7
View File
@@ -183,13 +183,7 @@ namespace Server.Gumps
Add(new GumpTooltip(number));
}
public void AddTooltipText(string text)
{
Add(new GumpTooltip(text));
}
public void AddHtml(int x, int y, int width, int height, string text, bool background, bool scrollbar)
public void AddHtml(int x, int y, int width, int height, string text, bool background, bool scrollbar)
{
Add(new GumpHtml(x, y, width, height, text, background, scrollbar));
}
+24 -56
View File
@@ -23,69 +23,37 @@ using Server.Network;
namespace Server.Gumps
{
public class GumpTooltip : GumpEntry
{
private int m_Number;
private string m_Text;
public GumpTooltip(int number)
{
m_Number = number;
}
public GumpTooltip(string text)
{
m_Text = text;
}
public class GumpTooltip : GumpEntry
{
private int m_Number;
public GumpTooltip( int number )
{
m_Number = number;
}
public int Number
{
get
{
return m_Number;
}
set
{
Delta(ref m_Number, value);
}
}
public string Text
{
get
{
return m_Text;
}
set
{
Delta(ref m_Text, value);
}
}
{
get
{
return m_Number;
}
set
{
Delta( ref m_Number, value );
}
}
public override string Compile()
{
if (m_Number == 0 && !string.IsNullOrEmpty(m_Text))
{ // if given: use custom text # TODO UNCHECKED -> AppendTo( IGumpWriter disp ) was used!
return String.Format("{{ tooltip {0} @{1}@ }}", 1042971, m_Text);
}
else
{ // default use cliloc localized text
return string.Format("{{ tooltip {0} }}", m_Number);
}
{
return string.Format("{{ tooltip {0} }}", m_Number);
}
private static byte[] m_LayoutName = Gump.StringToBuffer("tooltip");
private static byte[] m_LayoutName = Gump.StringToBuffer( "tooltip" );
public override void AppendTo(IGumpWriter disp)
{
if (m_Number == 0 && !string.IsNullOrEmpty(m_Text))
{ // if given: use custom text replacing placeholder "~1_NOTHING~"
disp.AppendLayout(Gump.StringToBuffer(String.Format("tooltip {0}@{1}@", 1042971, m_Text)));
}
else
{ // default use given cliloc localized text
disp.AppendLayout(m_LayoutName);
disp.AppendLayout(m_Number);
}
public override void AppendTo( IGumpWriter disp )
{
disp.AppendLayout( m_LayoutName );
disp.AppendLayout( m_Number );
}
}
}
+145 -110
View File
@@ -2137,7 +2137,7 @@ namespace Server
{
return false;
}
else if (Sockets != null && item.Sockets != null)
else if (Sockets != null && item.Sockets != null)
{
if (Sockets.Any(s => !item.HasSocket(s.GetType())))
{
@@ -2515,7 +2515,18 @@ namespace Server
{ }
public virtual void OnAdded(object parent)
{ }
{
// Only enforce insurance when the item is added to a Mobile (player)
if (parent is Mobile newOwner)
{
if (Insured && InsuredBy != Serial.MinusOne && newOwner.Serial != InsuredBy)
{
Insured = false;
InsuredBy = Serial.MinusOne;
newOwner.SendMessage("The insurance on this item has been removed.");
}
}
}
[CommandProperty(AccessLevel.Counselor, AccessLevel.Decorator)]
public Map Map
@@ -2620,15 +2631,15 @@ namespace Server
// 14
writer.Write(Sockets != null ? Sockets.Count : 0);
if(Sockets != null)
{
foreach(var socket in Sockets)
{
ItemSocket.Save(socket, writer);
}
}
if (Sockets != null)
{
foreach (var socket in Sockets)
{
ItemSocket.Save(socket, writer);
}
}
// 13: Merge sync
// 13: Merge sync
// 12: Light no longer backed by Direction
// 11
@@ -3031,6 +3042,7 @@ namespace Server
OnLockDownChange();
}
}
public Serial InsuredBy;
public virtual void OnLockDownChange()
{
@@ -3125,13 +3137,13 @@ namespace Server
case 14:
var socketCount = reader.ReadInt();
for(int i = 0; i < socketCount; i++)
for (int i = 0; i < socketCount; i++)
{
ItemSocket.Load(this, reader);
}
goto case 13;
case 13:
case 13:
case 12:
case 11:
m_GridLocation = reader.ReadByte();
@@ -3185,7 +3197,7 @@ namespace Server
{
m_Light = (LightType)reader.ReadByte();
}
else if(version < 12)
else if (version < 12)
{
m_Light = (LightType)m_Direction;
}
@@ -4619,7 +4631,7 @@ namespace Server
module.Delete();
}
if(Sockets != null)
if (Sockets != null)
{
Sockets.IterateReverse(socket =>
{
@@ -4746,7 +4758,7 @@ namespace Server
o.OnParentLocationChange(oldLocation);
}
}
}
}
public virtual void OnParentLocationChange(Point3D oldLocation)
{ }
@@ -4954,6 +4966,29 @@ namespace Server
root.Obtained(this);
}
}
// Character-bound insurance enforcement
if (!World.Loading && Parent is Mobile newOwner)
{
// Murderers cannot have insured items at all
if (newOwner.Murderer)
{
if (Insured)
{
Insured = false;
InsuredBy = Serial.MinusOne;
newOwner.SendMessage("The Insurance Agency will not cover items owned by murderers.");
}
return;
}
// Character-bound insurance enforcement
if (Insured && InsuredBy != Serial.MinusOne && newOwner.Serial != InsuredBy)
{
Insured = false;
InsuredBy = Serial.MinusOne;
newOwner.SendMessage("The insurance on this item has been removed.");
}
}
}
[CommandProperty(AccessLevel.Decorator)]
@@ -6255,17 +6290,17 @@ namespace Server
public List<ItemSocket> Sockets { get; private set; }
public void AttachSocket(ItemSocket socket)
{
if(Sockets == null)
{
Sockets = new List<ItemSocket>();
}
{
if (Sockets == null)
{
Sockets = new List<ItemSocket>();
}
Sockets.Add(socket);
socket.Owner = this;
Sockets.Add(socket);
socket.Owner = this;
InvalidateProperties();
}
InvalidateProperties();
}
public bool RemoveSocket<T>()
{
@@ -6298,25 +6333,25 @@ namespace Server
InvalidateProperties();
}
public T GetSocket<T>() where T : ItemSocket
{
public T GetSocket<T>() where T : ItemSocket
{
if (Sockets == null)
{
return null;
}
return Sockets.FirstOrDefault(s => s.GetType() == typeof(T)) as T;
}
return Sockets.FirstOrDefault(s => s.GetType() == typeof(T)) as T;
}
public T GetSocket<T>(Func<T, bool> predicate) where T : ItemSocket
{
public T GetSocket<T>(Func<T, bool> predicate) where T : ItemSocket
{
if (Sockets == null)
{
return null;
}
return Sockets.FirstOrDefault(s => s.GetType() == typeof(T) && (predicate == null || predicate(s as T))) as T;
}
return Sockets.FirstOrDefault(s => s.GetType() == typeof(T) && (predicate == null || predicate(s as T))) as T;
}
public ItemSocket GetSocket(Type type)
{
@@ -6329,14 +6364,14 @@ namespace Server
}
public bool HasSocket<T>()
{
{
if (Sockets == null)
{
return false;
}
return Sockets.Any(s => s.GetType() == typeof(T));
}
}
public bool HasSocket(Type t)
{
@@ -6351,71 +6386,71 @@ namespace Server
}
public class ItemSocket
{
[CommandProperty(AccessLevel.GameMaster)]
public Item Owner { get; set; }
{
[CommandProperty(AccessLevel.GameMaster)]
public Item Owner { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public DateTime Expires { get; set; }
[CommandProperty(AccessLevel.GameMaster)]
public DateTime Expires { get; set; }
public virtual TimeSpan TickDuration { get { return TimeSpan.FromMinutes(1); } }
public virtual TimeSpan TickDuration { get { return TimeSpan.FromMinutes(1); } }
public Timer Timer { get; set; }
public Timer Timer { get; set; }
public ItemSocket()
: this(TimeSpan.Zero)
{
}
public ItemSocket(TimeSpan duration)
{
if(duration != TimeSpan.Zero)
{
Expires = DateTime.UtcNow + duration;
public ItemSocket(TimeSpan duration)
{
if (duration != TimeSpan.Zero)
{
Expires = DateTime.UtcNow + duration;
BeginTimer();
}
}
BeginTimer();
}
}
protected void BeginTimer()
{
EndTimer();
protected void BeginTimer()
{
EndTimer();
Timer = Timer.DelayCall(TickDuration, TickDuration, OnTick);
Timer = Timer.DelayCall(TickDuration, TickDuration, OnTick);
Timer.Start();
}
}
protected void EndTimer()
{
if(Timer != null)
{
Timer.Stop();
Timer = null;
}
}
protected void EndTimer()
{
if (Timer != null)
{
Timer.Stop();
Timer = null;
}
}
protected virtual void OnTick()
{
if(Expires < DateTime.UtcNow || Owner.Deleted)
{
Remove();
}
}
protected virtual void OnTick()
{
if (Expires < DateTime.UtcNow || Owner.Deleted)
{
Remove();
}
}
public virtual void Remove()
{
EndTimer();
public virtual void Remove()
{
EndTimer();
Owner.RemoveItemSocket(this);
}
Owner.RemoveItemSocket(this);
}
public virtual void OnRemoved()
{
}
public virtual void OnRemoved()
{
}
public virtual void GetProperties(ObjectPropertyList list)
{
}
public virtual void GetProperties(ObjectPropertyList list)
{
}
public virtual void OnOwnerDuped(Item newItem)
{
@@ -6451,43 +6486,43 @@ namespace Server
{
}
public virtual void Serialize(GenericWriter writer)
{
writer.Write(0);
public virtual void Serialize(GenericWriter writer)
{
writer.Write(0);
writer.Write(Expires);
}
writer.Write(Expires);
}
public virtual void Deserialize(Item owner, GenericReader reader)
{
reader.ReadInt(); // version
public virtual void Deserialize(Item owner, GenericReader reader)
{
reader.ReadInt(); // version
Expires = reader.ReadDateTime();
Expires = reader.ReadDateTime();
if(Expires != DateTime.MinValue)
{
if(Expires < DateTime.UtcNow)
{
return;
}
else
{
BeginTimer();
}
}
if (Expires != DateTime.MinValue)
{
if (Expires < DateTime.UtcNow)
{
return;
}
else
{
BeginTimer();
}
}
owner.AttachSocket(this);
}
owner.AttachSocket(this);
}
public static void Save(ItemSocket socket, GenericWriter writer)
{
writer.Write(socket.GetType().Name);
socket.Serialize(writer);
}
public static void Save(ItemSocket socket, GenericWriter writer)
{
writer.Write(socket.GetType().Name);
socket.Serialize(writer);
}
public static void Load(Item item, GenericReader reader)
{
var typeName = ScriptCompiler.FindTypeByName(reader.ReadString());
public static void Load(Item item, GenericReader reader)
{
var typeName = ScriptCompiler.FindTypeByName(reader.ReadString());
var socket = Activator.CreateInstance(typeName) as ItemSocket;
socket.Deserialize(item, reader);
+15 -4
View File
@@ -47,8 +47,6 @@ namespace Server
private static DateTime _ProfileStart;
private static TimeSpan _ProfileTime;
public static MessagePump MessagePump { get; set; }
public static Slice Slice;
public static bool Profiling
@@ -453,6 +451,19 @@ namespace Server
Process = Process.GetCurrentProcess();
Assembly = Assembly.GetEntryAssembly();
// Disable Windows-only process priority on Linux/Mono
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
{
try
{
Process.PriorityClass = ProcessPriorityClass.High;
}
catch
{
}
}
if (Thread != null)
{
Thread.Name = "Core Thread";
@@ -641,7 +652,7 @@ namespace Server
ScriptCompiler.Invoke("Initialize");
MessagePump messagePump = MessagePump = new MessagePump();
MessagePump.Start();
_TimerThread.Start();
@@ -671,7 +682,7 @@ namespace Server
Item.ProcessDeltaQueue();
Timer.Slice();
messagePump.Slice();
MessagePump.Slice();
NetState.FlushAll();
NetState.ProcessDisposedQueue();
+4 -4
View File
@@ -268,10 +268,10 @@ namespace Server
bin.Close();
}
}
else
{
Console.WriteLine("Warning: Multi data files not found!");
}
}
else
{
Console.WriteLine("Warning: Multi data files not found!");
}
}
}
+72 -82
View File
@@ -1,108 +1,98 @@
#region References
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
#endregion
namespace Server.Network
{
public class BufferPool
{
public static List<BufferPool> Pools { get; private set; }
public class BufferPool
{
private static readonly ConcurrentDictionary<BufferPool, string> m_Pools = new ConcurrentDictionary<BufferPool, string>();
static BufferPool()
{
Pools = new List<BufferPool>();
}
public static ReadOnlyCollection<BufferPool> Pools => (ReadOnlyCollection<BufferPool>)m_Pools.Keys;
private readonly string m_Name;
private readonly string m_Name;
private readonly int m_InitialCapacity;
private readonly int m_BufferSize;
private readonly int m_InitialCapacity;
private readonly int m_BufferSize;
private int m_Misses;
private volatile int m_Misses;
private readonly Queue<byte[]> m_FreeBuffers;
private readonly ConcurrentQueue<byte[]> m_FreeBuffers = new ConcurrentQueue<byte[]>();
public int Count
{
get
{
lock (this)
return m_FreeBuffers.Count;
}
}
public int Count
{
get
{
return m_FreeBuffers.Count;
}
}
public void GetInfo(
out string name,
out int freeCount,
out int initialCapacity,
out int currentCapacity,
out int bufferSize,
out int misses)
{
lock (this)
{
name = m_Name;
freeCount = m_FreeBuffers.Count;
initialCapacity = m_InitialCapacity;
currentCapacity = m_InitialCapacity * (1 + m_Misses);
bufferSize = m_BufferSize;
misses = m_Misses;
}
}
public void GetInfo(
out string name,
out int freeCount,
out int initialCapacity,
out int currentCapacity,
out int bufferSize,
out int misses)
{
name = m_Name;
freeCount = m_FreeBuffers.Count;
initialCapacity = m_InitialCapacity;
currentCapacity = m_InitialCapacity * (1 + m_Misses);
bufferSize = m_BufferSize;
misses = m_Misses;
}
public BufferPool(string name, int initialCapacity, int bufferSize)
{
m_Name = name;
public BufferPool(string name, int initialCapacity, int bufferSize)
{
m_Name = name;
m_InitialCapacity = initialCapacity;
m_BufferSize = bufferSize;
m_InitialCapacity = initialCapacity;
m_BufferSize = bufferSize;
m_FreeBuffers = new Queue<byte[]>(initialCapacity);
while (m_FreeBuffers.Count < initialCapacity)
{
m_FreeBuffers.Enqueue(new byte[bufferSize]);
}
for (int i = 0; i < initialCapacity; ++i)
{
m_FreeBuffers.Enqueue(new byte[bufferSize]);
}
m_Pools[this] = name;
}
lock (Pools)
Pools.Add(this);
}
public byte[] AcquireBuffer()
{
if (m_FreeBuffers.TryDequeue(out var buffer))
{
return buffer;
}
public byte[] AcquireBuffer()
{
lock (this)
{
if (m_FreeBuffers.Count > 0)
{
return m_FreeBuffers.Dequeue();
}
++m_Misses;
++m_Misses;
while (m_FreeBuffers.Count < m_InitialCapacity - 1)
{
m_FreeBuffers.Enqueue(new byte[m_BufferSize]);
}
for (int i = 0; i < m_InitialCapacity; ++i)
{
m_FreeBuffers.Enqueue(new byte[m_BufferSize]);
}
return new byte[m_BufferSize];
}
return m_FreeBuffers.Dequeue();
}
}
public void ReleaseBuffer(byte[] buffer)
{
if (buffer == null || buffer.Length != m_BufferSize)
{
return;
}
public void ReleaseBuffer(byte[] buffer)
{
if (buffer == null)
{
return;
}
Array.Clear(buffer, 0, buffer.Length);
lock (this)
m_FreeBuffers.Enqueue(buffer);
}
m_FreeBuffers.Enqueue(buffer);
}
public void Free()
{
lock (Pools)
Pools.Remove(this);
}
}
public void Free()
{
m_Pools.TryRemove(this, out _);
}
}
}
+514 -248
View File
@@ -1,280 +1,546 @@
#region References
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text;
using System.Threading;
#endregion
namespace Server.Network
{
public class Listener : IDisposable
{
private Socket m_Listener;
private PingListener _PingListener;
public class Listener : IDisposable
{
private static readonly byte[][] m_HttpFilters =
{
Encoding.UTF8.GetBytes("GET"),
Encoding.UTF8.GetBytes("POST"),
Encoding.UTF8.GetBytes("PUT"),
Encoding.UTF8.GetBytes("DELETE"),
Encoding.UTF8.GetBytes("HEAD"),
Encoding.UTF8.GetBytes("OPTIONS"),
Encoding.UTF8.GetBytes("PATCH"),
Encoding.UTF8.GetBytes("CONNECT"),
Encoding.UTF8.GetBytes("TRACE"),
};
private readonly Queue<Socket> m_Accepted;
private readonly object m_AcceptedSyncRoot;
private static readonly BufferPool m_ByteBufferPool = new BufferPool("Login Byte", 1024, 1);
private static readonly BufferPool m_PeekBufferPool = new BufferPool("Login Peek", 1024, 4);
private static readonly BufferPool m_SeedBufferPool = new BufferPool("Login Seed [0xEF]", 1024, PacketHandlers.LoginSeedLength);
private readonly AsyncCallback m_OnAccept;
public static IPAddress Address => Config.Get("Server.Listen", IPAddress.Any);
private static readonly Socket[] m_EmptySockets = new Socket[0];
public static int Port => Config.Get("Server.Port", 2593);
public static IPEndPoint[] EndPoints { get; set; }
public static IPEndPoint[] EndPoints { get; set; } =
{
new IPEndPoint(Address, Port)
};
public Listener(IPEndPoint ipep)
{
m_Accepted = new Queue<Socket>();
m_AcceptedSyncRoot = ((ICollection)m_Accepted).SyncRoot;
private long m_SliceTime, m_SliceCounter;
m_Listener = Bind(ipep);
private long m_Counter, m_AcceptsPerSecond;
if (m_Listener == null)
{
return;
}
public long AcceptsPerSecond => m_AcceptsPerSecond;
DisplayListener();
_PingListener = new PingListener(ipep);
private Socket m_Listener;
m_OnAccept = OnAccept;
try
{
IAsyncResult res = m_Listener.BeginAccept(m_OnAccept, m_Listener);
}
catch (SocketException ex)
{
NetState.TraceException(ex);
}
catch (ObjectDisposedException)
{ }
}
private readonly ConcurrentQueue<SocketState> m_Accepted = new ConcurrentQueue<SocketState>();
private Socket Bind(IPEndPoint ipep)
{
Socket s = new Socket(ipep.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
private readonly AutoResetEvent m_AcceptLimiter = new AutoResetEvent(true);
try
{
s.LingerState.Enabled = false;
private readonly Thread m_AcceptThread;
// Default is 'false' starting Windows Vista and Server 2008. Source: https://msdn.microsoft.com/en-us/library/system.net.sockets.socket.exclusiveaddressuse(v=vs.110).aspx?f=255&MSPPError=-2147217396
s.ExclusiveAddressUse = false;
private SocketAsyncEventArgs m_AcceptArgs;
s.Bind(ipep);
s.Listen(8);
public Listener(IPEndPoint ipep)
{
m_Listener = Bind(ipep);
return s;
}
catch (Exception e)
{
if (e is SocketException)
{
SocketException se = (SocketException)e;
m_SliceTime = Core.TickCount;
if (se.ErrorCode == 10048)
{
// WSAEADDRINUSE
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine("Listener Failed: {0}:{1} (In Use)", ipep.Address, ipep.Port);
Utility.PopColor();
}
else if (se.ErrorCode == 10049)
{
// WSAEADDRNOTAVAIL
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine("Listener Failed: {0}:{1} (Unavailable)", ipep.Address, ipep.Port);
Utility.PopColor();
}
else
{
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine("Listener Exception:");
Console.WriteLine(e);
Utility.PopColor();
}
}
return null;
}
}
private void DisplayListener()
{
IPEndPoint ipep = m_Listener.LocalEndPoint as IPEndPoint;
if (ipep == null)
{
return;
}
if (ipep.Address.Equals(IPAddress.Any) || ipep.Address.Equals(IPAddress.IPv6Any))
{
var adapters = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in adapters)
{
IPInterfaceProperties properties = adapter.GetIPProperties();
foreach (IPAddressInformation unicast in properties.UnicastAddresses)
{
if (ipep.AddressFamily == unicast.Address.AddressFamily)
{
Utility.PushColor(ConsoleColor.Green);
Console.WriteLine("Listening: {0}:{1}", unicast.Address, ipep.Port);
Utility.PopColor();
}
}
}
/*
try {
Console.WriteLine( "Listening: {0}:{1}", IPAddress.Loopback, ipep.Port );
IPHostEntry iphe = Dns.GetHostEntry( Dns.GetHostName() );
IPAddress[] ip = iphe.AddressList;
for ( int i = 0; i < ip.Length; ++i )
Console.WriteLine( "Listening: {0}:{1}", ip[i], ipep.Port );
}
catch { }
*/
}
else
{
Utility.PushColor(ConsoleColor.Green);
Console.WriteLine("Listening: {0}:{1}", ipep.Address, ipep.Port);
Utility.PopColor();
}
Utility.PushColor(ConsoleColor.DarkGreen);
Console.WriteLine(@"----------------------------------------------------------------------");
Utility.PopColor();
}
private void OnAccept(IAsyncResult asyncResult)
{
Socket listener = (Socket)asyncResult.AsyncState;
Socket accepted = null;
try
{
accepted = listener.EndAccept(asyncResult);
}
catch (SocketException ex)
{
NetState.TraceException(ex);
}
catch (ObjectDisposedException)
{
return;
}
if (accepted != null)
{
if (VerifySocket(accepted))
{
Enqueue(accepted);
}
else
{
Release(accepted);
}
}
try
{
listener.BeginAccept(m_OnAccept, listener);
}
catch (SocketException ex)
{
NetState.TraceException(ex);
}
catch (ObjectDisposedException)
{ }
}
private bool VerifySocket(Socket socket)
{
try
{
SocketConnectEventArgs args = new SocketConnectEventArgs(socket);
EventSink.InvokeSocketConnect(args);
return args.AllowConnection;
}
catch (Exception ex)
{
NetState.TraceException(ex);
return false;
}
}
private void Enqueue(Socket socket)
{
lock (m_AcceptedSyncRoot)
{
m_Accepted.Enqueue(socket);
}
Core.Set();
}
private void Release(Socket socket)
{
try
{
socket.Shutdown(SocketShutdown.Both);
}
catch (SocketException ex)
{
NetState.TraceException(ex);
}
try
{
socket.Close();
}
catch (SocketException ex)
{
NetState.TraceException(ex);
}
}
public Socket[] Slice()
{
Socket[] array;
lock (m_AcceptedSyncRoot)
{
if (m_Accepted.Count == 0)
{
return m_EmptySockets;
}
array = m_Accepted.ToArray();
m_Accepted.Clear();
}
return array;
}
public void Dispose()
{
Socket socket = Interlocked.Exchange(ref m_Listener, null);
if (socket != null)
{
socket.Close();
}
if (_PingListener == null)
if (m_Listener == null)
{
return;
}
_PingListener.Dispose();
_PingListener = null;
DisplayListener();
m_AcceptThread = new Thread(AcceptLoop)
{
Name = $"Login Accept Processor",
Priority = ThreadPriority.AboveNormal,
};
m_AcceptThread.Start();
}
}
private Socket Bind(IPEndPoint ipep)
{
Socket s = new Socket(ipep.AddressFamily, SocketType.Stream, ProtocolType.Tcp)
{
SendTimeout = 1000,
ReceiveTimeout = 1000,
ExclusiveAddressUse = false,
UseOnlyOverlappedIO = false,
NoDelay = true,
LingerState =
{
Enabled = true,
LingerTime = 0,
},
};
try
{
s.Bind(ipep);
s.Listen(1000);
return s;
}
catch (Exception e)
{
if (e is SocketException se)
{
if (se.ErrorCode == 10048)
{
// WSAEADDRINUSE
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine("Listener Failed: {0}:{1} (In Use)", ipep.Address, ipep.Port);
Utility.PopColor();
}
else if (se.ErrorCode == 10049)
{
// WSAEADDRNOTAVAIL
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine("Listener Failed: {0}:{1} (Unavailable)", ipep.Address, ipep.Port);
Utility.PopColor();
}
else
{
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine("Listener Exception:");
Console.WriteLine(e);
Utility.PopColor();
}
}
return null;
}
}
private void DisplayListener()
{
if (!(m_Listener.LocalEndPoint is IPEndPoint ipep))
{
return;
}
if (ipep.Address.Equals(IPAddress.Any) || ipep.Address.Equals(IPAddress.IPv6Any))
{
NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces();
foreach (NetworkInterface adapter in adapters)
{
IPInterfaceProperties properties = adapter.GetIPProperties();
foreach (IPAddressInformation unicast in properties.UnicastAddresses)
{
if (ipep.AddressFamily == unicast.Address.AddressFamily)
{
Utility.PushColor(ConsoleColor.Green);
Console.WriteLine("Listening: {0}:{1}", unicast.Address, ipep.Port);
Utility.PopColor();
}
}
}
}
else
{
Utility.PushColor(ConsoleColor.Green);
Console.WriteLine("Listening: {0}:{1}", ipep.Address, ipep.Port);
Utility.PopColor();
}
Utility.PushColor(ConsoleColor.DarkGreen);
Console.WriteLine(@"----------------------------------------------------------------------");
Utility.PopColor();
}
private SocketAsyncEventArgs Reset(ref SocketAsyncEventArgs e)
{
if (e == null)
{
e = new SocketAsyncEventArgs();
e.Completed += OnAccept;
}
e.UserToken = this;
e.AcceptSocket = null;
e.RemoteEndPoint = null;
e.SocketFlags = 0;
e.SocketError = 0;
e.DisconnectReuseSocket = true;
return e;
}
[STAThread]
private void AcceptLoop()
{
while (m_Listener != null)
{
Accept();
}
}
private void Accept()
{
if (!m_AcceptLimiter.WaitOne(10))
{
return;
}
if (m_Listener == null)
{
return;
}
SocketAsyncEventArgs e = Reset(ref m_AcceptArgs);
bool iocp;
try
{
iocp = m_Listener.AcceptAsync(e);
}
catch
{
iocp = false;
}
if (!iocp)
{
OnAccept(e);
}
}
private void OnAccept(object sender, SocketAsyncEventArgs e)
{
OnAccept(e);
}
private void OnAccept(SocketAsyncEventArgs e)
{
try
{
Socket accepted = e.AcceptSocket;
SocketError error = e.SocketError;
m_AcceptArgs = Reset(ref e);
if (accepted == null)
{
return;
}
Interlocked.Increment(ref m_Counter);
accepted.NoDelay = true;
if (error != 0)
{
Release(false, ref accepted);
return;
}
try
{
accepted.SendTimeout = 1000;
accepted.ReceiveTimeout = 1000;
_ = ThreadPool.QueueUserWorkItem(o =>
{
Socket s = (Socket)o;
if (ValidateSequence(s, out byte[] seed))
{
Enqueue(s, seed);
}
else
{
Release(false, ref s);
}
}, accepted);
}
catch
{
Release(false, ref accepted);
}
}
finally
{
m_AcceptLimiter.Set();
}
}
private bool ValidateSequence(Socket socket, out byte[] buffer)
{
buffer = null;
byte[] peek;
try
{
peek = m_PeekBufferPool.AcquireBuffer();
}
catch
{
return false;
}
try
{
int recv = socket.Receive(peek, peek.Length, SocketFlags.None);
if (recv < peek.Length)
{
return false;
}
bool allow = false;
int index = 0;
byte packetID = peek[index++];
if (packetID == 0xEF)
{
byte[] packet = m_SeedBufferPool.AcquireBuffer();
try
{
var diff = packet.Length - peek.Length;
recv = socket.Receive(packet, peek.Length, diff, SocketFlags.None);
if (recv == diff)
{
Buffer.BlockCopy(peek, 0, packet, 0, peek.Length);
uint seed = readU32(packet, ref index);
if (seed != 0)
{
uint clientMaj = readU32(packet, ref index);
uint clientMin = readU32(packet, ref index);
uint clientRev = readU32(packet, ref index);
uint clientPat = readU32(packet, ref index);
uint version = (clientMaj << 24) | (clientMin << 16) | (clientRev << 8) | clientPat;
if (version != 0)
{
allow = true;
buffer = packet.ToArray();
}
}
}
}
finally
{
m_SeedBufferPool.ReleaseBuffer(packet);
}
}
else if (!Match(peek))
{
index = packetID = 0;
uint seed = readU32(peek, ref index);
if (seed != 0)
{
var one = m_ByteBufferPool.AcquireBuffer();
try
{
recv = socket.Receive(one, 0, one.Length, SocketFlags.None);
if (recv == one.Length)
{
packetID = one[0];
if (!MessagePump.CheckEncrypted(packetID))
{
allow = true;
buffer = new byte[peek.Length + one.Length];
Buffer.BlockCopy(peek, 0, buffer, 0, peek.Length);
Buffer.BlockCopy(one, 0, buffer, peek.Length, one.Length);
}
}
}
finally
{
m_ByteBufferPool.ReleaseBuffer(one);
}
}
}
return allow;
}
catch
{
return false;
}
finally
{
m_PeekBufferPool.ReleaseBuffer(peek);
}
uint readU32(byte[] b, ref int i)
{
return (uint)((b[i++] << 24) | (b[i++] << 16) | (b[i++] << 8) | b[i++]);
}
}
private bool Match(byte[] buffer)
{
for (int i = 0; i < m_HttpFilters.Length; i++)
{
byte[] filter = m_HttpFilters[i];
if (filter?.Length > 0)
{
IEnumerable<byte> fseq = filter;
IEnumerable<byte> pseq = buffer;
if (filter.Length > buffer.Length)
{
fseq = fseq.Take(buffer.Length);
}
else if (buffer.Length > filter.Length)
{
pseq = pseq.Take(filter.Length);
}
if (Enumerable.SequenceEqual(fseq, pseq))
{
return true;
}
}
}
return false;
}
private void Enqueue(Socket socket, byte[] seed)
{
m_Accepted.Enqueue(new SocketState(socket, seed));
Core.Set();
}
private void Release(bool graceful, ref Socket socket)
{
if (socket != null)
{
try
{
if (graceful)
{
try
{
socket.Shutdown(SocketShutdown.Both);
}
catch (SocketException ex)
{
NetState.TraceException(ex);
}
}
if (socket.LingerState != null)
{
socket.LingerState.Enabled = true;
socket.LingerState.LingerTime = graceful ? 1 : 0;
}
else
{
socket.LingerState = new LingerOption(true, graceful ? 1 : 0);
}
}
catch
{
}
finally
{
socket.Close();
socket = null;
}
}
}
public IEnumerable<SocketState> Slice()
{
long now = Core.TickCount;
if (now - m_SliceTime >= 1000)
{
var count = m_Counter;
Interlocked.Exchange(ref m_SliceTime, now);
Interlocked.Exchange(ref m_AcceptsPerSecond, count - m_SliceCounter);
Interlocked.Exchange(ref m_SliceCounter, count);
}
int limit = Math.Min(m_Accepted.Count, 100);
while (--limit >= 0 && m_Accepted.TryDequeue(out SocketState accepted))
{
Socket socket = accepted.Socket;
SocketConnectEventArgs args = new SocketConnectEventArgs(socket);
EventSink.InvokeSocketConnect(args);
if (args.AllowConnection)
{
yield return accepted;
}
else
{
Release(true, ref socket);
}
}
}
public void Dispose()
{
Socket socket = Interlocked.Exchange(ref m_Listener, null);
socket?.Close();
}
}
public readonly struct SocketState
{
public readonly Socket Socket;
public readonly byte[] Seed;
public SocketState(Socket socket, byte[] seed)
{
Socket = socket;
Seed = seed;
}
}
}
+62 -63
View File
@@ -1,7 +1,7 @@
#region References
using System;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Collections.Concurrent;
using System.Linq;
using System.Threading;
using Server.Diagnostics;
@@ -9,15 +9,17 @@ using Server.Diagnostics;
namespace Server.Network
{
public class MessagePump
public static class MessagePump
{
private Queue<NetState> m_Queue;
private Queue<NetState> m_WorkingQueue;
private readonly Queue<NetState> m_Throttled;
private static readonly ConcurrentQueue<NetState> m_Queue = new ConcurrentQueue<NetState>();
public Listener[] Listeners { get; set; }
private static readonly ConcurrentQueue<NetState> m_Throttled = new ConcurrentQueue<NetState>();
public MessagePump()
public static Listener[] Listeners { get; private set; }
public static long AcceptsPerSecond => Listeners.Sum(l => l.AcceptsPerSecond);
public static void Start()
{
var ipep = Listener.EndPoints;
@@ -44,13 +46,9 @@ namespace Server.Network
}
}
while (!success);
m_Queue = new Queue<NetState>();
m_WorkingQueue = new Queue<NetState>();
m_Throttled = new Queue<NetState>();
}
public void AddListener(Listener l)
public static void AddListener(Listener l)
{
var old = Listeners;
@@ -64,15 +62,13 @@ namespace Server.Network
Listeners[old.Length] = l;
}
private void CheckListener()
private static void CheckListener()
{
foreach (Listener l in Listeners)
{
var accepted = l.Slice();
foreach (Socket s in accepted)
foreach (SocketState state in l.Slice())
{
NetState ns = new NetState(s, this);
NetState ns = new NetState(state);
ns.Start();
@@ -104,50 +100,41 @@ namespace Server.Network
private static string[] _NoDisplay =
{
"192.99.10.155",
"192.99.69.21",
"54.39.99.106",
};
public void OnReceive(NetState ns)
public static void OnReceive(NetState ns)
{
lock (this)
m_Queue.Enqueue(ns);
m_Queue.Enqueue(ns);
Core.Set();
}
public void Slice()
{
CheckListener();
public static void Slice()
{
CheckListener();
lock (this)
{
var temp = m_WorkingQueue;
m_WorkingQueue = m_Queue;
m_Queue = temp;
}
var limit = m_Queue.Count;
while (m_WorkingQueue.Count > 0)
{
NetState ns = m_WorkingQueue.Dequeue();
while (--limit >= 0 && m_Queue.TryDequeue(out NetState ns))
{
if (ns.Running)
{
HandleReceive(ns);
}
}
if (ns.Running)
{
HandleReceive(ns);
}
}
lock (this)
{
while (m_Throttled.Count > 0)
{
m_Queue.Enqueue(m_Throttled.Dequeue());
}
}
}
while (m_Throttled.TryDequeue(out NetState ns))
{
if (ns.Running)
{
m_Queue.Enqueue(ns);
}
}
}
private const int BufferSize = 4096;
private readonly BufferPool m_Buffers = new BufferPool("Processor", 4, BufferSize);
private static readonly BufferPool m_Buffers = new BufferPool("Processor", 4, BufferSize);
public static bool HandleSeed(NetState ns, ByteQueue buffer)
{
@@ -187,24 +174,36 @@ namespace Server.Network
return false;
}
public static bool CheckEncrypted(NetState ns, int packetID)
{
if (!ns.SentFirstPacket && packetID != 0xF0 && packetID != 0xF1 && packetID != 0xCF && packetID != 0x80 &&
packetID != 0x91 && packetID != 0xA4 && packetID != 0xEF && packetID != 0xE4 && packetID != 0xFF)
{
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine("Client: {0}: Encrypted Client Unsupported", ns);
Utility.PopColor();
public static bool CheckEncrypted(NetState ns, int packetID)
{
if (ns.SentFirstPacket || !CheckEncrypted(packetID))
{
return false;
}
ns.Dispose();
Utility.PushColor(ConsoleColor.Red);
Console.WriteLine("Client: {0}: Encrypted Client Unsupported", ns);
Utility.PopColor();
return true;
}
ns.Dispose();
return false;
return true;
}
public static bool CheckEncrypted(int packetID)
{
return packetID != 0xF0
&& packetID != 0xF1
&& packetID != 0xCF
&& packetID != 0x80
&& packetID != 0x91
&& packetID != 0xA4
&& packetID != 0xEF
&& packetID != 0xE4
&& packetID != 0xFF;
}
public void HandleReceive(NetState ns)
public static void HandleReceive(NetState ns)
{
ByteQueue buffer = ns.Buffer;
+1101 -1095
View File
File diff suppressed because it is too large Load Diff
+4 -2
View File
@@ -48,9 +48,11 @@ namespace Server.Network
private static readonly EncodedPacketHandler[] m_EncodedHandlersLow;
private static readonly Dictionary<int, EncodedPacketHandler> m_EncodedHandlersHigh;
public static PacketHandler[] Handlers { get { return m_Handlers; } }
public static PacketHandler[] Handlers { get { return m_Handlers; } }
static PacketHandlers()
public static int LoginSeedLength => Handlers[0xEF]?.Length ?? -1;
static PacketHandlers()
{
m_Handlers = new PacketHandler[0x100];
m_6017Handlers = new PacketHandler[0x100];
+75 -102
View File
@@ -1,6 +1,7 @@
#region References
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Threading;
#endregion
namespace Server.Network
@@ -9,29 +10,20 @@ namespace Server.Network
{
public class Gram
{
private static readonly Stack<Gram> _pool = new Stack<Gram>();
private static readonly ConcurrentQueue<Gram> _pool = new ConcurrentQueue<Gram>();
public static Gram Acquire()
{
lock (_pool)
{
Gram gram;
public static Gram Acquire()
{
if (!_pool.TryDequeue(out Gram gram))
{
gram = new Gram();
}
if (_pool.Count > 0)
{
gram = _pool.Pop();
}
else
{
gram = new Gram();
}
gram._buffer = AcquireBuffer();
gram._length = 0;
gram._buffer = AcquireBuffer();
gram._length = 0;
return gram;
}
}
return gram;
}
private byte[] _buffer;
private int _length;
@@ -58,14 +50,12 @@ namespace Server.Network
return write;
}
public void Release()
{
lock (_pool)
{
_pool.Push(this);
ReleaseBuffer(_buffer);
}
}
public void Release()
{
_pool.Enqueue(this);
ReleaseBuffer(_buffer);
}
}
private static int m_CoalesceBufferSize = 512;
@@ -74,77 +64,60 @@ namespace Server.Network
public static int CoalesceBufferSize
{
get { return m_CoalesceBufferSize; }
set
{
if (m_CoalesceBufferSize == value)
{
return;
}
set
{
if (m_CoalesceBufferSize == value)
{
return;
}
BufferPool old = m_UnusedBuffers;
m_UnusedBuffers?.Free();
lock (old)
{
if (m_UnusedBuffers != null)
{
m_UnusedBuffers.Free();
}
m_CoalesceBufferSize = value;
m_UnusedBuffers = new BufferPool("Coalesced", 2048, m_CoalesceBufferSize);
}
}
m_CoalesceBufferSize = value;
m_UnusedBuffers = new BufferPool("Coalesced", 2048, m_CoalesceBufferSize);
}
}
public static byte[] AcquireBuffer()
{
lock (m_UnusedBuffers)
return m_UnusedBuffers.AcquireBuffer();
return m_UnusedBuffers.AcquireBuffer();
}
public static void ReleaseBuffer(byte[] buffer)
{
lock (m_UnusedBuffers)
if (buffer != null && buffer.Length == m_CoalesceBufferSize)
{
m_UnusedBuffers.ReleaseBuffer(buffer);
}
}
public static void ReleaseBuffer(byte[] buffer)
{
if (buffer != null && buffer.Length == m_CoalesceBufferSize)
{
m_UnusedBuffers.ReleaseBuffer(buffer);
}
}
private readonly Queue<Gram> _pending;
private readonly ConcurrentQueue<Gram> _pending = new ConcurrentQueue<Gram>();
private Gram _buffered;
private volatile Gram _buffered;
public bool IsFlushReady { get { return (_pending.Count == 0 && _buffered != null); } }
public bool IsEmpty { get { return (_pending.Count == 0 && _buffered == null); } }
public SendQueue()
{
_pending = new Queue<Gram>();
}
public Gram CheckFlushReady()
{
Gram gram = _buffered;
_pending.Enqueue(_buffered);
_buffered = null;
Gram gram = Interlocked.Exchange(ref _buffered, null);
_pending.Enqueue(gram);
return gram;
}
public Gram Dequeue()
{
Gram gram = null;
if (_pending.TryDequeue(out Gram gram))
{
gram?.Release();
gram = null;
if (_pending.Count > 0)
{
_pending.Dequeue().Release();
if (_pending.Count > 0)
{
gram = _pending.Peek();
}
}
if (_pending.TryPeek(out Gram peek))
gram = peek;
}
return gram;
}
@@ -177,41 +150,41 @@ namespace Server.Network
throw new ArgumentException("Offset and length do not point to a valid segment within the buffer.");
}
int existingBytes = (_pending.Count * m_CoalesceBufferSize) + (_buffered == null ? 0 : _buffered.Length);
int existingBytes = (_pending.Count * m_CoalesceBufferSize) + (_buffered?.Length ?? 0);
if ((existingBytes + length) > PendingCap)
{
throw new CapacityExceededException();
}
Gram gram = null;
Gram gram = null;
while (length > 0)
{
if (_buffered == null)
{
// nothing yet buffered
_buffered = Gram.Acquire();
}
while (length > 0)
{
if (_buffered == null)
{
// nothing yet buffered
_buffered = Gram.Acquire();
}
int bytesWritten = _buffered.Write(buffer, offset, length);
int bytesWritten = _buffered.Write(buffer, offset, length);
offset += bytesWritten;
length -= bytesWritten;
offset += bytesWritten;
length -= bytesWritten;
if (_buffered.IsFull)
{
if (_pending.Count == 0)
{
gram = _buffered;
}
if (_buffered.IsFull)
{
if (_pending.Count == 0)
{
gram = _buffered;
}
_pending.Enqueue(_buffered);
_buffered = null;
}
}
_pending.Enqueue(_buffered);
_buffered = null;
}
}
return gram;
return gram;
}
public void Clear()
@@ -222,9 +195,9 @@ namespace Server.Network
_buffered = null;
}
while (_pending.Count > 0)
while (_pending.TryDequeue(out Gram gram))
{
_pending.Dequeue().Release();
gram?.Release();
}
}
}
+581 -857
View File
File diff suppressed because it is too large Load Diff
+27 -220
View File
@@ -1,221 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AE4A9EAA-E0EB-4DC9-9604-BE4289F9F6C3}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Server</RootNamespace>
<AssemblyName>ServUO</AssemblyName>
<ApplicationIcon>servuo.ico</ApplicationIcon>
<StartupObject>Server.Core</StartupObject>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.16.10-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;DEBUG;NEWTIMERS;ServUO</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<UseVSHostingProcess>false</UseVSHostingProcess>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<Prefer32Bit>false</Prefer32Bit>
<DefineConstants>TRACE;NEWTIMERS;ServUO</DefineConstants>
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<ApplicationManifest>ServUO.exe.manifest</ApplicationManifest>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<ItemGroup>
<Compile Include=".\AggressorInfo.cs" />
<Compile Include=".\AssemblyInfo.cs" />
<Compile Include=".\Attributes.cs" />
<Compile Include=".\BaseVendor.cs" />
<Compile Include=".\Body.cs" />
<Compile Include=".\ClientVersion.cs" />
<Compile Include=".\Commands.cs" />
<Compile Include=".\ContextMenus\ContextMenu.cs" />
<Compile Include=".\ContextMenus\ContextMenuEntry.cs" />
<Compile Include=".\ContextMenus\OpenBackpackEntry.cs" />
<Compile Include=".\ContextMenus\PaperdollEntry.cs" />
<Compile Include=".\Customs Framework\Central Core\Base Types\BaseCore.cs" />
<Compile Include=".\Customs Framework\Central Core\Base Types\BaseModule.cs" />
<Compile Include=".\Customs Framework\Central Core\Base Types\BaseService.cs" />
<Compile Include=".\Customs Framework\Central Core\Base Types\Events.cs" />
<Compile Include=".\Customs Framework\Central Core\Base Types\SaveData.cs" />
<Compile Include=".\Customs Framework\Central Core\CustomSerial.cs" />
<Compile Include=".\Customs Framework\Central Core\Interfaces.cs" />
<Compile Include=".\Customs Framework\Custom Types\LastEditedBy.cs" />
<Compile Include=".\Customs Framework\Custom Types\Place.cs" />
<Compile Include=".\Customs Framework\Utilities\Decompressor.cs" />
<Compile Include=".\Customs Framework\Utilities\ObjectDumper.cs" />
<Compile Include=".\Customs Framework\Utilities\OutgoingPacketOverride.cs" />
<Compile Include=".\Customs Framework\Utilities\Utilities.cs" />
<Compile Include=".\Diagnostics\BaseProfile.cs" />
<Compile Include=".\Diagnostics\GumpProfile.cs" />
<Compile Include=".\Diagnostics\PacketProfile.cs" />
<Compile Include=".\Diagnostics\TargetProfile.cs" />
<Compile Include=".\Diagnostics\TimerProfile.cs" />
<Compile Include=".\Effects.cs" />
<Compile Include=".\EventLog.cs" />
<Compile Include=".\EventSink.cs" />
<Compile Include=".\ExpansionInfo.cs" />
<Compile Include=".\Geometry.cs" />
<Compile Include=".\Guild.cs" />
<Compile Include=".\HuePicker.cs" />
<Compile Include=".\IAccount.cs" />
<Compile Include=".\IEntity.cs" />
<Compile Include=".\Insensitive.cs" />
<Compile Include=".\Interfaces.cs" />
<Compile Include=".\Item.cs" />
<Compile Include=".\ItemBounds.cs" />
<Compile Include=".\Items\BaseMulti.cs" />
<Compile Include=".\Items\Container.cs" />
<Compile Include=".\Items\Containers.cs" />
<Compile Include=".\Items\SecureTradeContainer.cs" />
<Compile Include=".\Items\VirtualHair.cs" />
<Compile Include=".\KeywordList.cs" />
<Compile Include=".\Main.cs" />
<Compile Include=".\Map.cs" />
<Compile Include=".\Menus\IMenu.cs" />
<Compile Include=".\Menus\ItemListMenu.cs" />
<Compile Include=".\Menus\QuestionMenu.cs" />
<Compile Include=".\Mobile.cs" />
<Compile Include=".\Movement.cs" />
<Compile Include=".\MultiData.cs" />
<Compile Include=".\NativeReader.cs" />
<Compile Include=".\Network\BufferPool.cs" />
<Compile Include=".\Network\ByteQueue.cs" />
<Compile Include=".\Network\Compression.cs" />
<Compile Include=".\Network\EncodedPacketHandler.cs" />
<Compile Include=".\Network\EncodedReader.cs" />
<Compile Include=".\Network\Listener.cs" />
<Compile Include=".\Network\MessagePump.cs" />
<Compile Include=".\Network\NetState.cs" />
<Compile Include=".\Network\PacketHandler.cs" />
<Compile Include=".\Network\PacketHandlers.cs" />
<Compile Include=".\Network\PacketReader.cs" />
<Compile Include=".\Network\Packets.cs" />
<Compile Include=".\Network\PacketWriter.cs" />
<Compile Include=".\Network\SendQueue.cs" />
<Compile Include=".\Notoriety.cs" />
<Compile Include=".\ObjectPropertyList.cs" />
<Compile Include=".\Party.cs" />
<Compile Include=".\Persistence\BinaryMemoryWriter.cs" />
<Compile Include=".\Persistence\DualSaveStrategy.cs" />
<Compile Include=".\Persistence\DynamicSaveStrategy.cs" />
<Compile Include=".\Persistence\FileOperations.cs" />
<Compile Include=".\Persistence\FileQueue.cs" />
<Compile Include=".\Persistence\ParallelSaveStrategy.cs" />
<Compile Include=".\Persistence\QueuedMemoryWriter.cs" />
<Compile Include=".\Persistence\SaveMetrics.cs" />
<Compile Include=".\Persistence\SaveStrategy.cs" />
<Compile Include=".\Persistence\SequentialFileWriter.cs" />
<Compile Include=".\Persistence\StandardSaveStrategy.cs" />
<Compile Include=".\Point3DList.cs" />
<Compile Include=".\Poison.cs" />
<Compile Include=".\Prompt.cs" />
<Compile Include=".\QuestArrow.cs" />
<Compile Include=".\Race.cs" />
<Compile Include=".\Region.cs" />
<Compile Include=".\ScriptCompiler.cs" />
<Compile Include=".\Sector.cs" />
<Compile Include=".\SecureTrade.cs" />
<Compile Include=".\Serial.cs" />
<Compile Include=".\Serialization.cs" />
<Compile Include=".\Skills.cs" />
<Compile Include=".\Targeting\LandTarget.cs" />
<Compile Include=".\Targeting\MultiTarget.cs" />
<Compile Include=".\Targeting\StaticTarget.cs" />
<Compile Include=".\Targeting\Target.cs" />
<Compile Include=".\Targeting\TargetCancelType.cs" />
<Compile Include=".\Targeting\TargetFlags.cs" />
<Compile Include=".\TileData.cs" />
<Compile Include=".\TileList.cs" />
<Compile Include=".\TileMatrix.cs" />
<Compile Include=".\TileMatrixPatch.cs" />
<Compile Include=".\Timer.cs" />
<Compile Include=".\Utility.cs" />
<Compile Include=".\VirtueInfo.cs" />
<Compile Include=".\World.cs" />
<Compile Include="Config.cs" />
<Compile Include="Gumps\ECHandleInput.cs" />
<Compile Include="Gumps\Gump.cs" />
<Compile Include="Gumps\GumpAlphaRegion.cs" />
<Compile Include="Gumps\GumpBackground.cs" />
<Compile Include="Gumps\GumpButton.cs" />
<Compile Include="Gumps\GumpCheck.cs" />
<Compile Include="Gumps\GumpEntry.cs" />
<Compile Include="Gumps\GumpGroup.cs" />
<Compile Include="Gumps\GumpHtml.cs" />
<Compile Include="Gumps\GumpHtmlLocalized.cs" />
<Compile Include="Gumps\GumpImage.cs" />
<Compile Include="Gumps\GumpImageTileButton.cs" />
<Compile Include="Gumps\GumpImageTiled.cs" />
<Compile Include="Gumps\GumpItem.cs" />
<Compile Include="Gumps\GumpItemProperty.cs" />
<Compile Include="Gumps\GumpLabel.cs" />
<Compile Include="Gumps\GumpLabelCropped.cs" />
<Compile Include="Gumps\GumpPage.cs" />
<Compile Include="Gumps\GumpRadio.cs" />
<Compile Include="Gumps\GumpSpriteImage.cs" />
<Compile Include="Gumps\GumpTextEntry.cs" />
<Compile Include="Gumps\GumpTextEntryLimited.cs" />
<Compile Include="Gumps\GumpTooltip.cs" />
<Compile Include="Gumps\RelayInfo.cs" />
<Compile Include="Network\PacketThrottles.cs" />
<Compile Include="Network\PingListener.cs" />
<Compile Include="Persistence\Persistence.cs" />
<Compile Include="PromptExtensions.cs" />
<Compile Include="Random.cs" />
<Compile Include="Items\VirtualCheck.cs" />
<Compile Include="SpawnArea.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="servuo.ico" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ultima\Ultima.csproj">
<Project>{e08cfbe4-e013-44ee-8829-426d05bc083f}</Project>
<Name>Ultima</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="ServUO.exe.manifest" />
</ItemGroup>
<Import Project="..\VersionSpecificSymbols.Common.prop" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<OutputType>Exe</OutputType>
<AssemblyName>ServUO</AssemblyName>
<ApplicationIcon>servuo.ico</ApplicationIcon>
<StartupObject>Server.Core</StartupObject>
<ApplicationManifest>ServUO.exe.manifest</ApplicationManifest>
<AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<UseVSHostingProcess>False</UseVSHostingProcess>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<Platforms>x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;DEBUG;NEWTIMERS;ServUO</DefineConstants>
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;NEWTIMERS;ServUO</DefineConstants>
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Ultima\Ultima.csproj" />
</ItemGroup>
</Project>
+1 -1
View File
@@ -319,7 +319,7 @@ namespace Server
}
[CommandProperty(AccessLevel.Counselor, AccessLevel.GameMaster)]
public double Base { get { return (m_Base / 10.0); } set { BaseFixedPoint = (int)(value * 10.0); } }
public double Base { get => m_Base / 10.0; set => BaseFixedPoint = (int)Math.Round(value * 10.0); }
public int CapFixedPoint
{
+1 -43
View File
@@ -4,12 +4,6 @@ using System.Resources;
using System.Runtime.InteropServices;
#endregion
//
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
//
[assembly: AssemblyTitle("UltimaSDK")]
[assembly: AssemblyDescription("The Ultima SDK is a Software Development Kit")]
[assembly: AssemblyConfiguration("")]
@@ -18,43 +12,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyCopyright("")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
//
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("2.0.*")]
//
// In order to sign your assembly you must specify a key to use. Refer to the
// Microsoft .NET Framework documentation for more information on assembly signing.
//
// Use the attributes below to control which key is used for signing.
//
// Notes:
// (*) If no key is specified, the assembly is not signed.
// (*) KeyName refers to a key that has been installed in the Crypto Service
// Provider (CSP) on your machine. KeyFile refers to a file which contains
// a key.
// (*) If the KeyFile and the KeyName values are both specified, the
// following processing occurs:
// (1) If the KeyName can be found in the CSP, that key is used.
// (2) If the KeyName does not exist and the KeyFile does exist, the key
// in the KeyFile is installed into the CSP and used.
// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
// When specifying the KeyFile, the location of the KeyFile should be
// relative to the project output directory which is
// %Project Directory%\obj\<configuration>. For example, if your KeyFile is
// located in the project directory, you would specify the AssemblyKeyFile
// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
// documentation for more information on this.
//
[assembly: AssemblyVersion("2.0")]
[assembly: AssemblyDelaySign(false)]
[assembly: AssemblyKeyFile("")]
[assembly: AssemblyKeyName("")]
+20 -230
View File
@@ -1,231 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<ProjectType>Local</ProjectType>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{E08CFBE4-E013-44EE-8829-426D05BC083F}</ProjectGuid>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ApplicationIcon>
</ApplicationIcon>
<AssemblyKeyContainerName>
</AssemblyKeyContainerName>
<AssemblyName>Ultima</AssemblyName>
<AssemblyOriginatorKeyFile>
</AssemblyOriginatorKeyFile>
<DefaultClientScript>JScript</DefaultClientScript>
<DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout>
<DefaultTargetSchema>IE50</DefaultTargetSchema>
<DelaySign>false</DelaySign>
<OutputType>Library</OutputType>
<RootNamespace>Ultima</RootNamespace>
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<StartupObject>
</StartupObject>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<RuntimeIdentifiers>win7-x64;win7-x86;ubuntu.16.10-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>..\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;DEBUG;NEWTIMERS;ServUO</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>true</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>false</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>full</DebugType>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>..\</OutputPath>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<BaseAddress>285212672</BaseAddress>
<CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
<ConfigurationOverrideFile>
</ConfigurationOverrideFile>
<DefineConstants>TRACE;NEWTIMERS;ServUO</DefineConstants>
<DocumentationFile>
</DocumentationFile>
<DebugSymbols>false</DebugSymbols>
<FileAlignment>4096</FileAlignment>
<NoStdLib>false</NoStdLib>
<NoWarn>
</NoWarn>
<Optimize>true</Optimize>
<RegisterForComInterop>false</RegisterForComInterop>
<RemoveIntegerChecks>false</RemoveIntegerChecks>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<WarningLevel>4</WarningLevel>
<DebugType>none</DebugType>
<ErrorReport>prompt</ErrorReport>
<GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>false</UseVSHostingProcess>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;DEBUG;NEWTIMERS;ServUO</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
<OutputPath>..\</OutputPath>
<BaseAddress>285212672</BaseAddress>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>
</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<DefineConstants>TRACE;NEWTIMERS;ServUO</DefineConstants>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>true</DebugSymbols>
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;DEBUG;NEWTIMERS;ServUO</DefineConstants>
<BaseAddress>285212672</BaseAddress>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>full</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<OutputPath>..\</OutputPath>
<BaseAddress>285212672</BaseAddress>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Optimize>true</Optimize>
<DebugType>
</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>false</Prefer32Bit>
<DefineConstants>TRACE;NEWTIMERS;ServUO</DefineConstants>
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Drawing">
<Name>System.Drawing</Name>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="AnimationEdit.cs" />
<Compile Include="Animations.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Animdata.cs" />
<Compile Include="Art.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ASCIIFont.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="CalibrationInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Client.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="ClientHandles.cs" />
<Compile Include="FileIndex.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Files.cs" />
<Compile Include="Gumps.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Hues.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Light.cs" />
<Compile Include="LocationPointer.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Map.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="MultiMap.cs" />
<Compile Include="Multis.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="NativeMethods.cs" />
<Compile Include="ProcessStream.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="RadarCol.cs" />
<Compile Include="Settings.cs" />
<Compile Include="SkillGroups.cs" />
<Compile Include="Skills.cs" />
<Compile Include="Sound.cs" />
<Compile Include="SpeechList.cs" />
<Compile Include="StringEntry.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="StringList.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Textures.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="TileData.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="TileList.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="TileMatrix.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="TileMatrixPatch.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="UnicodeFont.cs" />
<Compile Include="Verdata.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="WindowProcessStream.cs">
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
</PreBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
<OutputType>Library</OutputType>
<AppendTargetFrameworkToOutputPath>False</AppendTargetFrameworkToOutputPath>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<UseVSHostingProcess>False</UseVSHostingProcess>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<Platforms>x64</Platforms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;DEBUG;NEWTIMERS;ServUO</DefineConstants>
<DebugType>embedded</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\</OutputPath>
<DefineConstants>TRACE;NEWTIMERS;ServUO</DefineConstants>
<DebugType>none</DebugType>
</PropertyGroup>
</Project>