public static int AddNode(Node node) { int nodeID = nodes.Count; // Add the nodes nodeStatus.Add(nodeID, NodeStatus.NodeAlive); nodes.Add(nodeID, node); if (node == null) { Log.Debug("NodeManager", "Adding dummy node with id " + nodeID); return 0; // Ignore it... } Log.Debug("Node", "Node connected with id " + nodeID); // Send a notification with the nodeInfo NodeInfo info = new NodeInfo(); info.nodeID = nodeID; info.solarSystems.Items.Add(new PyNone()); // This will let the node load the solarSystems it wants node.Notify(info.Encode()); return nodeID; }
private void SendNodeChangeNotification() { NodeInfo nodeInfo = new NodeInfo(); nodeInfo.nodeID = NodeManager.GetNodeID(this); nodeInfo.solarSystems.Items.Add(new PyNone()); // None = All solar systems Send(nodeInfo.Encode()); }
public void SendNodeChangeNotification() { if (Type != ConnectionType.Node) { return; } NodeInfo nodeInfo = new NodeInfo(); nodeInfo.nodeID = NodeID; nodeInfo.solarSystems.Items.Add(new PyNone()); // None = All solar systems Send(nodeInfo.Encode()); }