diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 77058ccadd..059bfd75cb 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -103,40 +103,32 @@ namespace OpenSim.Region.Environment.Scenes /// Region Name for this region public Scene(Dictionary clientThreads, RegionInfo regInfo, AuthenticateSessionsBase authen, CommunicationsManager commsMan, AssetCache assetCach, BaseHttpServer httpServer) { - try - { - updateLock = new Mutex(false); - this.authenticateHandler = authen; - this.commsManager = commsMan; - this.assetCache = assetCach; - m_clientThreads = clientThreads; - m_regInfo = regInfo; - m_regionHandle = m_regInfo.RegionHandle; - m_regionName = m_regInfo.RegionName; - this.m_datastore = m_regInfo.DataStore; - this.RegisterRegionWithComms(); + updateLock = new Mutex(false); + this.authenticateHandler = authen; + this.commsManager = commsMan; + this.assetCache = assetCach; + m_clientThreads = clientThreads; + m_regInfo = regInfo; + m_regionHandle = m_regInfo.RegionHandle; + m_regionName = m_regInfo.RegionName; + this.m_datastore = m_regInfo.DataStore; + this.RegisterRegionWithComms(); - parcelManager = new ParcelManager(this, this.m_regInfo); - estateManager = new EstateManager(this, this.m_regInfo); - scriptManager = new ScriptManager(this); - eventManager = new EventManager(); + parcelManager = new ParcelManager(this, this.m_regInfo); + estateManager = new EstateManager(this, this.m_regInfo); + scriptManager = new ScriptManager(this); + eventManager = new EventManager(); - OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating new entitities instance"); - Entities = new Dictionary(); - Avatars = new Dictionary(); - Prims = new Dictionary(); + OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating new entitities instance"); + Entities = new Dictionary(); + Avatars = new Dictionary(); + Prims = new Dictionary(); - OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating LandMap"); - Terrain = new TerrainEngine(); + OpenSim.Framework.Console.MainLog.Instance.Verbose("World.cs - creating LandMap"); + Terrain = new TerrainEngine(); - ScenePresence.LoadAnims(); - this.httpListener = httpServer; - - } - catch (Exception e) - { - OpenSim.Framework.Console.MainLog.Instance.Error("World.cs: Constructor failed with exception " + e.ToString()); - } + ScenePresence.LoadAnims(); + this.httpListener = httpServer; } #endregion @@ -218,7 +210,7 @@ namespace OpenSim.Region.Environment.Scenes /// public bool Backup() { - + return true; } #endregion @@ -432,7 +424,7 @@ namespace OpenSim.Region.Environment.Scenes this._primCount++; // Trigger event for listeners - // eventManager.TriggerOnNewPrimitive(prim); + // eventManager.TriggerOnNewPrimitive(prim); } catch (Exception e) { @@ -440,6 +432,13 @@ namespace OpenSim.Region.Environment.Scenes } } + public override uint AddNewPrim(LLUUID ownerId, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID texture, int flags) + { + uint id = NextLocalId; + + throw new NotImplementedException("Not implemented yet."); + } + #endregion #region Add/Remove Avatar Methods @@ -670,7 +669,7 @@ namespace OpenSim.Region.Environment.Scenes agent.startpos = new LLVector3(128, 128, 70); agent.child = true; this.commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent); - remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint ); + remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint); //this.capsHandlers[remoteClient.AgentId].CreateEstablishAgentComms("", System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr) + ":" + neighbours[i].CommsIPListenPort); } } @@ -733,7 +732,7 @@ namespace OpenSim.Region.Environment.Scenes this.commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, agent); this.commsManager.InterRegion.ExpectAvatarCrossing(regionHandle, remoteClient.AgentId, position); - remoteClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4)); + remoteClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4)); } //remoteClient.SendTeleportCancel(); @@ -752,5 +751,6 @@ namespace OpenSim.Region.Environment.Scenes } #endregion + } } diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs index 00ab194662..817f206c0e 100644 --- a/OpenSim/Region/Environment/Scenes/SceneBase.cs +++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs @@ -149,7 +149,9 @@ namespace OpenSim.Region.Environment.Scenes /// /// public abstract void AddNewClient(IClientAPI client, bool child); - + + public abstract uint AddNewPrim(LLUUID ownerId, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID texture, int flags); + /// /// /// diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index fe1fc16712..3ba9c77c24 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs @@ -78,6 +78,9 @@ namespace SimpleApp pos, null); client.SendChatMessage("Welcome to My World.", 1, pos, "System", LLUUID.Zero ); + + + }; client.SendRegionHandshake(m_regionInfo); diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index f5c6999696..8e9ad75822 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -16,6 +16,7 @@ using OpenSim.Region.Communications.Local; using OpenSim.Region.ClientStack; using OpenSim.Region.Physics.BasicPhysicsPlugin; using System.Net; +using libsecondlife.Packets; namespace SimpleApp { @@ -23,6 +24,7 @@ namespace SimpleApp { private LogBase m_log; AuthenticateSessionsBase m_circuitManager; + uint m_localId; private void Run() { @@ -65,6 +67,12 @@ namespace SimpleApp m_log.WriteLine( LogPriority.NORMAL, "Press enter to quit."); m_log.ReadLine(); + + PrimData primData = new PrimData(); + primData.Scale = new LLVector3(1, 1, 1); + + m_localId = world.AddNewPrim( LLUUID.Zero, primData, LLVector3.Zero, new LLQuaternion(0, 0, 0, 0), LLUUID.Zero, 0); + } private bool AddNewSessionHandler(ulong regionHandle, Login loginData)