Renamed subprojects and changed namespace names.
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace GameServiceWarden.ClientAPI
|
||||
{
|
||||
public enum CommunicableType : uint
|
||||
{
|
||||
Disconnect,
|
||||
Connect,
|
||||
Service,
|
||||
UnexpectedCommunication
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
using System;
|
||||
|
||||
namespace GameServiceWarden.ClientAPI
|
||||
{
|
||||
public interface ICommunicable
|
||||
{
|
||||
CommunicableType Type { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
namespace GameServiceWarden.ClientAPI.Requests
|
||||
{
|
||||
public struct ConnectRequest : ICommunicable
|
||||
{
|
||||
public string requestedIdentifier;
|
||||
public string programName;
|
||||
public string programAuthor;
|
||||
public string versionNumber;
|
||||
public string details;
|
||||
|
||||
public CommunicableType Type => CommunicableType.Connect;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace GameServiceWarden.ClientAPI
|
||||
{
|
||||
public struct DisconnectRequest
|
||||
{
|
||||
public string reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.IO.Pipes;
|
||||
|
||||
namespace GameServiceWarden.ClientAPI.Requests
|
||||
{
|
||||
public static class RequestHeader
|
||||
{
|
||||
public static void Decode(byte[] header, out CommunicableType type, out uint length) {
|
||||
type = (CommunicableType) BitConverter.ToUInt32(header, 0);
|
||||
length = BitConverter.ToUInt32(header, sizeof(uint));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using GameServiceWarden.ClientAPI.Module;
|
||||
|
||||
namespace GameServiceWarden.ClientAPI.Requests
|
||||
{
|
||||
public struct ServiceRequest : ICommunicable
|
||||
{
|
||||
public ServiceManagerAction serviceManagerAction;
|
||||
|
||||
public CommunicableType Type => CommunicableType.Service;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace GameServiceWarden.ClientAPI.Responses
|
||||
{
|
||||
public struct ConnectResponse : ICommunicable
|
||||
{
|
||||
public string identifier;
|
||||
public bool nameTaken;
|
||||
public bool invalidName;
|
||||
public string errorMsg;
|
||||
|
||||
public CommunicableType Type => CommunicableType.Connect;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace GameServiceWarden.ClientAPI
|
||||
{
|
||||
public struct DisconnectResponse
|
||||
{
|
||||
public string reason;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace GameServiceWarden.ClientAPI.Responses
|
||||
{
|
||||
public static class ResponseHeader
|
||||
{
|
||||
public static byte[] Encode(CommunicableType type, uint length) {
|
||||
byte[] res = new byte[sizeof(uint) + sizeof(uint)];
|
||||
BitConverter.GetBytes((uint)type).CopyTo(res, 0);
|
||||
BitConverter.GetBytes(length).CopyTo(res, sizeof(uint));
|
||||
return res;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
using GameServiceWarden.ClientAPI.Module;
|
||||
|
||||
namespace GameServiceWarden.ClientAPI.Responses
|
||||
{
|
||||
public struct ServiceResponse : ICommunicable
|
||||
{
|
||||
public ServiceManagerState gameServiceDelta;
|
||||
|
||||
public CommunicableType Type => CommunicableType.Service;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace GameServiceWarden.ClientAPI.Responses
|
||||
{
|
||||
public struct UnexpectedRequestResponse : ICommunicable
|
||||
{
|
||||
public CommunicableType origin;
|
||||
public string message;
|
||||
|
||||
public CommunicableType Type => CommunicableType.UnexpectedCommunication;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user