Exemplo n.º 1
0
 private void AddIdentity(string nodeid, string identity)
 {
     if (mRoutes.TryGetValue(nodeid, out Route route))
     {
         if (route.InternalIdentities.TryAdd(identity, true))
         {
             Logger.LogInformation("Identity added '{0}' for '{1}'", identity, nodeid);
             OnIdentityAdd?.Invoke(mSession, route, identity);
         }
     }
 }
Exemplo n.º 2
0
        private void AddRoute(string nodeid, List <string> identities)
        {
            Route route = new Route()
            {
                NodeID = nodeid
            };

            if (mRoutes.TryAdd(nodeid, route))
            {
                Logger.LogInformation("Route added '{0}'", nodeid);
                OnRouteAdd?.Invoke(mSession, route);
            }

            identities?.ForEach(i =>
            {
                if (route.InternalIdentities.TryAdd(i, true))
                {
                    Logger.LogInformation("Identity added '{0}' for '{1}'", i, nodeid);
                    OnIdentityAdd?.Invoke(mSession, route, i);
                }
            });
        }