Airship support

Logger utility
Initial Reactor.Networking protocol rework
This commit is contained in:
js6pak committed 2021-04-04 00:05:34 +02:00
1 parent a2f707fe16
commit d58afa5907
36 files changed
+473 -395

No files matched your search

+40
View File
@@ -0,0 +1,40 @@
#nullable enable
using System;
namespace Reactor.Networking
{
public class Mod
{
public Mod(uint netId, string id, string version, PluginSide side)
{
NetId = netId;
Id = id;
Version = version;
Side = side;
}
public uint NetId { get; }
public string Id { get; }
public string Version { get; }
public PluginSide Side { get; }
protected bool Equals(Mod other)
{
return Id == other.Id && Version == other.Version;
}
public override bool Equals(object? obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != GetType()) return false;
return Equals((Mod) obj);
}
public override int GetHashCode()
{
return HashCode.Combine(Id, Version);
}
}
}
@@ -0,0 +1,9 @@
namespace Reactor.Networking
{
public enum ReactorMessageFlags : byte
{
Handshake,
ModDeclaration,
PluginDeclaration
}
}
@@ -0,0 +1,18 @@
namespace Reactor.Networking
{
/// <summary>
/// Version of the Reactor.Net protocol format.
/// </summary>
public enum ReactorProtocolVersion : byte
{
/// <summary>
/// Initial version.
/// </summary>
Initial = 1,
/// <summary>
/// Latest version.
/// </summary>
Latest = Initial,
}
}
+18
View File
@@ -0,0 +1,18 @@
namespace Reactor
{
/// <summary>
/// Plugin side used in modded handshake
/// </summary>
public enum PluginSide : byte
{
/// <summary>
/// Required by both sides, reject connection if missing on the other side
/// </summary>
Both,
/// <summary>
/// Required only by client
/// </summary>
ClientOnly
}
}
+5
View File
@@ -0,0 +1,5 @@
<Project>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)**\*.cs" />
</ItemGroup>
</Project>
+3
View File
@@ -0,0 +1,3 @@
<Project>
<Import Project="Reactor.Shared.projitems" Label="Shared" />
</Project>