* Started renaming world to Scene

* Update and UpdateMovement now first stores array to avoid collection update exceptions
* Ignored some bins
afrisby
lbsa71 2007-07-26 14:55:42 +00:00
parent 74654dc735
commit 39b64564dc
20 changed files with 137 additions and 202 deletions

View File

@ -44,7 +44,7 @@ namespace OpenSim.Framework.Interfaces
void LoadPrimitives(ILocalStorageReceiver receiver);
[System.Obsolete("Use DataStorage instead")]
float[] LoadWorld();
float[] LoadScene();
[System.Obsolete("Use DataStorage instead")]
void SaveMap(float[] heightmap);

View File

@ -30,7 +30,7 @@ using OpenSim.Framework.Types;
namespace OpenSim.Framework.Interfaces
{
public interface IWorld
public interface IScene
{
void AddNewClient(IClientAPI client, bool child);
void RemoveClient(LLUUID agentID);

View File

@ -65,7 +65,7 @@ namespace OpenSim
protected List<UDPServer> m_udpServers = new List<UDPServer>();
protected List<RegionInfo> m_regionData = new List<RegionInfo>();
protected List<IWorld> m_localWorld = new List<IWorld>();
protected List<IScene> m_localScenes = new List<IScene>();
private bool m_silent;
private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log";
@ -83,7 +83,7 @@ namespace OpenSim
/// <summary>
/// Performs initialisation of the world, such as loading configuration from disk.
/// Performs initialisation of the scene, such as loading configuration from disk.
/// </summary>
public override void StartUp()
{
@ -126,7 +126,7 @@ namespace OpenSim
UDPServer udpServer;
Scene scene = SetupScene(regionInfo, out udpServer);
m_localWorld.Add(scene);
m_localScenes.Add(scene);
m_udpServers.Add(udpServer);
@ -311,9 +311,9 @@ namespace OpenSim
m_log.Verbose("Main.cs:Shutdown() - Killing clients");
// IMPLEMENT THIS
m_log.Verbose("Main.cs:Shutdown() - Closing console and terminating");
for (int i = 0; i < m_localWorld.Count; i++)
for (int i = 0; i < m_localScenes.Count; i++)
{
((Scene)m_localWorld[i]).Close();
((Scene)m_localScenes[i]).Close();
}
m_log.Close();
Environment.Exit(0);
@ -343,32 +343,32 @@ namespace OpenSim
case "terrain":
string result = "";
for (int i = 0; i < m_localWorld.Count; i++)
for (int i = 0; i < m_localScenes.Count; i++)
{
if (!((Scene)m_localWorld[i]).Terrain.RunTerrainCmd(cmdparams, ref result, m_localWorld[i].RegionInfo.RegionName))
if (!((Scene)m_localScenes[i]).Terrain.RunTerrainCmd(cmdparams, ref result, m_localScenes[i].RegionInfo.RegionName))
{
m_log.Error(result);
}
}
break;
case "script":
for (int i = 0; i < m_localWorld.Count; i++)
for (int i = 0; i < m_localScenes.Count; i++)
{
((Scene)m_localWorld[i]).SendCommandToScripts(cmdparams);
((Scene)m_localScenes[i]).SendCommandToScripts(cmdparams);
}
break;
case "backup":
for (int i = 0; i < m_localWorld.Count; i++)
for (int i = 0; i < m_localScenes.Count; i++)
{
((Scene)m_localWorld[i]).Backup();
((Scene)m_localScenes[i]).Backup();
}
break;
case "alert":
for (int i = 0; i < m_localWorld.Count; i++)
for (int i = 0; i < m_localScenes.Count; i++)
{
((Scene)m_localWorld[i]).HandleAlertCommand(cmdparams);
((Scene)m_localScenes[i]).HandleAlertCommand(cmdparams);
}
break;
@ -398,14 +398,14 @@ namespace OpenSim
case "users":
ScenePresence TempAv;
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname", "Agent ID", "Session ID", "Circuit", "IP", "World"));
for (int i = 0; i < m_localWorld.Count; i++)
for (int i = 0; i < m_localScenes.Count; i++)
{
foreach (libsecondlife.LLUUID UUID in ((Scene)m_localWorld[i]).Entities.Keys)
foreach (libsecondlife.LLUUID UUID in ((Scene)m_localScenes[i]).Entities.Keys)
{
if (((Scene)m_localWorld[i]).Entities[UUID].ToString() == "OpenSim.world.Avatar")
if (((Scene)m_localScenes[i]).Entities[UUID].ToString() == "OpenSim.world.Avatar")
{
TempAv = (ScenePresence)((Scene)m_localWorld[i]).Entities[UUID];
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.AgentId, "Unknown", "Unknown"), ((Scene)m_localWorld[i]).RegionInfo.RegionName);
TempAv = (ScenePresence)((Scene)m_localScenes[i]).Entities[UUID];
m_log.Error(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}", TempAv.firstname, TempAv.lastname, UUID, TempAv.ControllingClient.AgentId, "Unknown", "Unknown"), ((Scene)m_localScenes[i]).RegionInfo.RegionName);
}
}
}

View File

@ -146,7 +146,7 @@ namespace OpenSim.Region.ClientStack
}
}
#region World/Avatar to Client
#region Scene/Avatar to Client
/// <summary>
///

