aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorlbsa712007-07-26 14:55:42 +0000
committerlbsa712007-07-26 14:55:42 +0000
commit39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6 (patch)
tree81ab89a9749577c6fa1a3a19c1ed09c1942ec201
parentAdded the default shape to the OpenSim library. Now need to get the new ruth ... (diff)
downloadopensim-SC-39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6.zip
opensim-SC-39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6.tar.gz
opensim-SC-39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6.tar.bz2
opensim-SC-39b64564dca0e5cb57a2a8e1b60979ccaaf11ef6.tar.xz
* Started renaming world to Scene
* Update and UpdateMovement now first stores array to avoid collection update exceptions * Ignored some bins
-rw-r--r--OpenSim/Framework/General/Interfaces/ILocalStorage.cs2
-rw-r--r--OpenSim/Framework/General/Interfaces/IScene.cs (renamed from OpenSim/Framework/General/Interfaces/IWorld.cs)2
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs36
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs2
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs32
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs12
-rw-r--r--OpenSim/Region/ClientStack/PacketServer.cs22
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs2
-rw-r--r--OpenSim/Region/ClientStack/UDPServer.cs8
-rw-r--r--OpenSim/Region/Environment/EstateManager.cs10
-rw-r--r--OpenSim/Region/Environment/LandManagement/Land.cs33
-rw-r--r--OpenSim/Region/Environment/LandManagement/LandManager.cs14
-rw-r--r--OpenSim/Region/Environment/Scenes/Entity.cs26
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityBase.cs47
-rw-r--r--OpenSim/Region/Environment/Scenes/Primitive.cs29
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs24
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneBase.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObject.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs22
-rw-r--r--OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs4
20 files changed, 137 insertions, 202 deletions
diff --git a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs
index 9d5bb62..1b7b01e 100644
--- a/OpenSim/Framework/General/Interfaces/ILocalStorage.cs
+++ b/OpenSim/Framework/General/Interfaces/ILocalStorage.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Framework.Interfaces
44 void LoadPrimitives(ILocalStorageReceiver receiver); 44 void LoadPrimitives(ILocalStorageReceiver receiver);
45 45
46 [System.Obsolete("Use DataStorage instead")] 46 [System.Obsolete("Use DataStorage instead")]
47 float[] LoadWorld(); 47 float[] LoadScene();
48 [System.Obsolete("Use DataStorage instead")] 48 [System.Obsolete("Use DataStorage instead")]
49 void SaveMap(float[] heightmap); 49 void SaveMap(float[] heightmap);
50 50
diff --git a/OpenSim/Framework/General/Interfaces/IWorld.cs b/OpenSim/Framework/General/Interfaces/IScene.cs
index a474636..ee7a96a 100644
--- a/OpenSim/Framework/General/Interfaces/IWorld.cs
+++ b/OpenSim/Framework/General/Interfaces/IScene.cs
@@ -30,7 +30,7 @@ using OpenSim.Framework.Types;
30 30
31namespace OpenSim.Framework.Interfaces 31namespace OpenSim.Framework.Interfaces
32{ 32{
33 public interface IWorld 33 public interface IScene
34 { 34 {
35 void AddNewClient(IClientAPI client, bool child); 35 void AddNewClient(IClientAPI client, bool child);
36 void RemoveClient(LLUUID agentID); 36 void RemoveClient(LLUUID agentID);
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index d961b73..a90c078 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -65,7 +65,7 @@ namespace OpenSim
65 65
66 protected List<UDPServer> m_udpServers = new List<UDPServer>(); 66 protected List<UDPServer> m_udpServers = new List<UDPServer>();
67 protected List<RegionInfo> m_regionData = new List<RegionInfo>(); 67 protected List<RegionInfo> m_regionData = new List<RegionInfo>();
68 protected List<IWorld> m_localWorld = new List<IWorld>(); 68 protected List<IScene> m_localScenes = new List<IScene>();
69 69
70 private bool m_silent; 70 private bool m_silent;
71 private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log"; 71 private string m_logFilename = "region-console-" + Guid.NewGuid().ToString() + ".log";
@@ -83,7 +83,7 @@ namespace OpenSim
83 83
84 84
85 /// <summary> 85 /// <summary>
86 /// Performs initialisation of the world, such as loading configuration from disk. 86 /// Performs initialisation of the scene, such as loading configuration from disk.
87 /// </summary> 87 /// </summary>
88 public override void StartUp() 88 public override void StartUp()
89 { 89 {
@@ -126,7 +126,7 @@ namespace OpenSim
126 UDPServer udpServer; 126 UDPServer udpServer;
127 Scene scene = SetupScene(regionInfo, out udpServer); 127 Scene scene = SetupScene(regionInfo, out udpServer);
128 128
129 m_localWorld.Add(scene); 129 m_localScenes.Add(scene);
130 130
131 131
132 m_udpServers.Add(udpServer); 132 m_udpServers.Add(udpServer);
@@ -311,9 +311,9 @@ namespace OpenSim
311 m_log.Verbose("Main.cs:Shutdown() - Killing clients"); 311 m_log.Verbose("Main.cs:Shutdown() - Killing clients");
312 // IMPLEMENT THIS 312 // IMPLEMENT THIS
313 m_log.Verbose("Main.cs:Shutdown() - Closing console and terminating"); 313 m_log.Verbose("Main.cs:Shutdown() - Closing console and terminating");
314 for (int i = 0; i < m_localWorld.Count; i++) 314 for (int i = 0; i < m_localScenes.Count; i++)
315 { 315 {
316 ((Scene)m_localWorld[i]).Close(); 316 ((Scene)m_localScenes[i]).Close();
317 } 317 }
318 m_log.Close(); 318 m_log.Close();
319 Environment.Exit(0); 319 Environment.Exit(0);
@@ -343,32 +343,32 @@ namespace OpenSim
343 343
344 case "terrain": 344 case "terrain":
345 string result = ""; 345 string result = "";
346 for (int i = 0; i < m_localWorld.Count; i++) 346 for (int i = 0; i < m_localScenes.Count; i++)
347 { 347 {
348 if (!((Scene)m_localWorld[i]).Terrain.RunTerrainCmd(cmdparams, ref result, m_localWorld[i].RegionInfo.RegionName)) 348 if (!((Scene)m_localScenes[i]).Terrain.RunTerrainCmd(cmdparams, ref result, m_localScenes[i].RegionInfo.RegionName))
349 { 349 {
350 m_log.Error(result); 350 m_log.Error(result);
351 } 351 }
352 } 352 }
353 break; 353 break;
354 case "script": 354 case "script":
355 for (int i = 0; i < m_localWorld.Count; i++) 355 for (int i = 0; i < m_localScenes.Count; i++)
356 { 356 {
357 ((Scene)m_localWorld[i]).SendCommandToScripts(cmdparams); 357 ((Scene)m_localScenes[i]).SendCommandToScripts(cmdparams);
358 } 358 }
359 break; 359 break;
360 360
361 case "backup": 361 case "backup":
362 for (int i = 0; i < m_localWorld.Count; i++) 362 for (int i = 0; i < m_localScenes.Count; i++)
363 { 363 {
364 ((Scene)m_localWorld[i]).Backup(); 364 ((Scene)m_localScenes[i]).Backup();
365 } 365 }
366 break; 366 break;
367 367
368 case "alert": 368 case "alert":
369 for (int i = 0; i < m_localWorld.Count; i++) 369 for (int i = 0; i < m_localScenes.Count; i++)
370 { 370 {
371 ((Scene)m_localWorld[i]).HandleAlertCommand(cmdparams); 371 ((Scene)m_localScenes[i]).HandleAlertCommand(cmdparams);
372 } 372 }
373 break; 373 break;
374 374
@@ -398,14 +398,14 @@ namespace OpenSim
398 case "users": 398 case "users":
399 ScenePresence TempAv; 399 ScenePresence TempAv;
400 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")); 400 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"));
401 for (int i = 0; i < m_localWorld.Count; i++) 401 for (int i = 0; i < m_localScenes.Count; i++)
402 { 402 {
403 foreach (libsecondlife.LLUUID UUID in ((Scene)m_localWorld[i]).Entities.Keys) 403 foreach (libsecondlife.LLUUID UUID in ((Scene)m_localScenes[i]).Entities.Keys)
404 { 404 {
405 if (((Scene)m_localWorld[i]).Entities[UUID].ToString() == "OpenSim.world.Avatar") 405 if (((Scene)m_localScenes[i]).Entities[UUID].ToString() == "OpenSim.world.Avatar")
406 { 406 {
407 TempAv = (ScenePresence)((Scene)m_localWorld[i]).Entities[UUID]; 407 TempAv = (ScenePresence)((Scene)m_localScenes[i]).Entities[UUID];
408 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); 408 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);
409 } 409 }
410 } 410 }
411 } 411 }
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 0da89a1..feacadc 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Region.ClientStack
146 } 146 }
147 } 147 }
148 148
149 #region World/Avatar to Client 149 #region Scene/Avatar to Client
150 150
151 /// <summary> 151 /// <summary>
152 /// 152 ///
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index e5e872a..c0c14ee 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -73,7 +73,7 @@ namespace OpenSim.Region.ClientStack
73 } 73 }
74 break; 74 break;
75 75
76 #region World/Avatar 76 #region Scene/Avatar
77 case PacketType.ChatFromViewer: 77 case PacketType.ChatFromViewer:
78 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; 78 ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
79 if (Util.FieldToString(inchatpack.ChatData.Message) == "") 79 if (Util.FieldToString(inchatpack.ChatData.Message) == "")
@@ -466,33 +466,7 @@ namespace OpenSim.Region.ClientStack
466 // Console.WriteLine(Pack.ToString()); 466 // Console.WriteLine(Pack.ToString());
467 UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; 467 UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack;
468 AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID); 468 AgentInventory myinventory = this.m_inventoryCache.GetAgentsInventory(this.AgentID);
469 /*if (myinventory != null) 469
470 {
471 if (updatetask.UpdateData.Key == 0)
472 {
473 if (myinventory.InventoryItems[updatetask.InventoryData.ItemID] != null)
474 {
475 if (myinventory.InventoryItems[updatetask.InventoryData.ItemID].Type == 7)
476 {
477 LLUUID noteaid = myinventory.InventoryItems[updatetask.InventoryData.ItemID].AssetID;
478 AssetBase assBase = this.m_assetCache.GetAsset(noteaid);
479 if (assBase != null)
480 {
481 foreach (Entity ent in m_world.Entities.Values)
482 {
483 if (ent.localid == updatetask.UpdateData.LocalID)
484 {
485 if (ent is OpenSim.world.Primitive)
486 {
487 this.m_world.AddScript(ent, Util.FieldToString(assBase.Data));
488 }
489 }
490 }
491 }
492 }
493 }
494 }
495 }*/
496 break; 470 break;
497 case PacketType.MapLayerRequest: 471 case PacketType.MapLayerRequest:
498 this.RequestMapLayer(); 472 this.RequestMapLayer();
@@ -524,7 +498,7 @@ namespace OpenSim.Region.ClientStack
524 { 498 {
525 AssetLandmark lm = new AssetLandmark(lma); 499 AssetLandmark lm = new AssetLandmark(lma);
526 500
527 if (lm.RegionID == m_world.RegionInfo.SimUUID) 501 if (lm.RegionID == m_scene.RegionInfo.SimUUID)
528 { 502 {
529 TeleportLocalPacket tpLocal = new TeleportLocalPacket(); 503 TeleportLocalPacket tpLocal = new TeleportLocalPacket();
530 504
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 3fd3a46..92d73e1 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Region.ClientStack
72 private AgentAssetUpload UploadAssets; 72 private AgentAssetUpload UploadAssets;
73 private LLUUID newAssetFolder = LLUUID.Zero; 73 private LLUUID newAssetFolder = LLUUID.Zero;
74 private bool debug = false; 74 private bool debug = false;
75 protected IWorld m_world; 75 protected IScene m_scene;
76 private Dictionary<uint, ClientView> m_clientThreads; 76 private Dictionary<uint, ClientView> m_clientThreads;
77 private AssetCache m_assetCache; 77 private AssetCache m_assetCache;
78 private InventoryCache m_inventoryCache; 78 private InventoryCache m_inventoryCache;
@@ -85,9 +85,9 @@ namespace OpenSim.Region.ClientStack
85 private int probesWithNoIngressPackets = 0; 85 private int probesWithNoIngressPackets = 0;
86 private int lastPacketsReceived = 0; 86 private int lastPacketsReceived = 0;
87 87
88 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions ) 88 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene scene, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions )
89 { 89 {
90 m_world = world; 90 m_scene = scene;
91 m_clientThreads = clientThreads; 91 m_clientThreads = clientThreads;
92 m_assetCache = assetCache; 92 m_assetCache = assetCache;
93 93
@@ -121,7 +121,7 @@ namespace OpenSim.Region.ClientStack
121 { 121 {
122 clientPingTimer.Stop(); 122 clientPingTimer.Stop();
123 this.m_inventoryCache.ClientLeaving(this.AgentID, null); 123 this.m_inventoryCache.ClientLeaving(this.AgentID, null);
124 m_world.RemoveClient(this.AgentId); 124 m_scene.RemoveClient(this.AgentId);
125 125
126 m_clientThreads.Remove(this.CircuitCode); 126 m_clientThreads.Remove(this.CircuitCode);
127 m_networkServer.RemoveClientCircuit(this.CircuitCode); 127 m_networkServer.RemoveClientCircuit(this.CircuitCode);
@@ -231,8 +231,8 @@ namespace OpenSim.Region.ClientStack
231 clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity); 231 clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
232 clientPingTimer.Enabled = true; 232 clientPingTimer.Enabled = true;
233 233
234 MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); 234 MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to scene");
235 this.m_world.AddNewClient(this, false); 235 this.m_scene.AddNewClient(this, false);
236 } 236 }
237 237
238 protected virtual void AuthUser() 238 protected virtual void AuthUser()
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs
index 596cdbe..9d2250e 100644
--- a/OpenSim/Region/ClientStack/PacketServer.cs
+++ b/OpenSim/Region/ClientStack/PacketServer.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.ClientStack
40 public class PacketServer 40 public class PacketServer
41 { 41 {
42 private ClientStackNetworkHandler _networkHandler; 42 private ClientStackNetworkHandler _networkHandler;
43 private IWorld _localWorld; 43 private IScene _localScene;
44 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>(); 44 public Dictionary<uint, ClientView> ClientThreads = new Dictionary<uint, ClientView>();
45 private ClientManager m_clientManager = new ClientManager(); 45 private ClientManager m_clientManager = new ClientManager();
46 public ClientManager ClientManager 46 public ClientManager ClientManager
@@ -54,11 +54,11 @@ namespace OpenSim.Region.ClientStack
54 _networkHandler.RegisterPacketServer(this); 54 _networkHandler.RegisterPacketServer(this);
55 } 55 }
56 56
57 public IWorld LocalWorld 57 public IScene LocalScene
58 { 58 {
59 set 59 set
60 { 60 {
61 this._localWorld = value; 61 this._localScene = value;
62 } 62 }
63 } 63 }
64 64
@@ -122,19 +122,7 @@ namespace OpenSim.Region.ClientStack
122 122
123 } 123 }
124 124
125 /// <summary> 125 protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IScene world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions)
126 ///
127 /// </summary>
128 /// <param name="remoteEP"></param>
129 /// <param name="initialcirpack"></param>
130 /// <param name="clientThreads"></param>
131 /// <param name="world"></param>
132 /// <param name="assetCache"></param>
133 /// <param name="packServer"></param>
134 /// <param name="inventoryCache"></param>
135 /// <param name="authenSessions"></param>
136 /// <returns></returns>
137 protected virtual ClientView CreateNewClient(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AgentCircuitManager authenSessions)
138 { 126 {
139 return new ClientView(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions ); 127 return new ClientView(remoteEP, initialcirpack, clientThreads, world, assetCache, packServer, inventoryCache, authenSessions );
140 } 128 }
@@ -151,7 +139,7 @@ namespace OpenSim.Region.ClientStack
151 public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AgentCircuitManager authenticateSessionsClass) 139 public virtual bool AddNewClient(EndPoint epSender, UseCircuitCodePacket useCircuit, AssetCache assetCache, InventoryCache inventoryCache, AgentCircuitManager authenticateSessionsClass)
152 { 140 {
153 ClientView newuser = 141 ClientView newuser =
154 CreateNewClient(epSender, useCircuit, ClientThreads, _localWorld, assetCache, this, inventoryCache, 142 CreateNewClient(epSender, useCircuit, ClientThreads, _localScene, assetCache, this, inventoryCache,
155 authenticateSessionsClass); 143 authenticateSessionsClass);
156 144
157 this.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser); 145 this.ClientThreads.Add(useCircuit.CircuitCode.Code, newuser);
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index d91cd95..a61b9e3 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -108,7 +108,7 @@ namespace OpenSim.Region.ClientStack
108 StorageManager storageManager = CreateStorageManager(regionInfo); 108 StorageManager storageManager = CreateStorageManager(regionInfo);
109 Scene scene = CreateScene(regionInfo, storageManager, authen); 109 Scene scene = CreateScene(regionInfo, storageManager, authen);
110 110
111 udpServer.LocalWorld = scene; 111 udpServer.LocalScene = scene;
112 112
113 scene.LoadWorldMap(); 113 scene.LoadWorldMap();
114 114
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs
index 340ef61..705ced0 100644
--- a/OpenSim/Region/ClientStack/UDPServer.cs
+++ b/OpenSim/Region/ClientStack/UDPServer.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.ClientStack
53 protected PacketServer _packetServer; 53 protected PacketServer _packetServer;
54 54
55 protected int listenPort; 55 protected int listenPort;
56 protected IWorld m_localWorld; 56 protected IScene m_localScene;
57 protected AssetCache m_assetCache; 57 protected AssetCache m_assetCache;
58 protected InventoryCache m_inventoryCache; 58 protected InventoryCache m_inventoryCache;
59 protected LogBase m_log; 59 protected LogBase m_log;
@@ -71,12 +71,12 @@ namespace OpenSim.Region.ClientStack
71 } 71 }
72 } 72 }
73 73
74 public IWorld LocalWorld 74 public IScene LocalScene
75 { 75 {
76 set 76 set
77 { 77 {
78 this.m_localWorld = value; 78 this.m_localScene = value;
79 this._packetServer.LocalWorld = this.m_localWorld; 79 this._packetServer.LocalScene = this.m_localScene;
80 } 80 }
81 } 81 }
82 82
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index 3742486..3af6fb2 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -45,12 +45,12 @@ namespace OpenSim.Region.Environment
45 /// </summary> 45 /// </summary>
46 public class EstateManager 46 public class EstateManager
47 { 47 {
48 private Scene m_world; 48 private Scene m_scene;
49 private RegionInfo m_regInfo; 49 private RegionInfo m_regInfo;
50 50
51 public EstateManager(Scene world,RegionInfo reginfo) 51 public EstateManager(Scene scene,RegionInfo reginfo)
52 { 52 {
53 m_world = world; //Estate settings found at world.m_regInfo.estateSettings 53 m_scene = scene;
54 m_regInfo = reginfo; 54 m_regInfo = reginfo;
55 } 55 }
56 56
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Environment
243 243
244 public void sendRegionInfoPacketToAll() 244 public void sendRegionInfoPacketToAll()
245 { 245 {
246 List<Avatar> avatars = m_world.RequestAvatarList(); 246 List<Avatar> avatars = m_scene.RequestAvatarList();
247 247
248 for (int i = 0; i < avatars.Count; i++) 248 for (int i = 0; i < avatars.Count; i++)
249 { 249 {
@@ -253,7 +253,7 @@ namespace OpenSim.Region.Environment
253 253
254 public void sendRegionHandshakeToAll() 254 public void sendRegionHandshakeToAll()
255 { 255 {
256 List<Avatar> avatars = m_world.RequestAvatarList(); 256 List<Avatar> avatars = m_scene.RequestAvatarList();
257 257
258 for (int i = 0; i < avatars.Count; i++) 258 for (int i = 0; i < avatars.Count; i++)
259 { 259 {
diff --git a/OpenSim/Region/Environment/LandManagement/Land.cs b/OpenSim/Region/Environment/LandManagement/Land.cs
index bae3b0e..625b176 100644
--- a/OpenSim/Region/Environment/LandManagement/Land.cs
+++ b/OpenSim/Region/Environment/LandManagement/Land.cs
@@ -18,7 +18,7 @@ namespace OpenSim.Region.Environment.LandManagement
18 public LandData landData = new LandData(); 18 public LandData landData = new LandData();
19 public List<SceneObject> primsOverMe = new List<SceneObject>(); 19 public List<SceneObject> primsOverMe = new List<SceneObject>();
20 20
21 public Scene m_world; 21 public Scene m_scene;
22 22
23 private bool[,] landBitmap = new bool[64, 64]; 23 private bool[,] landBitmap = new bool[64, 64];
24 24
@@ -26,9 +26,9 @@ namespace OpenSim.Region.Environment.LandManagement
26 26
27 27
28 #region Constructors 28 #region Constructors
29 public Land(LLUUID owner_id, bool is_group_owned, Scene world) 29 public Land(LLUUID owner_id, bool is_group_owned, Scene scene)
30 { 30 {
31 m_world = world; 31 m_scene = scene;
32 landData.ownerID = owner_id; 32 landData.ownerID = owner_id;
33 landData.isGroupOwned = is_group_owned; 33 landData.isGroupOwned = is_group_owned;
34 34
@@ -59,7 +59,7 @@ namespace OpenSim.Region.Environment.LandManagement
59 59
60 public Land Copy() 60 public Land Copy()
61 { 61 {
62 Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_world); 62 Land newLand = new Land(this.landData.ownerID, this.landData.isGroupOwned, m_scene);
63 63
64 //Place all new variables here! 64 //Place all new variables here!
65 newLand.landBitmap = (bool[,])(this.landBitmap.Clone()); 65 newLand.landBitmap = (bool[,])(this.landBitmap.Clone());
@@ -101,7 +101,7 @@ namespace OpenSim.Region.Environment.LandManagement
101 updatePacket.ParcelData.LocalID = landData.localID; 101 updatePacket.ParcelData.LocalID = landData.localID;
102 if (landData.area > 0) 102 if (landData.area > 0)
103 { 103 {
104 updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor))); 104 updatePacket.ParcelData.MaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.area) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
105 } 105 }
106 else 106 else
107 { 107 {
@@ -118,14 +118,17 @@ namespace OpenSim.Region.Environment.LandManagement
118 updatePacket.ParcelData.OwnerID = landData.ownerID; 118 updatePacket.ParcelData.OwnerID = landData.ownerID;
119 updatePacket.ParcelData.OwnerPrims = landData.ownerPrims; 119 updatePacket.ParcelData.OwnerPrims = landData.ownerPrims;
120 updatePacket.ParcelData.ParcelFlags = landData.landFlags; 120 updatePacket.ParcelData.ParcelFlags = landData.landFlags;
121 updatePacket.ParcelData.ParcelPrimBonus = m_world.RegionInfo.estateSettings.objectBonusFactor; 121 updatePacket.ParcelData.ParcelPrimBonus = m_scene.RegionInfo.estateSettings.objectBonusFactor;
122 updatePacket.ParcelData.PassHours = landData.passHours; 122 updatePacket.ParcelData.PassHours = landData.passHours;
123 updatePacket.ParcelData.PassPrice = landData.passPrice; 123 updatePacket.ParcelData.PassPrice = landData.passPrice;
124 updatePacket.ParcelData.PublicCount = 0; //unemplemented 124 updatePacket.ParcelData.PublicCount = 0; //unemplemented
125 updatePacket.ParcelData.RegionDenyAnonymous = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0); 125
126 updatePacket.ParcelData.RegionDenyIdentified = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0); 126 uint regionFlags = (uint)m_scene.RegionInfo.estateSettings.regionFlags;
127 updatePacket.ParcelData.RegionDenyTransacted = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0); 127 updatePacket.ParcelData.RegionDenyAnonymous = ((regionFlags & (uint)Simulator.RegionFlags.DenyAnonymous) > 0);
128 updatePacket.ParcelData.RegionPushOverride = (((uint)m_world.RegionInfo.estateSettings.regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0); 128 updatePacket.ParcelData.RegionDenyIdentified = ((regionFlags & (uint)Simulator.RegionFlags.DenyIdentified) > 0);
129 updatePacket.ParcelData.RegionDenyTransacted = ((regionFlags & (uint)Simulator.RegionFlags.DenyTransacted) > 0);
130 updatePacket.ParcelData.RegionPushOverride = ((regionFlags & (uint)Simulator.RegionFlags.RestrictPushObject) > 0);
131
129 updatePacket.ParcelData.RentPrice = 0; 132 updatePacket.ParcelData.RentPrice = 0;
130 updatePacket.ParcelData.RequestResult = request_result; 133 updatePacket.ParcelData.RequestResult = request_result;
131 updatePacket.ParcelData.SalePrice = landData.salePrice; 134 updatePacket.ParcelData.SalePrice = landData.salePrice;
@@ -134,7 +137,7 @@ namespace OpenSim.Region.Environment.LandManagement
134 updatePacket.ParcelData.SequenceID = sequence_id; 137 updatePacket.ParcelData.SequenceID = sequence_id;
135 if (landData.simwideArea > 0) 138 if (landData.simwideArea > 0)
136 { 139 {
137 updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_world.RegionInfo.estateSettings.objectBonusFactor))); 140 updatePacket.ParcelData.SimWideMaxPrims = Convert.ToInt32(Math.Round((Convert.ToDecimal(landData.simwideArea) / Convert.ToDecimal(65536)) * 15000 * Convert.ToDecimal(m_scene.RegionInfo.estateSettings.objectBonusFactor)));
138 } 141 }
139 else 142 else
140 { 143 {
@@ -180,10 +183,10 @@ namespace OpenSim.Region.Environment.LandManagement
180 183
181 public void sendLandUpdateToAvatarsOverMe() 184 public void sendLandUpdateToAvatarsOverMe()
182 { 185 {
183 List<ScenePresence> avatars = m_world.RequestAvatarList(); 186 List<ScenePresence> avatars = m_scene.RequestAvatarList();
184 for (int i = 0; i < avatars.Count; i++) 187 for (int i = 0; i < avatars.Count; i++)
185 { 188 {
186 Land over = m_world.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y)); 189 Land over = m_scene.LandManager.getLandObject((int)Math.Round(avatars[i].Pos.X), (int)Math.Round(avatars[i].Pos.Y));
187 if (over.landData.localID == this.landData.localID) 190 if (over.landData.localID == this.landData.localID)
188 { 191 {
189 sendLandProperties(0, false, 0, avatars[i].ControllingClient); 192 sendLandProperties(0, false, 0, avatars[i].ControllingClient);
@@ -219,8 +222,8 @@ namespace OpenSim.Region.Environment.LandManagement
219 } 222 }
220 } 223 }
221 } 224 }
222 landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_world.Terrain.GetHeight((min_x * 4), (min_y * 4))); 225 landData.AABBMin = new LLVector3((float)(min_x * 4), (float)(min_y * 4), (float)m_scene.Terrain.GetHeight((min_x * 4), (min_y * 4)));
223 landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_world.Terrain.GetHeight((max_x * 4), (max_y * 4))); 226 landData.AABBMax = new LLVector3((float)(max_x * 4), (float)(max_y * 4), (float)m_scene.Terrain.GetHeight((max_x * 4), (max_y * 4)));
224 landData.area = tempArea; 227 landData.area = tempArea;
225 } 228 }
226 229
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs
index be2913b..8c359fc 100644
--- a/OpenSim/Region/Environment/LandManagement/LandManager.cs
+++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs
@@ -85,16 +85,16 @@ namespace OpenSim.Region.Environment.LandManagement
85 /// </summary> 85 /// </summary>
86 public bool landPrimCountTainted = false; 86 public bool landPrimCountTainted = false;
87 87
88 private Scene m_world; 88 private Scene m_scene;
89 private RegionInfo m_regInfo; 89 private RegionInfo m_regInfo;
90 90
91 #endregion 91 #endregion
92 92
93 #region Constructors 93 #region Constructors
94 public LandManager(Scene world, RegionInfo reginfo) 94 public LandManager(Scene scene, RegionInfo reginfo)
95 { 95 {
96 96
97 m_world = world; 97 m_scene = scene;
98 m_regInfo = reginfo; 98 m_regInfo = reginfo;
99 landIDList.Initialize(); 99 landIDList.Initialize();
100 100
@@ -106,7 +106,7 @@ namespace OpenSim.Region.Environment.LandManagement
106 #region Parcel From Storage Functions 106 #region Parcel From Storage Functions
107 public void LandFromStorage(LandData data) 107 public void LandFromStorage(LandData data)
108 { 108 {
109 Land new_land = new Land(data.ownerID, data.isGroupOwned, m_world); 109 Land new_land = new Land(data.ownerID, data.isGroupOwned, m_scene);
110 new_land.landData = data.Copy(); 110 new_land.landData = data.Copy();
111 new_land.setLandBitmapFromByteArray(); 111 new_land.setLandBitmapFromByteArray();
112 addLandObject(new_land); 112 addLandObject(new_land);
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Environment.LandManagement
126 /// <returns></returns> 126 /// <returns></returns>
127 public Land createBaseLand() 127 public Land createBaseLand()
128 { 128 {
129 return new Land(new LLUUID(), false, m_world); 129 return new Land(new LLUUID(), false, m_scene);
130 } 130 }
131 131
132 /// <summary> 132 /// <summary>
@@ -517,7 +517,7 @@ namespace OpenSim.Region.Environment.LandManagement
517 lastLandLocalID = START_LAND_LOCAL_ID - 1; 517 lastLandLocalID = START_LAND_LOCAL_ID - 1;
518 landIDList.Initialize(); 518 landIDList.Initialize();
519 519
520 Land fullSimParcel = new Land(LLUUID.Zero, false, m_world); 520 Land fullSimParcel = new Land(LLUUID.Zero, false, m_scene);
521 521
522 fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256)); 522 fullSimParcel.setLandBitmap(Land.getSquareLandBitmap(0, 0, 256, 256));
523 fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID; 523 fullSimParcel.landData.ownerID = m_regInfo.MasterAvatarAssignedUUID;
@@ -529,7 +529,7 @@ namespace OpenSim.Region.Environment.LandManagement
529 529
530 public void handleSignificantClientMovement(IClientAPI remote_client) 530 public void handleSignificantClientMovement(IClientAPI remote_client)
531 { 531 {
532 ScenePresence clientAvatar = m_world.RequestAvatar(remote_client.AgentId); 532 ScenePresence clientAvatar = m_scene.RequestAvatar(remote_client.AgentId);
533 if (clientAvatar != null) 533 if (clientAvatar != null)
534 { 534 {
535 Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y); 535 Land over = getLandObject(clientAvatar.Pos.X,clientAvatar.Pos.Y);
diff --git a/OpenSim/Region/Environment/Scenes/Entity.cs b/OpenSim/Region/Environment/Scenes/Entity.cs
index 2456a4e..204b68f 100644
--- a/OpenSim/Region/Environment/Scenes/Entity.cs
+++ b/OpenSim/Region/Environment/Scenes/Entity.cs
@@ -31,8 +31,8 @@ using OpenSim.Physics.Manager;
31 31
32namespace OpenSim.Region.Environment.Scenes 32namespace OpenSim.Region.Environment.Scenes
33{ 33{
34 public abstract class Entity :EntityBase //this class (Entity) will be phased out 34 public abstract class Entity : EntityBase //this class (Entity) will be phased out
35 { 35 {
36 protected PhysicsActor _physActor; 36 protected PhysicsActor _physActor;
37 37
38 /// <summary> 38 /// <summary>
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Scenes
42 { 42 {
43 get 43 get
44 { 44 {
45 if (this._physActor != null) 45 if (_physActor != null)
46 { 46 {
47 m_pos.X = _physActor.Position.X; 47 m_pos.X = _physActor.Position.X;
48 m_pos.Y = _physActor.Position.Y; 48 m_pos.Y = _physActor.Position.Y;
@@ -53,14 +53,13 @@ namespace OpenSim.Region.Environment.Scenes
53 } 53 }
54 set 54 set
55 { 55 {
56 if (this._physActor != null) 56 if (_physActor != null)
57 { 57 {
58 try 58 try
59 { 59 {
60 lock (this.m_world.SyncRoot) 60 lock (m_scene.SyncRoot)
61 { 61 {
62 62 _physActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
63 this._physActor.Position = new PhysicsVector(value.X, value.Y, value.Z);
64 } 63 }
65 } 64 }
66 catch (Exception e) 65 catch (Exception e)
@@ -73,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes
73 } 72 }
74 } 73 }
75 74
76 75
77 /// <summary> 76 /// <summary>
78 /// 77 ///
79 /// </summary> 78 /// </summary>
@@ -81,7 +80,7 @@ namespace OpenSim.Region.Environment.Scenes
81 { 80 {
82 get 81 get
83 { 82 {
84 if (this._physActor != null) 83 if (_physActor != null)
85 { 84 {
86 m_velocity.X = _physActor.Velocity.X; 85 m_velocity.X = _physActor.Velocity.X;
87 m_velocity.Y = _physActor.Velocity.Y; 86 m_velocity.Y = _physActor.Velocity.Y;
@@ -92,14 +91,13 @@ namespace OpenSim.Region.Environment.Scenes
92 } 91 }
93 set 92 set
94 { 93 {
95 if (this._physActor != null) 94 if (_physActor != null)
96 { 95 {
97 try 96 try
98 { 97 {
99 lock (this.m_world.SyncRoot) 98 lock (m_scene.SyncRoot)
100 { 99 {
101 100 _physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
102 this._physActor.Velocity = new PhysicsVector(value.X, value.Y, value.Z);
103 } 101 }
104 } 102 }
105 catch (Exception e) 103 catch (Exception e)
@@ -112,4 +110,4 @@ namespace OpenSim.Region.Environment.Scenes
112 } 110 }
113 } 111 }
114 } 112 }
115} 113} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index 0d1e3fc..08f13c2 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -11,7 +11,7 @@ namespace OpenSim.Region.Environment.Scenes
11 protected List<EntityBase> m_children; 11 protected List<EntityBase> m_children;
12 12
13 13
14 protected Scene m_world; 14 protected Scene m_scene;
15 protected string m_name; 15 protected string m_name;
16 16
17 /// <summary> 17 /// <summary>
@@ -24,19 +24,14 @@ namespace OpenSim.Region.Environment.Scenes
24 } 24 }
25 25
26 protected LLVector3 m_pos; 26 protected LLVector3 m_pos;
27
27 /// <summary> 28 /// <summary>
28 /// 29 ///
29 /// </summary> 30 /// </summary>
30 public virtual LLVector3 Pos 31 public virtual LLVector3 Pos
31 { 32 {
32 get 33 get { return m_pos; }
33 { 34 set { m_pos = value; }
34 return m_pos;
35 }
36 set
37 {
38 m_pos = value;
39 }
40 } 35 }
41 36
42 public LLVector3 m_velocity; 37 public LLVector3 m_velocity;
@@ -46,28 +41,16 @@ namespace OpenSim.Region.Environment.Scenes
46 /// </summary> 41 /// </summary>
47 public virtual LLVector3 Velocity 42 public virtual LLVector3 Velocity
48 { 43 {
49 get 44 get { return m_velocity; }
50 { 45 set { m_velocity = value; }
51 return m_velocity;
52 }
53 set
54 {
55 m_velocity = value;
56 }
57 } 46 }
58 47
59 protected Quaternion m_rotation = new Quaternion(0,0,1,0); 48 protected Quaternion m_rotation = new Quaternion(0, 0, 1, 0);
60 49
61 public virtual Quaternion Rotation 50 public virtual Quaternion Rotation
62 { 51 {
63 get 52 get { return m_rotation; }
64 { 53 set { m_rotation = value; }
65 return m_rotation;
66 }
67 set
68 {
69 m_rotation = value;
70 }
71 } 54 }
72 55
73 protected uint m_localId; 56 protected uint m_localId;
@@ -91,19 +74,17 @@ namespace OpenSim.Region.Environment.Scenes
91 m_name = "(basic entity)"; 74 m_name = "(basic entity)";
92 75
93 m_children = new List<EntityBase>(); 76 m_children = new List<EntityBase>();
94
95 } 77 }
96 78
97 /// <summary> 79 /// <summary>
98 /// 80 ///
99 /// </summary> 81 /// </summary>
100 public virtual void updateMovement() 82 public virtual void UpdateMovement()
101 { 83 {
102
103 foreach (EntityBase child in m_children) 84 foreach (EntityBase child in m_children)
104 85
105 { 86 {
106 child.updateMovement(); 87 child.UpdateMovement();
107 } 88 }
108 } 89 }
109 90
@@ -125,7 +106,6 @@ namespace OpenSim.Region.Environment.Scenes
125 /// </summary> 106 /// </summary>
126 public virtual void BackUp() 107 public virtual void BackUp()
127 { 108 {
128
129 } 109 }
130 110
131 /// <summary> 111 /// <summary>
@@ -134,7 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
134 /// <returns></returns> 114 /// <returns></returns>
135 public virtual EntityBase Copy() 115 public virtual EntityBase Copy()
136 { 116 {
137 return (EntityBase)this.MemberwiseClone(); 117 return (EntityBase) MemberwiseClone();
138 } 118 }
139 119
140 /// <summary> 120 /// <summary>
@@ -142,7 +122,6 @@ namespace OpenSim.Region.Environment.Scenes
142 /// </summary> 122 /// </summary>
143 public virtual void LandRenegerated() 123 public virtual void LandRenegerated()
144 { 124 {
145
146 } 125 }
147 } 126 }
148} 127} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Scenes/Primitive.cs b/OpenSim/Region/Environment/Scenes/Primitive.cs
index 93e4959..ce5c327 100644
--- a/OpenSim/Region/Environment/Scenes/Primitive.cs
+++ b/OpenSim/Region/Environment/Scenes/Primitive.cs
@@ -138,22 +138,11 @@ namespace OpenSim.Region.Environment.Scenes
138 138
139 #region Constructors 139 #region Constructors
140 140
141 /// <summary> 141 public Primitive(ulong regionHandle, Scene scene, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent,
142 ///
143 /// </summary>
144 /// <param name="regionHandle"></param>
145 /// <param name="world"></param>
146 /// <param name="addPacket"></param>
147 /// <param name="ownerID"></param>
148 /// <param name="localID"></param>
149 /// <param name="isRoot"></param>
150 /// <param name="parent"></param>
151 /// <param name="rootObject"></param>
152 public Primitive(ulong regionHandle, Scene world, LLUUID ownerID, uint localID, bool isRoot, EntityBase parent,
153 SceneObject rootObject, PrimitiveBaseShape shape, LLVector3 pos) 142 SceneObject rootObject, PrimitiveBaseShape shape, LLVector3 pos)
154 { 143 {
155 m_regionHandle = regionHandle; 144 m_regionHandle = regionHandle;
156 m_world = world; 145 m_scene = scene;
157 m_inventoryItems = new Dictionary<LLUUID, InventoryItem>(); 146 m_inventoryItems = new Dictionary<LLUUID, InventoryItem>();
158 m_Parent = parent; 147 m_Parent = parent;
159 m_isRootPrim = isRoot; 148 m_isRootPrim = isRoot;
@@ -163,7 +152,7 @@ namespace OpenSim.Region.Environment.Scenes
163 152
164 Rotation = Quaternion.Identity; 153 Rotation = Quaternion.Identity;
165 154
166 m_world.AcknowledgeNewPrim(this); 155 m_scene.AcknowledgeNewPrim(this);
167 156
168 OnPrimCountTainted(); 157 OnPrimCountTainted();
169 } 158 }
@@ -202,10 +191,10 @@ namespace OpenSim.Region.Environment.Scenes
202 dupe.m_children = new List<EntityBase>(); 191 dupe.m_children = new List<EntityBase>();
203 dupe.m_Shape = m_Shape.Copy(); 192 dupe.m_Shape = m_Shape.Copy();
204 dupe.m_regionHandle = m_regionHandle; 193 dupe.m_regionHandle = m_regionHandle;
205 dupe.m_world = m_world; 194 dupe.m_scene = m_scene;
206 195
207 196
208 uint newLocalID = m_world.PrimIDAllocate(); 197 uint newLocalID = m_scene.PrimIDAllocate();
209 dupe.m_uuid = LLUUID.Random(); 198 dupe.m_uuid = LLUUID.Random();
210 dupe.LocalId = newLocalID; 199 dupe.LocalId = newLocalID;
211 200
@@ -225,7 +214,7 @@ namespace OpenSim.Region.Environment.Scenes
225 dupe.m_pos = new LLVector3(m_pos.X, m_pos.Y, m_pos.Z); 214 dupe.m_pos = new LLVector3(m_pos.X, m_pos.Y, m_pos.Z);
226 215
227 rootParent.AddChildToList(dupe); 216 rootParent.AddChildToList(dupe);
228 m_world.AcknowledgeNewPrim(dupe); 217 m_scene.AcknowledgeNewPrim(dupe);
229 dupe.TriggerOnPrimCountTainted(); 218 dupe.TriggerOnPrimCountTainted();
230 219
231 220
@@ -327,7 +316,7 @@ namespace OpenSim.Region.Environment.Scenes
327 m_children.Add(linkObject.rootPrimitive); 316 m_children.Add(linkObject.rootPrimitive);
328 linkObject.rootPrimitive.SetNewParent(this, m_RootParent); 317 linkObject.rootPrimitive.SetNewParent(this, m_RootParent);
329 318
330 m_world.DeleteEntity(linkObject.rootUUID); 319 m_scene.DeleteEntity(linkObject.rootUUID);
331 linkObject.DeleteAllChildren(); 320 linkObject.DeleteAllChildren();
332 321
333 OnPrimCountTainted(); 322 OnPrimCountTainted();
@@ -676,7 +665,7 @@ namespace OpenSim.Region.Environment.Scenes
676 /// </summary> 665 /// </summary>
677 public void SendFullUpdateToAllClients() 666 public void SendFullUpdateToAllClients()
678 { 667 {
679 List<ScenePresence> avatars = m_world.RequestAvatarList(); 668 List<ScenePresence> avatars = m_scene.RequestAvatarList();
680 for (int i = 0; i < avatars.Count; i++) 669 for (int i = 0; i < avatars.Count; i++)
681 { 670 {
682 SendFullUpdateToClient(avatars[i].ControllingClient); 671 SendFullUpdateToClient(avatars[i].ControllingClient);
@@ -721,7 +710,7 @@ namespace OpenSim.Region.Environment.Scenes
721 /// </summary> 710 /// </summary>
722 public void SendTerseUpdateToALLClients() 711 public void SendTerseUpdateToALLClients()
723 { 712 {
724 List<ScenePresence> avatars = m_world.RequestAvatarList(); 713 List<ScenePresence> avatars = m_scene.RequestAvatarList();
725 for (int i = 0; i < avatars.Count; i++) 714 for (int i = 0; i < avatars.Count; i++)
726 { 715 {
727 SendTerseUpdateToClient(avatars[i].ControllingClient); 716 SendTerseUpdateToClient(avatars[i].ControllingClient);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 0e25e54..39584ad 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -140,23 +140,23 @@ namespace OpenSim.Region.Environment.Scenes
140 m_eventManager = new EventManager(); 140 m_eventManager = new EventManager();
141 141
142 m_eventManager.OnParcelPrimCountAdd += 142 m_eventManager.OnParcelPrimCountAdd +=
143 new EventManager.OnParcelPrimCountAddDelegate(m_LandManager.addPrimToLandPrimCounts); 143 m_LandManager.addPrimToLandPrimCounts;
144 144
145 MainLog.Instance.Verbose("World.cs - creating new entitities instance"); 145 MainLog.Instance.Verbose("Creating new entitities instance");
146 Entities = new Dictionary<LLUUID, EntityBase>(); 146 Entities = new Dictionary<LLUUID, EntityBase>();
147 Avatars = new Dictionary<LLUUID, ScenePresence>(); 147 Avatars = new Dictionary<LLUUID, ScenePresence>();
148 Prims = new Dictionary<LLUUID, SceneObject>(); 148 Prims = new Dictionary<LLUUID, SceneObject>();
149 149
150 MainLog.Instance.Verbose("World.cs - loading objects from datastore"); 150 MainLog.Instance.Verbose("Loading objects from datastore");
151 List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects(); 151 List<SceneObject> PrimsFromDB = storageManager.DataStore.LoadObjects();
152 foreach (SceneObject prim in PrimsFromDB) 152 foreach (SceneObject prim in PrimsFromDB)
153 { 153 {
154 AddEntity(prim); 154 AddEntity(prim);
155 } 155 }
156 MainLog.Instance.Verbose("World.cs - loaded " + PrimsFromDB.Count.ToString() + " object(s)"); 156 MainLog.Instance.Verbose("Loaded " + PrimsFromDB.Count.ToString() + " object(s)");
157 157
158 158
159 MainLog.Instance.Verbose("World.cs - creating LandMap"); 159 MainLog.Instance.Verbose("Creating LandMap");
160 Terrain = new TerrainEngine(); 160 Terrain = new TerrainEngine();
161 161
162 ScenePresence.LoadAnims(); 162 ScenePresence.LoadAnims();
@@ -198,7 +198,7 @@ namespace OpenSim.Region.Environment.Scenes
198 } 198 }
199 199
200 /// <summary> 200 /// <summary>
201 /// Performs per-frame updates on the world, this should be the central world loop 201 /// Performs per-frame updates on the scene, this should be the central world loop
202 /// </summary> 202 /// </summary>
203 public override void Update() 203 public override void Update()
204 { 204 {
@@ -210,9 +210,11 @@ namespace OpenSim.Region.Environment.Scenes
210 phyScene.GetResults(); 210 phyScene.GetResults();
211 } 211 }
212 212
213 foreach (LLUUID UUID in Entities.Keys) 213 List<EntityBase> moveEntities = new List<EntityBase>( Entities.Values );
214
215 foreach (EntityBase entity in moveEntities)
214 { 216 {
215 Entities[UUID].updateMovement(); 217 entity.UpdateMovement();
216 } 218 }
217 219
218 lock (m_syncRoot) 220 lock (m_syncRoot)
@@ -220,9 +222,11 @@ namespace OpenSim.Region.Environment.Scenes
220 phyScene.Simulate(timeStep); 222 phyScene.Simulate(timeStep);
221 } 223 }
222 224
223 foreach (LLUUID UUID in Entities.Keys) 225 List<EntityBase> updateEntities = new List<EntityBase>(Entities.Values);
226
227 foreach (EntityBase entity in updateEntities)
224 { 228 {
225 Entities[UUID].Update(); 229 entity.Update();
226 } 230 }
227 231
228 // General purpose event manager 232 // General purpose event manager
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index 76a8439..0038b39 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -38,7 +38,7 @@ using OpenSim.Framework;
38 38
39namespace OpenSim.Region.Environment.Scenes 39namespace OpenSim.Region.Environment.Scenes
40{ 40{
41 public abstract class SceneBase : IWorld 41 public abstract class SceneBase : IScene
42 { 42 {
43 public Dictionary<LLUUID, EntityBase> Entities; 43 public Dictionary<LLUUID, EntityBase> Entities;
44 protected ulong m_regionHandle; 44 protected ulong m_regionHandle;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObject.cs b/OpenSim/Region/Environment/Scenes/SceneObject.cs
index d513634..03a7f55 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObject.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObject.cs
@@ -86,7 +86,7 @@ namespace OpenSim.Region.Environment.Scenes
86 public SceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape) 86 public SceneObject(Scene world, EventManager eventManager, LLUUID ownerID, uint localID, LLVector3 pos, PrimitiveBaseShape shape)
87 { 87 {
88 m_regionHandle = world.RegionInfo.RegionHandle; 88 m_regionHandle = world.RegionInfo.RegionHandle;
89 m_world = world; 89 m_scene = world;
90 m_eventManager = eventManager; 90 m_eventManager = eventManager;
91 91
92 this.Pos = pos; 92 this.Pos = pos;
@@ -102,7 +102,7 @@ namespace OpenSim.Region.Environment.Scenes
102 /// <remarks>Need a null constructor for duplication</remarks> 102 /// <remarks>Need a null constructor for duplication</remarks>
103 public SceneObject() 103 public SceneObject()
104 { 104 {
105 105
106 } 106 }
107 107
108 public void registerEvents() 108 public void registerEvents()
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes
144 public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos) 144 public void CreateRootFromShape(LLUUID agentID, uint localID, PrimitiveBaseShape shape, LLVector3 pos)
145 { 145 {
146 146
147 this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_world, agentID, localID, true, this, this, shape, pos); 147 this.rootPrimitive = new Primitive(this.m_regionHandle, this.m_scene, agentID, localID, true, this, this, shape, pos);
148 this.m_children.Add(rootPrimitive); 148 this.m_children.Add(rootPrimitive);
149 149
150 this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive); 150 this.ChildPrimitives.Add(this.rootUUID, this.rootPrimitive);
@@ -167,7 +167,7 @@ namespace OpenSim.Region.Environment.Scenes
167 { 167 {
168 SceneObject dupe = new SceneObject(); 168 SceneObject dupe = new SceneObject();
169 169
170 dupe.m_world = this.m_world; 170 dupe.m_scene = this.m_scene;
171 dupe.m_eventManager = this.m_eventManager; 171 dupe.m_eventManager = this.m_eventManager;
172 dupe.m_regionHandle = this.m_regionHandle; 172 dupe.m_regionHandle = this.m_regionHandle;
173 Primitive newRoot = this.rootPrimitive.Copy(dupe, dupe); 173 Primitive newRoot = this.rootPrimitive.Copy(dupe, dupe);
@@ -176,7 +176,7 @@ namespace OpenSim.Region.Environment.Scenes
176 dupe.m_children.Add(dupe.rootPrimitive); 176 dupe.m_children.Add(dupe.rootPrimitive);
177 dupe.rootPrimitive.Pos = this.Pos; 177 dupe.rootPrimitive.Pos = this.Pos;
178 dupe.Rotation = this.Rotation; 178 dupe.Rotation = this.Rotation;
179 dupe.LocalId = m_world.PrimIDAllocate(); 179 dupe.LocalId = m_scene.PrimIDAllocate();
180 180
181 dupe.registerEvents(); 181 dupe.registerEvents();
182 return dupe; 182 return dupe;
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index e81ac7b..b3255c4 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -120,7 +120,7 @@ namespace OpenSim.Region.Environment.Scenes
120 public ScenePresence(IClientAPI theClient, Scene world, RegionInfo reginfo) 120 public ScenePresence(IClientAPI theClient, Scene world, RegionInfo reginfo)
121 { 121 {
122 122
123 m_world = world; 123 m_scene = world;
124 this.m_uuid = theClient.AgentId; 124 this.m_uuid = theClient.AgentId;
125 125
126 m_regionInfo = reginfo; 126 m_regionInfo = reginfo;
@@ -129,7 +129,7 @@ namespace OpenSim.Region.Environment.Scenes
129 ControllingClient = theClient; 129 ControllingClient = theClient;
130 this.firstname = ControllingClient.FirstName; 130 this.firstname = ControllingClient.FirstName;
131 this.lastname = ControllingClient.LastName; 131 this.lastname = ControllingClient.LastName;
132 m_localId = m_world.NextLocalId; 132 m_localId = m_scene.NextLocalId;
133 Pos = ControllingClient.StartPos; 133 Pos = ControllingClient.StartPos;
134 visualParams = new byte[218]; 134 visualParams = new byte[218];
135 for (int i = 0; i < 218; i++) 135 for (int i = 0; i < 218; i++)
@@ -394,7 +394,7 @@ namespace OpenSim.Region.Environment.Scenes
394 /// </summary> 394 /// </summary>
395 public void SendTerseUpdateToALLClients() 395 public void SendTerseUpdateToALLClients()
396 { 396 {
397 List<ScenePresence> avatars = this.m_world.RequestAvatarList(); 397 List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
398 for (int i = 0; i < avatars.Count; i++) 398 for (int i = 0; i < avatars.Count; i++)
399 { 399 {
400 this.SendTerseUpdateToClient(avatars[i].ControllingClient); 400 this.SendTerseUpdateToClient(avatars[i].ControllingClient);
@@ -412,8 +412,8 @@ namespace OpenSim.Region.Environment.Scenes
412 412
413 public void SendFullUpdateToALLClients() 413 public void SendFullUpdateToALLClients()
414 { 414 {
415 List<ScenePresence> avatars = this.m_world.RequestAvatarList(); 415 List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
416 foreach (ScenePresence avatar in this.m_world.RequestAvatarList()) 416 foreach (ScenePresence avatar in this.m_scene.RequestAvatarList())
417 { 417 {
418 this.SendFullUpdateToOtherClient(avatar); 418 this.SendFullUpdateToOtherClient(avatar);
419 avatar.SendFullUpdateToOtherClient(this); 419 avatar.SendFullUpdateToOtherClient(this);
@@ -428,7 +428,7 @@ namespace OpenSim.Region.Environment.Scenes
428 this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture); 428 this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture);
429 if (this.newAvatar) 429 if (this.newAvatar)
430 { 430 {
431 this.m_world.InformClientOfNeighbours(this.ControllingClient); 431 this.m_scene.InformClientOfNeighbours(this.ControllingClient);
432 this.newAvatar = false; 432 this.newAvatar = false;
433 } 433 }
434 } 434 }
@@ -441,7 +441,7 @@ namespace OpenSim.Region.Environment.Scenes
441 { 441 {
442 this.ControllingClient.SendWearables(this.Wearables); 442 this.ControllingClient.SendWearables(this.Wearables);
443 this.SendFullUpdateToALLClients(); 443 this.SendFullUpdateToALLClients();
444 this.m_world.SendAllSceneObjectsToClient(this.ControllingClient); 444 this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
445 } 445 }
446 446
447 /// <summary> 447 /// <summary>
@@ -462,7 +462,7 @@ namespace OpenSim.Region.Environment.Scenes
462 { 462 {
463 this.current_anim = animID; 463 this.current_anim = animID;
464 this.anim_seq = seq; 464 this.anim_seq = seq;
465 List<ScenePresence> avatars = this.m_world.RequestAvatarList(); 465 List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
466 for (int i = 0; i < avatars.Count; i++) 466 for (int i = 0; i < avatars.Count; i++)
467 { 467 {
468 avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId); 468 avatars[i].ControllingClient.SendAnimation(animID, seq, this.ControllingClient.AgentId);
@@ -550,10 +550,10 @@ namespace OpenSim.Region.Environment.Scenes
550 550
551 LLVector3 vel = this.m_velocity; 551 LLVector3 vel = this.m_velocity;
552 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256)); 552 ulong neighbourHandle = Helpers.UIntsToLong((uint)(neighbourx * 256), (uint)(neighboury * 256));
553 RegionInfo neighbourRegion = this.m_world.RequestNeighbouringRegionInfo(neighbourHandle); 553 RegionInfo neighbourRegion = this.m_scene.RequestNeighbouringRegionInfo(neighbourHandle);
554 if (neighbourRegion != null) 554 if (neighbourRegion != null)
555 { 555 {
556 bool res = this.m_world.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos, this._physActor.Flying); 556 bool res = this.m_scene.InformNeighbourOfCrossing(neighbourHandle, this.ControllingClient.AgentId, newpos, this._physActor.Flying);
557 if (res) 557 if (res)
558 { 558 {
559 this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint); 559 this.ControllingClient.CrossRegion(neighbourHandle, newpos, vel, neighbourRegion.ExternalEndPoint);
@@ -574,7 +574,7 @@ namespace OpenSim.Region.Environment.Scenes
574 /// <summary> 574 /// <summary>
575 /// 575 ///
576 /// </summary> 576 /// </summary>
577 public override void updateMovement() 577 public override void UpdateMovement()
578 { 578 {
579 newForce = false; 579 newForce = false;
580 lock (this.forcesList) 580 lock (this.forcesList)
diff --git a/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs b/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
index e6505b4..404653d 100644
--- a/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
+++ b/OpenSim/Region/Examples/SimpleApp/CpuCounterObject.cs
@@ -23,13 +23,13 @@ namespace SimpleApp
23 m_counter = new PerformanceCounter(objectName, counterName, instanceName); 23 m_counter = new PerformanceCounter(objectName, counterName, instanceName);
24 } 24 }
25 25
26 public override void Update( ) 26 public override void UpdateMovement( )
27 { 27 {
28 float cpu = m_counter.NextValue() / 40f; 28 float cpu = m_counter.NextValue() / 40f;
29 LLVector3 size = new LLVector3(cpu, cpu, cpu); 29 LLVector3 size = new LLVector3(cpu, cpu, cpu);
30 rootPrimitive.ResizeGoup( size ); 30 rootPrimitive.ResizeGoup( size );
31 31
32 base.Update(); 32 base.UpdateMovement();
33 } 33 }
34 } 34 }
35} 35}