public void AddSceneToEventForwarding(Scene virtualScene) { lock (m_virtScene) { if (m_virtScene.ContainsKey(virtualScene.RegionInfo.originRegionID)) { m_virtScene[virtualScene.RegionInfo.originRegionID] = virtualScene; } else { m_virtScene.Add(virtualScene.RegionInfo.originRegionID, virtualScene); } } lock (m_forwarders) { // TODO: Fix this to unregister if this happens if (m_forwarders.ContainsKey(virtualScene.RegionInfo.originRegionID)) { m_forwarders.Remove(virtualScene.RegionInfo.originRegionID); } RegionCombinerIndividualEventForwarder forwarder = new RegionCombinerIndividualEventForwarder(m_rootScene, virtualScene); m_forwarders.Add(virtualScene.RegionInfo.originRegionID, forwarder); virtualScene.EventManager.OnNewClient += forwarder.ClientConnect; virtualScene.EventManager.OnClientClosed += forwarder.ClientClosed; } }
public void AddSceneToEventForwarding(Scene virtualScene) { lock (m_virtScene) { if (m_virtScene.ContainsKey(virtualScene.RegionInfo.originRegionID)) { m_virtScene[virtualScene.RegionInfo.originRegionID] = virtualScene; } else { m_virtScene.Add(virtualScene.RegionInfo.originRegionID, virtualScene); } } lock (m_forwarders) { // TODO: Fix this to unregister if this happens if (m_forwarders.ContainsKey(virtualScene.RegionInfo.originRegionID)) m_forwarders.Remove(virtualScene.RegionInfo.originRegionID); RegionCombinerIndividualEventForwarder forwarder = new RegionCombinerIndividualEventForwarder(m_rootScene, virtualScene); m_forwarders.Add(virtualScene.RegionInfo.originRegionID, forwarder); virtualScene.EventManager.OnNewClient += forwarder.ClientConnect; virtualScene.EventManager.OnClientClosed += forwarder.ClientClosed; } }
public void RemoveSceneFromEventForwarding(Scene virtualScene) { lock (m_forwarders) { RegionCombinerIndividualEventForwarder forwarder = m_forwarders[virtualScene.RegionInfo.originRegionID]; virtualScene.EventManager.OnNewClient -= forwarder.ClientConnect; virtualScene.EventManager.OnClientClosed -= forwarder.ClientClosed; m_forwarders.Remove(virtualScene.RegionInfo.originRegionID); } lock (m_virtScene) { if (m_virtScene.ContainsKey(virtualScene.RegionInfo.originRegionID)) { m_virtScene.Remove(virtualScene.RegionInfo.originRegionID); } } }