private NegativeSpaceInfo _retrieve(Location location) { NegativeSpaceInfo info = new NegativeSpaceInfo(); 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.avatarListenPort = load(location.ToString() + ".avatar.listen.port"); info.localSurfaceListen = load(location.ToString() + ".local.surface.listen"); info.remoteSurfaceListen = load(location.ToString() + ".remote.surface.listen"); negativeSpaceLength = float.Parse(load("ns.length")); serverAddress = load("rpc.server.address"); return(info); }
public void load(Location myLocation) { _location = myLocation; if (System.IO.File.Exists(configFilenameFullPath)) { if (_location == Location.Instructor) { localSetupInfo = _retrieve(Location.Instructor); remoteSetupInfo = _retrieve(Location.Assembler); } else { localSetupInfo = _retrieve(Location.Assembler); remoteSetupInfo = _retrieve(Location.Instructor); } } else { throw new NegativeRuntimeException("Cannot find config file (" + configFilenameFullPath + ")"); } }