Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-12-12 01:20:46 +00:00
commit 8aa63093b1
29 changed files with 351 additions and 238 deletions

View File

@ -1845,7 +1845,7 @@ namespace OpenSim.Framework.Servers.HttpServer
/// property in StartHttp() for the HttpListener /// property in StartHttp() for the HttpListener
public class HttpServerLogWriter : ILogWriter public class HttpServerLogWriter : ILogWriter
{ {
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public void Write(object source, LogPrio priority, string message) public void Write(object source, LogPrio priority, string message)
{ {

View File

@ -265,10 +265,11 @@ namespace OpenSim
LoadOar); LoadOar);
m_console.Commands.AddCommand("region", false, "save oar", m_console.Commands.AddCommand("region", false, "save oar",
"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]", //"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
"save oar [-p|--profile=<url>] [<OAR path>]",
"Save a region's data to an OAR archive.", "Save a region's data to an OAR archive.",
"-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine // "-v|--version=<N> generates scene objects as per older versions of the serialization (e.g. -v=0)" + Environment.NewLine
+ "-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine "-p|--profile=<url> adds the url of the profile service to the saved user information" + Environment.NewLine
+ "The OAR path must be a filesystem path." + "The OAR path must be a filesystem path."
+ " If this is not given then the oar is saved to region.oar in the current directory.", + " If this is not given then the oar is saved to region.oar in the current directory.",
SaveOar); SaveOar);

View File

@ -336,7 +336,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
try try
{ {
// Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular jpeg data // Taking our jpeg2000 data, decoding it, then saving it to a byte array with regular data
imgstream = new MemoryStream(); imgstream = new MemoryStream();

View File

@ -156,7 +156,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// <param name="inventoryFolder">The inventory folder to save</param> /// <param name="inventoryFolder">The inventory folder to save</param>
/// <param name="path">The path to which the folder should be saved</param> /// <param name="path">The path to which the folder should be saved</param>
/// <param name="saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param> /// <param name="saveThisFolderItself">If true, save this folder itself. If false, only saves contents</param>
protected void SaveInvFolder(InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself, Dictionary<string, object> options, IUserAccountService userAccountService) /// <param name="options"></param>
/// <param name="userAccountService"></param>
protected void SaveInvFolder(
InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself,
Dictionary<string, object> options, IUserAccountService userAccountService)
{ {
if (saveThisFolderItself) if (saveThisFolderItself)
{ {
@ -249,7 +253,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
// Write out control file. This has to be done first so that subsequent loaders will see this file first // Write out control file. This has to be done first so that subsequent loaders will see this file first
// XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this // XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); // not sure how to fix this though, short of going with a completely different file format.
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options));
m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive."); m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
if (inventoryFolder != null) if (inventoryFolder != null)
@ -372,12 +377,24 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
} }
/// <summary> /// <summary>
/// Create the control file for a 0.1 version archive /// Create the control file for the archive
/// </summary> /// </summary>
/// <param name="options"></param>
/// <returns></returns> /// <returns></returns>
public static string Create0p1ControlFile() public static string CreateControlFile(Dictionary<string, object> options)
{ {
int majorVersion = 0, minorVersion = 1; int majorVersion, minorVersion;
if (options.ContainsKey("profile"))
{
majorVersion = 1;
minorVersion = 0;
}
else
{
majorVersion = 0;
minorVersion = 1;
}
m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion); m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);

View File

@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
/// <value> /// <value>
/// Enable or disable checking whether the iar user is actually logged in /// Enable or disable checking whether the iar user is actually logged in
/// </value> /// </value>
public bool DisablePresenceChecks { get; set; } // public bool DisablePresenceChecks { get; set; }
public event InventoryArchiveSaved OnInventoryArchiveSaved; public event InventoryArchiveSaved OnInventoryArchiveSaved;
@ -95,10 +95,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
public InventoryArchiverModule() {} public InventoryArchiverModule() {}
public InventoryArchiverModule(bool disablePresenceChecks) // public InventoryArchiverModule(bool disablePresenceChecks)
{ // {
DisablePresenceChecks = disablePresenceChecks; // DisablePresenceChecks = disablePresenceChecks;
} // }
public void Initialise(Scene scene, IConfigSource source) public void Initialise(Scene scene, IConfigSource source)
{ {
@ -172,8 +172,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (userInfo != null) if (userInfo != null)
{ {
if (CheckPresence(userInfo.PrincipalID)) // if (CheckPresence(userInfo.PrincipalID))
{ // {
try try
{ {
new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService); new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, saveStream).Execute(options, UserAccountService);
@ -189,13 +189,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
} }
return true; return true;
} // }
else // else
{ // {
m_log.ErrorFormat( // m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", // "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); // userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
} // }
} }
} }
@ -212,8 +212,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (userInfo != null) if (userInfo != null)
{ {
if (CheckPresence(userInfo.PrincipalID)) // if (CheckPresence(userInfo.PrincipalID))
{ // {
try try
{ {
new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService); new InventoryArchiveWriteRequest(id, this, m_aScene, userInfo, invPath, savePath).Execute(options, UserAccountService);
@ -229,13 +229,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
} }
return true; return true;
} // }
else // else
{ // {
m_log.ErrorFormat( // m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", // "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); // userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
} // }
} }
} }
@ -257,9 +257,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (userInfo != null) if (userInfo != null)
{ {
if (CheckPresence(userInfo.PrincipalID)) // if (CheckPresence(userInfo.PrincipalID))
{ // {
InventoryArchiveReadRequest request; InventoryArchiveReadRequest request;
bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
@ -280,13 +279,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
UpdateClientWithLoadedNodes(userInfo, request.Execute()); UpdateClientWithLoadedNodes(userInfo, request.Execute());
return true; return true;
} // }
else // else
{ // {
m_log.ErrorFormat( // m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", // "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); // userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
} // }
} }
else else
m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found", m_log.ErrorFormat("[INVENTORY ARCHIVER]: User {0} {1} not found",
@ -306,8 +305,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
if (userInfo != null) if (userInfo != null)
{ {
if (CheckPresence(userInfo.PrincipalID)) // if (CheckPresence(userInfo.PrincipalID))
{ // {
InventoryArchiveReadRequest request; InventoryArchiveReadRequest request;
bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false); bool merge = (options.ContainsKey("merge") ? (bool)options["merge"] : false);
@ -328,13 +327,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
UpdateClientWithLoadedNodes(userInfo, request.Execute()); UpdateClientWithLoadedNodes(userInfo, request.Execute());
return true; return true;
} // }
else // else
{ // {
m_log.ErrorFormat( // m_log.ErrorFormat(
"[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator", // "[INVENTORY ARCHIVER]: User {0} {1} {2} not logged in to this region simulator",
userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID); // userInfo.FirstName, userInfo.LastName, userInfo.PrincipalID);
} // }
} }
} }
@ -529,28 +528,27 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
} }
} }
/// <summary> // /// <summary>
/// Check if the given user is present in any of the scenes. // /// Check if the given user is present in any of the scenes.
/// </summary> // /// </summary>
/// <param name="userId">The user to check</param> // /// <param name="userId">The user to check</param>
/// <returns>true if the user is in any of the scenes, false otherwise</returns> // /// <returns>true if the user is in any of the scenes, false otherwise</returns>
protected bool CheckPresence(UUID userId) // protected bool CheckPresence(UUID userId)
{ // {
if (DisablePresenceChecks) // if (DisablePresenceChecks)
return true; // return true;
//
foreach (Scene scene in m_scenes.Values) // foreach (Scene scene in m_scenes.Values)
{ // {
ScenePresence p; // ScenePresence p;
if ((p = scene.GetScenePresence(userId)) != null) // if ((p = scene.GetScenePresence(userId)) != null)
{ // {
p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false); // p.ControllingClient.SendAgentAlertMessage("Inventory operation has been started", false);
return true; // return true;
} // }
} // }
//
return false; // return false;
} // }
} }
} }

