Merge branch 'master' of ssh://opensimulator.org/var/git/opensim

prebuild-update
Justin Clark-Casey (justincc) 2010-08-27 22:53:02 +01:00
commit b4278510f2
3 changed files with 41 additions and 15 deletions

View File

@ -2728,6 +2728,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
DirPlacesReplyPacket.StatusDataBlock[] status =
new DirPlacesReplyPacket.StatusDataBlock[0];
packet.QueryReplies = replies;
packet.StatusData = status;
foreach (DirPlacesReplyData d in data)
{
int idx = replies.Length;
@ -2766,7 +2769,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
}
}
if (replies.Length > 0)
if (replies.Length > 0 || data.Length == 0)
OutPacket(packet, ThrottleOutPacketType.Task);
}

View File

@ -30,6 +30,7 @@ using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using log4net;
using OpenSim.Region.DataSnapshot.Interfaces;
@ -98,13 +99,21 @@ namespace OpenSim.Region.DataSnapshot
{
String path = DataFileNameFragment(provider.GetParentScene, provider.Name);
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
try
{
snapXWriter.Formatting = Formatting.Indented;
snapXWriter.WriteStartDocument();
data.WriteTo(snapXWriter);
snapXWriter.WriteEndDocument();
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
{
snapXWriter.Formatting = Formatting.Indented;
snapXWriter.WriteStartDocument();
data.WriteTo(snapXWriter);
snapXWriter.WriteEndDocument();
}
}
catch (Exception e)
{
m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message);
}
}
//mark provider as not stale, parent scene as stale
@ -185,12 +194,19 @@ namespace OpenSim.Region.DataSnapshot
//save snapshot
String path = DataFileNameScene(scene);
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
try
{
snapXWriter.Formatting = Formatting.Indented;
snapXWriter.WriteStartDocument();
regionElement.WriteTo(snapXWriter);
snapXWriter.WriteEndDocument();
using (XmlTextWriter snapXWriter = new XmlTextWriter(path, Encoding.Default))
{
snapXWriter.Formatting = Formatting.Indented;
snapXWriter.WriteStartDocument();
regionElement.WriteTo(snapXWriter);
snapXWriter.WriteEndDocument();
}
}
catch (Exception e)
{
m_log.WarnFormat("[DATASNAPSHOT]: Exception on writing to file {0}: {1}", path, e.Message);
}
m_scenes[scene] = false;
@ -206,15 +222,23 @@ namespace OpenSim.Region.DataSnapshot
#region Helpers
private string DataFileNameFragment(Scene scene, String fragmentName)
{
return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName + "_" + fragmentName, "xml"));
return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName + "_" + fragmentName), "xml"));
}
private string DataFileNameScene(Scene scene)
{
return Path.Combine(m_directory, Path.ChangeExtension(scene.RegionInfo.RegionName, "xml"));
return Path.Combine(m_directory, Path.ChangeExtension(Sanitize(scene.RegionInfo.RegionName), "xml"));
//return (m_snapsDir + Path.DirectorySeparatorChar + scene.RegionInfo.RegionName + ".xml");
}
private static string Sanitize(string name)
{
string invalidChars = Regex.Escape(new string(Path.GetInvalidFileNameChars()));
string invalidReStr = string.Format(@"[{0}]", invalidChars);
string newname = Regex.Replace(name, invalidReStr, "_");
return newname.Replace('.', '_');
}
private XmlNode MakeRegionNode(Scene scene, XmlDocument basedoc)
{
XmlNode docElement = basedoc.CreateNode(XmlNodeType.Element, "region", "");

View File

@ -57,8 +57,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
; Realm = "regions"
; AllowDuplicateNames = "True"
; Check4096 = "False"
;; Next, we can specify properties of regions, including default and fallback regions
;; The syntax is: Region_<RegionName> = "<flags>"
;; or: Region_<RegionID> = "<flags>"