aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2012-03-11 01:55:36 +0100
committerMelanie2012-03-11 01:55:36 +0100
commit4f7ec1d691d769b9486c841c008e10aef164998f (patch)
tree443bd31819ac133d9878c0d906d250cad52e3831 /OpenSim/Region
parentMerge branch 'ubitwork' (diff)
parentMerge branch 'master' into careminster (diff)
downloadopensim-SC_OLD-4f7ec1d691d769b9486c841c008e10aef164998f.zip
opensim-SC_OLD-4f7ec1d691d769b9486c841c008e10aef164998f.tar.gz
opensim-SC_OLD-4f7ec1d691d769b9486c841c008e10aef164998f.tar.bz2
opensim-SC_OLD-4f7ec1d691d769b9486c841c008e10aef164998f.tar.xz
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Diffstat (limited to 'OpenSim/Region')
-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
8 files changed, 183 insertions, 146 deletions
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 7d51323..fcca1bc 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -320,7 +320,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
320 protected readonly UUID m_agentId; 320 protected readonly UUID m_agentId;
321 private readonly uint m_circuitCode; 321 private readonly uint m_circuitCode;
322 private readonly byte[] m_channelVersion = Utils.EmptyBytes; 322 private readonly byte[] m_channelVersion = Utils.EmptyBytes;
323 private readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>();
324 private readonly IGroupsModule m_GroupsModule; 323 private readonly IGroupsModule m_GroupsModule;
325 324
326 private int m_cachedTextureSerial; 325 private int m_cachedTextureSerial;
@@ -464,10 +463,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
464 RegisterInterface<IClientChat>(this); 463 RegisterInterface<IClientChat>(this);
465 RegisterInterface<IClientIPEndpoint>(this); 464 RegisterInterface<IClientIPEndpoint>(this);
466 465
467 InitDefaultAnimations();
468
469 m_scene = scene; 466 m_scene = scene;
470
471 m_entityUpdates = new PriorityQueue(m_scene.Entities.Count); 467 m_entityUpdates = new PriorityQueue(m_scene.Entities.Count);
472 m_entityProps = new PriorityQueue(m_scene.Entities.Count); 468 m_entityProps = new PriorityQueue(m_scene.Entities.Count);
473 m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>(); 469 m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>();
@@ -11374,30 +11370,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11374 OutPacket(scriptQuestion, ThrottleOutPacketType.Task); 11370 OutPacket(scriptQuestion, ThrottleOutPacketType.Task);
11375 } 11371 }
11376 11372
11377 private void InitDefaultAnimations()
11378 {
11379 using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
11380 {
11381 XmlDocument doc = new XmlDocument();
11382 doc.Load(reader);
11383 if (doc.DocumentElement != null)
11384 foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
11385 {
11386 if (nod.Attributes["name"] != null)
11387 {
11388 string name = nod.Attributes["name"].Value.ToLower();
11389 string id = nod.InnerText;
11390 m_defaultAnimations.Add(name, (UUID)id);
11391 }
11392 }
11393 }
11394 }
11395
11396 public UUID GetDefaultAnimation(string name) 11373 public UUID GetDefaultAnimation(string name)
11397 { 11374 {
11398 if (m_defaultAnimations.ContainsKey(name)) 11375 return SLUtil.GetDefaultAvatarAnimation(name);
11399 return m_defaultAnimations[name];
11400 return UUID.Zero;
11401 } 11376 }
11402 11377
11403 /// <summary> 11378 /// <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 cdb6efe..5b9b071 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)