From 269ff893df525ad5ea8ad8fbe2528f7045dec8d9 Mon Sep 17 00:00:00 2001 From: mingchen Date: Fri, 8 Jun 2007 03:54:03 +0000 Subject: *Added Estate Tools for terrain texturing, terrain texturing heights per corner, water height, region flags, etc basic settings *Parcel now sends ParcelProperties when the owner changes information as soon as the information is changed --- .../Simulator/Avatar.Update.cs | 8 +-- OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs | 61 +++------------------- .../Simulator/ParcelManager.cs | 10 +++- OpenSim/OpenSim.RegionServer/Simulator/World.cs | 19 ++++--- 4 files changed, 28 insertions(+), 70 deletions(-) (limited to 'OpenSim/OpenSim.RegionServer/Simulator') diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs index 6f32c85..03da861 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.Update.cs @@ -54,7 +54,7 @@ namespace OpenSim.RegionServer.Simulator //use CreateTerseBlock() ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = m_regionHandle; // FIXME + terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; terse.RegionData.TimeDilation = 64096; terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; terse.ObjectData[0] = terseBlock; @@ -78,7 +78,7 @@ namespace OpenSim.RegionServer.Simulator //It has been a while since last update was sent so lets send one. ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = m_regionHandle; // FIXME + terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; terse.RegionData.TimeDilation = 64096; terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; terse.ObjectData[0] = terseBlock; @@ -158,7 +158,7 @@ namespace OpenSim.RegionServer.Simulator System.Text.Encoding _enc = System.Text.Encoding.ASCII; //send a objectupdate packet with information about the clients avatar ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); - objupdate.RegionData.RegionHandle = m_regionHandle; + objupdate.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; objupdate.RegionData.TimeDilation = 64096; objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; @@ -182,7 +182,7 @@ namespace OpenSim.RegionServer.Simulator //send a objectupdate packet with information about the clients avatar ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); - objupdate.RegionData.RegionHandle = m_regionHandle; + objupdate.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; objupdate.RegionData.TimeDilation = 64096; objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; objupdate.ObjectData[0] = AvatarTemplate; diff --git a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs index 65a9a63..a64ee9e 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs @@ -66,24 +66,15 @@ namespace OpenSim.RegionServer.Simulator private int positionParcelHoverLocalID = -1; //Local ID of the last parcel they were over private int parcelUpdateSequenceIncrement = 1; - private ulong m_regionHandle; - //private Dictionary m_clientThreads; - private string m_regionName; - private ushort m_regionWaterHeight; - private bool m_regionTerraform; + private bool childAvatar = false; - public Avatar(ClientView TheClient, World world, string regionName, Dictionary clientThreads, ulong regionHandle, bool regionTerraform, ushort regionWater) + public Avatar(ClientView TheClient, World world) { m_world = world; - // m_clientThreads = clientThreads; - m_regionName = regionName; - m_regionHandle = regionHandle; - m_regionTerraform = regionTerraform; - m_regionWaterHeight = regionWater; + ControllingClient = TheClient; OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs - Loading details from grid (DUMMY)"); - ControllingClient = TheClient; localid = 8880000 + (this.m_world._localNumber++); Pos = ControllingClient.startpos; visualParams = new byte[218]; @@ -133,7 +124,7 @@ namespace OpenSim.RegionServer.Simulator this._physActor.Velocity = new PhysicsVector(0, 0, 0); ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); - terse.RegionData.RegionHandle = m_regionHandle; // FIXME + terse.RegionData.RegionHandle = m_world.m_regInfo.RegionHandle; terse.RegionData.TimeDilation = 64096; terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; terse.ObjectData[0] = terseBlock; @@ -251,7 +242,7 @@ namespace OpenSim.RegionServer.Simulator AgentMovementCompletePacket mov = new AgentMovementCompletePacket(); mov.AgentData.SessionID = this.ControllingClient.SessionID; mov.AgentData.AgentID = this.ControllingClient.AgentID; - mov.Data.RegionHandle = this.m_regionHandle; + mov.Data.RegionHandle = this.m_world.m_regInfo.RegionHandle; // TODO - dynamicalise this stuff mov.Data.Timestamp = 1172750370; mov.Data.Position = this.ControllingClient.startpos; @@ -415,47 +406,7 @@ namespace OpenSim.RegionServer.Simulator } } - //really really should be moved somewhere else (RegionInfo.cs ?) - public void SendRegionHandshake(World regionInfo) - { - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); - System.Text.Encoding _enc = System.Text.Encoding.ASCII; - RegionHandshakePacket handshake = new RegionHandshakePacket(); - - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionhandshake() - Filling in RegionHandshake details"); - handshake.RegionInfo.BillableFactor = 0; - handshake.RegionInfo.IsEstateManager = false; - handshake.RegionInfo.TerrainHeightRange00 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeNW; - handshake.RegionInfo.TerrainHeightRange01 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeNE; - handshake.RegionInfo.TerrainHeightRange10 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeSW; - handshake.RegionInfo.TerrainHeightRange11 = regionInfo.m_regInfo.estateSettings.terrainHeightRangeSE; - handshake.RegionInfo.TerrainStartHeight00 = regionInfo.m_regInfo.estateSettings.terrainStartHeightNW; - handshake.RegionInfo.TerrainStartHeight01 = regionInfo.m_regInfo.estateSettings.terrainStartHeightNE; - handshake.RegionInfo.TerrainStartHeight10 = regionInfo.m_regInfo.estateSettings.terrainStartHeightSW; - handshake.RegionInfo.TerrainStartHeight11 = regionInfo.m_regInfo.estateSettings.terrainStartHeightSE; - handshake.RegionInfo.SimAccess = 13; - handshake.RegionInfo.WaterHeight = m_regionWaterHeight; - uint regionFlags = 72458694; - if (this.m_regionTerraform) - { - regionFlags -= 64; - } - handshake.RegionInfo.RegionFlags = regionFlags; - handshake.RegionInfo.SimName = _enc.GetBytes(m_regionName + "\0"); - handshake.RegionInfo.SimOwner = regionInfo.m_regInfo.MasterAvatarAssignedUUID; - handshake.RegionInfo.TerrainBase0 = regionInfo.m_regInfo.estateSettings.terrainBase0; - handshake.RegionInfo.TerrainBase1 = regionInfo.m_regInfo.estateSettings.terrainBase1; - handshake.RegionInfo.TerrainBase2 = regionInfo.m_regInfo.estateSettings.terrainBase2; - handshake.RegionInfo.TerrainBase3 = regionInfo.m_regInfo.estateSettings.terrainBase3; - handshake.RegionInfo.TerrainDetail0 = regionInfo.m_regInfo.estateSettings.terrainDetail0; - handshake.RegionInfo.TerrainDetail1 = regionInfo.m_regInfo.estateSettings.terrainDetail1; - handshake.RegionInfo.TerrainDetail2 = regionInfo.m_regInfo.estateSettings.terrainDetail2; - handshake.RegionInfo.TerrainDetail3 = regionInfo.m_regInfo.estateSettings.terrainDetail3; - handshake.RegionInfo.CacheID = new LLUUID("545ec0a5-5751-1026-8a0b-216e38a7ab37"); - - OpenSim.Framework.Console.MainConsole.Instance.Verbose("Avatar.cs:SendRegionHandshake() - Sending RegionHandshake packet"); - this.ControllingClient.OutPacket(handshake); - } + public static void LoadAnims() { diff --git a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs index 6d432f1..8620e8c 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/ParcelManager.cs @@ -562,7 +562,6 @@ namespace OpenSim.RegionServer.Simulator updatePacket.ParcelData.TotalPrims = 0; //unemplemented updatePacket.ParcelData.UserLocation = parcelData.userLocation; updatePacket.ParcelData.UserLookAt = parcelData.userLookAt; - remote_client.OutPacket((Packet)updatePacket); } @@ -588,6 +587,15 @@ namespace OpenSim.RegionServer.Simulator parcelData.snapshotID = packet.ParcelData.SnapshotID; parcelData.userLocation = packet.ParcelData.UserLocation; parcelData.userLookAt = packet.ParcelData.UserLookAt; + + foreach (Avatar av in m_world.Avatars.Values) + { + Parcel over = m_world.parcelManager.getParcel((int)Math.Round(av.Pos.X), (int)Math.Round(av.Pos.Y)); + if (over == this) + { + sendParcelProperties(0, false, 0, av.ControllingClient); + } + } } } #endregion diff --git a/OpenSim/OpenSim.RegionServer/Simulator/World.cs b/OpenSim/OpenSim.RegionServer/Simulator/World.cs index dda8ac4..765c74e 100644 --- a/OpenSim/OpenSim.RegionServer/Simulator/World.cs +++ b/OpenSim/OpenSim.RegionServer/Simulator/World.cs @@ -627,19 +627,18 @@ namespace OpenSim.RegionServer.Simulator try { MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Creating new avatar for remote viewer agent"); - newAvatar = new Avatar(agentClient, this, m_regionName, m_clientThreads, m_regionHandle, true, 20); + newAvatar = new Avatar(agentClient, this); MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Adding new avatar to world"); MainConsole.Instance.Notice("World.cs:AddViewerAgent() - Starting RegionHandshake "); - newAvatar.SendRegionHandshake(this); - //if (!agentClient.m_child) - //{ + estateManager.sendRegionHandshake(newAvatar.ControllingClient); - PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); - lock (this.LockPhysicsEngine) - { - newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); - } - // } + PhysicsVector pVec = new PhysicsVector(newAvatar.Pos.X, newAvatar.Pos.Y, newAvatar.Pos.Z); + lock (this.LockPhysicsEngine) + { + newAvatar.PhysActor = this.phyScene.AddAvatar(pVec); + } + + lock (Entities) { if (!Entities.ContainsKey(agentClient.AgentID)) -- cgit v1.1