diff options
Diffstat (limited to '')
58 files changed, 1187 insertions, 2753 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index e57aaa0..7e4a8e8 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -58,12 +58,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
58 | { | 58 | { |
59 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 59 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
60 | 60 | ||
61 | private static bool daload = false; | 61 | private static bool m_defaultAvatarsLoaded = false; |
62 | private static Object rslock = new Object(); | 62 | private static Object m_requestLock = new Object(); |
63 | private static Object SOLock = new Object(); | 63 | private static Object m_saveOarLock = new Object(); |
64 | 64 | ||
65 | private OpenSimBase m_app; | 65 | private OpenSimBase m_application; |
66 | private IHttpServer m_httpd; | 66 | private IHttpServer m_httpServer; |
67 | private IConfig m_config; | 67 | private IConfig m_config; |
68 | private IConfigSource m_configSource; | 68 | private IConfigSource m_configSource; |
69 | private string m_requiredPassword = String.Empty; | 69 | private string m_requiredPassword = String.Empty; |
@@ -115,8 +115,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
115 | m_requiredPassword = m_config.GetString("access_password", String.Empty); | 115 | m_requiredPassword = m_config.GetString("access_password", String.Empty); |
116 | int port = m_config.GetInt("port", 0); | 116 | int port = m_config.GetInt("port", 0); |
117 | 117 | ||
118 | m_app = openSim; | 118 | m_application = openSim; |
119 | m_httpd = MainServer.GetHttpServer((uint)port); | 119 | m_httpServer = MainServer.GetHttpServer((uint)port); |
120 | 120 | ||
121 | Dictionary<string, XmlRpcMethod> availableMethods = new Dictionary<string, XmlRpcMethod>(); | 121 | Dictionary<string, XmlRpcMethod> availableMethods = new Dictionary<string, XmlRpcMethod>(); |
122 | availableMethods["admin_create_region"] = XmlRpcCreateRegionMethod; | 122 | availableMethods["admin_create_region"] = XmlRpcCreateRegionMethod; |
@@ -160,14 +160,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
160 | { | 160 | { |
161 | foreach (string method in availableMethods.Keys) | 161 | foreach (string method in availableMethods.Keys) |
162 | { | 162 | { |
163 | m_httpd.AddXmlRPCHandler(method, availableMethods[method], false); | 163 | m_httpServer.AddXmlRPCHandler(method, availableMethods[method], false); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | else | 166 | else |
167 | { | 167 | { |
168 | foreach (string enabledMethod in enabledMethods.Split('|')) | 168 | foreach (string enabledMethod in enabledMethods.Split('|')) |
169 | { | 169 | { |
170 | m_httpd.AddXmlRPCHandler(enabledMethod, availableMethods[enabledMethod]); | 170 | m_httpServer.AddXmlRPCHandler(enabledMethod, availableMethods[enabledMethod]); |
171 | } | 171 | } |
172 | } | 172 | } |
173 | } | 173 | } |
@@ -180,7 +180,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
180 | 180 | ||
181 | public void PostInitialise() | 181 | public void PostInitialise() |
182 | { | 182 | { |
183 | if (!createDefaultAvatars()) | 183 | if (!CreateDefaultAvatars()) |
184 | { | 184 | { |
185 | m_log.Info("[RADMIN]: Default avatars not loaded"); | 185 | m_log.Info("[RADMIN]: Default avatars not loaded"); |
186 | } | 186 | } |
@@ -196,7 +196,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
196 | Hashtable requestData = (Hashtable) request.Params[0]; | 196 | Hashtable requestData = (Hashtable) request.Params[0]; |
197 | 197 | ||
198 | m_log.Info("[RADMIN]: Request to restart Region."); | 198 | m_log.Info("[RADMIN]: Request to restart Region."); |
199 | checkStringParameters(request, new string[] {"password", "regionID"}); | 199 | CheckStringParameters(request, new string[] {"password", "regionID"}); |
200 | 200 | ||
201 | if (m_requiredPassword != String.Empty && | 201 | if (m_requiredPassword != String.Empty && |
202 | (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) | 202 | (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) |
@@ -212,7 +212,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
212 | 212 | ||
213 | Scene rebootedScene; | 213 | Scene rebootedScene; |
214 | 214 | ||
215 | if (!m_app.SceneManager.TryGetScene(regionID, out rebootedScene)) | 215 | if (!m_application.SceneManager.TryGetScene(regionID, out rebootedScene)) |
216 | throw new Exception("region not found"); | 216 | throw new Exception("region not found"); |
217 | 217 | ||
218 | responseData["rebooting"] = true; | 218 | responseData["rebooting"] = true; |
@@ -245,7 +245,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
245 | { | 245 | { |
246 | Hashtable requestData = (Hashtable) request.Params[0]; | 246 | Hashtable requestData = (Hashtable) request.Params[0]; |
247 | 247 | ||
248 | checkStringParameters(request, new string[] {"password", "message"}); | 248 | CheckStringParameters(request, new string[] {"password", "message"}); |
249 | 249 | ||
250 | if (m_requiredPassword != String.Empty && | 250 | if (m_requiredPassword != String.Empty && |
251 | (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) | 251 | (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) |
@@ -258,7 +258,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
258 | responseData["success"] = true; | 258 | responseData["success"] = true; |
259 | response.Value = responseData; | 259 | response.Value = responseData; |
260 | 260 | ||
261 | m_app.SceneManager.ForEachScene( | 261 | m_application.SceneManager.ForEachScene( |
262 | delegate(Scene scene) | 262 | delegate(Scene scene) |
263 | { | 263 | { |
264 | IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>(); | 264 | IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>(); |
@@ -299,7 +299,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
299 | // k, (string)requestData[k], ((string)requestData[k]).Length); | 299 | // k, (string)requestData[k], ((string)requestData[k]).Length); |
300 | // } | 300 | // } |
301 | 301 | ||
302 | checkStringParameters(request, new string[] {"password", "filename", "regionid"}); | 302 | CheckStringParameters(request, new string[] {"password", "filename", "regionid"}); |
303 | 303 | ||
304 | if (m_requiredPassword != String.Empty && | 304 | if (m_requiredPassword != String.Empty && |
305 | (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) | 305 | (!requestData.Contains("password") || (string) requestData["password"] != m_requiredPassword)) |
@@ -313,7 +313,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
313 | 313 | ||
314 | Scene region = null; | 314 | Scene region = null; |
315 | 315 | ||
316 | if (!m_app.SceneManager.TryGetScene(regionID, out region)) | 316 | if (!m_application.SceneManager.TryGetScene(regionID, out region)) |
317 | throw new Exception("1: unable to get a scene with that name"); | 317 | throw new Exception("1: unable to get a scene with that name"); |
318 | 318 | ||
319 | ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); | 319 | ITerrainModule terrainModule = region.RequestModuleInterface<ITerrainModule>(); |
@@ -387,7 +387,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
387 | message = "Region is going down now."; | 387 | message = "Region is going down now."; |
388 | } | 388 | } |
389 | 389 | ||
390 | m_app.SceneManager.ForEachScene( | 390 | m_application.SceneManager.ForEachScene( |
391 | delegate(Scene scene) | 391 | delegate(Scene scene) |
392 | { | 392 | { |
393 | IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>(); | 393 | IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>(); |
@@ -422,7 +422,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
422 | 422 | ||
423 | private void shutdownTimer_Elapsed(object sender, ElapsedEventArgs e) | 423 | private void shutdownTimer_Elapsed(object sender, ElapsedEventArgs e) |
424 | { | 424 | { |
425 | m_app.Shutdown(); | 425 | m_application.Shutdown(); |
426 | } | 426 | } |
427 | 427 | ||
428 | /// <summary> | 428 | /// <summary> |
@@ -489,7 +489,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
489 | XmlRpcResponse response = new XmlRpcResponse(); | 489 | XmlRpcResponse response = new XmlRpcResponse(); |
490 | Hashtable responseData = new Hashtable(); | 490 | Hashtable responseData = new Hashtable(); |
491 | 491 | ||
492 | lock (rslock) | 492 | lock (m_requestLock) |
493 | { | 493 | { |
494 | int m_regionLimit = m_config.GetInt("region_limit", 0); | 494 | int m_regionLimit = m_config.GetInt("region_limit", 0); |
495 | bool m_enableVoiceForNewRegions = m_config.GetBoolean("create_region_enable_voice", false); | 495 | bool m_enableVoiceForNewRegions = m_config.GetBoolean("create_region_enable_voice", false); |
@@ -499,7 +499,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
499 | { | 499 | { |
500 | Hashtable requestData = (Hashtable) request.Params[0]; | 500 | Hashtable requestData = (Hashtable) request.Params[0]; |
501 | 501 | ||
502 | checkStringParameters(request, new string[] | 502 | CheckStringParameters(request, new string[] |
503 | { | 503 | { |
504 | "password", | 504 | "password", |
505 | "region_name", | 505 | "region_name", |
@@ -507,14 +507,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
507 | "region_master_password", | 507 | "region_master_password", |
508 | "listen_ip", "external_address" | 508 | "listen_ip", "external_address" |
509 | }); | 509 | }); |
510 | checkIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"}); | 510 | CheckIntegerParams(request, new string[] {"region_x", "region_y", "listen_port"}); |
511 | 511 | ||
512 | // check password | 512 | // check password |
513 | if (!String.IsNullOrEmpty(m_requiredPassword) && | 513 | if (!String.IsNullOrEmpty(m_requiredPassword) && |
514 | (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); | 514 | (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); |
515 | 515 | ||
516 | // check whether we still have space left (iff we are using limits) | 516 | // check whether we still have space left (iff we are using limits) |
517 | if (m_regionLimit != 0 && m_app.SceneManager.Scenes.Count >= m_regionLimit) | 517 | if (m_regionLimit != 0 && m_application.SceneManager.Scenes.Count >= m_regionLimit) |
518 | throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first", | 518 | throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first", |
519 | m_regionLimit)); | 519 | m_regionLimit)); |
520 | // extract or generate region ID now | 520 | // extract or generate region ID now |
@@ -524,7 +524,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
524 | !String.IsNullOrEmpty((string) requestData["region_id"])) | 524 | !String.IsNullOrEmpty((string) requestData["region_id"])) |
525 | { | 525 | { |
526 | regionID = (UUID) (string) requestData["region_id"]; | 526 | regionID = (UUID) (string) requestData["region_id"]; |
527 | if (m_app.SceneManager.TryGetScene(regionID, out scene)) | 527 | if (m_application.SceneManager.TryGetScene(regionID, out scene)) |
528 | throw new Exception( | 528 | throw new Exception( |
529 | String.Format("region UUID already in use by region {0}, UUID {1}, <{2},{3}>", | 529 | String.Format("region UUID already in use by region {0}, UUID {1}, <{2},{3}>", |
530 | scene.RegionInfo.RegionName, scene.RegionInfo.RegionID, | 530 | scene.RegionInfo.RegionName, scene.RegionInfo.RegionID, |
@@ -547,13 +547,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
547 | 547 | ||
548 | // check for collisions: region name, region UUID, | 548 | // check for collisions: region name, region UUID, |
549 | // region location | 549 | // region location |
550 | if (m_app.SceneManager.TryGetScene(region.RegionName, out scene)) | 550 | if (m_application.SceneManager.TryGetScene(region.RegionName, out scene)) |
551 | throw new Exception( | 551 | throw new Exception( |
552 | String.Format("region name already in use by region {0}, UUID {1}, <{2},{3}>", | 552 | String.Format("region name already in use by region {0}, UUID {1}, <{2},{3}>", |
553 | scene.RegionInfo.RegionName, scene.RegionInfo.RegionID, | 553 | scene.RegionInfo.RegionName, scene.RegionInfo.RegionID, |
554 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY)); | 554 | scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY)); |
555 | 555 | ||
556 | if (m_app.SceneManager.TryGetScene(region.RegionLocX, region.RegionLocY, out scene)) | 556 | if (m_application.SceneManager.TryGetScene(region.RegionLocX, region.RegionLocY, out scene)) |
557 | throw new Exception( | 557 | throw new Exception( |
558 | String.Format("region location <{0},{1}> already in use by region {2}, UUID {3}, <{4},{5}>", | 558 | String.Format("region location <{0},{1}> already in use by region {2}, UUID {3}, <{4},{5}>", |
559 | region.RegionLocX, region.RegionLocY, | 559 | region.RegionLocX, region.RegionLocY, |
@@ -565,7 +565,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
565 | 565 | ||
566 | region.InternalEndPoint.Port = Convert.ToInt32(requestData["listen_port"]); | 566 | region.InternalEndPoint.Port = Convert.ToInt32(requestData["listen_port"]); |
567 | if (0 == region.InternalEndPoint.Port) throw new Exception("listen_port is 0"); | 567 | if (0 == region.InternalEndPoint.Port) throw new Exception("listen_port is 0"); |
568 | if (m_app.SceneManager.TryGetScene(region.InternalEndPoint, out scene)) | 568 | if (m_application.SceneManager.TryGetScene(region.InternalEndPoint, out scene)) |
569 | throw new Exception( | 569 | throw new Exception( |
570 | String.Format( | 570 | String.Format( |
571 | "region internal IP {0} and port {1} already in use by region {2}, UUID {3}, <{4},{5}>", | 571 | "region internal IP {0} and port {1} already in use by region {2}, UUID {3}, <{4},{5}>", |
@@ -625,28 +625,28 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
625 | 625 | ||
626 | // Create the region and perform any initial initialization | 626 | // Create the region and perform any initial initialization |
627 | 627 | ||
628 | IScene newscene; | 628 | IScene newScene; |
629 | m_app.CreateRegion(region, out newscene); | 629 | m_application.CreateRegion(region, out newScene); |
630 | 630 | ||
631 | // If an access specification was provided, use it. | 631 | // If an access specification was provided, use it. |
632 | // Otherwise accept the default. | 632 | // Otherwise accept the default. |
633 | newscene.RegionInfo.EstateSettings.PublicAccess = getBoolean(requestData, "public", m_publicAccess); | 633 | newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess); |
634 | newscene.RegionInfo.EstateSettings.EstateOwner = userID; | 634 | newScene.RegionInfo.EstateSettings.EstateOwner = userID; |
635 | if (persist) | 635 | if (persist) |
636 | newscene.RegionInfo.EstateSettings.Save(); | 636 | newScene.RegionInfo.EstateSettings.Save(); |
637 | 637 | ||
638 | // enable voice on newly created region if | 638 | // enable voice on newly created region if |
639 | // requested by either the XmlRpc request or the | 639 | // requested by either the XmlRpc request or the |
640 | // configuration | 640 | // configuration |
641 | if (getBoolean(requestData, "enable_voice", m_enableVoiceForNewRegions)) | 641 | if (GetBoolean(requestData, "enable_voice", m_enableVoiceForNewRegions)) |
642 | { | 642 | { |
643 | List<ILandObject> parcels = ((Scene)newscene).LandChannel.AllParcels(); | 643 | List<ILandObject> parcels = ((Scene)newScene).LandChannel.AllParcels(); |
644 | 644 | ||
645 | foreach (ILandObject parcel in parcels) | 645 | foreach (ILandObject parcel in parcels) |
646 | { | 646 | { |
647 | parcel.LandData.Flags |= (uint) ParcelFlags.AllowVoiceChat; | 647 | parcel.LandData.Flags |= (uint) ParcelFlags.AllowVoiceChat; |
648 | parcel.LandData.Flags |= (uint) ParcelFlags.UseEstateVoiceChan; | 648 | parcel.LandData.Flags |= (uint) ParcelFlags.UseEstateVoiceChan; |
649 | ((Scene)newscene).LandChannel.UpdateLandObject(parcel.LandData.LocalID, parcel.LandData); | 649 | ((Scene)newScene).LandChannel.UpdateLandObject(parcel.LandData.LocalID, parcel.LandData); |
650 | } | 650 | } |
651 | } | 651 | } |
652 | 652 | ||
@@ -704,19 +704,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
704 | XmlRpcResponse response = new XmlRpcResponse(); | 704 | XmlRpcResponse response = new XmlRpcResponse(); |
705 | Hashtable responseData = new Hashtable(); | 705 | Hashtable responseData = new Hashtable(); |
706 | 706 | ||
707 | lock (rslock) | 707 | lock (m_requestLock) |
708 | { | 708 | { |
709 | try | 709 | try |
710 | { | 710 | { |
711 | Hashtable requestData = (Hashtable) request.Params[0]; | 711 | Hashtable requestData = (Hashtable) request.Params[0]; |
712 | checkStringParameters(request, new string[] {"password", "region_name"}); | 712 | CheckStringParameters(request, new string[] {"password", "region_name"}); |
713 | 713 | ||
714 | Scene scene = null; | 714 | Scene scene = null; |
715 | string regionName = (string) requestData["region_name"]; | 715 | string regionName = (string) requestData["region_name"]; |
716 | if (!m_app.SceneManager.TryGetScene(regionName, out scene)) | 716 | if (!m_application.SceneManager.TryGetScene(regionName, out scene)) |
717 | throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); | 717 | throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); |
718 | 718 | ||
719 | m_app.RemoveRegion(scene, true); | 719 | m_application.RemoveRegion(scene, true); |
720 | 720 | ||
721 | responseData["success"] = true; | 721 | responseData["success"] = true; |
722 | responseData["region_name"] = regionName; | 722 | responseData["region_name"] = regionName; |
@@ -774,22 +774,22 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
774 | Hashtable responseData = new Hashtable(); | 774 | Hashtable responseData = new Hashtable(); |
775 | Scene scene = null; | 775 | Scene scene = null; |
776 | 776 | ||
777 | lock (rslock) | 777 | lock (m_requestLock) |
778 | { | 778 | { |
779 | try | 779 | try |
780 | { | 780 | { |
781 | Hashtable requestData = (Hashtable) request.Params[0]; | 781 | Hashtable requestData = (Hashtable) request.Params[0]; |
782 | checkStringParameters(request, new string[] {"password"}); | 782 | CheckStringParameters(request, new string[] {"password"}); |
783 | 783 | ||
784 | if (requestData.ContainsKey("region_id") && | 784 | if (requestData.ContainsKey("region_id") && |
785 | !String.IsNullOrEmpty((string) requestData["region_id"])) | 785 | !String.IsNullOrEmpty((string) requestData["region_id"])) |
786 | { | 786 | { |
787 | // Region specified by UUID | 787 | // Region specified by UUID |
788 | UUID regionID = (UUID) (string) requestData["region_id"]; | 788 | UUID regionID = (UUID) (string) requestData["region_id"]; |
789 | if (!m_app.SceneManager.TryGetScene(regionID, out scene)) | 789 | if (!m_application.SceneManager.TryGetScene(regionID, out scene)) |
790 | throw new Exception(String.Format("region \"{0}\" does not exist", regionID)); | 790 | throw new Exception(String.Format("region \"{0}\" does not exist", regionID)); |
791 | 791 | ||
792 | m_app.CloseRegion(scene); | 792 | m_application.CloseRegion(scene); |
793 | 793 | ||
794 | responseData["success"] = true; | 794 | responseData["success"] = true; |
795 | responseData["region_id"] = regionID; | 795 | responseData["region_id"] = regionID; |
@@ -802,10 +802,10 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
802 | // Region specified by name | 802 | // Region specified by name |
803 | 803 | ||
804 | string regionName = (string) requestData["region_name"]; | 804 | string regionName = (string) requestData["region_name"]; |
805 | if (!m_app.SceneManager.TryGetScene(regionName, out scene)) | 805 | if (!m_application.SceneManager.TryGetScene(regionName, out scene)) |
806 | throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); | 806 | throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); |
807 | 807 | ||
808 | m_app.CloseRegion(scene); | 808 | m_application.CloseRegion(scene); |
809 | 809 | ||
810 | responseData["success"] = true; | 810 | responseData["success"] = true; |
811 | responseData["region_name"] = regionName; | 811 | responseData["region_name"] = regionName; |
@@ -869,27 +869,27 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
869 | XmlRpcResponse response = new XmlRpcResponse(); | 869 | XmlRpcResponse response = new XmlRpcResponse(); |
870 | Hashtable responseData = new Hashtable(); | 870 | Hashtable responseData = new Hashtable(); |
871 | 871 | ||
872 | lock (rslock) | 872 | lock (m_requestLock) |
873 | { | 873 | { |
874 | try | 874 | try |
875 | { | 875 | { |
876 | Hashtable requestData = (Hashtable) request.Params[0]; | 876 | Hashtable requestData = (Hashtable) request.Params[0]; |
877 | checkStringParameters(request, new string[] {"password", "region_name"}); | 877 | CheckStringParameters(request, new string[] {"password", "region_name"}); |
878 | 878 | ||
879 | Scene scene = null; | 879 | Scene scene = null; |
880 | string regionName = (string) requestData["region_name"]; | 880 | string regionName = (string) requestData["region_name"]; |
881 | if (!m_app.SceneManager.TryGetScene(regionName, out scene)) | 881 | if (!m_application.SceneManager.TryGetScene(regionName, out scene)) |
882 | throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); | 882 | throw new Exception(String.Format("region \"{0}\" does not exist", regionName)); |
883 | 883 | ||
884 | // Modify access | 884 | // Modify access |
885 | scene.RegionInfo.EstateSettings.PublicAccess = | 885 | scene.RegionInfo.EstateSettings.PublicAccess = |
886 | getBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess); | 886 | GetBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess); |
887 | if (scene.RegionInfo.Persistent) | 887 | if (scene.RegionInfo.Persistent) |
888 | scene.RegionInfo.EstateSettings.Save(); | 888 | scene.RegionInfo.EstateSettings.Save(); |
889 | 889 | ||
890 | if (requestData.ContainsKey("enable_voice")) | 890 | if (requestData.ContainsKey("enable_voice")) |
891 | { | 891 | { |
892 | bool enableVoice = getBoolean(requestData, "enable_voice", true); | 892 | bool enableVoice = GetBoolean(requestData, "enable_voice", true); |
893 | List<ILandObject> parcels = ((Scene)scene).LandChannel.AllParcels(); | 893 | List<ILandObject> parcels = ((Scene)scene).LandChannel.AllParcels(); |
894 | 894 | ||
895 | foreach (ILandObject parcel in parcels) | 895 | foreach (ILandObject parcel in parcels) |
@@ -976,66 +976,66 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
976 | XmlRpcResponse response = new XmlRpcResponse(); | 976 | XmlRpcResponse response = new XmlRpcResponse(); |
977 | Hashtable responseData = new Hashtable(); | 977 | Hashtable responseData = new Hashtable(); |
978 | 978 | ||
979 | lock (rslock) | 979 | lock (m_requestLock) |
980 | { | 980 | { |
981 | try | 981 | try |
982 | { | 982 | { |
983 | Hashtable requestData = (Hashtable) request.Params[0]; | 983 | Hashtable requestData = (Hashtable) request.Params[0]; |
984 | 984 | ||
985 | // check completeness | 985 | // check completeness |
986 | checkStringParameters(request, new string[] | 986 | CheckStringParameters(request, new string[] |
987 | { | 987 | { |
988 | "password", "user_firstname", | 988 | "password", "user_firstname", |
989 | "user_lastname", "user_password", | 989 | "user_lastname", "user_password", |
990 | }); | 990 | }); |
991 | checkIntegerParams(request, new string[] {"start_region_x", "start_region_y"}); | 991 | CheckIntegerParams(request, new string[] {"start_region_x", "start_region_y"}); |
992 | 992 | ||
993 | // check password | 993 | // check password |
994 | if (!String.IsNullOrEmpty(m_requiredPassword) && | 994 | if (!String.IsNullOrEmpty(m_requiredPassword) && |
995 | (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); | 995 | (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); |
996 | 996 | ||
997 | // do the job | 997 | // do the job |
998 | string firstname = (string) requestData["user_firstname"]; | 998 | string firstName = (string) requestData["user_firstname"]; |
999 | string lastname = (string) requestData["user_lastname"]; | 999 | string lastName = (string) requestData["user_lastname"]; |
1000 | string passwd = (string) requestData["user_password"]; | 1000 | string password = (string) requestData["user_password"]; |
1001 | 1001 | ||
1002 | uint regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); | 1002 | uint regionXLocation = Convert.ToUInt32((Int32) requestData["start_region_x"]); |
1003 | uint regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); | 1003 | uint regionYLocation = Convert.ToUInt32((Int32) requestData["start_region_y"]); |
1004 | 1004 | ||
1005 | string email = ""; // empty string for email | 1005 | string email = ""; // empty string for email |
1006 | if (requestData.Contains("user_email")) | 1006 | if (requestData.Contains("user_email")) |
1007 | email = (string)requestData["user_email"]; | 1007 | email = (string)requestData["user_email"]; |
1008 | 1008 | ||
1009 | Scene scene = m_app.SceneManager.CurrentOrFirstScene; | 1009 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; |
1010 | UUID scopeID = scene.RegionInfo.ScopeID; | 1010 | UUID scopeID = scene.RegionInfo.ScopeID; |
1011 | 1011 | ||
1012 | UserAccount account = CreateUser(scopeID, firstname, lastname, passwd, email); | 1012 | UserAccount account = CreateUser(scopeID, firstName, lastName, password, email); |
1013 | 1013 | ||
1014 | if (null == account) | 1014 | if (null == account) |
1015 | throw new Exception(String.Format("failed to create new user {0} {1}", | 1015 | throw new Exception(String.Format("failed to create new user {0} {1}", |
1016 | firstname, lastname)); | 1016 | firstName, lastName)); |
1017 | 1017 | ||
1018 | // Set home position | 1018 | // Set home position |
1019 | 1019 | ||
1020 | GridRegion home = scene.GridService.GetRegionByPosition(scopeID, | 1020 | GridRegion home = scene.GridService.GetRegionByPosition(scopeID, |
1021 | (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); | 1021 | (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); |
1022 | if (null == home) { | 1022 | if (null == home) { |
1023 | m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", firstname, lastname); | 1023 | m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", firstName, lastName); |
1024 | } else { | 1024 | } else { |
1025 | scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); | 1025 | scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); |
1026 | m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstname, lastname); | 1026 | m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstName, lastName); |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | // Establish the avatar's initial appearance | 1029 | // Establish the avatar's initial appearance |
1030 | 1030 | ||
1031 | updateUserAppearance(responseData, requestData, account.PrincipalID); | 1031 | UpdateUserAppearance(responseData, requestData, account.PrincipalID); |
1032 | 1032 | ||
1033 | responseData["success"] = true; | 1033 | responseData["success"] = true; |
1034 | responseData["avatar_uuid"] = account.PrincipalID.ToString(); | 1034 | responseData["avatar_uuid"] = account.PrincipalID.ToString(); |
1035 | 1035 | ||
1036 | response.Value = responseData; | 1036 | response.Value = responseData; |
1037 | 1037 | ||
1038 | m_log.InfoFormat("[RADMIN]: CreateUser: User {0} {1} created, UUID {2}", firstname, lastname, account.PrincipalID); | 1038 | m_log.InfoFormat("[RADMIN]: CreateUser: User {0} {1} created, UUID {2}", firstName, lastName, account.PrincipalID); |
1039 | } | 1039 | } |
1040 | catch (Exception e) | 1040 | catch (Exception e) |
1041 | { | 1041 | { |
@@ -1099,17 +1099,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1099 | Hashtable requestData = (Hashtable) request.Params[0]; | 1099 | Hashtable requestData = (Hashtable) request.Params[0]; |
1100 | 1100 | ||
1101 | // check completeness | 1101 | // check completeness |
1102 | checkStringParameters(request, new string[] {"password", "user_firstname", "user_lastname"}); | 1102 | CheckStringParameters(request, new string[] {"password", "user_firstname", "user_lastname"}); |
1103 | 1103 | ||
1104 | string firstname = (string) requestData["user_firstname"]; | 1104 | string firstName = (string) requestData["user_firstname"]; |
1105 | string lastname = (string) requestData["user_lastname"]; | 1105 | string lastName = (string) requestData["user_lastname"]; |
1106 | 1106 | ||
1107 | responseData["user_firstname"] = firstname; | 1107 | responseData["user_firstname"] = firstName; |
1108 | responseData["user_lastname"] = lastname; | 1108 | responseData["user_lastname"] = lastName; |
1109 | 1109 | ||
1110 | UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; | 1110 | UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; |
1111 | 1111 | ||
1112 | UserAccount account = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, firstname, lastname); | 1112 | UserAccount account = m_application.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, firstName, lastName); |
1113 | 1113 | ||
1114 | if (null == account) | 1114 | if (null == account) |
1115 | { | 1115 | { |
@@ -1118,9 +1118,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1118 | } | 1118 | } |
1119 | else | 1119 | else |
1120 | { | 1120 | { |
1121 | GridUserInfo guinfo = m_app.SceneManager.CurrentOrFirstScene.GridUserService.GetGridUserInfo(account.PrincipalID.ToString()); | 1121 | GridUserInfo userInfo = m_application.SceneManager.CurrentOrFirstScene.GridUserService.GetGridUserInfo(account.PrincipalID.ToString()); |
1122 | if (guinfo != null) | 1122 | if (userInfo != null) |
1123 | responseData["lastlogin"] = guinfo.Login; | 1123 | responseData["lastlogin"] = userInfo.Login; |
1124 | else | 1124 | else |
1125 | responseData["lastlogin"] = 0; | 1125 | responseData["lastlogin"] = 0; |
1126 | 1126 | ||
@@ -1197,14 +1197,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1197 | XmlRpcResponse response = new XmlRpcResponse(); | 1197 | XmlRpcResponse response = new XmlRpcResponse(); |
1198 | Hashtable responseData = new Hashtable(); | 1198 | Hashtable responseData = new Hashtable(); |
1199 | 1199 | ||
1200 | lock (rslock) | 1200 | lock (m_requestLock) |
1201 | { | 1201 | { |
1202 | try | 1202 | try |
1203 | { | 1203 | { |
1204 | Hashtable requestData = (Hashtable) request.Params[0]; | 1204 | Hashtable requestData = (Hashtable) request.Params[0]; |
1205 | 1205 | ||
1206 | // check completeness | 1206 | // check completeness |
1207 | checkStringParameters(request, new string[] { | 1207 | CheckStringParameters(request, new string[] { |
1208 | "password", "user_firstname", | 1208 | "password", "user_firstname", |
1209 | "user_lastname"}); | 1209 | "user_lastname"}); |
1210 | 1210 | ||
@@ -1213,12 +1213,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1213 | (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); | 1213 | (string) requestData["password"] != m_requiredPassword) throw new Exception("wrong password"); |
1214 | 1214 | ||
1215 | // do the job | 1215 | // do the job |
1216 | string firstname = (string) requestData["user_firstname"]; | 1216 | string firstName = (string) requestData["user_firstname"]; |
1217 | string lastname = (string) requestData["user_lastname"]; | 1217 | string lastName = (string) requestData["user_lastname"]; |
1218 | 1218 | ||
1219 | string passwd = String.Empty; | 1219 | string password = String.Empty; |
1220 | uint? regX = null; | 1220 | uint? regionXLocation = null; |
1221 | uint? regY = null; | 1221 | uint? regionYLocation = null; |
1222 | // uint? ulaX = null; | 1222 | // uint? ulaX = null; |
1223 | // uint? ulaY = null; | 1223 | // uint? ulaY = null; |
1224 | // uint? ulaZ = null; | 1224 | // uint? ulaZ = null; |
@@ -1228,11 +1228,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1228 | // string aboutFirstLive = String.Empty; | 1228 | // string aboutFirstLive = String.Empty; |
1229 | // string aboutAvatar = String.Empty; | 1229 | // string aboutAvatar = String.Empty; |
1230 | 1230 | ||
1231 | if (requestData.ContainsKey("user_password")) passwd = (string) requestData["user_password"]; | 1231 | if (requestData.ContainsKey("user_password")) password = (string) requestData["user_password"]; |
1232 | if (requestData.ContainsKey("start_region_x")) | 1232 | if (requestData.ContainsKey("start_region_x")) |
1233 | regX = Convert.ToUInt32((Int32) requestData["start_region_x"]); | 1233 | regionXLocation = Convert.ToUInt32((Int32) requestData["start_region_x"]); |
1234 | if (requestData.ContainsKey("start_region_y")) | 1234 | if (requestData.ContainsKey("start_region_y")) |
1235 | regY = Convert.ToUInt32((Int32) requestData["start_region_y"]); | 1235 | regionYLocation = Convert.ToUInt32((Int32) requestData["start_region_y"]); |
1236 | 1236 | ||
1237 | // if (requestData.ContainsKey("start_lookat_x")) | 1237 | // if (requestData.ContainsKey("start_lookat_x")) |
1238 | // ulaX = Convert.ToUInt32((Int32) requestData["start_lookat_x"]); | 1238 | // ulaX = Convert.ToUInt32((Int32) requestData["start_lookat_x"]); |
@@ -1252,17 +1252,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1252 | // if (requestData.ContainsKey("about_virtual_world")) | 1252 | // if (requestData.ContainsKey("about_virtual_world")) |
1253 | // aboutAvatar = (string)requestData["about_virtual_world"]; | 1253 | // aboutAvatar = (string)requestData["about_virtual_world"]; |
1254 | 1254 | ||
1255 | Scene scene = m_app.SceneManager.CurrentOrFirstScene; | 1255 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; |
1256 | UUID scopeID = scene.RegionInfo.ScopeID; | 1256 | UUID scopeID = scene.RegionInfo.ScopeID; |
1257 | UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, firstname, lastname); | 1257 | UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, firstName, lastName); |
1258 | 1258 | ||
1259 | if (null == account) | 1259 | if (null == account) |
1260 | throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname)); | 1260 | throw new Exception(String.Format("avatar {0} {1} does not exist", firstName, lastName)); |
1261 | 1261 | ||
1262 | if (!String.IsNullOrEmpty(passwd)) | 1262 | if (!String.IsNullOrEmpty(password)) |
1263 | { | 1263 | { |
1264 | m_log.DebugFormat("[RADMIN]: UpdateUserAccount: updating password for avatar {0} {1}", firstname, lastname); | 1264 | m_log.DebugFormat("[RADMIN]: UpdateUserAccount: updating password for avatar {0} {1}", firstName, lastName); |
1265 | ChangeUserPassword(firstname, lastname, passwd); | 1265 | ChangeUserPassword(firstName, lastName, password); |
1266 | } | 1266 | } |
1267 | 1267 | ||
1268 | // if (null != usaX) userProfile.HomeLocationX = (uint) usaX; | 1268 | // if (null != usaX) userProfile.HomeLocationX = (uint) usaX; |
@@ -1278,21 +1278,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1278 | 1278 | ||
1279 | // Set home position | 1279 | // Set home position |
1280 | 1280 | ||
1281 | if ((null != regX) && (null != regY)) | 1281 | if ((null != regionXLocation) && (null != regionYLocation)) |
1282 | { | 1282 | { |
1283 | GridRegion home = scene.GridService.GetRegionByPosition(scopeID, | 1283 | GridRegion home = scene.GridService.GetRegionByPosition(scopeID, |
1284 | (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); | 1284 | (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); |
1285 | if (null == home) { | 1285 | if (null == home) { |
1286 | m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstname, lastname); | 1286 | m_log.WarnFormat("[RADMIN]: Unable to set home region for updated user account {0} {1}", firstName, lastName); |
1287 | } else { | 1287 | } else { |
1288 | scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); | 1288 | scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); |
1289 | m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstname, lastname); | 1289 | m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, firstName, lastName); |
1290 | } | 1290 | } |
1291 | } | 1291 | } |
1292 | 1292 | ||
1293 | // User has been created. Now establish gender and appearance. | 1293 | // User has been created. Now establish gender and appearance. |
1294 | 1294 | ||
1295 | updateUserAppearance(responseData, requestData, account.PrincipalID); | 1295 | UpdateUserAppearance(responseData, requestData, account.PrincipalID); |
1296 | 1296 | ||
1297 | responseData["success"] = true; | 1297 | responseData["success"] = true; |
1298 | responseData["avatar_uuid"] = account.PrincipalID.ToString(); | 1298 | responseData["avatar_uuid"] = account.PrincipalID.ToString(); |
@@ -1300,7 +1300,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1300 | response.Value = responseData; | 1300 | response.Value = responseData; |
1301 | 1301 | ||
1302 | m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", | 1302 | m_log.InfoFormat("[RADMIN]: UpdateUserAccount: account for user {0} {1} updated, UUID {2}", |
1303 | firstname, lastname, | 1303 | firstName, lastName, |
1304 | account.PrincipalID); | 1304 | account.PrincipalID); |
1305 | } | 1305 | } |
1306 | catch (Exception e) | 1306 | catch (Exception e) |
@@ -1328,13 +1328,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1328 | /// This should probably get moved into somewhere more core eventually. | 1328 | /// This should probably get moved into somewhere more core eventually. |
1329 | /// </summary> | 1329 | /// </summary> |
1330 | 1330 | ||
1331 | private void updateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid) | 1331 | private void UpdateUserAppearance(Hashtable responseData, Hashtable requestData, UUID userid) |
1332 | { | 1332 | { |
1333 | m_log.DebugFormat("[RADMIN] updateUserAppearance"); | 1333 | m_log.DebugFormat("[RADMIN] updateUserAppearance"); |
1334 | 1334 | ||
1335 | string dmale = m_config.GetString("default_male", "Default Male"); | 1335 | string defaultMale = m_config.GetString("default_male", "Default Male"); |
1336 | string dfemale = m_config.GetString("default_female", "Default Female"); | 1336 | string defaultFemale = m_config.GetString("default_female", "Default Female"); |
1337 | string dneut = m_config.GetString("default_female", "Default Default"); | 1337 | string defaultNeutral = m_config.GetString("default_female", "Default Default"); |
1338 | string model = String.Empty; | 1338 | string model = String.Empty; |
1339 | 1339 | ||
1340 | // Has a gender preference been supplied? | 1340 | // Has a gender preference been supplied? |
@@ -1345,16 +1345,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1345 | { | 1345 | { |
1346 | case "m" : | 1346 | case "m" : |
1347 | case "male" : | 1347 | case "male" : |
1348 | model = dmale; | 1348 | model = defaultMale; |
1349 | break; | 1349 | break; |
1350 | case "f" : | 1350 | case "f" : |
1351 | case "female" : | 1351 | case "female" : |
1352 | model = dfemale; | 1352 | model = defaultFemale; |
1353 | break; | 1353 | break; |
1354 | case "n" : | 1354 | case "n" : |
1355 | case "neutral" : | 1355 | case "neutral" : |
1356 | default : | 1356 | default : |
1357 | model = dneut; | 1357 | model = defaultNeutral; |
1358 | break; | 1358 | break; |
1359 | } | 1359 | } |
1360 | } | 1360 | } |
@@ -1376,19 +1376,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1376 | 1376 | ||
1377 | m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model <{1}>", userid, model); | 1377 | m_log.DebugFormat("[RADMIN] Setting appearance for avatar {0}, using model <{1}>", userid, model); |
1378 | 1378 | ||
1379 | string[] nomens = model.Split(); | 1379 | string[] modelSpecifiers = model.Split(); |
1380 | if (nomens.Length != 2) | 1380 | if (modelSpecifiers.Length != 2) |
1381 | { | 1381 | { |
1382 | m_log.WarnFormat("[RADMIN] User appearance not set for {0}. Invalid model name : <{1}>", userid, model); | 1382 | m_log.WarnFormat("[RADMIN] User appearance not set for {0}. Invalid model name : <{1}>", userid, model); |
1383 | // nomens = dmodel.Split(); | 1383 | // modelSpecifiers = dmodel.Split(); |
1384 | return; | 1384 | return; |
1385 | } | 1385 | } |
1386 | 1386 | ||
1387 | Scene scene = m_app.SceneManager.CurrentOrFirstScene; | 1387 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; |
1388 | UUID scopeID = scene.RegionInfo.ScopeID; | 1388 | UUID scopeID = scene.RegionInfo.ScopeID; |
1389 | UserAccount mprof = scene.UserAccountService.GetUserAccount(scopeID, nomens[0], nomens[1]); | 1389 | UserAccount modelProfile = scene.UserAccountService.GetUserAccount(scopeID, modelSpecifiers[0], modelSpecifiers[1]); |
1390 | 1390 | ||
1391 | if (mprof == null) | 1391 | if (modelProfile == null) |
1392 | { | 1392 | { |
1393 | m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Appearance unchanged", model); | 1393 | m_log.WarnFormat("[RADMIN] Requested model ({0}) not found. Appearance unchanged", model); |
1394 | return; | 1394 | return; |
@@ -1398,7 +1398,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1398 | // actual asset ids, however to complete the magic we need to populate the inventory with the | 1398 | // actual asset ids, however to complete the magic we need to populate the inventory with the |
1399 | // assets in question. | 1399 | // assets in question. |
1400 | 1400 | ||
1401 | establishAppearance(userid, mprof.PrincipalID); | 1401 | EstablishAppearance(userid, modelProfile.PrincipalID); |
1402 | 1402 | ||
1403 | m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", | 1403 | m_log.DebugFormat("[RADMIN] Finished setting appearance for avatar {0}, using model {1}", |
1404 | userid, model); | 1404 | userid, model); |
@@ -1410,17 +1410,17 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1410 | /// is known to exist, as is the target avatar. | 1410 | /// is known to exist, as is the target avatar. |
1411 | /// </summary> | 1411 | /// </summary> |
1412 | 1412 | ||
1413 | private void establishAppearance(UUID dest, UUID srca) | 1413 | private void EstablishAppearance(UUID destination, UUID source) |
1414 | { | 1414 | { |
1415 | m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", dest, srca); | 1415 | m_log.DebugFormat("[RADMIN] Initializing inventory for {0} from {1}", destination, source); |
1416 | Scene scene = m_app.SceneManager.CurrentOrFirstScene; | 1416 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; |
1417 | AvatarAppearance ava = null; | 1417 | AvatarAppearance avatarAppearance = null; |
1418 | AvatarData avatar = scene.AvatarService.GetAvatar(srca); | 1418 | AvatarData avatar = scene.AvatarService.GetAvatar(source); |
1419 | if (avatar != null) | 1419 | if (avatar != null) |
1420 | ava = avatar.ToAvatarAppearance(srca); | 1420 | avatarAppearance = avatar.ToAvatarAppearance(source); |
1421 | 1421 | ||
1422 | // If the model has no associated appearance we're done. | 1422 | // If the model has no associated appearance we're done. |
1423 | if (ava == null) | 1423 | if (avatarAppearance == null) |
1424 | return; | 1424 | return; |
1425 | 1425 | ||
1426 | // Simple appearance copy or copy Clothing and Bodyparts folders? | 1426 | // Simple appearance copy or copy Clothing and Bodyparts folders? |
@@ -1431,15 +1431,15 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1431 | // Simple copy of wearables and appearance update | 1431 | // Simple copy of wearables and appearance update |
1432 | try | 1432 | try |
1433 | { | 1433 | { |
1434 | copyWearablesAndAttachments(dest, srca, ava); | 1434 | CopyWearablesAndAttachments(destination, source, avatarAppearance); |
1435 | 1435 | ||
1436 | AvatarData adata = new AvatarData(ava); | 1436 | AvatarData avatarData = new AvatarData(avatarAppearance); |
1437 | scene.AvatarService.SetAvatar(dest, adata); | 1437 | scene.AvatarService.SetAvatar(destination, avatarData); |
1438 | } | 1438 | } |
1439 | catch (Exception e) | 1439 | catch (Exception e) |
1440 | { | 1440 | { |
1441 | m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", | 1441 | m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", |
1442 | dest, e.Message); | 1442 | destination, e.Message); |
1443 | } | 1443 | } |
1444 | 1444 | ||
1445 | return; | 1445 | return; |
@@ -1448,30 +1448,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1448 | // Copy Clothing and Bodypart folders and appearance update | 1448 | // Copy Clothing and Bodypart folders and appearance update |
1449 | try | 1449 | try |
1450 | { | 1450 | { |
1451 | Dictionary<UUID,UUID> imap = new Dictionary<UUID,UUID>(); | 1451 | Dictionary<UUID,UUID> inventoryMap = new Dictionary<UUID,UUID>(); |
1452 | copyInventoryFolders(dest, srca, AssetType.Clothing, imap, ava); | 1452 | CopyInventoryFolders(destination, source, AssetType.Clothing, inventoryMap, avatarAppearance); |
1453 | copyInventoryFolders(dest, srca, AssetType.Bodypart, imap, ava); | 1453 | CopyInventoryFolders(destination, source, AssetType.Bodypart, inventoryMap, avatarAppearance); |
1454 | 1454 | ||
1455 | AvatarWearable[] wearables = ava.Wearables; | 1455 | AvatarWearable[] wearables = avatarAppearance.Wearables; |
1456 | 1456 | ||
1457 | for (int i=0; i<wearables.Length; i++) | 1457 | for (int i=0; i<wearables.Length; i++) |
1458 | { | 1458 | { |
1459 | if (imap.ContainsKey(wearables[i].ItemID)) | 1459 | if (inventoryMap.ContainsKey(wearables[i].ItemID)) |
1460 | { | 1460 | { |
1461 | AvatarWearable dw = new AvatarWearable(); | 1461 | AvatarWearable wearable = new AvatarWearable(); |
1462 | dw.AssetID = wearables[i].AssetID; | 1462 | wearable.AssetID = wearables[i].AssetID; |
1463 | dw.ItemID = imap[wearables[i].ItemID]; | 1463 | wearable.ItemID = inventoryMap[wearables[i].ItemID]; |
1464 | ava.SetWearable(i, dw); | 1464 | avatarAppearance.SetWearable(i, wearable); |
1465 | } | 1465 | } |
1466 | } | 1466 | } |
1467 | 1467 | ||
1468 | AvatarData adata = new AvatarData(ava); | 1468 | AvatarData avatarData = new AvatarData(avatarAppearance); |
1469 | scene.AvatarService.SetAvatar(dest, adata); | 1469 | scene.AvatarService.SetAvatar(destination, avatarData); |
1470 | } | 1470 | } |
1471 | catch (Exception e) | 1471 | catch (Exception e) |
1472 | { | 1472 | { |
1473 | m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", | 1473 | m_log.WarnFormat("[RADMIN] Error transferring appearance for {0} : {1}", |
1474 | dest, e.Message); | 1474 | destination, e.Message); |
1475 | } | 1475 | } |
1476 | 1476 | ||
1477 | return; | 1477 | return; |
@@ -1483,32 +1483,33 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1483 | /// In parallel the avatar wearables and attachments are updated. | 1483 | /// In parallel the avatar wearables and attachments are updated. |
1484 | /// </summary> | 1484 | /// </summary> |
1485 | 1485 | ||
1486 | private void copyWearablesAndAttachments(UUID dest, UUID srca, AvatarAppearance ava) | 1486 | private void CopyWearablesAndAttachments(UUID destination, UUID source, AvatarAppearance avatarAppearance) |
1487 | { | 1487 | { |
1488 | IInventoryService iserv = m_app.SceneManager.CurrentOrFirstScene.InventoryService; | 1488 | IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; |
1489 | 1489 | ||
1490 | // Get Clothing folder of receiver | 1490 | // Get Clothing folder of receiver |
1491 | InventoryFolderBase dstf = iserv.GetFolderForType(dest, AssetType.Clothing); | 1491 | InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, AssetType.Clothing); |
1492 | 1492 | ||
1493 | if (dstf == null) | 1493 | if (destinationFolder == null) |
1494 | throw new Exception("Cannot locate folder(s)"); | 1494 | throw new Exception("Cannot locate folder(s)"); |
1495 | 1495 | ||
1496 | // Missing destination folder? This should *never* be the case | 1496 | // Missing destination folder? This should *never* be the case |
1497 | if (dstf.Type != (short)AssetType.Clothing) | 1497 | if (destinationFolder.Type != (short)AssetType.Clothing) |
1498 | { | 1498 | { |
1499 | dstf = new InventoryFolderBase(); | 1499 | destinationFolder = new InventoryFolderBase(); |
1500 | dstf.ID = UUID.Random(); | 1500 | |
1501 | dstf.Name = "Clothing"; | 1501 | destinationFolder.ID = UUID.Random(); |
1502 | dstf.Owner = dest; | 1502 | destinationFolder.Name = "Clothing"; |
1503 | dstf.Type = (short)AssetType.Clothing; | 1503 | destinationFolder.Owner = destination; |
1504 | dstf.ParentID = iserv.GetRootFolder(dest).ID; | 1504 | destinationFolder.Type = (short)AssetType.Clothing; |
1505 | dstf.Version = 1; | 1505 | destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; |
1506 | iserv.AddFolder(dstf); // store base record | 1506 | destinationFolder.Version = 1; |
1507 | m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", srca); | 1507 | inventoryService.AddFolder(destinationFolder); // store base record |
1508 | m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", source); | ||
1508 | } | 1509 | } |
1509 | 1510 | ||
1510 | // Wearables | 1511 | // Wearables |
1511 | AvatarWearable[] wearables = ava.Wearables; | 1512 | AvatarWearable[] wearables = avatarAppearance.Wearables; |
1512 | AvatarWearable wearable; | 1513 | AvatarWearable wearable; |
1513 | 1514 | ||
1514 | for (int i=0; i<wearables.Length; i++) | 1515 | for (int i=0; i<wearables.Length; i++) |
@@ -1517,95 +1518,95 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1517 | if (wearable.ItemID != UUID.Zero) | 1518 | if (wearable.ItemID != UUID.Zero) |
1518 | { | 1519 | { |
1519 | // Get inventory item and copy it | 1520 | // Get inventory item and copy it |
1520 | InventoryItemBase item = new InventoryItemBase(wearable.ItemID, srca); | 1521 | InventoryItemBase item = new InventoryItemBase(wearable.ItemID, source); |
1521 | item = iserv.GetItem(item); | 1522 | item = inventoryService.GetItem(item); |
1522 | 1523 | ||
1523 | if (item != null) | 1524 | if (item != null) |
1524 | { | 1525 | { |
1525 | InventoryItemBase dsti = new InventoryItemBase(UUID.Random(), dest); | 1526 | InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); |
1526 | dsti.Name = item.Name; | 1527 | destinationItem.Name = item.Name; |
1527 | dsti.Description = item.Description; | 1528 | destinationItem.Description = item.Description; |
1528 | dsti.InvType = item.InvType; | 1529 | destinationItem.InvType = item.InvType; |
1529 | dsti.CreatorId = item.CreatorId; | 1530 | destinationItem.CreatorId = item.CreatorId; |
1530 | dsti.CreatorIdAsUuid = item.CreatorIdAsUuid; | 1531 | destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid; |
1531 | dsti.NextPermissions = item.NextPermissions; | 1532 | destinationItem.NextPermissions = item.NextPermissions; |
1532 | dsti.CurrentPermissions = item.CurrentPermissions; | 1533 | destinationItem.CurrentPermissions = item.CurrentPermissions; |
1533 | dsti.BasePermissions = item.BasePermissions; | 1534 | destinationItem.BasePermissions = item.BasePermissions; |
1534 | dsti.EveryOnePermissions = item.EveryOnePermissions; | 1535 | destinationItem.EveryOnePermissions = item.EveryOnePermissions; |
1535 | dsti.GroupPermissions = item.GroupPermissions; | 1536 | destinationItem.GroupPermissions = item.GroupPermissions; |
1536 | dsti.AssetType = item.AssetType; | 1537 | destinationItem.AssetType = item.AssetType; |
1537 | dsti.AssetID = item.AssetID; | 1538 | destinationItem.AssetID = item.AssetID; |
1538 | dsti.GroupID = item.GroupID; | 1539 | destinationItem.GroupID = item.GroupID; |
1539 | dsti.GroupOwned = item.GroupOwned; | 1540 | destinationItem.GroupOwned = item.GroupOwned; |
1540 | dsti.SalePrice = item.SalePrice; | 1541 | destinationItem.SalePrice = item.SalePrice; |
1541 | dsti.SaleType = item.SaleType; | 1542 | destinationItem.SaleType = item.SaleType; |
1542 | dsti.Flags = item.Flags; | 1543 | destinationItem.Flags = item.Flags; |
1543 | dsti.CreationDate = item.CreationDate; | 1544 | destinationItem.CreationDate = item.CreationDate; |
1544 | dsti.Folder = dstf.ID; | 1545 | destinationItem.Folder = destinationFolder.ID; |
1545 | 1546 | ||
1546 | iserv.AddItem(dsti); | 1547 | inventoryService.AddItem(destinationItem); |
1547 | m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", dsti.ID, dstf.ID); | 1548 | m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); |
1548 | 1549 | ||
1549 | // Wear item | 1550 | // Wear item |
1550 | AvatarWearable dw = new AvatarWearable(); | 1551 | AvatarWearable newWearable = new AvatarWearable(); |
1551 | dw.AssetID = wearable.AssetID; | 1552 | newWearable.AssetID = wearable.AssetID; |
1552 | dw.ItemID = dsti.ID; | 1553 | newWearable.ItemID = destinationItem.ID; |
1553 | ava.SetWearable(i, dw); | 1554 | avatarAppearance.SetWearable(i, newWearable); |
1554 | } | 1555 | } |
1555 | else | 1556 | else |
1556 | { | 1557 | { |
1557 | m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", wearable.ItemID, dstf.ID); | 1558 | m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", wearable.ItemID, destinationFolder.ID); |
1558 | } | 1559 | } |
1559 | } | 1560 | } |
1560 | } | 1561 | } |
1561 | 1562 | ||
1562 | // Attachments | 1563 | // Attachments |
1563 | Dictionary<int, UUID[]> attachments = ava.GetAttachmentDictionary(); | 1564 | Dictionary<int, UUID[]> attachments = avatarAppearance.GetAttachmentDictionary(); |
1564 | 1565 | ||
1565 | foreach (KeyValuePair<int, UUID[]> kvp in attachments) | 1566 | foreach (KeyValuePair<int, UUID[]> attachment in attachments) |
1566 | { | 1567 | { |
1567 | int attachpoint = kvp.Key; | 1568 | int attachpoint = attachment.Key; |
1568 | UUID itemID = kvp.Value[0]; | 1569 | UUID itemID = attachment.Value[0]; |
1569 | 1570 | ||
1570 | if (itemID != UUID.Zero) | 1571 | if (itemID != UUID.Zero) |
1571 | { | 1572 | { |
1572 | // Get inventory item and copy it | 1573 | // Get inventory item and copy it |
1573 | InventoryItemBase item = new InventoryItemBase(itemID, srca); | 1574 | InventoryItemBase item = new InventoryItemBase(itemID, source); |
1574 | item = iserv.GetItem(item); | 1575 | item = inventoryService.GetItem(item); |
1575 | 1576 | ||
1576 | if (item != null) | 1577 | if (item != null) |
1577 | { | 1578 | { |
1578 | InventoryItemBase dsti = new InventoryItemBase(UUID.Random(), dest); | 1579 | InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); |
1579 | dsti.Name = item.Name; | 1580 | destinationItem.Name = item.Name; |
1580 | dsti.Description = item.Description; | 1581 | destinationItem.Description = item.Description; |
1581 | dsti.InvType = item.InvType; | 1582 | destinationItem.InvType = item.InvType; |
1582 | dsti.CreatorId = item.CreatorId; | 1583 | destinationItem.CreatorId = item.CreatorId; |
1583 | dsti.CreatorIdAsUuid = item.CreatorIdAsUuid; | 1584 | destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid; |
1584 | dsti.NextPermissions = item.NextPermissions; | 1585 | destinationItem.NextPermissions = item.NextPermissions; |
1585 | dsti.CurrentPermissions = item.CurrentPermissions; | 1586 | destinationItem.CurrentPermissions = item.CurrentPermissions; |
1586 | dsti.BasePermissions = item.BasePermissions; | 1587 | destinationItem.BasePermissions = item.BasePermissions; |
1587 | dsti.EveryOnePermissions = item.EveryOnePermissions; | 1588 | destinationItem.EveryOnePermissions = item.EveryOnePermissions; |
1588 | dsti.GroupPermissions = item.GroupPermissions; | 1589 | destinationItem.GroupPermissions = item.GroupPermissions; |
1589 | dsti.AssetType = item.AssetType; | 1590 | destinationItem.AssetType = item.AssetType; |
1590 | dsti.AssetID = item.AssetID; | 1591 | destinationItem.AssetID = item.AssetID; |
1591 | dsti.GroupID = item.GroupID; | 1592 | destinationItem.GroupID = item.GroupID; |
1592 | dsti.GroupOwned = item.GroupOwned; | 1593 | destinationItem.GroupOwned = item.GroupOwned; |
1593 | dsti.SalePrice = item.SalePrice; | 1594 | destinationItem.SalePrice = item.SalePrice; |
1594 | dsti.SaleType = item.SaleType; | 1595 | destinationItem.SaleType = item.SaleType; |
1595 | dsti.Flags = item.Flags; | 1596 | destinationItem.Flags = item.Flags; |
1596 | dsti.CreationDate = item.CreationDate; | 1597 | destinationItem.CreationDate = item.CreationDate; |
1597 | dsti.Folder = dstf.ID; | 1598 | destinationItem.Folder = destinationFolder.ID; |
1598 | 1599 | ||
1599 | iserv.AddItem(dsti); | 1600 | inventoryService.AddItem(destinationItem); |
1600 | m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", dsti.ID, dstf.ID); | 1601 | m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, destinationFolder.ID); |
1601 | 1602 | ||
1602 | // Attach item | 1603 | // Attach item |
1603 | ava.SetAttachment(attachpoint, dsti.ID, dsti.AssetID); | 1604 | avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); |
1604 | m_log.DebugFormat("[RADMIN] Attached {0}", dsti.ID); | 1605 | m_log.DebugFormat("[RADMIN] Attached {0}", destinationItem.ID); |
1605 | } | 1606 | } |
1606 | else | 1607 | else |
1607 | { | 1608 | { |
1608 | m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", itemID, dstf.ID); | 1609 | m_log.WarnFormat("[RADMIN] Error transferring {0} to folder {1}", itemID, destinationFolder.ID); |
1609 | } | 1610 | } |
1610 | } | 1611 | } |
1611 | } | 1612 | } |
@@ -1618,101 +1619,101 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1618 | /// copies of Clothing and Bodyparts inventory folders and attaches worn attachments | 1619 | /// copies of Clothing and Bodyparts inventory folders and attaches worn attachments |
1619 | /// </summary> | 1620 | /// </summary> |
1620 | 1621 | ||
1621 | private void copyInventoryFolders(UUID dest, UUID srca, AssetType assettype, Dictionary<UUID,UUID> imap, | 1622 | private void CopyInventoryFolders(UUID destination, UUID source, AssetType assetType, Dictionary<UUID,UUID> inventoryMap, |
1622 | AvatarAppearance ava) | 1623 | AvatarAppearance avatarAppearance) |
1623 | { | 1624 | { |
1624 | IInventoryService iserv = m_app.SceneManager.CurrentOrFirstScene.InventoryService; | 1625 | IInventoryService inventoryService = m_application.SceneManager.CurrentOrFirstScene.InventoryService; |
1625 | 1626 | ||
1626 | InventoryFolderBase srcf = iserv.GetFolderForType(srca, assettype); | 1627 | InventoryFolderBase sourceFolder = inventoryService.GetFolderForType(source, assetType); |
1627 | InventoryFolderBase dstf = iserv.GetFolderForType(dest, assettype); | 1628 | InventoryFolderBase destinationFolder = inventoryService.GetFolderForType(destination, assetType); |
1628 | 1629 | ||
1629 | if (srcf == null || dstf == null) | 1630 | if (sourceFolder == null || destinationFolder == null) |
1630 | throw new Exception("Cannot locate folder(s)"); | 1631 | throw new Exception("Cannot locate folder(s)"); |
1631 | 1632 | ||
1632 | // Missing source folder? This should *never* be the case | 1633 | // Missing source folder? This should *never* be the case |
1633 | if (srcf.Type != (short)assettype) | 1634 | if (sourceFolder.Type != (short)assetType) |
1634 | { | 1635 | { |
1635 | srcf = new InventoryFolderBase(); | 1636 | sourceFolder = new InventoryFolderBase(); |
1636 | srcf.ID = UUID.Random(); | 1637 | sourceFolder.ID = UUID.Random(); |
1637 | if (assettype == AssetType.Clothing) { | 1638 | if (assetType == AssetType.Clothing) { |
1638 | srcf.Name = "Clothing"; | 1639 | sourceFolder.Name = "Clothing"; |
1639 | } else { | 1640 | } else { |
1640 | srcf.Name = "Body Parts"; | 1641 | sourceFolder.Name = "Body Parts"; |
1641 | } | 1642 | } |
1642 | srcf.Owner = srca; | 1643 | sourceFolder.Owner = source; |
1643 | srcf.Type = (short)assettype; | 1644 | sourceFolder.Type = (short)assetType; |
1644 | srcf.ParentID = iserv.GetRootFolder(srca).ID; | 1645 | sourceFolder.ParentID = inventoryService.GetRootFolder(source).ID; |
1645 | srcf.Version = 1; | 1646 | sourceFolder.Version = 1; |
1646 | iserv.AddFolder(srcf); // store base record | 1647 | inventoryService.AddFolder(sourceFolder); // store base record |
1647 | m_log.ErrorFormat("[RADMIN] Created folder for source {0}", srca); | 1648 | m_log.ErrorFormat("[RADMIN] Created folder for source {0}", source); |
1648 | } | 1649 | } |
1649 | 1650 | ||
1650 | // Missing destination folder? This should *never* be the case | 1651 | // Missing destination folder? This should *never* be the case |
1651 | if (dstf.Type != (short)assettype) | 1652 | if (destinationFolder.Type != (short)assetType) |
1652 | { | 1653 | { |
1653 | dstf = new InventoryFolderBase(); | 1654 | destinationFolder = new InventoryFolderBase(); |
1654 | dstf.ID = UUID.Random(); | 1655 | destinationFolder.ID = UUID.Random(); |
1655 | dstf.Name = assettype.ToString(); | 1656 | destinationFolder.Name = assetType.ToString(); |
1656 | dstf.Owner = dest; | 1657 | destinationFolder.Owner = destination; |
1657 | dstf.Type = (short)assettype; | 1658 | destinationFolder.Type = (short)assetType; |
1658 | dstf.ParentID = iserv.GetRootFolder(dest).ID; | 1659 | destinationFolder.ParentID = inventoryService.GetRootFolder(destination).ID; |
1659 | dstf.Version = 1; | 1660 | destinationFolder.Version = 1; |
1660 | iserv.AddFolder(dstf); // store base record | 1661 | inventoryService.AddFolder(destinationFolder); // store base record |
1661 | m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", srca); | 1662 | m_log.ErrorFormat("[RADMIN] Created folder for destination {0}", source); |
1662 | } | 1663 | } |
1663 | 1664 | ||
1664 | InventoryFolderBase efolder; | 1665 | InventoryFolderBase extraFolder; |
1665 | List<InventoryFolderBase> folders = iserv.GetFolderContent(srca, srcf.ID).Folders; | 1666 | List<InventoryFolderBase> folders = inventoryService.GetFolderContent(source, sourceFolder.ID).Folders; |
1666 | 1667 | ||
1667 | foreach (InventoryFolderBase folder in folders) | 1668 | foreach (InventoryFolderBase folder in folders) |
1668 | { | 1669 | { |
1669 | 1670 | ||
1670 | efolder = new InventoryFolderBase(); | 1671 | extraFolder = new InventoryFolderBase(); |
1671 | efolder.ID = UUID.Random(); | 1672 | extraFolder.ID = UUID.Random(); |
1672 | efolder.Name = folder.Name; | 1673 | extraFolder.Name = folder.Name; |
1673 | efolder.Owner = dest; | 1674 | extraFolder.Owner = destination; |
1674 | efolder.Type = folder.Type; | 1675 | extraFolder.Type = folder.Type; |
1675 | efolder.Version = folder.Version; | 1676 | extraFolder.Version = folder.Version; |
1676 | efolder.ParentID = dstf.ID; | 1677 | extraFolder.ParentID = destinationFolder.ID; |
1677 | iserv.AddFolder(efolder); | 1678 | inventoryService.AddFolder(extraFolder); |
1678 | 1679 | ||
1679 | m_log.DebugFormat("[RADMIN] Added folder {0} to folder {1}", efolder.ID, srcf.ID); | 1680 | m_log.DebugFormat("[RADMIN] Added folder {0} to folder {1}", extraFolder.ID, sourceFolder.ID); |
1680 | 1681 | ||
1681 | List<InventoryItemBase> items = iserv.GetFolderContent(srca, folder.ID).Items; | 1682 | List<InventoryItemBase> items = inventoryService.GetFolderContent(source, folder.ID).Items; |
1682 | 1683 | ||
1683 | foreach (InventoryItemBase item in items) | 1684 | foreach (InventoryItemBase item in items) |
1684 | { | 1685 | { |
1685 | InventoryItemBase dsti = new InventoryItemBase(UUID.Random(), dest); | 1686 | InventoryItemBase destinationItem = new InventoryItemBase(UUID.Random(), destination); |
1686 | dsti.Name = item.Name; | 1687 | destinationItem.Name = item.Name; |
1687 | dsti.Description = item.Description; | 1688 | destinationItem.Description = item.Description; |
1688 | dsti.InvType = item.InvType; | 1689 | destinationItem.InvType = item.InvType; |
1689 | dsti.CreatorId = item.CreatorId; | 1690 | destinationItem.CreatorId = item.CreatorId; |
1690 | dsti.CreatorIdAsUuid = item.CreatorIdAsUuid; | 1691 | destinationItem.CreatorIdAsUuid = item.CreatorIdAsUuid; |
1691 | dsti.NextPermissions = item.NextPermissions; | 1692 | destinationItem.NextPermissions = item.NextPermissions; |
1692 | dsti.CurrentPermissions = item.CurrentPermissions; | 1693 | destinationItem.CurrentPermissions = item.CurrentPermissions; |
1693 | dsti.BasePermissions = item.BasePermissions; | 1694 | destinationItem.BasePermissions = item.BasePermissions; |
1694 | dsti.EveryOnePermissions = item.EveryOnePermissions; | 1695 | destinationItem.EveryOnePermissions = item.EveryOnePermissions; |
1695 | dsti.GroupPermissions = item.GroupPermissions; | 1696 | destinationItem.GroupPermissions = item.GroupPermissions; |
1696 | dsti.AssetType = item.AssetType; | 1697 | destinationItem.AssetType = item.AssetType; |
1697 | dsti.AssetID = item.AssetID; | 1698 | destinationItem.AssetID = item.AssetID; |
1698 | dsti.GroupID = item.GroupID; | 1699 | destinationItem.GroupID = item.GroupID; |
1699 | dsti.GroupOwned = item.GroupOwned; | 1700 | destinationItem.GroupOwned = item.GroupOwned; |
1700 | dsti.SalePrice = item.SalePrice; | 1701 | destinationItem.SalePrice = item.SalePrice; |
1701 | dsti.SaleType = item.SaleType; | 1702 | destinationItem.SaleType = item.SaleType; |
1702 | dsti.Flags = item.Flags; | 1703 | destinationItem.Flags = item.Flags; |
1703 | dsti.CreationDate = item.CreationDate; | 1704 | destinationItem.CreationDate = item.CreationDate; |
1704 | dsti.Folder = efolder.ID; | 1705 | destinationItem.Folder = extraFolder.ID; |
1705 | 1706 | ||
1706 | iserv.AddItem(dsti); | 1707 | inventoryService.AddItem(destinationItem); |
1707 | imap.Add(item.ID, dsti.ID); | 1708 | inventoryMap.Add(item.ID, destinationItem.ID); |
1708 | m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", dsti.ID, efolder.ID); | 1709 | m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", destinationItem.ID, extraFolder.ID); |
1709 | 1710 | ||
1710 | // Attach item, if original is attached | 1711 | // Attach item, if original is attached |
1711 | int attachpoint = ava.GetAttachpoint(item.ID); | 1712 | int attachpoint = avatarAppearance.GetAttachpoint(item.ID); |
1712 | if (attachpoint != 0) | 1713 | if (attachpoint != 0) |
1713 | { | 1714 | { |
1714 | ava.SetAttachment(attachpoint, dsti.ID, dsti.AssetID); | 1715 | avatarAppearance.SetAttachment(attachpoint, destinationItem.ID, destinationItem.AssetID); |
1715 | m_log.DebugFormat("[RADMIN] Attached {0}", dsti.ID); | 1716 | m_log.DebugFormat("[RADMIN] Attached {0}", destinationItem.ID); |
1716 | } | 1717 | } |
1717 | } | 1718 | } |
1718 | } | 1719 | } |
@@ -1728,63 +1729,63 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1728 | /// other outfits are provided to allow "real" avatars a way to easily change their outfits. | 1729 | /// other outfits are provided to allow "real" avatars a way to easily change their outfits. |
1729 | /// </summary> | 1730 | /// </summary> |
1730 | 1731 | ||
1731 | private bool createDefaultAvatars() | 1732 | private bool CreateDefaultAvatars() |
1732 | { | 1733 | { |
1733 | // Only load once | 1734 | // Only load once |
1734 | 1735 | ||
1735 | if (daload) | 1736 | if (m_defaultAvatarsLoaded) |
1736 | { | 1737 | { |
1737 | return false; | 1738 | return false; |
1738 | } | 1739 | } |
1739 | 1740 | ||
1740 | m_log.DebugFormat("[RADMIN] Creating default avatar entries"); | 1741 | m_log.DebugFormat("[RADMIN] Creating default avatar entries"); |
1741 | 1742 | ||
1742 | daload = true; | 1743 | m_defaultAvatarsLoaded = true; |
1743 | 1744 | ||
1744 | // Load processing starts here... | 1745 | // Load processing starts here... |
1745 | 1746 | ||
1746 | try | 1747 | try |
1747 | { | 1748 | { |
1748 | string dafn = null; | 1749 | string defaultAppearanceFileName = null; |
1749 | 1750 | ||
1750 | //m_config may be null if RemoteAdmin configuration secition is missing or disabled in OpenSim.ini | 1751 | //m_config may be null if RemoteAdmin configuration secition is missing or disabled in OpenSim.ini |
1751 | if (m_config != null) | 1752 | if (m_config != null) |
1752 | { | 1753 | { |
1753 | dafn = m_config.GetString("default_appearance", "default_appearance.xml"); | 1754 | defaultAppearanceFileName = m_config.GetString("default_appearance", "default_appearance.xml"); |
1754 | } | 1755 | } |
1755 | 1756 | ||
1756 | if (File.Exists(dafn)) | 1757 | if (File.Exists(defaultAppearanceFileName)) |
1757 | { | 1758 | { |
1758 | XmlDocument doc = new XmlDocument(); | 1759 | XmlDocument doc = new XmlDocument(); |
1759 | string name = "*unknown*"; | 1760 | string name = "*unknown*"; |
1760 | string email = "anon@anon"; | 1761 | string email = "anon@anon"; |
1761 | uint regX = 1000; | 1762 | uint regionXLocation = 1000; |
1762 | uint regY = 1000; | 1763 | uint regionYLocation = 1000; |
1763 | string passwd = UUID.Random().ToString(); // No requirement to sign-in. | 1764 | string password = UUID.Random().ToString(); // No requirement to sign-in. |
1764 | UUID ID = UUID.Zero; | 1765 | UUID ID = UUID.Zero; |
1765 | AvatarAppearance mava; | 1766 | AvatarAppearance avatarAppearance; |
1766 | XmlNodeList avatars; | 1767 | XmlNodeList avatars; |
1767 | XmlNodeList assets; | 1768 | XmlNodeList assets; |
1768 | XmlNode perms = null; | 1769 | XmlNode perms = null; |
1769 | bool include = false; | 1770 | bool include = false; |
1770 | bool select = false; | 1771 | bool select = false; |
1771 | 1772 | ||
1772 | Scene scene = m_app.SceneManager.CurrentOrFirstScene; | 1773 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; |
1773 | IInventoryService iserv = scene.InventoryService; | 1774 | IInventoryService inventoryService = scene.InventoryService; |
1774 | IAssetService aserv = scene.AssetService; | 1775 | IAssetService assetService = scene.AssetService; |
1775 | 1776 | ||
1776 | doc.LoadXml(File.ReadAllText(dafn)); | 1777 | doc.LoadXml(File.ReadAllText(defaultAppearanceFileName)); |
1777 | 1778 | ||
1778 | // Load up any included assets. Duplicates will be ignored | 1779 | // Load up any included assets. Duplicates will be ignored |
1779 | assets = doc.GetElementsByTagName("RequiredAsset"); | 1780 | assets = doc.GetElementsByTagName("RequiredAsset"); |
1780 | foreach (XmlNode asset in assets) | 1781 | foreach (XmlNode assetNode in assets) |
1781 | { | 1782 | { |
1782 | AssetBase rass = new AssetBase(UUID.Random(), GetStringAttribute(asset, "name", ""), SByte.Parse(GetStringAttribute(asset, "type", "")), UUID.Zero.ToString()); | 1783 | AssetBase asset = new AssetBase(UUID.Random(), GetStringAttribute(assetNode, "name", ""), SByte.Parse(GetStringAttribute(assetNode, "type", "")), UUID.Zero.ToString()); |
1783 | rass.Description = GetStringAttribute(asset,"desc",""); | 1784 | asset.Description = GetStringAttribute(assetNode,"desc",""); |
1784 | rass.Local = Boolean.Parse(GetStringAttribute(asset,"local","")); | 1785 | asset.Local = Boolean.Parse(GetStringAttribute(assetNode,"local","")); |
1785 | rass.Temporary = Boolean.Parse(GetStringAttribute(asset,"temporary","")); | 1786 | asset.Temporary = Boolean.Parse(GetStringAttribute(assetNode,"temporary","")); |
1786 | rass.Data = Convert.FromBase64String(asset.InnerText); | 1787 | asset.Data = Convert.FromBase64String(assetNode.InnerText); |
1787 | aserv.Store(rass); | 1788 | assetService.Store(asset); |
1788 | } | 1789 | } |
1789 | 1790 | ||
1790 | avatars = doc.GetElementsByTagName("Avatar"); | 1791 | avatars = doc.GetElementsByTagName("Avatar"); |
@@ -1803,19 +1804,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1803 | // Only the name value is mandatory | 1804 | // Only the name value is mandatory |
1804 | name = GetStringAttribute(avatar,"name",name); | 1805 | name = GetStringAttribute(avatar,"name",name); |
1805 | email = GetStringAttribute(avatar,"email",email); | 1806 | email = GetStringAttribute(avatar,"email",email); |
1806 | regX = GetUnsignedAttribute(avatar,"regx",regX); | 1807 | regionXLocation = GetUnsignedAttribute(avatar,"regx",regionXLocation); |
1807 | regY = GetUnsignedAttribute(avatar,"regy",regY); | 1808 | regionYLocation = GetUnsignedAttribute(avatar,"regy",regionYLocation); |
1808 | passwd = GetStringAttribute(avatar,"password",passwd); | 1809 | password = GetStringAttribute(avatar,"password",password); |
1809 | 1810 | ||
1810 | string[] nomens = name.Split(); | 1811 | string[] names = name.Split(); |
1811 | UUID scopeID = scene.RegionInfo.ScopeID; | 1812 | UUID scopeID = scene.RegionInfo.ScopeID; |
1812 | UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, nomens[0], nomens[1]); | 1813 | UserAccount account = scene.UserAccountService.GetUserAccount(scopeID, names[0], names[1]); |
1813 | if (null == account) | 1814 | if (null == account) |
1814 | { | 1815 | { |
1815 | account = CreateUser(scopeID, nomens[0], nomens[1], passwd, email); | 1816 | account = CreateUser(scopeID, names[0], names[1], password, email); |
1816 | if (null == account) | 1817 | if (null == account) |
1817 | { | 1818 | { |
1818 | m_log.ErrorFormat("[RADMIN] Avatar {0} {1} was not created", nomens[0], nomens[1]); | 1819 | m_log.ErrorFormat("[RADMIN] Avatar {0} {1} was not created", names[0], names[1]); |
1819 | return false; | 1820 | return false; |
1820 | } | 1821 | } |
1821 | } | 1822 | } |
@@ -1823,12 +1824,12 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1823 | // Set home position | 1824 | // Set home position |
1824 | 1825 | ||
1825 | GridRegion home = scene.GridService.GetRegionByPosition(scopeID, | 1826 | GridRegion home = scene.GridService.GetRegionByPosition(scopeID, |
1826 | (int)(regX * Constants.RegionSize), (int)(regY * Constants.RegionSize)); | 1827 | (int)(regionXLocation * Constants.RegionSize), (int)(regionYLocation * Constants.RegionSize)); |
1827 | if (null == home) { | 1828 | if (null == home) { |
1828 | m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", nomens[0], nomens[1]); | 1829 | m_log.WarnFormat("[RADMIN]: Unable to set home region for newly created user account {0} {1}", names[0], names[1]); |
1829 | } else { | 1830 | } else { |
1830 | scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); | 1831 | scene.GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); |
1831 | m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, nomens[0], nomens[1]); | 1832 | m_log.DebugFormat("[RADMIN]: Set home region {0} for updated user account {1} {2}", home.RegionID, names[0], names[1]); |
1832 | } | 1833 | } |
1833 | 1834 | ||
1834 | ID = account.PrincipalID; | 1835 | ID = account.PrincipalID; |
@@ -1850,13 +1851,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1850 | if (include) | 1851 | if (include) |
1851 | { | 1852 | { |
1852 | // Setup for appearance processing | 1853 | // Setup for appearance processing |
1853 | AvatarData adata = scene.AvatarService.GetAvatar(ID); | 1854 | AvatarData avatarData = scene.AvatarService.GetAvatar(ID); |
1854 | if (adata != null) | 1855 | if (avatarData != null) |
1855 | mava = adata.ToAvatarAppearance(ID); | 1856 | avatarAppearance = avatarData.ToAvatarAppearance(ID); |
1856 | else | 1857 | else |
1857 | mava = new AvatarAppearance(); | 1858 | avatarAppearance = new AvatarAppearance(); |
1858 | 1859 | ||
1859 | AvatarWearable[] wearables = mava.Wearables; | 1860 | AvatarWearable[] wearables = avatarAppearance.Wearables; |
1860 | for (int i=0; i<wearables.Length; i++) | 1861 | for (int i=0; i<wearables.Length; i++) |
1861 | { | 1862 | { |
1862 | wearables[i] = new AvatarWearable(); | 1863 | wearables[i] = new AvatarWearable(); |
@@ -1867,19 +1868,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1867 | // m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory", | 1868 | // m_log.DebugFormat("[RADMIN] {0} folders, {1} items in inventory", |
1868 | // uic.folders.Count, uic.items.Count); | 1869 | // uic.folders.Count, uic.items.Count); |
1869 | 1870 | ||
1870 | InventoryFolderBase cfolder = iserv.GetFolderForType(ID, AssetType.Clothing); | 1871 | InventoryFolderBase clothingFolder = inventoryService.GetFolderForType(ID, AssetType.Clothing); |
1871 | 1872 | ||
1872 | // This should *never* be the case | 1873 | // This should *never* be the case |
1873 | if (cfolder == null || cfolder.Type != (short)AssetType.Clothing) | 1874 | if (clothingFolder == null || clothingFolder.Type != (short)AssetType.Clothing) |
1874 | { | 1875 | { |
1875 | cfolder = new InventoryFolderBase(); | 1876 | clothingFolder = new InventoryFolderBase(); |
1876 | cfolder.ID = UUID.Random(); | 1877 | clothingFolder.ID = UUID.Random(); |
1877 | cfolder.Name = "Clothing"; | 1878 | clothingFolder.Name = "Clothing"; |
1878 | cfolder.Owner = ID; | 1879 | clothingFolder.Owner = ID; |
1879 | cfolder.Type = (short)AssetType.Clothing; | 1880 | clothingFolder.Type = (short)AssetType.Clothing; |
1880 | cfolder.ParentID = iserv.GetRootFolder(ID).ID; | 1881 | clothingFolder.ParentID = inventoryService.GetRootFolder(ID).ID; |
1881 | cfolder.Version = 1; | 1882 | clothingFolder.Version = 1; |
1882 | iserv.AddFolder(cfolder); // store base record | 1883 | inventoryService.AddFolder(clothingFolder); // store base record |
1883 | m_log.ErrorFormat("[RADMIN] Created clothing folder for {0}/{1}", name, ID); | 1884 | m_log.ErrorFormat("[RADMIN] Created clothing folder for {0}/{1}", name, ID); |
1884 | } | 1885 | } |
1885 | 1886 | ||
@@ -1887,8 +1888,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1887 | // default appearance XMl file. | 1888 | // default appearance XMl file. |
1888 | 1889 | ||
1889 | XmlNodeList outfits = avatar.GetElementsByTagName("Ensemble"); | 1890 | XmlNodeList outfits = avatar.GetElementsByTagName("Ensemble"); |
1890 | InventoryFolderBase efolder; | 1891 | InventoryFolderBase extraFolder; |
1891 | string oname; | 1892 | string outfitName; |
1892 | UUID assetid; | 1893 | UUID assetid; |
1893 | 1894 | ||
1894 | foreach (XmlElement outfit in outfits) | 1895 | foreach (XmlElement outfit in outfits) |
@@ -1896,37 +1897,37 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1896 | m_log.DebugFormat("[RADMIN] Loading outfit {0} for {1}", | 1897 | m_log.DebugFormat("[RADMIN] Loading outfit {0} for {1}", |
1897 | GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?")); | 1898 | GetStringAttribute(outfit,"name","?"), GetStringAttribute(avatar,"name","?")); |
1898 | 1899 | ||
1899 | oname = GetStringAttribute(outfit,"name",""); | 1900 | outfitName = GetStringAttribute(outfit,"name",""); |
1900 | select = (GetStringAttribute(outfit,"default","no") == "yes"); | 1901 | select = (GetStringAttribute(outfit,"default","no") == "yes"); |
1901 | 1902 | ||
1902 | // If the folder already exists, re-use it. The defaults may | 1903 | // If the folder already exists, re-use it. The defaults may |
1903 | // change over time. Augment only. | 1904 | // change over time. Augment only. |
1904 | 1905 | ||
1905 | List<InventoryFolderBase> folders = iserv.GetFolderContent(ID, cfolder.ID).Folders; | 1906 | List<InventoryFolderBase> folders = inventoryService.GetFolderContent(ID, clothingFolder.ID).Folders; |
1906 | efolder = null; | 1907 | extraFolder = null; |
1907 | 1908 | ||
1908 | foreach (InventoryFolderBase folder in folders) | 1909 | foreach (InventoryFolderBase folder in folders) |
1909 | { | 1910 | { |
1910 | if (folder.Name == oname) | 1911 | if (folder.Name == outfitName) |
1911 | { | 1912 | { |
1912 | efolder = folder; | 1913 | extraFolder = folder; |
1913 | break; | 1914 | break; |
1914 | } | 1915 | } |
1915 | } | 1916 | } |
1916 | 1917 | ||
1917 | // Otherwise, we must create the folder. | 1918 | // Otherwise, we must create the folder. |
1918 | if (efolder == null) | 1919 | if (extraFolder == null) |
1919 | { | 1920 | { |
1920 | m_log.DebugFormat("[RADMIN] Creating outfit folder {0} for {1}", oname, name); | 1921 | m_log.DebugFormat("[RADMIN] Creating outfit folder {0} for {1}", outfitName, name); |
1921 | efolder = new InventoryFolderBase(); | 1922 | extraFolder = new InventoryFolderBase(); |
1922 | efolder.ID = UUID.Random(); | 1923 | extraFolder.ID = UUID.Random(); |
1923 | efolder.Name = oname; | 1924 | extraFolder.Name = outfitName; |
1924 | efolder.Owner = ID; | 1925 | extraFolder.Owner = ID; |
1925 | efolder.Type = (short)AssetType.Clothing; | 1926 | extraFolder.Type = (short)AssetType.Clothing; |
1926 | efolder.Version = 1; | 1927 | extraFolder.Version = 1; |
1927 | efolder.ParentID = cfolder.ID; | 1928 | extraFolder.ParentID = clothingFolder.ID; |
1928 | iserv.AddFolder(efolder); | 1929 | inventoryService.AddFolder(extraFolder); |
1929 | m_log.DebugFormat("[RADMIN] Adding outfile folder {0} to folder {1}", efolder.ID, cfolder.ID); | 1930 | m_log.DebugFormat("[RADMIN] Adding outfile folder {0} to folder {1}", extraFolder.ID, clothingFolder.ID); |
1930 | } | 1931 | } |
1931 | 1932 | ||
1932 | // Now get the pieces that make up the outfit | 1933 | // Now get the pieces that make up the outfit |
@@ -1950,55 +1951,55 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1950 | } | 1951 | } |
1951 | } | 1952 | } |
1952 | 1953 | ||
1953 | InventoryItemBase iitem = null; | 1954 | InventoryItemBase inventoryItem = null; |
1954 | 1955 | ||
1955 | // Check if asset is in inventory already | 1956 | // Check if asset is in inventory already |
1956 | iitem = null; | 1957 | inventoryItem = null; |
1957 | List<InventoryItemBase> iitems = iserv.GetFolderContent(ID, efolder.ID).Items; | 1958 | List<InventoryItemBase> inventoryItems = inventoryService.GetFolderContent(ID, extraFolder.ID).Items; |
1958 | 1959 | ||
1959 | foreach (InventoryItemBase litem in iitems) | 1960 | foreach (InventoryItemBase listItem in inventoryItems) |
1960 | { | 1961 | { |
1961 | if (litem.AssetID == assetid) | 1962 | if (listItem.AssetID == assetid) |
1962 | { | 1963 | { |
1963 | iitem = litem; | 1964 | inventoryItem = listItem; |
1964 | break; | 1965 | break; |
1965 | } | 1966 | } |
1966 | } | 1967 | } |
1967 | 1968 | ||
1968 | // Create inventory item | 1969 | // Create inventory item |
1969 | if (iitem == null) | 1970 | if (inventoryItem == null) |
1970 | { | 1971 | { |
1971 | iitem = new InventoryItemBase(UUID.Random(), ID); | 1972 | inventoryItem = new InventoryItemBase(UUID.Random(), ID); |
1972 | iitem.Name = GetStringAttribute(item,"name",""); | 1973 | inventoryItem.Name = GetStringAttribute(item,"name",""); |
1973 | iitem.Description = GetStringAttribute(item,"desc",""); | 1974 | inventoryItem.Description = GetStringAttribute(item,"desc",""); |
1974 | iitem.InvType = GetIntegerAttribute(item,"invtype",-1); | 1975 | inventoryItem.InvType = GetIntegerAttribute(item,"invtype",-1); |
1975 | iitem.CreatorId = GetStringAttribute(item,"creatorid",""); | 1976 | inventoryItem.CreatorId = GetStringAttribute(item,"creatorid",""); |
1976 | iitem.CreatorIdAsUuid = (UUID)GetStringAttribute(item,"creatoruuid",""); | 1977 | inventoryItem.CreatorIdAsUuid = (UUID)GetStringAttribute(item,"creatoruuid",""); |
1977 | iitem.NextPermissions = GetUnsignedAttribute(perms,"next",0x7fffffff); | 1978 | inventoryItem.NextPermissions = GetUnsignedAttribute(perms,"next",0x7fffffff); |
1978 | iitem.CurrentPermissions = GetUnsignedAttribute(perms,"current",0x7fffffff); | 1979 | inventoryItem.CurrentPermissions = GetUnsignedAttribute(perms,"current",0x7fffffff); |
1979 | iitem.BasePermissions = GetUnsignedAttribute(perms,"base",0x7fffffff); | 1980 | inventoryItem.BasePermissions = GetUnsignedAttribute(perms,"base",0x7fffffff); |
1980 | iitem.EveryOnePermissions = GetUnsignedAttribute(perms,"everyone",0x7fffffff); | 1981 | inventoryItem.EveryOnePermissions = GetUnsignedAttribute(perms,"everyone",0x7fffffff); |
1981 | iitem.GroupPermissions = GetUnsignedAttribute(perms,"group",0x7fffffff); | 1982 | inventoryItem.GroupPermissions = GetUnsignedAttribute(perms,"group",0x7fffffff); |
1982 | iitem.AssetType = GetIntegerAttribute(item,"assettype",-1); | 1983 | inventoryItem.AssetType = GetIntegerAttribute(item,"assettype",-1); |
1983 | iitem.AssetID = assetid; // associated asset | 1984 | inventoryItem.AssetID = assetid; // associated asset |
1984 | iitem.GroupID = (UUID)GetStringAttribute(item,"groupid",""); | 1985 | inventoryItem.GroupID = (UUID)GetStringAttribute(item,"groupid",""); |
1985 | iitem.GroupOwned = (GetStringAttribute(item,"groupowned","false") == "true"); | 1986 | inventoryItem.GroupOwned = (GetStringAttribute(item,"groupowned","false") == "true"); |
1986 | iitem.SalePrice = GetIntegerAttribute(item,"saleprice",0); | 1987 | inventoryItem.SalePrice = GetIntegerAttribute(item,"saleprice",0); |
1987 | iitem.SaleType = (byte)GetIntegerAttribute(item,"saletype",0); | 1988 | inventoryItem.SaleType = (byte)GetIntegerAttribute(item,"saletype",0); |
1988 | iitem.Flags = GetUnsignedAttribute(item,"flags",0); | 1989 | inventoryItem.Flags = GetUnsignedAttribute(item,"flags",0); |
1989 | iitem.CreationDate = GetIntegerAttribute(item,"creationdate",Util.UnixTimeSinceEpoch()); | 1990 | inventoryItem.CreationDate = GetIntegerAttribute(item,"creationdate",Util.UnixTimeSinceEpoch()); |
1990 | iitem.Folder = efolder.ID; // Parent folder | 1991 | inventoryItem.Folder = extraFolder.ID; // Parent folder |
1991 | 1992 | ||
1992 | iserv.AddItem(iitem); | 1993 | inventoryService.AddItem(inventoryItem); |
1993 | m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", iitem.ID, efolder.ID); | 1994 | m_log.DebugFormat("[RADMIN] Added item {0} to folder {1}", inventoryItem.ID, extraFolder.ID); |
1994 | } | 1995 | } |
1995 | 1996 | ||
1996 | // Attach item, if attachpoint is specified | 1997 | // Attach item, if attachpoint is specified |
1997 | int attachpoint = GetIntegerAttribute(item,"attachpoint",0); | 1998 | int attachpoint = GetIntegerAttribute(item,"attachpoint",0); |
1998 | if (attachpoint != 0) | 1999 | if (attachpoint != 0) |
1999 | { | 2000 | { |
2000 | mava.SetAttachment(attachpoint, iitem.ID, iitem.AssetID); | 2001 | avatarAppearance.SetAttachment(attachpoint, inventoryItem.ID, inventoryItem.AssetID); |
2001 | m_log.DebugFormat("[RADMIN] Attached {0}", iitem.ID); | 2002 | m_log.DebugFormat("[RADMIN] Attached {0}", inventoryItem.ID); |
2002 | } | 2003 | } |
2003 | 2004 | ||
2004 | // Record whether or not the item is to be initially worn | 2005 | // Record whether or not the item is to be initially worn |
@@ -2006,20 +2007,20 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2006 | { | 2007 | { |
2007 | if (select && (GetStringAttribute(item, "wear", "false") == "true")) | 2008 | if (select && (GetStringAttribute(item, "wear", "false") == "true")) |
2008 | { | 2009 | { |
2009 | mava.Wearables[iitem.Flags].ItemID = iitem.ID; | 2010 | avatarAppearance.Wearables[inventoryItem.Flags].ItemID = inventoryItem.ID; |
2010 | mava.Wearables[iitem.Flags].AssetID = iitem.AssetID; | 2011 | avatarAppearance.Wearables[inventoryItem.Flags].AssetID = inventoryItem.AssetID; |
2011 | } | 2012 | } |
2012 | } | 2013 | } |
2013 | catch (Exception e) | 2014 | catch (Exception e) |
2014 | { | 2015 | { |
2015 | m_log.WarnFormat("[RADMIN] Error wearing item {0} : {1}", iitem.ID, e.Message); | 2016 | m_log.WarnFormat("[RADMIN] Error wearing item {0} : {1}", inventoryItem.ID, e.Message); |
2016 | } | 2017 | } |
2017 | } // foreach item in outfit | 2018 | } // foreach item in outfit |
2018 | m_log.DebugFormat("[RADMIN] Outfit {0} load completed", oname); | 2019 | m_log.DebugFormat("[RADMIN] Outfit {0} load completed", outfitName); |
2019 | } // foreach outfit | 2020 | } // foreach outfit |
2020 | m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); | 2021 | m_log.DebugFormat("[RADMIN] Inventory update complete for {0}", name); |
2021 | AvatarData adata2 = new AvatarData(mava); | 2022 | AvatarData avatarData2 = new AvatarData(avatarAppearance); |
2022 | scene.AvatarService.SetAvatar(ID, adata2); | 2023 | scene.AvatarService.SetAvatar(ID, avatarData2); |
2023 | } | 2024 | } |
2024 | catch (Exception e) | 2025 | catch (Exception e) |
2025 | { | 2026 | { |
@@ -2086,19 +2087,19 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2086 | XmlRpcResponse response = new XmlRpcResponse(); | 2087 | XmlRpcResponse response = new XmlRpcResponse(); |
2087 | Hashtable responseData = new Hashtable(); | 2088 | Hashtable responseData = new Hashtable(); |
2088 | 2089 | ||
2089 | lock (rslock) | 2090 | lock (m_requestLock) |
2090 | { | 2091 | { |
2091 | try | 2092 | try |
2092 | { | 2093 | { |
2093 | Hashtable requestData = (Hashtable) request.Params[0]; | 2094 | Hashtable requestData = (Hashtable) request.Params[0]; |
2094 | 2095 | ||
2095 | // check completeness | 2096 | // check completeness |
2096 | foreach (string p in new string[] {"password", "filename"}) | 2097 | foreach (string parameter in new string[] {"password", "filename"}) |
2097 | { | 2098 | { |
2098 | if (!requestData.Contains(p)) | 2099 | if (!requestData.Contains(parameter)) |
2099 | throw new Exception(String.Format("missing parameter {0}", p)); | 2100 | throw new Exception(String.Format("missing parameter {0}", parameter)); |
2100 | if (String.IsNullOrEmpty((string) requestData[p])) | 2101 | if (String.IsNullOrEmpty((string) requestData[parameter])) |
2101 | throw new Exception(String.Format("parameter {0} is empty")); | 2102 | throw new Exception(String.Format("parameter {0} is empty", parameter)); |
2102 | } | 2103 | } |
2103 | 2104 | ||
2104 | // check password | 2105 | // check password |
@@ -2110,13 +2111,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2110 | if (requestData.Contains("region_uuid")) | 2111 | if (requestData.Contains("region_uuid")) |
2111 | { | 2112 | { |
2112 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2113 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2113 | if (!m_app.SceneManager.TryGetScene(region_uuid, out scene)) | 2114 | if (!m_application.SceneManager.TryGetScene(region_uuid, out scene)) |
2114 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2115 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2115 | } | 2116 | } |
2116 | else if (requestData.Contains("region_name")) | 2117 | else if (requestData.Contains("region_name")) |
2117 | { | 2118 | { |
2118 | string region_name = (string) requestData["region_name"]; | 2119 | string region_name = (string) requestData["region_name"]; |
2119 | if (!m_app.SceneManager.TryGetScene(region_name, out scene)) | 2120 | if (!m_application.SceneManager.TryGetScene(region_name, out scene)) |
2120 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2121 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2121 | } | 2122 | } |
2122 | else throw new Exception("neither region_name nor region_uuid given"); | 2123 | else throw new Exception("neither region_name nor region_uuid given"); |
@@ -2210,13 +2211,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2210 | if (requestData.Contains("region_uuid")) | 2211 | if (requestData.Contains("region_uuid")) |
2211 | { | 2212 | { |
2212 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2213 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2213 | if (!m_app.SceneManager.TryGetScene(region_uuid, out scene)) | 2214 | if (!m_application.SceneManager.TryGetScene(region_uuid, out scene)) |
2214 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2215 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2215 | } | 2216 | } |
2216 | else if (requestData.Contains("region_name")) | 2217 | else if (requestData.Contains("region_name")) |
2217 | { | 2218 | { |
2218 | string region_name = (string) requestData["region_name"]; | 2219 | string region_name = (string) requestData["region_name"]; |
2219 | if (!m_app.SceneManager.TryGetScene(region_name, out scene)) | 2220 | if (!m_application.SceneManager.TryGetScene(region_name, out scene)) |
2220 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2221 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2221 | } | 2222 | } |
2222 | else throw new Exception("neither region_name nor region_uuid given"); | 2223 | else throw new Exception("neither region_name nor region_uuid given"); |
@@ -2227,7 +2228,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2227 | { | 2228 | { |
2228 | scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted; | 2229 | scene.EventManager.OnOarFileSaved += RemoteAdminOarSaveCompleted; |
2229 | archiver.ArchiveRegion(filename); | 2230 | archiver.ArchiveRegion(filename); |
2230 | lock (SOLock) Monitor.Wait(SOLock,5000); | 2231 | lock (m_saveOarLock) Monitor.Wait(m_saveOarLock,5000); |
2231 | scene.EventManager.OnOarFileSaved -= RemoteAdminOarSaveCompleted; | 2232 | scene.EventManager.OnOarFileSaved -= RemoteAdminOarSaveCompleted; |
2232 | } | 2233 | } |
2233 | else | 2234 | else |
@@ -2255,7 +2256,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2255 | private void RemoteAdminOarSaveCompleted(Guid uuid, string name) | 2256 | private void RemoteAdminOarSaveCompleted(Guid uuid, string name) |
2256 | { | 2257 | { |
2257 | m_log.DebugFormat("[RADMIN] File processing complete for {0}", name); | 2258 | m_log.DebugFormat("[RADMIN] File processing complete for {0}", name); |
2258 | lock (SOLock) Monitor.Pulse(SOLock); | 2259 | lock (m_saveOarLock) Monitor.Pulse(m_saveOarLock); |
2259 | } | 2260 | } |
2260 | 2261 | ||
2261 | public XmlRpcResponse XmlRpcLoadXMLMethod(XmlRpcRequest request, IPEndPoint remoteClient) | 2262 | public XmlRpcResponse XmlRpcLoadXMLMethod(XmlRpcRequest request, IPEndPoint remoteClient) |
@@ -2267,7 +2268,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2267 | XmlRpcResponse response = new XmlRpcResponse(); | 2268 | XmlRpcResponse response = new XmlRpcResponse(); |
2268 | Hashtable responseData = new Hashtable(); | 2269 | Hashtable responseData = new Hashtable(); |
2269 | 2270 | ||
2270 | lock (rslock) | 2271 | lock (m_requestLock) |
2271 | { | 2272 | { |
2272 | try | 2273 | try |
2273 | { | 2274 | { |
@@ -2290,14 +2291,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2290 | if (requestData.Contains("region_uuid")) | 2291 | if (requestData.Contains("region_uuid")) |
2291 | { | 2292 | { |
2292 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2293 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2293 | if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) | 2294 | if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) |
2294 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2295 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2295 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); | 2296 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); |
2296 | } | 2297 | } |
2297 | else if (requestData.Contains("region_name")) | 2298 | else if (requestData.Contains("region_name")) |
2298 | { | 2299 | { |
2299 | string region_name = (string) requestData["region_name"]; | 2300 | string region_name = (string) requestData["region_name"]; |
2300 | if (!m_app.SceneManager.TrySetCurrentScene(region_name)) | 2301 | if (!m_application.SceneManager.TrySetCurrentScene(region_name)) |
2301 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2302 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2302 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); | 2303 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); |
2303 | } | 2304 | } |
@@ -2314,11 +2315,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2314 | switch (xml_version) | 2315 | switch (xml_version) |
2315 | { | 2316 | { |
2316 | case "1": | 2317 | case "1": |
2317 | m_app.SceneManager.LoadCurrentSceneFromXml(filename, true, new Vector3(0, 0, 0)); | 2318 | m_application.SceneManager.LoadCurrentSceneFromXml(filename, true, new Vector3(0, 0, 0)); |
2318 | break; | 2319 | break; |
2319 | 2320 | ||
2320 | case "2": | 2321 | case "2": |
2321 | m_app.SceneManager.LoadCurrentSceneFromXml2(filename); | 2322 | m_application.SceneManager.LoadCurrentSceneFromXml2(filename); |
2322 | break; | 2323 | break; |
2323 | 2324 | ||
2324 | default: | 2325 | default: |
@@ -2375,14 +2376,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2375 | if (requestData.Contains("region_uuid")) | 2376 | if (requestData.Contains("region_uuid")) |
2376 | { | 2377 | { |
2377 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2378 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2378 | if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) | 2379 | if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) |
2379 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2380 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2380 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); | 2381 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); |
2381 | } | 2382 | } |
2382 | else if (requestData.Contains("region_name")) | 2383 | else if (requestData.Contains("region_name")) |
2383 | { | 2384 | { |
2384 | string region_name = (string) requestData["region_name"]; | 2385 | string region_name = (string) requestData["region_name"]; |
2385 | if (!m_app.SceneManager.TrySetCurrentScene(region_name)) | 2386 | if (!m_application.SceneManager.TrySetCurrentScene(region_name)) |
2386 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2387 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2387 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); | 2388 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); |
2388 | } | 2389 | } |
@@ -2399,11 +2400,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2399 | switch (xml_version) | 2400 | switch (xml_version) |
2400 | { | 2401 | { |
2401 | case "1": | 2402 | case "1": |
2402 | m_app.SceneManager.SaveCurrentSceneToXml(filename); | 2403 | m_application.SceneManager.SaveCurrentSceneToXml(filename); |
2403 | break; | 2404 | break; |
2404 | 2405 | ||
2405 | case "2": | 2406 | case "2": |
2406 | m_app.SceneManager.SaveCurrentSceneToXml2(filename); | 2407 | m_application.SceneManager.SaveCurrentSceneToXml2(filename); |
2407 | break; | 2408 | break; |
2408 | 2409 | ||
2409 | default: | 2410 | default: |
@@ -2454,21 +2455,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2454 | if (requestData.Contains("region_uuid")) | 2455 | if (requestData.Contains("region_uuid")) |
2455 | { | 2456 | { |
2456 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2457 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2457 | if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) | 2458 | if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) |
2458 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2459 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2459 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); | 2460 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); |
2460 | } | 2461 | } |
2461 | else if (requestData.Contains("region_name")) | 2462 | else if (requestData.Contains("region_name")) |
2462 | { | 2463 | { |
2463 | string region_name = (string) requestData["region_name"]; | 2464 | string region_name = (string) requestData["region_name"]; |
2464 | if (!m_app.SceneManager.TrySetCurrentScene(region_name)) | 2465 | if (!m_application.SceneManager.TrySetCurrentScene(region_name)) |
2465 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2466 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2466 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); | 2467 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); |
2467 | } | 2468 | } |
2468 | else throw new Exception("neither region_name nor region_uuid given"); | 2469 | else throw new Exception("neither region_name nor region_uuid given"); |
2469 | 2470 | ||
2470 | Scene s = m_app.SceneManager.CurrentScene; | 2471 | Scene scene = m_application.SceneManager.CurrentScene; |
2471 | int health = s.GetHealth(); | 2472 | int health = scene.GetHealth(); |
2472 | responseData["health"] = health; | 2473 | responseData["health"] = health; |
2473 | 2474 | ||
2474 | response.Value = responseData; | 2475 | response.Value = responseData; |
@@ -2551,23 +2552,23 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2551 | if (requestData.Contains("region_uuid")) | 2552 | if (requestData.Contains("region_uuid")) |
2552 | { | 2553 | { |
2553 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2554 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2554 | if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) | 2555 | if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) |
2555 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2556 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2556 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); | 2557 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); |
2557 | } | 2558 | } |
2558 | else if (requestData.Contains("region_name")) | 2559 | else if (requestData.Contains("region_name")) |
2559 | { | 2560 | { |
2560 | string region_name = (string) requestData["region_name"]; | 2561 | string region_name = (string) requestData["region_name"]; |
2561 | if (!m_app.SceneManager.TrySetCurrentScene(region_name)) | 2562 | if (!m_application.SceneManager.TrySetCurrentScene(region_name)) |
2562 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2563 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2563 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); | 2564 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); |
2564 | } | 2565 | } |
2565 | else throw new Exception("neither region_name nor region_uuid given"); | 2566 | else throw new Exception("neither region_name nor region_uuid given"); |
2566 | 2567 | ||
2567 | Scene s = m_app.SceneManager.CurrentScene; | 2568 | Scene scene = m_application.SceneManager.CurrentScene; |
2568 | s.RegionInfo.EstateSettings.EstateAccess = new UUID[]{}; | 2569 | scene.RegionInfo.EstateSettings.EstateAccess = new UUID[]{}; |
2569 | if (s.RegionInfo.Persistent) | 2570 | if (scene.RegionInfo.Persistent) |
2570 | s.RegionInfo.EstateSettings.Save(); | 2571 | scene.RegionInfo.EstateSettings.Save(); |
2571 | } | 2572 | } |
2572 | catch (Exception e) | 2573 | catch (Exception e) |
2573 | { | 2574 | { |
@@ -2608,26 +2609,26 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2608 | if (requestData.Contains("region_uuid")) | 2609 | if (requestData.Contains("region_uuid")) |
2609 | { | 2610 | { |
2610 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2611 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2611 | if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) | 2612 | if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) |
2612 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2613 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2613 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); | 2614 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); |
2614 | } | 2615 | } |
2615 | else if (requestData.Contains("region_name")) | 2616 | else if (requestData.Contains("region_name")) |
2616 | { | 2617 | { |
2617 | string region_name = (string) requestData["region_name"]; | 2618 | string region_name = (string) requestData["region_name"]; |
2618 | if (!m_app.SceneManager.TrySetCurrentScene(region_name)) | 2619 | if (!m_application.SceneManager.TrySetCurrentScene(region_name)) |
2619 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2620 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2620 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); | 2621 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); |
2621 | } | 2622 | } |
2622 | else throw new Exception("neither region_name nor region_uuid given"); | 2623 | else throw new Exception("neither region_name nor region_uuid given"); |
2623 | 2624 | ||
2624 | int addk = 0; | 2625 | int addedUsers = 0; |
2625 | 2626 | ||
2626 | if (requestData.Contains("users")) | 2627 | if (requestData.Contains("users")) |
2627 | { | 2628 | { |
2628 | UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; | 2629 | UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; |
2629 | IUserAccountService userService = m_app.SceneManager.CurrentOrFirstScene.UserAccountService; | 2630 | IUserAccountService userService = m_application.SceneManager.CurrentOrFirstScene.UserAccountService; |
2630 | Scene s = m_app.SceneManager.CurrentScene; | 2631 | Scene scene = m_application.SceneManager.CurrentScene; |
2631 | Hashtable users = (Hashtable) requestData["users"]; | 2632 | Hashtable users = (Hashtable) requestData["users"]; |
2632 | List<UUID> uuids = new List<UUID>(); | 2633 | List<UUID> uuids = new List<UUID>(); |
2633 | foreach (string name in users.Values) | 2634 | foreach (string name in users.Values) |
@@ -2637,24 +2638,24 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2637 | if (account != null) | 2638 | if (account != null) |
2638 | { | 2639 | { |
2639 | uuids.Add(account.PrincipalID); | 2640 | uuids.Add(account.PrincipalID); |
2640 | m_log.DebugFormat("[RADMIN] adding \"{0}\" to ACL for \"{1}\"", name, s.RegionInfo.RegionName); | 2641 | m_log.DebugFormat("[RADMIN] adding \"{0}\" to ACL for \"{1}\"", name, scene.RegionInfo.RegionName); |
2641 | } | 2642 | } |
2642 | } | 2643 | } |
2643 | List<UUID> acl = new List<UUID>(s.RegionInfo.EstateSettings.EstateAccess); | 2644 | List<UUID> accessControlList = new List<UUID>(scene.RegionInfo.EstateSettings.EstateAccess); |
2644 | foreach (UUID uuid in uuids) | 2645 | foreach (UUID uuid in uuids) |
2645 | { | 2646 | { |
2646 | if (!acl.Contains(uuid)) | 2647 | if (!accessControlList.Contains(uuid)) |
2647 | { | 2648 | { |
2648 | acl.Add(uuid); | 2649 | accessControlList.Add(uuid); |
2649 | addk++; | 2650 | addedUsers++; |
2650 | } | 2651 | } |
2651 | } | 2652 | } |
2652 | s.RegionInfo.EstateSettings.EstateAccess = acl.ToArray(); | 2653 | scene.RegionInfo.EstateSettings.EstateAccess = accessControlList.ToArray(); |
2653 | if (s.RegionInfo.Persistent) | 2654 | if (scene.RegionInfo.Persistent) |
2654 | s.RegionInfo.EstateSettings.Save(); | 2655 | scene.RegionInfo.EstateSettings.Save(); |
2655 | } | 2656 | } |
2656 | 2657 | ||
2657 | responseData["added"] = addk; | 2658 | responseData["added"] = addedUsers; |
2658 | } | 2659 | } |
2659 | catch (Exception e) | 2660 | catch (Exception e) |
2660 | { | 2661 | { |
@@ -2695,27 +2696,27 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2695 | if (requestData.Contains("region_uuid")) | 2696 | if (requestData.Contains("region_uuid")) |
2696 | { | 2697 | { |
2697 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2698 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2698 | if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) | 2699 | if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) |
2699 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2700 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2700 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); | 2701 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); |
2701 | } | 2702 | } |
2702 | else if (requestData.Contains("region_name")) | 2703 | else if (requestData.Contains("region_name")) |
2703 | { | 2704 | { |
2704 | string region_name = (string) requestData["region_name"]; | 2705 | string region_name = (string) requestData["region_name"]; |
2705 | if (!m_app.SceneManager.TrySetCurrentScene(region_name)) | 2706 | if (!m_application.SceneManager.TrySetCurrentScene(region_name)) |
2706 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2707 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2707 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); | 2708 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); |
2708 | } | 2709 | } |
2709 | else throw new Exception("neither region_name nor region_uuid given"); | 2710 | else throw new Exception("neither region_name nor region_uuid given"); |
2710 | 2711 | ||
2711 | int remk = 0; | 2712 | int removedUsers = 0; |
2712 | 2713 | ||
2713 | if (requestData.Contains("users")) | 2714 | if (requestData.Contains("users")) |
2714 | { | 2715 | { |
2715 | UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; | 2716 | UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; |
2716 | IUserAccountService userService = m_app.SceneManager.CurrentOrFirstScene.UserAccountService; | 2717 | IUserAccountService userService = m_application.SceneManager.CurrentOrFirstScene.UserAccountService; |
2717 | //UserProfileCacheService ups = m_app.CommunicationsManager.UserProfileCacheService; | 2718 | //UserProfileCacheService ups = m_application.CommunicationsManager.UserProfileCacheService; |
2718 | Scene s = m_app.SceneManager.CurrentScene; | 2719 | Scene scene = m_application.SceneManager.CurrentScene; |
2719 | Hashtable users = (Hashtable) requestData["users"]; | 2720 | Hashtable users = (Hashtable) requestData["users"]; |
2720 | List<UUID> uuids = new List<UUID>(); | 2721 | List<UUID> uuids = new List<UUID>(); |
2721 | foreach (string name in users.Values) | 2722 | foreach (string name in users.Values) |
@@ -2727,21 +2728,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2727 | uuids.Add(account.PrincipalID); | 2728 | uuids.Add(account.PrincipalID); |
2728 | } | 2729 | } |
2729 | } | 2730 | } |
2730 | List<UUID> acl = new List<UUID>(s.RegionInfo.EstateSettings.EstateAccess); | 2731 | List<UUID> accessControlList = new List<UUID>(scene.RegionInfo.EstateSettings.EstateAccess); |
2731 | foreach (UUID uuid in uuids) | 2732 | foreach (UUID uuid in uuids) |
2732 | { | 2733 | { |
2733 | if (acl.Contains(uuid)) | 2734 | if (accessControlList.Contains(uuid)) |
2734 | { | 2735 | { |
2735 | acl.Remove(uuid); | 2736 | accessControlList.Remove(uuid); |
2736 | remk++; | 2737 | removedUsers++; |
2737 | } | 2738 | } |
2738 | } | 2739 | } |
2739 | s.RegionInfo.EstateSettings.EstateAccess = acl.ToArray(); | 2740 | scene.RegionInfo.EstateSettings.EstateAccess = accessControlList.ToArray(); |
2740 | if (s.RegionInfo.Persistent) | 2741 | if (scene.RegionInfo.Persistent) |
2741 | s.RegionInfo.EstateSettings.Save(); | 2742 | scene.RegionInfo.EstateSettings.Save(); |
2742 | } | 2743 | } |
2743 | 2744 | ||
2744 | responseData["removed"] = remk; | 2745 | responseData["removed"] = removedUsers; |
2745 | } | 2746 | } |
2746 | catch (Exception e) | 2747 | catch (Exception e) |
2747 | { | 2748 | { |
@@ -2782,27 +2783,27 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2782 | if (requestData.Contains("region_uuid")) | 2783 | if (requestData.Contains("region_uuid")) |
2783 | { | 2784 | { |
2784 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; | 2785 | UUID region_uuid = (UUID) (string) requestData["region_uuid"]; |
2785 | if (!m_app.SceneManager.TrySetCurrentScene(region_uuid)) | 2786 | if (!m_application.SceneManager.TrySetCurrentScene(region_uuid)) |
2786 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); | 2787 | throw new Exception(String.Format("failed to switch to region {0}", region_uuid.ToString())); |
2787 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); | 2788 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_uuid.ToString()); |
2788 | } | 2789 | } |
2789 | else if (requestData.Contains("region_name")) | 2790 | else if (requestData.Contains("region_name")) |
2790 | { | 2791 | { |
2791 | string region_name = (string) requestData["region_name"]; | 2792 | string region_name = (string) requestData["region_name"]; |
2792 | if (!m_app.SceneManager.TrySetCurrentScene(region_name)) | 2793 | if (!m_application.SceneManager.TrySetCurrentScene(region_name)) |
2793 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); | 2794 | throw new Exception(String.Format("failed to switch to region {0}", region_name)); |
2794 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); | 2795 | m_log.InfoFormat("[RADMIN] Switched to region {0}", region_name); |
2795 | } | 2796 | } |
2796 | else throw new Exception("neither region_name nor region_uuid given"); | 2797 | else throw new Exception("neither region_name nor region_uuid given"); |
2797 | 2798 | ||
2798 | Scene s = m_app.SceneManager.CurrentScene; | 2799 | Scene scene = m_application.SceneManager.CurrentScene; |
2799 | UUID[] acl = s.RegionInfo.EstateSettings.EstateAccess; | 2800 | UUID[] accessControlList = scene.RegionInfo.EstateSettings.EstateAccess; |
2800 | Hashtable users = new Hashtable(); | 2801 | Hashtable users = new Hashtable(); |
2801 | 2802 | ||
2802 | foreach (UUID user in acl) | 2803 | foreach (UUID user in accessControlList) |
2803 | { | 2804 | { |
2804 | UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; | 2805 | UUID scopeID = m_application.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID; |
2805 | UserAccount account = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, user); | 2806 | UserAccount account = m_application.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, user); |
2806 | if (account != null) | 2807 | if (account != null) |
2807 | { | 2808 | { |
2808 | users[user.ToString()] = account.FirstName + " " + account.LastName; | 2809 | users[user.ToString()] = account.FirstName + " " + account.LastName; |
@@ -2827,29 +2828,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2827 | return response; | 2828 | return response; |
2828 | } | 2829 | } |
2829 | 2830 | ||
2830 | private static void checkStringParameters(XmlRpcRequest request, string[] param) | 2831 | private static void CheckStringParameters(XmlRpcRequest request, string[] param) |
2831 | { | 2832 | { |
2832 | Hashtable requestData = (Hashtable) request.Params[0]; | 2833 | Hashtable requestData = (Hashtable) request.Params[0]; |
2833 | foreach (string p in param) | 2834 | foreach (string parameter in param) |
2834 | { | 2835 | { |
2835 | if (!requestData.Contains(p)) | 2836 | if (!requestData.Contains(parameter)) |
2836 | throw new Exception(String.Format("missing string parameter {0}", p)); | 2837 | throw new Exception(String.Format("missing string parameter {0}", parameter)); |
2837 | if (String.IsNullOrEmpty((string) requestData[p])) | 2838 | if (String.IsNullOrEmpty((string) requestData[parameter])) |
2838 | throw new Exception(String.Format("parameter {0} is empty", p)); | 2839 | throw new Exception(String.Format("parameter {0} is empty", parameter)); |
2839 | } | 2840 | } |
2840 | } | 2841 | } |
2841 | 2842 | ||
2842 | private static void checkIntegerParams(XmlRpcRequest request, string[] param) | 2843 | private static void CheckIntegerParams(XmlRpcRequest request, string[] param) |
2843 | { | 2844 | { |
2844 | Hashtable requestData = (Hashtable) request.Params[0]; | 2845 | Hashtable requestData = (Hashtable) request.Params[0]; |
2845 | foreach (string p in param) | 2846 | foreach (string parameter in param) |
2846 | { | 2847 | { |
2847 | if (!requestData.Contains(p)) | 2848 | if (!requestData.Contains(parameter)) |
2848 | throw new Exception(String.Format("missing integer parameter {0}", p)); | 2849 | throw new Exception(String.Format("missing integer parameter {0}", parameter)); |
2849 | } | 2850 | } |
2850 | } | 2851 | } |
2851 | 2852 | ||
2852 | private bool getBoolean(Hashtable requestData, string tag, bool defv) | 2853 | private bool GetBoolean(Hashtable requestData, string tag, bool defaultValue) |
2853 | { | 2854 | { |
2854 | // If an access value has been provided, apply it. | 2855 | // If an access value has been provided, apply it. |
2855 | if (requestData.Contains(tag)) | 2856 | if (requestData.Contains(tag)) |
@@ -2865,29 +2866,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2865 | case "0" : | 2866 | case "0" : |
2866 | return false; | 2867 | return false; |
2867 | default : | 2868 | default : |
2868 | return defv; | 2869 | return defaultValue; |
2869 | } | 2870 | } |
2870 | } | 2871 | } |
2871 | else | 2872 | else |
2872 | return defv; | 2873 | return defaultValue; |
2873 | } | 2874 | } |
2874 | 2875 | ||
2875 | private int GetIntegerAttribute(XmlNode node, string attr, int dv) | 2876 | private int GetIntegerAttribute(XmlNode node, string attribute, int defaultValue) |
2876 | { | 2877 | { |
2877 | try { return Convert.ToInt32(node.Attributes[attr].Value); } catch{} | 2878 | try { return Convert.ToInt32(node.Attributes[attribute].Value); } catch{} |
2878 | return dv; | 2879 | return defaultValue; |
2879 | } | 2880 | } |
2880 | 2881 | ||
2881 | private uint GetUnsignedAttribute(XmlNode node, string attr, uint dv) | 2882 | private uint GetUnsignedAttribute(XmlNode node, string attribute, uint defaultValue) |
2882 | { | 2883 | { |
2883 | try { return Convert.ToUInt32(node.Attributes[attr].Value); } catch{} | 2884 | try { return Convert.ToUInt32(node.Attributes[attribute].Value); } catch{} |
2884 | return dv; | 2885 | return defaultValue; |
2885 | } | 2886 | } |
2886 | 2887 | ||
2887 | private string GetStringAttribute(XmlNode node, string attr, string dv) | 2888 | private string GetStringAttribute(XmlNode node, string attribute, string defaultValue) |
2888 | { | 2889 | { |
2889 | try { return node.Attributes[attr].Value; } catch{} | 2890 | try { return node.Attributes[attribute].Value; } catch{} |
2890 | return dv; | 2891 | return defaultValue; |
2891 | } | 2892 | } |
2892 | 2893 | ||
2893 | public void Dispose() | 2894 | public void Dispose() |
@@ -2904,14 +2905,14 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2904 | /// <param name="email"></param> | 2905 | /// <param name="email"></param> |
2905 | private UserAccount CreateUser(UUID scopeID, string firstName, string lastName, string password, string email) | 2906 | private UserAccount CreateUser(UUID scopeID, string firstName, string lastName, string password, string email) |
2906 | { | 2907 | { |
2907 | Scene scene = m_app.SceneManager.CurrentOrFirstScene; | 2908 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; |
2908 | IUserAccountService m_UserAccountService = scene.UserAccountService; | 2909 | IUserAccountService userAccountService = scene.UserAccountService; |
2909 | IGridService m_GridService = scene.GridService; | 2910 | IGridService gridService = scene.GridService; |
2910 | IAuthenticationService m_AuthenticationService = scene.AuthenticationService; | 2911 | IAuthenticationService authenticationService = scene.AuthenticationService; |
2911 | IGridUserService m_GridUserService = scene.GridUserService; | 2912 | IGridUserService gridUserService = scene.GridUserService; |
2912 | IInventoryService m_InventoryService = scene.InventoryService; | 2913 | IInventoryService inventoryService = scene.InventoryService; |
2913 | 2914 | ||
2914 | UserAccount account = m_UserAccountService.GetUserAccount(scopeID, firstName, lastName); | 2915 | UserAccount account = userAccountService.GetUserAccount(scopeID, firstName, lastName); |
2915 | if (null == account) | 2916 | if (null == account) |
2916 | { | 2917 | { |
2917 | account = new UserAccount(scopeID, firstName, lastName, email); | 2918 | account = new UserAccount(scopeID, firstName, lastName, email); |
@@ -2924,26 +2925,26 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2924 | account.ServiceURLs["AssetServerURI"] = string.Empty; | 2925 | account.ServiceURLs["AssetServerURI"] = string.Empty; |
2925 | } | 2926 | } |
2926 | 2927 | ||
2927 | if (m_UserAccountService.StoreUserAccount(account)) | 2928 | if (userAccountService.StoreUserAccount(account)) |
2928 | { | 2929 | { |
2929 | bool success; | 2930 | bool success; |
2930 | if (m_AuthenticationService != null) | 2931 | if (authenticationService != null) |
2931 | { | 2932 | { |
2932 | success = m_AuthenticationService.SetPassword(account.PrincipalID, password); | 2933 | success = authenticationService.SetPassword(account.PrincipalID, password); |
2933 | if (!success) | 2934 | if (!success) |
2934 | m_log.WarnFormat("[RADMIN]: Unable to set password for account {0} {1}.", | 2935 | m_log.WarnFormat("[RADMIN]: Unable to set password for account {0} {1}.", |
2935 | firstName, lastName); | 2936 | firstName, lastName); |
2936 | } | 2937 | } |
2937 | 2938 | ||
2938 | GridRegion home = null; | 2939 | GridRegion home = null; |
2939 | if (m_GridService != null) | 2940 | if (gridService != null) |
2940 | { | 2941 | { |
2941 | List<GridRegion> defaultRegions = m_GridService.GetDefaultRegions(UUID.Zero); | 2942 | List<GridRegion> defaultRegions = gridService.GetDefaultRegions(UUID.Zero); |
2942 | if (defaultRegions != null && defaultRegions.Count >= 1) | 2943 | if (defaultRegions != null && defaultRegions.Count >= 1) |
2943 | home = defaultRegions[0]; | 2944 | home = defaultRegions[0]; |
2944 | 2945 | ||
2945 | if (m_GridUserService != null && home != null) | 2946 | if (gridUserService != null && home != null) |
2946 | m_GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); | 2947 | gridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); |
2947 | else | 2948 | else |
2948 | m_log.WarnFormat("[RADMIN]: Unable to set home for account {0} {1}.", | 2949 | m_log.WarnFormat("[RADMIN]: Unable to set home for account {0} {1}.", |
2949 | firstName, lastName); | 2950 | firstName, lastName); |
@@ -2952,9 +2953,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2952 | m_log.WarnFormat("[RADMIN]: Unable to retrieve home region for account {0} {1}.", | 2953 | m_log.WarnFormat("[RADMIN]: Unable to retrieve home region for account {0} {1}.", |
2953 | firstName, lastName); | 2954 | firstName, lastName); |
2954 | 2955 | ||
2955 | if (m_InventoryService != null) | 2956 | if (inventoryService != null) |
2956 | { | 2957 | { |
2957 | success = m_InventoryService.CreateUserInventory(account.PrincipalID); | 2958 | success = inventoryService.CreateUserInventory(account.PrincipalID); |
2958 | if (!success) | 2959 | if (!success) |
2959 | m_log.WarnFormat("[RADMIN]: Unable to create inventory for account {0} {1}.", | 2960 | m_log.WarnFormat("[RADMIN]: Unable to create inventory for account {0} {1}.", |
2960 | firstName, lastName); | 2961 | firstName, lastName); |
@@ -2981,16 +2982,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
2981 | /// <param name="password"></param> | 2982 | /// <param name="password"></param> |
2982 | private bool ChangeUserPassword(string firstName, string lastName, string password) | 2983 | private bool ChangeUserPassword(string firstName, string lastName, string password) |
2983 | { | 2984 | { |
2984 | Scene scene = m_app.SceneManager.CurrentOrFirstScene; | 2985 | Scene scene = m_application.SceneManager.CurrentOrFirstScene; |
2985 | IUserAccountService m_UserAccountService = scene.UserAccountService; | 2986 | IUserAccountService userAccountService = scene.UserAccountService; |
2986 | IAuthenticationService m_AuthenticationService = scene.AuthenticationService; | 2987 | IAuthenticationService authenticationService = scene.AuthenticationService; |
2987 | 2988 | ||
2988 | UserAccount account = m_UserAccountService.GetUserAccount(UUID.Zero, firstName, lastName); | 2989 | UserAccount account = userAccountService.GetUserAccount(UUID.Zero, firstName, lastName); |
2989 | if (null != account) | 2990 | if (null != account) |
2990 | { | 2991 | { |
2991 | bool success = false; | 2992 | bool success = false; |
2992 | if (m_AuthenticationService != null) | 2993 | if (authenticationService != null) |
2993 | success = m_AuthenticationService.SetPassword(account.PrincipalID, password); | 2994 | success = authenticationService.SetPassword(account.PrincipalID, password); |
2994 | if (!success) { | 2995 | if (!success) { |
2995 | m_log.WarnFormat("[RADMIN]: Unable to set password for account {0} {1}.", | 2996 | m_log.WarnFormat("[RADMIN]: Unable to set password for account {0} {1}.", |
2996 | firstName, lastName); | 2997 | firstName, lastName); |
diff --git a/OpenSim/Data/IRegionData.cs b/OpenSim/Data/IRegionData.cs index 8259f9b..42533c6 100644 --- a/OpenSim/Data/IRegionData.cs +++ b/OpenSim/Data/IRegionData.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim.Data | |||
62 | 62 | ||
63 | List<RegionData> GetDefaultRegions(UUID scopeID); | 63 | List<RegionData> GetDefaultRegions(UUID scopeID); |
64 | List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y); | 64 | List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y); |
65 | List<RegionData> GetHyperlinks(UUID scopeID); | ||
65 | } | 66 | } |
66 | 67 | ||
67 | [Flags] | 68 | [Flags] |
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs index 66c3f81..9656be1 100644 --- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs +++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs | |||
@@ -310,23 +310,23 @@ namespace OpenSim.Data.MSSQL | |||
310 | 310 | ||
311 | public List<RegionData> GetDefaultRegions(UUID scopeID) | 311 | public List<RegionData> GetDefaultRegions(UUID scopeID) |
312 | { | 312 | { |
313 | string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 1) <> 0"; | 313 | return Get((int)RegionFlags.DefaultRegion, scopeID); |
314 | if (scopeID != UUID.Zero) | ||
315 | sql += " AND ScopeID = @scopeID"; | ||
316 | |||
317 | using (SqlConnection conn = new SqlConnection(m_ConnectionString)) | ||
318 | using (SqlCommand cmd = new SqlCommand(sql, conn)) | ||
319 | { | ||
320 | cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); | ||
321 | conn.Open(); | ||
322 | return RunCommand(cmd); | ||
323 | } | ||
324 | |||
325 | } | 314 | } |
326 | 315 | ||
327 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) | 316 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) |
328 | { | 317 | { |
329 | string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & 2) <> 0"; | 318 | // TODO: distance-sort results |
319 | return Get((int)RegionFlags.FallbackRegion, scopeID); | ||
320 | } | ||
321 | |||
322 | public List<RegionData> GetHyperlinks(UUID scopeID) | ||
323 | { | ||
324 | return Get((int)RegionFlags.Hyperlink, scopeID); | ||
325 | } | ||
326 | |||
327 | private List<RegionData> Get(int regionFlags, UUID scopeID) | ||
328 | { | ||
329 | string sql = "SELECT * FROM [" + m_Realm + "] WHERE (flags & " + regionFlags.ToString() + ") <> 0"; | ||
330 | if (scopeID != UUID.Zero) | 330 | if (scopeID != UUID.Zero) |
331 | sql += " AND ScopeID = @scopeID"; | 331 | sql += " AND ScopeID = @scopeID"; |
332 | 332 | ||
@@ -335,7 +335,6 @@ namespace OpenSim.Data.MSSQL | |||
335 | { | 335 | { |
336 | cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); | 336 | cmd.Parameters.Add(m_database.CreateParameter("@scopeID", scopeID)); |
337 | conn.Open(); | 337 | conn.Open(); |
338 | // TODO: distance-sort results | ||
339 | return RunCommand(cmd); | 338 | return RunCommand(cmd); |
340 | } | 339 | } |
341 | } | 340 | } |
diff --git a/OpenSim/Data/MySQL/MySQLRegionData.cs b/OpenSim/Data/MySQL/MySQLRegionData.cs index c7bddac..aec37e2 100644 --- a/OpenSim/Data/MySQL/MySQLRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLRegionData.cs | |||
@@ -281,22 +281,26 @@ namespace OpenSim.Data.MySQL | |||
281 | 281 | ||
282 | return false; | 282 | return false; |
283 | } | 283 | } |
284 | |||
284 | public List<RegionData> GetDefaultRegions(UUID scopeID) | 285 | public List<RegionData> GetDefaultRegions(UUID scopeID) |
285 | { | 286 | { |
286 | string command = "select * from `"+m_Realm+"` where (flags & 1) <> 0"; | 287 | return Get((int)RegionFlags.DefaultRegion, scopeID); |
287 | if (scopeID != UUID.Zero) | 288 | } |
288 | command += " and ScopeID = ?scopeID"; | ||
289 | |||
290 | MySqlCommand cmd = new MySqlCommand(command); | ||
291 | 289 | ||
292 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | 290 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) |
291 | { | ||
292 | // TODO: distance-sort results | ||
293 | return Get((int)RegionFlags.FallbackRegion, scopeID); | ||
294 | } | ||
293 | 295 | ||
294 | return RunCommand(cmd); | 296 | public List<RegionData> GetHyperlinks(UUID scopeID) |
297 | { | ||
298 | return Get((int)RegionFlags.Hyperlink, scopeID); | ||
295 | } | 299 | } |
296 | 300 | ||
297 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) | 301 | private List<RegionData> Get(int regionFlags, UUID scopeID) |
298 | { | 302 | { |
299 | string command = "select * from `"+m_Realm+"` where (flags & 2) <> 0"; | 303 | string command = "select * from `" + m_Realm + "` where (flags & " + regionFlags.ToString() + ") <> 0"; |
300 | if (scopeID != UUID.Zero) | 304 | if (scopeID != UUID.Zero) |
301 | command += " and ScopeID = ?scopeID"; | 305 | command += " and ScopeID = ?scopeID"; |
302 | 306 | ||
@@ -304,7 +308,6 @@ namespace OpenSim.Data.MySQL | |||
304 | 308 | ||
305 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); | 309 | cmd.Parameters.AddWithValue("?scopeID", scopeID.ToString()); |
306 | 310 | ||
307 | // TODO: distance-sort results | ||
308 | return RunCommand(cmd); | 311 | return RunCommand(cmd); |
309 | } | 312 | } |
310 | } | 313 | } |
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs index d596698..f276d10 100644 --- a/OpenSim/Data/Null/NullRegionData.cs +++ b/OpenSim/Data/Null/NullRegionData.cs | |||
@@ -164,30 +164,29 @@ namespace OpenSim.Data.Null | |||
164 | 164 | ||
165 | public List<RegionData> GetDefaultRegions(UUID scopeID) | 165 | public List<RegionData> GetDefaultRegions(UUID scopeID) |
166 | { | 166 | { |
167 | if (Instance != this) | 167 | return Get((int)RegionFlags.DefaultRegion, scopeID); |
168 | return Instance.GetDefaultRegions(scopeID); | 168 | } |
169 | |||
170 | List<RegionData> ret = new List<RegionData>(); | ||
171 | 169 | ||
172 | foreach (RegionData r in m_regionData.Values) | 170 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) |
173 | { | 171 | { |
174 | if ((Convert.ToInt32(r.Data["flags"]) & 1) != 0) | 172 | return Get((int)RegionFlags.FallbackRegion, scopeID); |
175 | ret.Add(r); | 173 | } |
176 | } | ||
177 | 174 | ||
178 | return ret; | 175 | public List<RegionData> GetHyperlinks(UUID scopeID) |
176 | { | ||
177 | return Get((int)RegionFlags.Hyperlink, scopeID); | ||
179 | } | 178 | } |
180 | 179 | ||
181 | public List<RegionData> GetFallbackRegions(UUID scopeID, int x, int y) | 180 | private List<RegionData> Get(int regionFlags, UUID scopeID) |
182 | { | 181 | { |
183 | if (Instance != this) | 182 | if (Instance != this) |
184 | return Instance.GetFallbackRegions(scopeID, x, y); | 183 | return Instance.Get(regionFlags, scopeID); |
185 | 184 | ||
186 | List<RegionData> ret = new List<RegionData>(); | 185 | List<RegionData> ret = new List<RegionData>(); |
187 | 186 | ||
188 | foreach (RegionData r in m_regionData.Values) | 187 | foreach (RegionData r in m_regionData.Values) |
189 | { | 188 | { |
190 | if ((Convert.ToInt32(r.Data["flags"]) & 2) != 0) | 189 | if ((Convert.ToInt32(r.Data["flags"]) & regionFlags) != 0) |
191 | ret.Add(r); | 190 | ret.Add(r); |
192 | } | 191 | } |
193 | 192 | ||
diff --git a/OpenSim/Framework/ACL.cs b/OpenSim/Framework/ACL.cs deleted file mode 100644 index f76e8b7..0000000 --- a/OpenSim/Framework/ACL.cs +++ /dev/null | |||
@@ -1,252 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | // ACL Class | ||
34 | // Modelled after the structure of the Zend ACL Framework Library | ||
35 | // with one key difference - the tree will search for all matching | ||
36 | // permissions rather than just the first. Deny permissions will | ||
37 | // override all others. | ||
38 | |||
39 | #region ACL Core Class | ||
40 | |||
41 | /// <summary> | ||
42 | /// Access Control List Engine | ||
43 | /// </summary> | ||
44 | public class ACL | ||
45 | { | ||
46 | private Dictionary<string, Resource> Resources = new Dictionary<string, Resource>(); | ||
47 | private Dictionary<string, Role> Roles = new Dictionary<string, Role>(); | ||
48 | |||
49 | /// <summary> | ||
50 | /// Adds a new role | ||
51 | /// </summary> | ||
52 | /// <param name="role"></param> | ||
53 | /// <returns></returns> | ||
54 | public ACL AddRole(Role role) | ||
55 | { | ||
56 | if (Roles.ContainsKey(role.Name)) | ||
57 | throw new AlreadyContainsRoleException(role); | ||
58 | |||
59 | Roles.Add(role.Name, role); | ||
60 | |||
61 | return this; | ||
62 | } | ||
63 | |||
64 | /// <summary> | ||
65 | /// Adds a new resource | ||
66 | /// </summary> | ||
67 | /// <param name="resource"></param> | ||
68 | /// <returns></returns> | ||
69 | public ACL AddResource(Resource resource) | ||
70 | { | ||
71 | Resources.Add(resource.Name, resource); | ||
72 | |||
73 | return this; | ||
74 | } | ||
75 | |||
76 | /// <summary> | ||
77 | /// Permision for user/roll on a resource | ||
78 | /// </summary> | ||
79 | /// <param name="role"></param> | ||
80 | /// <param name="resource"></param> | ||
81 | /// <returns></returns> | ||
82 | public Permission HasPermission(string role, string resource) | ||
83 | { | ||
84 | if (!Roles.ContainsKey(role)) | ||
85 | throw new KeyNotFoundException(); | ||
86 | |||
87 | if (!Resources.ContainsKey(resource)) | ||
88 | throw new KeyNotFoundException(); | ||
89 | |||
90 | return Roles[role].RequestPermission(resource); | ||
91 | } | ||
92 | |||
93 | public ACL GrantPermission(string role, string resource) | ||
94 | { | ||
95 | if (!Roles.ContainsKey(role)) | ||
96 | throw new KeyNotFoundException(); | ||
97 | |||
98 | if (!Resources.ContainsKey(resource)) | ||
99 | throw new KeyNotFoundException(); | ||
100 | |||
101 | Roles[role].GivePermission(resource, Permission.Allow); | ||
102 | |||
103 | return this; | ||
104 | } | ||
105 | |||
106 | public ACL DenyPermission(string role, string resource) | ||
107 | { | ||
108 | if (!Roles.ContainsKey(role)) | ||
109 | throw new KeyNotFoundException(); | ||
110 | |||
111 | if (!Resources.ContainsKey(resource)) | ||
112 | throw new KeyNotFoundException(); | ||
113 | |||
114 | Roles[role].GivePermission(resource, Permission.Deny); | ||
115 | |||
116 | return this; | ||
117 | } | ||
118 | |||
119 | public ACL ResetPermission(string role, string resource) | ||
120 | { | ||
121 | if (!Roles.ContainsKey(role)) | ||
122 | throw new KeyNotFoundException(); | ||
123 | |||
124 | if (!Resources.ContainsKey(resource)) | ||
125 | throw new KeyNotFoundException(); | ||
126 | |||
127 | Roles[role].GivePermission(resource, Permission.None); | ||
128 | |||
129 | return this; | ||
130 | } | ||
131 | } | ||
132 | |||
133 | #endregion | ||
134 | |||
135 | #region Exceptions | ||
136 | |||
137 | /// <summary> | ||
138 | /// Thrown when an ACL attempts to add a duplicate role. | ||
139 | /// </summary> | ||
140 | public class AlreadyContainsRoleException : Exception | ||
141 | { | ||
142 | protected Role m_role; | ||
143 | |||
144 | public AlreadyContainsRoleException(Role role) | ||
145 | { | ||
146 | m_role = role; | ||
147 | } | ||
148 | |||
149 | public Role ErrorRole | ||
150 | { | ||
151 | get { return m_role; } | ||
152 | } | ||
153 | |||
154 | public override string ToString() | ||
155 | { | ||
156 | return "This ACL already contains a role called '" + m_role.Name + "'."; | ||
157 | } | ||
158 | } | ||
159 | |||
160 | #endregion | ||
161 | |||
162 | #region Roles and Resources | ||
163 | |||
164 | /// <summary> | ||
165 | /// Does this Role have permission to access a specified Resource? | ||
166 | /// </summary> | ||
167 | public enum Permission | ||
168 | { | ||
169 | Deny, | ||
170 | None, | ||
171 | Allow | ||
172 | } ; | ||
173 | |||
174 | /// <summary> | ||
175 | /// A role class, for use with Users or Groups | ||
176 | /// </summary> | ||
177 | public class Role | ||
178 | { | ||
179 | private string m_name; | ||
180 | private Role[] m_parents; | ||
181 | private Dictionary<string, Permission> m_resources = new Dictionary<string, Permission>(); | ||
182 | |||
183 | public Role(string name) | ||
184 | { | ||
185 | m_name = name; | ||
186 | m_parents = null; | ||
187 | } | ||
188 | |||
189 | public Role(string name, Role[] parents) | ||
190 | { | ||
191 | m_name = name; | ||
192 | m_parents = parents; | ||
193 | } | ||
194 | |||
195 | public string Name | ||
196 | { | ||
197 | get { return m_name; } | ||
198 | } | ||
199 | |||
200 | public Permission RequestPermission(string resource) | ||
201 | { | ||
202 | return RequestPermission(resource, Permission.None); | ||
203 | } | ||
204 | |||
205 | public Permission RequestPermission(string resource, Permission current) | ||
206 | { | ||
207 | // Deny permissions always override any others | ||
208 | if (current == Permission.Deny) | ||
209 | return current; | ||
210 | |||
211 | Permission temp = Permission.None; | ||
212 | |||
213 | // Pickup non-None permissions | ||
214 | if (m_resources.ContainsKey(resource) && m_resources[resource] != Permission.None) | ||
215 | temp = m_resources[resource]; | ||
216 | |||
217 | if (m_parents != null) | ||
218 | { | ||
219 | foreach (Role parent in m_parents) | ||
220 | { | ||
221 | temp = parent.RequestPermission(resource, temp); | ||
222 | } | ||
223 | } | ||
224 | |||
225 | return temp; | ||
226 | } | ||
227 | |||
228 | public void GivePermission(string resource, Permission perm) | ||
229 | { | ||
230 | m_resources[resource] = perm; | ||
231 | } | ||
232 | } | ||
233 | |||
234 | public class Resource | ||
235 | { | ||
236 | private string m_name; | ||
237 | |||
238 | public Resource(string name) | ||
239 | { | ||
240 | m_name = name; | ||
241 | } | ||
242 | |||
243 | public string Name | ||
244 | { | ||
245 | get { return m_name; } | ||
246 | } | ||
247 | } | ||
248 | |||
249 | #endregion | ||
250 | |||
251 | |||
252 | } \ No newline at end of file | ||
diff --git a/OpenSim/Framework/ConfigBase.cs b/OpenSim/Framework/ConfigBase.cs deleted file mode 100644 index 40ec32f..0000000 --- a/OpenSim/Framework/ConfigBase.cs +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Framework | ||
33 | { | ||
34 | public abstract class ConfigBase | ||
35 | { | ||
36 | protected ConfigurationMember m_configMember; | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Framework/FriendRegionInfo.cs b/OpenSim/Framework/FriendRegionInfo.cs deleted file mode 100644 index 68b5f3d..0000000 --- a/OpenSim/Framework/FriendRegionInfo.cs +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using OpenMetaverse; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public class FriendRegionInfo | ||
33 | { | ||
34 | public bool isOnline; | ||
35 | public ulong regionHandle; | ||
36 | public UUID regionID; | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs deleted file mode 100644 index 3a43a14..0000000 --- a/OpenSim/Framework/GridConfig.cs +++ /dev/null | |||
@@ -1,162 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public class GridConfig:ConfigBase | ||
33 | { | ||
34 | public string AllowForcefulBanlines = "TRUE"; | ||
35 | public bool AllowRegionRegistration = true; | ||
36 | public string AssetRecvKey = String.Empty; | ||
37 | public string AssetSendKey = String.Empty; | ||
38 | |||
39 | public string DatabaseProvider = String.Empty; | ||
40 | public string DatabaseConnect = String.Empty; | ||
41 | public string DefaultAssetServer = String.Empty; | ||
42 | public string DefaultUserServer = String.Empty; | ||
43 | public uint HttpPort = ConfigSettings.DefaultGridServerHttpPort; | ||
44 | public string SimRecvKey = String.Empty; | ||
45 | public string SimSendKey = String.Empty; | ||
46 | public string UserRecvKey = String.Empty; | ||
47 | public string UserSendKey = String.Empty; | ||
48 | public string ConsoleUser = String.Empty; | ||
49 | public string ConsolePass = String.Empty; | ||
50 | |||
51 | public GridConfig(string description, string filename) | ||
52 | { | ||
53 | m_configMember = | ||
54 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); | ||
55 | m_configMember.performConfigurationRetrieve(); | ||
56 | } | ||
57 | |||
58 | public void loadConfigurationOptions() | ||
59 | { | ||
60 | m_configMember.addConfigurationOption("default_asset_server", | ||
61 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
62 | "Default Asset Server URI", | ||
63 | "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString() + "/", | ||
64 | false); | ||
65 | m_configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
66 | "Key to send to asset server", "null", false); | ||
67 | m_configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
68 | "Key to expect from asset server", "null", false); | ||
69 | |||
70 | m_configMember.addConfigurationOption("default_user_server", | ||
71 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
72 | "Default User Server URI", | ||
73 | "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString() + "/", false); | ||
74 | m_configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
75 | "Key to send to user server", "null", false); | ||
76 | m_configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
77 | "Key to expect from user server", "null", false); | ||
78 | |||
79 | m_configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
80 | "Key to send to a simulator", "null", false); | ||
81 | m_configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
82 | "Key to expect from a simulator", "null", false); | ||
83 | m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
84 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); | ||
85 | m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
86 | "Database connect string", "", false); | ||
87 | |||
88 | m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
89 | "Http Listener port", ConfigSettings.DefaultGridServerHttpPort.ToString(), false); | ||
90 | |||
91 | m_configMember.addConfigurationOption("allow_forceful_banlines", | ||
92 | ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
93 | "Allow Forceful Banlines", "TRUE", true); | ||
94 | |||
95 | m_configMember.addConfigurationOption("allow_region_registration", | ||
96 | ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
97 | "Allow regions to register immediately upon grid server startup? true/false", | ||
98 | "True", | ||
99 | false); | ||
100 | m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
101 | "Remote console access user name [Default: disabled]", "", false); | ||
102 | |||
103 | m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
104 | "Remote console access password [Default: disabled]", "", false); | ||
105 | |||
106 | } | ||
107 | |||
108 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
109 | { | ||
110 | switch (configuration_key) | ||
111 | { | ||
112 | case "default_asset_server": | ||
113 | DefaultAssetServer = (string) configuration_result; | ||
114 | break; | ||
115 | case "asset_send_key": | ||
116 | AssetSendKey = (string) configuration_result; | ||
117 | break; | ||
118 | case "asset_recv_key": | ||
119 | AssetRecvKey = (string) configuration_result; | ||
120 | break; | ||
121 | case "default_user_server": | ||
122 | DefaultUserServer = (string) configuration_result; | ||
123 | break; | ||
124 | case "user_send_key": | ||
125 | UserSendKey = (string) configuration_result; | ||
126 | break; | ||
127 | case "user_recv_key": | ||
128 | UserRecvKey = (string) configuration_result; | ||
129 | break; | ||
130 | case "sim_send_key": | ||
131 | SimSendKey = (string) configuration_result; | ||
132 | break; | ||
133 | case "sim_recv_key": | ||
134 | SimRecvKey = (string) configuration_result; | ||
135 | break; | ||
136 | case "database_provider": | ||
137 | DatabaseProvider = (string) configuration_result; | ||
138 | break; | ||
139 | case "database_connect": | ||
140 | DatabaseConnect = (string) configuration_result; | ||
141 | break; | ||
142 | case "http_port": | ||
143 | HttpPort = (uint) configuration_result; | ||
144 | break; | ||
145 | case "allow_forceful_banlines": | ||
146 | AllowForcefulBanlines = (string) configuration_result; | ||
147 | break; | ||
148 | case "allow_region_registration": | ||
149 | AllowRegionRegistration = (bool)configuration_result; | ||
150 | break; | ||
151 | case "console_user": | ||
152 | ConsoleUser = (string)configuration_result; | ||
153 | break; | ||
154 | case "console_pass": | ||
155 | ConsolePass = (string)configuration_result; | ||
156 | break; | ||
157 | } | ||
158 | |||
159 | return true; | ||
160 | } | ||
161 | } | ||
162 | } | ||
diff --git a/OpenSim/Framework/HGNetworkServersInfo.cs b/OpenSim/Framework/HGNetworkServersInfo.cs deleted file mode 100644 index 0865576..0000000 --- a/OpenSim/Framework/HGNetworkServersInfo.cs +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System.Net; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public class HGNetworkServersInfo | ||
33 | { | ||
34 | |||
35 | public readonly string LocalAssetServerURI, LocalInventoryServerURI, LocalUserServerURI; | ||
36 | |||
37 | private static HGNetworkServersInfo m_singleton; | ||
38 | public static HGNetworkServersInfo Singleton | ||
39 | { | ||
40 | get { return m_singleton; } | ||
41 | } | ||
42 | |||
43 | public static void Init(string assetserver, string inventoryserver, string userserver) | ||
44 | { | ||
45 | m_singleton = new HGNetworkServersInfo(assetserver, inventoryserver, userserver); | ||
46 | |||
47 | } | ||
48 | |||
49 | private HGNetworkServersInfo(string a, string i, string u) | ||
50 | { | ||
51 | LocalAssetServerURI = ServerURI(a); | ||
52 | LocalInventoryServerURI = ServerURI(i); | ||
53 | LocalUserServerURI = ServerURI(u); | ||
54 | } | ||
55 | |||
56 | public bool IsLocalUser(string userserver) | ||
57 | { | ||
58 | string userServerURI = ServerURI(userserver); | ||
59 | bool ret = (((userServerURI == null) || (userServerURI == "") || (userServerURI == LocalUserServerURI))); | ||
60 | //m_log.Debug("-------------> HGNetworkServersInfo.IsLocalUser? " + ret + "(userServer=" + userServerURI + "; localuserserver=" + LocalUserServerURI + ")"); | ||
61 | return ret; | ||
62 | } | ||
63 | |||
64 | public bool IsLocalUser(UserProfileData userData) | ||
65 | { | ||
66 | if (userData != null) | ||
67 | { | ||
68 | if (userData is ForeignUserProfileData) | ||
69 | return IsLocalUser(((ForeignUserProfileData)userData).UserServerURI); | ||
70 | else | ||
71 | return true; | ||
72 | } | ||
73 | else | ||
74 | // Something fishy; ignore it | ||
75 | return true; | ||
76 | } | ||
77 | |||
78 | public static string ServerURI(string uri) | ||
79 | { | ||
80 | // Get rid of eventual slashes at the end | ||
81 | try | ||
82 | { | ||
83 | if (uri.EndsWith("/")) | ||
84 | uri = uri.Substring(0, uri.Length - 1); | ||
85 | } | ||
86 | catch { } | ||
87 | |||
88 | IPAddress ipaddr1 = null; | ||
89 | string port1 = ""; | ||
90 | try | ||
91 | { | ||
92 | ipaddr1 = Util.GetHostFromURL(uri); | ||
93 | } | ||
94 | catch { } | ||
95 | |||
96 | try | ||
97 | { | ||
98 | port1 = uri.Split(new char[] { ':' })[2]; | ||
99 | } | ||
100 | catch { } | ||
101 | |||
102 | // We tried our best to convert the domain names to IP addresses | ||
103 | return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri; | ||
104 | } | ||
105 | |||
106 | } | ||
107 | } | ||
diff --git a/OpenSim/Framework/IClientFileTransfer.cs b/OpenSim/Framework/IClientFileTransfer.cs deleted file mode 100644 index f947b17..0000000 --- a/OpenSim/Framework/IClientFileTransfer.cs +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using OpenMetaverse; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | public delegate void UploadComplete(string filename, UUID fileID, ulong transferID, byte[] fileData, IClientAPI remoteClient); | ||
33 | public delegate void UploadAborted(string filename, UUID fileID, ulong transferID, IClientAPI remoteClient); | ||
34 | |||
35 | public interface IClientFileTransfer | ||
36 | { | ||
37 | bool RequestUpload(string clientFileName, UploadComplete uploadCompleteCallback, UploadAborted abortCallback); | ||
38 | bool RequestUpload(UUID fileID, UploadComplete uploadCompleteCallback, UploadAborted abortCallback); | ||
39 | } | ||
40 | } | ||
diff --git a/OpenSim/Framework/ILoginServiceToRegionsConnector.cs b/OpenSim/Framework/ILoginServiceToRegionsConnector.cs deleted file mode 100644 index 5a155c1..0000000 --- a/OpenSim/Framework/ILoginServiceToRegionsConnector.cs +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using OpenMetaverse; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | public interface ILoginServiceToRegionsConnector | ||
34 | { | ||
35 | void LogOffUserFromGrid(ulong regionHandle, UUID AvatarID, UUID RegionSecret, string message); | ||
36 | bool NewUserConnection(ulong regionHandle, AgentCircuitData agent, out string reason); | ||
37 | RegionInfo RequestClosestRegion(string region); | ||
38 | RegionInfo RequestNeighbourInfo(UUID regionID); | ||
39 | RegionInfo RequestNeighbourInfo(ulong regionhandle); | ||
40 | } | ||
41 | } | ||
diff --git a/OpenSim/Framework/MessageServerConfig.cs b/OpenSim/Framework/MessageServerConfig.cs deleted file mode 100644 index 884c0ea..0000000 --- a/OpenSim/Framework/MessageServerConfig.cs +++ /dev/null | |||
@@ -1,152 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | |||
30 | namespace OpenSim.Framework | ||
31 | { | ||
32 | /// <summary> | ||
33 | /// Message Server Config - Configuration of the Message Server | ||
34 | /// </summary> | ||
35 | public class MessageServerConfig:ConfigBase | ||
36 | { | ||
37 | public string DatabaseProvider = String.Empty; | ||
38 | public string DatabaseConnect = String.Empty; | ||
39 | public string GridCommsProvider = String.Empty; | ||
40 | public string GridRecvKey = String.Empty; | ||
41 | public string GridSendKey = String.Empty; | ||
42 | public string GridServerURL = String.Empty; | ||
43 | public uint HttpPort = ConfigSettings.DefaultMessageServerHttpPort; | ||
44 | public bool HttpSSL = ConfigSettings.DefaultMessageServerHttpSSL; | ||
45 | public string MessageServerIP = String.Empty; | ||
46 | public string UserRecvKey = String.Empty; | ||
47 | public string UserSendKey = String.Empty; | ||
48 | public string UserServerURL = String.Empty; | ||
49 | public string ConsoleUser = String.Empty; | ||
50 | public string ConsolePass = String.Empty; | ||
51 | |||
52 | public MessageServerConfig(string description, string filename) | ||
53 | { | ||
54 | m_configMember = | ||
55 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); | ||
56 | m_configMember.performConfigurationRetrieve(); | ||
57 | } | ||
58 | |||
59 | public void loadConfigurationOptions() | ||
60 | { | ||
61 | m_configMember.addConfigurationOption("default_user_server", | ||
62 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
63 | "Default User Server URI", | ||
64 | "http://127.0.0.1:" + ConfigSettings.DefaultUserServerHttpPort.ToString() + "/", false); | ||
65 | m_configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
66 | "Key to send to user server", "null", false); | ||
67 | m_configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
68 | "Key to expect from user server", "null", false); | ||
69 | m_configMember.addConfigurationOption("default_grid_server", | ||
70 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
71 | "Default Grid Server URI", | ||
72 | "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort.ToString() + "/", false); | ||
73 | m_configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
74 | "Key to send to grid server", "null", false); | ||
75 | m_configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
76 | "Key to expect from grid server", "null", false); | ||
77 | |||
78 | m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
79 | "Connection String for Database", "", false); | ||
80 | |||
81 | m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
82 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); | ||
83 | |||
84 | m_configMember.addConfigurationOption("region_comms_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
85 | "DLL for comms provider", "OpenSim.Region.Communications.OGS1.dll", false); | ||
86 | |||
87 | m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
88 | "Http Listener port", ConfigSettings.DefaultMessageServerHttpPort.ToString(), false); | ||
89 | m_configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
90 | "Use SSL? true/false", ConfigSettings.DefaultMessageServerHttpSSL.ToString(), false); | ||
91 | m_configMember.addConfigurationOption("published_ip", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
92 | "My Published IP Address", "127.0.0.1", false); | ||
93 | m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
94 | "Remote console access user name [Default: disabled]", "", false); | ||
95 | |||
96 | m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
97 | "Remote console access password [Default: disabled]", "", false); | ||
98 | |||
99 | } | ||
100 | |||
101 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
102 | { | ||
103 | switch (configuration_key) | ||
104 | { | ||
105 | case "default_user_server": | ||
106 | UserServerURL = (string) configuration_result; | ||
107 | break; | ||
108 | case "user_send_key": | ||
109 | UserSendKey = (string) configuration_result; | ||
110 | break; | ||
111 | case "user_recv_key": | ||
112 | UserRecvKey = (string) configuration_result; | ||
113 | break; | ||
114 | case "default_grid_server": | ||
115 | GridServerURL = (string) configuration_result; | ||
116 | break; | ||
117 | case "grid_send_key": | ||
118 | GridSendKey = (string) configuration_result; | ||
119 | break; | ||
120 | case "grid_recv_key": | ||
121 | GridRecvKey = (string) configuration_result; | ||
122 | break; | ||
123 | case "database_provider": | ||
124 | DatabaseProvider = (string) configuration_result; | ||
125 | break; | ||
126 | case "database_connect": | ||
127 | DatabaseConnect = (string)configuration_result; | ||
128 | break; | ||
129 | case "http_port": | ||
130 | HttpPort = (uint) configuration_result; | ||
131 | break; | ||
132 | case "http_ssl": | ||
133 | HttpSSL = (bool) configuration_result; | ||
134 | break; | ||
135 | case "region_comms_provider": | ||
136 | GridCommsProvider = (string) configuration_result; | ||
137 | break; | ||
138 | case "published_ip": | ||
139 | MessageServerIP = (string) configuration_result; | ||
140 | break; | ||
141 | case "console_user": | ||
142 | ConsoleUser = (string)configuration_result; | ||
143 | break; | ||
144 | case "console_pass": | ||
145 | ConsolePass = (string)configuration_result; | ||
146 | break; | ||
147 | } | ||
148 | |||
149 | return true; | ||
150 | } | ||
151 | } | ||
152 | } | ||
diff --git a/OpenSim/Framework/NetworkUtil.cs b/OpenSim/Framework/NetworkUtil.cs index 5fe343d..831ff70 100644 --- a/OpenSim/Framework/NetworkUtil.cs +++ b/OpenSim/Framework/NetworkUtil.cs | |||
@@ -31,6 +31,7 @@ using System.Net.Sockets; | |||
31 | using System.Net; | 31 | using System.Net; |
32 | using System.Net.NetworkInformation; | 32 | using System.Net.NetworkInformation; |
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using System.Text; | ||
34 | using log4net; | 35 | using log4net; |
35 | 36 | ||
36 | namespace OpenSim.Framework | 37 | namespace OpenSim.Framework |
@@ -180,10 +181,18 @@ namespace OpenSim.Framework | |||
180 | throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client"); | 181 | throw new ArgumentException("[NetworkUtil] Unable to resolve defaultHostname to an IPv4 address for an IPv4 client"); |
181 | } | 182 | } |
182 | 183 | ||
184 | static IPAddress externalIPAddress; | ||
185 | |||
183 | static NetworkUtil() | 186 | static NetworkUtil() |
184 | { | 187 | { |
185 | try | 188 | try |
186 | { | 189 | { |
190 | externalIPAddress = GetExternalIP(); | ||
191 | } | ||
192 | catch { /* ignore */ } | ||
193 | |||
194 | try | ||
195 | { | ||
187 | foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces()) | 196 | foreach (NetworkInterface ni in NetworkInterface.GetAllNetworkInterfaces()) |
188 | { | 197 | { |
189 | foreach (UnicastIPAddressInformation address in ni.GetIPProperties().UnicastAddresses) | 198 | foreach (UnicastIPAddressInformation address in ni.GetIPProperties().UnicastAddresses) |
@@ -244,5 +253,80 @@ namespace OpenSim.Framework | |||
244 | } | 253 | } |
245 | return defaultHostname; | 254 | return defaultHostname; |
246 | } | 255 | } |
256 | |||
257 | public static IPAddress GetExternalIPOf(IPAddress user) | ||
258 | { | ||
259 | if (externalIPAddress == null) | ||
260 | return user; | ||
261 | |||
262 | if (user.ToString() == "127.0.0.1") | ||
263 | { | ||
264 | m_log.Info("[NetworkUtil] 127.0.0.1 user detected, sending '" + externalIPAddress + "' instead of '" + user + "'"); | ||
265 | return externalIPAddress; | ||
266 | } | ||
267 | // Check if we're accessing localhost. | ||
268 | foreach (IPAddress host in Dns.GetHostAddresses(Dns.GetHostName())) | ||
269 | { | ||
270 | if (host.Equals(user) && host.AddressFamily == AddressFamily.InterNetwork) | ||
271 | { | ||
272 | m_log.Info("[NetworkUtil] Localhost user detected, sending '" + externalIPAddress + "' instead of '" + user + "'"); | ||
273 | return externalIPAddress; | ||
274 | } | ||
275 | } | ||
276 | |||
277 | // Check for same LAN segment | ||
278 | foreach (KeyValuePair<IPAddress, IPAddress> subnet in m_subnets) | ||
279 | { | ||
280 | byte[] subnetBytes = subnet.Value.GetAddressBytes(); | ||
281 | byte[] localBytes = subnet.Key.GetAddressBytes(); | ||
282 | byte[] destBytes = user.GetAddressBytes(); | ||
283 | |||
284 | if (subnetBytes.Length != destBytes.Length || subnetBytes.Length != localBytes.Length) | ||
285 | return user; | ||
286 | |||
287 | bool valid = true; | ||
288 | |||
289 | for (int i = 0; i < subnetBytes.Length; i++) | ||
290 | { | ||
291 | if ((localBytes[i] & subnetBytes[i]) != (destBytes[i] & subnetBytes[i])) | ||
292 | { | ||
293 | valid = false; | ||
294 | break; | ||
295 | } | ||
296 | } | ||
297 | |||
298 | if (subnet.Key.AddressFamily != AddressFamily.InterNetwork) | ||
299 | valid = false; | ||
300 | |||
301 | if (valid) | ||
302 | { | ||
303 | m_log.Info("[NetworkUtil] Local LAN user detected, sending '" + externalIPAddress + "' instead of '" + user + "'"); | ||
304 | return externalIPAddress; | ||
305 | } | ||
306 | } | ||
307 | |||
308 | // Otherwise, return user address | ||
309 | return user; | ||
310 | } | ||
311 | |||
312 | private static IPAddress GetExternalIP() | ||
313 | { | ||
314 | string whatIsMyIp = "http://www.whatismyip.com/automation/n09230945.asp"; | ||
315 | WebClient wc = new WebClient(); | ||
316 | UTF8Encoding utf8 = new UTF8Encoding(); | ||
317 | string requestHtml = ""; | ||
318 | try | ||
319 | { | ||
320 | requestHtml = utf8.GetString(wc.DownloadData(whatIsMyIp)); | ||
321 | } | ||
322 | catch (WebException we) | ||
323 | { | ||
324 | m_log.Info("[NetworkUtil]: Exception in GetExternalIP: " + we.ToString()); | ||
325 | return null; | ||
326 | } | ||
327 | |||
328 | IPAddress externalIp = IPAddress.Parse(requestHtml); | ||
329 | return externalIp; | ||
330 | } | ||
247 | } | 331 | } |
248 | } | 332 | } |
diff --git a/OpenSim/Framework/Serialization/ArchiveConstants.cs b/OpenSim/Framework/Serialization/ArchiveConstants.cs index 475a9de..3143e3b 100644 --- a/OpenSim/Framework/Serialization/ArchiveConstants.cs +++ b/OpenSim/Framework/Serialization/ArchiveConstants.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Text; | ||
30 | using OpenMetaverse; | 31 | using OpenMetaverse; |
31 | 32 | ||
32 | namespace OpenSim.Framework.Serialization | 33 | namespace OpenSim.Framework.Serialization |
@@ -171,6 +172,30 @@ namespace OpenSim.Framework.Serialization | |||
171 | public static string CreateOarObjectPath(string objectName, UUID uuid, Vector3 pos) | 172 | public static string CreateOarObjectPath(string objectName, UUID uuid, Vector3 pos) |
172 | { | 173 | { |
173 | return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos); | 174 | return OBJECTS_PATH + CreateOarObjectFilename(objectName, uuid, pos); |
174 | } | 175 | } |
176 | |||
177 | /// <summary> | ||
178 | /// Extract a plain path from an IAR path | ||
179 | /// </summary> | ||
180 | /// <param name="iarPath"></param> | ||
181 | /// <returns></returns> | ||
182 | public static string ExtractPlainPathFromIarPath(string iarPath) | ||
183 | { | ||
184 | List<string> plainDirs = new List<string>(); | ||
185 | |||
186 | string[] iarDirs = iarPath.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); | ||
187 | |||
188 | foreach (string iarDir in iarDirs) | ||
189 | { | ||
190 | if (!iarDir.Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) | ||
191 | plainDirs.Add(iarDir); | ||
192 | |||
193 | int i = iarDir.LastIndexOf(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); | ||
194 | |||
195 | plainDirs.Add(iarDir.Remove(i)); | ||
196 | } | ||
197 | |||
198 | return string.Join("/", plainDirs.ToArray()); | ||
199 | } | ||
175 | } | 200 | } |
176 | } | 201 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Tests/ACLTest.cs b/OpenSim/Framework/Tests/ACLTest.cs deleted file mode 100644 index 06e860e..0000000 --- a/OpenSim/Framework/Tests/ACLTest.cs +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using NUnit.Framework; | ||
30 | using System.Collections.Generic; | ||
31 | |||
32 | |||
33 | namespace OpenSim.Framework.Tests | ||
34 | { | ||
35 | [TestFixture] | ||
36 | public class ACLTest | ||
37 | { | ||
38 | #region Tests | ||
39 | |||
40 | /// <summary> | ||
41 | /// ACL Test class | ||
42 | /// </summary> | ||
43 | [Test] | ||
44 | public void ACLTest01() | ||
45 | { | ||
46 | ACL acl = new ACL(); | ||
47 | |||
48 | Role Guests = new Role("Guests"); | ||
49 | acl.AddRole(Guests); | ||
50 | |||
51 | Role[] parents = new Role[1]; | ||
52 | parents[0] = Guests; | ||
53 | |||
54 | Role JoeGuest = new Role("JoeGuest", parents); | ||
55 | acl.AddRole(JoeGuest); | ||
56 | |||
57 | Resource CanBuild = new Resource("CanBuild"); | ||
58 | acl.AddResource(CanBuild); | ||
59 | |||
60 | |||
61 | acl.GrantPermission("Guests", "CanBuild"); | ||
62 | |||
63 | Permission perm = acl.HasPermission("JoeGuest", "CanBuild"); | ||
64 | Assert.That(perm == Permission.Allow, "JoeGuest should have permission to build"); | ||
65 | perm = Permission.None; | ||
66 | try | ||
67 | { | ||
68 | perm = acl.HasPermission("unknownGuest", "CanBuild"); | ||
69 | |||
70 | } | ||
71 | catch (KeyNotFoundException) | ||
72 | { | ||
73 | |||
74 | |||
75 | } | ||
76 | catch (Exception) | ||
77 | { | ||
78 | Assert.That(false,"Exception thrown should have been KeyNotFoundException"); | ||
79 | } | ||
80 | Assert.That(perm == Permission.None,"Permission None should be set because exception should have been thrown"); | ||
81 | |||
82 | } | ||
83 | |||
84 | [Test] | ||
85 | public void KnownButPermissionDenyAndPermissionNoneUserTest() | ||
86 | { | ||
87 | ACL acl = new ACL(); | ||
88 | |||
89 | Role Guests = new Role("Guests"); | ||
90 | acl.AddRole(Guests); | ||
91 | Role Administrators = new Role("Administrators"); | ||
92 | acl.AddRole(Administrators); | ||
93 | Role[] Guestparents = new Role[1]; | ||
94 | Role[] Adminparents = new Role[1]; | ||
95 | |||
96 | Guestparents[0] = Guests; | ||
97 | Adminparents[0] = Administrators; | ||
98 | |||
99 | Role JoeGuest = new Role("JoeGuest", Guestparents); | ||
100 | acl.AddRole(JoeGuest); | ||
101 | |||
102 | Resource CanBuild = new Resource("CanBuild"); | ||
103 | acl.AddResource(CanBuild); | ||
104 | |||
105 | Resource CanScript = new Resource("CanScript"); | ||
106 | acl.AddResource(CanScript); | ||
107 | |||
108 | Resource CanRestart = new Resource("CanRestart"); | ||
109 | acl.AddResource(CanRestart); | ||
110 | |||
111 | acl.GrantPermission("Guests", "CanBuild"); | ||
112 | acl.DenyPermission("Guests", "CanRestart"); | ||
113 | |||
114 | acl.GrantPermission("Administrators", "CanScript"); | ||
115 | |||
116 | acl.GrantPermission("Administrators", "CanRestart"); | ||
117 | Permission setPermission = acl.HasPermission("JoeGuest", "CanRestart"); | ||
118 | Assert.That(setPermission == Permission.Deny, "Guests Should not be able to restart"); | ||
119 | Assert.That(acl.HasPermission("JoeGuest", "CanScript") == Permission.None, | ||
120 | "No Explicit Permissions set so should be Permission.None"); | ||
121 | } | ||
122 | |||
123 | #endregion | ||
124 | } | ||
125 | } | ||
diff --git a/OpenSim/Framework/UserConfig.cs b/OpenSim/Framework/UserConfig.cs deleted file mode 100644 index 0fa82cf..0000000 --- a/OpenSim/Framework/UserConfig.cs +++ /dev/null | |||
@@ -1,231 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.IO; | ||
30 | |||
31 | namespace OpenSim.Framework | ||
32 | { | ||
33 | /// <summary> | ||
34 | /// UserConfig -- For User Server Configuration | ||
35 | /// </summary> | ||
36 | public class UserConfig:ConfigBase | ||
37 | { | ||
38 | public string DatabaseProvider = String.Empty; | ||
39 | public string DatabaseConnect = String.Empty; | ||
40 | public string DefaultStartupMsg = String.Empty; | ||
41 | public uint DefaultX = 1000; | ||
42 | public uint DefaultY = 1000; | ||
43 | public string GridRecvKey = String.Empty; | ||
44 | public string GridSendKey = String.Empty; | ||
45 | public uint HttpPort = ConfigSettings.DefaultUserServerHttpPort; | ||
46 | public bool HttpSSL = ConfigSettings.DefaultUserServerHttpSSL; | ||
47 | public uint DefaultUserLevel = 0; | ||
48 | public string LibraryXmlfile = ""; | ||
49 | public string ConsoleUser = String.Empty; | ||
50 | public string ConsolePass = String.Empty; | ||
51 | |||
52 | private Uri m_inventoryUrl; | ||
53 | |||
54 | public Uri InventoryUrl | ||
55 | { | ||
56 | get | ||
57 | { | ||
58 | return m_inventoryUrl; | ||
59 | } | ||
60 | set | ||
61 | { | ||
62 | m_inventoryUrl = value; | ||
63 | } | ||
64 | } | ||
65 | |||
66 | private Uri m_authUrl; | ||
67 | public Uri AuthUrl | ||
68 | { | ||
69 | get | ||
70 | { | ||
71 | return m_authUrl; | ||
72 | } | ||
73 | set | ||
74 | { | ||
75 | m_authUrl = value; | ||
76 | } | ||
77 | } | ||
78 | |||
79 | private Uri m_gridServerURL; | ||
80 | |||
81 | public Uri GridServerURL | ||
82 | { | ||
83 | get | ||
84 | { | ||
85 | return m_gridServerURL; | ||
86 | } | ||
87 | set | ||
88 | { | ||
89 | m_gridServerURL = value; | ||
90 | } | ||
91 | } | ||
92 | |||
93 | public bool EnableLLSDLogin = true; | ||
94 | |||
95 | public bool EnableHGLogin = true; | ||
96 | |||
97 | public UserConfig() | ||
98 | { | ||
99 | // weird, but UserManagerBase needs this. | ||
100 | } | ||
101 | public UserConfig(string description, string filename) | ||
102 | { | ||
103 | m_configMember = | ||
104 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, true); | ||
105 | m_configMember.performConfigurationRetrieve(); | ||
106 | } | ||
107 | |||
108 | public void loadConfigurationOptions() | ||
109 | { | ||
110 | m_configMember.addConfigurationOption("default_startup_message", | ||
111 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
112 | "Default Startup Message", "Welcome to OGS", false); | ||
113 | |||
114 | m_configMember.addConfigurationOption("default_grid_server", | ||
115 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
116 | "Default Grid Server URI", | ||
117 | "http://127.0.0.1:" + ConfigSettings.DefaultGridServerHttpPort + "/", false); | ||
118 | m_configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
119 | "Key to send to grid server", "null", false); | ||
120 | m_configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
121 | "Key to expect from grid server", "null", false); | ||
122 | |||
123 | m_configMember.addConfigurationOption("default_inventory_server", | ||
124 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
125 | "Default Inventory Server URI", | ||
126 | "http://127.0.0.1:" + ConfigSettings.DefaultInventoryServerHttpPort + "/", | ||
127 | false); | ||
128 | m_configMember.addConfigurationOption("default_authentication_server", | ||
129 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
130 | "User Server (this) External URI for authentication keys", | ||
131 | "http://localhost:" + ConfigSettings.DefaultUserServerHttpPort + "/", | ||
132 | false); | ||
133 | m_configMember.addConfigurationOption("library_location", | ||
134 | ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | ||
135 | "Path to library control file", | ||
136 | string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false); | ||
137 | |||
138 | m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
139 | "DLL for database provider", "OpenSim.Data.MySQL.dll", false); | ||
140 | m_configMember.addConfigurationOption("database_connect", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
141 | "Connection String for Database", "", false); | ||
142 | |||
143 | m_configMember.addConfigurationOption("http_port", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
144 | "Http Listener port", ConfigSettings.DefaultUserServerHttpPort.ToString(), false); | ||
145 | m_configMember.addConfigurationOption("http_ssl", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
146 | "Use SSL? true/false", ConfigSettings.DefaultUserServerHttpSSL.ToString(), false); | ||
147 | m_configMember.addConfigurationOption("default_X", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
148 | "Known good region X", "1000", false); | ||
149 | m_configMember.addConfigurationOption("default_Y", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
150 | "Known good region Y", "1000", false); | ||
151 | m_configMember.addConfigurationOption("enable_llsd_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
152 | "Enable LLSD login support [Currently used by libsl based clients/bots]? true/false", true.ToString(), false); | ||
153 | |||
154 | m_configMember.addConfigurationOption("enable_hg_login", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
155 | "Enable Hypergrid login support [Currently used by GridSurfer-proxied clients]? true/false", true.ToString(), false); | ||
156 | |||
157 | m_configMember.addConfigurationOption("default_loginLevel", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, | ||
158 | "Minimum Level a user should have to login [0 default]", "0", false); | ||
159 | |||
160 | m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
161 | "Remote console access user name [Default: disabled]", "", false); | ||
162 | |||
163 | m_configMember.addConfigurationOption("console_pass", ConfigurationOption.ConfigurationTypes.TYPE_STRING, | ||
164 | "Remote console access password [Default: disabled]", "", false); | ||
165 | |||
166 | } | ||
167 | |||
168 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | ||
169 | { | ||
170 | switch (configuration_key) | ||
171 | { | ||
172 | case "default_startup_message": | ||
173 | DefaultStartupMsg = (string) configuration_result; | ||
174 | break; | ||
175 | case "default_grid_server": | ||
176 | GridServerURL = new Uri((string) configuration_result); | ||
177 | break; | ||
178 | case "grid_send_key": | ||
179 | GridSendKey = (string) configuration_result; | ||
180 | break; | ||
181 | case "grid_recv_key": | ||
182 | GridRecvKey = (string) configuration_result; | ||
183 | break; | ||
184 | case "default_inventory_server": | ||
185 | InventoryUrl = new Uri((string) configuration_result); | ||
186 | break; | ||
187 | case "default_authentication_server": | ||
188 | AuthUrl = new Uri((string)configuration_result); | ||
189 | break; | ||
190 | case "database_provider": | ||
191 | DatabaseProvider = (string) configuration_result; | ||
192 | break; | ||
193 | case "database_connect": | ||
194 | DatabaseConnect = (string) configuration_result; | ||
195 | break; | ||
196 | case "http_port": | ||
197 | HttpPort = (uint) configuration_result; | ||
198 | break; | ||
199 | case "http_ssl": | ||
200 | HttpSSL = (bool) configuration_result; | ||
201 | break; | ||
202 | case "default_X": | ||
203 | DefaultX = (uint) configuration_result; | ||
204 | break; | ||
205 | case "default_Y": | ||
206 | DefaultY = (uint) configuration_result; | ||
207 | break; | ||
208 | case "enable_llsd_login": | ||
209 | EnableLLSDLogin = (bool)configuration_result; | ||
210 | break; | ||
211 | case "enable_hg_login": | ||
212 | EnableHGLogin = (bool)configuration_result; | ||
213 | break; | ||
214 | case "default_loginLevel": | ||
215 | DefaultUserLevel = (uint)configuration_result; | ||
216 | break; | ||
217 | case "library_location": | ||
218 | LibraryXmlfile = (string)configuration_result; | ||
219 | break; | ||
220 | case "console_user": | ||
221 | ConsoleUser = (string)configuration_result; | ||
222 | break; | ||
223 | case "console_pass": | ||
224 | ConsolePass = (string)configuration_result; | ||
225 | break; | ||
226 | } | ||
227 | |||
228 | return true; | ||
229 | } | ||
230 | } | ||
231 | } | ||
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index e20866e..d16f9bf 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -139,8 +139,9 @@ namespace OpenSim.Framework | |||
139 | request.ContentLength = requestData.Length; | 139 | request.ContentLength = requestData.Length; |
140 | request.ContentType = "application/x-www-form-urlencoded"; | 140 | request.ContentType = "application/x-www-form-urlencoded"; |
141 | 141 | ||
142 | using (Stream requestStream = request.GetRequestStream()) | 142 | Stream requestStream = request.GetRequestStream(); |
143 | requestStream.Write(requestData, 0, requestData.Length); | 143 | requestStream.Write(requestData, 0, requestData.Length); |
144 | requestStream.Close(); | ||
144 | 145 | ||
145 | using (WebResponse response = request.GetResponse()) | 146 | using (WebResponse response = request.GetResponse()) |
146 | { | 147 | { |
@@ -169,7 +170,7 @@ namespace OpenSim.Framework | |||
169 | } | 170 | } |
170 | catch (Exception ex) | 171 | catch (Exception ex) |
171 | { | 172 | { |
172 | m_log.Warn("POST to URL " + url + " failed: " + ex.Message); | 173 | m_log.Warn("POST to URL " + url + " failed: " + ex); |
173 | errorMessage = ex.Message; | 174 | errorMessage = ex.Message; |
174 | } | 175 | } |
175 | 176 | ||
diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index cac5fa9..09f7bea 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs | |||
@@ -308,21 +308,6 @@ namespace OpenSim | |||
308 | } | 308 | } |
309 | 309 | ||
310 | { | 310 | { |
311 | IConfig config = defaultConfig.Configs["StandAlone"]; | ||
312 | |||
313 | if (null == config) | ||
314 | config = defaultConfig.AddConfig("StandAlone"); | ||
315 | |||
316 | config.Set("accounts_authenticate", true); | ||
317 | config.Set("welcome_message", "Welcome to OpenSimulator"); | ||
318 | config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll"); | ||
319 | config.Set("inventory_source", ""); | ||
320 | config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); | ||
321 | config.Set("user_source", ""); | ||
322 | config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); | ||
323 | } | ||
324 | |||
325 | { | ||
326 | IConfig config = defaultConfig.Configs["Network"]; | 311 | IConfig config = defaultConfig.Configs["Network"]; |
327 | 312 | ||
328 | if (null == config) | 313 | if (null == config) |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs deleted file mode 100644 index 10e5a95..0000000 --- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs +++ /dev/null | |||
@@ -1,367 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenMetaverse; | ||
31 | using OpenSim.Framework; | ||
32 | |||
33 | namespace OpenSim.Region.ClientStack.LindenUDP | ||
34 | { | ||
35 | /// <summary> | ||
36 | /// A work in progress, to contain the SL specific file transfer code that is currently in various region modules | ||
37 | /// This file currently contains multiple classes that need to be split out into their own files. | ||
38 | /// </summary> | ||
39 | public class LLFileTransfer : IClientFileTransfer | ||
40 | { | ||
41 | protected IClientAPI m_clientAPI; | ||
42 | |||
43 | /// Dictionary of handlers for uploading files from client | ||
44 | /// TODO: Need to add cleanup code to remove handlers that have completed their upload | ||
45 | protected Dictionary<ulong, XferUploadHandler> m_uploadHandlers; | ||
46 | protected object m_uploadHandlersLock = new object(); | ||
47 | |||
48 | |||
49 | /// <summary> | ||
50 | /// Dictionary of files ready to be sent to clients | ||
51 | /// </summary> | ||
52 | protected static Dictionary<string, byte[]> m_files; | ||
53 | |||
54 | /// <summary> | ||
55 | /// Dictionary of Download Transfers in progess | ||
56 | /// </summary> | ||
57 | protected Dictionary<ulong, XferDownloadHandler> m_downloadHandlers = new Dictionary<ulong, XferDownloadHandler>(); | ||
58 | |||
59 | |||
60 | public LLFileTransfer(IClientAPI clientAPI) | ||
61 | { | ||
62 | m_uploadHandlers = new Dictionary<ulong, XferUploadHandler>(); | ||
63 | m_clientAPI = clientAPI; | ||
64 | |||
65 | m_clientAPI.OnXferReceive += XferReceive; | ||
66 | m_clientAPI.OnAbortXfer += AbortXferUploadHandler; | ||
67 | } | ||
68 | |||
69 | public void Close() | ||
70 | { | ||
71 | if (m_clientAPI != null) | ||
72 | { | ||
73 | m_clientAPI.OnXferReceive -= XferReceive; | ||
74 | m_clientAPI.OnAbortXfer -= AbortXferUploadHandler; | ||
75 | m_clientAPI = null; | ||
76 | } | ||
77 | } | ||
78 | |||
79 | #region Upload Handling | ||
80 | |||
81 | public bool RequestUpload(string clientFileName, UploadComplete uploadCompleteCallback, UploadAborted abortCallback) | ||
82 | { | ||
83 | if ((String.IsNullOrEmpty(clientFileName)) || (uploadCompleteCallback == null)) | ||
84 | { | ||
85 | return false; | ||
86 | } | ||
87 | |||
88 | XferUploadHandler uploader = new XferUploadHandler(m_clientAPI, clientFileName); | ||
89 | |||
90 | return StartUpload(uploader, uploadCompleteCallback, abortCallback); | ||
91 | } | ||
92 | |||
93 | public bool RequestUpload(UUID fileID, UploadComplete uploadCompleteCallback, UploadAborted abortCallback) | ||
94 | { | ||
95 | if ((fileID == UUID.Zero) || (uploadCompleteCallback == null)) | ||
96 | { | ||
97 | return false; | ||
98 | } | ||
99 | |||
100 | XferUploadHandler uploader = new XferUploadHandler(m_clientAPI, fileID); | ||
101 | |||
102 | return StartUpload(uploader, uploadCompleteCallback, abortCallback); | ||
103 | } | ||
104 | |||
105 | private bool StartUpload(XferUploadHandler uploader, UploadComplete uploadCompleteCallback, UploadAborted abortCallback) | ||
106 | { | ||
107 | uploader.UploadDone += uploadCompleteCallback; | ||
108 | uploader.UploadDone += RemoveXferUploadHandler; | ||
109 | |||
110 | if (abortCallback != null) | ||
111 | { | ||
112 | uploader.UploadAborted += abortCallback; | ||
113 | } | ||
114 | |||
115 | lock (m_uploadHandlersLock) | ||
116 | { | ||
117 | if (!m_uploadHandlers.ContainsKey(uploader.XferID)) | ||
118 | { | ||
119 | m_uploadHandlers.Add(uploader.XferID, uploader); | ||
120 | uploader.RequestStartXfer(m_clientAPI); | ||
121 | return true; | ||
122 | } | ||
123 | else | ||
124 | { | ||
125 | // something went wrong with the xferID allocation | ||
126 | uploader.UploadDone -= uploadCompleteCallback; | ||
127 | uploader.UploadDone -= RemoveXferUploadHandler; | ||
128 | if (abortCallback != null) | ||
129 | { | ||
130 | uploader.UploadAborted -= abortCallback; | ||
131 | } | ||
132 | return false; | ||
133 | } | ||
134 | } | ||
135 | } | ||
136 | |||
137 | protected void AbortXferUploadHandler(IClientAPI remoteClient, ulong xferID) | ||
138 | { | ||
139 | lock (m_uploadHandlersLock) | ||
140 | { | ||
141 | if (m_uploadHandlers.ContainsKey(xferID)) | ||
142 | { | ||
143 | m_uploadHandlers[xferID].AbortUpload(remoteClient); | ||
144 | m_uploadHandlers.Remove(xferID); | ||
145 | } | ||
146 | } | ||
147 | } | ||
148 | |||
149 | protected void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) | ||
150 | { | ||
151 | lock (m_uploadHandlersLock) | ||
152 | { | ||
153 | if (m_uploadHandlers.ContainsKey(xferID)) | ||
154 | { | ||
155 | m_uploadHandlers[xferID].XferReceive(remoteClient, xferID, packetID, data); | ||
156 | } | ||
157 | } | ||
158 | } | ||
159 | |||
160 | protected void RemoveXferUploadHandler(string filename, UUID fileID, ulong transferID, byte[] fileData, IClientAPI remoteClient) | ||
161 | { | ||
162 | |||
163 | } | ||
164 | #endregion | ||
165 | |||
166 | } | ||
167 | |||
168 | public class XferUploadHandler | ||
169 | { | ||
170 | private AssetBase m_asset; | ||
171 | |||
172 | public event UploadComplete UploadDone; | ||
173 | public event UploadAborted UploadAborted; | ||
174 | |||
175 | private sbyte type = 0; | ||
176 | |||
177 | public ulong mXferID; | ||
178 | private UploadComplete handlerUploadDone; | ||
179 | private UploadAborted handlerAbort; | ||
180 | |||
181 | private bool m_complete = false; | ||
182 | |||
183 | public bool UploadComplete | ||
184 | { | ||
185 | get { return m_complete; } | ||
186 | } | ||
187 | |||
188 | public XferUploadHandler(IClientAPI pRemoteClient, string pClientFilename) | ||
189 | { | ||
190 | Initialise(UUID.Zero, pClientFilename); | ||
191 | } | ||
192 | |||
193 | public XferUploadHandler(IClientAPI pRemoteClient, UUID fileID) | ||
194 | { | ||
195 | Initialise(fileID, String.Empty); | ||
196 | } | ||
197 | |||
198 | private void Initialise(UUID fileID, string fileName) | ||
199 | { | ||
200 | m_asset = new AssetBase(fileID, fileName, type, UUID.Zero.ToString()); | ||
201 | m_asset.Data = new byte[0]; | ||
202 | m_asset.Description = "empty"; | ||
203 | m_asset.Local = true; | ||
204 | m_asset.Temporary = true; | ||
205 | mXferID = Util.GetNextXferID(); | ||
206 | } | ||
207 | |||
208 | public ulong XferID | ||
209 | { | ||
210 | get { return mXferID; } | ||
211 | } | ||
212 | |||
213 | public void RequestStartXfer(IClientAPI pRemoteClient) | ||
214 | { | ||
215 | m_asset.Metadata.CreatorID = pRemoteClient.AgentId.ToString(); | ||
216 | |||
217 | if (!String.IsNullOrEmpty(m_asset.Name)) | ||
218 | { | ||
219 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); | ||
220 | } | ||
221 | else | ||
222 | { | ||
223 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, new byte[0]); | ||
224 | } | ||
225 | } | ||
226 | |||
227 | /// <summary> | ||
228 | /// Process transfer data received from the client. | ||
229 | /// </summary> | ||
230 | /// <param name="xferID"></param> | ||
231 | /// <param name="packetID"></param> | ||
232 | /// <param name="data"></param> | ||
233 | public void XferReceive(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) | ||
234 | { | ||
235 | if (mXferID == xferID) | ||
236 | { | ||
237 | if (m_asset.Data.Length > 1) | ||
238 | { | ||
239 | byte[] destinationArray = new byte[m_asset.Data.Length + data.Length]; | ||
240 | Array.Copy(m_asset.Data, 0, destinationArray, 0, m_asset.Data.Length); | ||
241 | Array.Copy(data, 0, destinationArray, m_asset.Data.Length, data.Length); | ||
242 | m_asset.Data = destinationArray; | ||
243 | } | ||
244 | else | ||
245 | { | ||
246 | byte[] buffer2 = new byte[data.Length - 4]; | ||
247 | Array.Copy(data, 4, buffer2, 0, data.Length - 4); | ||
248 | m_asset.Data = buffer2; | ||
249 | } | ||
250 | |||
251 | remoteClient.SendConfirmXfer(xferID, packetID); | ||
252 | |||
253 | if ((packetID & 0x80000000) != 0) | ||
254 | { | ||
255 | SendCompleteMessage(remoteClient); | ||
256 | |||
257 | } | ||
258 | } | ||
259 | } | ||
260 | |||
261 | protected void SendCompleteMessage(IClientAPI remoteClient) | ||
262 | { | ||
263 | m_complete = true; | ||
264 | handlerUploadDone = UploadDone; | ||
265 | if (handlerUploadDone != null) | ||
266 | { | ||
267 | handlerUploadDone(m_asset.Name, m_asset.FullID, mXferID, m_asset.Data, remoteClient); | ||
268 | } | ||
269 | } | ||
270 | |||
271 | public void AbortUpload(IClientAPI remoteClient) | ||
272 | { | ||
273 | handlerAbort = UploadAborted; | ||
274 | if (handlerAbort != null) | ||
275 | { | ||
276 | handlerAbort(m_asset.Name, m_asset.FullID, mXferID, remoteClient); | ||
277 | } | ||
278 | } | ||
279 | } | ||
280 | |||
281 | public class XferDownloadHandler | ||
282 | { | ||
283 | public IClientAPI Client; | ||
284 | private bool complete; | ||
285 | public byte[] Data = new byte[0]; | ||
286 | public int DataPointer = 0; | ||
287 | public string FileName = String.Empty; | ||
288 | public uint Packet = 0; | ||
289 | public uint Serial = 1; | ||
290 | public ulong XferID = 0; | ||
291 | |||
292 | public XferDownloadHandler(string fileName, byte[] data, ulong xferID, IClientAPI client) | ||
293 | { | ||
294 | FileName = fileName; | ||
295 | Data = data; | ||
296 | XferID = xferID; | ||
297 | Client = client; | ||
298 | } | ||
299 | |||
300 | public XferDownloadHandler() | ||
301 | { | ||
302 | } | ||
303 | |||
304 | /// <summary> | ||
305 | /// Start a transfer | ||
306 | /// </summary> | ||
307 | /// <returns>True if the transfer is complete, false if not</returns> | ||
308 | public bool StartSend() | ||
309 | { | ||
310 | if (Data.Length < 1000) | ||
311 | { | ||
312 | // for now (testing) we only support files under 1000 bytes | ||
313 | byte[] transferData = new byte[Data.Length + 4]; | ||
314 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); | ||
315 | Array.Copy(Data, 0, transferData, 4, Data.Length); | ||
316 | Client.SendXferPacket(XferID, 0 + 0x80000000, transferData); | ||
317 | |||
318 | complete = true; | ||
319 | } | ||
320 | else | ||
321 | { | ||
322 | byte[] transferData = new byte[1000 + 4]; | ||
323 | Array.Copy(Utils.IntToBytes(Data.Length), 0, transferData, 0, 4); | ||
324 | Array.Copy(Data, 0, transferData, 4, 1000); | ||
325 | Client.SendXferPacket(XferID, 0, transferData); | ||
326 | Packet++; | ||
327 | DataPointer = 1000; | ||
328 | } | ||
329 | |||
330 | return complete; | ||
331 | } | ||
332 | |||
333 | /// <summary> | ||
334 | /// Respond to an ack packet from the client | ||
335 | /// </summary> | ||
336 | /// <param name="packet"></param> | ||
337 | /// <returns>True if the transfer is complete, false otherwise</returns> | ||
338 | public bool AckPacket(uint packet) | ||
339 | { | ||
340 | if (!complete) | ||
341 | { | ||
342 | if ((Data.Length - DataPointer) > 1000) | ||
343 | { | ||
344 | byte[] transferData = new byte[1000]; | ||
345 | Array.Copy(Data, DataPointer, transferData, 0, 1000); | ||
346 | Client.SendXferPacket(XferID, Packet, transferData); | ||
347 | Packet++; | ||
348 | DataPointer += 1000; | ||
349 | } | ||
350 | else | ||
351 | { | ||
352 | byte[] transferData = new byte[Data.Length - DataPointer]; | ||
353 | Array.Copy(Data, DataPointer, transferData, 0, Data.Length - DataPointer); | ||
354 | uint endPacket = Packet |= (uint)0x80000000; | ||
355 | Client.SendXferPacket(XferID, endPacket, transferData); | ||
356 | Packet++; | ||
357 | DataPointer += (Data.Length - DataPointer); | ||
358 | |||
359 | complete = true; | ||
360 | } | ||
361 | } | ||
362 | |||
363 | return complete; | ||
364 | } | ||
365 | } | ||
366 | |||
367 | } | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index ff3036a..d895bb1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using OpenMetaverse.Packets; | 35 | using OpenMetaverse.Packets; |
@@ -39,38 +40,64 @@ using OpenSim.Region.Framework.Scenes; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.Avatar.Attachments | 41 | namespace OpenSim.Region.CoreModules.Avatar.Attachments |
41 | { | 42 | { |
42 | public class AttachmentsModule : IAttachmentsModule, IRegionModule | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "AttachmentsModule")] |
44 | public class AttachmentsModule : IAttachmentsModule, INonSharedRegionModule | ||
43 | { | 45 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 47 | ||
46 | protected Scene m_scene = null; | 48 | protected Scene m_scene = null; |
49 | |||
50 | public string Name { get { return "Attachments Module"; } } | ||
51 | public Type ReplaceableInterface { get { return null; } } | ||
47 | 52 | ||
48 | public void Initialise(Scene scene, IConfigSource source) | 53 | public void Initialise(IConfigSource source) {} |
54 | |||
55 | public void AddRegion(Scene scene) | ||
49 | { | 56 | { |
50 | scene.RegisterModuleInterface<IAttachmentsModule>(this); | ||
51 | m_scene = scene; | 57 | m_scene = scene; |
58 | m_scene.RegisterModuleInterface<IAttachmentsModule>(this); | ||
59 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | ||
60 | // TODO: Should probably be subscribing to CloseClient too, but this doesn't yet give us IClientAPI | ||
52 | } | 61 | } |
53 | 62 | ||
54 | public void PostInitialise() | 63 | public void RemoveRegion(Scene scene) |
55 | { | 64 | { |
65 | m_scene.UnregisterModuleInterface<IAttachmentsModule>(this); | ||
66 | m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; | ||
56 | } | 67 | } |
57 | 68 | ||
58 | public void Close() | 69 | public void RegionLoaded(Scene scene) {} |
70 | |||
71 | public void Close() | ||
59 | { | 72 | { |
73 | RemoveRegion(m_scene); | ||
60 | } | 74 | } |
61 | 75 | ||
62 | public string Name | 76 | public void SubscribeToClientEvents(IClientAPI client) |
63 | { | 77 | { |
64 | get { return "Attachments Module"; } | 78 | client.OnRezSingleAttachmentFromInv += RezSingleAttachmentFromInventory; |
79 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachmentsFromInventory; | ||
80 | client.OnObjectAttach += AttachObject; | ||
81 | client.OnObjectDetach += DetachObject; | ||
82 | client.OnDetachAttachmentIntoInv += ShowDetachInUserInventory; | ||
65 | } | 83 | } |
66 | 84 | ||
67 | public bool IsSharedModule | 85 | public void UnsubscribeFromClientEvents(IClientAPI client) |
68 | { | 86 | { |
69 | get { return false; } | 87 | client.OnRezSingleAttachmentFromInv -= RezSingleAttachmentFromInventory; |
88 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachmentsFromInventory; | ||
89 | client.OnObjectAttach -= AttachObject; | ||
90 | client.OnObjectDetach -= DetachObject; | ||
91 | client.OnDetachAttachmentIntoInv -= ShowDetachInUserInventory; | ||
70 | } | 92 | } |
71 | 93 | ||
72 | // Called by client | 94 | /// <summary> |
73 | // | 95 | /// Called by client |
96 | /// </summary> | ||
97 | /// <param name="remoteClient"></param> | ||
98 | /// <param name="objectLocalID"></param> | ||
99 | /// <param name="AttachmentPt"></param> | ||
100 | /// <param name="silent"></param> | ||
74 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) | 101 | public void AttachObject(IClientAPI remoteClient, uint objectLocalID, uint AttachmentPt, bool silent) |
75 | { | 102 | { |
76 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); | 103 | m_log.Debug("[ATTACHMENTS MODULE]: Invoking AttachObject"); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 50171a3..4b30b0d 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -47,6 +47,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
47 | m_scene = scene; | 47 | m_scene = scene; |
48 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); | 48 | m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>(); |
49 | m_scene.RegisterModuleInterface<IGodsModule>(this); | 49 | m_scene.RegisterModuleInterface<IGodsModule>(this); |
50 | m_scene.EventManager.OnNewClient += SubscribeToClientEvents; | ||
50 | } | 51 | } |
51 | 52 | ||
52 | public void PostInitialise() {} | 53 | public void PostInitialise() {} |
@@ -54,6 +55,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
54 | public string Name { get { return "Gods Module"; } } | 55 | public string Name { get { return "Gods Module"; } } |
55 | public bool IsSharedModule { get { return false; } } | 56 | public bool IsSharedModule { get { return false; } } |
56 | 57 | ||
58 | public void SubscribeToClientEvents(IClientAPI client) | ||
59 | { | ||
60 | client.OnGodKickUser += KickUser; | ||
61 | client.OnRequestGodlikePowers += RequestGodlikePowers; | ||
62 | } | ||
63 | |||
64 | public void UnsubscribeFromClientEvents(IClientAPI client) | ||
65 | { | ||
66 | client.OnGodKickUser -= KickUser; | ||
67 | client.OnRequestGodlikePowers -= RequestGodlikePowers; | ||
68 | } | ||
69 | |||
57 | public void RequestGodlikePowers( | 70 | public void RequestGodlikePowers( |
58 | UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) | 71 | UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient) |
59 | { | 72 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs index ab141eb..a3c40e0 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/InstantMessageModule.cs | |||
@@ -162,7 +162,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
162 | delegate(bool success) | 162 | delegate(bool success) |
163 | { | 163 | { |
164 | if (dialog == (uint)InstantMessageDialog.StartTyping || | 164 | if (dialog == (uint)InstantMessageDialog.StartTyping || |
165 | dialog == (uint)InstantMessageDialog.StopTyping) | 165 | dialog == (uint)InstantMessageDialog.StopTyping || |
166 | dialog == (uint)InstantMessageDialog.MessageFromObject) | ||
166 | { | 167 | { |
167 | return; | 168 | return; |
168 | } | 169 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index 83209fc..d025f0c 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -185,13 +185,16 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
185 | { | 185 | { |
186 | UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage; | 186 | UndeliveredMessage handlerUndeliveredMessage = OnUndeliveredMessage; |
187 | 187 | ||
188 | // If this event has handlers, then the IM will be considered | 188 | // If this event has handlers, then an IM from an agent will be |
189 | // delivered. This will suppress the error message. | 189 | // considered delivered. This will suppress the error message. |
190 | // | 190 | // |
191 | if (handlerUndeliveredMessage != null) | 191 | if (handlerUndeliveredMessage != null) |
192 | { | 192 | { |
193 | handlerUndeliveredMessage(im); | 193 | handlerUndeliveredMessage(im); |
194 | result(true); | 194 | if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent) |
195 | result(true); | ||
196 | else | ||
197 | result(false); | ||
195 | return; | 198 | return; |
196 | } | 199 | } |
197 | 200 | ||
@@ -504,14 +507,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
504 | // | 507 | // |
505 | if (upd.RegionID == prevRegionID) | 508 | if (upd.RegionID == prevRegionID) |
506 | { | 509 | { |
507 | m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); | 510 | // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); |
508 | HandleUndeliveredMessage(im, result); | 511 | HandleUndeliveredMessage(im, result); |
509 | return; | 512 | return; |
510 | } | 513 | } |
511 | } | 514 | } |
512 | else | 515 | else |
513 | { | 516 | { |
514 | m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); | 517 | // m_log.Error("[GRID INSTANT MESSAGE]: Unable to deliver an instant message"); |
515 | HandleUndeliveredMessage(im, result); | 518 | HandleUndeliveredMessage(im, result); |
516 | return; | 519 | return; |
517 | } | 520 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 31dfe14..7683288 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -54,6 +54,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
54 | 54 | ||
55 | private UserAccount m_userInfo; | 55 | private UserAccount m_userInfo; |
56 | private string m_invPath; | 56 | private string m_invPath; |
57 | |||
58 | /// <summary> | ||
59 | /// Do we want to merge this load with existing inventory? | ||
60 | /// </summary> | ||
61 | protected bool m_merge; | ||
57 | 62 | ||
58 | /// <value> | 63 | /// <value> |
59 | /// We only use this to request modules | 64 | /// We only use this to request modules |
@@ -66,19 +71,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
66 | private Stream m_loadStream; | 71 | private Stream m_loadStream; |
67 | 72 | ||
68 | public InventoryArchiveReadRequest( | 73 | public InventoryArchiveReadRequest( |
69 | Scene scene, UserAccount userInfo, string invPath, string loadPath) | 74 | Scene scene, UserAccount userInfo, string invPath, string loadPath, bool merge) |
70 | : this( | 75 | : this( |
71 | scene, | 76 | scene, |
72 | userInfo, | 77 | userInfo, |
73 | invPath, | 78 | invPath, |
74 | new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress)) | 79 | new GZipStream(ArchiveHelpers.GetStream(loadPath), CompressionMode.Decompress), |
80 | merge) | ||
75 | { | 81 | { |
76 | } | 82 | } |
77 | 83 | ||
78 | public InventoryArchiveReadRequest( | 84 | public InventoryArchiveReadRequest( |
79 | Scene scene, UserAccount userInfo, string invPath, Stream loadStream) | 85 | Scene scene, UserAccount userInfo, string invPath, Stream loadStream, bool merge) |
80 | { | 86 | { |
81 | m_scene = scene; | 87 | m_scene = scene; |
88 | m_merge = merge; | ||
82 | m_userInfo = userInfo; | 89 | m_userInfo = userInfo; |
83 | m_invPath = invPath; | 90 | m_invPath = invPath; |
84 | m_loadStream = loadStream; | 91 | m_loadStream = loadStream; |
@@ -91,7 +98,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
91 | /// A list of the inventory nodes loaded. If folders were loaded then only the root folders are | 98 | /// A list of the inventory nodes loaded. If folders were loaded then only the root folders are |
92 | /// returned | 99 | /// returned |
93 | /// </returns> | 100 | /// </returns> |
94 | public List<InventoryNodeBase> Execute() | 101 | public HashSet<InventoryNodeBase> Execute() |
95 | { | 102 | { |
96 | try | 103 | try |
97 | { | 104 | { |
@@ -100,7 +107,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
100 | int failedAssetRestores = 0; | 107 | int failedAssetRestores = 0; |
101 | int successfulItemRestores = 0; | 108 | int successfulItemRestores = 0; |
102 | 109 | ||
103 | List<InventoryNodeBase> loadedNodes = new List<InventoryNodeBase>(); | 110 | HashSet<InventoryNodeBase> loadedNodes = new HashSet<InventoryNodeBase>(); |
104 | 111 | ||
105 | List<InventoryFolderBase> folderCandidates | 112 | List<InventoryFolderBase> folderCandidates |
106 | = InventoryArchiveUtils.FindFolderByPath( | 113 | = InventoryArchiveUtils.FindFolderByPath( |
@@ -158,9 +165,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
158 | { | 165 | { |
159 | successfulItemRestores++; | 166 | successfulItemRestores++; |
160 | 167 | ||
161 | // If we're loading an item directly into the given destination folder then we need to record | 168 | // If we aren't loading the folder containing the item then well need to update the |
162 | // it separately from any loaded root folders | 169 | // viewer separately for that item. |
163 | if (rootDestinationFolder == foundFolder) | 170 | if (!loadedNodes.Contains(foundFolder)) |
164 | loadedNodes.Add(item); | 171 | loadedNodes.Add(item); |
165 | } | 172 | } |
166 | } | 173 | } |
@@ -205,14 +212,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
205 | string iarPath, | 212 | string iarPath, |
206 | InventoryFolderBase rootDestFolder, | 213 | InventoryFolderBase rootDestFolder, |
207 | Dictionary <string, InventoryFolderBase> resolvedFolders, | 214 | Dictionary <string, InventoryFolderBase> resolvedFolders, |
208 | List<InventoryNodeBase> loadedNodes) | 215 | HashSet<InventoryNodeBase> loadedNodes) |
209 | { | 216 | { |
210 | string iarPathExisting = iarPath; | 217 | string iarPathExisting = iarPath; |
211 | 218 | ||
212 | // m_log.DebugFormat( | 219 | // m_log.DebugFormat( |
213 | // "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); | 220 | // "[INVENTORY ARCHIVER]: Loading folder {0} {1}", rootDestFolder.Name, rootDestFolder.ID); |
214 | 221 | ||
215 | InventoryFolderBase destFolder = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); | 222 | InventoryFolderBase destFolder |
223 | = ResolveDestinationFolder(rootDestFolder, ref iarPathExisting, resolvedFolders); | ||
216 | 224 | ||
217 | // m_log.DebugFormat( | 225 | // m_log.DebugFormat( |
218 | // "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", | 226 | // "[INVENTORY ARCHIVER]: originalArchivePath [{0}], section already loaded [{1}]", |
@@ -251,46 +259,55 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
251 | { | 259 | { |
252 | // string originalArchivePath = archivePath; | 260 | // string originalArchivePath = archivePath; |
253 | 261 | ||
254 | InventoryFolderBase destFolder = null; | 262 | while (archivePath.Length > 0) |
255 | |||
256 | if (archivePath.Length > 0) | ||
257 | { | 263 | { |
258 | while (null == destFolder && archivePath.Length > 0) | 264 | m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); |
265 | |||
266 | if (resolvedFolders.ContainsKey(archivePath)) | ||
267 | { | ||
268 | // m_log.DebugFormat( | ||
269 | // "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); | ||
270 | return resolvedFolders[archivePath]; | ||
271 | } | ||
272 | else | ||
259 | { | 273 | { |
260 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Trying to resolve destination folder {0}", archivePath); | 274 | if (m_merge) |
275 | { | ||
276 | // TODO: Using m_invPath is totally wrong - what we need to do is strip the uuid from the | ||
277 | // iar name and try to find that instead. | ||
278 | string plainPath = ArchiveConstants.ExtractPlainPathFromIarPath(archivePath); | ||
279 | List<InventoryFolderBase> folderCandidates | ||
280 | = InventoryArchiveUtils.FindFolderByPath( | ||
281 | m_scene.InventoryService, m_userInfo.PrincipalID, plainPath); | ||
282 | |||
283 | if (folderCandidates.Count != 0) | ||
284 | { | ||
285 | InventoryFolderBase destFolder = folderCandidates[0]; | ||
286 | resolvedFolders[archivePath] = destFolder; | ||
287 | return destFolder; | ||
288 | } | ||
289 | } | ||
261 | 290 | ||
262 | if (resolvedFolders.ContainsKey(archivePath)) | 291 | // Don't include the last slash so find the penultimate one |
292 | int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); | ||
293 | |||
294 | if (penultimateSlashIndex >= 0) | ||
263 | { | 295 | { |
264 | // m_log.DebugFormat( | 296 | // Remove the last section of path so that we can see if we've already resolved the parent |
265 | // "[INVENTORY ARCHIVER]: Found previously created folder from archive path {0}", archivePath); | 297 | archivePath = archivePath.Remove(penultimateSlashIndex + 1); |
266 | destFolder = resolvedFolders[archivePath]; | ||
267 | } | 298 | } |
268 | else | 299 | else |
269 | { | 300 | { |
270 | // Don't include the last slash so find the penultimate one | 301 | // m_log.DebugFormat( |
271 | int penultimateSlashIndex = archivePath.LastIndexOf("/", archivePath.Length - 2); | 302 | // "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", |
272 | 303 | // originalArchivePath); | |
273 | if (penultimateSlashIndex >= 0) | 304 | archivePath = string.Empty; |
274 | { | 305 | return rootDestFolder; |
275 | // Remove the last section of path so that we can see if we've already resolved the parent | ||
276 | archivePath = archivePath.Remove(penultimateSlashIndex + 1); | ||
277 | } | ||
278 | else | ||
279 | { | ||
280 | // m_log.DebugFormat( | ||
281 | // "[INVENTORY ARCHIVER]: Found no previously created folder for archive path {0}", | ||
282 | // originalArchivePath); | ||
283 | archivePath = string.Empty; | ||
284 | destFolder = rootDestFolder; | ||
285 | } | ||
286 | } | 306 | } |
287 | } | 307 | } |
288 | } | 308 | } |
289 | 309 | ||
290 | if (null == destFolder) | 310 | return rootDestFolder; |
291 | destFolder = rootDestFolder; | ||
292 | |||
293 | return destFolder; | ||
294 | } | 311 | } |
295 | 312 | ||
296 | /// <summary> | 313 | /// <summary> |
@@ -316,24 +333,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
316 | string iarPathExisting, | 333 | string iarPathExisting, |
317 | string iarPathToReplicate, | 334 | string iarPathToReplicate, |
318 | Dictionary <string, InventoryFolderBase> resolvedFolders, | 335 | Dictionary <string, InventoryFolderBase> resolvedFolders, |
319 | List<InventoryNodeBase> loadedNodes) | 336 | HashSet<InventoryNodeBase> loadedNodes) |
320 | { | 337 | { |
321 | string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); | 338 | string[] rawDirsToCreate = iarPathToReplicate.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries); |
322 | int i = 0; | ||
323 | 339 | ||
324 | while (i < rawDirsToCreate.Length) | 340 | for (int i = 0; i < rawDirsToCreate.Length; i++) |
325 | { | 341 | { |
326 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0} from IAR", rawDirsToCreate[i]); | 342 | // m_log.DebugFormat("[INVENTORY ARCHIVER]: Creating folder {0} from IAR", rawDirsToCreate[i]); |
327 | 343 | ||
344 | if (!rawDirsToCreate[i].Contains(ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR)) | ||
345 | continue; | ||
346 | |||
328 | int identicalNameIdentifierIndex | 347 | int identicalNameIdentifierIndex |
329 | = rawDirsToCreate[i].LastIndexOf( | 348 | = rawDirsToCreate[i].LastIndexOf( |
330 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); | 349 | ArchiveConstants.INVENTORY_NODE_NAME_COMPONENT_SEPARATOR); |
331 | 350 | ||
332 | if (identicalNameIdentifierIndex < 0) | ||
333 | { | ||
334 | i++; | ||
335 | continue; | ||
336 | } | ||
337 | string newFolderName = rawDirsToCreate[i].Remove(identicalNameIdentifierIndex); | 351 | string newFolderName = rawDirsToCreate[i].Remove(identicalNameIdentifierIndex); |
338 | 352 | ||
339 | newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); | 353 | newFolderName = InventoryArchiveUtils.UnescapeArchivePath(newFolderName); |
@@ -356,8 +370,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
356 | 370 | ||
357 | if (0 == i) | 371 | if (0 == i) |
358 | loadedNodes.Add(destFolder); | 372 | loadedNodes.Add(destFolder); |
359 | |||
360 | i++; | ||
361 | } | 373 | } |
362 | } | 374 | } |
363 | 375 | ||
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs index f7a2b09..f03f2a1 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiverModule.cs | |||
@@ -91,12 +91,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
91 | 91 | ||
92 | scene.AddCommand( | 92 | scene.AddCommand( |
93 | this, "load iar", | 93 | this, "load iar", |
94 | "load iar <first> <last> <inventory path> <password> [<IAR path>]", | 94 | "load iar <first> <last> <inventory path> <password> [<IAR path>]", |
95 | //"load iar [--merge] <first> <last> <inventory path> <password> [<IAR path>]", | 95 | //"load iar [--merge] <first> <last> <inventory path> <password> [<IAR path>]", |
96 | "Load user inventory archive (IAR).", | 96 | "Load user inventory archive (IAR).", |
97 | //"--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones" | 97 | //"--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones" |
98 | //+ "<first> is user's first name." + Environment.NewLine | 98 | //+ "<first> is user's first name." + Environment.NewLine |
99 | "<first> is user's first name." + Environment.NewLine | 99 | "<first> is user's first name." + Environment.NewLine |
100 | + "<last> is user's last name." + Environment.NewLine | 100 | + "<last> is user's last name." + Environment.NewLine |
101 | + "<inventory path> is the path inside the user's inventory where the IAR should be loaded." + Environment.NewLine | 101 | + "<inventory path> is the path inside the user's inventory where the IAR should be loaded." + Environment.NewLine |
102 | + "<password> is the user's password." + Environment.NewLine | 102 | + "<password> is the user's password." + Environment.NewLine |
@@ -136,16 +136,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
136 | if (handlerInventoryArchiveSaved != null) | 136 | if (handlerInventoryArchiveSaved != null) |
137 | handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException); | 137 | handlerInventoryArchiveSaved(id, succeeded, userInfo, invPath, saveStream, reportedException); |
138 | } | 138 | } |
139 | 139 | ||
140 | public bool ArchiveInventory( | 140 | public bool ArchiveInventory( |
141 | Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) | 141 | Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream) |
142 | { | 142 | { |
143 | return ArchiveInventory(id, firstName, lastName, invPath, pass, saveStream, new Dictionary<string, object>()); | 143 | return ArchiveInventory(id, firstName, lastName, invPath, pass, saveStream, new Dictionary<string, object>()); |
144 | } | 144 | } |
145 | 145 | ||
146 | public bool ArchiveInventory( | 146 | public bool ArchiveInventory( |
147 | Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, | 147 | Guid id, string firstName, string lastName, string invPath, string pass, Stream saveStream, |
148 | Dictionary<string, object> options) | 148 | Dictionary<string, object> options) |
149 | { | 149 | { |
150 | if (m_scenes.Count > 0) | 150 | if (m_scenes.Count > 0) |
151 | { | 151 | { |
@@ -184,8 +184,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
184 | } | 184 | } |
185 | 185 | ||
186 | public bool ArchiveInventory( | 186 | public bool ArchiveInventory( |
187 | Guid id, string firstName, string lastName, string invPath, string pass, string savePath, | 187 | Guid id, string firstName, string lastName, string invPath, string pass, string savePath, |
188 | Dictionary<string, object> options) | 188 | Dictionary<string, object> options) |
189 | { | 189 | { |
190 | if (m_scenes.Count > 0) | 190 | if (m_scenes.Count > 0) |
191 | { | 191 | { |
@@ -224,13 +224,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
224 | } | 224 | } |
225 | 225 | ||
226 | public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream) | 226 | public bool DearchiveInventory(string firstName, string lastName, string invPath, string pass, Stream loadStream) |
227 | { | 227 | { |
228 | return DearchiveInventory(firstName, lastName, invPath, pass, loadStream, new Dictionary<string, object>()); | 228 | return DearchiveInventory(firstName, lastName, invPath, pass, loadStream, new Dictionary<string, object>()); |
229 | } | 229 | } |
230 | 230 | ||
231 | public bool DearchiveInventory( | 231 | public bool DearchiveInventory( |
232 | string firstName, string lastName, string invPath, string pass, Stream loadStream, | 232 | string firstName, string lastName, string invPath, string pass, Stream loadStream, |
233 | Dictionary<string, object> options) | 233 | Dictionary<string, object> options) |
234 | { | 234 | { |
235 | if (m_scenes.Count > 0) | 235 | if (m_scenes.Count > 0) |
236 | { | 236 | { |
@@ -241,10 +241,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
241 | if (CheckPresence(userInfo.PrincipalID)) | 241 | if (CheckPresence(userInfo.PrincipalID)) |
242 | { | 242 | { |
243 | InventoryArchiveReadRequest request; | 243 | InventoryArchiveReadRequest request; |
244 | bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); | ||
244 | 245 | ||
245 | try | 246 | try |
246 | { | 247 | { |
247 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream); | 248 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadStream, merge); |
248 | } | 249 | } |
249 | catch (EntryPointNotFoundException e) | 250 | catch (EntryPointNotFoundException e) |
250 | { | 251 | { |
@@ -273,8 +274,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
273 | } | 274 | } |
274 | 275 | ||
275 | public bool DearchiveInventory( | 276 | public bool DearchiveInventory( |
276 | string firstName, string lastName, string invPath, string pass, string loadPath, | 277 | string firstName, string lastName, string invPath, string pass, string loadPath, |
277 | Dictionary<string, object> options) | 278 | Dictionary<string, object> options) |
278 | { | 279 | { |
279 | if (m_scenes.Count > 0) | 280 | if (m_scenes.Count > 0) |
280 | { | 281 | { |
@@ -285,10 +286,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
285 | if (CheckPresence(userInfo.PrincipalID)) | 286 | if (CheckPresence(userInfo.PrincipalID)) |
286 | { | 287 | { |
287 | InventoryArchiveReadRequest request; | 288 | InventoryArchiveReadRequest request; |
289 | bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); | ||
288 | 290 | ||
289 | try | 291 | try |
290 | { | 292 | { |
291 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath); | 293 | request = new InventoryArchiveReadRequest(m_aScene, userInfo, invPath, loadPath, merge); |
292 | } | 294 | } |
293 | catch (EntryPointNotFoundException e) | 295 | catch (EntryPointNotFoundException e) |
294 | { | 296 | { |
@@ -334,7 +336,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
334 | if (mainParams.Count < 6) | 336 | if (mainParams.Count < 6) |
335 | { | 337 | { |
336 | m_log.Error( | 338 | m_log.Error( |
337 | "[INVENTORY ARCHIVER]: usage is load iar <first name> <last name> <inventory path> <user password> [<load file path>]"); | 339 | "[INVENTORY ARCHIVER]: usage is load iar [--merge] <first name> <last name> <inventory path> <user password> [<load file path>]"); |
338 | return; | 340 | return; |
339 | } | 341 | } |
340 | 342 | ||
@@ -356,7 +358,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
356 | catch (InventoryArchiverException e) | 358 | catch (InventoryArchiverException e) |
357 | { | 359 | { |
358 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message); | 360 | m_log.ErrorFormat("[INVENTORY ARCHIVER]: {0}", e.Message); |
359 | } | 361 | } |
360 | } | 362 | } |
361 | 363 | ||
362 | /// <summary> | 364 | /// <summary> |
@@ -469,7 +471,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
469 | /// Notify the client of loaded nodes if they are logged in | 471 | /// Notify the client of loaded nodes if they are logged in |
470 | /// </summary> | 472 | /// </summary> |
471 | /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param> | 473 | /// <param name="loadedNodes">Can be empty. In which case, nothing happens</param> |
472 | private void UpdateClientWithLoadedNodes(UserAccount userInfo, List<InventoryNodeBase> loadedNodes) | 474 | private void UpdateClientWithLoadedNodes(UserAccount userInfo, HashSet<InventoryNodeBase> loadedNodes) |
473 | { | 475 | { |
474 | if (loadedNodes.Count == 0) | 476 | if (loadedNodes.Count == 0) |
475 | return; | 477 | return; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs index 4531bfd..2d80382 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/Tests/InventoryArchiverTests.cs | |||
@@ -629,7 +629,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
629 | UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); | 629 | UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); |
630 | 630 | ||
631 | Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); | 631 | Dictionary <string, InventoryFolderBase> foldersCreated = new Dictionary<string, InventoryFolderBase>(); |
632 | List<InventoryNodeBase> nodesLoaded = new List<InventoryNodeBase>(); | 632 | HashSet<InventoryNodeBase> nodesLoaded = new HashSet<InventoryNodeBase>(); |
633 | 633 | ||
634 | string folder1Name = "1"; | 634 | string folder1Name = "1"; |
635 | string folder2aName = "2a"; | 635 | string folder2aName = "2a"; |
@@ -644,7 +644,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
644 | 644 | ||
645 | { | 645 | { |
646 | // Test replication of path1 | 646 | // Test replication of path1 |
647 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) | 647 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) |
648 | .ReplicateArchivePathToUserInventory( | 648 | .ReplicateArchivePathToUserInventory( |
649 | iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 649 | iarPath1, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
650 | foldersCreated, nodesLoaded); | 650 | foldersCreated, nodesLoaded); |
@@ -661,7 +661,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
661 | 661 | ||
662 | { | 662 | { |
663 | // Test replication of path2 | 663 | // Test replication of path2 |
664 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) | 664 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) |
665 | .ReplicateArchivePathToUserInventory( | 665 | .ReplicateArchivePathToUserInventory( |
666 | iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 666 | iarPath2, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
667 | foldersCreated, nodesLoaded); | 667 | foldersCreated, nodesLoaded); |
@@ -707,10 +707,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
707 | 707 | ||
708 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); | 708 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); |
709 | 709 | ||
710 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null) | 710 | new InventoryArchiveReadRequest(scene, ua1, null, (Stream)null, false) |
711 | .ReplicateArchivePathToUserInventory( | 711 | .ReplicateArchivePathToUserInventory( |
712 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | 712 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), |
713 | new Dictionary<string, InventoryFolderBase>(), new List<InventoryNodeBase>()); | 713 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); |
714 | 714 | ||
715 | List<InventoryFolderBase> folder1PostCandidates | 715 | List<InventoryFolderBase> folder1PostCandidates |
716 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | 716 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); |
@@ -732,5 +732,45 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests | |||
732 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); | 732 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1Post, "b"); |
733 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); | 733 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); |
734 | } | 734 | } |
735 | |||
736 | /// <summary> | ||
737 | /// Test replication of a partly existing archive path to the user's inventory. This should create | ||
738 | /// a merged path. | ||
739 | /// </summary> | ||
740 | [Test] | ||
741 | public void TestMergeIarPath() | ||
742 | { | ||
743 | TestHelper.InMethod(); | ||
744 | log4net.Config.XmlConfigurator.Configure(); | ||
745 | |||
746 | Scene scene = SceneSetupHelpers.SetupScene("inventory"); | ||
747 | UserAccount ua1 = UserProfileTestUtils.CreateUserWithInventory(scene); | ||
748 | |||
749 | string folder1ExistingName = "a"; | ||
750 | string folder2Name = "b"; | ||
751 | |||
752 | InventoryFolderBase folder1 | ||
753 | = UserInventoryTestUtils.CreateInventoryFolder( | ||
754 | scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | ||
755 | |||
756 | string folder1ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder1ExistingName, UUID.Random()); | ||
757 | string folder2ArchiveName = InventoryArchiveWriteRequest.CreateArchiveFolderName(folder2Name, UUID.Random()); | ||
758 | |||
759 | string itemArchivePath = string.Join("", new string[] { folder1ArchiveName, folder2ArchiveName }); | ||
760 | |||
761 | new InventoryArchiveReadRequest(scene, ua1, folder1ExistingName, (Stream)null, true) | ||
762 | .ReplicateArchivePathToUserInventory( | ||
763 | itemArchivePath, scene.InventoryService.GetRootFolder(ua1.PrincipalID), | ||
764 | new Dictionary<string, InventoryFolderBase>(), new HashSet<InventoryNodeBase>()); | ||
765 | |||
766 | List<InventoryFolderBase> folder1PostCandidates | ||
767 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, ua1.PrincipalID, folder1ExistingName); | ||
768 | Assert.That(folder1PostCandidates.Count, Is.EqualTo(1)); | ||
769 | Assert.That(folder1PostCandidates[0].ID, Is.EqualTo(folder1.ID)); | ||
770 | |||
771 | List<InventoryFolderBase> folder2PostCandidates | ||
772 | = InventoryArchiveUtils.FindFolderByPath(scene.InventoryService, folder1PostCandidates[0], "b"); | ||
773 | Assert.That(folder2PostCandidates.Count, Is.EqualTo(1)); | ||
774 | } | ||
735 | } | 775 | } |
736 | } \ No newline at end of file | 776 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs index 36dae6b..9c20d68 100644 --- a/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs +++ b/OpenSim/Region/CoreModules/Framework/Library/LibraryModule.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -173,16 +173,16 @@ namespace OpenSim.Region.CoreModules.Framework.Library | |||
173 | m_log.InfoFormat("[LIBRARY MODULE]: Loading library archive {0} ({1})...", iarFileName, simpleName); | 173 | m_log.InfoFormat("[LIBRARY MODULE]: Loading library archive {0} ({1})...", iarFileName, simpleName); |
174 | simpleName = GetInventoryPathFromName(simpleName); | 174 | simpleName = GetInventoryPathFromName(simpleName); |
175 | 175 | ||
176 | InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, simpleName, iarFileName); | 176 | InventoryArchiveReadRequest archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, simpleName, iarFileName, false); |
177 | try | 177 | try |
178 | { | 178 | { |
179 | List<InventoryNodeBase> nodes = archread.Execute(); | 179 | HashSet<InventoryNodeBase> nodes = archread.Execute(); |
180 | if (nodes != null && nodes.Count == 0) | 180 | if (nodes != null && nodes.Count == 0) |
181 | { | 181 | { |
182 | // didn't find the subfolder with the given name; place it on the top | 182 | // didn't find the subfolder with the given name; place it on the top |
183 | m_log.InfoFormat("[LIBRARY MODULE]: Didn't find {0} in library. Placing archive on the top level", simpleName); | 183 | m_log.InfoFormat("[LIBRARY MODULE]: Didn't find {0} in library. Placing archive on the top level", simpleName); |
184 | archread.Close(); | 184 | archread.Close(); |
185 | archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName); | 185 | archread = new InventoryArchiveReadRequest(m_MockScene, uinfo, "/", iarFileName, false); |
186 | archread.Execute(); | 186 | archread.Execute(); |
187 | } | 187 | } |
188 | foreach (InventoryNodeBase node in nodes) | 188 | foreach (InventoryNodeBase node in nodes) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 2a87da2..6864629 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -283,6 +283,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
283 | 283 | ||
284 | public bool IsBannedFromLand(UUID avatar) | 284 | public bool IsBannedFromLand(UUID avatar) |
285 | { | 285 | { |
286 | if (m_scene.Permissions.IsAdministrator(avatar)) | ||
287 | return false; | ||
288 | |||
286 | if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) | 289 | if ((LandData.Flags & (uint) ParcelFlags.UseBanList) > 0) |
287 | { | 290 | { |
288 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 291 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
@@ -301,6 +304,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
301 | 304 | ||
302 | public bool IsRestrictedFromLand(UUID avatar) | 305 | public bool IsRestrictedFromLand(UUID avatar) |
303 | { | 306 | { |
307 | if (m_scene.Permissions.IsAdministrator(avatar)) | ||
308 | return false; | ||
309 | |||
304 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) | 310 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) |
305 | { | 311 | { |
306 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); | 312 | ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); |
diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 8549b36..82ad109 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs | |||
@@ -59,9 +59,7 @@ namespace OpenSim.Region.CoreModules.Media.Moap | |||
59 | 59 | ||
60 | public string Name { get { return "MoapModule"; } } | 60 | public string Name { get { return "MoapModule"; } } |
61 | public Type ReplaceableInterface { get { return null; } } | 61 | public Type ReplaceableInterface { get { return null; } } |
62 | 62 | ||
63 | public const string MEDIA_TEXTURE_TYPE = "sl"; | ||
64 | |||
65 | /// <summary> | 63 | /// <summary> |
66 | /// Is this module enabled? | 64 | /// Is this module enabled? |
67 | /// </summary> | 65 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 3a642f4..bc54997 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -210,6 +210,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
210 | m_scene.Permissions.OnDeedParcel += CanDeedParcel; | 210 | m_scene.Permissions.OnDeedParcel += CanDeedParcel; |
211 | m_scene.Permissions.OnDeedObject += CanDeedObject; | 211 | m_scene.Permissions.OnDeedObject += CanDeedObject; |
212 | m_scene.Permissions.OnIsGod += IsGod; | 212 | m_scene.Permissions.OnIsGod += IsGod; |
213 | m_scene.Permissions.OnIsAdministrator += IsAdministrator; | ||
213 | m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; | 214 | m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; |
214 | m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED | 215 | m_scene.Permissions.OnDeleteObject += CanDeleteObject; //MAYBE FULLY IMPLEMENTED |
215 | m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED | 216 | m_scene.Permissions.OnEditObject += CanEditObject; //MAYBE FULLY IMPLEMENTED |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs b/OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs index e23be59..36917e9 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/DefaultEffects/ChannelDigger.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Effects/ChannelDigger.cs | |||
@@ -30,7 +30,7 @@ using OpenSim.Region.CoreModules.World.Terrain; | |||
30 | using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; | 30 | using OpenSim.Region.CoreModules.World.Terrain.FloodBrushes; |
31 | using OpenSim.Region.Framework.Interfaces; | 31 | using OpenSim.Region.Framework.Interfaces; |
32 | 32 | ||
33 | namespace OpenSim.Region.Modules.Terrain.Extensions.DefaultEffects.Effects | 33 | namespace OpenSim.Region.CoreModules.World.Terrain.Effects |
34 | { | 34 | { |
35 | public class ChannelDigger : ITerrainEffect | 35 | public class ChannelDigger : ITerrainEffect |
36 | { | 36 | { |
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index 1e7ea7b..2c5e444 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
68 | #endregion | 68 | #endregion |
69 | 69 | ||
70 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 70 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
71 | 71 | ||
72 | private readonly Commander m_commander = new Commander("terrain"); | 72 | private readonly Commander m_commander = new Commander("terrain"); |
73 | 73 | ||
74 | private readonly Dictionary<StandardTerrainEffects, ITerrainFloodEffect> m_floodeffects = | 74 | private readonly Dictionary<StandardTerrainEffects, ITerrainFloodEffect> m_floodeffects = |
@@ -381,8 +381,13 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
381 | private void LoadPlugins() | 381 | private void LoadPlugins() |
382 | { | 382 | { |
383 | m_plugineffects = new Dictionary<string, ITerrainEffect>(); | 383 | m_plugineffects = new Dictionary<string, ITerrainEffect>(); |
384 | string plugineffectsPath = "Terrain"; | ||
385 | |||
384 | // Load the files in the Terrain/ dir | 386 | // Load the files in the Terrain/ dir |
385 | string[] files = Directory.GetFiles("Terrain"); | 387 | if (!Directory.Exists(plugineffectsPath)) |
388 | return; | ||
389 | |||
390 | string[] files = Directory.GetFiles(plugineffectsPath); | ||
386 | foreach (string file in files) | 391 | foreach (string file in files) |
387 | { | 392 | { |
388 | m_log.Info("Loading effects in " + file); | 393 | m_log.Info("Loading effects in " + file); |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index de4c5fb..a90e0f3 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -131,7 +131,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
131 | anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) | 131 | anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) |
132 | { | 132 | { |
133 | // 16384 is CHANGED_ANIMATION | 133 | // 16384 is CHANGED_ANIMATION |
134 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { 16384 }); | 134 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION}); |
135 | SendAnimPack(); | 135 | SendAnimPack(); |
136 | } | 136 | } |
137 | } | 137 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs index 0033900..4e80bf2 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Permissions.cs | |||
@@ -64,6 +64,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
64 | public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); | 64 | public delegate bool RunConsoleCommandHandler(UUID user, Scene requestFromScene); |
65 | public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); | 65 | public delegate bool IssueEstateCommandHandler(UUID user, Scene requestFromScene, bool ownerCommand); |
66 | public delegate bool IsGodHandler(UUID user, Scene requestFromScene); | 66 | public delegate bool IsGodHandler(UUID user, Scene requestFromScene); |
67 | public delegate bool IsAdministratorHandler(UUID user); | ||
67 | public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); | 68 | public delegate bool EditParcelHandler(UUID user, ILandObject parcel, Scene scene); |
68 | public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); | 69 | public delegate bool SellParcelHandler(UUID user, ILandObject parcel, Scene scene); |
69 | public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); | 70 | public delegate bool AbandonParcelHandler(UUID user, ILandObject parcel, Scene scene); |
@@ -124,6 +125,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
124 | public event RunConsoleCommandHandler OnRunConsoleCommand; | 125 | public event RunConsoleCommandHandler OnRunConsoleCommand; |
125 | public event IssueEstateCommandHandler OnIssueEstateCommand; | 126 | public event IssueEstateCommandHandler OnIssueEstateCommand; |
126 | public event IsGodHandler OnIsGod; | 127 | public event IsGodHandler OnIsGod; |
128 | public event IsAdministratorHandler OnIsAdministrator; | ||
127 | public event EditParcelHandler OnEditParcel; | 129 | public event EditParcelHandler OnEditParcel; |
128 | public event SellParcelHandler OnSellParcel; | 130 | public event SellParcelHandler OnSellParcel; |
129 | public event AbandonParcelHandler OnAbandonParcel; | 131 | public event AbandonParcelHandler OnAbandonParcel; |
@@ -656,6 +658,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
656 | } | 658 | } |
657 | return true; | 659 | return true; |
658 | } | 660 | } |
661 | |||
662 | public bool IsAdministrator(UUID user) | ||
663 | { | ||
664 | IsAdministratorHandler handler = OnIsAdministrator; | ||
665 | if (handler != null) | ||
666 | { | ||
667 | Delegate[] list = handler.GetInvocationList(); | ||
668 | foreach (IsAdministratorHandler h in list) | ||
669 | { | ||
670 | if (h(user) == false) | ||
671 | return false; | ||
672 | } | ||
673 | } | ||
674 | return true; | ||
675 | } | ||
659 | #endregion | 676 | #endregion |
660 | 677 | ||
661 | #region EDIT PARCEL | 678 | #region EDIT PARCEL |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index e8dce08..dcd7f3d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2727,7 +2727,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
2727 | IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); | 2727 | IUserAgentVerificationModule userVerification = RequestModuleInterface<IUserAgentVerificationModule>(); |
2728 | if (userVerification != null && ep != null) | 2728 | if (userVerification != null && ep != null) |
2729 | { | 2729 | { |
2730 | if (!userVerification.VerifyClient(aCircuit, ep.Address.ToString())) | 2730 | System.Net.IPAddress addr = NetworkUtil.GetExternalIPOf(ep.Address); |
2731 | |||
2732 | if (!userVerification.VerifyClient(aCircuit, /*ep.Address.ToString() */ addr.ToString())) | ||
2731 | { | 2733 | { |
2732 | // uh-oh, this is fishy | 2734 | // uh-oh, this is fishy |
2733 | m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); | 2735 | m_log.DebugFormat("[Scene]: User Client Verification for {0} {1} in {2} returned false", aCircuit.firstname, aCircuit.lastname, RegionInfo.RegionName); |
@@ -2785,17 +2787,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2785 | SubscribeToClientPrimEvents(client); | 2787 | SubscribeToClientPrimEvents(client); |
2786 | SubscribeToClientPrimRezEvents(client); | 2788 | SubscribeToClientPrimRezEvents(client); |
2787 | SubscribeToClientInventoryEvents(client); | 2789 | SubscribeToClientInventoryEvents(client); |
2788 | SubscribeToClientAttachmentEvents(client); | ||
2789 | SubscribeToClientTeleportEvents(client); | 2790 | SubscribeToClientTeleportEvents(client); |
2790 | SubscribeToClientScriptEvents(client); | 2791 | SubscribeToClientScriptEvents(client); |
2791 | SubscribeToClientParcelEvents(client); | 2792 | SubscribeToClientParcelEvents(client); |
2792 | SubscribeToClientGridEvents(client); | 2793 | SubscribeToClientGridEvents(client); |
2793 | SubscribeToClientGodEvents(client); | ||
2794 | |||
2795 | SubscribeToClientNetworkEvents(client); | 2794 | SubscribeToClientNetworkEvents(client); |
2796 | |||
2797 | |||
2798 | // EventManager.TriggerOnNewClient(client); | ||
2799 | } | 2795 | } |
2800 | 2796 | ||
2801 | public virtual void SubscribeToClientTerrainEvents(IClientAPI client) | 2797 | public virtual void SubscribeToClientTerrainEvents(IClientAPI client) |
@@ -2805,8 +2801,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2805 | } | 2801 | } |
2806 | 2802 | ||
2807 | public virtual void SubscribeToClientPrimEvents(IClientAPI client) | 2803 | public virtual void SubscribeToClientPrimEvents(IClientAPI client) |
2808 | { | 2804 | { |
2809 | |||
2810 | client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition; | 2805 | client.OnUpdatePrimGroupPosition += m_sceneGraph.UpdatePrimPosition; |
2811 | client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition; | 2806 | client.OnUpdatePrimSinglePosition += m_sceneGraph.UpdatePrimSinglePosition; |
2812 | client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation; | 2807 | client.OnUpdatePrimGroupRotation += m_sceneGraph.UpdatePrimRotation; |
@@ -2876,18 +2871,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2876 | client.OnMoveTaskItem += ClientMoveTaskInventoryItem; | 2871 | client.OnMoveTaskItem += ClientMoveTaskInventoryItem; |
2877 | } | 2872 | } |
2878 | 2873 | ||
2879 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) | ||
2880 | { | ||
2881 | if (AttachmentsModule != null) | ||
2882 | { | ||
2883 | client.OnRezSingleAttachmentFromInv += AttachmentsModule.RezSingleAttachmentFromInventory; | ||
2884 | client.OnRezMultipleAttachmentsFromInv += AttachmentsModule.RezMultipleAttachmentsFromInventory; | ||
2885 | client.OnObjectAttach += AttachmentsModule.AttachObject; | ||
2886 | client.OnObjectDetach += AttachmentsModule.DetachObject; | ||
2887 | client.OnDetachAttachmentIntoInv += AttachmentsModule.ShowDetachInUserInventory; | ||
2888 | } | ||
2889 | } | ||
2890 | |||
2891 | public virtual void SubscribeToClientTeleportEvents(IClientAPI client) | 2874 | public virtual void SubscribeToClientTeleportEvents(IClientAPI client) |
2892 | { | 2875 | { |
2893 | client.OnTeleportLocationRequest += RequestTeleportLocation; | 2876 | client.OnTeleportLocationRequest += RequestTeleportLocation; |
@@ -2917,44 +2900,29 @@ namespace OpenSim.Region.Framework.Scenes | |||
2917 | client.OnSetStartLocationRequest += SetHomeRezPoint; | 2900 | client.OnSetStartLocationRequest += SetHomeRezPoint; |
2918 | client.OnRegionHandleRequest += RegionHandleRequest; | 2901 | client.OnRegionHandleRequest += RegionHandleRequest; |
2919 | } | 2902 | } |
2920 | 2903 | ||
2921 | public virtual void SubscribeToClientGodEvents(IClientAPI client) | ||
2922 | { | ||
2923 | IGodsModule godsModule = RequestModuleInterface<IGodsModule>(); | ||
2924 | client.OnGodKickUser += godsModule.KickUser; | ||
2925 | client.OnRequestGodlikePowers += godsModule.RequestGodlikePowers; | ||
2926 | } | ||
2927 | |||
2928 | public virtual void SubscribeToClientNetworkEvents(IClientAPI client) | 2904 | public virtual void SubscribeToClientNetworkEvents(IClientAPI client) |
2929 | { | 2905 | { |
2930 | client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats; | 2906 | client.OnNetworkStatsUpdate += StatsReporter.AddPacketsStats; |
2931 | client.OnViewerEffect += ProcessViewerEffect; | 2907 | client.OnViewerEffect += ProcessViewerEffect; |
2932 | } | 2908 | } |
2933 | 2909 | ||
2934 | protected virtual void UnsubscribeToClientEvents(IClientAPI client) | ||
2935 | { | ||
2936 | } | ||
2937 | |||
2938 | /// <summary> | 2910 | /// <summary> |
2939 | /// Register for events from the client | 2911 | /// Unsubscribe the client from events. |
2940 | /// </summary> | 2912 | /// </summary> |
2941 | /// <param name="client">The IClientAPI of the connected client</param> | 2913 | /// FIXME: Not called anywhere! |
2914 | /// <param name="client">The IClientAPI of the client</param> | ||
2942 | public virtual void UnSubscribeToClientEvents(IClientAPI client) | 2915 | public virtual void UnSubscribeToClientEvents(IClientAPI client) |
2943 | { | 2916 | { |
2944 | UnSubscribeToClientTerrainEvents(client); | 2917 | UnSubscribeToClientTerrainEvents(client); |
2945 | UnSubscribeToClientPrimEvents(client); | 2918 | UnSubscribeToClientPrimEvents(client); |
2946 | UnSubscribeToClientPrimRezEvents(client); | 2919 | UnSubscribeToClientPrimRezEvents(client); |
2947 | UnSubscribeToClientInventoryEvents(client); | 2920 | UnSubscribeToClientInventoryEvents(client); |
2948 | UnSubscribeToClientAttachmentEvents(client); | ||
2949 | UnSubscribeToClientTeleportEvents(client); | 2921 | UnSubscribeToClientTeleportEvents(client); |
2950 | UnSubscribeToClientScriptEvents(client); | 2922 | UnSubscribeToClientScriptEvents(client); |
2951 | UnSubscribeToClientParcelEvents(client); | 2923 | UnSubscribeToClientParcelEvents(client); |
2952 | UnSubscribeToClientGridEvents(client); | 2924 | UnSubscribeToClientGridEvents(client); |
2953 | UnSubscribeToClientGodEvents(client); | ||
2954 | |||
2955 | UnSubscribeToClientNetworkEvents(client); | 2925 | UnSubscribeToClientNetworkEvents(client); |
2956 | |||
2957 | // EventManager.TriggerOnNewClient(client); | ||
2958 | } | 2926 | } |
2959 | 2927 | ||
2960 | public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client) | 2928 | public virtual void UnSubscribeToClientTerrainEvents(IClientAPI client) |
@@ -3031,18 +2999,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3031 | client.OnMoveTaskItem -= ClientMoveTaskInventoryItem; | 2999 | client.OnMoveTaskItem -= ClientMoveTaskInventoryItem; |
3032 | } | 3000 | } |
3033 | 3001 | ||
3034 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) | ||
3035 | { | ||
3036 | if (AttachmentsModule != null) | ||
3037 | { | ||
3038 | client.OnRezSingleAttachmentFromInv -= AttachmentsModule.RezSingleAttachmentFromInventory; | ||
3039 | client.OnRezMultipleAttachmentsFromInv -= AttachmentsModule.RezMultipleAttachmentsFromInventory; | ||
3040 | client.OnObjectAttach -= AttachmentsModule.AttachObject; | ||
3041 | client.OnObjectDetach -= AttachmentsModule.DetachObject; | ||
3042 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; | ||
3043 | } | ||
3044 | } | ||
3045 | |||
3046 | public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client) | 3002 | public virtual void UnSubscribeToClientTeleportEvents(IClientAPI client) |
3047 | { | 3003 | { |
3048 | client.OnTeleportLocationRequest -= RequestTeleportLocation; | 3004 | client.OnTeleportLocationRequest -= RequestTeleportLocation; |
@@ -3074,13 +3030,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3074 | client.OnRegionHandleRequest -= RegionHandleRequest; | 3030 | client.OnRegionHandleRequest -= RegionHandleRequest; |
3075 | } | 3031 | } |
3076 | 3032 | ||
3077 | public virtual void UnSubscribeToClientGodEvents(IClientAPI client) | ||
3078 | { | ||
3079 | IGodsModule godsModule = RequestModuleInterface<IGodsModule>(); | ||
3080 | client.OnGodKickUser -= godsModule.KickUser; | ||
3081 | client.OnRequestGodlikePowers -= godsModule.RequestGodlikePowers; | ||
3082 | } | ||
3083 | |||
3084 | public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client) | 3033 | public virtual void UnSubscribeToClientNetworkEvents(IClientAPI client) |
3085 | { | 3034 | { |
3086 | client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats; | 3035 | client.OnNetworkStatsUpdate -= StatsReporter.AddPacketsStats; |
@@ -5294,4 +5243,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
5294 | return offsets.ToArray(); | 5243 | return offsets.ToArray(); |
5295 | } | 5244 | } |
5296 | } | 5245 | } |
5297 | } | 5246 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 40332a6..f47450f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -78,8 +78,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
78 | // protected internal Dictionary<UUID, EntityBase> Entities = new Dictionary<UUID, EntityBase>(); | 78 | // protected internal Dictionary<UUID, EntityBase> Entities = new Dictionary<UUID, EntityBase>(); |
79 | protected internal Dictionary<UUID, ScenePresence> RestorePresences = new Dictionary<UUID, ScenePresence>(); | 79 | protected internal Dictionary<UUID, ScenePresence> RestorePresences = new Dictionary<UUID, ScenePresence>(); |
80 | 80 | ||
81 | protected internal BasicQuadTreeNode QuadTree; | ||
82 | |||
83 | protected RegionInfo m_regInfo; | 81 | protected RegionInfo m_regInfo; |
84 | protected Scene m_parentScene; | 82 | protected Scene m_parentScene; |
85 | protected Dictionary<UUID, SceneObjectGroup> m_updateList = new Dictionary<UUID, SceneObjectGroup>(); | 83 | protected Dictionary<UUID, SceneObjectGroup> m_updateList = new Dictionary<UUID, SceneObjectGroup>(); |
@@ -107,9 +105,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
107 | { | 105 | { |
108 | m_parentScene = parent; | 106 | m_parentScene = parent; |
109 | m_regInfo = regInfo; | 107 | m_regInfo = regInfo; |
110 | QuadTree = new BasicQuadTreeNode(null, "/0/", 0, 0, (short)Constants.RegionSize, (short)Constants.RegionSize); | ||
111 | QuadTree.Subdivide(); | ||
112 | QuadTree.Subdivide(); | ||
113 | } | 108 | } |
114 | 109 | ||
115 | public PhysicsScene PhysicsScene | 110 | public PhysicsScene PhysicsScene |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 32332f7..3dac0ad 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -56,10 +56,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
56 | LINK = 32, | 56 | LINK = 32, |
57 | ALLOWED_DROP = 64, | 57 | ALLOWED_DROP = 64, |
58 | OWNER = 128, | 58 | OWNER = 128, |
59 | REGION_RESTART = 256, | 59 | REGION = 256, |
60 | REGION = 512, | 60 | TELEPORT = 512, |
61 | TELEPORT = 1024, | 61 | REGION_RESTART = 1024, |
62 | MEDIA = 2048 | 62 | MEDIA = 2048, |
63 | ANIMATION = 16384 | ||
63 | } | 64 | } |
64 | 65 | ||
65 | // I don't really know where to put this except here. | 66 | // I don't really know where to put this except here. |
@@ -871,7 +872,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
871 | set | 872 | set |
872 | { | 873 | { |
873 | m_color = value; | 874 | m_color = value; |
874 | TriggerScriptChangedEvent(Changed.COLOR); | ||
875 | 875 | ||
876 | /* ScheduleFullUpdate() need not be called b/c after | 876 | /* ScheduleFullUpdate() need not be called b/c after |
877 | * setting the color, the text will be set, so then | 877 | * setting the color, the text will be set, so then |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 1e8ce22..4c17615 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -929,7 +929,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
929 | /// </summary> | 929 | /// </summary> |
930 | public void MakeChildAgent() | 930 | public void MakeChildAgent() |
931 | { | 931 | { |
932 | Animator.ResetAnimations(); | 932 | // It looks like m_animator is set to null somewhere, and MakeChild |
933 | // is called after that. Probably in aborted teleports. | ||
934 | if (m_animator == null) | ||
935 | m_animator = new ScenePresenceAnimator(this); | ||
936 | else | ||
937 | Animator.ResetAnimations(); | ||
933 | 938 | ||
934 | // m_log.DebugFormat( | 939 | // m_log.DebugFormat( |
935 | // "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", | 940 | // "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", |
@@ -3455,7 +3460,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3455 | if (m == null) // No script engine loaded | 3460 | if (m == null) // No script engine loaded |
3456 | continue; | 3461 | continue; |
3457 | 3462 | ||
3458 | m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { 16384 }); | 3463 | m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); |
3459 | } | 3464 | } |
3460 | } | 3465 | } |
3461 | } | 3466 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs b/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs deleted file mode 100644 index 38a9203..0000000 --- a/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs +++ /dev/null | |||
@@ -1,269 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using OpenSim.Region.Framework.Scenes; | ||
31 | |||
32 | namespace OpenSim.Region.Framework.Scenes.Types | ||
33 | { | ||
34 | public class BasicQuadTreeNode | ||
35 | { | ||
36 | private List<SceneObjectGroup> m_objects = new List<SceneObjectGroup>(); | ||
37 | private BasicQuadTreeNode[] m_childNodes = null; | ||
38 | private BasicQuadTreeNode m_parent = null; | ||
39 | |||
40 | private short m_leftX; | ||
41 | private short m_leftY; | ||
42 | private short m_width; | ||
43 | private short m_height; | ||
44 | //private int m_quadNumber; | ||
45 | private string m_quadID; | ||
46 | |||
47 | public BasicQuadTreeNode(BasicQuadTreeNode parent, string quadID, short leftX, short leftY, short width, | ||
48 | short height) | ||
49 | { | ||
50 | m_parent = parent; | ||
51 | m_quadID = quadID; | ||
52 | m_leftX = leftX; | ||
53 | m_leftY = leftY; | ||
54 | m_width = width; | ||
55 | m_height = height; | ||
56 | // m_log.Debug("creating quadtree node " + m_quadID); | ||
57 | } | ||
58 | |||
59 | public void AddObject(SceneObjectGroup obj) | ||
60 | { | ||
61 | if (m_childNodes == null) | ||
62 | { | ||
63 | if (!m_objects.Contains(obj)) | ||
64 | { | ||
65 | m_objects.Add(obj); | ||
66 | } | ||
67 | } | ||
68 | else | ||
69 | { | ||
70 | if (obj.AbsolutePosition.X < (m_leftX + (m_width/2))) | ||
71 | { | ||
72 | if (obj.AbsolutePosition.Y < (m_leftY + (m_height/2))) | ||
73 | { | ||
74 | m_childNodes[0].AddObject(obj); | ||
75 | } | ||
76 | else | ||
77 | { | ||
78 | m_childNodes[2].AddObject(obj); | ||
79 | } | ||
80 | } | ||
81 | else | ||
82 | { | ||
83 | if (obj.AbsolutePosition.Y < (m_leftY + (m_height/2))) | ||
84 | { | ||
85 | m_childNodes[1].AddObject(obj); | ||
86 | } | ||
87 | else | ||
88 | { | ||
89 | m_childNodes[3].AddObject(obj); | ||
90 | } | ||
91 | } | ||
92 | } | ||
93 | } | ||
94 | |||
95 | public void Subdivide() | ||
96 | { | ||
97 | if (m_childNodes == null) | ||
98 | { | ||
99 | m_childNodes = new BasicQuadTreeNode[4]; | ||
100 | m_childNodes[0] = | ||
101 | new BasicQuadTreeNode(this, m_quadID + "1/", m_leftX, m_leftY, (short) (m_width/2), | ||
102 | (short) (m_height/2)); | ||
103 | m_childNodes[1] = | ||
104 | new BasicQuadTreeNode(this, m_quadID + "2/", (short) (m_leftX + (m_width/2)), m_leftY, | ||
105 | (short) (m_width/2), (short) (m_height/2)); | ||
106 | m_childNodes[2] = | ||
107 | new BasicQuadTreeNode(this, m_quadID + "3/", m_leftX, (short) (m_leftY + (m_height/2)), | ||
108 | (short) (m_width/2), (short) (m_height/2)); | ||
109 | m_childNodes[3] = | ||
110 | new BasicQuadTreeNode(this, m_quadID + "4/", (short) (m_leftX + (m_width/2)), | ||
111 | (short) (m_height + (m_height/2)), (short) (m_width/2), (short) (m_height/2)); | ||
112 | } | ||
113 | else | ||
114 | { | ||
115 | for (int i = 0; i < m_childNodes.Length; i++) | ||
116 | { | ||
117 | m_childNodes[i].Subdivide(); | ||
118 | } | ||
119 | } | ||
120 | } | ||
121 | |||
122 | public List<SceneObjectGroup> GetObjectsFrom(float x, float y) | ||
123 | { | ||
124 | if (m_childNodes == null) | ||
125 | { | ||
126 | return new List<SceneObjectGroup>(m_objects); | ||
127 | } | ||
128 | else | ||
129 | { | ||
130 | if (x < m_leftX + (m_width/2)) | ||
131 | { | ||
132 | if (y < m_leftY + (m_height/2)) | ||
133 | { | ||
134 | return m_childNodes[0].GetObjectsFrom(x, y); | ||
135 | } | ||
136 | else | ||
137 | { | ||
138 | return m_childNodes[2].GetObjectsFrom(x, y); | ||
139 | } | ||
140 | } | ||
141 | else | ||
142 | { | ||
143 | if (y < m_leftY + (m_height/2)) | ||
144 | { | ||
145 | return m_childNodes[1].GetObjectsFrom(x, y); | ||
146 | } | ||
147 | else | ||
148 | { | ||
149 | return m_childNodes[3].GetObjectsFrom(x, y); | ||
150 | } | ||
151 | } | ||
152 | } | ||
153 | } | ||
154 | |||
155 | public List<SceneObjectGroup> GetObjectsFrom(string nodeName) | ||
156 | { | ||
157 | if (nodeName == m_quadID) | ||
158 | { | ||
159 | return new List<SceneObjectGroup>(m_objects); | ||
160 | } | ||
161 | else if (m_childNodes != null) | ||
162 | { | ||
163 | for (int i = 0; i < 4; i++) | ||
164 | { | ||
165 | List<SceneObjectGroup> retVal; | ||
166 | retVal = m_childNodes[i].GetObjectsFrom(nodeName); | ||
167 | if (retVal != null) | ||
168 | { | ||
169 | return retVal; | ||
170 | } | ||
171 | } | ||
172 | } | ||
173 | return null; | ||
174 | } | ||
175 | |||
176 | public string GetNodeID(float x, float y) | ||
177 | { | ||
178 | if (m_childNodes == null) | ||
179 | { | ||
180 | return m_quadID; | ||
181 | } | ||
182 | else | ||
183 | { | ||
184 | if (x < m_leftX + (m_width/2)) | ||
185 | { | ||
186 | if (y < m_leftY + (m_height/2)) | ||
187 | { | ||
188 | return m_childNodes[0].GetNodeID(x, y); | ||
189 | } | ||
190 | else | ||
191 | { | ||
192 | return m_childNodes[2].GetNodeID(x, y); | ||
193 | } | ||
194 | } | ||
195 | else | ||
196 | { | ||
197 | if (y < m_leftY + (m_height/2)) | ||
198 | { | ||
199 | return m_childNodes[1].GetNodeID(x, y); | ||
200 | } | ||
201 | else | ||
202 | { | ||
203 | return m_childNodes[3].GetNodeID(x, y); | ||
204 | } | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | |||
209 | public void Update() | ||
210 | { | ||
211 | if (m_childNodes != null) | ||
212 | { | ||
213 | for (int i = 0; i < 4; i++) | ||
214 | { | ||
215 | m_childNodes[i].Update(); | ||
216 | } | ||
217 | } | ||
218 | else | ||
219 | { | ||
220 | List<SceneObjectGroup> outBounds = new List<SceneObjectGroup>(); | ||
221 | foreach (SceneObjectGroup group in m_objects) | ||
222 | { | ||
223 | if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) && | ||
224 | ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height)))) | ||
225 | { | ||
226 | //still in bounds | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | outBounds.Add(group); | ||
231 | } | ||
232 | } | ||
233 | |||
234 | foreach (SceneObjectGroup removee in outBounds) | ||
235 | { | ||
236 | m_objects.Remove(removee); | ||
237 | if (m_parent != null) | ||
238 | { | ||
239 | m_parent.PassUp(removee); | ||
240 | } | ||
241 | } | ||
242 | outBounds.Clear(); | ||
243 | } | ||
244 | } | ||
245 | |||
246 | public void PassUp(SceneObjectGroup group) | ||
247 | { | ||
248 | if (((group.AbsolutePosition.X > m_leftX) && (group.AbsolutePosition.X < (m_leftX + m_width))) && | ||
249 | ((group.AbsolutePosition.Y > m_leftY) && (group.AbsolutePosition.Y < (m_leftY + m_height)))) | ||
250 | { | ||
251 | AddObject(group); | ||
252 | } | ||
253 | else | ||
254 | { | ||
255 | if (m_parent != null) | ||
256 | { | ||
257 | m_parent.PassUp(group); | ||
258 | } | ||
259 | } | ||
260 | } | ||
261 | |||
262 | public string[] GetNeighbours(string nodeName) | ||
263 | { | ||
264 | string[] retVal = new string[1]; | ||
265 | retVal[0] = String.Empty; | ||
266 | return retVal; | ||
267 | } | ||
268 | } | ||
269 | } | ||
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs index 9d41c9c..a0d6197 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerIndividualEventForwarder.cs | |||
@@ -28,11 +28,14 @@ | |||
28 | using System; | 28 | using System; |
29 | using OpenMetaverse; | 29 | using OpenMetaverse; |
30 | using OpenSim.Framework; | 30 | using OpenSim.Framework; |
31 | using OpenSim.Region.CoreModules.Avatar.Attachments; | ||
32 | using OpenSim.Region.CoreModules.Avatar.Gods; | ||
33 | using OpenSim.Region.Framework.Interfaces; | ||
31 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
32 | 35 | ||
33 | namespace OpenSim.Region.RegionCombinerModule | 36 | namespace OpenSim.Region.RegionCombinerModule |
34 | { | 37 | { |
35 | public class RegionCombinerIndividualEventForwarder | 38 | public class RegionCombinerIndividualEventForwarder |
36 | { | 39 | { |
37 | private Scene m_rootScene; | 40 | private Scene m_rootScene; |
38 | private Scene m_virtScene; | 41 | private Scene m_virtScene; |
@@ -46,22 +49,31 @@ namespace OpenSim.Region.RegionCombinerModule | |||
46 | public void ClientConnect(IClientAPI client) | 49 | public void ClientConnect(IClientAPI client) |
47 | { | 50 | { |
48 | m_virtScene.UnSubscribeToClientPrimEvents(client); | 51 | m_virtScene.UnSubscribeToClientPrimEvents(client); |
49 | m_virtScene.UnSubscribeToClientPrimRezEvents(client); | 52 | m_virtScene.UnSubscribeToClientPrimRezEvents(client); |
50 | m_virtScene.UnSubscribeToClientInventoryEvents(client); | 53 | m_virtScene.UnSubscribeToClientInventoryEvents(client); |
51 | m_virtScene.UnSubscribeToClientAttachmentEvents(client); | 54 | ((AttachmentsModule)m_virtScene.AttachmentsModule).UnsubscribeFromClientEvents(client); |
52 | //m_virtScene.UnSubscribeToClientTeleportEvents(client); | 55 | //m_virtScene.UnSubscribeToClientTeleportEvents(client); |
53 | m_virtScene.UnSubscribeToClientScriptEvents(client); | 56 | m_virtScene.UnSubscribeToClientScriptEvents(client); |
54 | m_virtScene.UnSubscribeToClientGodEvents(client); | 57 | |
58 | IGodsModule virtGodsModule = m_virtScene.RequestModuleInterface<IGodsModule>(); | ||
59 | if (virtGodsModule != null) | ||
60 | ((GodsModule)virtGodsModule).UnsubscribeFromClientEvents(client); | ||
61 | |||
55 | m_virtScene.UnSubscribeToClientNetworkEvents(client); | 62 | m_virtScene.UnSubscribeToClientNetworkEvents(client); |
56 | 63 | ||
57 | m_rootScene.SubscribeToClientPrimEvents(client); | 64 | m_rootScene.SubscribeToClientPrimEvents(client); |
58 | client.OnAddPrim += LocalAddNewPrim; | 65 | client.OnAddPrim += LocalAddNewPrim; |
59 | client.OnRezObject += LocalRezObject; | 66 | client.OnRezObject += LocalRezObject; |
67 | |||
60 | m_rootScene.SubscribeToClientInventoryEvents(client); | 68 | m_rootScene.SubscribeToClientInventoryEvents(client); |
61 | m_rootScene.SubscribeToClientAttachmentEvents(client); | 69 | ((AttachmentsModule)m_rootScene.AttachmentsModule).SubscribeToClientEvents(client); |
62 | //m_rootScene.SubscribeToClientTeleportEvents(client); | 70 | //m_rootScene.SubscribeToClientTeleportEvents(client); |
63 | m_rootScene.SubscribeToClientScriptEvents(client); | 71 | m_rootScene.SubscribeToClientScriptEvents(client); |
64 | m_rootScene.SubscribeToClientGodEvents(client); | 72 | |
73 | IGodsModule rootGodsModule = m_virtScene.RequestModuleInterface<IGodsModule>(); | ||
74 | if (rootGodsModule != null) | ||
75 | ((GodsModule)rootGodsModule).UnsubscribeFromClientEvents(client); | ||
76 | |||
65 | m_rootScene.SubscribeToClientNetworkEvents(client); | 77 | m_rootScene.SubscribeToClientNetworkEvents(client); |
66 | } | 78 | } |
67 | 79 | ||
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index 9f6ea35..0c99d8c 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -38,10 +38,11 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
38 | { | 38 | { |
39 | public enum StateSource | 39 | public enum StateSource |
40 | { | 40 | { |
41 | NewRez = 0, | 41 | RegionStart = 0, |
42 | PrimCrossing = 1, | 42 | NewRez = 1, |
43 | ScriptedRez = 2, | 43 | PrimCrossing = 2, |
44 | AttachedRez = 3 | 44 | ScriptedRez = 3, |
45 | AttachedRez = 4 | ||
45 | } | 46 | } |
46 | 47 | ||
47 | public interface IScriptWorkItem | 48 | public interface IScriptWorkItem |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 8903c3b..139b4f1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -68,6 +68,14 @@ using System.Reflection; | |||
68 | 68 | ||
69 | namespace OpenSim.Region.ScriptEngine.Shared.Api | 69 | namespace OpenSim.Region.ScriptEngine.Shared.Api |
70 | { | 70 | { |
71 | // MUST be a ref type | ||
72 | public class UserInfoCacheEntry | ||
73 | { | ||
74 | public int time; | ||
75 | public UserAccount account; | ||
76 | public PresenceInfo pinfo; | ||
77 | } | ||
78 | |||
71 | /// <summary> | 79 | /// <summary> |
72 | /// Contains all LSL ll-functions. This class will be in Default AppDomain. | 80 | /// Contains all LSL ll-functions. This class will be in Default AppDomain. |
73 | /// </summary> | 81 | /// </summary> |
@@ -92,6 +100,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
92 | protected int m_scriptConsoleChannel = 0; | 100 | protected int m_scriptConsoleChannel = 0; |
93 | protected bool m_scriptConsoleChannelEnabled = false; | 101 | protected bool m_scriptConsoleChannelEnabled = false; |
94 | protected IUrlModule m_UrlModule = null; | 102 | protected IUrlModule m_UrlModule = null; |
103 | protected Dictionary<UUID, UserInfoCacheEntry> m_userInfoCache = | ||
104 | new Dictionary<UUID, UserInfoCacheEntry>(); | ||
95 | 105 | ||
96 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) | 106 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) |
97 | { | 107 | { |
@@ -1934,13 +1944,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1934 | } | 1944 | } |
1935 | else | 1945 | else |
1936 | { | 1946 | { |
1937 | if (llVecDist(new LSL_Vector(0,0,0), targetPos) <= 10.0f) | 1947 | LSL_Vector rel_vec = SetPosAdjust(currentPos, targetPos); |
1938 | { | 1948 | part.OffsetPosition = new Vector3((float)rel_vec.x, (float)rel_vec.y, (float)rel_vec.z); |
1939 | part.OffsetPosition = new Vector3((float)targetPos.x, (float)targetPos.y, (float)targetPos.z); | 1949 | SceneObjectGroup parent = part.ParentGroup; |
1940 | SceneObjectGroup parent = part.ParentGroup; | 1950 | parent.HasGroupChanged = true; |
1941 | parent.HasGroupChanged = true; | 1951 | parent.ScheduleGroupForTerseUpdate(); |
1942 | parent.ScheduleGroupForTerseUpdate(); | ||
1943 | } | ||
1944 | } | 1952 | } |
1945 | } | 1953 | } |
1946 | 1954 | ||
@@ -3250,17 +3258,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3250 | public void llPointAt(LSL_Vector pos) | 3258 | public void llPointAt(LSL_Vector pos) |
3251 | { | 3259 | { |
3252 | m_host.AddScriptLPS(1); | 3260 | m_host.AddScriptLPS(1); |
3253 | ScenePresence Owner = World.GetScenePresence(m_host.UUID); | ||
3254 | LSL_Rotation rot = llEuler2Rot(pos); | ||
3255 | Owner.PreviousRotation = Owner.Rotation; | ||
3256 | Owner.Rotation = (new Quaternion((float)rot.x,(float)rot.y,(float)rot.z,(float)rot.s)); | ||
3257 | } | 3261 | } |
3258 | 3262 | ||
3259 | public void llStopPointAt() | 3263 | public void llStopPointAt() |
3260 | { | 3264 | { |
3261 | m_host.AddScriptLPS(1); | 3265 | m_host.AddScriptLPS(1); |
3262 | ScenePresence Owner = m_host.ParentGroup.Scene.GetScenePresence(m_host.OwnerID); | ||
3263 | Owner.Rotation = Owner.PreviousRotation; | ||
3264 | } | 3266 | } |
3265 | 3267 | ||
3266 | public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) | 3268 | public void llTargetOmega(LSL_Vector axis, double spinrate, double gain) |
@@ -3916,24 +3918,56 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3916 | m_host.AddScriptLPS(1); | 3918 | m_host.AddScriptLPS(1); |
3917 | 3919 | ||
3918 | UUID uuid = (UUID)id; | 3920 | UUID uuid = (UUID)id; |
3921 | PresenceInfo pinfo = null; | ||
3922 | UserAccount account; | ||
3919 | 3923 | ||
3920 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); | 3924 | UserInfoCacheEntry ce; |
3925 | if (!m_userInfoCache.TryGetValue(uuid, out ce)) | ||
3926 | { | ||
3927 | account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); | ||
3928 | if (account == null) | ||
3929 | { | ||
3930 | m_userInfoCache[uuid] = null; // Cache negative | ||
3931 | return UUID.Zero.ToString(); | ||
3932 | } | ||
3921 | 3933 | ||
3922 | PresenceInfo pinfo = null; | ||
3923 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); | ||
3924 | if (pinfos != null && pinfos.Length > 0) | ||
3925 | pinfo = pinfos[0]; | ||
3926 | 3934 | ||
3927 | if (pinfo == null) | 3935 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); |
3928 | return UUID.Zero.ToString(); | 3936 | if (pinfos != null && pinfos.Length > 0) |
3937 | pinfo = pinfos[0]; | ||
3938 | |||
3939 | ce = new UserInfoCacheEntry(); | ||
3940 | ce.time = Util.EnvironmentTickCount(); | ||
3941 | ce.account = account; | ||
3942 | ce.pinfo = pinfo; | ||
3943 | } | ||
3944 | else | ||
3945 | { | ||
3946 | if (ce == null) | ||
3947 | return UUID.Zero.ToString(); | ||
3948 | |||
3949 | account = ce.account; | ||
3950 | pinfo = ce.pinfo; | ||
3951 | } | ||
3952 | |||
3953 | if (Util.EnvironmentTickCount() < ce.time || (Util.EnvironmentTickCount() - ce.time) >= 20000) | ||
3954 | { | ||
3955 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); | ||
3956 | if (pinfos != null && pinfos.Length > 0) | ||
3957 | pinfo = pinfos[0]; | ||
3958 | else | ||
3959 | pinfo = null; | ||
3960 | |||
3961 | ce.time = Util.EnvironmentTickCount(); | ||
3962 | ce.pinfo = pinfo; | ||
3963 | } | ||
3929 | 3964 | ||
3930 | string reply = String.Empty; | 3965 | string reply = String.Empty; |
3931 | 3966 | ||
3932 | switch (data) | 3967 | switch (data) |
3933 | { | 3968 | { |
3934 | case 1: // DATA_ONLINE (0|1) | 3969 | case 1: // DATA_ONLINE (0|1) |
3935 | // TODO: implement fetching of this information | 3970 | if (pinfo != null && pinfo.RegionID != UUID.Zero) |
3936 | if (pinfo != null) | ||
3937 | reply = "1"; | 3971 | reply = "1"; |
3938 | else | 3972 | else |
3939 | reply = "0"; | 3973 | reply = "0"; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs index fe71ed5..5ae6439 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LS_Api.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index 06f9426..5da6bb9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -273,9 +273,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
273 | public const int CHANGED_LINK = 32; | 273 | public const int CHANGED_LINK = 32; |
274 | public const int CHANGED_ALLOWED_DROP = 64; | 274 | public const int CHANGED_ALLOWED_DROP = 64; |
275 | public const int CHANGED_OWNER = 128; | 275 | public const int CHANGED_OWNER = 128; |
276 | public const int CHANGED_REGION_RESTART = 256; | 276 | public const int CHANGED_REGION = 256; |
277 | public const int CHANGED_REGION = 512; | 277 | public const int CHANGED_TELEPORT = 512; |
278 | public const int CHANGED_TELEPORT = 1024; | 278 | public const int CHANGED_REGION_RESTART = 1024; |
279 | public const int CHANGED_REGION_START = 1024; //LL Changed the constant from CHANGED_REGION_RESTART | ||
279 | public const int CHANGED_MEDIA = 2048; | 280 | public const int CHANGED_MEDIA = 2048; |
280 | public const int CHANGED_ANIMATION = 16384; | 281 | public const int CHANGED_ANIMATION = 16384; |
281 | public const int TYPE_INVALID = 0; | 282 | public const int TYPE_INVALID = 0; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 3dd381d..6663aa5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -388,17 +388,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
388 | PostEvent(new EventParams("attach", | 388 | PostEvent(new EventParams("attach", |
389 | new object[] { new LSL_Types.LSLString(m_AttachedAvatar.ToString()) }, new DetectParams[0])); | 389 | new object[] { new LSL_Types.LSLString(m_AttachedAvatar.ToString()) }, new DetectParams[0])); |
390 | } | 390 | } |
391 | else if (m_stateSource == StateSource.NewRez) | 391 | else if (m_stateSource == StateSource.RegionStart) |
392 | { | 392 | { |
393 | // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); | 393 | // m_log.Debug("[Script] Posted changed(CHANGED_REGION_RESTART) to script"); |
394 | PostEvent(new EventParams("changed", | 394 | PostEvent(new EventParams("changed", |
395 | new Object[] {new LSL_Types.LSLInteger(256)}, new DetectParams[0])); | 395 | new Object[] { (int)Changed.REGION_RESTART }, new DetectParams[0])); |
396 | } | 396 | } |
397 | else if (m_stateSource == StateSource.PrimCrossing) | 397 | else if (m_stateSource == StateSource.PrimCrossing) |
398 | { | 398 | { |
399 | // CHANGED_REGION | 399 | // CHANGED_REGION |
400 | PostEvent(new EventParams("changed", | 400 | PostEvent(new EventParams("changed", |
401 | new Object[] {new LSL_Types.LSLInteger(512)}, new DetectParams[0])); | 401 | new Object[] { (int)Changed.REGION }, new DetectParams[0])); |
402 | } | 402 | } |
403 | } | 403 | } |
404 | else | 404 | else |
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 42eca05..96d2605 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -358,7 +358,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
358 | 358 | ||
359 | private bool GetBoolResponse(XmlRpcRequest request, out string reason) | 359 | private bool GetBoolResponse(XmlRpcRequest request, out string reason) |
360 | { | 360 | { |
361 | //m_log.Debug("[HGrid]: Linking to " + uri); | 361 | //m_log.Debug("[USER AGENT CONNECTOR]: GetBoolResponse from/to " + m_ServerURL); |
362 | XmlRpcResponse response = null; | 362 | XmlRpcResponse response = null; |
363 | try | 363 | try |
364 | { | 364 | { |
@@ -366,14 +366,14 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
366 | } | 366 | } |
367 | catch (Exception e) | 367 | catch (Exception e) |
368 | { | 368 | { |
369 | m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server "); | 369 | m_log.DebugFormat("[USER AGENT CONNECTOR]: Unable to contact remote server {0}", m_ServerURL); |
370 | reason = "Exception: " + e.Message; | 370 | reason = "Exception: " + e.Message; |
371 | return false; | 371 | return false; |
372 | } | 372 | } |
373 | 373 | ||
374 | if (response.IsFault) | 374 | if (response.IsFault) |
375 | { | 375 | { |
376 | m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString); | 376 | m_log.ErrorFormat("[HGrid]: remote call to {0} returned an error: {1}", m_ServerURL, response.FaultString); |
377 | reason = "XMLRPC Fault"; | 377 | reason = "XMLRPC Fault"; |
378 | return false; | 378 | return false; |
379 | } | 379 | } |
@@ -383,15 +383,29 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
383 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); | 383 | // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); |
384 | try | 384 | try |
385 | { | 385 | { |
386 | if (hash == null) | ||
387 | { | ||
388 | m_log.ErrorFormat("[USER AGENT CONNECTOR]: Got null response from {0}! THIS IS BAAAAD", m_ServerURL); | ||
389 | reason = "Internal error 1"; | ||
390 | return false; | ||
391 | } | ||
386 | bool success = false; | 392 | bool success = false; |
387 | reason = string.Empty; | 393 | reason = string.Empty; |
388 | Boolean.TryParse((string)hash["result"], out success); | 394 | if (hash.ContainsKey("result")) |
395 | Boolean.TryParse((string)hash["result"], out success); | ||
396 | else | ||
397 | { | ||
398 | reason = "Internal error 2"; | ||
399 | m_log.WarnFormat("[USER AGENT CONNECTOR]: response from {0} does not have expected key 'result'", m_ServerURL); | ||
400 | } | ||
389 | 401 | ||
390 | return success; | 402 | return success; |
391 | } | 403 | } |
392 | catch (Exception e) | 404 | catch (Exception e) |
393 | { | 405 | { |
394 | m_log.Error("[HGrid]: Got exception while parsing GetEndPoint response " + e.StackTrace); | 406 | m_log.ErrorFormat("[HGrid]: Got exception on GetBoolResponse response."); |
407 | if (hash.ContainsKey("result") && hash["result"] != null) | ||
408 | m_log.ErrorFormat("Reply was ", (string)hash["result"]); | ||
395 | reason = "Exception: " + e.Message; | 409 | reason = "Exception: " + e.Message; |
396 | return false; | 410 | return false; |
397 | } | 411 | } |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index dc68259..2b6d29c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | |||
@@ -745,6 +745,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
745 | } | 745 | } |
746 | } | 746 | } |
747 | 747 | ||
748 | m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invFolders.Count + " folders from SimianGrid response"); | ||
748 | return invFolders; | 749 | return invFolders; |
749 | } | 750 | } |
750 | 751 | ||
@@ -810,6 +811,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
810 | } | 811 | } |
811 | } | 812 | } |
812 | 813 | ||
814 | m_log.Debug("[SIMIAN INVENTORY CONNECTOR]: Parsed " + invItems.Count + " items from SimianGrid response"); | ||
813 | return invItems; | 815 | return invItems; |
814 | } | 816 | } |
815 | 817 | ||
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 46d72dc..ebaed42 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Services.GridService | |||
50 | private bool m_DeleteOnUnregister = true; | 50 | private bool m_DeleteOnUnregister = true; |
51 | private static GridService m_RootInstance = null; | 51 | private static GridService m_RootInstance = null; |
52 | protected IConfigSource m_config; | 52 | protected IConfigSource m_config; |
53 | protected HypergridLinker m_HypergridLinker; | 53 | protected static HypergridLinker m_HypergridLinker; |
54 | 54 | ||
55 | protected IAuthenticationService m_AuthenticationService = null; | 55 | protected IAuthenticationService m_AuthenticationService = null; |
56 | protected bool m_AllowDuplicateNames = false; | 56 | protected bool m_AllowDuplicateNames = false; |
@@ -124,7 +124,7 @@ namespace OpenSim.Services.GridService | |||
124 | { | 124 | { |
125 | // Regions reserved for the null key cannot be taken. | 125 | // Regions reserved for the null key cannot be taken. |
126 | if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) | 126 | if ((string)region.Data["PrincipalID"] == UUID.Zero.ToString()) |
127 | return "Region location us reserved"; | 127 | return "Region location is reserved"; |
128 | 128 | ||
129 | // Treat it as an auth request | 129 | // Treat it as an auth request |
130 | // | 130 | // |
@@ -210,6 +210,7 @@ namespace OpenSim.Services.GridService | |||
210 | { | 210 | { |
211 | int newFlags = 0; | 211 | int newFlags = 0; |
212 | string regionName = rdata.RegionName.Trim().Replace(' ', '_'); | 212 | string regionName = rdata.RegionName.Trim().Replace(' ', '_'); |
213 | newFlags = ParseFlags(newFlags, gridConfig.GetString("DefaultRegionFlags", String.Empty)); | ||
213 | newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty)); | 214 | newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + regionName, String.Empty)); |
214 | newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty)); | 215 | newFlags = ParseFlags(newFlags, gridConfig.GetString("Region_" + rdata.RegionID.ToString(), String.Empty)); |
215 | rdata.Data["flags"] = newFlags.ToString(); | 216 | rdata.Data["flags"] = newFlags.ToString(); |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index ae80a8c..1f53007 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -378,32 +378,31 @@ namespace OpenSim.Services.GridService | |||
378 | 378 | ||
379 | public void HandleShow(string module, string[] cmd) | 379 | public void HandleShow(string module, string[] cmd) |
380 | { | 380 | { |
381 | MainConsole.Instance.Output("Not Implemented Yet"); | 381 | if (cmd.Length != 2) |
382 | //if (cmd.Length != 2) | 382 | { |
383 | //{ | 383 | MainConsole.Instance.Output("Syntax: show hyperlinks"); |
384 | // MainConsole.Instance.Output("Syntax: show hyperlinks"); | 384 | return; |
385 | // return; | 385 | } |
386 | //} | 386 | List<RegionData> regions = m_Database.GetHyperlinks(UUID.Zero); |
387 | //List<GridRegion> regions = new List<GridRegion>(m_HypergridService.m_HyperlinkRegions.Values); | 387 | if (regions == null || regions.Count < 1) |
388 | //if (regions == null || regions.Count < 1) | 388 | { |
389 | //{ | 389 | MainConsole.Instance.Output("No hyperlinks"); |
390 | // MainConsole.Instance.Output("No hyperlinks"); | 390 | return; |
391 | // return; | 391 | } |
392 | //} | ||
393 | 392 | ||
394 | //MainConsole.Instance.Output("Region Name Region UUID"); | 393 | MainConsole.Instance.Output("Region Name Region UUID"); |
395 | //MainConsole.Instance.Output("Location URI"); | 394 | MainConsole.Instance.Output("Location URI"); |
396 | //MainConsole.Instance.Output("Owner ID "); | 395 | MainConsole.Instance.Output("-------------------------------------------------------------------------------"); |
397 | //MainConsole.Instance.Output("-------------------------------------------------------------------------------"); | 396 | foreach (RegionData r in regions) |
398 | //foreach (GridRegion r in regions) | 397 | { |
399 | //{ | 398 | MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", |
400 | // MainConsole.Instance.Output(String.Format("{0,-20} {1}\n{2,-20} {3}\n{4,-39} \n\n", | 399 | r.RegionName, r.RegionID, |
401 | // r.RegionName, r.RegionID, | 400 | String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), |
402 | // String.Format("{0},{1}", r.RegionLocX, r.RegionLocY), "http://" + r.ExternalHostName + ":" + r.HttpPort.ToString(), | 401 | "http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString())); |
403 | // r.EstateOwner.ToString())); | 402 | } |
404 | //} | 403 | return; |
405 | //return; | ||
406 | } | 404 | } |
405 | |||
407 | public void RunCommand(string module, string[] cmdparams) | 406 | public void RunCommand(string module, string[] cmdparams) |
408 | { | 407 | { |
409 | List<string> args = new List<string>(cmdparams); | 408 | List<string> args = new List<string>(cmdparams); |
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index c5cfe75..3aaafe8 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -49,61 +49,64 @@ namespace OpenSim.Services.HypergridService | |||
49 | LogManager.GetLogger( | 49 | LogManager.GetLogger( |
50 | MethodBase.GetCurrentMethod().DeclaringType); | 50 | MethodBase.GetCurrentMethod().DeclaringType); |
51 | 51 | ||
52 | IGridService m_GridService; | 52 | private static bool m_Initialized = false; |
53 | IPresenceService m_PresenceService; | ||
54 | IUserAccountService m_UserAccountService; | ||
55 | IUserAgentService m_UserAgentService; | ||
56 | ISimulationService m_SimulationService; | ||
57 | 53 | ||
58 | string m_AuthDll; | 54 | private static IGridService m_GridService; |
55 | private static IPresenceService m_PresenceService; | ||
56 | private static IUserAccountService m_UserAccountService; | ||
57 | private static IUserAgentService m_UserAgentService; | ||
58 | private static ISimulationService m_SimulationService; | ||
59 | 59 | ||
60 | UUID m_ScopeID; | 60 | private static UUID m_ScopeID; |
61 | bool m_AllowTeleportsToAnyRegion; | 61 | private static bool m_AllowTeleportsToAnyRegion; |
62 | string m_ExternalName; | 62 | private static string m_ExternalName; |
63 | GridRegion m_DefaultGatewayRegion; | 63 | private static GridRegion m_DefaultGatewayRegion; |
64 | 64 | ||
65 | public GatekeeperService(IConfigSource config, ISimulationService simService) | 65 | public GatekeeperService(IConfigSource config, ISimulationService simService) |
66 | { | 66 | { |
67 | IConfig serverConfig = config.Configs["GatekeeperService"]; | 67 | if (!m_Initialized) |
68 | if (serverConfig == null) | 68 | { |
69 | throw new Exception(String.Format("No section GatekeeperService in config file")); | 69 | m_Initialized = true; |
70 | 70 | ||
71 | string accountService = serverConfig.GetString("UserAccountService", String.Empty); | 71 | IConfig serverConfig = config.Configs["GatekeeperService"]; |
72 | string homeUsersService = serverConfig.GetString("HomeUsersSecurityService", string.Empty); | 72 | if (serverConfig == null) |
73 | string gridService = serverConfig.GetString("GridService", String.Empty); | 73 | throw new Exception(String.Format("No section GatekeeperService in config file")); |
74 | string presenceService = serverConfig.GetString("PresenceService", String.Empty); | 74 | |
75 | string simulationService = serverConfig.GetString("SimulationService", String.Empty); | 75 | string accountService = serverConfig.GetString("UserAccountService", String.Empty); |
76 | 76 | string homeUsersService = serverConfig.GetString("UserAgentService", string.Empty); | |
77 | //m_AuthDll = serverConfig.GetString("AuthenticationService", String.Empty); | 77 | string gridService = serverConfig.GetString("GridService", String.Empty); |
78 | 78 | string presenceService = serverConfig.GetString("PresenceService", String.Empty); | |
79 | // These 3 are mandatory, the others aren't | 79 | string simulationService = serverConfig.GetString("SimulationService", String.Empty); |
80 | if (gridService == string.Empty || presenceService == string.Empty || m_AuthDll == string.Empty) | 80 | |
81 | throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); | 81 | // These 3 are mandatory, the others aren't |
82 | 82 | if (gridService == string.Empty || presenceService == string.Empty) | |
83 | string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); | 83 | throw new Exception("Incomplete specifications, Gatekeeper Service cannot function."); |
84 | UUID.TryParse(scope, out m_ScopeID); | 84 | |
85 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); | 85 | string scope = serverConfig.GetString("ScopeID", UUID.Zero.ToString()); |
86 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); | 86 | UUID.TryParse(scope, out m_ScopeID); |
87 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); | 87 | //m_WelcomeMessage = serverConfig.GetString("WelcomeMessage", "Welcome to OpenSim!"); |
88 | 88 | m_AllowTeleportsToAnyRegion = serverConfig.GetBoolean("AllowTeleportsToAnyRegion", true); | |
89 | Object[] args = new Object[] { config }; | 89 | m_ExternalName = serverConfig.GetString("ExternalName", string.Empty); |
90 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 90 | |
91 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); | 91 | Object[] args = new Object[] { config }; |
92 | 92 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | |
93 | if (accountService != string.Empty) | 93 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); |
94 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); | 94 | |
95 | if (homeUsersService != string.Empty) | 95 | if (accountService != string.Empty) |
96 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); | 96 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(accountService, args); |
97 | 97 | if (homeUsersService != string.Empty) | |
98 | if (simService != null) | 98 | m_UserAgentService = ServerUtils.LoadPlugin<IUserAgentService>(homeUsersService, args); |
99 | m_SimulationService = simService; | 99 | |
100 | else if (simulationService != string.Empty) | 100 | if (simService != null) |
101 | m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); | 101 | m_SimulationService = simService; |
102 | 102 | else if (simulationService != string.Empty) | |
103 | if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) | 103 | m_SimulationService = ServerUtils.LoadPlugin<ISimulationService>(simulationService, args); |
104 | throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); | 104 | |
105 | 105 | if (m_GridService == null || m_PresenceService == null || m_SimulationService == null) | |
106 | m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); | 106 | throw new Exception("Unable to load a required plugin, Gatekeeper Service cannot function."); |
107 | |||
108 | m_log.Debug("[GATEKEEPER SERVICE]: Starting..."); | ||
109 | } | ||
107 | } | 110 | } |
108 | 111 | ||
109 | public GatekeeperService(IConfigSource config) | 112 | public GatekeeperService(IConfigSource config) |
@@ -280,18 +283,23 @@ namespace OpenSim.Services.HypergridService | |||
280 | return false; | 283 | return false; |
281 | } | 284 | } |
282 | 285 | ||
283 | Object[] args = new Object[] { userURL }; | 286 | if (userURL == m_ExternalName) |
284 | IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); //ServerUtils.LoadPlugin<IUserAgentService>(m_AuthDll, args); | 287 | return m_UserAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); |
285 | if (userAgentService != null) | 288 | else |
286 | { | 289 | { |
287 | try | 290 | Object[] args = new Object[] { userURL }; |
291 | IUserAgentService userAgentService = new UserAgentServiceConnector(userURL); | ||
292 | if (userAgentService != null) | ||
288 | { | 293 | { |
289 | return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); | 294 | try |
290 | } | 295 | { |
291 | catch | 296 | return userAgentService.VerifyAgent(aCircuit.SessionID, aCircuit.ServiceSessionID); |
292 | { | 297 | } |
293 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL); | 298 | catch |
294 | return false; | 299 | { |
300 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Unable to contact authentication service at {0}", userURL); | ||
301 | return false; | ||
302 | } | ||
295 | } | 303 | } |
296 | } | 304 | } |
297 | 305 | ||
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 2f1fed4..181d7f2 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -62,11 +62,18 @@ namespace OpenSim.Services.HypergridService | |||
62 | protected static IGridUserService m_GridUserService; | 62 | protected static IGridUserService m_GridUserService; |
63 | protected static IGridService m_GridService; | 63 | protected static IGridService m_GridService; |
64 | protected static GatekeeperServiceConnector m_GatekeeperConnector; | 64 | protected static GatekeeperServiceConnector m_GatekeeperConnector; |
65 | protected static IGatekeeperService m_GatekeeperService; | ||
66 | |||
67 | protected static string m_GridName; | ||
68 | |||
69 | protected static bool m_BypassClientVerification; | ||
65 | 70 | ||
66 | public UserAgentService(IConfigSource config) | 71 | public UserAgentService(IConfigSource config) |
67 | { | 72 | { |
68 | if (!m_Initialized) | 73 | if (!m_Initialized) |
69 | { | 74 | { |
75 | m_Initialized = true; | ||
76 | |||
70 | m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); | 77 | m_log.DebugFormat("[HOME USERS SECURITY]: Starting..."); |
71 | 78 | ||
72 | IConfig serverConfig = config.Configs["UserAgentService"]; | 79 | IConfig serverConfig = config.Configs["UserAgentService"]; |
@@ -75,16 +82,25 @@ namespace OpenSim.Services.HypergridService | |||
75 | 82 | ||
76 | string gridService = serverConfig.GetString("GridService", String.Empty); | 83 | string gridService = serverConfig.GetString("GridService", String.Empty); |
77 | string gridUserService = serverConfig.GetString("GridUserService", String.Empty); | 84 | string gridUserService = serverConfig.GetString("GridUserService", String.Empty); |
85 | string gatekeeperService = serverConfig.GetString("GatekeeperService", String.Empty); | ||
86 | |||
87 | m_BypassClientVerification = serverConfig.GetBoolean("BypassClientVerification", false); | ||
78 | 88 | ||
79 | if (gridService == string.Empty || gridUserService == string.Empty) | 89 | if (gridService == string.Empty || gridUserService == string.Empty || gatekeeperService == string.Empty) |
80 | throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); | 90 | throw new Exception(String.Format("Incomplete specifications, UserAgent Service cannot function.")); |
81 | 91 | ||
82 | Object[] args = new Object[] { config }; | 92 | Object[] args = new Object[] { config }; |
83 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 93 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
84 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); | 94 | m_GridUserService = ServerUtils.LoadPlugin<IGridUserService>(gridUserService, args); |
85 | m_GatekeeperConnector = new GatekeeperServiceConnector(); | 95 | m_GatekeeperConnector = new GatekeeperServiceConnector(); |
96 | m_GatekeeperService = ServerUtils.LoadPlugin<IGatekeeperService>(gatekeeperService, args); | ||
86 | 97 | ||
87 | m_Initialized = true; | 98 | m_GridName = serverConfig.GetString("ExternalName", string.Empty); |
99 | if (m_GridName == string.Empty) | ||
100 | { | ||
101 | serverConfig = config.Configs["GatekeeperService"]; | ||
102 | m_GridName = serverConfig.GetString("ExternalName", string.Empty); | ||
103 | } | ||
88 | } | 104 | } |
89 | } | 105 | } |
90 | 106 | ||
@@ -131,7 +147,13 @@ namespace OpenSim.Services.HypergridService | |||
131 | agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); | 147 | agentCircuit.ServiceSessionID = "http://" + region.ExternalHostName + ":" + region.HttpPort + ";" + UUID.Random(); |
132 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); | 148 | TravelingAgentInfo old = UpdateTravelInfo(agentCircuit, region); |
133 | 149 | ||
134 | bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); | 150 | //bool success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); |
151 | bool success = false; | ||
152 | string gridName = "http://" + gatekeeper.ExternalHostName + ":" + gatekeeper.HttpPort; | ||
153 | if (m_GridName == gridName) | ||
154 | success = m_GatekeeperService.LoginAgent(agentCircuit, finalDestination, out reason); | ||
155 | else | ||
156 | success = m_GatekeeperConnector.CreateAgent(region, agentCircuit, (uint)Constants.TeleportFlags.ViaLogin, out reason); | ||
135 | 157 | ||
136 | if (!success) | 158 | if (!success) |
137 | { | 159 | { |
@@ -171,7 +193,7 @@ namespace OpenSim.Services.HypergridService | |||
171 | m_TravelingAgents[agentCircuit.SessionID] = travel; | 193 | m_TravelingAgents[agentCircuit.SessionID] = travel; |
172 | } | 194 | } |
173 | travel.UserID = agentCircuit.AgentID; | 195 | travel.UserID = agentCircuit.AgentID; |
174 | travel.GridExternalName = region.ExternalHostName + ":" + region.HttpPort; | 196 | travel.GridExternalName = "http://" + region.ExternalHostName + ":" + region.HttpPort; |
175 | travel.ServiceToken = agentCircuit.ServiceSessionID; | 197 | travel.ServiceToken = agentCircuit.ServiceSessionID; |
176 | if (old != null) | 198 | if (old != null) |
177 | travel.ClientToken = old.ClientToken; | 199 | travel.ClientToken = old.ClientToken; |
@@ -207,16 +229,16 @@ namespace OpenSim.Services.HypergridService | |||
207 | return false; | 229 | return false; |
208 | 230 | ||
209 | TravelingAgentInfo travel = m_TravelingAgents[sessionID]; | 231 | TravelingAgentInfo travel = m_TravelingAgents[sessionID]; |
232 | |||
210 | return travel.GridExternalName == thisGridExternalName; | 233 | return travel.GridExternalName == thisGridExternalName; |
211 | } | 234 | } |
212 | 235 | ||
213 | public bool VerifyClient(UUID sessionID, string token) | 236 | public bool VerifyClient(UUID sessionID, string token) |
214 | { | 237 | { |
215 | m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); | 238 | if (m_BypassClientVerification) |
216 | //return true; | 239 | return true; |
217 | 240 | ||
218 | // Commenting this for now until I understand better what part of a sender's | 241 | m_log.DebugFormat("[USER AGENT SERVICE]: Verifying Client session {0} with token {1}", sessionID, token); |
219 | // info stays unchanged throughout a session | ||
220 | 242 | ||
221 | if (m_TravelingAgents.ContainsKey(sessionID)) | 243 | if (m_TravelingAgents.ContainsKey(sessionID)) |
222 | return m_TravelingAgents[sessionID].ClientToken == token; | 244 | return m_TravelingAgents[sessionID].ClientToken == token; |
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index bb24292..f63ab16 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -45,6 +45,7 @@ namespace OpenSim.Services.InventoryService | |||
45 | MethodBase.GetCurrentMethod().DeclaringType); | 45 | MethodBase.GetCurrentMethod().DeclaringType); |
46 | 46 | ||
47 | protected IXInventoryData m_Database; | 47 | protected IXInventoryData m_Database; |
48 | protected bool m_AllowDelete = true; | ||
48 | 49 | ||
49 | public XInventoryService(IConfigSource config) : base(config) | 50 | public XInventoryService(IConfigSource config) : base(config) |
50 | { | 51 | { |
@@ -60,6 +61,7 @@ namespace OpenSim.Services.InventoryService | |||
60 | { | 61 | { |
61 | dllName = authConfig.GetString("StorageProvider", dllName); | 62 | dllName = authConfig.GetString("StorageProvider", dllName); |
62 | connString = authConfig.GetString("ConnectionString", connString); | 63 | connString = authConfig.GetString("ConnectionString", connString); |
64 | m_AllowDelete = authConfig.GetBoolean("AllowDelete", true); | ||
63 | // realm = authConfig.GetString("Realm", realm); | 65 | // realm = authConfig.GetString("Realm", realm); |
64 | } | 66 | } |
65 | 67 | ||
@@ -304,10 +306,15 @@ namespace OpenSim.Services.InventoryService | |||
304 | // | 306 | // |
305 | public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) | 307 | public virtual bool DeleteFolders(UUID principalID, List<UUID> folderIDs) |
306 | { | 308 | { |
309 | if (!m_AllowDelete) | ||
310 | return false; | ||
311 | |||
307 | // Ignore principal ID, it's bogus at connector level | 312 | // Ignore principal ID, it's bogus at connector level |
308 | // | 313 | // |
309 | foreach (UUID id in folderIDs) | 314 | foreach (UUID id in folderIDs) |
310 | { | 315 | { |
316 | if (!ParentIsTrash(id)) | ||
317 | continue; | ||
311 | InventoryFolderBase f = new InventoryFolderBase(); | 318 | InventoryFolderBase f = new InventoryFolderBase(); |
312 | f.ID = id; | 319 | f.ID = id; |
313 | PurgeFolder(f); | 320 | PurgeFolder(f); |
@@ -319,6 +326,12 @@ namespace OpenSim.Services.InventoryService | |||
319 | 326 | ||
320 | public virtual bool PurgeFolder(InventoryFolderBase folder) | 327 | public virtual bool PurgeFolder(InventoryFolderBase folder) |
321 | { | 328 | { |
329 | if (!m_AllowDelete) | ||
330 | return false; | ||
331 | |||
332 | if (!ParentIsTrash(folder.ID)) | ||
333 | return false; | ||
334 | |||
322 | XInventoryFolder[] subFolders = m_Database.GetFolders( | 335 | XInventoryFolder[] subFolders = m_Database.GetFolders( |
323 | new string[] { "parentFolderID" }, | 336 | new string[] { "parentFolderID" }, |
324 | new string[] { folder.ID.ToString() }); | 337 | new string[] { folder.ID.ToString() }); |
@@ -358,6 +371,9 @@ namespace OpenSim.Services.InventoryService | |||
358 | 371 | ||
359 | public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) | 372 | public virtual bool DeleteItems(UUID principalID, List<UUID> itemIDs) |
360 | { | 373 | { |
374 | if (!m_AllowDelete) | ||
375 | return false; | ||
376 | |||
361 | // Just use the ID... *facepalms* | 377 | // Just use the ID... *facepalms* |
362 | // | 378 | // |
363 | foreach (UUID id in itemIDs) | 379 | foreach (UUID id in itemIDs) |
@@ -519,5 +535,32 @@ namespace OpenSim.Services.InventoryService | |||
519 | 535 | ||
520 | return newItem; | 536 | return newItem; |
521 | } | 537 | } |
538 | |||
539 | private bool ParentIsTrash(UUID folderID) | ||
540 | { | ||
541 | XInventoryFolder[] folder = m_Database.GetFolders(new string[] {"folderID"}, new string[] {folderID.ToString()}); | ||
542 | if (folder.Length < 1) | ||
543 | return false; | ||
544 | |||
545 | if (folder[0].type == (int)AssetType.TrashFolder) | ||
546 | return true; | ||
547 | |||
548 | UUID parentFolder = folder[0].parentFolderID; | ||
549 | |||
550 | while (parentFolder != UUID.Zero) | ||
551 | { | ||
552 | XInventoryFolder[] parent = m_Database.GetFolders(new string[] {"folderID"}, new string[] {parentFolder.ToString()}); | ||
553 | if (parent.Length < 1) | ||
554 | return false; | ||
555 | |||
556 | if (parent[0].type == (int)AssetType.TrashFolder) | ||
557 | return true; | ||
558 | if (parent[0].type == (int)AssetType.RootFolder) | ||
559 | return false; | ||
560 | |||
561 | parentFolder = parent[0].parentFolderID; | ||
562 | } | ||
563 | return false; | ||
564 | } | ||
522 | } | 565 | } |
523 | } | 566 | } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index f4e045c..036bec6 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -754,10 +754,8 @@ namespace OpenSim.Services.LLLoginService | |||
754 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); | 754 | m_log.Debug("[LLOGIN SERVICE] Launching agent at " + destination.RegionName); |
755 | if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) | 755 | if (m_UserAgentService.LoginAgentToGrid(aCircuit, gatekeeper, destination, out reason)) |
756 | { | 756 | { |
757 | // We may need to do this at some point, | 757 | IPAddress addr = NetworkUtil.GetExternalIPOf(clientIP.Address); |
758 | // so leaving it here in comments. | 758 | m_UserAgentService.SetClientToken(aCircuit.SessionID, addr.ToString() /* clientIP.Address.ToString() */); |
759 | //IPAddress addr = NetworkUtil.GetIPFor(clientIP.Address, destination.ExternalEndPoint.Address); | ||
760 | m_UserAgentService.SetClientToken(aCircuit.SessionID, /*addr.Address.ToString() */ clientIP.Address.ToString()); | ||
761 | return true; | 759 | return true; |
762 | } | 760 | } |
763 | return false; | 761 | return false; |
diff --git a/OpenSim/Tools/Configger/ConfigurationLoader.cs b/OpenSim/Tools/Configger/ConfigurationLoader.cs index 1619a22..e74debb 100644 --- a/OpenSim/Tools/Configger/ConfigurationLoader.cs +++ b/OpenSim/Tools/Configger/ConfigurationLoader.cs | |||
@@ -241,36 +241,6 @@ namespace OpenSim.Tools.Configger | |||
241 | config.Set("EventQueue", true); | 241 | config.Set("EventQueue", true); |
242 | } | 242 | } |
243 | 243 | ||
244 | { | ||
245 | IConfig config = defaultConfig.Configs["StandAlone"]; | ||
246 | |||
247 | if (null == config) | ||
248 | config = defaultConfig.AddConfig("StandAlone"); | ||
249 | |||
250 | config.Set("accounts_authenticate", true); | ||
251 | config.Set("welcome_message", "Welcome to OpenSimulator"); | ||
252 | config.Set("inventory_plugin", "OpenSim.Data.SQLite.dll"); | ||
253 | config.Set("inventory_source", ""); | ||
254 | config.Set("userDatabase_plugin", "OpenSim.Data.SQLite.dll"); | ||
255 | config.Set("user_source", ""); | ||
256 | config.Set("LibrariesXMLFile", string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar)); | ||
257 | } | ||
258 | |||
259 | { | ||
260 | IConfig config = defaultConfig.Configs["Network"]; | ||
261 | |||
262 | if (null == config) | ||
263 | config = defaultConfig.AddConfig("Network"); | ||
264 | |||
265 | config.Set("default_location_x", 1000); | ||
266 | config.Set("default_location_y", 1000); | ||
267 | config.Set("grid_send_key", "null"); | ||
268 | config.Set("grid_recv_key", "null"); | ||
269 | config.Set("user_send_key", "null"); | ||
270 | config.Set("user_recv_key", "null"); | ||
271 | config.Set("secure_inventory_server", "true"); | ||
272 | } | ||
273 | |||
274 | return defaultConfig; | 244 | return defaultConfig; |
275 | } | 245 | } |
276 | 246 | ||
diff --git a/bin/Robust.HG.ini.example b/bin/Robust.HG.ini.example index 0cf9ab1..9269e39 100644 --- a/bin/Robust.HG.ini.example +++ b/bin/Robust.HG.ini.example | |||
@@ -207,6 +207,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003 | |||
207 | ;; for the service | 207 | ;; for the service |
208 | GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" | 208 | GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" |
209 | GridService = "OpenSim.Services.GridService.dll:GridService" | 209 | GridService = "OpenSim.Services.GridService.dll:GridService" |
210 | GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" | ||
210 | 211 | ||
211 | ;; The interface that local users get when they are in other grids. | 212 | ;; The interface that local users get when they are in other grids. |
212 | ;; This restricts the inventory operations while in other grids. | 213 | ;; This restricts the inventory operations while in other grids. |
diff --git a/bin/config-include/StandaloneHypergrid.ini b/bin/config-include/StandaloneHypergrid.ini index e87270d..35e7da2 100644 --- a/bin/config-include/StandaloneHypergrid.ini +++ b/bin/config-include/StandaloneHypergrid.ini | |||
@@ -114,6 +114,8 @@ | |||
114 | ;; for the service | 114 | ;; for the service |
115 | GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" | 115 | GridUserService = "OpenSim.Services.UserAccountService.dll:GridUserService" |
116 | GridService = "OpenSim.Services.GridService.dll:GridService" | 116 | GridService = "OpenSim.Services.GridService.dll:GridService" |
117 | GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" | ||
118 | |||
117 | 119 | ||
118 | ;; The interface that local users get when they are in other grids | 120 | ;; The interface that local users get when they are in other grids |
119 | ;; This greatly restricts the inventory operations while in other grids | 121 | ;; This greatly restricts the inventory operations while in other grids |
diff --git a/prebuild.xml b/prebuild.xml index 1eabc4b..94c83f7 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -1418,35 +1418,11 @@ | |||
1418 | <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/> | 1418 | <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/> |
1419 | <Match pattern="*.cs" recurse="true"> | 1419 | <Match pattern="*.cs" recurse="true"> |
1420 | <Exclude name="Tests" pattern="Tests" /> | 1420 | <Exclude name="Tests" pattern="Tests" /> |
1421 | <Exclude name="TerrainDefaultEffects" pattern="World/Terrain/DefaultEffects" /> | ||
1422 | </Match> | 1421 | </Match> |
1423 | <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/> | 1422 | <Match pattern="*.addin.xml" path="Resources" buildAction="EmbeddedResource" recurse="true"/> |
1424 | </Files> | 1423 | </Files> |
1425 | </Project> | 1424 | </Project> |
1426 | 1425 | ||
1427 | <Project frameworkVersion="v3_5" name="OpenSim.Region.CoreModules.World.Terrain.DefaultEffects" path="OpenSim/Region/CoreModules/World/Terrain/DefaultEffects" type="Library"> | ||
1428 | <Configuration name="Debug"> | ||
1429 | <Options> | ||
1430 | <OutputPath>../../../../../../bin/Terrain/</OutputPath> | ||
1431 | </Options> | ||
1432 | </Configuration> | ||
1433 | <Configuration name="Release"> | ||
1434 | <Options> | ||
1435 | <OutputPath>../../../../../../bin/Terrain/</OutputPath> | ||
1436 | </Options> | ||
1437 | </Configuration> | ||
1438 | |||
1439 | <ReferencePath>../../../../../../bin/</ReferencePath> | ||
1440 | <Reference name="System"/> | ||
1441 | <Reference name="OpenSim.Framework"/> | ||
1442 | <Reference name="OpenSim.Region.Framework"/> | ||
1443 | <Reference name="OpenSim.Region.CoreModules"/> | ||
1444 | <Files> | ||
1445 | <Match pattern="*.cs" recurse="true"/> | ||
1446 | </Files> | ||
1447 | </Project> | ||
1448 | |||
1449 | |||
1450 | <Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library"> | 1426 | <Project frameworkVersion="v3_5" name="OpenSim.Region.OptionalModules" path="OpenSim/Region/OptionalModules" type="Library"> |
1451 | <Configuration name="Debug"> | 1427 | <Configuration name="Debug"> |
1452 | <Options> | 1428 | <Options> |