feat: Splits Server in Core and Application (#1806)
> [!Note] > **Developer Note** > Now developers will only need to build/run the Application project instead of everything. > When adding new projects, make sure to: > 1. Add a reference to that project in the Application project. > 2. Add the dll file to the Distribution/Data/assemblies.json file ### Summary - Adds an application project - Consolidates process restarts to use `Core.Kill(true)` - Removes some old messaging, for example processor optimization - Fixes missing build cleanup
This commit is contained in:
parent
e85c56ec2d
commit
60a3a6f501
43 changed files with 572 additions and 585 deletions
|
|
@ -5,24 +5,24 @@ using Server.Tests;
|
|||
using Server.Tests.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace UOContent.Tests
|
||||
namespace UOContent.Tests;
|
||||
|
||||
public class TestBook : BaseBook
|
||||
{
|
||||
public class TestBook : BaseBook
|
||||
public TestBook(int itemID, int pageCount = 20, bool writable = true) : base(itemID, pageCount, writable)
|
||||
{
|
||||
public TestBook(int itemID, int pageCount = 20, bool writable = true) : base(itemID, pageCount, writable)
|
||||
{
|
||||
}
|
||||
|
||||
public TestBook(int itemID, string title, string author, int pageCount, bool writable) : base(itemID, title, author, pageCount, writable)
|
||||
{
|
||||
public TestBook(int itemID, string title, string author, int pageCount, bool writable) : base(itemID, title, author, pageCount, writable)
|
||||
{
|
||||
}
|
||||
|
||||
public TestBook(int itemID, bool writable) : base(itemID, writable)
|
||||
{
|
||||
public TestBook(int itemID, bool writable) : base(itemID, writable)
|
||||
{
|
||||
}
|
||||
|
||||
public TestBook(Serial serial) : base(serial)
|
||||
{
|
||||
public TestBook(Serial serial) : base(serial)
|
||||
{
|
||||
Pages = new BookPageInfo[20];
|
||||
|
||||
for (var i = 0; i < Pages.Length; ++i)
|
||||
|
|
@ -30,14 +30,14 @@ namespace UOContent.Tests
|
|||
Pages[i] = new BookPageInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class BookPacketTests : IClassFixture<ServerFixture>
|
||||
public class BookPacketTests : IClassFixture<ServerFixture>
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("🅵🅰🅽🅲🆈 🆃🅴🆇🆃 Author", "🅵🅰🅽🅲🆈 🆃🅴🆇🆃 Title")]
|
||||
public void TestBookCover(string author, string title)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("🅵🅰🅽🅲🆈 🆃🅴🆇🆃 Author", "🅵🅰🅽🅲🆈 🆃🅴🆇🆃 Title")]
|
||||
public void TestBookCover(string author, string title)
|
||||
{
|
||||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
|
|
@ -53,9 +53,9 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestBookContent()
|
||||
{
|
||||
[Fact]
|
||||
public void TestBookContent()
|
||||
{
|
||||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
|
|
@ -89,5 +89,4 @@ namespace UOContent.Tests
|
|||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
using Server.Items;
|
||||
using Server.Text;
|
||||
|
||||
namespace Server.Network
|
||||
namespace Server.Network;
|
||||
|
||||
public sealed class BookPageDetails : Packet
|
||||
{
|
||||
public sealed class BookPageDetails : Packet
|
||||
public BookPageDetails(BaseBook book) : base(0x66)
|
||||
{
|
||||
public BookPageDetails(BaseBook book) : base(0x66)
|
||||
{
|
||||
EnsureCapacity(256);
|
||||
|
||||
Stream.Write(book.Serial);
|
||||
|
|
@ -28,12 +28,12 @@ namespace Server.Network
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class BookHeader : Packet
|
||||
public sealed class BookHeader : Packet
|
||||
{
|
||||
public BookHeader(Mobile from, BaseBook book) : base(0xD4)
|
||||
{
|
||||
public BookHeader(Mobile from, BaseBook book) : base(0xD4)
|
||||
{
|
||||
var title = book.Title ?? "";
|
||||
var author = book.Author ?? "";
|
||||
|
||||
|
|
@ -55,5 +55,4 @@ namespace Server.Network
|
|||
Stream.Write(authorBuffer, 0, authorBuffer.Length);
|
||||
Stream.Write((byte)0); // terminate
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,17 +5,17 @@ using Server.Tests;
|
|||
using Server.Tests.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace UOContent.Tests
|
||||
namespace UOContent.Tests;
|
||||
|
||||
[Collection("Sequential Tests")]
|
||||
public class BulletinBoardPacketTests : IClassFixture<ServerFixture>
|
||||
{
|
||||
[Collection("Sequential Tests")]
|
||||
public class BulletinBoardPacketTests : IClassFixture<ServerFixture>
|
||||
[Theory]
|
||||
[InlineData("Test Name")]
|
||||
[InlineData(null)]
|
||||
[InlineData("🅵🅰🅽🅲🆈 🆃🅴🆇🆃")]
|
||||
public void TestSendBBDisplayBoard(string boardName)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("Test Name")]
|
||||
[InlineData(null)]
|
||||
[InlineData("🅵🅰🅽🅲🆈 🆃🅴🆇🆃")]
|
||||
public void TestSendBBDisplayBoard(string boardName)
|
||||
{
|
||||
var bb = new TestBulletinBoard(0x234) { BoardName = boardName };
|
||||
|
||||
var expected = new BBDisplayBoard(bb).Compile();
|
||||
|
|
@ -27,15 +27,15 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("The Subject", false, "First Line", "Second Line", "Third Line")]
|
||||
[InlineData("", false, "")]
|
||||
[InlineData("🅵🅰🅽🅲🆈 🆃🅴🆇🆃", false, "First Line", "Second Line")]
|
||||
[InlineData("The Subject", true, "First Line", "Second Line", "Third Line")]
|
||||
[InlineData("", true, "")]
|
||||
[InlineData("🅵🅰🅽🅲🆈 🆃🅴🆇🆃", true, "First Line", "Second Line")]
|
||||
public void TestSendBBHeaderMessage(string subject, bool content, params string[] lines)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData("The Subject", false, "First Line", "Second Line", "Third Line")]
|
||||
[InlineData("", false, "")]
|
||||
[InlineData("🅵🅰🅽🅲🆈 🆃🅴🆇🆃", false, "First Line", "Second Line")]
|
||||
[InlineData("The Subject", true, "First Line", "Second Line", "Third Line")]
|
||||
[InlineData("", true, "")]
|
||||
[InlineData("🅵🅰🅽🅲🆈 🆃🅴🆇🆃", true, "First Line", "Second Line")]
|
||||
public void TestSendBBHeaderMessage(string subject, bool content, params string[] lines)
|
||||
{
|
||||
var poster = new Mobile((Serial)0x1024u) { Name = "Kamron" };
|
||||
poster.DefaultMobileInit();
|
||||
|
||||
|
|
@ -53,16 +53,15 @@ namespace UOContent.Tests
|
|||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
}
|
||||
|
||||
internal class TestBulletinBoard : BaseBulletinBoard
|
||||
{
|
||||
public TestBulletinBoard(int itemID) : base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public TestBulletinBoard(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal class TestBulletinBoard : BaseBulletinBoard
|
||||
{
|
||||
public TestBulletinBoard(int itemID) : base(itemID)
|
||||
{
|
||||
}
|
||||
|
||||
public TestBulletinBoard(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -4,14 +4,14 @@ using Server.Tests;
|
|||
using Server.Tests.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace UOContent.Tests
|
||||
namespace UOContent.Tests;
|
||||
|
||||
[Collection("Sequential Tests")]
|
||||
public class MahjongPacketTests : IClassFixture<ServerFixture>
|
||||
{
|
||||
[Collection("Sequential Tests")]
|
||||
public class MahjongPacketTests : IClassFixture<ServerFixture>
|
||||
[Fact]
|
||||
public void TestMahjongJoinGame()
|
||||
{
|
||||
[Fact]
|
||||
public void TestMahjongJoinGame()
|
||||
{
|
||||
Serial game = (Serial)0x1024u;
|
||||
|
||||
var expected = new MahjongJoinGame(game).Compile();
|
||||
|
|
@ -23,11 +23,11 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true)]
|
||||
[InlineData(false)]
|
||||
public void TestMahjongPlayersInfo(bool showScores)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(true)]
|
||||
[InlineData(false)]
|
||||
public void TestMahjongPlayersInfo(bool showScores)
|
||||
{
|
||||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
|
|
@ -43,13 +43,13 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true, true)]
|
||||
[InlineData(true, false)]
|
||||
[InlineData(false, true)]
|
||||
[InlineData(false, false)]
|
||||
public void TestMahjongGeneralInfo(bool showScores, bool spectatorVision)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(true, true)]
|
||||
[InlineData(true, false)]
|
||||
[InlineData(false, true)]
|
||||
[InlineData(false, false)]
|
||||
public void TestMahjongGeneralInfo(bool showScores, bool spectatorVision)
|
||||
{
|
||||
var game = new MahjongGame { ShowScores = showScores, SpectatorVision = spectatorVision};
|
||||
|
||||
var expected = new MahjongGeneralInfo(game).Compile();
|
||||
|
|
@ -61,11 +61,11 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true)]
|
||||
[InlineData(false)]
|
||||
public void TestMahjongTilesInfo(bool spectatorVision)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(true)]
|
||||
[InlineData(false)]
|
||||
public void TestMahjongTilesInfo(bool spectatorVision)
|
||||
{
|
||||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
|
|
@ -81,11 +81,11 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(true)]
|
||||
[InlineData(false)]
|
||||
public void TestMahjongTileInfo(bool spectatorVision)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(true)]
|
||||
[InlineData(false)]
|
||||
public void TestMahjongTileInfo(bool spectatorVision)
|
||||
{
|
||||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
|
|
@ -101,9 +101,9 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestMahjongRelieve()
|
||||
{
|
||||
[Fact]
|
||||
public void TestMahjongRelieve()
|
||||
{
|
||||
Serial game = (Serial)0x1024u;
|
||||
|
||||
var expected = new MahjongRelieve(game).Compile();
|
||||
|
|
@ -114,5 +114,4 @@ namespace UOContent.Tests
|
|||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,24 +1,24 @@
|
|||
using System.IO;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Engines.Mahjong
|
||||
namespace Server.Engines.Mahjong;
|
||||
|
||||
public sealed class MahjongJoinGame : Packet
|
||||
{
|
||||
public sealed class MahjongJoinGame : Packet
|
||||
public MahjongJoinGame(Serial game) : base(0xDA)
|
||||
{
|
||||
public MahjongJoinGame(Serial game) : base(0xDA)
|
||||
{
|
||||
EnsureCapacity(9);
|
||||
|
||||
Stream.Write(game);
|
||||
Stream.Write((byte)0);
|
||||
Stream.Write((byte)0x19);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MahjongPlayersInfo : Packet
|
||||
public sealed class MahjongPlayersInfo : Packet
|
||||
{
|
||||
public MahjongPlayersInfo(MahjongGame game, Mobile to) : base(0xDA)
|
||||
{
|
||||
public MahjongPlayersInfo(MahjongGame game, Mobile to) : base(0xDA)
|
||||
{
|
||||
var players = game.Players;
|
||||
|
||||
EnsureCapacity(11 + 45 * players.Seats);
|
||||
|
|
@ -86,12 +86,12 @@ namespace Server.Engines.Mahjong
|
|||
Stream.Write((byte)n);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MahjongGeneralInfo : Packet
|
||||
public sealed class MahjongGeneralInfo : Packet
|
||||
{
|
||||
public MahjongGeneralInfo(MahjongGame game) : base(0xDA)
|
||||
{
|
||||
public MahjongGeneralInfo(MahjongGame game) : base(0xDA)
|
||||
{
|
||||
EnsureCapacity(13);
|
||||
|
||||
Stream.Write(game.Serial);
|
||||
|
|
@ -114,12 +114,12 @@ namespace Server.Engines.Mahjong
|
|||
Stream.Write((short)game.WallBreakIndicator.Position.Y);
|
||||
Stream.Write((short)game.WallBreakIndicator.Position.X);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MahjongTilesInfo : Packet
|
||||
public sealed class MahjongTilesInfo : Packet
|
||||
{
|
||||
public MahjongTilesInfo(MahjongGame game, Mobile to) : base(0xDA)
|
||||
{
|
||||
public MahjongTilesInfo(MahjongGame game, Mobile to) : base(0xDA)
|
||||
{
|
||||
var tiles = game.Tiles;
|
||||
var players = game.Players;
|
||||
|
||||
|
|
@ -162,12 +162,12 @@ namespace Server.Engines.Mahjong
|
|||
Stream.Write(tile.Flipped ? (byte)0x10 : (byte)0x0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MahjongTileInfo : Packet
|
||||
public sealed class MahjongTileInfo : Packet
|
||||
{
|
||||
public MahjongTileInfo(MahjongTile tile, Mobile to) : base(0xDA)
|
||||
{
|
||||
public MahjongTileInfo(MahjongTile tile, Mobile to) : base(0xDA)
|
||||
{
|
||||
var game = tile.Game;
|
||||
var players = game.Players;
|
||||
|
||||
|
|
@ -205,17 +205,16 @@ namespace Server.Engines.Mahjong
|
|||
|
||||
Stream.Write(tile.Flipped ? (byte)0x10 : (byte)0x0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MahjongRelieve : Packet
|
||||
public sealed class MahjongRelieve : Packet
|
||||
{
|
||||
public MahjongRelieve(Serial game) : base(0xDA)
|
||||
{
|
||||
public MahjongRelieve(Serial game) : base(0xDA)
|
||||
{
|
||||
EnsureCapacity(9);
|
||||
|
||||
Stream.Write(game);
|
||||
Stream.Write((byte)0);
|
||||
Stream.Write((byte)0x1A);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
using Server.Network;
|
||||
|
||||
namespace Server.Items
|
||||
namespace Server.Items;
|
||||
|
||||
public sealed class MapDetails : Packet
|
||||
{
|
||||
public sealed class MapDetails : Packet
|
||||
public MapDetails(MapItem map) : base(0x90, 19)
|
||||
{
|
||||
public MapDetails(MapItem map) : base(0x90, 19)
|
||||
{
|
||||
Stream.Write(map.Serial);
|
||||
Stream.Write((short)0x139D);
|
||||
Stream.Write((short)map.Bounds.Start.X);
|
||||
|
|
@ -15,12 +15,12 @@ namespace Server.Items
|
|||
Stream.Write((short)map.Width);
|
||||
Stream.Write((short)map.Height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapDetailsNew : Packet
|
||||
public sealed class MapDetailsNew : Packet
|
||||
{
|
||||
public MapDetailsNew(MapItem map) : base(0xF5, 21)
|
||||
{
|
||||
public MapDetailsNew(MapItem map) : base(0xF5, 21)
|
||||
{
|
||||
Stream.Write(map.Serial);
|
||||
Stream.Write((short)0x139D);
|
||||
Stream.Write((short)map.Bounds.Start.X);
|
||||
|
|
@ -31,38 +31,37 @@ namespace Server.Items
|
|||
Stream.Write((short)map.Height);
|
||||
Stream.Write((short)(map.Facet?.MapID ?? 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class MapCommand : Packet
|
||||
public class MapCommand : Packet
|
||||
{
|
||||
public MapCommand(MapItem map, int command, int number, int x, int y) : base(0x56, 11)
|
||||
{
|
||||
public MapCommand(MapItem map, int command, int number, int x, int y) : base(0x56, 11)
|
||||
{
|
||||
Stream.Write(map.Serial);
|
||||
Stream.Write((byte)command);
|
||||
Stream.Write((byte)number);
|
||||
Stream.Write((short)x);
|
||||
Stream.Write((short)y);
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapDisplay : MapCommand
|
||||
{
|
||||
public MapDisplay(MapItem map) : base(map, 5, 0, 0, 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapAddPin : MapCommand
|
||||
{
|
||||
public MapAddPin(MapItem map, Point2D point) : base(map, 1, 0, point.X, point.Y)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapSetEditable : MapCommand
|
||||
{
|
||||
public MapSetEditable(MapItem map, bool editable) : base(map, 7, editable ? 1 : 0, 0, 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapDisplay : MapCommand
|
||||
{
|
||||
public MapDisplay(MapItem map) : base(map, 5, 0, 0, 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapAddPin : MapCommand
|
||||
{
|
||||
public MapAddPin(MapItem map, Point2D point) : base(map, 1, 0, point.X, point.Y)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class MapSetEditable : MapCommand
|
||||
{
|
||||
public MapSetEditable(MapItem map, bool editable) : base(map, 7, editable ? 1 : 0, 0, 0)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
@ -5,16 +5,16 @@ using Server.Tests;
|
|||
using Server.Tests.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace UOContent.Tests
|
||||
namespace UOContent.Tests;
|
||||
|
||||
[Collection("Sequential Tests")]
|
||||
public class TestMapItemPackets : IClassFixture<ServerFixture>
|
||||
{
|
||||
[Collection("Sequential Tests")]
|
||||
public class TestMapItemPackets : IClassFixture<ServerFixture>
|
||||
[Theory]
|
||||
[InlineData(ProtocolChanges.NewCharacterList)]
|
||||
[InlineData(ProtocolChanges.None)]
|
||||
public void TestSendMapDetails(ProtocolChanges changes)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(ProtocolChanges.NewCharacterList)]
|
||||
[InlineData(ProtocolChanges.None)]
|
||||
public void TestSendMapDetails(ProtocolChanges changes)
|
||||
{
|
||||
var mapItem = new MapItem(Map.Trammel);
|
||||
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
|
|
@ -28,13 +28,13 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(5, 0, 0, 0)]
|
||||
[InlineData(1, 0, 100, 200)]
|
||||
[InlineData(7, 1, 0, 0)]
|
||||
[InlineData(7, 0, 0, 0)]
|
||||
public void TestSendMapCommand(int command, int number, int x, int y)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(5, 0, 0, 0)]
|
||||
[InlineData(1, 0, 100, 200)]
|
||||
[InlineData(7, 1, 0, 0)]
|
||||
[InlineData(7, 0, 0, 0)]
|
||||
public void TestSendMapCommand(int command, int number, int x, int y)
|
||||
{
|
||||
var mapItem = new MapItem(Map.Trammel);
|
||||
|
||||
var expected = new MapCommand(mapItem, command, number, x, y).Compile();
|
||||
|
|
@ -45,5 +45,4 @@ namespace UOContent.Tests
|
|||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -5,14 +5,14 @@ using Server.Tests;
|
|||
using Server.Tests.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace UOContent.Tests
|
||||
namespace UOContent.Tests;
|
||||
|
||||
[Collection("Sequential Tests")]
|
||||
public class CorpsePacketTests : IClassFixture<ServerFixture>
|
||||
{
|
||||
[Collection("Sequential Tests")]
|
||||
public class CorpsePacketTests : IClassFixture<ServerFixture>
|
||||
[Fact]
|
||||
public void TestCorpseEquipPacket()
|
||||
{
|
||||
[Fact]
|
||||
public void TestCorpseEquipPacket()
|
||||
{
|
||||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
|
|
@ -30,11 +30,11 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(ProtocolChanges.None)]
|
||||
[InlineData(ProtocolChanges.ContainerGridLines)]
|
||||
public void TestCorpseContainerPacket(ProtocolChanges changes)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(ProtocolChanges.None)]
|
||||
[InlineData(ProtocolChanges.ContainerGridLines)]
|
||||
public void TestCorpseContainerPacket(ProtocolChanges changes)
|
||||
{
|
||||
var m = new Mobile((Serial)0x1);
|
||||
m.DefaultMobileInit();
|
||||
|
||||
|
|
@ -53,5 +53,4 @@ namespace UOContent.Tests
|
|||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +1,12 @@
|
|||
using System.IO;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Network
|
||||
namespace Server.Network;
|
||||
|
||||
public sealed class CorpseEquip : Packet
|
||||
{
|
||||
public sealed class CorpseEquip : Packet
|
||||
public CorpseEquip(Mobile beholder, Corpse beheld) : base(0x89)
|
||||
{
|
||||
public CorpseEquip(Mobile beholder, Corpse beheld) : base(0x89)
|
||||
{
|
||||
var list = beheld.EquipItems;
|
||||
|
||||
var count = list.Count;
|
||||
|
|
@ -49,13 +49,13 @@ namespace Server.Network
|
|||
|
||||
Stream.Write((byte)Layer.Invalid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CorpseContent : Packet
|
||||
public sealed class CorpseContent : Packet
|
||||
{
|
||||
public CorpseContent(Mobile beholder, Corpse beheld)
|
||||
: base(0x3C)
|
||||
{
|
||||
public CorpseContent(Mobile beholder, Corpse beheld)
|
||||
: base(0x3C)
|
||||
{
|
||||
var items = beheld.EquipItems;
|
||||
var count = items.Count;
|
||||
|
||||
|
|
@ -127,13 +127,13 @@ namespace Server.Network
|
|||
Stream.Seek(pos, SeekOrigin.Begin);
|
||||
Stream.Write((ushort)written);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class CorpseContent6017 : Packet
|
||||
public sealed class CorpseContent6017 : Packet
|
||||
{
|
||||
public CorpseContent6017(Mobile beholder, Corpse beheld)
|
||||
: base(0x3C)
|
||||
{
|
||||
public CorpseContent6017(Mobile beholder, Corpse beheld)
|
||||
: base(0x3C)
|
||||
{
|
||||
var items = beheld.EquipItems;
|
||||
var count = items.Count;
|
||||
|
||||
|
|
@ -208,5 +208,4 @@ namespace Server.Network
|
|||
Stream.Seek(pos, SeekOrigin.Begin);
|
||||
Stream.Write((ushort)written);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,17 +3,17 @@ using Server.Tests;
|
|||
using Server.Tests.Network;
|
||||
using Xunit;
|
||||
|
||||
namespace UOContent.Tests
|
||||
namespace UOContent.Tests;
|
||||
|
||||
public class WeaponAbilityPacketTests
|
||||
{
|
||||
public class WeaponAbilityPacketTests
|
||||
[Theory]
|
||||
[InlineData(0, true)]
|
||||
[InlineData(0, false)]
|
||||
[InlineData(100, true)]
|
||||
[InlineData(1000, false)]
|
||||
public void TestSpecialAbility(int abilityId, bool active)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(0, true)]
|
||||
[InlineData(0, false)]
|
||||
[InlineData(100, true)]
|
||||
[InlineData(1000, false)]
|
||||
public void TestSpecialAbility(int abilityId, bool active)
|
||||
{
|
||||
var expected = new ToggleSpecialAbility(abilityId, active).Compile();
|
||||
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
|
|
@ -23,9 +23,9 @@ namespace UOContent.Tests
|
|||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TestClearAbility()
|
||||
{
|
||||
[Fact]
|
||||
public void TestClearAbility()
|
||||
{
|
||||
var expected = new ClearWeaponAbility().Compile();
|
||||
|
||||
var ns = PacketTestUtilities.CreateTestNetState();
|
||||
|
|
@ -34,5 +34,4 @@ namespace UOContent.Tests
|
|||
var result = ns.SendPipe.Reader.AvailableToRead();
|
||||
AssertThat.Equal(result, expected);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
using Server.Network;
|
||||
|
||||
namespace UOContent.Tests
|
||||
namespace UOContent.Tests;
|
||||
|
||||
public sealed class ToggleSpecialAbility : Packet
|
||||
{
|
||||
public sealed class ToggleSpecialAbility : Packet
|
||||
public ToggleSpecialAbility(int abilityID, bool active) : base(0xBF)
|
||||
{
|
||||
public ToggleSpecialAbility(int abilityID, bool active) : base(0xBF)
|
||||
{
|
||||
EnsureCapacity(7);
|
||||
|
||||
Stream.Write((short)0x25);
|
||||
|
|
@ -13,17 +13,16 @@ namespace UOContent.Tests
|
|||
Stream.Write((short)abilityID);
|
||||
Stream.Write(active);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class ClearWeaponAbility : Packet
|
||||
public sealed class ClearWeaponAbility : Packet
|
||||
{
|
||||
public static readonly Packet Instance = SetStatic(new ClearWeaponAbility());
|
||||
|
||||
public ClearWeaponAbility() : base(0xBF)
|
||||
{
|
||||
public static readonly Packet Instance = SetStatic(new ClearWeaponAbility());
|
||||
|
||||
public ClearWeaponAbility() : base(0xBF)
|
||||
{
|
||||
EnsureCapacity(5);
|
||||
|
||||
Stream.Write((short)0x21);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue