public bool RemovePortal(int worldId) { if (_world == null) { return(false); } using (TimedLock.Lock(_worldLock)) { if (!_portals.ContainsKey(worldId)) { return(false); } var portal = _portals[worldId]; _world.LeaveWorld(portal); _portals.Remove(worldId); return(true); } }
public bool RemovePortal(int worldId) { if (_world == null) { return(false); } using (TimedLock.Lock(_worldLock)) { if (!_portals.ContainsKey(worldId)) { return(false); } var portal = _portals[worldId]; _world.LeaveWorld(portal); _portals.Remove(worldId); Log.InfoFormat("Portal {0}({1}) removed.", portal.WorldInstance.Id, portal.WorldInstance.Name); return(true); } }