View File

@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene("Inventory");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
TestHelper.InMethod(); TestHelper.InMethod();
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene("Inventory");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@ -355,7 +355,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// log4net.Config.XmlConfigurator.Configure(); // log4net.Config.XmlConfigurator.Configure();
SerialiserModule serialiserModule = new SerialiserModule(); SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene("inventory");
SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, serialiserModule, archiverModule);
@ -382,7 +382,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
//log4net.Config.XmlConfigurator.Configure(); //log4net.Config.XmlConfigurator.Configure();
SerialiserModule serialiserModule = new SerialiserModule(); SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene("inventory");
@ -443,7 +443,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
string humanEscapedItemName = @"You & you are a mean\/man\/"; string humanEscapedItemName = @"You & you are a mean\/man\/";
string userPassword = "meowfood"; string userPassword = "meowfood";
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
Scene scene = SceneSetupHelpers.SetupScene("Inventory"); Scene scene = SceneSetupHelpers.SetupScene("Inventory");
SceneSetupHelpers.SetupSceneModules(scene, archiverModule); SceneSetupHelpers.SetupSceneModules(scene, archiverModule);
@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
SerialiserModule serialiserModule = new SerialiserModule(); SerialiserModule serialiserModule = new SerialiserModule();
InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
Scene scene = SceneSetupHelpers.SetupScene("inventory"); Scene scene = SceneSetupHelpers.SetupScene("inventory");
@ -619,7 +619,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver.Tests
// MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); // MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray());
// SerialiserModule serialiserModule = new SerialiserModule(); // SerialiserModule serialiserModule = new SerialiserModule();
// InventoryArchiverModule archiverModule = new InventoryArchiverModule(true); // InventoryArchiverModule archiverModule = new InventoryArchiverModule();
// // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene // // Annoyingly, we have to set up a scene even though inventory loading has nothing to do with a scene
// Scene scene = SceneSetupHelpers.SetupScene(); // Scene scene = SceneSetupHelpers.SetupScene();

View File

@ -1326,7 +1326,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
#region Agent Arrived #region Agent Arrived
public void AgentArrivedAtDestination(UUID id) public void AgentArrivedAtDestination(UUID id)
{ {
//m_log.Debug(" >>> ReleaseAgent called <<< "); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Agent {0} released", id);
ResetFromTransit(id); ResetFromTransit(id);
} }

View File

@ -165,7 +165,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
int width = 256; int width = 256;
int height = 256; int height = 256;
int alpha = 255; // 0 is transparent int alpha = 255; // 0 is transparent
Color bgColour = Color.White; // Default background color Color bgColor = Color.White; // Default background color
char altDataDelim = ';'; char altDataDelim = ';';
char[] paramDelimiter = { ',' }; char[] paramDelimiter = { ',' };
@ -253,15 +253,16 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
alpha = 256; alpha = 256;
} }
break; break;
case "bgcolor":
case "bgcolour": case "bgcolour":
int hex = 0; int hex = 0;
if (Int32.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) if (Int32.TryParse(value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex))
{ {
bgColour = Color.FromArgb(hex); bgColor = Color.FromArgb(hex);
} }
else else
{ {
bgColour = Color.FromName(value); bgColor = Color.FromName(value);
} }
break; break;
case "altdatadelim": case "altdatadelim":
@ -315,7 +316,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
// background color in their scripts, only do when fully opaque // background color in their scripts, only do when fully opaque
if (alpha >= 255) if (alpha >= 255)
{ {
graph.FillRectangle(new SolidBrush(bgColour), 0, 0, width, height); graph.FillRectangle(new SolidBrush(bgColor), 0, 0, width, height);
} }
for (int w = 0; w < bitmap.Width; w++) for (int w = 0; w < bitmap.Width; w++)
@ -616,25 +617,25 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
} }
} }
} }
else if (nextLine.StartsWith("PenColour")) else if (nextLine.StartsWith("PenColour") || nextLine.StartsWith("PenColor"))
{ {
nextLine = nextLine.Remove(0, 9); nextLine = nextLine.Remove(0, 9);
nextLine = nextLine.Trim(); nextLine = nextLine.Trim();
int hex = 0; int hex = 0;
Color newColour; Color newColor;
if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex)) if (Int32.TryParse(nextLine, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out hex))
{ {
newColour = Color.FromArgb(hex); newColor = Color.FromArgb(hex);
} }
else else
{ {
// this doesn't fail, it just returns black if nothing is found // this doesn't fail, it just returns black if nothing is found
newColour = Color.FromName(nextLine); newColor = Color.FromName(nextLine);
} }
myBrush.Color = newColour; myBrush.Color = newColor;
drawPen.Color = newColour; drawPen.Color = newColor;
} }
} }
} }

