aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/SLUtil.cs52
-rw-r--r--OpenSim/Framework/WebUtil.cs41
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs219
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs27
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs5
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs15
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs15
-rw-r--r--OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs10
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs36
-rw-r--r--OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs2
10 files changed, 275 insertions, 147 deletions
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs
index b337e03..f9cb851 100644
--- a/OpenSim/Framework/SLUtil.cs
+++ b/OpenSim/Framework/SLUtil.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using System.Xml;
31using log4net; 32using log4net;
32using OpenMetaverse; 33using OpenMetaverse;
33 34
@@ -39,6 +40,13 @@ namespace OpenSim.Framework
39 40
40 #region SL / file extension / content-type conversions 41 #region SL / file extension / content-type conversions
41 42
43 public static Dictionary<string, UUID> DefaultAvatarAnimations = new Dictionary<string, UUID>();
44
45 static SLUtil()
46 {
47 DefaultAvatarAnimations = LoadDefaultAvatarAnimations("data/avataranimations.xml");
48 }
49
42 public static string SLAssetTypeToContentType(int assetType) 50 public static string SLAssetTypeToContentType(int assetType)
43 { 51 {
44 switch ((AssetType)assetType) 52 switch ((AssetType)assetType)
@@ -374,5 +382,47 @@ namespace OpenSim.Framework
374 382
375 return output; 383 return output;
376 } 384 }
385
386 /// <summary>
387 /// Load the default SL avatar animations.
388 /// </summary>
389 /// <returns></returns>
390 public static Dictionary<string, UUID> LoadDefaultAvatarAnimations(string path)
391 {
392 Dictionary<string, UUID> animations = new Dictionary<string, UUID>();
393
394 using (XmlTextReader reader = new XmlTextReader(path))
395 {
396 XmlDocument doc = new XmlDocument();
397 doc.Load(reader);
398 if (doc.DocumentElement != null)
399 {
400 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
401 {
402 if (nod.Attributes["name"] != null)
403 {
404 string name = nod.Attributes["name"].Value.ToLower();
405 string id = nod.InnerText;
406 animations.Add(name, (UUID)id);
407 }
408 }
409 }
410 }
411
412 return animations;
413 }
414
415 /// <summary>
416 /// Get the default SL avatar animation with the given name.
417 /// </summary>
418 /// <param name="name"></param>
419 /// <returns></returns>
420 public static UUID GetDefaultAvatarAnimation(string name)
421 {
422 if (DefaultAvatarAnimations.ContainsKey(name))
423 return DefaultAvatarAnimations[name];
424
425 return UUID.Zero;
426 }
377 } 427 }
378} 428} \ No newline at end of file
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs
index f90df12..71a56e5 100644
--- a/OpenSim/Framework/WebUtil.cs
+++ b/OpenSim/Framework/WebUtil.cs
@@ -63,6 +63,31 @@ namespace OpenSim.Framework
63 // a "long" call for warning & debugging purposes 63 // a "long" call for warning & debugging purposes
64 public const int LongCallTime = 500; 64 public const int LongCallTime = 500;
65 65
66 // dictionary of end points
67 private static Dictionary<string,object> m_endpointSerializer = new Dictionary<string,object>();
68
69
70 private static object EndPointLock(string url)
71 {
72 System.Uri uri = new System.Uri(url);
73 string endpoint = string.Format("{0}:{1}",uri.Host,uri.Port);
74
75 lock (m_endpointSerializer)
76 {
77 object eplock = null;
78
79 if (! m_endpointSerializer.TryGetValue(endpoint,out eplock))
80 {
81 eplock = new object();
82 m_endpointSerializer.Add(endpoint,eplock);
83 // m_log.WarnFormat("[WEB UTIL] add a new host to end point serializer {0}",endpoint);
84 }
85
86 return eplock;
87 }
88 }
89
90
66 #region JSONRequest 91 #region JSONRequest
67 92
68 /// <summary> 93 /// <summary>
@@ -96,6 +121,14 @@ namespace OpenSim.Framework
96 121
97 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed) 122 public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed)
98 { 123 {
124 lock (EndPointLock(url))
125 {
126 return ServiceOSDRequestWorker(url,data,method,timeout,compressed);
127 }
128 }
129
130 private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed)
131 {
99 int reqnum = m_requestNumber++; 132 int reqnum = m_requestNumber++;
100 // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method); 133 // m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
101 134
@@ -249,6 +282,14 @@ namespace OpenSim.Framework
249 282
250 public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout) 283 public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout)
251 { 284 {
285 lock (EndPointLock(url))
286 {
287 return ServiceFormRequestWorker(url,data,timeout);
288 }
289 }
290
291 private static OSDMap ServiceFormRequestWorker(string url, NameValueCollection data, int timeout)
292 {
252 int reqnum = m_requestNumber++; 293 int reqnum = m_requestNumber++;
253 string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown"; 294 string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown";
254 // m_log.DebugFormat("[WEB UTIL]: <{0}> start form request for {1}, method {2}",reqnum,url,method); 295 // m_log.DebugFormat("[WEB UTIL]: <{0}> start form request for {1}, method {2}",reqnum,url,method);
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index 34f513d..b304403 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -28,6 +28,7 @@
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Linq;
31using System.Net; 32using System.Net;
32using System.Reflection; 33using System.Reflection;
33using System.Text; 34using System.Text;
@@ -67,6 +68,9 @@ namespace OpenSim
67 private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache"; 68 private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
68 private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient"; 69 private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
69 70
71 // OpenSim.ini Section name for ESTATES Settings
72 public const string ESTATE_SECTION_NAME = "Estates";
73
70 protected string proxyUrl; 74 protected string proxyUrl;
71 protected int proxyOffset = 0; 75 protected int proxyOffset = 0;
72 76
@@ -524,12 +528,42 @@ namespace OpenSim
524 { 528 {
525 RegionInfo regionInfo = scene.RegionInfo; 529 RegionInfo regionInfo = scene.RegionInfo;
526 530
531 string estateOwnerFirstName = null;
532 string estateOwnerLastName = null;
533 string estateOwnerEMail = null;
534 string estateOwnerPassword = null;
535 string rawEstateOwnerUuid = null;
536
537 if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
538 {
539 string defaultEstateOwnerName
540 = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "").Trim();
541 string[] ownerNames = defaultEstateOwnerName.Split(' ');
542
543 if (ownerNames.Length >= 2)
544 {
545 estateOwnerFirstName = ownerNames[0];
546 estateOwnerLastName = ownerNames[1];
547 }
548
549 // Info to be used only on Standalone Mode
550 rawEstateOwnerUuid = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerUUID", null);
551 estateOwnerEMail = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerEMail", null);
552 estateOwnerPassword = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", null);
553 }
554
527 MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName); 555 MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
528 List<char> excluded = new List<char>(new char[1]{' '}); 556 List<char> excluded = new List<char>(new char[1]{' '});
529 string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
530 string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
531 557
532 UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last); 558
559 if (estateOwnerFirstName == null || estateOwnerLastName == null)
560 {
561 estateOwnerFirstName = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
562 estateOwnerLastName = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
563 }
564
565 UserAccount account
566 = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, estateOwnerFirstName, estateOwnerLastName);
533 567
534 if (account == null) 568 if (account == null)
535 { 569 {
@@ -548,23 +582,35 @@ namespace OpenSim
548 582
549 if (scene.UserAccountService is UserAccountService) 583 if (scene.UserAccountService is UserAccountService)
550 { 584 {
551 string password = MainConsole.Instance.PasswdPrompt("Password"); 585 if (estateOwnerPassword == null)
552 string email = MainConsole.Instance.CmdPrompt("Email", ""); 586 estateOwnerPassword = MainConsole.Instance.PasswdPrompt("Password");
587
588 if (estateOwnerEMail == null)
589 estateOwnerEMail = MainConsole.Instance.CmdPrompt("Email");
553 590
554 string rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString()); 591 if (rawEstateOwnerUuid == null)
592 rawEstateOwnerUuid = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
555 593
556 UUID principalId = UUID.Zero; 594 UUID estateOwnerUuid = UUID.Zero;
557 if (!UUID.TryParse(rawPrincipalId, out principalId)) 595 if (!UUID.TryParse(rawEstateOwnerUuid, out estateOwnerUuid))
558 { 596 {
559 m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawPrincipalId); 597 m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawEstateOwnerUuid);
560 return; 598 return;
561 } 599 }
562 600
601 // If we've been given a zero uuid then this signals that we should use a random user id
602 if (estateOwnerUuid == UUID.Zero)
603 estateOwnerUuid = UUID.Random();
604
563 account 605 account
564 = ((UserAccountService)scene.UserAccountService).CreateUser( 606 = ((UserAccountService)scene.UserAccountService).CreateUser(
565 regionInfo.ScopeID, principalId, first, last, password, email); 607 regionInfo.ScopeID,
608 estateOwnerUuid,
609 estateOwnerFirstName,
610 estateOwnerLastName,
611 estateOwnerPassword,
612 estateOwnerEMail);
566 } 613 }
567// }
568 } 614 }
569 615
570 if (account == null) 616 if (account == null)
@@ -969,15 +1015,21 @@ namespace OpenSim
969 /// This method doesn't allow an estate to be created with the same name as existing estates. 1015 /// This method doesn't allow an estate to be created with the same name as existing estates.
970 /// </remarks> 1016 /// </remarks>
971 /// <param name="regInfo"></param> 1017 /// <param name="regInfo"></param>
972 /// <param name="existingName">A list of estate names that already exist.</param> 1018 /// <param name="estatesByName">A list of estate names that already exist.</param>
1019 /// <param name="estateName">Estate name to create if already known</param>
973 /// <returns>true if the estate was created, false otherwise</returns> 1020 /// <returns>true if the estate was created, false otherwise</returns>
974 public bool CreateEstate(RegionInfo regInfo, List<string> existingNames) 1021 public bool CreateEstate(RegionInfo regInfo, Dictionary<string, EstateSettings> estatesByName, string estateName)
975 { 1022 {
976 // Create a new estate 1023 // Create a new estate
977 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true); 1024 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
978 string newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
979 1025
980 if (existingNames.Contains(newName)) 1026 string newName;
1027 if (estateName != null && estateName != "")
1028 newName = estateName;
1029 else
1030 newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
1031
1032 if (estatesByName.ContainsKey(newName))
981 { 1033 {
982 MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName); 1034 MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName);
983 return false; 1035 return false;
@@ -1004,69 +1056,102 @@ namespace OpenSim
1004 if (EstateDataService != null) 1056 if (EstateDataService != null)
1005 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false); 1057 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
1006 1058
1007 if (regInfo.EstateSettings.EstateID == 0) // No record at all 1059 if (regInfo.EstateSettings.EstateID != 0)
1060 return;
1061
1062 m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
1063
1064 List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
1065 Dictionary<string, EstateSettings> estatesByName = new Dictionary<string, EstateSettings>();
1066
1067 foreach (EstateSettings estate in estates)
1068 estatesByName[estate.EstateName] = estate;
1069
1070 string defaultEstateName = null;
1071
1072 if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
1008 { 1073 {
1009 m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName); 1074 defaultEstateName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateName", null);
1010 1075
1011 List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll(); 1076 if (defaultEstateName != null)
1012 List<string> estateNames = new List<string>();
1013 foreach (EstateSettings estate in estates)
1014 estateNames.Add(estate.EstateName);
1015
1016 while (true)
1017 { 1077 {
1018 if (estates.Count == 0) 1078 EstateSettings defaultEstate;
1019 { 1079 bool defaultEstateJoined = false;
1020 m_log.Info("[ESTATE] No existing estates found. You must create a new one."); 1080
1021 1081 if (estatesByName.ContainsKey(defaultEstateName))
1022 if (CreateEstate(regInfo, estateNames)) 1082 {
1023 break; 1083 defaultEstate = estatesByName[defaultEstateName];
1084
1085 if (EstateDataService.LinkRegion(regInfo.RegionID, (int)defaultEstate.EstateID))
1086 defaultEstateJoined = true;
1087 }
1088 else
1089 {
1090 if (CreateEstate(regInfo, estatesByName, defaultEstateName))
1091 defaultEstateJoined = true;
1092 }
1093
1094 if (defaultEstateJoined)
1095 return;
1096 else
1097 m_log.ErrorFormat(
1098 "[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName);
1099 }
1100 }
1101
1102 // If we have no default estate or creation of the default estate failed then ask the user.
1103 while (true)
1104 {
1105 if (estates.Count == 0)
1106 {
1107 m_log.Info("[ESTATE]: No existing estates found. You must create a new one.");
1108
1109 if (CreateEstate(regInfo, estatesByName, null))
1110 break;
1111 else
1112 continue;
1113 }
1114 else
1115 {
1116 string response
1117 = MainConsole.Instance.CmdPrompt(
1118 string.Format(
1119 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
1120 "yes",
1121 new List<string>() { "yes", "no" });
1122
1123 if (response == "no")
1124 {
1125 if (CreateEstate(regInfo, estatesByName, null))
1126 break;
1024 else 1127 else
1025 continue; 1128 continue;
1026 } 1129 }
1027 else 1130 else
1028 { 1131 {
1029 string response 1132 string[] estateNames = estatesByName.Keys.ToArray();
1133 response
1030 = MainConsole.Instance.CmdPrompt( 1134 = MainConsole.Instance.CmdPrompt(
1031 string.Format( 1135 string.Format(
1032 "Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName), 1136 "Name of estate to join. Existing estate names are ({0})",
1033 "no", 1137 string.Join(", ", estateNames)),
1034 new List<string>() { "yes", "no" }); 1138 estateNames[0]);
1035 1139
1036 if (response == "no") 1140 List<int> estateIDs = EstateDataService.GetEstates(response);
1141 if (estateIDs.Count < 1)
1037 { 1142 {
1038 if (CreateEstate(regInfo, estateNames)) 1143 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
1039 break; 1144 continue;
1040 else
1041 continue;
1042 }
1043 else
1044 {
1045 response
1046 = MainConsole.Instance.CmdPrompt(
1047 string.Format(
1048 "Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
1049 "None");
1050
1051 if (response == "None")
1052 continue;
1053
1054 List<int> estateIDs = EstateDataService.GetEstates(response);
1055 if (estateIDs.Count < 1)
1056 {
1057 MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
1058 continue;
1059 }
1060
1061 int estateID = estateIDs[0];
1062
1063 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
1064
1065 if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
1066 break;
1067
1068 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
1069 } 1145 }
1146
1147 int estateID = estateIDs[0];
1148
1149 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
1150
1151 if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
1152 break;
1153
1154 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
1070 } 1155 }
1071 } 1156 }
1072 } 1157 }
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 051c4fa..d973a06 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -319,7 +319,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
319 protected readonly UUID m_agentId; 319 protected readonly UUID m_agentId;
320 private readonly uint m_circuitCode; 320 private readonly uint m_circuitCode;
321 private readonly byte[] m_channelVersion = Utils.EmptyBytes; 321 private readonly byte[] m_channelVersion = Utils.EmptyBytes;
322 private readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>();
323 private readonly IGroupsModule m_GroupsModule; 322 private readonly IGroupsModule m_GroupsModule;
324 323
325 private int m_cachedTextureSerial; 324 private int m_cachedTextureSerial;
@@ -463,10 +462,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
463 RegisterInterface<IClientChat>(this); 462 RegisterInterface<IClientChat>(this);
464 RegisterInterface<IClientIPEndpoint>(this); 463 RegisterInterface<IClientIPEndpoint>(this);
465 464
466 InitDefaultAnimations();
467
468 m_scene = scene; 465 m_scene = scene;
469
470 m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); 466 m_entityUpdates = new PriorityQueue(m_scene.Entities.Count);
471 m_entityProps = new PriorityQueue(m_scene.Entities.Count); 467 m_entityProps = new PriorityQueue(m_scene.Entities.Count);
472 m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); 468 m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>();
@@ -11373,30 +11369,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11373 OutPacket(scriptQuestion, ThrottleOutPacketType.Task); 11369 OutPacket(scriptQuestion, ThrottleOutPacketType.Task);
11374 } 11370 }
11375 11371
11376 private void InitDefaultAnimations()
11377 {
11378 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
11379 {
11380 XmlDocument doc = new XmlDocument();
11381 doc.Load(reader);
11382 if (doc.DocumentElement != null)
11383 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
11384 {
11385 if (nod.Attributes["name"] != null)
11386 {
11387 string name = nod.Attributes["name"].Value.ToLower();
11388 string id = nod.InnerText;
11389 m_defaultAnimations.Add(name, (UUID)id);
11390 }
11391 }
11392 }
11393 }
11394
11395 public UUID GetDefaultAnimation(string name) 11372 public UUID GetDefaultAnimation(string name)
11396 { 11373 {
11397 if (m_defaultAnimations.ContainsKey(name)) 11374 return SLUtil.GetDefaultAvatarAnimation(name);
11398 return m_defaultAnimations[name];
11399 return UUID.Zero;
11400 } 11375 }
11401 11376
11402 /// <summary> 11377 /// <summary>
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
index c6e9964..8560c73 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs
@@ -267,12 +267,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
267 267
268 m_archiveWriter = new TarArchiveWriter(m_saveStream); 268 m_archiveWriter = new TarArchiveWriter(m_saveStream);
269 269
270 m_log.InfoFormat("[INVENTORY ARCHIVER]: Adding control file to archive.");
271
270 // Write out control file. This has to be done first so that subsequent loaders will see this file first 272 // Write out control file. This has to be done first so that subsequent loaders will see this file first
271 // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this 273 // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
272 // not sure how to fix this though, short of going with a completely different file format. 274 // not sure how to fix this though, short of going with a completely different file format.
273 m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options)); 275 m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options));
274 m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive."); 276
275
276 if (inventoryFolder != null) 277 if (inventoryFolder != null)
277 { 278 {
278 m_log.DebugFormat( 279 m_log.DebugFormat(
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
index 9ec4ebe..c179a34 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs
@@ -108,12 +108,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
108// "[ARCHIVER]: Received {0} of {1} assets requested", 108// "[ARCHIVER]: Received {0} of {1} assets requested",
109// assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count); 109// assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count);
110 110
111 m_log.InfoFormat("[ARCHIVER]: Adding region settings to archive.");
112
111 // Write out region settings 113 // Write out region settings
112 string settingsPath 114 string settingsPath
113 = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName); 115 = String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName);
114 m_archiveWriter.WriteFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings)); 116 m_archiveWriter.WriteFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings));
115 117
116 m_log.InfoFormat("[ARCHIVER]: Added region settings to archive."); 118 m_log.InfoFormat("[ARCHIVER]: Adding parcel settings to archive.");
117 119
118 // Write out land data (aka parcel) settings 120 // Write out land data (aka parcel) settings
119 List<ILandObject>landObjects = m_scene.LandChannel.AllParcels(); 121 List<ILandObject>landObjects = m_scene.LandChannel.AllParcels();
@@ -124,7 +126,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
124 landData.GlobalID.ToString()); 126 landData.GlobalID.ToString());
125 m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData)); 127 m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData));
126 } 128 }
127 m_log.InfoFormat("[ARCHIVER]: Added parcel settings to archive."); 129
130 m_log.InfoFormat("[ARCHIVER]: Adding terrain information to archive.");
128 131
129 // Write out terrain 132 // Write out terrain
130 string terrainPath 133 string terrainPath
@@ -135,7 +138,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
135 m_archiveWriter.WriteFile(terrainPath, ms.ToArray()); 138 m_archiveWriter.WriteFile(terrainPath, ms.ToArray());
136 ms.Close(); 139 ms.Close();
137 140
138 m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); 141 m_log.InfoFormat("[ARCHIVER]: Adding scene objects to archive.");
139 142
140 // Write out scene object metadata 143 // Write out scene object metadata
141 foreach (SceneObjectGroup sceneObject in m_sceneObjects) 144 foreach (SceneObjectGroup sceneObject in m_sceneObjects)
@@ -145,10 +148,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
145 string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); 148 string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
146 m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); 149 m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
147 } 150 }
148
149 m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive.");
150 } 151 }
151
152
153 } 152 }
154} 153} \ No newline at end of file
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
index ffcf063..4d459bf 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs
@@ -219,12 +219,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
219 m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); 219 m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
220 220
221 if (SaveAssets) 221 if (SaveAssets)
222 new AssetsRequest( 222 {
223 new AssetsArchiver(archiveWriter), assetUuids, 223 AssetsRequest ar
224 m_scene.AssetService, m_scene.UserAccountService, 224 = new AssetsRequest(
225 m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets).Execute(); 225 new AssetsArchiver(archiveWriter), assetUuids,
226 m_scene.AssetService, m_scene.UserAccountService,
227 m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets);
228
229 Util.FireAndForget(o => ar.Execute());
230 }
226 else 231 else
232 {
227 awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>()); 233 awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>());
234 }
228 } 235 }
229 catch (Exception) 236 catch (Exception)
230 { 237 {
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
index 7b872b9..1eb641d 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs
@@ -141,13 +141,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
141 PerformAssetsRequestCallback(null); 141 PerformAssetsRequestCallback(null);
142 return; 142 return;
143 } 143 }
144 144
145 m_requestCallbackTimer.Enabled = true;
146
145 foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids) 147 foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
146 { 148 {
147 m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback); 149// m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
150 AssetBase asset = m_assetService.Get(kvp.Key.ToString());
151 PreAssetRequestCallback(kvp.Key.ToString(), kvp.Value, asset);
148 } 152 }
149
150 m_requestCallbackTimer.Enabled = true;
151 } 153 }
152 154
153 protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args) 155 protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index cbc3813..d88b2bd 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -42,9 +42,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
42{ 42{
43 public class NPCAvatar : IClientAPI, INPC 43 public class NPCAvatar : IClientAPI, INPC
44 { 44 {
45 private static readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>();
46
47 public bool SenseAsAgent { get; set; } 45 public bool SenseAsAgent { get; set; }
46
48 private readonly string m_firstname; 47 private readonly string m_firstname;
49 private readonly string m_lastname; 48 private readonly string m_lastname;
50 private readonly Vector3 m_startPos; 49 private readonly Vector3 m_startPos;
@@ -61,16 +60,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
61 m_scene = scene; 60 m_scene = scene;
62 m_ownerID = ownerID; 61 m_ownerID = ownerID;
63 SenseAsAgent = senseAsAgent; 62 SenseAsAgent = senseAsAgent;
64
65 } 63 }
66 64
67 static NPCAvatar()
68 {
69 InitDefaultAnimations();
70 }
71
72
73
74 public IScene Scene 65 public IScene Scene
75 { 66 {
76 get { return m_scene; } 67 get { return m_scene; }
@@ -142,32 +133,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
142 133
143 } 134 }
144 135
145 private static void InitDefaultAnimations()
146 {
147 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
148 {
149 XmlDocument doc = new XmlDocument();
150 doc.Load(reader);
151 if (doc.DocumentElement != null)
152 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
153 {
154 if (nod.Attributes["name"] != null)
155 {
156 string name = nod.Attributes["name"].Value.ToLower();
157 string id = nod.InnerText;
158 m_defaultAnimations.Add(name, (UUID)id);
159 }
160 }
161 }
162 }
163
164 public UUID GetDefaultAnimation(string name) 136 public UUID GetDefaultAnimation(string name)
165 { 137 {
166 if (m_defaultAnimations.ContainsKey(name)) 138 return SLUtil.GetDefaultAvatarAnimation(name);
167 {
168 return m_defaultAnimations[name];
169 }
170 return UUID.Zero;
171 } 139 }
172 140
173 public Vector3 Position 141 public Vector3 Position
diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
index 9d52a8f..d8d9554 100644
--- a/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
+++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerModule.cs
@@ -630,7 +630,7 @@ namespace OpenSim.Region.RegionCombinerModule
630 630
631 List<Vector3> CoarseLocations = new List<Vector3>(); 631 List<Vector3> CoarseLocations = new List<Vector3>();
632 List<UUID> AvatarUUIDs = new List<UUID>(); 632 List<UUID> AvatarUUIDs = new List<UUID>();
633 633
634 connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp) 634 connectiondata.RegionScene.ForEachRootScenePresence(delegate(ScenePresence sp)
635 { 635 {
636 if (sp.UUID != presence.UUID) 636 if (sp.UUID != presence.UUID)