aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs22
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs4
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs10
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs9
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs6
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs8
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs2
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs12
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs128
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs172
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs7
11 files changed, 242 insertions, 138 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
index d3bb0bc..d1ce5df 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs
@@ -136,7 +136,6 @@ namespace OpenSim.Region.ClientStack.Linden
136 TaskScriptUpdatedCall = m_Scene.CapsUpdateTaskInventoryScriptAsset; 136 TaskScriptUpdatedCall = m_Scene.CapsUpdateTaskInventoryScriptAsset;
137 CAPSFetchInventoryDescendents = m_Scene.HandleFetchInventoryDescendentsCAPS; 137 CAPSFetchInventoryDescendents = m_Scene.HandleFetchInventoryDescendentsCAPS;
138 GetClient = m_Scene.SceneContents.GetControllingClient; 138 GetClient = m_Scene.SceneContents.GetControllingClient;
139
140 } 139 }
141 140
142 /// <summary> 141 /// <summary>
@@ -232,7 +231,7 @@ namespace OpenSim.Region.ClientStack.Linden
232 public string SeedCapRequest(string request, string path, string param, 231 public string SeedCapRequest(string request, string path, string param,
233 OSHttpRequest httpRequest, OSHttpResponse httpResponse) 232 OSHttpRequest httpRequest, OSHttpResponse httpResponse)
234 { 233 {
235 m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName); 234// m_log.Debug("[CAPS]: Seed Caps Request in region: " + m_regionName);
236 235
237 if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint)) 236 if (!m_Scene.CheckClient(m_HostCapsObj.AgentID, httpRequest.RemoteIPEndPoint))
238 { 237 {
@@ -331,14 +330,22 @@ namespace OpenSim.Region.ClientStack.Linden
331 } 330 }
332 } 331 }
333 332
333 /// <summary>
334 /// Handle a request from the client for a Uri to upload a baked texture.
335 /// </summary>
336 /// <param name="request"></param>
337 /// <param name="path"></param>
338 /// <param name="param"></param>
339 /// <param name="httpRequest"></param>
340 /// <param name="httpResponse"></param>
341 /// <returns>The upload response if the request is successful, null otherwise.</returns>
334 public string UploadBakedTexture(string request, string path, 342 public string UploadBakedTexture(string request, string path,
335 string param, OSHttpRequest httpRequest, 343 string param, OSHttpRequest httpRequest,
336 OSHttpResponse httpResponse) 344 OSHttpResponse httpResponse)
337 { 345 {
338 try 346 try
339 { 347 {
340 // m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " + 348// m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " + m_regionName);
341 // m_regionName);
342 349
343 string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath; 350 string capsBase = "/CAPS/" + m_HostCapsObj.CapsObjectPath;
344 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); 351 string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
@@ -374,6 +381,11 @@ namespace OpenSim.Region.ClientStack.Linden
374 return null; 381 return null;
375 } 382 }
376 383
384 /// <summary>
385 /// Called when a baked texture has been successfully uploaded by a client.
386 /// </summary>
387 /// <param name="assetID"></param>
388 /// <param name="data"></param>
377 public void BakedTextureUploaded(UUID assetID, byte[] data) 389 public void BakedTextureUploaded(UUID assetID, byte[] data)
378 { 390 {
379 // m_log.WarnFormat("[CAPS]: Received baked texture {0}", assetID.ToString()); 391 // m_log.WarnFormat("[CAPS]: Received baked texture {0}", assetID.ToString());
@@ -687,7 +699,7 @@ namespace OpenSim.Region.ClientStack.Linden
687 item.CurrentPermissions = (uint)PermissionMask.All; 699 item.CurrentPermissions = (uint)PermissionMask.All;
688 item.BasePermissions = (uint)PermissionMask.All; 700 item.BasePermissions = (uint)PermissionMask.All;
689 item.EveryOnePermissions = 0; 701 item.EveryOnePermissions = 0;
690 item.NextPermissions = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); 702 item.NextPermissions = (uint)PermissionMask.All;
691 item.CreationDate = Util.UnixTimeSinceEpoch(); 703 item.CreationDate = Util.UnixTimeSinceEpoch();
692 704
693 if (AddNewInventoryItem != null) 705 if (AddNewInventoryItem != null)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
index 14160ae..66b865f 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCapsModule.cs
@@ -48,8 +48,8 @@ namespace OpenSim.Region.ClientStack.Linden
48 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 48 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
49 public class BunchOfCapsModule : INonSharedRegionModule 49 public class BunchOfCapsModule : INonSharedRegionModule
50 { 50 {
51 private static readonly ILog m_log = 51// private static readonly ILog m_log =
52 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 private Scene m_Scene; 54 private Scene m_Scene;
55 55
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
index e0807ee..e7bd2e7 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetMeshModule.cs
@@ -50,8 +50,8 @@ namespace OpenSim.Region.ClientStack.Linden
50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 50 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
51 public class GetMeshModule : INonSharedRegionModule 51 public class GetMeshModule : INonSharedRegionModule
52 { 52 {
53 private static readonly ILog m_log = 53// private static readonly ILog m_log =
54 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 54// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
55 55
56 private Scene m_scene; 56 private Scene m_scene;
57 private IAssetService m_AssetService; 57 private IAssetService m_AssetService;
@@ -113,12 +113,12 @@ namespace OpenSim.Region.ClientStack.Linden
113 113
114 public void RegisterCaps(UUID agentID, Caps caps) 114 public void RegisterCaps(UUID agentID, Caps caps)
115 { 115 {
116 UUID capID = UUID.Random(); 116// UUID capID = UUID.Random();
117 117
118 //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); 118 //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
119 if (m_URL == "localhost") 119 if (m_URL == "localhost")
120 { 120 {
121 m_log.InfoFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); 121// m_log.DebugFormat("[GETMESH]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
122 GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService); 122 GetMeshHandler gmeshHandler = new GetMeshHandler(m_AssetService);
123 IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), 123 IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(),
124 delegate(Hashtable m_dhttpMethod) 124 delegate(Hashtable m_dhttpMethod)
@@ -130,7 +130,7 @@ namespace OpenSim.Region.ClientStack.Linden
130 } 130 }
131 else 131 else
132 { 132 {
133 m_log.InfoFormat("[GETMESH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName); 133// m_log.DebugFormat("[GETMESH]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
134 caps.RegisterHandler("GetMesh", m_URL); 134 caps.RegisterHandler("GetMesh", m_URL);
135 } 135 }
136 } 136 }
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
index 35eedb4..fffcee2 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/GetTextureModule.cs
@@ -54,8 +54,9 @@ namespace OpenSim.Region.ClientStack.Linden
54 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 54 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
55 public class GetTextureModule : INonSharedRegionModule 55 public class GetTextureModule : INonSharedRegionModule
56 { 56 {
57 private static readonly ILog m_log = 57// private static readonly ILog m_log =
58 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 58// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
59
59 private Scene m_scene; 60 private Scene m_scene;
60 private IAssetService m_assetService; 61 private IAssetService m_assetService;
61 62
@@ -128,12 +129,12 @@ namespace OpenSim.Region.ClientStack.Linden
128 //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture)); 129 //caps.RegisterHandler("GetTexture", new StreamHandler("GET", "/CAPS/" + capID, ProcessGetTexture));
129 if (m_URL == "localhost") 130 if (m_URL == "localhost")
130 { 131 {
131 m_log.InfoFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName); 132// m_log.DebugFormat("[GETTEXTURE]: /CAPS/{0} in region {1}", capID, m_scene.RegionInfo.RegionName);
132 caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService)); 133 caps.RegisterHandler("GetTexture", new GetTextureHandler("/CAPS/" + capID + "/", m_assetService));
133 } 134 }
134 else 135 else
135 { 136 {
136 m_log.InfoFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName); 137// m_log.DebugFormat("[GETTEXTURE]: {0} in region {1}", m_URL, m_scene.RegionInfo.RegionName);
137 caps.RegisterHandler("GetTexture", m_URL); 138 caps.RegisterHandler("GetTexture", m_URL);
138 } 139 }
139 } 140 }
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs
index c9d7ae1..18c7eae 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/MeshUploadFlagModule.cs
@@ -48,8 +48,8 @@ namespace OpenSim.Region.ClientStack.Linden
48 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 48 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
49 public class MeshUploadFlagModule : INonSharedRegionModule 49 public class MeshUploadFlagModule : INonSharedRegionModule
50 { 50 {
51 private static readonly ILog m_log = 51// private static readonly ILog m_log =
52 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 52// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
53 53
54 /// <summary> 54 /// <summary>
55 /// Is this module enabled? 55 /// Is this module enabled?
@@ -124,7 +124,7 @@ namespace OpenSim.Region.ClientStack.Linden
124 124
125 private Hashtable MeshUploadFlag(Hashtable mDhttpMethod) 125 private Hashtable MeshUploadFlag(Hashtable mDhttpMethod)
126 { 126 {
127 m_log.DebugFormat("[SIMULATOR FEATURES MODULE]: MeshUploadFlag request"); 127// m_log.DebugFormat("[MESH UPLOAD FLAG MODULE]: MeshUploadFlag request");
128 128
129 OSDMap data = new OSDMap(); 129 OSDMap data = new OSDMap();
130 ScenePresence sp = m_scene.GetScenePresence(m_agentID); 130 ScenePresence sp = m_scene.GetScenePresence(m_agentID);
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
index b7e79cc..b2f04f9 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/NewFileAgentInventoryVariablePriceModule.cs
@@ -160,8 +160,6 @@ namespace OpenSim.Region.ClientStack.Linden
160 } 160 }
161 } 161 }
162 // } 162 // }
163
164
165 163
166 string assetName = llsdRequest.name; 164 string assetName = llsdRequest.name;
167 string assetDes = llsdRequest.description; 165 string assetDes = llsdRequest.description;
@@ -208,12 +206,10 @@ namespace OpenSim.Region.ClientStack.Linden
208 return uploadResponse; 206 return uploadResponse;
209 } 207 }
210 208
211
212 public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID, 209 public void UploadCompleteHandler(string assetName, string assetDescription, UUID assetID,
213 UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType, 210 UUID inventoryItem, UUID parentFolder, byte[] data, string inventoryType,
214 string assetType,UUID AgentID) 211 string assetType,UUID AgentID)
215 { 212 {
216
217 sbyte assType = 0; 213 sbyte assType = 0;
218 sbyte inType = 0; 214 sbyte inType = 0;
219 215
@@ -266,10 +262,10 @@ namespace OpenSim.Region.ClientStack.Linden
266 item.CurrentPermissions = (uint)PermissionMask.All; 262 item.CurrentPermissions = (uint)PermissionMask.All;
267 item.BasePermissions = (uint)PermissionMask.All; 263 item.BasePermissions = (uint)PermissionMask.All;
268 item.EveryOnePermissions = 0; 264 item.EveryOnePermissions = 0;
269 item.NextPermissions = (uint)(PermissionMask.Move | PermissionMask.Modify | PermissionMask.Transfer); 265 item.NextPermissions = (uint)PermissionMask.All;
270 item.CreationDate = Util.UnixTimeSinceEpoch(); 266 item.CreationDate = Util.UnixTimeSinceEpoch();
271 m_scene.AddInventoryItem(item); 267 m_scene.AddInventoryItem(item);
272 268
273 } 269 }
274 } 270 }
275} 271} \ No newline at end of file
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
index 15139a3..1c47f0e 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/ObjectAdd.cs
@@ -322,8 +322,6 @@ namespace OpenSim.Region.ClientStack.Linden
322 rootpart.NextOwnerMask = next_owner_mask; 322 rootpart.NextOwnerMask = next_owner_mask;
323 rootpart.Material = (byte)material; 323 rootpart.Material = (byte)material;
324 324
325
326
327 m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor); 325 m_scene.PhysicsScene.AddPhysicsActorTaint(rootpart.PhysActor);
328 326
329 responsedata["int_response_code"] = 200; //501; //410; //404; 327 responsedata["int_response_code"] = 200; //501; //410; //404;
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
index 15ed3b3..c07fc73 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
@@ -129,7 +129,7 @@ namespace OpenSim.Region.ClientStack.Linden
129 129
130 130
131 /// <summary> 131 /// <summary>
132 /// Parses ad request 132 /// Parses add request
133 /// </summary> 133 /// </summary>
134 /// <param name="request"></param> 134 /// <param name="request"></param>
135 /// <param name="AgentId"></param> 135 /// <param name="AgentId"></param>
@@ -312,11 +312,11 @@ namespace OpenSim.Region.ClientStack.Linden
312 primFace.RepeatV = face.ScaleT; 312 primFace.RepeatV = face.ScaleT;
313 primFace.TexMapType = (MappingType) (face.MediaFlags & 6); 313 primFace.TexMapType = (MappingType) (face.MediaFlags & 6);
314 } 314 }
315
315 pbs.TextureEntry = tmp.GetBytes(); 316 pbs.TextureEntry = tmp.GetBytes();
316 prim.Shape = pbs; 317 prim.Shape = pbs;
317 prim.Scale = obj.Scale; 318 prim.Scale = obj.Scale;
318 319
319
320 SceneObjectGroup grp = new SceneObjectGroup(); 320 SceneObjectGroup grp = new SceneObjectGroup();
321 321
322 grp.SetRootPart(prim); 322 grp.SetRootPart(prim);
@@ -330,7 +330,7 @@ namespace OpenSim.Region.ClientStack.Linden
330 grp.AbsolutePosition = obj.Position; 330 grp.AbsolutePosition = obj.Position;
331 prim.RotationOffset = obj.Rotation; 331 prim.RotationOffset = obj.Rotation;
332 332
333 grp.RootPart.IsAttachment = false; 333 grp.IsAttachment = false;
334 // Required for linking 334 // Required for linking
335 grp.RootPart.UpdateFlag = 0; 335 grp.RootPart.UpdateFlag = 0;
336 336
@@ -339,8 +339,8 @@ namespace OpenSim.Region.ClientStack.Linden
339 m_scene.AddSceneObject(grp); 339 m_scene.AddSceneObject(grp);
340 grp.AbsolutePosition = obj.Position; 340 grp.AbsolutePosition = obj.Position;
341 } 341 }
342
342 allparts[i] = grp; 343 allparts[i] = grp;
343
344 } 344 }
345 345
346 for (int j = 1; j < allparts.Length; j++) 346 for (int j = 1; j < allparts.Length; j++)
@@ -351,7 +351,9 @@ namespace OpenSim.Region.ClientStack.Linden
351 } 351 }
352 352
353 rootGroup.ScheduleGroupForFullUpdate(); 353 rootGroup.ScheduleGroupForFullUpdate();
354 pos = m_scene.GetNewRezLocation(Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale(), false); 354 pos
355 = m_scene.GetNewRezLocation(
356 Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale, false);
355 357
356 responsedata["int_response_code"] = 200; //501; //410; //404; 358 responsedata["int_response_code"] = 200; //501; //410; //404;
357 responsedata["content_type"] = "text/plain"; 359 responsedata["content_type"] = "text/plain";
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
index 9f78948..1dd8938 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs
@@ -43,21 +43,29 @@ using Caps = OpenSim.Framework.Capabilities.Caps;
43namespace OpenSim.Region.ClientStack.Linden 43namespace OpenSim.Region.ClientStack.Linden
44{ 44{
45 /// <summary> 45 /// <summary>
46 /// SimulatorFeatures capability. This is required for uploading Mesh. 46 /// SimulatorFeatures capability.
47 /// </summary>
48 /// <remarks>
49 /// This is required for uploading Mesh.
47 /// Since is accepts an open-ended response, we also send more information 50 /// Since is accepts an open-ended response, we also send more information
48 /// for viewers that care to interpret it. 51 /// for viewers that care to interpret it.
49 /// 52 ///
50 /// NOTE: Part of this code was adapted from the Aurora project, specifically 53 /// NOTE: Part of this code was adapted from the Aurora project, specifically
51 /// the normal part of the response in the capability handler. 54 /// the normal part of the response in the capability handler.
52 /// </summary> 55 /// </remarks>
53 ///
54 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 56 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
55 public class SimulatorFeaturesModule : ISharedRegionModule 57 public class SimulatorFeaturesModule : ISharedRegionModule, ISimulatorFeaturesModule
56 { 58 {
57 private static readonly ILog m_log = 59// private static readonly ILog m_log =
58 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 60// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
61
59 private Scene m_scene; 62 private Scene m_scene;
60 63
64 /// <summary>
65 /// Simulator features
66 /// </summary>
67 private OSDMap m_features = new OSDMap();
68
61 private string m_MapImageServerURL = string.Empty; 69 private string m_MapImageServerURL = string.Empty;
62 private string m_SearchURL = string.Empty; 70 private string m_SearchURL = string.Empty;
63 71
@@ -66,18 +74,20 @@ namespace OpenSim.Region.ClientStack.Linden
66 public void Initialise(IConfigSource source) 74 public void Initialise(IConfigSource source)
67 { 75 {
68 IConfig config = source.Configs["SimulatorFeatures"]; 76 IConfig config = source.Configs["SimulatorFeatures"];
69 if (config == null) 77 if (config != null)
70 return;
71
72 m_MapImageServerURL = config.GetString("MapImageServerURI", string.Empty);
73 if (m_MapImageServerURL != string.Empty)
74 { 78 {
75 m_MapImageServerURL = m_MapImageServerURL.Trim(); 79 m_MapImageServerURL = config.GetString("MapImageServerURI", string.Empty);
76 if (!m_MapImageServerURL.EndsWith("/")) 80 if (m_MapImageServerURL != string.Empty)
77 m_MapImageServerURL = m_MapImageServerURL + "/"; 81 {
82 m_MapImageServerURL = m_MapImageServerURL.Trim();
83 if (!m_MapImageServerURL.EndsWith("/"))
84 m_MapImageServerURL = m_MapImageServerURL + "/";
85 }
86
87 m_SearchURL = config.GetString("SearchServerURI", string.Empty);
78 } 88 }
79 89
80 m_SearchURL = config.GetString("SearchServerURI", string.Empty); 90 AddDefaultFeatures();
81 } 91 }
82 92
83 public void AddRegion(Scene s) 93 public void AddRegion(Scene s)
@@ -110,43 +120,83 @@ namespace OpenSim.Region.ClientStack.Linden
110 120
111 #endregion 121 #endregion
112 122
123 /// <summary>
124 /// Add default features
125 /// </summary>
126 /// <remarks>
127 /// TODO: These should be added from other modules rather than hardcoded.
128 /// </remarks>
129 private void AddDefaultFeatures()
130 {
131 lock (m_features)
132 {
133 m_features["MeshRezEnabled"] = true;
134 m_features["MeshUploadEnabled"] = true;
135 m_features["MeshXferEnabled"] = true;
136 m_features["PhysicsMaterialsEnabled"] = true;
137
138 OSDMap typesMap = new OSDMap();
139 typesMap["convex"] = true;
140 typesMap["none"] = true;
141 typesMap["prim"] = true;
142 m_features["PhysicsShapeTypes"] = typesMap;
143
144 // Extra information for viewers that want to use it
145 OSDMap gridServicesMap = new OSDMap();
146 if (m_MapImageServerURL != string.Empty)
147 gridServicesMap["map-server-url"] = m_MapImageServerURL;
148 if (m_SearchURL != string.Empty)
149 gridServicesMap["search"] = m_SearchURL;
150 m_features["GridServices"] = gridServicesMap;
151 }
152 }
153
113 public void RegisterCaps(UUID agentID, Caps caps) 154 public void RegisterCaps(UUID agentID, Caps caps)
114 { 155 {
115 IRequestHandler reqHandler = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), SimulatorFeatures); 156 IRequestHandler reqHandler
157 = new RestHTTPHandler("GET", "/CAPS/" + UUID.Random(), HandleSimulatorFeaturesRequest);
158
116 caps.RegisterHandler("SimulatorFeatures", reqHandler); 159 caps.RegisterHandler("SimulatorFeatures", reqHandler);
117 } 160 }
118 161
119 private Hashtable SimulatorFeatures(Hashtable mDhttpMethod) 162 public void AddFeature(string name, OSD value)
120 { 163 {
121 m_log.DebugFormat("[SIMULATOR FEATURES MODULE]: SimulatorFeatures request"); 164 lock (m_features)
122 OSDMap data = new OSDMap(); 165 m_features[name] = value;
123 data["MeshRezEnabled"] = true; 166 }
124 data["MeshUploadEnabled"] = true; 167
125 data["MeshXferEnabled"] = true; 168 public bool RemoveFeature(string name)
126 data["PhysicsMaterialsEnabled"] = true; 169 {
127 170 lock (m_features)
128 OSDMap typesMap = new OSDMap(); 171 return m_features.Remove(name);
129 typesMap["convex"] = true; 172 }
130 typesMap["none"] = true; 173
131 typesMap["prim"] = true; 174 public bool TryGetFeature(string name, out OSD value)
132 data["PhysicsShapeTypes"] = typesMap; 175 {
133 176 lock (m_features)
134 // Extra information for viewers that want to use it 177 return m_features.TryGetValue(name, out value);
135 OSDMap gridServicesMap = new OSDMap(); 178 }
136 if (m_MapImageServerURL != string.Empty) 179
137 gridServicesMap["map-server-url"] = m_MapImageServerURL; 180 public OSDMap GetFeatures()
138 if (m_SearchURL != string.Empty) 181 {
139 gridServicesMap["search"] = m_SearchURL; 182 lock (m_features)
140 data["GridServices"] = gridServicesMap; 183 return new OSDMap(m_features);
184 }
185
186 private Hashtable HandleSimulatorFeaturesRequest(Hashtable mDhttpMethod)
187 {
188// m_log.DebugFormat("[SIMULATOR FEATURES MODULE]: SimulatorFeatures request");
141 189
142 //Send back data 190 //Send back data
143 Hashtable responsedata = new Hashtable(); 191 Hashtable responsedata = new Hashtable();
144 responsedata["int_response_code"] = 200; 192 responsedata["int_response_code"] = 200;
145 responsedata["content_type"] = "text/plain"; 193 responsedata["content_type"] = "text/plain";
146 responsedata["keepalive"] = false; 194 responsedata["keepalive"] = false;
147 responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(data); 195
196 lock (m_features)
197 responsedata["str_response_string"] = OSDParser.SerializeLLSDXmlString(m_features);
198
148 return responsedata; 199 return responsedata;
149 } 200 }
150
151 } 201 }
152} 202}
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index d5419cc..5c94fba 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
90 public event ObjectAttach OnObjectAttach; 90 public event ObjectAttach OnObjectAttach;
91 public event ObjectDeselect OnObjectDetach; 91 public event ObjectDeselect OnObjectDetach;
92 public event ObjectDrop OnObjectDrop; 92 public event ObjectDrop OnObjectDrop;
93 public event GenericCall1 OnCompleteMovementToRegion; 93 public event Action<IClientAPI, bool> OnCompleteMovementToRegion;
94 public event UpdateAgent OnPreAgentUpdate; 94 public event UpdateAgent OnPreAgentUpdate;
95 public event UpdateAgent OnAgentUpdate; 95 public event UpdateAgent OnAgentUpdate;
96 public event AgentRequestSit OnAgentRequestSit; 96 public event AgentRequestSit OnAgentRequestSit;
@@ -232,7 +232,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
232 public event ScriptReset OnScriptReset; 232 public event ScriptReset OnScriptReset;
233 public event GetScriptRunning OnGetScriptRunning; 233 public event GetScriptRunning OnGetScriptRunning;
234 public event SetScriptRunning OnSetScriptRunning; 234 public event SetScriptRunning OnSetScriptRunning;
235 public event UpdateVector OnAutoPilotGo; 235 public event Action<Vector3, bool> OnAutoPilotGo;
236 public event TerrainUnacked OnUnackedTerrain; 236 public event TerrainUnacked OnUnackedTerrain;
237 public event ActivateGesture OnActivateGesture; 237 public event ActivateGesture OnActivateGesture;
238 public event DeactivateGesture OnDeactivateGesture; 238 public event DeactivateGesture OnDeactivateGesture;
@@ -534,7 +534,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
534 m_udpServer.Flush(m_udpClient); 534 m_udpServer.Flush(m_udpClient);
535 535
536 // Remove ourselves from the scene 536 // Remove ourselves from the scene
537 m_scene.RemoveClient(AgentId); 537 m_scene.RemoveClient(AgentId, true);
538 538
539 // We can't reach into other scenes and close the connection 539 // We can't reach into other scenes and close the connection
540 // We need to do this over grid communications 540 // We need to do this over grid communications
@@ -596,22 +596,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP
596 return result; 596 return result;
597 } 597 }
598 598
599 /// <summary>
600 /// Add a handler for the given packet type.
601 /// </summary>
602 /// <remarks>The packet is handled on its own thread. If packets must be handled in the order in which thye
603 /// are received then please us ethe synchronous version of this method.</remarks>
604 /// <param name="packetType"></param>
605 /// <param name="handler"></param>
606 /// <returns>true if the handler was added. This is currently always the case.</returns>
599 public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler) 607 public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler)
600 { 608 {
601 return AddLocalPacketHandler(packetType, handler, true); 609 return AddLocalPacketHandler(packetType, handler, true);
602 } 610 }
603 611
604 public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool async) 612 /// <summary>
613 /// Add a handler for the given packet type.
614 /// </summary>
615 /// <param name="packetType"></param>
616 /// <param name="handler"></param>
617 /// <param name="doAsync">
618 /// If true, when the packet is received it is handled on its own thread rather than on the main inward bound
619 /// packet handler thread. This vastly increases respnosiveness but some packets need to be handled
620 /// synchronously.
621 /// </param>
622 /// <returns>true if the handler was added. This is currently always the case.</returns>
623 public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync)
605 { 624 {
606 bool result = false; 625 bool result = false;
607 lock (m_packetHandlers) 626 lock (m_packetHandlers)
608 { 627 {
609 if (!m_packetHandlers.ContainsKey(packetType)) 628 if (!m_packetHandlers.ContainsKey(packetType))
610 { 629 {
611 m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = async }); 630 m_packetHandlers.Add(packetType, new PacketProcessor() { method = handler, Async = doAsync });
612 result = true; 631 result = true;
613 } 632 }
614 } 633 }
634
615 return result; 635 return result;
616 } 636 }
617 637
@@ -694,7 +714,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
694 714
695 public virtual void Start() 715 public virtual void Start()
696 { 716 {
697 m_scene.AddNewClient(this); 717 m_scene.AddNewClient(this, PresenceType.User);
698 718
699 RefreshGroupMembership(); 719 RefreshGroupMembership();
700 } 720 }
@@ -4800,7 +4820,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4800 { 4820 {
4801 SceneObjectPart part = (SceneObjectPart)entity; 4821 SceneObjectPart part = (SceneObjectPart)entity;
4802 4822
4803 attachPoint = part.AttachmentPoint; 4823 attachPoint = part.ParentGroup.AttachmentPoint;
4824
4825// m_log.DebugFormat(
4826// "[LLCLIENTVIEW]: Sending attachPoint {0} for {1} {2} to {3}",
4827// attachPoint, part.Name, part.LocalId, Name);
4828
4804 collisionPlane = Vector4.Zero; 4829 collisionPlane = Vector4.Zero;
4805 position = part.RelativePosition; 4830 position = part.RelativePosition;
4806 velocity = part.Velocity; 4831 velocity = part.Velocity;
@@ -4957,17 +4982,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4957 //update.JointType = 0; 4982 //update.JointType = 0;
4958 update.Material = data.Material; 4983 update.Material = data.Material;
4959 update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim 4984 update.MediaURL = Utils.EmptyBytes; // FIXME: Support this in OpenSim
4960 if (data.IsAttachment) 4985 if (data.ParentGroup.IsAttachment)
4961 { 4986 {
4962 update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.FromItemID); 4987 update.NameValue = Util.StringToBytes256("AttachItemID STRING RW SV " + data.FromItemID);
4963 update.State = (byte)((data.AttachmentPoint % 16) * 16 + (data.AttachmentPoint / 16)); 4988 update.State = (byte)((data.ParentGroup.AttachmentPoint % 16) * 16 + (data.ParentGroup.AttachmentPoint / 16));
4964 } 4989 }
4965 else 4990 else
4966 { 4991 {
4967 update.NameValue = Utils.EmptyBytes; 4992 update.NameValue = Utils.EmptyBytes;
4968 update.State = data.Shape.State; 4993
4994 // The root part state is the canonical state for all parts of the object. The other part states in the
4995 // case for attachments may contain conflicting values that can end up crashing the viewer.
4996 update.State = data.ParentGroup.RootPart.Shape.State;
4969 } 4997 }
4970 4998
4999// m_log.DebugFormat(
5000// "[LLCLIENTVIEW]: Sending state {0} for {1} {2} to {3}",
5001// update.State, data.Name, data.LocalId, Name);
5002
4971 update.ObjectData = objectData; 5003 update.ObjectData = objectData;
4972 update.ParentID = data.ParentID; 5004 update.ParentID = data.ParentID;
4973 update.PathBegin = data.Shape.PathBegin; 5005 update.PathBegin = data.Shape.PathBegin;
@@ -5311,6 +5343,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5311 AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest); 5343 AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest);
5312 AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes); 5344 AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes);
5313 AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard); 5345 AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard);
5346
5347 AddGenericPacketHandler("autopilot", HandleAutopilot);
5314 } 5348 }
5315 5349
5316 #region Packet Handlers 5350 #region Packet Handlers
@@ -5354,7 +5388,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5354 ); 5388 );
5355 } 5389 }
5356 else 5390 else
5391 {
5357 update = true; 5392 update = true;
5393 }
5358 5394
5359 // These should be ordered from most-likely to 5395 // These should be ordered from most-likely to
5360 // least likely to change. I've made an initial 5396 // least likely to change. I've made an initial
@@ -5362,6 +5398,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5362 5398
5363 if (update) 5399 if (update)
5364 { 5400 {
5401// m_log.DebugFormat("[LLCLIENTVIEW]: Triggered AgentUpdate for {0}", sener.Name);
5402
5365 AgentUpdateArgs arg = new AgentUpdateArgs(); 5403 AgentUpdateArgs arg = new AgentUpdateArgs();
5366 arg.AgentID = x.AgentID; 5404 arg.AgentID = x.AgentID;
5367 arg.BodyRotation = x.BodyRotation; 5405 arg.BodyRotation = x.BodyRotation;
@@ -6235,10 +6273,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6235 6273
6236 private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) 6274 private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack)
6237 { 6275 {
6238 GenericCall1 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; 6276 Action<IClientAPI, bool> handlerCompleteMovementToRegion = OnCompleteMovementToRegion;
6239 if (handlerCompleteMovementToRegion != null) 6277 if (handlerCompleteMovementToRegion != null)
6240 { 6278 {
6241 handlerCompleteMovementToRegion(sender); 6279 handlerCompleteMovementToRegion(sender, true);
6242 } 6280 }
6243 handlerCompleteMovementToRegion = null; 6281 handlerCompleteMovementToRegion = null;
6244 6282
@@ -11316,8 +11354,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11316 protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet) 11354 protected bool HandleMultipleObjUpdate(IClientAPI simClient, Packet packet)
11317 { 11355 {
11318 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; 11356 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet;
11319 if (multipleupdate.AgentData.SessionID != SessionId) return false; 11357
11320 // m_log.Debug("new multi update packet " + multipleupdate.ToString()); 11358 if (multipleupdate.AgentData.SessionID != SessionId)
11359 return false;
11360
11361// m_log.DebugFormat(
11362// "[CLIENT]: Incoming MultipleObjectUpdatePacket contained {0} blocks", multipleupdate.ObjectData.Length);
11363
11321 Scene tScene = (Scene)m_scene; 11364 Scene tScene = (Scene)m_scene;
11322 11365
11323 for (int i = 0; i < multipleupdate.ObjectData.Length; i++) 11366 for (int i = 0; i < multipleupdate.ObjectData.Length; i++)
@@ -11338,7 +11381,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11338 } 11381 }
11339 else 11382 else
11340 { 11383 {
11341 // UUID partId = part.UUID; 11384// m_log.DebugFormat(
11385// "[CLIENT]: Processing block {0} type {1} for {2} {3}",
11386// i, block.Type, part.Name, part.LocalId);
11387
11388// // Do this once since fetch parts creates a new array.
11389// SceneObjectPart[] parts = part.ParentGroup.Parts;
11390// for (int j = 0; j < parts.Length; j++)
11391// {
11392// part.StoreUndoState();
11393// parts[j].IgnoreUndoUpdate = true;
11394// }
11395
11342 UpdatePrimGroupRotation handlerUpdatePrimGroupRotation; 11396 UpdatePrimGroupRotation handlerUpdatePrimGroupRotation;
11343 11397
11344 switch (block.Type) 11398 switch (block.Type)
@@ -11353,6 +11407,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11353 handlerUpdatePrimSinglePosition(localId, pos1, this); 11407 handlerUpdatePrimSinglePosition(localId, pos1, this);
11354 } 11408 }
11355 break; 11409 break;
11410
11356 case 2: 11411 case 2:
11357 Quaternion rot1 = new Quaternion(block.Data, 0, true); 11412 Quaternion rot1 = new Quaternion(block.Data, 0, true);
11358 11413
@@ -11363,6 +11418,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11363 handlerUpdatePrimSingleRotation(localId, rot1, this); 11418 handlerUpdatePrimSingleRotation(localId, rot1, this);
11364 } 11419 }
11365 break; 11420 break;
11421
11366 case 3: 11422 case 3:
11367 Vector3 rotPos = new Vector3(block.Data, 0); 11423 Vector3 rotPos = new Vector3(block.Data, 0);
11368 Quaternion rot2 = new Quaternion(block.Data, 12, true); 11424 Quaternion rot2 = new Quaternion(block.Data, 12, true);
@@ -11375,6 +11431,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11375 handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this); 11431 handlerUpdatePrimSingleRotationPosition(localId, rot2, rotPos, this);
11376 } 11432 }
11377 break; 11433 break;
11434
11378 case 4: 11435 case 4:
11379 case 20: 11436 case 20:
11380 Vector3 scale4 = new Vector3(block.Data, 0); 11437 Vector3 scale4 = new Vector3(block.Data, 0);
@@ -11386,8 +11443,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11386 handlerUpdatePrimScale(localId, scale4, this); 11443 handlerUpdatePrimScale(localId, scale4, this);
11387 } 11444 }
11388 break; 11445 break;
11389 case 5:
11390 11446
11447 case 5:
11391 Vector3 scale1 = new Vector3(block.Data, 12); 11448 Vector3 scale1 = new Vector3(block.Data, 12);
11392 Vector3 pos11 = new Vector3(block.Data, 0); 11449 Vector3 pos11 = new Vector3(block.Data, 0);
11393 11450
@@ -11404,6 +11461,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11404 } 11461 }
11405 } 11462 }
11406 break; 11463 break;
11464
11407 case 9: 11465 case 9:
11408 Vector3 pos2 = new Vector3(block.Data, 0); 11466 Vector3 pos2 = new Vector3(block.Data, 0);
11409 11467
@@ -11411,10 +11469,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11411 11469
11412 if (handlerUpdateVector != null) 11470 if (handlerUpdateVector != null)
11413 { 11471 {
11414
11415 handlerUpdateVector(localId, pos2, this); 11472 handlerUpdateVector(localId, pos2, this);
11416 } 11473 }
11417 break; 11474 break;
11475
11418 case 10: 11476 case 10:
11419 Quaternion rot3 = new Quaternion(block.Data, 0, true); 11477 Quaternion rot3 = new Quaternion(block.Data, 0, true);
11420 11478
@@ -11425,6 +11483,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11425 handlerUpdatePrimRotation(localId, rot3, this); 11483 handlerUpdatePrimRotation(localId, rot3, this);
11426 } 11484 }
11427 break; 11485 break;
11486
11428 case 11: 11487 case 11:
11429 Vector3 pos3 = new Vector3(block.Data, 0); 11488 Vector3 pos3 = new Vector3(block.Data, 0);
11430 Quaternion rot4 = new Quaternion(block.Data, 12, true); 11489 Quaternion rot4 = new Quaternion(block.Data, 12, true);
@@ -11448,6 +11507,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11448 handlerUpdatePrimGroupScale(localId, scale7, this); 11507 handlerUpdatePrimGroupScale(localId, scale7, this);
11449 } 11508 }
11450 break; 11509 break;
11510
11451 case 13: 11511 case 13:
11452 Vector3 scale2 = new Vector3(block.Data, 12); 11512 Vector3 scale2 = new Vector3(block.Data, 12);
11453 Vector3 pos4 = new Vector3(block.Data, 0); 11513 Vector3 pos4 = new Vector3(block.Data, 0);
@@ -11467,6 +11527,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11467 } 11527 }
11468 } 11528 }
11469 break; 11529 break;
11530
11470 case 29: 11531 case 29:
11471 Vector3 scale5 = new Vector3(block.Data, 12); 11532 Vector3 scale5 = new Vector3(block.Data, 12);
11472 Vector3 pos5 = new Vector3(block.Data, 0); 11533 Vector3 pos5 = new Vector3(block.Data, 0);
@@ -11475,6 +11536,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11475 if (handlerUpdatePrimGroupScale != null) 11536 if (handlerUpdatePrimGroupScale != null)
11476 { 11537 {
11477 // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); 11538 // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
11539 part.StoreUndoState(true);
11540 part.IgnoreUndoUpdate = true;
11478 handlerUpdatePrimGroupScale(localId, scale5, this); 11541 handlerUpdatePrimGroupScale(localId, scale5, this);
11479 handlerUpdateVector = OnUpdatePrimGroupPosition; 11542 handlerUpdateVector = OnUpdatePrimGroupPosition;
11480 11543
@@ -11482,8 +11545,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11482 { 11545 {
11483 handlerUpdateVector(localId, pos5, this); 11546 handlerUpdateVector(localId, pos5, this);
11484 } 11547 }
11548
11549 part.IgnoreUndoUpdate = false;
11485 } 11550 }
11551
11486 break; 11552 break;
11553
11487 case 21: 11554 case 21:
11488 Vector3 scale6 = new Vector3(block.Data, 12); 11555 Vector3 scale6 = new Vector3(block.Data, 12);
11489 Vector3 pos6 = new Vector3(block.Data, 0); 11556 Vector3 pos6 = new Vector3(block.Data, 0);
@@ -11491,6 +11558,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11491 handlerUpdatePrimScale = OnUpdatePrimScale; 11558 handlerUpdatePrimScale = OnUpdatePrimScale;
11492 if (handlerUpdatePrimScale != null) 11559 if (handlerUpdatePrimScale != null)
11493 { 11560 {
11561 part.StoreUndoState(false);
11562 part.IgnoreUndoUpdate = true;
11563
11494 // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); 11564 // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z);
11495 handlerUpdatePrimScale(localId, scale6, this); 11565 handlerUpdatePrimScale(localId, scale6, this);
11496 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; 11566 handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition;
@@ -11498,15 +11568,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11498 { 11568 {
11499 handlerUpdatePrimSinglePosition(localId, pos6, this); 11569 handlerUpdatePrimSinglePosition(localId, pos6, this);
11500 } 11570 }
11571
11572 part.IgnoreUndoUpdate = false;
11501 } 11573 }
11502 break; 11574 break;
11575
11503 default: 11576 default:
11504 m_log.Debug("[CLIENT] MultipleObjUpdate recieved an unknown packet type: " + (block.Type)); 11577 m_log.Debug("[CLIENT]: MultipleObjUpdate recieved an unknown packet type: " + (block.Type));
11505 break; 11578 break;
11506 } 11579 }
11580
11581// for (int j = 0; j < parts.Length; j++)
11582// parts[j].IgnoreUndoUpdate = false;
11507 } 11583 }
11508 } 11584 }
11509 } 11585 }
11586
11510 return true; 11587 return true;
11511 } 11588 }
11512 11589
@@ -11666,55 +11743,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11666 return false; 11743 return false;
11667 } 11744 }
11668 11745
11669 /// <summary> 11746 protected void HandleAutopilot(Object sender, string method, List<String> args)
11670 /// Breaks down the genericMessagePacket into specific events
11671 /// </summary>
11672 /// <param name="gmMethod"></param>
11673 /// <param name="gmInvoice"></param>
11674 /// <param name="gmParams"></param>
11675 public void DecipherGenericMessage(string gmMethod, UUID gmInvoice, GenericMessagePacket.ParamListBlock[] gmParams)
11676 { 11747 {
11677 switch (gmMethod) 11748 float locx = 0;
11678 { 11749 float locy = 0;
11679 case "autopilot": 11750 float locz = 0;
11680 float locx; 11751 uint regionX = 0;
11681 float locy; 11752 uint regionY = 0;
11682 float locz;
11683
11684 try
11685 {
11686 uint regionX;
11687 uint regionY;
11688 Utils.LongToUInts(Scene.RegionInfo.RegionHandle, out regionX, out regionY);
11689 locx = Convert.ToSingle(Utils.BytesToString(gmParams[0].Parameter)) - regionX;
11690 locy = Convert.ToSingle(Utils.BytesToString(gmParams[1].Parameter)) - regionY;
11691 locz = Convert.ToSingle(Utils.BytesToString(gmParams[2].Parameter));
11692 }
11693 catch (InvalidCastException)
11694 {
11695 m_log.Error("[CLIENT]: Invalid autopilot request");
11696 return;
11697 }
11698
11699 UpdateVector handlerAutoPilotGo = OnAutoPilotGo;
11700 if (handlerAutoPilotGo != null)
11701 {
11702 handlerAutoPilotGo(0, new Vector3(locx, locy, locz), this);
11703 }
11704 m_log.InfoFormat("[CLIENT]: Client Requests autopilot to position <{0},{1},{2}>", locx, locy, locz);
11705 11753
11754 Utils.LongToUInts(m_scene.RegionInfo.RegionHandle, out regionX, out regionY);
11755 locx = Convert.ToSingle(args[0]) - (float)regionX;
11756 locy = Convert.ToSingle(args[1]) - (float)regionY;
11757 locz = Convert.ToSingle(args[2]);
11706 11758
11707 break; 11759 Action<Vector3, bool> handlerAutoPilotGo = OnAutoPilotGo;
11708 default: 11760 if (handlerAutoPilotGo != null)
11709 m_log.Debug("[CLIENT]: Unknown Generic Message, Method: " + gmMethod + ". Invoice: " + gmInvoice + ". Dumping Params:"); 11761 handlerAutoPilotGo(new Vector3(locx, locy, locz), false);
11710 for (int hi = 0; hi < gmParams.Length; hi++)
11711 {
11712 Console.WriteLine(gmParams[hi].ToString());
11713 }
11714 //gmpack.MethodData.
11715 break;
11716
11717 }
11718 } 11762 }
11719 11763
11720 /// <summary> 11764 /// <summary>
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
index 29fd1a4..4c33db5 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 private static Int32 m_counter = 0; 45 private static Int32 m_counter = 0;
46 46
47 private Int32 m_identifier; 47// private Int32 m_identifier;
48 48
49 /// <summary> 49 /// <summary>
50 /// Number of ticks (ms) per quantum, drip rate and max burst 50 /// Number of ticks (ms) per quantum, drip rate and max burst
@@ -173,7 +173,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
173 /// second. If zero, the bucket always remains full</param> 173 /// second. If zero, the bucket always remains full</param>
174 public TokenBucket(TokenBucket parent, Int64 dripRate) 174 public TokenBucket(TokenBucket parent, Int64 dripRate)
175 { 175 {
176 m_identifier = m_counter++; 176// m_identifier = m_counter++;
177 m_counter++;
177 178
178 Parent = parent; 179 Parent = parent;
179 RequestedDripRate = dripRate; 180 RequestedDripRate = dripRate;
@@ -320,7 +321,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
320 321
321 public class AdaptiveTokenBucket : TokenBucket 322 public class AdaptiveTokenBucket : TokenBucket
322 { 323 {
323 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 324// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
324 325
325 /// <summary> 326 /// <summary>
326 /// The minimum rate for flow control. Minimum drip rate is one 327 /// The minimum rate for flow control. Minimum drip rate is one