aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs11
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs12
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs88
3 files changed, 42 insertions, 69 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index a05e88c..f98337d 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
@@ -59,6 +59,7 @@ namespace OpenSim.Region.ClientStack.Linden
59 public class EventQueueGetModule : IEventQueue, INonSharedRegionModule 59 public class EventQueueGetModule : IEventQueue, INonSharedRegionModule
60 { 60 {
61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
62 private static string LogHeader = "[EVENT QUEUE GET MODULE]";
62 63
63 /// <value> 64 /// <value>
64 /// Debug level. 65 /// Debug level.
@@ -714,7 +715,7 @@ namespace OpenSim.Region.ClientStack.Linden
714 public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY) 715 public virtual void EnableSimulator(ulong handle, IPEndPoint endPoint, UUID avatarID, int regionSizeX, int regionSizeY)
715 { 716 {
716 m_log.DebugFormat("{0} EnableSimulator. handle={1}, avatarID={2}, regionSize={3},{4}>", 717 m_log.DebugFormat("{0} EnableSimulator. handle={1}, avatarID={2}, regionSize={3},{4}>",
717 "[EVENT QUEUE GET MODULE]", handle, avatarID, regionSizeX, regionSizeY); 718 LogHeader, handle, avatarID, regionSizeX, regionSizeY);
718 719
719 OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY); 720 OSD item = EventQueueHelper.EnableSimulator(handle, endPoint, regionSizeX, regionSizeY);
720 Enqueue(item, avatarID); 721 Enqueue(item, avatarID);
@@ -724,7 +725,7 @@ namespace OpenSim.Region.ClientStack.Linden
724 ulong regionHandle, int regionSizeX, int regionSizeY) 725 ulong regionHandle, int regionSizeX, int regionSizeY)
725 { 726 {
726 m_log.DebugFormat("{0} EstablishAgentCommunication. handle={1}, avatarID={2}, regionSize={3},{4}>", 727 m_log.DebugFormat("{0} EstablishAgentCommunication. handle={1}, avatarID={2}, regionSize={3},{4}>",
727 "[EVENT QUEUE GET MODULE]", regionHandle, avatarID, regionSizeX, regionSizeY); 728 LogHeader, regionHandle, avatarID, regionSizeX, regionSizeY);
728 OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath, regionHandle, regionSizeX, regionSizeY); 729 OSD item = EventQueueHelper.EstablishAgentCommunication(avatarID, endPoint.ToString(), capsPath, regionHandle, regionSizeX, regionSizeY);
729 Enqueue(item, avatarID); 730 Enqueue(item, avatarID);
730 } 731 }
@@ -734,8 +735,8 @@ namespace OpenSim.Region.ClientStack.Linden
734 uint locationID, uint flags, string capsURL, 735 uint locationID, uint flags, string capsURL,
735 UUID avatarID, int regionSizeX, int regionSizeY) 736 UUID avatarID, int regionSizeX, int regionSizeY)
736 { 737 {
737 m_log.DebugFormat("{0} TeleportFinishEvent. handle={1}, avatarID={2}, regionSize={3},{4}>", 738 m_log.DebugFormat("{0} TeleportFinishEvent. handle={1}, avatarID={2}, regionSize=<{3},{4}>",
738 "[EVENT QUEUE GET MODULE]", regionHandle, avatarID, regionSizeX, regionSizeY); 739 LogHeader, regionHandle, avatarID, regionSizeX, regionSizeY);
739 740
740 OSD item = EventQueueHelper.TeleportFinishEvent(regionHandle, simAccess, regionExternalEndPoint, 741 OSD item = EventQueueHelper.TeleportFinishEvent(regionHandle, simAccess, regionExternalEndPoint,
741 locationID, flags, capsURL, avatarID, regionSizeX, regionSizeY); 742 locationID, flags, capsURL, avatarID, regionSizeX, regionSizeY);
@@ -747,7 +748,7 @@ namespace OpenSim.Region.ClientStack.Linden
747 string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY) 748 string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY)
748 { 749 {
749 m_log.DebugFormat("{0} CrossRegion. handle={1}, avatarID={2}, regionSize={3},{4}>", 750 m_log.DebugFormat("{0} CrossRegion. handle={1}, avatarID={2}, regionSize={3},{4}>",
750 "[EVENT QUEUE GET MODULE]", handle, avatarID, regionSizeX, regionSizeY); 751 LogHeader, handle, avatarID, regionSizeX, regionSizeY);
751 752
752 OSD item = EventQueueHelper.CrossRegion(handle, pos, lookAt, newRegionExternalEndPoint, 753 OSD item = EventQueueHelper.CrossRegion(handle, pos, lookAt, newRegionExternalEndPoint,
753 capsURL, avatarID, sessionID, regionSizeX, regionSizeY); 754 capsURL, avatarID, sessionID, regionSizeX, regionSizeY);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
index ded228d..384af74 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs
@@ -77,8 +77,8 @@ namespace OpenSim.Region.ClientStack.Linden
77 llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle))); 77 llsdSimInfo.Add("Handle", new OSDBinary(ulongToByteArray(handle)));
78 llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes())); 78 llsdSimInfo.Add("IP", new OSDBinary(endPoint.Address.GetAddressBytes()));
79 llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port)); 79 llsdSimInfo.Add("Port", new OSDInteger(endPoint.Port));
80 llsdSimInfo.Add("RegionSizeX", new OSDInteger(regionSizeX)); 80 llsdSimInfo.Add("RegionSizeX", OSD.FromUInteger((uint) regionSizeX));
81 llsdSimInfo.Add("RegionSizeY", new OSDInteger(regionSizeY)); 81 llsdSimInfo.Add("RegionSizeY", OSD.FromUInteger((uint) regionSizeY));
82 82
83 OSDArray arr = new OSDArray(1); 83 OSDArray arr = new OSDArray(1);
84 arr.Add(llsdSimInfo); 84 arr.Add(llsdSimInfo);
@@ -138,8 +138,8 @@ namespace OpenSim.Region.ClientStack.Linden
138 regionDataMap.Add("SeedCapability", OSD.FromString(capsURL)); 138 regionDataMap.Add("SeedCapability", OSD.FromString(capsURL));
139 regionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes())); 139 regionDataMap.Add("SimIP", OSD.FromBinary(newRegionExternalEndPoint.Address.GetAddressBytes()));
140 regionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port)); 140 regionDataMap.Add("SimPort", OSD.FromInteger(newRegionExternalEndPoint.Port));
141 regionDataMap.Add("RegionSizeX", new OSDInteger(regionSizeX)); 141 regionDataMap.Add("RegionSizeX", OSD.FromUInteger((uint)regionSizeX));
142 regionDataMap.Add("RegionSizeY", new OSDInteger(regionSizeY)); 142 regionDataMap.Add("RegionSizeY", OSD.FromUInteger((uint)regionSizeY));
143 143
144 OSDArray regionDataArr = new OSDArray(1); 144 OSDArray regionDataArr = new OSDArray(1);
145 regionDataArr.Add(regionDataMap); 145 regionDataArr.Add(regionDataMap);
@@ -166,8 +166,8 @@ namespace OpenSim.Region.ClientStack.Linden
166 info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes())); 166 info.Add("SimIP", OSD.FromBinary(regionExternalEndPoint.Address.GetAddressBytes()));
167 info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port)); 167 info.Add("SimPort", OSD.FromInteger(regionExternalEndPoint.Port));
168 info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation 168 info.Add("TeleportFlags", OSD.FromULong(1L << 4)); // AgentManager.TeleportFlags.ViaLocation
169 info.Add("RegionSizeX", new OSDInteger(regionSizeX)); 169 info.Add("RegionSizeX", OSD.FromUInteger((uint)regionSizeX));
170 info.Add("RegionSizeY", new OSDInteger(regionSizeY)); 170 info.Add("RegionSizeY", OSD.FromUInteger((uint)regionSizeY));
171 171
172 OSDArray infoArr = new OSDArray(); 172 OSDArray infoArr = new OSDArray();
173 infoArr.Add(info); 173 infoArr.Add(info);
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 3a0ddae..6861f5b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -34,11 +34,13 @@ using System.Text;
34using System.Threading; 34using System.Threading;
35using System.Timers; 35using System.Timers;
36using System.Xml; 36using System.Xml;
37
37using log4net; 38using log4net;
38using OpenMetaverse; 39using OpenMetaverse;
39using OpenMetaverse.Packets; 40using OpenMetaverse.Packets;
40using OpenMetaverse.Messages.Linden; 41using OpenMetaverse.Messages.Linden;
41using OpenMetaverse.StructuredData; 42using OpenMetaverse.StructuredData;
43
42using OpenSim.Framework; 44using OpenSim.Framework;
43using OpenSim.Framework.Client; 45using OpenSim.Framework.Client;
44using OpenSim.Framework.Monitoring; 46using OpenSim.Framework.Monitoring;
@@ -48,7 +50,6 @@ using OpenSim.Services.Interfaces;
48using Timer = System.Timers.Timer; 50using Timer = System.Timers.Timer;
49using AssetLandmark = OpenSim.Framework.AssetLandmark; 51using AssetLandmark = OpenSim.Framework.AssetLandmark;
50using RegionFlags = OpenMetaverse.RegionFlags; 52using RegionFlags = OpenMetaverse.RegionFlags;
51using Nini.Config;
52 53
53using System.IO; 54using System.IO;
54using PermissionMask = OpenSim.Framework.PermissionMask; 55using PermissionMask = OpenSim.Framework.PermissionMask;
@@ -307,6 +308,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
307 private const float m_sunPainDaHalfOrbitalCutoff = 4.712388980384689858f; 308 private const float m_sunPainDaHalfOrbitalCutoff = 4.712388980384689858f;
308 309
309 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 310 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
311 private static string LogHeader = "[LLCLIENTVIEW]";
310 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients 312 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
311 313
312 /// <summary> 314 /// <summary>
@@ -447,7 +449,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
447 449
448// ~LLClientView() 450// ~LLClientView()
449// { 451// {
450// m_log.DebugFormat("[LLCLIENTVIEW]: Destructor called for {0}, circuit code {1}", Name, CircuitCode); 452// m_log.DebugFormat("{0} Destructor called for {1}, circuit code {2}", LogHeader, Name, CircuitCode);
451// } 453// }
452 454
453 /// <summary> 455 /// <summary>
@@ -513,9 +515,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
513 // there is some unidentified connection problem, not where we have issues due to deadlock 515 // there is some unidentified connection problem, not where we have issues due to deadlock
514 if (!IsActive && !force) 516 if (!IsActive && !force)
515 { 517 {
516 m_log.DebugFormat( 518 m_log.DebugFormat( "{0} Not attempting to close inactive client {1} in {2} since force flag is not set",
517 "[CLIENT]: Not attempting to close inactive client {0} in {1} since force flag is not set", 519 LogHeader, Name, m_scene.Name);
518 Name, m_scene.Name);
519 520
520 return; 521 return;
521 } 522 }
@@ -1153,7 +1154,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1153 /// <param name="map">heightmap</param> 1154 /// <param name="map">heightmap</param>
1154 public virtual void SendLayerData(float[] map) 1155 public virtual void SendLayerData(float[] map)
1155 { 1156 {
1156 Util.FireAndForget(DoSendLayerData, map); 1157 Util.FireAndForget(DoSendLayerData, m_scene.Heightmap.GetTerrainData());
1157 } 1158 }
1158 1159
1159 /// <summary> 1160 /// <summary>
@@ -1162,10 +1163,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1162 /// <param name="o"></param> 1163 /// <param name="o"></param>
1163 private void DoSendLayerData(object o) 1164 private void DoSendLayerData(object o)
1164 { 1165 {
1165 float[] map = LLHeightFieldMoronize((float[])o); 1166 TerrainData map = (TerrainData)o;
1166 1167
1167 try 1168 try
1168 { 1169 {
1170 // Send LayerData in typerwriter pattern
1169 //for (int y = 0; y < 16; y++) 1171 //for (int y = 0; y < 16; y++)
1170 //{ 1172 //{
1171 // for (int x = 0; x < 16; x++) 1173 // for (int x = 0; x < 16; x++)
@@ -1175,7 +1177,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1175 //} 1177 //}
1176 1178
1177 // Send LayerData in a spiral pattern. Fun! 1179 // Send LayerData in a spiral pattern. Fun!
1178 SendLayerTopRight(map, 0, 0, 15, 15); 1180 SendLayerTopRight(map, 0, 0, map.SizeX/Constants.TerrainPatchSize-1, map.SizeY/Constants.TerrainPatchSize-1);
1179 } 1181 }
1180 catch (Exception e) 1182 catch (Exception e)
1181 { 1183 {
@@ -1183,7 +1185,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1183 } 1185 }
1184 } 1186 }
1185 1187
1186 private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2) 1188 private void SendLayerTopRight(TerrainData map, int x1, int y1, int x2, int y2)
1187 { 1189 {
1188 // Row 1190 // Row
1189 for (int i = x1; i <= x2; i++) 1191 for (int i = x1; i <= x2; i++)
@@ -1193,11 +1195,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1193 for (int j = y1 + 1; j <= y2; j++) 1195 for (int j = y1 + 1; j <= y2; j++)
1194 SendLayerData(x2, j, map); 1196 SendLayerData(x2, j, map);
1195 1197
1196 if (x2 - x1 > 0) 1198 if (x2 - x1 > 0 && y2 - y1 > 0)
1197 SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2); 1199 SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
1198 } 1200 }
1199 1201
1200 void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2) 1202 void SendLayerBottomLeft(TerrainData map, int x1, int y1, int x2, int y2)
1201 { 1203 {
1202 // Row in reverse 1204 // Row in reverse
1203 for (int i = x2; i >= x1; i--) 1205 for (int i = x2; i >= x1; i--)
@@ -1207,7 +1209,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1207 for (int j = y2 - 1; j >= y1; j--) 1209 for (int j = y2 - 1; j >= y1; j--)
1208 SendLayerData(x1, j, map); 1210 SendLayerData(x1, j, map);
1209 1211
1210 if (x2 - x1 > 0) 1212 if (x2 - x1 > 0 && y2 - y1 > 0)
1211 SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1); 1213 SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
1212 } 1214 }
1213 1215
@@ -1229,22 +1231,26 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1229 // OutPacket(layerpack, ThrottleOutPacketType.Land); 1231 // OutPacket(layerpack, ThrottleOutPacketType.Land);
1230 // } 1232 // }
1231 1233
1234 // Legacy form of invocation that passes around a bare data array.
1235 // Just ignore what was passed and use the real terrain info that is part of the scene.
1236 public void SendLayerData(int px, int py, float[] map)
1237 {
1238 SendLayerData(px, py, m_scene.Heightmap.GetTerrainData());
1239 }
1240
1232 /// <summary> 1241 /// <summary>
1233 /// Sends a specified patch to a client 1242 /// Sends a terrain packet for the point specified.
1243 /// This is a legacy call that has refarbed the terrain into a flat map of floats.
1244 /// We just use the terrain from the region we know about.
1234 /// </summary> 1245 /// </summary>
1235 /// <param name="px">Patch coordinate (x) 0..15</param> 1246 /// <param name="px">Patch coordinate (x) 0..15</param>
1236 /// <param name="py">Patch coordinate (y) 0..15</param> 1247 /// <param name="py">Patch coordinate (y) 0..15</param>
1237 /// <param name="map">heightmap</param> 1248 /// <param name="map">heightmap</param>
1238 public void SendLayerData(int px, int py, float[] map) 1249 public void SendLayerData(int px, int py, TerrainData terrData)
1239 { 1250 {
1240 try 1251 try
1241 { 1252 {
1242 int[] patches = new int[] { py * 16 + px }; 1253 LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLandPacket(terrData, px, py);
1243 float[] heightmap = (map.Length == 65536) ?
1244 map :
1245 LLHeightFieldMoronize(map);
1246
1247 LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
1248 1254
1249 // When a user edits the terrain, so much data is sent, the data queues up fast and presents a sub optimal editing experience. 1255 // When a user edits the terrain, so much data is sent, the data queues up fast and presents a sub optimal editing experience.
1250 // To alleviate this issue, when the user edits the terrain, we start skipping the queues until they're done editing the terrain. 1256 // To alleviate this issue, when the user edits the terrain, we start skipping the queues until they're done editing the terrain.
@@ -1262,14 +1268,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1262 if (m_justEditedTerrain) 1268 if (m_justEditedTerrain)
1263 { 1269 {
1264 layerpack.Header.Reliable = false; 1270 layerpack.Header.Reliable = false;
1265 OutPacket(layerpack, 1271 OutPacket(layerpack, ThrottleOutPacketType.Unknown );
1266 ThrottleOutPacketType.Unknown );
1267 } 1272 }
1268 else 1273 else
1269 { 1274 {
1270 layerpack.Header.Reliable = true; 1275 layerpack.Header.Reliable = true;
1271 OutPacket(layerpack, 1276 OutPacket(layerpack, ThrottleOutPacketType.Land);
1272 ThrottleOutPacketType.Land);
1273 } 1277 }
1274 } 1278 }
1275 catch (Exception e) 1279 catch (Exception e)
@@ -1279,38 +1283,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1279 } 1283 }
1280 1284
1281 /// <summary> 1285 /// <summary>
1282 /// Munges heightfield into the LLUDP backed in restricted heightfield.
1283 /// </summary>
1284 /// <param name="map">float array in the base; Constants.RegionSize</param>
1285 /// <returns>float array in the base 256</returns>
1286 internal float[] LLHeightFieldMoronize(float[] map)
1287 {
1288 if (map.Length == 65536)
1289 return map;
1290 else
1291 {
1292 float[] returnmap = new float[65536];
1293
1294 if (map.Length < 65535)
1295 {
1296 // rebase the vector stride to 256
1297 for (int i = 0; i < Constants.RegionSize; i++)
1298 Array.Copy(map, i * (int)Constants.RegionSize, returnmap, i * 256, (int)Constants.RegionSize);
1299 }
1300 else
1301 {
1302 for (int i = 0; i < 256; i++)
1303 Array.Copy(map, i * (int)Constants.RegionSize, returnmap, i * 256, 256);
1304 }
1305
1306 //Array.Copy(map,0,returnmap,0,(map.Length < 65536)? map.Length : 65536);
1307
1308 return returnmap;
1309 }
1310
1311 }
1312
1313 /// <summary>
1314 /// Send the wind matrix to the client 1286 /// Send the wind matrix to the client
1315 /// </summary> 1287 /// </summary>
1316 /// <param name="windSpeeds">16x16 array of wind speeds</param> 1288 /// <param name="windSpeeds">16x16 array of wind speeds</param>
@@ -2785,8 +2757,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2785 { 2757 {
2786 if (req.AssetInf.Data == null) 2758 if (req.AssetInf.Data == null)
2787 { 2759 {
2788 m_log.ErrorFormat("Cannot send asset {0} ({1}), asset data is null", 2760 m_log.ErrorFormat("{0} Cannot send asset {1} ({2}), asset data is null",
2789 req.AssetInf.ID, req.AssetInf.Metadata.ContentType); 2761 LogHeader, req.AssetInf.ID, req.AssetInf.Metadata.ContentType);
2790 return; 2762 return;
2791 } 2763 }
2792 2764