View File

@ -136,14 +136,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver
ms.Close(); ms.Close();
m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive."); m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
// Write out scene object metadata // Write out scene object metadata
foreach (SceneObjectGroup sceneObject in m_sceneObjects) foreach (SceneObjectGroup sceneObject in m_sceneObjects)
{ {
//m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType()); //m_log.DebugFormat("[ARCHIVER]: Saving {0} {1}, {2}", entity.Name, entity.UUID, entity.GetType());
string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options); string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject); m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
} }

View File

@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <summary> /// <summary>
/// The maximum major version of OAR that we can write. /// The maximum major version of OAR that we can write.
/// </summary> /// </summary>
public static int MAX_MAJOR_VERSION = 1; public static int MAX_MAJOR_VERSION = 0;
protected Scene m_scene; protected Scene m_scene;
protected Stream m_saveStream; protected Stream m_saveStream;
@ -206,37 +206,37 @@ namespace OpenSim.Region.CoreModules.World.Archiver
/// <returns></returns> /// <returns></returns>
public static string CreateControlFile(Dictionary<string, object> options) public static string CreateControlFile(Dictionary<string, object> options)
{ {
int majorVersion = MAX_MAJOR_VERSION, minorVersion = 0; int majorVersion = MAX_MAJOR_VERSION, minorVersion = 5;
//
if (options.ContainsKey("version")) // if (options.ContainsKey("version"))
{ // {
string[] parts = options["version"].ToString().Split('.'); // string[] parts = options["version"].ToString().Split('.');
if (parts.Length >= 1) // if (parts.Length >= 1)
{ // {
majorVersion = Int32.Parse(parts[0]); // majorVersion = Int32.Parse(parts[0]);
//
if (parts.Length >= 2) // if (parts.Length >= 2)
minorVersion = Int32.Parse(parts[1]); // minorVersion = Int32.Parse(parts[1]);
} // }
} // }
//
if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) // if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION)
{ // {
throw new Exception( // throw new Exception(
string.Format( // string.Format(
"OAR version number for save must be between {0} and {1}", // "OAR version number for save must be between {0} and {1}",
MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); // MIN_MAJOR_VERSION, MAX_MAJOR_VERSION));
} // }
else if (majorVersion == MAX_MAJOR_VERSION) // else if (majorVersion == MAX_MAJOR_VERSION)
{ // {
// Force 1.0 // // Force 1.0
minorVersion = 0; // minorVersion = 0;
} // }
else if (majorVersion == MIN_MAJOR_VERSION) // else if (majorVersion == MIN_MAJOR_VERSION)
{ // {
// Force 0.4 // // Force 0.4
minorVersion = 4; // minorVersion = 4;
} // }
m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
//if (majorVersion == 1) //if (majorVersion == 1)

View File

@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
Dictionary<string, object> options = new Dictionary<string, object>(); Dictionary<string, object> options = new Dictionary<string, object>();
OptionSet ops = new OptionSet(); OptionSet ops = new OptionSet();
ops.Add("v|version=", delegate(string v) { options["version"] = v; }); // ops.Add("v|version=", delegate(string v) { options["version"] = v; });
ops.Add("p|profile=", delegate(string v) { options["profile"] = v; }); ops.Add("p|profile=", delegate(string v) { options["profile"] = v; });
List<string> mainParams = ops.Parse(cmdparams); List<string> mainParams = ops.Parse(cmdparams);

View File

@ -223,8 +223,27 @@ namespace OpenSim.Region.Framework.Scenes
if (sp.IsChildAgent) if (sp.IsChildAgent)
return; return;
coarseLocations.Add(sp.AbsolutePosition); if (sp.ParentID != 0)
avatarUUIDs.Add(sp.UUID); {
// sitting avatar
SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
if (sop != null)
{
coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition);
avatarUUIDs.Add(sp.UUID);
}
else
{
// we can't find the parent.. ! arg!
coarseLocations.Add(sp.AbsolutePosition);
avatarUUIDs.Add(sp.UUID);
}
}
else
{
coarseLocations.Add(sp.AbsolutePosition);
avatarUUIDs.Add(sp.UUID);
}
} }
} }

View File