View File

@ -73,7 +73,7 @@ namespace OpenSim.Region.ClientStack
}
break;
#region World/Avatar
#region Scene/Avatar
case PacketType.ChatFromViewer:
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
if (Util.FieldToString(inchatpack.ChatData.Message) == "")
@ -466,33 +466,7 @@ namespace OpenSim.Region.ClientStack
// Console.WriteLine(Pack.ToString());
UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
/*if (myinventory != null)
{
if (updatetask.UpdateData.Key == 0)
{
if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null)
{
if (myinventory.InventoryItems[updatetask.InventoryData.ItemID].Type == 7)
{
LLUUID noteaid = myinventory.InventoryItems[updatetask.InventoryData.ItemID].AssetID;
AssetBase assBase = this.m_assetCache.GetAsset(noteaid);
if (assBase != null)
{
foreach (Entity ent in m_world.Entities.Values)
{
if (ent.localid == updatetask.UpdateData.LocalID)
{
if (ent is OpenSim.world.Primitive)
{
this.m_world.AddScript(ent, Util.FieldToString(assBase.Data));
}
}
}
}
}
}
}
}*/
break;
case PacketType.MapLayerRequest:
this.RequestMapLayer();
@ -524,7 +498,7 @@ namespace OpenSim.Region.ClientStack
{
AssetLandmark lm = new AssetLandmark(lma);
if (lm.RegionID == m_world.RegionInfo.SimUUID)
if (lm.RegionID == m_scene.RegionInfo.SimUUID)
{
TeleportLocalPacket tpLocal = new TeleportLocalPacket();

View File

@ -72,7 +72,7 @@ namespace OpenSim.Region.ClientStack
private AgentAssetUpload UploadAssets;
private LLUUID newAssetFolder = LLUUID.Zero;
private bool debug = false;
protected IWorld m_world;
protected IScene m_scene;
private Dictionary<uint, ClientView> m_clientThreads;
private AssetCache m_assetCache;
private InventoryCache m_inventoryCache;
@ -85,9 +85,9 @@ namespace OpenSim.Region.ClientStack
private int probesWithNoIngressPackets = 0;
private int lastPacketsReceived = 0;
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions )
public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions )
{
m_world = world;
m_scene = scene;
m_clientThreads = clientThreads;
m_assetCache = assetCache;
@ -121,7 +121,7 @@ namespace OpenSim.Region.ClientStack
{
clientPingTimer.Stop();
this.m_inventoryCache.ClientLeaving(this.AgentID, null);
m_world.RemoveClient(this.AgentId);
m_scene.RemoveClient(this.AgentId);
m_clientThreads.Remove(this.CircuitCode);
m_networkServer.RemoveClientCircuit(this.CircuitCode);
@ -231,8 +231,8 @@ namespace OpenSim.Region.ClientStack
clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
clientPingTimer.Enabled = true;
MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
this.m_world.AddNewClient(this, false);
MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to scene");
this.m_scene.AddNewClient(this, false);
}
protected virtual void AuthUser()

View File

@ -40,7 +40,7 @@ namespace OpenSim.Region.ClientStack
public class PacketServer
{
private ClientStackNetworkHandler _networkHandler;
private IWorld _localWorld;
private IScene _localScene;
public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
private ClientManager m_clientManager = new ClientManager();
public ClientManager ClientManager
@ -54,11 +54,11 @@ namespace OpenSim.Region.ClientStack
_networkHandler.RegisterPacketServer(this);
}
public IWorld LocalWorld
public IScene LocalScene
{
set
{
this._localWorld = value;
this._localScene = value;
}
}
@ -122,19 +122,7 @@ namespace OpenSim.Region.ClientStack
}
/// <summary>
///
/// </summary>
/// <param name="remoteEP"></param>
/// <param name="initialcirpack"></param>
/// <param name="clientThreads"></param>
/// <param name="world"></param>
/// <param name="assetCache"></param>
/// <param name="packServer"></param>
/// <param name="inventoryCache"></param>
/// <param name="authenSessions"></param>
/// <returns></returns>
protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions)
protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions)
{
return new ClientView(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions );
}
@ -151,7 +139,7 @@ namespace OpenSim.Region.ClientStack
public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AgentCircuitManager authenticateSessionsClass)
{
ClientView newuser =
CreateNewClient(epSender, useCircuit, ClientThreads, _localWorld, assetCache, this, inventoryCache,
CreateNewClient(epSender, useCircuit, ClientThreads, _localScene, assetCache, this, inventoryCache,
authenticateSessionsClass);
this.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);

View File

@ -108,7 +108,7 @@ namespace OpenSim.Region.ClientStack
StorageManager storageManager = CreateStorageManager(regionInfo);
Scene scene = CreateScene(regionInfo, storageManager, authen);
udpServer.LocalWorld = scene;
udpServer.LocalScene = scene;
scene.LoadWorldMap();

View File

@ -53,7 +53,7 @@ namespace OpenSim.Region.ClientStack
protected PacketServer _packetServer;
protected int listenPort;
protected IWorld m_localWorld;
protected IScene m_localScene;
protected AssetCache m_assetCache;
protected InventoryCache m_inventoryCache;
protected LogBase m_log;
@ -71,12 +71,12 @@ namespace OpenSim.Region.ClientStack
}
}
public IWorld LocalWorld
public IScene LocalScene
{
set
{
this.m_localWorld = value;
this._packetServer.LocalWorld = this.m_localWorld;
this.m_localScene = value;
this._packetServer.LocalScene = this.m_localScene;
}
}

