Updated to .NET 7.0 and added Jenkinsfile.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
|
||||
namespace GameServiceWarden.InteractionAPI
|
||||
{
|
||||
public enum CommunicableType : uint
|
||||
{
|
||||
Disconnect,
|
||||
Connect,
|
||||
View,
|
||||
Delta,
|
||||
UnexpectedCommunication
|
||||
}
|
||||
}
|
@@ -0,0 +1,11 @@
|
||||
namespace GameServiceWarden.InteractionAPI.Communicable.Requests
|
||||
{
|
||||
public struct ConnectRequest
|
||||
{
|
||||
public string requestedIdentifier;
|
||||
public string programName;
|
||||
public string programAuthor;
|
||||
public string versionNumber;
|
||||
public string details;
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
using GameServiceWarden.InteractionAPI.Module;
|
||||
|
||||
namespace GameServiceWarden.InteractionAPI.Communicable.Requests
|
||||
{
|
||||
public struct ServiceRequest
|
||||
{
|
||||
public ServiceManagerAction serviceManagerAction;
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace GameServiceWarden.InteractionAPI
|
||||
{
|
||||
public struct DisconnectRequest
|
||||
{
|
||||
public string reason;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.IO.Pipes;
|
||||
|
||||
namespace GameServiceWarden.InteractionAPI.Communicable.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,12 @@
|
||||
using System.Security.Cryptography.X509Certificates;
|
||||
|
||||
namespace GameServiceWarden.InteractionAPI.Communicable.Responses
|
||||
{
|
||||
public struct ConnectResponse
|
||||
{
|
||||
public string identifier;
|
||||
public bool nameTaken;
|
||||
public bool invalidName;
|
||||
public string errorMsg;
|
||||
}
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
using GameServiceWarden.InteractionAPI.Module;
|
||||
|
||||
namespace GameServiceWarden.InteractionAPI.Communicable.Responses
|
||||
{
|
||||
public struct DeltaResponse
|
||||
{
|
||||
public ServiceManagerTotal gameServiceDelta;
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
namespace GameServiceWarden.InteractionAPI
|
||||
{
|
||||
public struct DisconnectResponse
|
||||
{
|
||||
public string reason;
|
||||
}
|
||||
}
|
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
|
||||
namespace GameServiceWarden.InteractionAPI.Communicable.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,8 @@
|
||||
namespace GameServiceWarden.InteractionAPI.Communicable.Responses
|
||||
{
|
||||
public struct UnexpectedRequestResponse
|
||||
{
|
||||
public CommunicableType origin;
|
||||
public string message;
|
||||
}
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
using GameServiceWarden.InteractionAPI.Module;
|
||||
|
||||
namespace GameServiceWarden.InteractionAPI.Communicable.Responses
|
||||
{
|
||||
public struct ViewResponse {
|
||||
public ServiceManagerTotal state;
|
||||
}
|
||||
}
|
@@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
@@ -0,0 +1,24 @@
|
||||
namespace GameServiceWarden.InteractionAPI.Module
|
||||
{
|
||||
public struct ServiceManagerAction
|
||||
{
|
||||
public enum Type
|
||||
{
|
||||
|
||||
Start,
|
||||
Stop,
|
||||
CreateService,
|
||||
DeleteService,
|
||||
ExecuteCommand,
|
||||
SetServiceOption,
|
||||
}
|
||||
|
||||
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.InteractionAPI.Module
|
||||
{
|
||||
public struct ServiceManagerDelta
|
||||
{
|
||||
public bool subtract;
|
||||
public string service;
|
||||
public string running;
|
||||
public string modules;
|
||||
public byte[] logs;
|
||||
public string optionName;
|
||||
public string optionValue;
|
||||
}
|
||||
}
|
@@ -0,0 +1,13 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace GameServiceWarden.InteractionAPI.Module
|
||||
{
|
||||
public struct ServiceManagerTotal
|
||||
{
|
||||
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