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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace GameServiceWarden.ClientAPI.Module
|
||||
{
|
||||
public struct ServiceManagerAction
|
||||
{
|
||||
public enum Type
|
||||
{
|
||||
|
||||
Start,
|
||||
Stop,
|
||||
CreateService,
|
||||
DeleteService,
|
||||
ExecuteCommand,
|
||||
SetServiceOption,
|
||||
View
|
||||
}
|
||||
|
||||
public string assemblyName;
|
||||
public string moduleName;
|
||||
public string serviceName;
|
||||
public string option;
|
||||
public string command;
|
||||
public string value;
|
||||
public Type action;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GameServiceWarden.ClientAPI.Module
|
||||
{
|
||||
public struct ServiceManagerState
|
||||
{
|
||||
public bool delta;
|
||||
public bool subtract;
|
||||
public ICollection<string> services;
|
||||
public ICollection<string> running;
|
||||
public ICollection<string> modules;
|
||||
public IReadOnlyDictionary<string, byte[]> logs;
|
||||
public IReadOnlyDictionary<string, IReadOnlyDictionary<string, string>> serviceOptions;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user