View File

@ -45,12 +45,12 @@ namespace OpenSim.Region.Environment
/// </summary>
public class EstateManager
{
private Scene m_world;
private Scene m_scene;
private RegionInfo m_regInfo;
public EstateManager(Scene world,RegionInfo reginfo)
public EstateManager(Scene scene,RegionInfo reginfo)
{
m_world = world; //Estate settings found at world.m_regInfo.estateSettings
m_scene = scene;
m_regInfo = reginfo;
}
@ -243,7 +243,7 @@ namespace OpenSim.Region.Environment
public void sendRegionInfoPacketToAll()
{
List<Avatar> avatars = m_world.RequestAvatarList();
List<Avatar> avatars = m_scene.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
@ -253,7 +253,7 @@ namespace OpenSim.Region.Environment
public void sendRegionHandshakeToAll()
{
List<Avatar> avatars = m_world.RequestAvatarList();
List<Avatar> avatars = m_scene.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{

View File

@ -18,7 +18,7 @@ namespace OpenSim.Region.Environment.LandManagement
public LandData landData = new LandData();
public List<SceneObject> primsOverMe = new List<SceneObject>();
public Scene m_world;
public Scene m_scene;
private bool[,] landBitmap = new bool[64, 64];
@ -26,9 +26,9 @@ namespace OpenSim.Region.Environment.LandManagement
#region Constructors
public Land(LLUUID owner_id, bool is_group_owned, Scene world)
public Land(LLUUID owner_id, bool is_group_owned, Scene scene)
{
m_world = world;
m_scene = scene;
landData.ownerID = owner_id;
landData.isGroupOwned = is_group_owned;
@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.LandManagement
public Land Copy()
{
Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_world);
Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_scene);
//Place all new variables here!
newLand.landBitmap = (bool[,])(this.landBitmap.Clone());
@ -101,7 +101,7 @@ namespace OpenSim.Region.Environment.LandManagement
updatePacket.ParcelData.LocalID = landData.localID;
if (landData.area > 0)
{
updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor)));
updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
}
else
{
@ -118,14 +118,17 @@ namespace OpenSim.Region.Environment.LandManagement
updatePacket.ParcelData.OwnerID = landData.ownerID;
updatePacket.ParcelData.OwnerPrims = landData.ownerPrims;
updatePacket.ParcelData.ParcelFlags = landData.landFlags;
updatePacket.ParcelData.ParcelPrimBonus = m_world.RegionInfo.estateSettings.objectBonusFactor;
updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.estateSettings.objectBonusFactor;
updatePacket.ParcelData.PassHours = landData.passHours;
updatePacket.ParcelData.PassPrice = landData.passPrice;
updatePacket.ParcelData.PublicCount = 0; //unemplemented
updatePacket.ParcelData.RegionDenyAnonymous = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0);
updatePacket.ParcelData.RegionDenyIdentified = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0);
updatePacket.ParcelData.RegionDenyTransacted = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0);
updatePacket.ParcelData.RegionPushOverride = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0);
uint regionFlags = (uint)m_scene.RegionInfo.estateSettings.regionFlags;
updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0);
updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0);
updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0);
updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0);
updatePacket.ParcelData.RentPrice = 0;
updatePacket.ParcelData.RequestResult = request_result;
updatePacket.ParcelData.SalePrice = landData.salePrice;
@ -134,7 +137,7 @@ namespace OpenSim.Region.Environment.LandManagement
updatePacket.ParcelData.SequenceID = sequence_id;
if (landData.simwideArea > 0)
{
updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor)));
updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
}
else
{
@ -180,10 +183,10 @@ namespace OpenSim.Region.Environment.LandManagement
public void sendLandUpdateToAvatarsOverMe()
{
List<ScenePresence> avatars = m_world.RequestAvatarList();
List<ScenePresence> avatars = m_scene.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
Land over = m_world.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y));
Land over = m_scene.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y));
if (over.landData.localID == this.landData.localID)
{
sendLandProperties(0, false, 0, avatars[i].ControllingClient);
@ -219,8 +222,8 @@ namespace OpenSim.Region.Environment.LandManagement
}
}
}
landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_world.Terrain.GetHeight((min_x * 4), (min_y * 4)));
landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_world.Terrain.GetHeight((max_x * 4), (max_y * 4)));
landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_scene.Terrain.GetHeight((min_x * 4), (min_y * 4)));
landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_scene.Terrain.GetHeight((max_x * 4), (max_y * 4)));
landData.area = tempArea;
}

