| 1234567891011121314151617181920212223242526272829303132333435363738 | 
							- using InABox.Clients;
 
- using InABox.Core;
 
- using InABox.IPC;
 
- using System;
 
- using System.Collections.Generic;
 
- using System.Linq;
 
- using System.Text;
 
- using System.Threading.Tasks;
 
- namespace InABox.Client.IPC
 
- {
 
-     public static class IPCClientFactory
 
-     {
 
-         private static Dictionary<string, IPCClientTransport> Clients = new();
 
-         public static IPCClientTransport GetClient(string pipeName)
 
-         {
 
-             if (!Clients.TryGetValue(pipeName, out var client))
 
-             {
 
-                 client = new IPCClientTransport(pipeName);
 
-                 Clients[pipeName] = client;
 
-                 client.OnPush += Client_OnPush;
 
-             }
 
-             return client;
 
-         }
 
-         private static void Client_OnPush(IPCMessage request)
 
-         {
 
-             if(request.Method == Method.Push)
 
-             {
 
-                 if(request.Type is not null && CoreUtils.TryGetEntity(request.Type, out var entity))
 
-                 {
 
-                     ClientFactory.PushHandlers.Push(entity, request.GetRequest(entity));
 
-                 }
 
-             }
 
-         }
 
-     }
 
- }
 
 
  |