Skip to content

Commit 361d63d

Browse files
authored
fix: correct keys on slot packets (AscensionGameDev#1954)
1 parent 88793ca commit 361d63d

File tree

10 files changed

+99
-130
lines changed

10 files changed

+99
-130
lines changed
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class BuyItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class BuyItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public BuyItemPacket() : base(0, 0)
710
{
8-
//Parameterless Constructor for MessagePack
9-
public BuyItemPacket() : base(0, 0)
10-
{
11-
}
12-
13-
public BuyItemPacket(int slot, int quantity) : base(slot, quantity)
14-
{
15-
}
16-
1711
}
1812

19-
}
13+
public BuyItemPacket(int slot, int quantity) : base(slot, quantity)
14+
{
15+
}
16+
}
Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class DepositItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class DepositItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public DepositItemPacket() : base(0, 0)
710
{
11+
}
812

9-
//Parameterless Constructor for MessagePack
10-
public DepositItemPacket() : base(0, 0)
11-
{
12-
}
13-
14-
public DepositItemPacket(int slot, int quantity, int bankSlot = -1) : base(slot, quantity)
15-
{
16-
BankSlot = bankSlot;
17-
}
18-
19-
[Key(0)]
20-
public int BankSlot { get; set; }
13+
public DepositItemPacket(int slot, int quantity, int bankSlot = -1) : base(slot, quantity)
14+
{
15+
BankSlot = bankSlot;
2116
}
2217

23-
}
18+
[Key(3)] public int BankSlot { get; set; }
19+
}
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class DropItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class DropItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public DropItemPacket() : base(0, 0)
710
{
8-
//Parameterless Constructor for MessagePack
9-
public DropItemPacket() : base(0, 0)
10-
{
11-
}
12-
13-
public DropItemPacket(int slot, int quantity) : base(slot, quantity)
14-
{
15-
}
16-
1711
}
1812

19-
}
13+
public DropItemPacket(int slot, int quantity) : base(slot, quantity)
14+
{
15+
}
16+
}
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class OfferTradeItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class OfferTradeItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public OfferTradeItemPacket() : base(0, 0)
710
{
8-
//Parameterless Constructor for MessagePack
9-
public OfferTradeItemPacket() : base(0, 0)
10-
{
11-
}
12-
13-
public OfferTradeItemPacket(int slot, int quantity) : base(slot, quantity)
14-
{
15-
}
16-
1711
}
1812

19-
}
13+
public OfferTradeItemPacket(int slot, int quantity) : base(slot, quantity)
14+
{
15+
}
16+
}
Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class RetrieveBagItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class RetrieveBagItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public RetrieveBagItemPacket() : base(0, 0)
710
{
8-
//Parameterless Constructor for MessagePack
9-
public RetrieveBagItemPacket() : base(0, 0)
10-
{
11-
}
12-
13-
public RetrieveBagItemPacket(int bagSlot, int quantity, int invSlot) : base(bagSlot, quantity)
14-
{
15-
InventorySlot = invSlot;
16-
}
17-
18-
[Key(4)]
19-
public int InventorySlot { get; set; }
11+
}
2012

13+
public RetrieveBagItemPacket(int bagSlot, int quantity, int invSlot) : base(bagSlot, quantity)
14+
{
15+
InventorySlot = invSlot;
2116
}
2217

23-
}
18+
[Key(3)] public int InventorySlot { get; set; }
19+
}
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class RevokeTradeItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class RevokeTradeItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public RevokeTradeItemPacket() : base(0, 0)
710
{
8-
//Parameterless Constructor for MessagePack
9-
public RevokeTradeItemPacket() : base(0,0)
10-
{
11-
}
12-
13-
public RevokeTradeItemPacket(int slot, int quantity) : base(slot, quantity)
14-
{
15-
}
16-
1711
}
1812

19-
}
13+
public RevokeTradeItemPacket(int slot, int quantity) : base(slot, quantity)
14+
{
15+
}
16+
}
Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class SellItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class SellItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public SellItemPacket() : base(0, 0)
710
{
8-
//Parameterless Constructor for MessagePack
9-
public SellItemPacket() : base(0, 0)
10-
{
11-
}
12-
13-
public SellItemPacket(int slot, int quantity) : base(slot, quantity)
14-
{
15-
}
16-
1711
}
1812

19-
}
13+
public SellItemPacket(int slot, int quantity) : base(slot, quantity)
14+
{
15+
}
16+
}
Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class StoreBagItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class StoreBagItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public StoreBagItemPacket() : base(0, 0)
710
{
8-
//Parameterless Constructor for MessagePack
9-
public StoreBagItemPacket() : base(0, 0)
10-
{
11-
}
12-
public StoreBagItemPacket(int invSlot, int quantity, int bagSlot) : base(invSlot, quantity)
13-
{
14-
BagSlot = bagSlot;
15-
}
16-
17-
[Key(0)]
18-
public int BagSlot { get; set; }
19-
11+
}
2012

13+
public StoreBagItemPacket(int invSlot, int quantity, int bagSlot) : base(invSlot, quantity)
14+
{
15+
BagSlot = bagSlot;
2116
}
2217

23-
}
18+
[Key(3)] public int BagSlot { get; set; }
19+
}
Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
using MessagePack;
22

3-
namespace Intersect.Network.Packets.Client
3+
namespace Intersect.Network.Packets.Client;
4+
5+
[MessagePackObject]
6+
public class WithdrawItemPacket : SlotQuantityPacket
47
{
5-
[MessagePackObject]
6-
public partial class WithdrawItemPacket : SlotQuantityPacket
8+
//Parameterless Constructor for MessagePack
9+
public WithdrawItemPacket() : base(0, 0)
710
{
8-
//Parameterless Constructor for MessagePack
9-
public WithdrawItemPacket() : base(0, 0)
10-
{
11-
}
12-
13-
public WithdrawItemPacket(int slot, int quantity, int invSlot = -1) : base(slot, quantity)
14-
{
15-
InvSlot = invSlot;
16-
}
17-
18-
[Key(0)]
19-
public int InvSlot { get; set; }
11+
}
2012

13+
public WithdrawItemPacket(int slot, int quantity, int invSlot = -1) : base(slot, quantity)
14+
{
15+
InvSlot = invSlot;
2116
}
2217

23-
}
18+
[Key(3)] public int InvSlot { get; set; }
19+
}

Intersect (Core)/Network/Packets/SlotQuantityPacket.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public SlotQuantityPacket(int slot, int quantity)
3636
[Key(2)]
3737
public int Quantity { get; set; }
3838

39-
[Key(3)]
39+
[IgnoreMember]
4040
public override bool IsValid => Slot >= 0 && Quantity >= 0;
4141

4242
public override Dictionary<string, SanitizedValue<object>> Sanitize()

0 commit comments

Comments
 (0)