fix(core): Converts mobile moving packet (#357)

- [X] Converts mobile moving packet
This commit is contained in:
Kamron Batman 2020-12-24 17:13:55 -08:00 committed by GitHub
parent c2143584bc
commit 10a6e17640
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 147 additions and 170 deletions

View file

@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*************************************************************************/
using System;
using System.Buffers;
using System.IO;
using System.Runtime.CompilerServices;
@ -38,5 +39,17 @@ namespace Server.Network
writer.Write((ushort)length);
writer.Seek(length, SeekOrigin.Begin);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static void InitializePackets(this Span<byte> buffer, int chunkLength)
{
var index = 0;
while (index < buffer.Length)
{
buffer[index] = 0;
index += chunkLength;
}
}
}
}