Example #1
0
 public void DefaultConfig()
 {
     var config = new KRPCConfiguration ("settings.cfg");
     Assert.AreEqual (IPAddress.Loopback, config.Address);
     Assert.AreEqual (50000, config.Port);
     Assert.AreEqual (true, config.MainWindowVisible);
     Assert.AreEqual (false, config.AutoAcceptConnections);
 }
Example #2
0
        public void Start()
        {
            var config = new KRPCConfiguration("settings.cfg");

            config.Load();
            OK = true;
            try {
                var services = Scanner.GetServices();
                if (CheckDocumented)
                {
                    CheckDocumentation(services.Values);
                }
            } catch (ServiceException e) {
                OK = false;
                var path = (e.Assembly == null ? "unknown" : e.Assembly.Location);
                PopupDialog.SpawnPopupDialog("kRPC service error - plugin disabled", e.Message + "\n\n" + path, "OK", true, HighLogic.Skin);
            }
        }
Example #3
0
        void Init()
        {
            if (server != null)
            {
                return;
            }

            config = new KRPCConfiguration("settings.cfg");
            config.Load();
            server = new KRPCServer(
                config.Address, config.RPCPort, config.StreamPort,
                config.OneRPCPerUpdate, config.MaxTimePerUpdate, config.AdaptiveRateControl,
                config.BlockingRecv, config.RecvTimeout);

            // Auto-start the server, if required
            if (config.AutoStartServer)
            {
                StartServer();
            }
        }