@ -311,7 +311,7 @@ namespace OpenSim.Region.Physics.Meshing
OSD decodedMeshOsd = new OSD(); OSD decodedMeshOsd = new OSD();
byte[] meshBytes = new byte[physSize]; byte[] meshBytes = new byte[physSize];
System.Buffer.BlockCopy(primShape.SculptData, physOffset, meshBytes, 0, physSize); System.Buffer.BlockCopy(primShape.SculptData, physOffset, meshBytes, 0, physSize);
byte[] decompressed = new byte[physSize * 5]; // byte[] decompressed = new byte[physSize * 5];
try try
{ {
using (MemoryStream inMs = new MemoryStream(meshBytes)) using (MemoryStream inMs = new MemoryStream(meshBytes))

View File

@ -375,7 +375,7 @@ namespace PrimMesher
int coordsDown = rows.Count; int coordsDown = rows.Count;
int coordsAcross = rows[0].Count; int coordsAcross = rows[0].Count;
int lastColumn = coordsAcross - 1; // int lastColumn = coordsAcross - 1;
float widthUnit = 1.0f / (coordsAcross - 1); float widthUnit = 1.0f / (coordsAcross - 1);
float heightUnit = 1.0f / (coordsDown - 1); float heightUnit = 1.0f / (coordsDown - 1);

View File

@ -345,6 +345,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
internal void OSSLDeprecated(string function, string replacement)
{
OSSLShoutError(string.Format("Use of function {0} is deprecated. Use {1} instead.", function, replacement));
}
protected void ScriptSleep(int delay) protected void ScriptSleep(int delay)
{ {
delay = (int)((float)delay * m_ScriptDelayFactor); delay = (int)((float)delay * m_ScriptDelayFactor);
@ -356,13 +361,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
// //
// OpenSim functions // OpenSim functions
// //
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
{
CheckThreatLevel(ThreatLevel.High, "osSetTerrainHeight");
return SetTerrainHeight(x, y, val);
}
public LSL_Integer osTerrainSetHeight(int x, int y, double val) public LSL_Integer osTerrainSetHeight(int x, int y, double val)
{ {
CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight"); CheckThreatLevel(ThreatLevel.High, "osTerrainSetHeight");
OSSLDeprecated("osTerrainSetHeight", "osSetTerrainHeight");
return SetTerrainHeight(x, y, val);
}
private LSL_Integer SetTerrainHeight(int x, int y, double val)
{
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
OSSLError("osTerrainSetHeight: Coordinate out of bounds"); OSSLError("osSetTerrainHeight: Coordinate out of bounds");
if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0))) if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x, y, 0)))
{ {
@ -375,13 +389,22 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
public LSL_Float osGetTerrainHeight(int x, int y)
{
CheckThreatLevel(ThreatLevel.None, "osGetTerrainHeight");
return GetTerrainHeight(x, y);
}
public LSL_Float osTerrainGetHeight(int x, int y) public LSL_Float osTerrainGetHeight(int x, int y)
{ {
CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight"); CheckThreatLevel(ThreatLevel.None, "osTerrainGetHeight");
OSSLDeprecated("osTerrainGetHeight", "osGetTerrainHeight");
return GetTerrainHeight(x, y);
}
private LSL_Float GetTerrainHeight(int x, int y)
{
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0) if (x > ((int)Constants.RegionSize - 1) || x < 0 || y > ((int)Constants.RegionSize - 1) || y < 0)
OSSLError("osTerrainGetHeight: Coordinate out of bounds"); OSSLError("osGetTerrainHeight: Coordinate out of bounds");
return World.Heightmap[x, y]; return World.Heightmap[x, y];
} }
@ -1008,9 +1031,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return drawList; return drawList;
} }
public string osSetPenColor(string drawList, string color)
{
CheckThreatLevel(ThreatLevel.None, "osSetPenColor");
m_host.AddScriptLPS(1);
drawList += "PenColor " + color + "; ";
return drawList;
}
// Deprecated
public string osSetPenColour(string drawList, string colour) public string osSetPenColour(string drawList, string colour)
{ {
CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); CheckThreatLevel(ThreatLevel.None, "osSetPenColour");
OSSLDeprecated("osSetPenColour", "osSetPenColor");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
drawList += "PenColour " + colour + "; "; drawList += "PenColour " + colour + "; ";
@ -1019,7 +1052,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public string osSetPenCap(string drawList, string direction, string type) public string osSetPenCap(string drawList, string direction, string type)
{ {
CheckThreatLevel(ThreatLevel.None, "osSetPenColour"); CheckThreatLevel(ThreatLevel.None, "osSetPenCap");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
drawList += "PenCap " + direction + "," + type + "; "; drawList += "PenCap " + direction + "," + type + "; ";
@ -1164,6 +1197,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public double osSunGetParam(string param) public double osSunGetParam(string param)
{ {
CheckThreatLevel(ThreatLevel.None, "osSunGetParam"); CheckThreatLevel(ThreatLevel.None, "osSunGetParam");
OSSLDeprecated("osSunGetParam", "osGetSunParam");
return GetSunParam(param);
}
public double osGetSunParam(string param)
{
CheckThreatLevel(ThreatLevel.None, "osGetSunParam");
return GetSunParam(param);
}
private double GetSunParam(string param)
{
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
double value = 0.0; double value = 0.0;
@ -1180,6 +1223,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public void osSunSetParam(string param, double value) public void osSunSetParam(string param, double value)
{ {
CheckThreatLevel(ThreatLevel.None, "osSunSetParam"); CheckThreatLevel(ThreatLevel.None, "osSunSetParam");
OSSLDeprecated("osSunSetParam", "osSetSunParam");
SetSunParam(param, value);
}
public void osSetSunParam(string param, double value)
{
CheckThreatLevel(ThreatLevel.None, "osSetSunParam");
SetSunParam(param, value);
}
private void SetSunParam(string param, double value)
{
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
ISunModule module = World.RequestModuleInterface<ISunModule>(); ISunModule module = World.RequestModuleInterface<ISunModule>();
@ -1205,9 +1258,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return String.Empty; return String.Empty;
} }
public void osWindParamSet(string plugin, string param, float value) public void osSetWindParam(string plugin, string param, float value)
{ {
CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamSet"); CheckThreatLevel(ThreatLevel.VeryLow, "osSetWindParam");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IWindModule module = World.RequestModuleInterface<IWindModule>(); IWindModule module = World.RequestModuleInterface<IWindModule>();
@ -1221,9 +1274,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
} }
} }
public float osWindParamGet(string plugin, string param) public float osGetWindParam(string plugin, string param)
{ {
CheckThreatLevel(ThreatLevel.VeryLow, "osWindParamGet"); CheckThreatLevel(ThreatLevel.VeryLow, "osGetWindParam");
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
IWindModule module = World.RequestModuleInterface<IWindModule>(); IWindModule module = World.RequestModuleInterface<IWindModule>();

View File

@ -67,8 +67,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams, string osSetDynamicTextureDataBlendFace(string dynamicID, string contentType, string data, string extraParams,
bool blend, int disp, int timer, int alpha, int face); bool blend, int disp, int timer, int alpha, int face);
LSL_Float osTerrainGetHeight(int x, int y); LSL_Float osGetTerrainHeight(int x, int y);
LSL_Integer osTerrainSetHeight(int x, int y, double val); LSL_Float osTerrainGetHeight(int x, int y); // Deprecated
LSL_Integer osSetTerrainHeight(int x, int y, double val);
LSL_Integer osTerrainSetHeight(int x, int y, double val); //Deprecated
void osTerrainFlush(); void osTerrainFlush();
int osRegionRestart(double seconds); int osRegionRestart(double seconds);
@ -107,7 +109,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
string osSetFontName(string drawList, string fontName); string osSetFontName(string drawList, string fontName);
string osSetFontSize(string drawList, int fontSize); string osSetFontSize(string drawList, int fontSize);
string osSetPenSize(string drawList, int penSize); string osSetPenSize(string drawList, int penSize);
string osSetPenColour(string drawList, string colour); string osSetPenColor(string drawList, string color);
string osSetPenColour(string drawList, string colour); // Deprecated
string osSetPenCap(string drawList, string direction, string type); string osSetPenCap(string drawList, string direction, string type);
string osDrawImage(string drawList, int width, int height, string imageUrl); string osDrawImage(string drawList, int width, int height, string imageUrl);
vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize); vector osGetDrawStringSize(string contentType, string text, string fontName, int fontSize);
@ -119,13 +122,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour); void osSetRegionSunSettings(bool useEstateSun, bool sunFixed, double sunHour);
void osSetEstateSunSettings(bool sunFixed, double sunHour); void osSetEstateSunSettings(bool sunFixed, double sunHour);
double osGetCurrentSunHour(); double osGetCurrentSunHour();
double osSunGetParam(string param); double osGetSunParam(string param);
void osSunSetParam(string param, double value); double osSunGetParam(string param); // Deprecated
void osSetSunParam(string param, double value);
void osSunSetParam(string param, double value); // Deprecated
// Wind Module Functions // Wind Module Functions
string osWindActiveModelPluginName(); string osWindActiveModelPluginName();
void osWindParamSet(string plugin, string param, float value); void osSetWindParam(string plugin, string param, float value);
float osWindParamGet(string plugin, string param); float osGetWindParam(string plugin, string param);
// Parcel commands // Parcel commands
void osParcelJoin(vector pos1, vector pos2); void osParcelJoin(vector pos1, vector pos2);

View File

@ -81,11 +81,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetCurrentSunHour(); return m_OSSL_Functions.osGetCurrentSunHour();
} }
public double osGetSunParam(string param)
{
return m_OSSL_Functions.osGetSunParam(param);
}
// Deprecated
public double osSunGetParam(string param) public double osSunGetParam(string param)
{ {
return m_OSSL_Functions.osSunGetParam(param); return m_OSSL_Functions.osSunGetParam(param);
} }
public void osSetSunParam(string param, double value)
{
m_OSSL_Functions.osSetSunParam(param, value);
}
// Deprecated
public void osSunSetParam(string param, double value) public void osSunSetParam(string param, double value)
{ {
m_OSSL_Functions.osSunSetParam(param, value); m_OSSL_Functions.osSunSetParam(param, value);
@ -97,14 +107,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
} }
// Not yet plugged in as available OSSL functions, so commented out // Not yet plugged in as available OSSL functions, so commented out
// void osWindParamSet(string plugin, string param, float value) // void osSetWindParam(string plugin, string param, float value)
// { // {
// m_OSSL_Functions.osWindParamSet(plugin, param, value); // m_OSSL_Functions.osSetWindParam(plugin, param, value);
// } // }
// //
// float osWindParamGet(string plugin, string param) // float osGetWindParam(string plugin, string param)
// { // {
// return m_OSSL_Functions.osWindParamGet(plugin, param); // return m_OSSL_Functions.osGetWindParam(plugin, param);
// } // }
public void osParcelJoin(vector pos1, vector pos2) public void osParcelJoin(vector pos1, vector pos2)
@ -165,11 +175,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
blend, disp, timer, alpha, face); blend, disp, timer, alpha, face);
} }
public LSL_Float osGetTerrainHeight(int x, int y)
{
return m_OSSL_Functions.osGetTerrainHeight(x, y);
}
// Deprecated
public LSL_Float osTerrainGetHeight(int x, int y) public LSL_Float osTerrainGetHeight(int x, int y)
{ {
return m_OSSL_Functions.osTerrainGetHeight(x, y); return m_OSSL_Functions.osTerrainGetHeight(x, y);
} }
public LSL_Integer osSetTerrainHeight(int x, int y, double val)
{
return m_OSSL_Functions.osSetTerrainHeight(x, y, val);
}
// Deprecated
public LSL_Integer osTerrainSetHeight(int x, int y, double val) public LSL_Integer osTerrainSetHeight(int x, int y, double val)
{ {
return m_OSSL_Functions.osTerrainSetHeight(x, y, val); return m_OSSL_Functions.osTerrainSetHeight(x, y, val);
@ -333,6 +353,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osSetPenCap(drawList, direction, type); return m_OSSL_Functions.osSetPenCap(drawList, direction, type);
} }
public string osSetPenColor(string drawList, string color)
{
return m_OSSL_Functions.osSetPenColor(drawList, color);
}
// Deprecated
public string osSetPenColour(string drawList, string colour) public string osSetPenColour(string drawList, string colour)
{ {
return m_OSSL_Functions.osSetPenColour(drawList, colour); return m_OSSL_Functions.osSetPenColour(drawList, colour);

View File

@ -104,7 +104,7 @@ namespace OpenSim.Services.Connectors.Hypergrid
return false; return false;
} }
string uri = m_ServerURL + "/homeagent/" + aCircuit.AgentID + "/"; string uri = m_ServerURL + "homeagent/" + aCircuit.AgentID + "/";
Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri); Console.WriteLine(" >>> LoginAgentToGrid <<< " + uri);

