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); }
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); } }
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(); } }