Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public class EInfoNpcMonsterPacket : PacketBase
[PacketIndex(24)]
public int Unknown { get; set; } = -1;

[PacketIndex(25)]
[PacketIndex(25, EscapeSpaces = true)]
public string? Name { get; set; }
}
}
8 changes: 7 additions & 1 deletion test/NosCore.Packets.Tests/StringFieldSeparatorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using NosCore.Packets.Interfaces;
using NosCore.Packets.ServerPackets.Mates;
using NosCore.Packets.ServerPackets.Groups;
using NosCore.Packets.ServerPackets.Inventory;
using NosCore.Packets.ServerPackets.Miniland;
using NosCore.Packets.ServerPackets.Visibility;
using System.Collections.Generic;
Expand Down Expand Up @@ -42,7 +43,8 @@ public class StringFieldSeparatorTests
{
typeof(SeparatorProbePacket), typeof(DottedProbePacket),
typeof(ScpPacket), typeof(ScnPacket), typeof(InPacket),
typeof(PinitPacket), typeof(MlintroPacket), typeof(MlInfoBrPacket)
typeof(PinitPacket), typeof(MlintroPacket), typeof(MlInfoBrPacket),
typeof(EInfoNpcMonsterPacket)
});

[TestMethod]
Expand Down Expand Up @@ -118,6 +120,10 @@ public void AFieldThatOptsInIsEscapedEvenThoughItIsLast()
StringAssert.Contains(
Serializer.Serialize(new MlInfoBrPacket { Name = "Bob", MinilandMessage = "hello there" }),
"hello^there");

StringAssert.Contains(
Serializer.Serialize(new EInfoNpcMonsterPacket { Name = "Mother Cuby" }),
"Mother^Cuby");
}

[TestMethod]
Expand Down
Loading