View File

@ -235,6 +235,7 @@ namespace OpenSim.Services.Connectors.Simulation
m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); m_log.Warn("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message);
return null; return null;
} }
// Add the input arguments // Add the input arguments
args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString());
args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString()); args["destination_y"] = OSD.FromString(destination.RegionLocY.ToString());

View File

@ -26,6 +26,7 @@
*/ */
using System; using System;
using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net; using System.Net;
@ -215,7 +216,9 @@ namespace OpenSim.Services.GridService
public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason) public bool TryCreateLink(UUID scopeID, int xloc, int yloc, string remoteRegionName, uint externalPort, string externalHostName, string serverURI, UUID ownerID, out GridRegion regInfo, out string reason)
{ {
m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}:{2}, in {3}-{4}", externalHostName, externalPort, remoteRegionName, xloc, yloc); m_log.DebugFormat("[HYPERGRID LINKER]: Link to {0}:{1}, in {2}-{3}",
((serverURI == null) ? (externalHostName + ":" + externalPort) : serverURI),
remoteRegionName, xloc / Constants.RegionSize, yloc / Constants.RegionSize);
reason = string.Empty; reason = string.Empty;
regInfo = new GridRegion(); regInfo = new GridRegion();
@ -242,7 +245,9 @@ namespace OpenSim.Services.GridService
GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY); GridRegion region = m_GridService.GetRegionByPosition(regInfo.ScopeID, regInfo.RegionLocX, regInfo.RegionLocY);
if (region != null) if (region != null)
{ {
m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}", regInfo.RegionLocX, regInfo.RegionLocY, region.RegionName, region.RegionID); m_log.WarnFormat("[HYPERGRID LINKER]: Coordinates {0}-{1} are already occupied by region {2} with uuid {3}",
regInfo.RegionLocX / Constants.RegionSize, regInfo.RegionLocY / Constants.RegionSize,
region.RegionName, region.RegionID);
reason = "Coordinates are already in use"; reason = "Coordinates are already in use";
return false; return false;
} }
@ -271,7 +276,8 @@ namespace OpenSim.Services.GridService
region = m_GridService.GetRegionByUUID(scopeID, regionID); region = m_GridService.GetRegionByUUID(scopeID, regionID);
if (region != null) if (region != null)
{ {
m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}", region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize); m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates {0} {1}",
region.RegionLocX / Constants.RegionSize, region.RegionLocY / Constants.RegionSize);
regInfo = region; regInfo = region;
return true; return true;
} }
@ -423,15 +429,14 @@ namespace OpenSim.Services.GridService
return; return;
} }
MainConsole.Instance.Output("Region Name Region UUID"); MainConsole.Instance.Output("Region Name");
MainConsole.Instance.Output("Location URI"); MainConsole.Instance.Output("Location Region UUID");
MainConsole.Instance.Output("-------------------------------------------------------------------------------"); MainConsole.Instance.Output(new string('-', 72));
foreach (RegionData r in regions) foreach (RegionData r in regions)
{ {
MainConsole.Instance.Output(String.Format("{0,-39} {1}\n{2,-39} {3}\n", MainConsole.Instance.Output(String.Format("{0}\n{2,-32} {1}\n",
r.RegionName, r.RegionID, r.RegionName, r.RegionID, String.Format("{0},{1} ({2},{3})", r.posX, r.posY,
String.Format("{0},{1} ({2},{3})", r.posX, r.posY, r.posX / 256, r.posY / 256), r.posX / Constants.RegionSize, r.posY / Constants.RegionSize)));
"http://" + r.Data["serverIP"].ToString() + ":" + r.Data["serverHttpPort"].ToString()));
} }
return; return;
} }
@ -459,11 +464,14 @@ namespace OpenSim.Services.GridService
xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize; xloc = Convert.ToInt32(cmdparams[0]) * (int)Constants.RegionSize;
yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize; yloc = Convert.ToInt32(cmdparams[1]) * (int)Constants.RegionSize;
serverURI = cmdparams[2]; serverURI = cmdparams[2];
if (cmdparams.Length == 4) if (cmdparams.Length > 3)
remoteName = cmdparams[3]; remoteName = string.Join(" ", cmdparams, 3, cmdparams.Length - 3);
string reason = string.Empty; string reason = string.Empty;
GridRegion regInfo; GridRegion regInfo;
TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason); if (TryCreateLink(UUID.Zero, xloc, yloc, remoteName, 0, null, serverURI, UUID.Zero, out regInfo, out reason))
MainConsole.Instance.Output("Hyperlink established");
else
MainConsole.Instance.Output("Failed to link region: " + reason);
} }
private void RunHGCommand(string command, string[] cmdparams) private void RunHGCommand(string command, string[] cmdparams)
@ -487,18 +495,6 @@ namespace OpenSim.Services.GridService
} }
} }
else if (command.Equals("link-region")) else if (command.Equals("link-region"))
{
if (cmdparams.Length > 0 && cmdparams.Length < 5)
{
RunLinkRegionCommand(cmdparams);
}
else
{
LinkRegionCmdUsage();
}
return;
}
else if (command.Equals("link-region"))
{ {
if (cmdparams.Length < 3) if (cmdparams.Length < 3)
{ {
@ -514,40 +510,24 @@ namespace OpenSim.Services.GridService
} }
//this should be the prefererred way of setting up hg links now //this should be the prefererred way of setting up hg links now
if ( cmdparams[2].StartsWith("http") && ( cmdparams.Length >= 3 && cmdparams.Length <= 5 )) { if (cmdparams[2].StartsWith("http"))
{
RunLinkRegionCommand(cmdparams); RunLinkRegionCommand(cmdparams);
} }
else if (cmdparams[2].Contains(":")) else if (cmdparams[2].Contains(":"))
{ {
// New format // New format
int xloc, yloc; string[] parts = cmdparams[2].Split(':');
string mapName; if (parts.Length > 2)
try
{ {
xloc = Convert.ToInt32(cmdparams[0]); // Insert remote region name
yloc = Convert.ToInt32(cmdparams[1]); ArrayList parameters = new ArrayList(cmdparams);
mapName = cmdparams[2]; parameters.Insert(3, parts[2]);
if (cmdparams.Length > 3) cmdparams = (string[])parameters.ToArray(typeof(string));
for (int i = 3; i < cmdparams.Length; i++)
mapName += " " + cmdparams[i];
//m_log.Info(">> MapName: " + mapName);
}
catch (Exception e)
{
MainConsole.Instance.Output("[HGrid] Wrong format for link-region command: " + e.Message);
LinkRegionCmdUsage();
return;
} }
cmdparams[2] = "http://" + parts[0] + ':' + parts[1];
// Convert cell coordinates given by the user to meters RunLinkRegionCommand(cmdparams);
xloc = xloc * (int)Constants.RegionSize;
yloc = yloc * (int)Constants.RegionSize;
string reason = string.Empty;
if (TryLinkRegionToCoords(UUID.Zero, mapName, xloc, yloc, out reason) == null)
MainConsole.Instance.Output("Failed to link region: " + reason);
else
MainConsole.Instance.Output("Hyperlink established");
} }
else else
{ {
@ -556,16 +536,12 @@ namespace OpenSim.Services.GridService
int xloc, yloc; int xloc, yloc;
uint externalPort; uint externalPort;
string externalHostName; string externalHostName;
string serverURI;
try try
{ {
xloc = Convert.ToInt32(cmdparams[0]); xloc = Convert.ToInt32(cmdparams[0]);
yloc = Convert.ToInt32(cmdparams[1]); yloc = Convert.ToInt32(cmdparams[1]);
externalPort = Convert.ToUInt32(cmdparams[3]); externalPort = Convert.ToUInt32(cmdparams[3]);
externalHostName = cmdparams[2]; externalHostName = cmdparams[2];
if ( cmdparams.Length == 4 ) {
}
//internalPort = Convert.ToUInt32(cmdparams[4]); //internalPort = Convert.ToUInt32(cmdparams[4]);
//remotingPort = Convert.ToUInt32(cmdparams[5]); //remotingPort = Convert.ToUInt32(cmdparams[5]);
} }
@ -582,27 +558,30 @@ namespace OpenSim.Services.GridService
string reason = string.Empty; string reason = string.Empty;
if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason)) if (TryCreateLink(UUID.Zero, xloc, yloc, string.Empty, externalPort, externalHostName, UUID.Zero, out regInfo, out reason))
{ {
if (cmdparams.Length >= 5) // What is this? The GridRegion instance will be discarded anyway,
{ // which effectively ignores any local name given with the command.
regInfo.RegionName = ""; //if (cmdparams.Length >= 5)
for (int i = 4; i < cmdparams.Length; i++) //{
regInfo.RegionName += cmdparams[i] + " "; // regInfo.RegionName = "";
} // for (int i = 4; i < cmdparams.Length; i++)
// regInfo.RegionName += cmdparams[i] + " ";
//}
} }
} }
return; return;
} }
else if (command.Equals("unlink-region")) else if (command.Equals("unlink-region"))
{ {
if (cmdparams.Length < 1 || cmdparams.Length > 1) if (cmdparams.Length < 1)
{ {
UnlinkRegionCmdUsage(); UnlinkRegionCmdUsage();
return; return;
} }
if (TryUnlinkRegion(cmdparams[0])) string region = string.Join(" ", cmdparams);
MainConsole.Instance.Output("Successfully unlinked " + cmdparams[0]); if (TryUnlinkRegion(region))
MainConsole.Instance.Output("Successfully unlinked " + region);
else else
MainConsole.Instance.Output("Unable to unlink " + cmdparams[0] + ", region not found."); MainConsole.Instance.Output("Unable to unlink " + region + ", region not found.");
} }
} }

