implement profile interaction registration through plugins (mute and vpn detection implementation)

This commit is contained in:
RaidMax
2022-09-08 15:03:38 -05:00
parent 3cffdfdd9d
commit 2380f23dbe
26 changed files with 452 additions and 26 deletions

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using Data.Models.Client;
using InteractionCallback = System.Func<int?, Data.Models.Reference.Game?, System.Threading.CancellationToken, System.Threading.Tasks.Task<string>>;
using ScriptInteractionCallback = System.Func<int?, Data.Models.Reference.Game?, System.Threading.CancellationToken, System.Threading.Tasks.Task<string>>;
namespace SharedLibraryCore.Interfaces;
public interface IInteractionData
{
int? EntityId { get; }
bool Enabled { get; }
string Name { get; }
string Description { get; }
string DisplayMeta { get; }
string ActionPath { get; }
Dictionary<string, string> ActionMeta { get; }
string ActionUri { get; }
EFClient.Permission? MinimumPermission { get; }
string PermissionEntity { get; }
string PermissionAccess { get; }
string Source { get; }
InteractionCallback Action { get; }
Delegate ScriptAction { get; }
}

View File

@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Data.Models;
namespace SharedLibraryCore.Interfaces;
public interface IInteractionRegistration
{
void RegisterScriptInteraction(string interactionName, string source, Delegate interactionRegistration);
void RegisterInteraction(string interactionName, Func<int?, Reference.Game?, CancellationToken, Task<IInteractionData>> interactionRegistration);
void UnregisterInteraction(string interactionName);
Task<IEnumerable<IInteractionData>> GetInteractions(int? clientId = null,
Reference.Game? game = null, CancellationToken token = default);
Task<string> ProcessInteraction(string interactionId, int? clientId = null, Reference.Game? game = null, CancellationToken token = default);
}