public void load() { _filename = Application.dataPath + "/" + configFilename; if (File.Exists(_filename)) { _log.WriteLine(this, "Config file found!"); try { localSetupInfo = _retrieveInfo(_location); remoteSetupInfo = _retrieveInfo(_location == Location.A ? Location.B : Location.A); _configRead = true; } catch (Exception e) { Debug.Log(e.Message); Debug.Log(e.StackTrace); _configRead = false; } } else { _log.WriteLine(this, "Cannot find the config file"); } }
private NSInfo _retrieveInfo(Location _location) { NSInfo info = new NSInfo(); info.location = _location; info.machineAddress = load(_location.ToString() + ".machine.address"); info.rpcPort = load(_location.ToString() + ".rpc.port"); info.receiveHandheldPort = load(_location.ToString() + ".rcv.handheld.port"); info.trackerBroadcastPort = load(_location.ToString() + ".tracker.broadcast.port"); info.trackerListenPort = load(_location.ToString() + ".tracker.listen.port"); info.ravatarListenPort = load(_location.ToString() + ".ravatar.listen.port"); info.localSurfaceListen = load(_location.ToString() + ".local.surface.listen"); info.remoteSurfaceListen = load(_location.ToString() + ".remote.surface.listen"); negativeSpaceLength = float.Parse(load("ns.length")); return(info); }