View File

@ -101,7 +101,7 @@ namespace OpenSim.Services.HypergridService
serverConfig = config.Configs["GatekeeperService"]; serverConfig = config.Configs["GatekeeperService"];
m_GridName = serverConfig.GetString("ExternalName", string.Empty); m_GridName = serverConfig.GetString("ExternalName", string.Empty);
} }
else if (!m_GridName.EndsWith("/")) if (!m_GridName.EndsWith("/"))
m_GridName = m_GridName + "/"; m_GridName = m_GridName + "/";
} }
} }

View File

@ -101,7 +101,7 @@ namespace OpenSim.Services.Interfaces
if (str != string.Empty) if (str != string.Empty)
{ {
string[] parts = str.Split(new char[] { ';' }); string[] parts = str.Split(new char[] { ';' });
Dictionary<string, object> dic = new Dictionary<string, object>(); // Dictionary<string, object> dic = new Dictionary<string, object>();
foreach (string s in parts) foreach (string s in parts)
{ {
string[] parts2 = s.Split(new char[] { '*' }); string[] parts2 = s.Split(new char[] { '*' });

View File

@ -779,6 +779,8 @@ namespace OpenSim.Services.LLLoginService
{ {
aCircuit.ServiceURLs[kvp.Key] = kvp.Value; aCircuit.ServiceURLs[kvp.Key] = kvp.Value;
} }
if (!aCircuit.ServiceURLs[kvp.Key].ToString().EndsWith("/"))
aCircuit.ServiceURLs[kvp.Key] = aCircuit.ServiceURLs[kvp.Key] + "/";
} }
// New style: service keys start with SRV_; override the previous // New style: service keys start with SRV_; override the previous
@ -791,6 +793,9 @@ namespace OpenSim.Services.LLLoginService
{ {
string keyName = serviceKey.Replace("SRV_", ""); string keyName = serviceKey.Replace("SRV_", "");
aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty); aCircuit.ServiceURLs[keyName] = m_LoginServerConfig.GetString(serviceKey, string.Empty);
if (!aCircuit.ServiceURLs[keyName].ToString().EndsWith("/"))
aCircuit.ServiceURLs[keyName] = aCircuit.ServiceURLs[keyName] + "/";
m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]); m_log.DebugFormat("[LLLOGIN SERVICE]: found new key {0} {1}", keyName, aCircuit.ServiceURLs[keyName]);
} }
} }

