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
11 changes: 5 additions & 6 deletions src/NosCore.Packets/ServerPackets/Map/EffObPacket.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
using NosCore.Packets.Attributes;
using NosCore.Packets.Enumerations;
using NosCore.Shared.Enumerations;

namespace NosCore.Packets.ServerPackets.Map
{
[PacketHeader("eff_ob", Scope.InGame)]
public class EffObPacket : PacketBase
{
// The client reads only the FIRST CHARACTER of this field.
[PacketIndex(0)]
public string ExtraSpace { get; set; } = string.Empty;
public VisualType VisualType { get; set; }

[PacketIndex(1)]
public short MapX { get; set; }
public long VisualId { get; set; }

[PacketIndex(2)]
public short MapY { get; set; }
public bool IsVisible { get; set; }

[PacketIndex(3)]
public byte Unknown { get; set; } //TODO to find

[PacketIndex(4)]
public int EffectId { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,8 @@ Bgm2Packet#1 => bgm2 21
Bgm2Packet#7 => bgm2 74
BgmPacket#1 => bgm 21
BgmPacket#7 => bgm 74
EffObPacket#1 => eff_ob s15521 44 83 53 21
EffObPacket#7 => eff_ob s15674 75 77 8 43
EffObPacket#1 => eff_ob 1 44 0 53
EffObPacket#7 => eff_ob 9 75 0 8
EffTPacket#1 => eff_t 1 44 83 53 21
EffTPacket#7 => eff_t 9 75 77 8 43
GroundEffectPacket#1 => eff_g s15521 44 s12383 53 21 1
Expand Down
14 changes: 8 additions & 6 deletions test/NosCore.Packets.Tests/SerializerTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1054,13 +1054,15 @@ public void SerializeEffObPacketMatchesTrace()
{
var p = new EffObPacket
{
ExtraSpace = string.Empty,
MapX = -1,
MapY = -1,
Unknown = 0,
EffectId = 4269
VisualType = VisualType.Player,
VisualId = 2,
IsVisible = true,
EffectId = 4430
};
Assert.AreEqual("eff_ob -1 -1 0 4269", Serializer.Serialize(p));
Assert.AreEqual("eff_ob 1 2 1 4430", Serializer.Serialize(p));

p.IsVisible = false;
Assert.AreEqual("eff_ob 1 2 0 4430", Serializer.Serialize(p));
}

[TestMethod]
Expand Down
Loading