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
---
OpenSim/OpenSim.RegionServer/Client/ClientView.cs | 1 +
.../OpenSim.RegionServer/Estate/EstateManager.cs | 271 +++++++++++++++++++--
.../OpenSim.RegionServer.csproj | 20 +-
.../OpenSim.RegionServer.dll.build | 8 +-
.../Simulator/Avatar.Update.cs | 8 +-
OpenSim/OpenSim.RegionServer/Simulator/Avatar.cs | 61 +----
.../Simulator/ParcelManager.cs | 10 +-
OpenSim/OpenSim.RegionServer/Simulator/World.cs | 19 +-
OpenSim/OpenSim/OpenSim.csproj | 4 +-
OpenSim/OpenSim/OpenSim.exe.build | 2 +-
10 files changed, 296 insertions(+), 108 deletions(-)
(limited to 'OpenSim')
diff --git a/OpenSim/OpenSim.RegionServer/Client/ClientView.cs b/OpenSim/OpenSim.RegionServer/Client/ClientView.cs
index 6d7c3f2..f6d672c 100644
--- a/OpenSim/OpenSim.RegionServer/Client/ClientView.cs
+++ b/OpenSim/OpenSim.RegionServer/Client/ClientView.cs
@@ -144,6 +144,7 @@ namespace OpenSim.RegionServer.Client
m_world.parcelManager.sendParcelOverlay(this);
+ m_world.estateManager.sendRegionInfoPacket(this);
ClientThread = new Thread(new ThreadStart(AuthUser));
ClientThread.IsBackground = true;
diff --git a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs
index 33996d0..7a34334 100644
--- a/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs
+++ b/OpenSim/OpenSim.RegionServer/Estate/EstateManager.cs
@@ -24,6 +24,16 @@ namespace OpenSim.RegionServer.Estate
m_world = world; //Estate settings found at world.m_regInfo.estateSettings
}
+ private bool convertParamStringToBool(byte[] field)
+ {
+ string s = Helpers.FieldToUTF8String(field);
+ if (s == "1" || s.ToLower() == "y" || s.ToLower() == "yes" || s.ToLower() == "t" || s.ToLower() == "true")
+ {
+ return true;
+ }
+ return false;
+ }
+
public void handleEstateOwnerMessage(EstateOwnerMessagePacket packet, ClientView remote_client)
{
if (remote_client.AgentID == m_world.m_regInfo.MasterAvatarAssignedUUID)
@@ -32,27 +42,168 @@ namespace OpenSim.RegionServer.Estate
{
case "getinfo":
Console.WriteLine("GETINFO Requested");
- RegionInfoPacket regionInfoPacket = new RegionInfoPacket();
- regionInfoPacket.AgentData.AgentID = remote_client.AgentID;
- regionInfoPacket.AgentData.SessionID = remote_client.SessionID;
- regionInfoPacket.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor;
- regionInfoPacket.RegionInfo.EstateID = m_world.m_regInfo.estateSettings.estateID;
- regionInfoPacket.RegionInfo.MaxAgents = m_world.m_regInfo.estateSettings.maxAgents;
- regionInfoPacket.RegionInfo.ObjectBonusFactor = m_world.m_regInfo.estateSettings.objectBonusFactor;
- regionInfoPacket.RegionInfo.ParentEstateID = m_world.m_regInfo.estateSettings.parentEstateID;
- regionInfoPacket.RegionInfo.PricePerMeter = m_world.m_regInfo.estateSettings.pricePerMeter;
- regionInfoPacket.RegionInfo.RedirectGridX = m_world.m_regInfo.estateSettings.redirectGridX;
- regionInfoPacket.RegionInfo.RedirectGridY = m_world.m_regInfo.estateSettings.redirectGridY;
- regionInfoPacket.RegionInfo.RegionFlags = m_world.m_regInfo.estateSettings.regionFlags;
- regionInfoPacket.RegionInfo.SimAccess = m_world.m_regInfo.estateSettings.simAccess;
- regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_world.m_regInfo.RegionName);
- regionInfoPacket.RegionInfo.SunHour = m_world.m_regInfo.estateSettings.sunHour;
- regionInfoPacket.RegionInfo.TerrainLowerLimit = m_world.m_regInfo.estateSettings.terrainLowerLimit;
- regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_world.m_regInfo.estateSettings.terrainRaiseLimit;
- regionInfoPacket.RegionInfo.UseEstateSun = m_world.m_regInfo.estateSettings.useEstateSun;
- regionInfoPacket.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight;
-
- remote_client.OutPacket(regionInfoPacket);
+ this.sendRegionInfoPacketToAll();
+
+ break;
+ case "setregioninfo":
+ if (packet.ParamList.Length != 9)
+ {
+ OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: SetRegionInfo method has a ParamList of invalid length");
+ }
+ else
+ {
+ m_world.m_regInfo.estateSettings.regionFlags = libsecondlife.Simulator.RegionFlags.None;
+
+ if (convertParamStringToBool(packet.ParamList[0].Parameter))
+ {
+ m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockTerraform;
+ }
+
+ if (convertParamStringToBool(packet.ParamList[1].Parameter))
+ {
+ m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.NoFly;
+ }
+
+ if (convertParamStringToBool(packet.ParamList[2].Parameter))
+ {
+ m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowDamage;
+ }
+
+ if (convertParamStringToBool(packet.ParamList[3].Parameter) == false)
+ {
+ m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.BlockLandResell;
+ }
+
+
+ int tempMaxAgents = Convert.ToInt16(Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[4].Parameter)));
+ m_world.m_regInfo.estateSettings.maxAgents = (byte)tempMaxAgents;
+
+ float tempObjectBonusFactor = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
+ m_world.m_regInfo.estateSettings.objectBonusFactor = tempObjectBonusFactor;
+
+ int tempMatureLevel = Convert.ToInt16(Helpers.FieldToUTF8String(packet.ParamList[6].Parameter));
+ m_world.m_regInfo.estateSettings.simAccess = (libsecondlife.Simulator.SimAccess)tempMatureLevel;
+
+
+ if (convertParamStringToBool(packet.ParamList[7].Parameter))
+ {
+ m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.RestrictPushObject;
+ }
+
+ if (convertParamStringToBool(packet.ParamList[8].Parameter))
+ {
+ m_world.m_regInfo.estateSettings.regionFlags = m_world.m_regInfo.estateSettings.regionFlags | libsecondlife.Simulator.RegionFlags.AllowParcelChanges;
+ }
+
+ sendRegionInfoPacketToAll();
+
+ }
+ break;
+ case "texturebase":
+ foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
+ {
+ string s = Helpers.FieldToUTF8String(block.Parameter);
+ string[] splitField = s.Split(' ');
+ if (splitField.Length == 2)
+ {
+ LLUUID tempUUID = new LLUUID(splitField[1]);
+ switch (Convert.ToInt16(splitField[0]))
+ {
+ case 0:
+ m_world.m_regInfo.estateSettings.terrainBase0 = tempUUID;
+ break;
+ case 1:
+ m_world.m_regInfo.estateSettings.terrainBase1 = tempUUID;
+ break;
+ case 2:
+ m_world.m_regInfo.estateSettings.terrainBase2 = tempUUID;
+ break;
+ case 3:
+ m_world.m_regInfo.estateSettings.terrainBase3 = tempUUID;
+ break;
+ }
+ }
+ }
+ break;
+ case "texturedetail":
+ foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
+ {
+
+ string s = Helpers.FieldToUTF8String(block.Parameter);
+ string[] splitField = s.Split(' ');
+ if (splitField.Length == 2)
+ {
+ LLUUID tempUUID = new LLUUID(splitField[1]);
+ switch (Convert.ToInt16(splitField[0]))
+ {
+ case 0:
+ m_world.m_regInfo.estateSettings.terrainDetail0 = tempUUID;
+ break;
+ case 1:
+ m_world.m_regInfo.estateSettings.terrainDetail1 = tempUUID;
+ break;
+ case 2:
+ m_world.m_regInfo.estateSettings.terrainDetail2 = tempUUID;
+ break;
+ case 3:
+ m_world.m_regInfo.estateSettings.terrainDetail3 = tempUUID;
+ break;
+ }
+ }
+ }
+ break;
+ case "textureheights":
+ foreach (EstateOwnerMessagePacket.ParamListBlock block in packet.ParamList)
+ {
+
+ string s = Helpers.FieldToUTF8String(block.Parameter);
+ string[] splitField = s.Split(' ');
+ if (splitField.Length == 3)
+ {
+
+ float tempHeightLow = (float)Convert.ToDecimal(splitField[1]);
+ float tempHeightHigh = (float)Convert.ToDecimal(splitField[2]);
+
+ switch (Convert.ToInt16(splitField[0]))
+ {
+ case 0:
+ m_world.m_regInfo.estateSettings.terrainStartHeight0 = tempHeightLow;
+ m_world.m_regInfo.estateSettings.terrainHeightRange0 = tempHeightHigh;
+ break;
+ case 1:
+ m_world.m_regInfo.estateSettings.terrainStartHeight1 = tempHeightLow;
+ m_world.m_regInfo.estateSettings.terrainHeightRange1 = tempHeightHigh;
+ break;
+ case 2:
+ m_world.m_regInfo.estateSettings.terrainStartHeight2 = tempHeightLow;
+ m_world.m_regInfo.estateSettings.terrainHeightRange2 = tempHeightHigh;
+ break;
+ case 3:
+ m_world.m_regInfo.estateSettings.terrainStartHeight3 = tempHeightLow;
+ m_world.m_regInfo.estateSettings.terrainHeightRange3 = tempHeightHigh;
+ break;
+ }
+ }
+ }
+ break;
+ case "texturecommit":
+ sendRegionHandshakeToAll();
+ break;
+ case "setregionterrain":
+ if (packet.ParamList.Length != 9)
+ {
+ OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length");
+ }
+ else
+ {
+ m_world.m_regInfo.estateSettings.waterHeight = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[0].Parameter));
+ m_world.m_regInfo.estateSettings.terrainRaiseLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[1].Parameter));
+ m_world.m_regInfo.estateSettings.terrainLowerLimit = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[2].Parameter));
+ m_world.m_regInfo.estateSettings.useFixedSun = this.convertParamStringToBool(packet.ParamList[4].Parameter);
+ m_world.m_regInfo.estateSettings.sunHour = (float)Convert.ToDecimal(Helpers.FieldToUTF8String(packet.ParamList[5].Parameter));
+
+ sendRegionInfoPacketToAll();
+ }
break;
default:
OpenSim.Framework.Console.MainConsole.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
@@ -60,5 +211,83 @@ namespace OpenSim.RegionServer.Estate
}
}
}
+
+ public void sendRegionInfoPacketToAll()
+ {
+ foreach (OpenSim.RegionServer.Simulator.Avatar av in m_world.Avatars.Values)
+ {
+ this.sendRegionInfoPacket(av.ControllingClient);
+ }
+ }
+
+ public void sendRegionHandshakeToAll()
+ {
+ foreach (OpenSim.RegionServer.Simulator.Avatar av in m_world.Avatars.Values)
+ {
+ this.sendRegionHandshake(av.ControllingClient);
+ }
+ }
+
+ public void sendRegionInfoPacket(ClientView remote_client)
+ {
+
+ RegionInfoPacket regionInfoPacket = new RegionInfoPacket();
+ regionInfoPacket.AgentData.AgentID = remote_client.AgentID;
+ regionInfoPacket.AgentData.SessionID = remote_client.SessionID;
+ regionInfoPacket.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor;
+ regionInfoPacket.RegionInfo.EstateID = m_world.m_regInfo.estateSettings.estateID;
+ regionInfoPacket.RegionInfo.MaxAgents = m_world.m_regInfo.estateSettings.maxAgents;
+ regionInfoPacket.RegionInfo.ObjectBonusFactor = m_world.m_regInfo.estateSettings.objectBonusFactor;
+ regionInfoPacket.RegionInfo.ParentEstateID = m_world.m_regInfo.estateSettings.parentEstateID;
+ regionInfoPacket.RegionInfo.PricePerMeter = m_world.m_regInfo.estateSettings.pricePerMeter;
+ regionInfoPacket.RegionInfo.RedirectGridX = m_world.m_regInfo.estateSettings.redirectGridX;
+ regionInfoPacket.RegionInfo.RedirectGridY = m_world.m_regInfo.estateSettings.redirectGridY;
+ regionInfoPacket.RegionInfo.RegionFlags = (uint)m_world.m_regInfo.estateSettings.regionFlags;
+ regionInfoPacket.RegionInfo.SimAccess = (byte)m_world.m_regInfo.estateSettings.simAccess;
+ regionInfoPacket.RegionInfo.SimName = Helpers.StringToField(m_world.m_regInfo.RegionName);
+ regionInfoPacket.RegionInfo.SunHour = m_world.m_regInfo.estateSettings.sunHour;
+ regionInfoPacket.RegionInfo.TerrainLowerLimit = m_world.m_regInfo.estateSettings.terrainLowerLimit;
+ regionInfoPacket.RegionInfo.TerrainRaiseLimit = m_world.m_regInfo.estateSettings.terrainRaiseLimit;
+ regionInfoPacket.RegionInfo.UseEstateSun = !m_world.m_regInfo.estateSettings.useFixedSun;
+ regionInfoPacket.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight;
+
+ remote_client.OutPacket(regionInfoPacket);
+ }
+
+ public void sendRegionHandshake(ClientView remote_client)
+ {
+ System.Text.Encoding _enc = System.Text.Encoding.ASCII;
+ RegionHandshakePacket handshake = new RegionHandshakePacket();
+
+ handshake.RegionInfo.BillableFactor = m_world.m_regInfo.estateSettings.billableFactor;
+ handshake.RegionInfo.IsEstateManager = false;
+ handshake.RegionInfo.TerrainHeightRange00 = m_world.m_regInfo.estateSettings.terrainHeightRange0;
+ handshake.RegionInfo.TerrainHeightRange01 = m_world.m_regInfo.estateSettings.terrainHeightRange1;
+ handshake.RegionInfo.TerrainHeightRange10 = m_world.m_regInfo.estateSettings.terrainHeightRange2;
+ handshake.RegionInfo.TerrainHeightRange11 = m_world.m_regInfo.estateSettings.terrainHeightRange3;
+ handshake.RegionInfo.TerrainStartHeight00 = m_world.m_regInfo.estateSettings.terrainStartHeight0;
+ handshake.RegionInfo.TerrainStartHeight01 = m_world.m_regInfo.estateSettings.terrainStartHeight1;
+ handshake.RegionInfo.TerrainStartHeight10 = m_world.m_regInfo.estateSettings.terrainStartHeight2;
+ handshake.RegionInfo.TerrainStartHeight11 = m_world.m_regInfo.estateSettings.terrainStartHeight3;
+ handshake.RegionInfo.SimAccess = (byte)m_world.m_regInfo.estateSettings.simAccess;
+ handshake.RegionInfo.WaterHeight = m_world.m_regInfo.estateSettings.waterHeight;
+
+
+ handshake.RegionInfo.RegionFlags = (uint)m_world.m_regInfo.estateSettings.regionFlags;
+
+ handshake.RegionInfo.SimName = _enc.GetBytes(m_world.m_regInfo.estateSettings.waterHeight + "\0");
+ handshake.RegionInfo.SimOwner = m_world.m_regInfo.MasterAvatarAssignedUUID;
+ handshake.RegionInfo.TerrainBase0 = m_world.m_regInfo.estateSettings.terrainBase0;
+ handshake.RegionInfo.TerrainBase1 = m_world.m_regInfo.estateSettings.terrainBase1;
+ handshake.RegionInfo.TerrainBase2 = m_world.m_regInfo.estateSettings.terrainBase2;
+ handshake.RegionInfo.TerrainBase3 = m_world.m_regInfo.estateSettings.terrainBase3;
+ handshake.RegionInfo.TerrainDetail0 = m_world.m_regInfo.estateSettings.terrainDetail0;
+ handshake.RegionInfo.TerrainDetail1 = m_world.m_regInfo.estateSettings.terrainDetail1;
+ handshake.RegionInfo.TerrainDetail2 = m_world.m_regInfo.estateSettings.terrainDetail2;
+ handshake.RegionInfo.TerrainDetail3 = m_world.m_regInfo.estateSettings.terrainDetail3;
+ handshake.RegionInfo.CacheID = LLUUID.Random(); //I guess this is for the client to remember an old setting?
+
+ remote_client.OutPacket(handshake);
+ }
}
}
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
index 4f16f2c..12c0645 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.csproj
@@ -154,15 +154,15 @@
Code
-
- Code
-
Code
Code
+
+ Code
+
Code
@@ -172,9 +172,6 @@
Code
-
- Code
-
Code
@@ -190,13 +187,16 @@
Code
+
+ Code
+
Code
-
+
Code
-
+
Code
@@ -244,10 +244,10 @@
Code
-
+
Code
-
+
Code
diff --git a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
index 702c90c..5f33913 100644
--- a/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
+++ b/OpenSim/OpenSim.RegionServer/OpenSim.RegionServer.dll.build
@@ -21,21 +21,21 @@
-
+
-
+
+
-
@@ -51,8 +51,8 @@
-
+
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))
diff --git a/OpenSim/OpenSim/OpenSim.csproj b/OpenSim/OpenSim/OpenSim.csproj
index a3f6ec0..069c5c6 100644
--- a/OpenSim/OpenSim/OpenSim.csproj
+++ b/OpenSim/OpenSim/OpenSim.csproj
@@ -130,10 +130,10 @@
-
+
Code
-
+
Code
diff --git a/OpenSim/OpenSim/OpenSim.exe.build b/OpenSim/OpenSim/OpenSim.exe.build
index 670b77c..4f8ca8a 100644
--- a/OpenSim/OpenSim/OpenSim.exe.build
+++ b/OpenSim/OpenSim/OpenSim.exe.build
@@ -11,8 +11,8 @@
-
+
--
cgit v1.1