View File

@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.LandManagement
/// </summary>
public bool landPrimCountTainted = false;
private Scene m_world;
private Scene m_scene;
private RegionInfo m_regInfo;
#endregion
#region Constructors
public LandManager(Scene world, RegionInfo reginfo)
public LandManager(Scene scene, RegionInfo reginfo)
{
m_world = world;
m_scene = scene;
m_regInfo = reginfo;
landIDList.Initialize();
@ -106,7 +106,7 @@ namespace OpenSim.Region.Environment.LandManagement
#region Parcel From Storage Functions
public void LandFromStorage(LandData data)
{
Land new_land = new Land(data.ownerID, data.isGroupOwned, m_world);
Land new_land = new Land(data.ownerID, data.isGroupOwned, m_scene);
new_land.landData = data.Copy();
new_land.setLandBitmapFromByteArray();
addLandObject(new_land);
@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.LandManagement
/// <returns></returns>
public Land createBaseLand()
{
return new Land(new LLUUID(), false, m_world);
return new Land(new LLUUID(), false, m_scene);
}
/// <summary>
@ -517,7 +517,7 @@ namespace OpenSim.Region.Environment.LandManagement
lastLandLocalID = START_LAND_LOCAL_ID - 1;
landIDList.Initialize();
Land fullSimParcel = new Land(LLUUID.Zero, false, m_world);
Land fullSimParcel = new Land(LLUUID.Zero, false, m_scene);
fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256));
fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID;
@ -529,7 +529,7 @@ namespace OpenSim.Region.Environment.LandManagement
public void handleSignificantClientMovement(IClientAPI remote_client)
{
ScenePresence clientAvatar = m_world.RequestAvatar(remote_client.AgentId);
ScenePresence clientAvatar = m_scene.RequestAvatar(remote_client.AgentId);
if (clientAvatar != null)
{
Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y);

View File

@ -31,8 +31,8 @@ using OpenSim.Physics.Manager;
namespace OpenSim.Region.Environment.Scenes
{
public abstract class Entity :EntityBase //this class (Entity) will be phased out
{
public abstract class Entity : EntityBase //this class (Entity) will be phased out
{
protected PhysicsActor _physActor;
/// <summary>
@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Scenes
{
get
{
if (this._physActor != null)
if (_physActor != null)
{
m_pos.X = _physActor.Position.X;
m_pos.Y = _physActor.Position.Y;
@ -53,14 +53,13 @@ namespace OpenSim.Region.Environment.Scenes
}
set
{
if (this._physActor != null)
if (_physActor != null)
{
try
{
lock (this.m_world.SyncRoot)
lock (m_scene.SyncRoot)
{
this._physActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
_physActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
}
}
catch (Exception e)
@ -73,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
/// <summary>
///
/// </summary>
@ -81,7 +80,7 @@ namespace OpenSim.Region.Environment.Scenes
{
get
{
if (this._physActor != null)
if (_physActor != null)
{
m_velocity.X = _physActor.Velocity.X;
m_velocity.Y = _physActor.Velocity.Y;
@ -92,14 +91,13 @@ namespace OpenSim.Region.Environment.Scenes
}
set
{
if (this._physActor != null)
if (_physActor != null)
{
try
{
lock (this.m_world.SyncRoot)
lock (m_scene.SyncRoot)
{
this._physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
_physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
}
}
catch (Exception e)
@ -112,4 +110,4 @@ namespace OpenSim.Region.Environment.Scenes
}
}
}
}
}

View File

@ -11,7 +11,7 @@ namespace OpenSim.Region.Environment.Scenes
protected List<EntityBase> m_children;
protected Scene m_world;
protected Scene m_scene;
protected string m_name;
/// <summary>
@ -24,19 +24,14 @@ namespace OpenSim.Region.Environment.Scenes
}
protected LLVector3 m_pos;
/// <summary>
///
/// </summary>
public virtual LLVector3 Pos
{
get
{
return m_pos;
}
set
{
m_pos = value;
}
get { return m_pos; }
set { m_pos = value; }
}
public LLVector3 m_velocity;
@ -46,28 +41,16 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public virtual LLVector3 Velocity
{
get
{
return m_velocity;
}
set
{
m_velocity = value;
}
get { return m_velocity; }
set { m_velocity = value; }
}
protected Quaternion m_rotation = new Quaternion(0,0,1,0);
protected Quaternion m_rotation = new Quaternion(0, 0, 1, 0);
public virtual Quaternion Rotation
{
get
{
return m_rotation;
}
set
{
m_rotation = value;
}
get { return m_rotation; }
set { m_rotation = value; }
}
protected uint m_localId;
@ -91,19 +74,17 @@ namespace OpenSim.Region.Environment.Scenes
m_name = "(basic entity)";
m_children = new List<EntityBase>();
}
/// <summary>
///
/// </summary>
public virtual void updateMovement()
public virtual void UpdateMovement()
{
foreach (EntityBase child in m_children)
{
child.updateMovement();
child.UpdateMovement();
}
}
@ -125,7 +106,6 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public virtual void BackUp()
{
}
/// <summary>
@ -134,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns>
public virtual EntityBase Copy()
{
return (EntityBase)this.MemberwiseClone();
return (EntityBase) MemberwiseClone();
}
/// <summary>
@ -142,7 +122,6 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public virtual void LandRenegerated()
{
}
}
}
}

View File

@ -138,22 +138,11 @@ namespace OpenSim.Region.Environment.Scenes
#region Constructors
/// <summary>
///
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="world"></param>
/// <param name="addPacket"></param>
/// <param name="ownerID"></param>
/// <param name="localID"></param>
/// <param name="isRoot"></param>
/// <param name="parent"></param>
/// <param name="rootObject"></param>
public Primitive(ulong regionHandle, Scene world, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent,
public Primitive(ulong regionHandle, Scene scene, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent,
SceneObject rootObject, PrimitiveBaseShape shape, LLVector3 pos)
{
m_regionHandle = regionHandle;
m_world = world;
m_scene = scene;
m_inventoryItems = new Dictionary<LLUUID, InventoryItem>();
m_Parent = parent;
m_isRootPrim = isRoot;
@ -163,7 +152,7 @@ namespace OpenSim.Region.Environment.Scenes
Rotation = Quaternion.Identity;
m_world.AcknowledgeNewPrim(this);
m_scene.AcknowledgeNewPrim(this);
OnPrimCountTainted();
}
@ -202,10 +191,10 @@ namespace OpenSim.Region.Environment.Scenes
dupe.m_children = new List<EntityBase>();
dupe.m_Shape = m_Shape.Copy();
dupe.m_regionHandle = m_regionHandle;
dupe.m_world = m_world;
dupe.m_scene = m_scene;
uint newLocalID = m_world.PrimIDAllocate();
uint newLocalID = m_scene.PrimIDAllocate();
dupe.m_uuid = LLUUID.Random();
dupe.LocalId = newLocalID;
@ -225,7 +214,7 @@ namespace OpenSim.Region.Environment.Scenes
dupe.m_pos = new LLVector3(m_pos.X, m_pos.Y, m_pos.Z);
rootParent.AddChildToList(dupe);
m_world.AcknowledgeNewPrim(dupe);
m_scene.AcknowledgeNewPrim(dupe);
dupe.TriggerOnPrimCountTainted();
@ -327,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes
m_children.Add(linkObject.rootPrimitive);
linkObject.rootPrimitive.SetNewParent(this, m_RootParent);
m_world.DeleteEntity(linkObject.rootUUID);
m_scene.DeleteEntity(linkObject.rootUUID);
linkObject.DeleteAllChildren();
OnPrimCountTainted();
@ -676,7 +665,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void SendFullUpdateToAllClients()
{
List<ScenePresence> avatars = m_world.RequestAvatarList();
List<ScenePresence> avatars = m_scene.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
SendFullUpdateToClient(avatars[i].ControllingClient);
@ -721,7 +710,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void SendTerseUpdateToALLClients()
{
List<ScenePresence> avatars = m_world.RequestAvatarList();
List<ScenePresence> avatars = m_scene.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
SendTerseUpdateToClient(avatars[i].ControllingClient);

View File

@ -140,23 +140,23 @@ namespace OpenSim.Region.Environment.Scenes
m_eventManager = new EventManager();
m_eventManager.OnParcelPrimCountAdd +=
new EventManager.OnParcelPrimCountAddDelegate(m_LandManager.addPrimToLandPrimCounts);
m_LandManager.addPrimToLandPrimCounts;
MainLog.Instance.Verbose("World.cs - creating new entitities instance");
MainLog.Instance.Verbose("Creating new entitities instance");
Entities = new Dictionary<LLUUID, EntityBase>();
Avatars = new Dictionary<LLUUID, ScenePresence>();
Prims = new Dictionary<LLUUID, SceneObject>();
MainLog.Instance.Verbose("World.cs - loading objects from datastore");
MainLog.Instance.Verbose("Loading objects from datastore");
List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects();
foreach (SceneObject prim in PrimsFromDB)
{
AddEntity(prim);
}
MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)");
MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " object(s)");
MainLog.Instance.Verbose("World.cs - creating LandMap");
MainLog.Instance.Verbose("Creating LandMap");
Terrain = new TerrainEngine();
ScenePresence.LoadAnims();
@ -198,7 +198,7 @@ namespace OpenSim.Region.Environment.Scenes
}
/// <summary>
/// Performs per-frame updates on the world, this should be the central world loop
/// Performs per-frame updates on the scene, this should be the central world loop
/// </summary>
public override void Update()
{
@ -210,9 +210,11 @@ namespace OpenSim.Region.Environment.Scenes
phyScene.GetResults();
}
foreach (LLUUID UUID in Entities.Keys)
List<EntityBase> moveEntities = new List<EntityBase>( Entities.Values );
foreach (EntityBase entity in moveEntities)
{
Entities[UUID].updateMovement();
entity.UpdateMovement();
}
lock (m_syncRoot)
@ -220,9 +222,11 @@ namespace OpenSim.Region.Environment.Scenes
phyScene.Simulate(timeStep);
}
foreach (LLUUID UUID in Entities.Keys)
List<EntityBase> updateEntities = new List<EntityBase>(Entities.Values);
foreach (EntityBase entity in updateEntities)
{
Entities[UUID].Update();
entity.Update();
}
// General purpose event manager

View File

@ -38,7 +38,7 @@ using OpenSim.Framework;
namespace OpenSim.Region.Environment.Scenes
{
public abstract class SceneBase : IWorld
public abstract class SceneBase : IScene
{
public Dictionary<LLUUID, EntityBase> Entities;
protected ulong m_regionHandle;

View File

@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Scenes
public SceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
{
m_regionHandle = world.RegionInfo.RegionHandle;
m_world = world;
m_scene = world;
m_eventManager = eventManager;
this.Pos = pos;
@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <remarks>Need a null constructor for duplication</remarks>
public SceneObject()
{
}
public void registerEvents()
@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes
public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
{
this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos);
this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_scene, agentID, localID, true, this, this, shape, pos);
this.m_children.Add(rootPrimitive);
this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
@ -167,7 +167,7 @@ namespace OpenSim.Region.Environment.Scenes
{
SceneObject dupe = new SceneObject();
dupe.m_world = this.m_world;
dupe.m_scene = this.m_scene;
dupe.m_eventManager = this.m_eventManager;
dupe.m_regionHandle = this.m_regionHandle;
Primitive newRoot = this.rootPrimitive.Copy(dupe, dupe);
@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Scenes
dupe.m_children.Add(dupe.rootPrimitive);
dupe.rootPrimitive.Pos = this.Pos;
dupe.Rotation = this.Rotation;
dupe.LocalId = m_world.PrimIDAllocate();
dupe.LocalId = m_scene.PrimIDAllocate();
dupe.registerEvents();
return dupe;

View File

@ -120,7 +120,7 @@ namespace OpenSim.Region.Environment.Scenes
public ScenePresence(IClientAPI theClient, Scene world, RegionInfo reginfo)
{
m_world = world;
m_scene = world;
this.m_uuid = theClient.AgentId;
m_regionInfo = reginfo;
@ -129,7 +129,7 @@ namespace OpenSim.Region.Environment.Scenes
ControllingClient = theClient;
this.firstname = ControllingClient.FirstName;
this.lastname = ControllingClient.LastName;
m_localId = m_world.NextLocalId;
m_localId = m_scene.NextLocalId;
Pos = ControllingClient.StartPos;
visualParams = new byte[218];
for (int i = 0; i < 218; i++)
@ -394,7 +394,7 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
public void SendTerseUpdateToALLClients()
{
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
this.SendTerseUpdateToClient(avatars[i].ControllingClient);
@ -412,8 +412,8 @@ namespace OpenSim.Region.Environment.Scenes
public void SendFullUpdateToALLClients()
{
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
foreach (ScenePresence avatar in this.m_world.RequestAvatarList())
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
foreach (ScenePresence avatar in this.m_scene.RequestAvatarList())
{
this.SendFullUpdateToOtherClient(avatar);
avatar.SendFullUpdateToOtherClient(this);
@ -428,7 +428,7 @@ namespace OpenSim.Region.Environment.Scenes
this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture);
if (this.newAvatar)
{
this.m_world.InformClientOfNeighbours(this.ControllingClient);
this.m_scene.InformClientOfNeighbours(this.ControllingClient);
this.newAvatar = false;
}
}
@ -441,7 +441,7 @@ namespace OpenSim.Region.Environment.Scenes
{
this.ControllingClient.SendWearables(this.Wearables);
this.SendFullUpdateToALLClients();
this.m_world.SendAllSceneObjectsToClient(this.ControllingClient);
this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
}
/// <summary>
@ -462,7 +462,7 @@ namespace OpenSim.Region.Environment.Scenes
{
this.current_anim = animID;
this.anim_seq = seq;
List<ScenePresence> avatars = this.m_world.RequestAvatarList();
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
for (int i = 0; i < avatars.Count; i++)
{
avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId);
@ -550,10 +550,10 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 vel = this.m_velocity;
ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256));
RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle);
RegionInfo neighbourRegion = this.m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
if (neighbourRegion != null)
{
bool res = this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos, this._physActor.Flying);
bool res = this.m_scene.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos, this._physActor.Flying);
if (res)
{
this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint);
@ -574,7 +574,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary>
///
/// </summary>
public override void updateMovement()
public override void UpdateMovement()
{
newForce = false;
lock (this.forcesList)

View File

@ -23,13 +23,13 @@ namespace SimpleApp
m_counter = new PerformanceCounter(objectName, counterName, instanceName);
}
public override void Update( )
public override void UpdateMovement( )
{
float cpu = m_counter.NextValue() / 40f;
LLVector3 size = new LLVector3(cpu, cpu, cpu);
rootPrimitive.ResizeGoup( size );
base.Update();
base.UpdateMovement();
}
}
}