View File

@ -24,7 +24,7 @@
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,HGAssetService@8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector" ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector,8002/OpenSim.Server.Handlers.dll:GatekeeperServiceInConnector,8002/OpenSim.Server.Handlers.dll:UserAgentServerConnector,HGInventoryService@8002/OpenSim.Server.Handlers.dll:XInventoryInConnector,HGAssetService@8002/OpenSim.Server.Handlers.dll:AssetServiceConnector,8002/OpenSim.Server.Handlers.dll:HeloServiceInConnector"
; * This is common for all services, it's the network setup for the entire ; * This is common for all services, it's the network setup for the entire
; * server instance, if none if specified above ; * server instance, if none is specified above
; * ; *
[Network] [Network]
port = 8003 port = 8003
@ -48,7 +48,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[AssetService] [AssetService]
LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
AssetLoaderArgs = "assets/AssetSets.xml" AssetLoaderArgs = "./assets/AssetSets.xml"
; * This configuration loads the inventory server modules. It duplicates ; * This configuration loads the inventory server modules. It duplicates
; * the function of the legacy inventory server ; * the function of the legacy inventory server
@ -79,11 +79,22 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; * This is the configuration for the freeswitch server in grid mode ; * This is the configuration for the freeswitch server in grid mode
[FreeswitchService] [FreeswitchService]
LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService" LocalServiceModule = "OpenSim.Services.FreeswitchService.dll:FreeswitchService"
;; IP of your FS server
; ServerAddress = 127.0.0.1
;; All other options are - well - optional
; Realm = "127.0.0.1"
; SIPProxy = "127.0.0.1:5060"
; EchoServer = "127.0.0.1"
; EchoPort = 50505
; AttemptSTUN = "false"
; DefaultTimeout = 5000
; Context = "default"
; UserName = "freeswitch"
; Password = "password"
; * This is the new style authentication service. Currently, only MySQL ; * This is the new style authentication service. Currently, only MySQL
; * is implemented. "Realm" is the table that is used for user lookup. ; * is implemented.
; * It defaults to "useraccounts", which uses the new style.
; * Realm = "users" will use the legacy tables as an authentication source
; * ; *
[AuthenticationService] [AuthenticationService]
; for the server connector ; for the server connector
@ -97,7 +108,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; * This is the new style user service. ; * This is the new style user service.
; * "Realm" is the table that is used for user lookup. ; * "Realm" is the table that is used for user lookup.
; * It defaults to "users", which uses the legacy tables ; * It defaults to "useraccounts", which uses the new style.
; * Realm = "users" will use the legacy tables as an authentication source
; * ; *
[UserAccountService] [UserAccountService]
; for the server connector ; for the server connector
@ -150,7 +162,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
AllowRemoteSetLoginLevel = "false" AllowRemoteSetLoginLevel = "false"
; If you run this login server behind a proxy, set this to true ; If you run this login server behind a proxy, set this to true
; HasProxy = true ; HasProxy = false
; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs) ; Defaults for the users, if none is specified in the useraccounts table entry (ServiceURLs)
; CHANGE THIS ; CHANGE THIS
@ -159,7 +171,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
SRV_HomeURI = "http://127.0.0.1:8002" SRV_HomeURI = "http://127.0.0.1:8002"
SRV_InventoryServerURI = "http://127.0.0.1:8002" SRV_InventoryServerURI = "http://127.0.0.1:8002"
SRV_AssetServerURI = "http://127.0.0.1:8002" SRV_AssetServerURI = "http://127.0.0.1:8002"
SRV_ProfileServerURI = "http://127.0.0.1:8002" SRV_ProfileServerURI = "http://127.0.0.1:8002/user"
[GridInfoService] [GridInfoService]
; These settings are used to return information on a get_grid_info call. ; These settings are used to return information on a get_grid_info call.
@ -218,7 +230,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
AllowTeleportsToAnyRegion = true AllowTeleportsToAnyRegion = true
; If you run this gatekeeper server behind a proxy, set this to true ; If you run this gatekeeper server behind a proxy, set this to true
; HasProxy = true ; HasProxy = false
[UserAgentService] [UserAgentService]
@ -229,7 +241,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService" GatekeeperService = "OpenSim.Services.HypergridService.dll:GatekeeperService"
; If you run this user agent server behind a proxy, set this to true ; If you run this user agent server behind a proxy, set this to true
; HasProxy = true ; HasProxy = false
;; If you separate the UserAgentService from the LoginService, set this to ;; If you separate the UserAgentService from the LoginService, set this to
;; the IP address of the machine where your LoginService is ;; the IP address of the machine where your LoginService is

