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
838 B
C#
22 lines
838 B
C#
using System.Net;
|
|
using System.Net.Sockets;
|
|
|
|
namespace Yuanshen.Kcp
|
|
{
|
|
/// <summary>
|
|
/// A transport to send and receive packets.
|
|
/// </summary>
|
|
public interface IKcpTransport
|
|
{
|
|
/// <summary>
|
|
/// Send a packet into the transport.
|
|
/// </summary>
|
|
/// <param name="packet">The content of the packet.</param>
|
|
/// <param name="remoteEndpoint">The remote endpoint</param>
|
|
/// <param name="cancellationToken">A token to cancel this operation.</param>
|
|
/// <returns>A <see cref="ValueTask"/> that completes when the packet is sent.</returns>
|
|
ValueTask SendPacketAsync(Memory<byte> packet, IPEndPoint remoteEndpoint, CancellationToken cancellationToken);
|
|
|
|
void SetCallbacks(int handshakeSize, Func<UdpReceiveResult, ValueTask> handshakeHandler);
|
|
}
|
|
}
|