Attempt to get World Map working in Grid mode, will need to be using the grid asset server for it to work correctly and has only been quickly tested in a three region grid.

Moved PermissionManager creation out of the Scene constructor and instead a PermissionManager is passed to the constructor as a param. So that we could create and use custom permissionsManagers.
Added AllowMovement property to ScenePresence which can be used to stop movement of avatars (for example in a custom region that wanted avatars always in one place).
Added PermissionManager call when copying objects, although currently the call will always return true so that it allows copying in places like Wright Plaza. 
A few other changes/fixes.
afrisby
MW 2007-11-18 11:11:44 +00:00
parent 2cd00f46b9
commit 7f99644864
8 changed files with 105 additions and 70 deletions

View File

@ -366,9 +366,10 @@ namespace OpenSim
protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
AgentCircuitManager circuitManager) AgentCircuitManager circuitManager)
{ {
PermissionManager permissionManager = new PermissionManager();
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
return return
new Scene(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, new Scene(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer,
m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim); m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim);
} }

View File

@ -36,7 +36,7 @@ using OpenSim.Region.Environment.Scenes;
namespace OpenSim.Region.Environment.Modules namespace OpenSim.Region.Environment.Modules
{ {
//this is first attempt to start breaking the mess thats called the assetcache up. //this is a first attempt, to start breaking the mess thats called the assetcache up.
// basically this should be the texture sending (to clients) code moved out of assetcache // basically this should be the texture sending (to clients) code moved out of assetcache
//and some small clean up //and some small clean up
// but on first tests it didn't seem to work very well so is currently not in use. // but on first tests it didn't seem to work very well so is currently not in use.

View File

@ -48,12 +48,20 @@ namespace OpenSim.Region.Environment
set { m_bypassPermissions = value; } set { m_bypassPermissions = value; }
} }
public PermissionManager()
{
}
public PermissionManager(Scene scene) public PermissionManager(Scene scene)
{ {
m_scene = scene; m_scene = scene;
} }
public void Initialise(Scene scene)
{
m_scene = scene;
}
protected virtual void SendPermissionError(LLUUID user, string reason) protected virtual void SendPermissionError(LLUUID user, string reason)
{ {
m_scene.EventManager.TriggerPermissionError(user, reason); m_scene.EventManager.TriggerPermissionError(user, reason);
@ -188,6 +196,12 @@ namespace OpenSim.Region.Environment
return GenericObjectPermission(user, obj); return GenericObjectPermission(user, obj);
} }
public virtual bool CanCopyObject(LLUUID user, LLUUID obj)
{
return true;
// return GenericObjectPermission(user, obj);
}
#endregion #endregion
#region Communication Permissions #region Communication Permissions

View File

@ -626,20 +626,22 @@ namespace OpenSim.Region.Environment.Scenes
} }
if (originPrim != null) if (originPrim != null)
{
if (PermissionsMngr.CanCopyObject(AgentID, originPrim.UUID))
{ {
SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID); SceneObjectGroup copy = originPrim.Copy(AgentID, GroupID);
copy.AbsolutePosition = copy.AbsolutePosition + offset; copy.AbsolutePosition = copy.AbsolutePosition + offset;
Entities.Add(copy.UUID, copy); Entities.Add(copy.UUID, copy);
copy.ScheduleGroupForFullUpdate(); copy.ScheduleGroupForFullUpdate();
}
} }
else else
{ {
MainLog.Instance.Warn("client", "Attempted to duplicate nonexistant prim"); MainLog.Instance.Warn("client", "Attempted to duplicate nonexistant prim");
} }
}
}
#endregion #endregion
} }

View File

