public static void Main(string[] args) { running = true; log4net.Config.XmlConfigurator.Configure(); log.Info("=== Matrix Host Server Launching ==="); log.Debug("Searching for encryption key "+Settings.Default.KeyFile+"..."); if(!File.Exists(Settings.Default.KeyFile)) { log.Error("No encryption key! Exiting..."); Console.ReadLine(); return; } byte[] hash; AES encrypt; //Hash the file to a all lowercase string using (var md5 = MD5.Create()) { using (var stream = File.OpenRead(Settings.Default.KeyFile)) { hash = md5.ComputeHash(stream); encrypt = new AES(Encoding.UTF8, Settings.Default.KeyFile); } } client = new HostClient(Settings.Default.MasterIP, Settings.Default.MasterPort, encrypt, hash); nodeLibraryManager = new NodeLibraryManager("CompiledNodes", client); pool = new NodePool(); client.Startup(); while(running) { Thread.Sleep(50); } client.Shutdown(); if(restart) { restart = false; Main(args); } }
public NodePool() { Instance = this; Nodes = new Dictionary<NodeInfo, INode>(); rmiResponses = new Dictionary<int, NodeRMI>(); }