fix: Fixes more packet initializations (#1507)

This commit is contained in:
Kamron Batman 2023-09-19 00:02:17 -07:00 committed by GitHub
parent 0bec97639f
commit 2a3e048b86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 26 additions and 23 deletions

View file

@ -41,7 +41,7 @@ public static class OutgoingMessagePackets
return;
}
Span<byte> buffer = stackalloc byte[GetMaxMessageLocalizedLength(args)];
Span<byte> buffer = stackalloc byte[GetMaxMessageLocalizedLength(args)].InitializePacket();
var length = CreateMessageLocalized(
buffer, serial, graphic, type, hue, font, number, name, args
);

View file

@ -94,7 +94,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> span = stackalloc byte[DeathAnimationPacketLength];
Span<byte> span = stackalloc byte[DeathAnimationPacketLength].InitializePacket();
CreateDeathAnimation(span, killed, corpse);
ns.Send(span);
}
@ -200,7 +200,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> span = stackalloc byte[MobileAttributePacketLength];
Span<byte> span = stackalloc byte[MobileAttributePacketLength].InitializePacket();
CreateMobileHits(span, m, normalize);
ns.Send(span);
}
@ -225,7 +225,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> span = stackalloc byte[MobileAttributePacketLength];
Span<byte> span = stackalloc byte[MobileAttributePacketLength].InitializePacket();
CreateMobileMana(span, m, normalize);
ns.Send(span);
}
@ -250,7 +250,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> span = stackalloc byte[MobileAttributePacketLength];
Span<byte> span = stackalloc byte[MobileAttributePacketLength].InitializePacket();
CreateMobileStam(span, m, normalize);
ns.Send(span);
}
@ -275,7 +275,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> span = stackalloc byte[MobileAttributesPacketLength];
Span<byte> span = stackalloc byte[MobileAttributesPacketLength].InitializePacket();
CreateMobileAttributes(span, m, normalize);
ns.Send(span);
}
@ -344,7 +344,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> span = stackalloc byte[MobileAnimationPacketLength];
Span<byte> span = stackalloc byte[MobileAnimationPacketLength].InitializePacket();
CreateMobileAnimation(span, mobile, action, frameCount, repeatCount, forward, repeat, delay);
ns.Send(span);
}
@ -369,7 +369,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> span = stackalloc byte[NewMobileAnimationPacketLength];
Span<byte> span = stackalloc byte[NewMobileAnimationPacketLength].InitializePacket();
CreateNewMobileAnimation(span, mobile, action, frameCount, delay);
ns.Send(span);
}
@ -381,7 +381,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> span = stackalloc byte[MobileHealthbarPacketLength];
Span<byte> span = stackalloc byte[MobileHealthbarPacketLength].InitializePacket();
CreateMobileHealthbar(span, m, healthbar);
ns.Send(span);
}
@ -436,7 +436,7 @@ public static class OutgoingMobilePackets
return;
}
Span<byte> buffer = stackalloc byte[MobileStatusCompactLength];
Span<byte> buffer = stackalloc byte[MobileStatusCompactLength].InitializePacket();
CreateMobileStatusCompact(buffer, m, canBeRenamed);
ns.Send(buffer);
@ -487,7 +487,7 @@ public static class OutgoingMobilePackets
}
}
Span<byte> buffer = stackalloc byte[length];
Span<byte> buffer = stackalloc byte[length].InitializePacket();
CreateMobileStatus(buffer, beheld, version, beheld.CanBeRenamedBy(beholder));
ns.Send(buffer);
}