Separated view request from delta request and respective responses.

This commit is contained in:
2021-04-21 01:14:05 -05:00
parent f61bbd3a9e
commit 7438a76bf7
25 changed files with 130 additions and 114 deletions

View File

@@ -6,7 +6,8 @@ namespace GameServiceWarden.ClientAPI
{
Disconnect,
Connect,
Service,
View,
Delta,
UnexpectedCommunication
}
}

View File

@@ -1,9 +0,0 @@
using System;
namespace GameServiceWarden.ClientAPI
{
public interface ICommunicable
{
CommunicableType Type { get; }
}
}

View File

@@ -1,13 +1,11 @@
namespace GameServiceWarden.ClientAPI.Requests
namespace GameServiceWarden.ClientAPI.Communicable.Requests
{
public struct ConnectRequest : ICommunicable
public struct ConnectRequest
{
public string requestedIdentifier;
public string programName;
public string programAuthor;
public string versionNumber;
public string details;
public CommunicableType Type => CommunicableType.Connect;
}
}

View File

@@ -0,0 +1,9 @@
using GameServiceWarden.ClientAPI.Module;
namespace GameServiceWarden.ClientAPI.Communicable.Requests
{
public struct ServiceRequest
{
public ServiceManagerAction serviceManagerAction;
}
}

View File

@@ -1,7 +1,7 @@
using System;
using System.IO.Pipes;
namespace GameServiceWarden.ClientAPI.Requests
namespace GameServiceWarden.ClientAPI.Communicable.Requests
{
public static class RequestHeader
{

View File

@@ -1,11 +0,0 @@
using GameServiceWarden.ClientAPI.Module;
namespace GameServiceWarden.ClientAPI.Requests
{
public struct ServiceRequest : ICommunicable
{
public ServiceManagerAction serviceManagerAction;
public CommunicableType Type => CommunicableType.Service;
}
}

View File

@@ -0,0 +1,7 @@
namespace GameServiceWarden.ClientAPI.Communicable.Requests
{
public struct ViewRequest
{
}
}

View File

@@ -1,14 +1,12 @@
using System.Security.Cryptography.X509Certificates;
namespace GameServiceWarden.ClientAPI.Responses
namespace GameServiceWarden.ClientAPI.Communicable.Responses
{
public struct ConnectResponse : ICommunicable
public struct ConnectResponse
{
public string identifier;
public bool nameTaken;
public bool invalidName;
public string errorMsg;
public CommunicableType Type => CommunicableType.Connect;
}
}

View File

@@ -0,0 +1,9 @@
using GameServiceWarden.ClientAPI.Module;
namespace GameServiceWarden.ClientAPI.Communicable.Responses
{
public struct DeltaResponse
{
public ServiceManagerTotal gameServiceDelta;
}
}

View File

@@ -1,6 +1,6 @@
using System;
namespace GameServiceWarden.ClientAPI.Responses
namespace GameServiceWarden.ClientAPI.Communicable.Responses
{
public static class ResponseHeader
{

View File

@@ -1,11 +0,0 @@
using GameServiceWarden.ClientAPI.Module;
namespace GameServiceWarden.ClientAPI.Responses
{
public struct ServiceResponse : ICommunicable
{
public ServiceManagerState gameServiceDelta;
public CommunicableType Type => CommunicableType.Service;
}
}

View File

@@ -1,10 +1,8 @@
namespace GameServiceWarden.ClientAPI.Responses
namespace GameServiceWarden.ClientAPI.Communicable.Responses
{
public struct UnexpectedRequestResponse : ICommunicable
public struct UnexpectedRequestResponse
{
public CommunicableType origin;
public string message;
public CommunicableType Type => CommunicableType.UnexpectedCommunication;
}
}

View File

@@ -0,0 +1,8 @@
using GameServiceWarden.ClientAPI.Module;
namespace GameServiceWarden.ClientAPI.Communicable.Responses
{
public struct ViewResponse {
public ServiceManagerTotal state;
}
}

View File

@@ -11,7 +11,6 @@ namespace GameServiceWarden.ClientAPI.Module
DeleteService,
ExecuteCommand,
SetServiceOption,
View
}
public string assemblyName;

View File

@@ -0,0 +1,15 @@
using System.Collections.Generic;
namespace GameServiceWarden.ClientAPI.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;
}
}

View File

@@ -2,10 +2,8 @@ using System.Collections.Generic;
namespace GameServiceWarden.ClientAPI.Module
{
public struct ServiceManagerState
public struct ServiceManagerTotal
{
public bool delta;
public bool subtract;
public ICollection<string> services;
public ICollection<string> running;
public ICollection<string> modules;