mirror of
https://github.com/ACEmulator/ACE
synced 2026-08-17 12:26:06 -04:00
* Remove RunActions() from IActor interface * make Landblock an IActor * Make WorldManager an IActor * Remove AgressiveInlinding from ActionQueue.RunActions (Helps break up profiling results) * Fix WorldManager EnqueueAction * Split WorldObject ActionQueues into Landblock and Player * Switch Landblock from o(n) to o(1) * Loop in reverse order, no need to create a new list using FindAll. * use an ArrayPool<byte> to conserve resources and improve performance * cosmetic * Update/Tick Age every 7 seconds for Players (Before, this was consuming 1% CPU) * More packet transmission improvements
30 lines
826 B
C#
30 lines
826 B
C#
using System;
|
|
|
|
using ACE.Common.Cryptography;
|
|
|
|
namespace ACE.Server.Network
|
|
{
|
|
public class ServerPacketFragment : PacketFragment
|
|
{
|
|
public ServerPacketFragment(byte[] data)
|
|
{
|
|
Header = new PacketFragmentHeader();
|
|
Data = data;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Returns the Hash32 of the payload added to buffer
|
|
/// </summary>
|
|
public uint AddPayloadToBuffer(byte[] buffer, ref int offset)
|
|
{
|
|
Header.Size = (ushort)(PacketFragmentHeader.HeaderSize + Data.Length);
|
|
|
|
var headerHash32 = Header.AddPayloadToBuffer(buffer, ref offset);
|
|
|
|
Buffer.BlockCopy(Data, 0, buffer, offset, Data.Length);
|
|
offset += Data.Length;
|
|
|
|
return headerHash32 + Hash32.Calculate(Data, Data.Length);
|
|
}
|
|
}
|
|
}
|