// ProxySim: return the proxy for the specified sim, creating it if it doesn't exist private IPEndPoint ProxySim(IPEndPoint simEndPoint) { if (proxyEndPoints.ContainsKey(simEndPoint)) // return the existing proxy return (IPEndPoint)proxyEndPoints[simEndPoint]; else { // return a new proxy SimProxy simProxy = new SimProxy(proxyConfig, simEndPoint, this); IPEndPoint fakeSim = simProxy.LocalEndPoint(); OpenMetaverse.Logger.Log("Creating proxy for " + simEndPoint + " at " + fakeSim, Helpers.LogLevel.Info); simProxy.Run(); proxyEndPoints.Add(simEndPoint, fakeSim); simProxies.Add(simEndPoint, simProxy); return fakeSim; } }
// AddHandler: remember which sim proxy corresponds to a given sim private void AddHandler(EndPoint endPoint, SimProxy proxy) { proxyHandlers.Add(endPoint, proxy); }
// ProxySim: return the proxy for the specified sim, creating it if it doesn't exist private IPEndPoint ProxySim(IPEndPoint simEndPoint) { if (proxyEndPoints.ContainsKey(simEndPoint)) // return the existing proxy return (IPEndPoint)proxyEndPoints[simEndPoint]; else { // return a new proxy SimProxy simProxy = new SimProxy(proxyConfig, simEndPoint, this); IPEndPoint fakeSim = simProxy.LocalEndPoint(); Log("creating proxy for " + simEndPoint + " at " + fakeSim, false); simProxy.Run(); proxyEndPoints.Add(simEndPoint, fakeSim); simProxies.Add(simEndPoint, simProxy); return fakeSim; } }