KCP gameserver with packet dispatch, scene streaming, combat, gacha and the shop, plus a small HTTP server for the login flow and the wish history page. Game data under assets is pulled out of the client instead of being typed by hand. The excel tables come from the packed bin container and the spawn points from the compiled scene scripts.
22 lines
430 B
C#
22 lines
430 B
C#
#if !NEED_POH_SHIM
|
|
|
|
using System.Buffers;
|
|
|
|
namespace Yuanshen.Kcp
|
|
{
|
|
internal sealed class ArrayMemoryOwner : IMemoryOwner<byte>
|
|
{
|
|
private readonly byte[] _buffer;
|
|
|
|
public ArrayMemoryOwner(byte[] buffer)
|
|
{
|
|
_buffer = buffer ?? throw new ArgumentNullException(nameof(buffer));
|
|
}
|
|
|
|
public Memory<byte> Memory => _buffer;
|
|
|
|
public void Dispose() { }
|
|
}
|
|
}
|
|
|
|
#endif
|