View File

@ -16,7 +16,7 @@
ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector" ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003/OpenSim.Server.Handlers.dll:XInventoryInConnector,8002/OpenSim.Server.Handlers.dll:FreeswitchServerConnector,8003/OpenSim.Server.Handlers.dll:GridServiceConnector,8002/OpenSim.Server.Handlers.dll:GridInfoServerInConnector,8003/OpenSim.Server.Handlers.dll:AuthenticationServiceConnector,8002/OpenSim.Server.Handlers.dll:OpenIdServerConnector,8003/OpenSim.Server.Handlers.dll:AvatarServiceConnector,8002/OpenSim.Server.Handlers.dll:LLLoginServiceInConnector,8003/OpenSim.Server.Handlers.dll:PresenceServiceConnector,8003/OpenSim.Server.Handlers.dll:UserAccountServiceConnector,8003/OpenSim.Server.Handlers.dll:GridUserServiceConnector,8003/OpenSim.Server.Handlers.dll:FriendsServiceConnector"
; * This is common for all services, it's the network setup for the entire ; * This is common for all services, it's the network setup for the entire
; * server instance, if none if specified above ; * server instance, if none is specified above
; * ; *
[Network] [Network]
port = 8003 port = 8003
@ -40,7 +40,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
[AssetService] [AssetService]
LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService"
DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll" DefaultAssetLoader = "OpenSim.Framework.AssetLoader.Filesystem.dll"
AssetLoaderArgs = "assets/AssetSets.xml" AssetLoaderArgs = "./assets/AssetSets.xml"
AllowRemoteDelete = "false" AllowRemoteDelete = "false"
; * This configuration loads the inventory server modules. It duplicates ; * This configuration loads the inventory server modules. It duplicates
@ -84,9 +84,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; Password = "password" ; Password = "password"
; * This is the new style authentication service. Currently, only MySQL ; * This is the new style authentication service. Currently, only MySQL
; * is implemented. "Realm" is the table that is used for user lookup. ; * is implemented.
; * It defaults to "users", which uses the legacy tables as an
; * authentication source.
; * ; *
[AuthenticationService] [AuthenticationService]
; for the server connector ; for the server connector
@ -158,7 +156,7 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
; MapTileURL = ""; ; MapTileURL = "";
; If you run this login server behind a proxy, set this to true ; If you run this login server behind a proxy, set this to true
; HasProxy = true ; HasProxy = false
[GridInfoService] [GridInfoService]
; These settings are used to return information on a get_grid_info call. ; These settings are used to return information on a get_grid_info call.

View File

@ -84,7 +84,7 @@
; Change this to your profile server ; Change this to your profile server
; accessible from other grids ; accessible from other grids
; ;
ProfileServerURI = "http://mygridserver.com:8002/profiles" ProfileServerURI = "http://mygridserver.com:8002/user"
[Modules] [Modules]
;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists. ;; Choose 0 or 1 cache modules, and the corresponding config file, if it exists.

Binary file not shown.

Binary file not shown.

Binary file not shown.