mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-09-16 06:15:16 -05:00
- This version of the server is modified from the other open sourced one on GitHub as we ignore the port when attempting to connect. Program.cs is modified as such
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using System;
|
|
using System.Net;
|
|
|
|
namespace MLAPI.Relay.Transports
|
|
{
|
|
public abstract class Transport
|
|
{
|
|
public abstract void Send(ArraySegment<byte> payload, byte channelId, ulong connectionId);
|
|
public abstract void Disconnect(ulong connectionId);
|
|
public abstract NetEventType Poll(out ulong connectionId, out byte channelId, out ArraySegment<byte> payload);
|
|
public abstract IPEndPoint GetEndPoint(ulong connectionId);
|
|
public abstract void Start(object config);
|
|
public abstract object GetConfig();
|
|
|
|
public virtual RelayConfig BeforeSerializeConfig(RelayConfig config)
|
|
{
|
|
return config;
|
|
}
|
|
|
|
public virtual string ProcessSerializedJson(string json)
|
|
{
|
|
return json;
|
|
}
|
|
|
|
public virtual RelayConfig AfterDeserializedConfig(RelayConfig config)
|
|
{
|
|
return config;
|
|
}
|
|
}
|
|
|
|
public enum NetEventType
|
|
{
|
|
Connect,
|
|
Disconnect,
|
|
Data,
|
|
Nothing
|
|
}
|
|
}
|