Added full chain of P&L notifications

This commit is contained in:
Falkvinge
2017-05-16 08:13:16 +02:00
parent c61bff3866
commit cc40100824
7 changed files with 204 additions and 18 deletions
+13 -1
View File
@@ -13,6 +13,7 @@ using Swarmops.Common.Enums;
using Swarmops.Logic.Communications;
using Swarmops.Logic.Communications.Payload;
using Swarmops.Common.ExtensionMethods;
using Swarmops.Logic;
using Swarmops.Logic.Security;
using Swarmops.Logic.Structure;
using Swarmops.Logic.Support;
@@ -343,7 +344,7 @@ namespace Swarmops.Frontend.Socket
{
Console.WriteLine(" - Backend socket error: " + args.Message);
// TODO: Try reconnecting
// TODO: Try reconnecting if closed or never opened
}
@@ -408,6 +409,17 @@ namespace Swarmops.Frontend.Socket
return false;
}
public static void SendMessageUpstream(SocketMessage message)
{
JObject json = new JObject();
json["ServerRequest"] = "Metapackage";
json["XmlData"] = message.ToXml();
_backendSocket.Send(json.ToString());
}
private static Dictionary<FrontendMalfunctions,bool> _activeAlarms;
internal static WebSocketServer SocketServer { get { return _socketServer; } }