@ -195,7 +195,7 @@ namespace OpenSim.Region.Environment.Scenes
#region Constructors #region Constructors
public Scene(RegionInfo regInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, public Scene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim) ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim)
{ {
@ -217,15 +217,14 @@ namespace OpenSim.Region.Environment.Scenes
m_LandManager = new LandManager(this, m_regInfo); m_LandManager = new LandManager(this, m_regInfo);
m_estateManager = new EstateManager(this, m_regInfo); m_estateManager = new EstateManager(this, m_regInfo);
m_eventManager = new EventManager(); m_eventManager = new EventManager();
m_permissionManager = new PermissionManager(this);
m_permissionManager = permissionManager;
m_permissionManager.Initialise(this);
m_innerScene = new InnerScene(this, m_regInfo, m_permissionManager); m_innerScene = new InnerScene(this, m_regInfo, m_permissionManager);
m_sceneXmlLoader = new SceneXmlLoader(this, m_innerScene, m_regInfo); m_sceneXmlLoader = new SceneXmlLoader(this, m_innerScene, m_regInfo);
m_eventManager.OnParcelPrimCountAdd += RegisterDefaultSceneEvents();
m_LandManager.addPrimToLandPrimCounts;
m_eventManager.OnPermissionError += SendPermissionAlert;
MainLog.Instance.Verbose("Creating new entitities instance"); MainLog.Instance.Verbose("Creating new entitities instance");
Entities = new Dictionary<LLUUID, EntityBase>(); Entities = new Dictionary<LLUUID, EntityBase>();
@ -244,6 +243,13 @@ namespace OpenSim.Region.Environment.Scenes
#endregion #endregion
#region Startup / Close Methods #region Startup / Close Methods
protected virtual void RegisterDefaultSceneEvents()
{
m_eventManager.OnParcelPrimCountAdd += m_LandManager.addPrimToLandPrimCounts;
m_eventManager.OnPermissionError += SendPermissionAlert;
}
public override void Close() public override void Close()
{ {
ForEachScenePresence(delegate(ScenePresence avatar) ForEachScenePresence(delegate(ScenePresence avatar)
@ -504,6 +510,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
CreateTerrainTexture(); CreateTerrainTexture();
CommsManager.GridService.RegisterRegion(RegionInfo); //hack to update the terrain texture in grid mode so it shows on world map
} }
catch (Exception e) catch (Exception e)
{ {

View File

@ -147,6 +147,13 @@ namespace OpenSim.Region.Environment.Scenes
get { return m_lastname; } get { return m_lastname; }
} }
protected bool m_allowMovement = true;
public bool AllowMovement
{
get { return m_allowMovement; }
set { m_allowMovement = value; }
}
private readonly IClientAPI m_controllingClient; private readonly IClientAPI m_controllingClient;
protected PhysicsActor m_physicsActor; protected PhysicsActor m_physicsActor;
@ -529,6 +536,8 @@ namespace OpenSim.Region.Environment.Scenes
return; return;
} }
if (m_allowMovement)
{
int i = 0; int i = 0;
bool update_movementflag = false; bool update_movementflag = false;
bool update_rotation = false; bool update_rotation = false;
@ -581,6 +590,7 @@ namespace OpenSim.Region.Environment.Scenes
AddNewMovement(agent_control_v3, q); AddNewMovement(agent_control_v3, q);
UpdateMovementAnimations(update_movementflag); UpdateMovementAnimations(update_movementflag);
} }
}
} }

View File

@ -42,10 +42,10 @@ namespace SimpleApp
{ {
private List<ScenePresence> m_avatars; private List<ScenePresence> m_avatars;
public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer,
ModuleLoader moduleLoader, bool physicalPrim) ModuleLoader moduleLoader, bool physicalPrim)
: base(regionInfo, authen, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true) : base(regionInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true)
{ {
m_avatars = new List<Avatar>(); m_avatars = new List<Avatar>();
} }

View File

@ -169,9 +169,10 @@ namespace SimpleApp
protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager, protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
AgentCircuitManager circuitManager) AgentCircuitManager circuitManager)
{ {
PermissionManager permissionManager = new PermissionManager();
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
return return
new MyWorld(regionInfo, circuitManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, new MyWorld(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer,
new ModuleLoader(m_log, m_config), true); new ModuleLoader(m_log, m_config), true);
} }