Compare commits
87 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba233008cd | ||
|
|
108978be1e | ||
|
|
63b5c11b9c | ||
|
|
219d273418 | ||
|
|
bb9071e5f0 | ||
|
|
869191a51d | ||
|
|
b019fd5a95 | ||
|
|
82a5d00bc8 | ||
|
|
dac8703949 | ||
|
|
78c155cd12 | ||
|
|
4b73268cbd | ||
|
|
3d70db4a58 | ||
|
|
6e0e35cd66 | ||
|
|
20b47fce07 | ||
|
|
82b875317b | ||
|
|
60ad72357e | ||
|
|
d99c8e68a7 | ||
|
|
d0782c2bc0 | ||
|
|
9643792b34 | ||
|
|
4ba396b81c | ||
|
|
c3923a1aa6 | ||
|
|
889194db63 | ||
|
|
fe6dab7f13 | ||
|
|
cd031d129a | ||
|
|
9d2789aff8 | ||
|
|
abf85b7f19 | ||
|
|
a93799d03b | ||
|
|
ca2379ee83 | ||
|
|
481b7c71c3 | ||
|
|
c90b986d8b | ||
|
|
3fe9c7c49d | ||
|
|
4651cd1f50 | ||
|
|
f348928590 | ||
|
|
3cbdf3bfe0 | ||
|
|
7b2f125fb6 | ||
|
|
a0d6705fe6 | ||
|
|
db0c41501c | ||
|
|
ff892b5bcf | ||
|
|
5450b1b024 | ||
|
|
602587b8d5 | ||
|
|
b59812b4e3 | ||
|
|
4374ce9fbf | ||
|
|
696df33e5c | ||
|
|
c5f7184d1b | ||
|
|
dcd8e74584 | ||
|
|
7f0adfd203 | ||
|
|
31096fb1fe | ||
|
|
807fb8339b | ||
|
|
e86c765be3 | ||
|
|
c915791824 | ||
|
|
7f45ac72e1 | ||
|
|
8956cdc55f | ||
|
|
3552cfb1a5 | ||
|
|
0dc14b5f35 | ||
|
|
74cda2ad78 | ||
|
|
2766b37d8b | ||
|
|
b913f1c8ab | ||
|
|
fe779128b0 | ||
|
|
90de9df3e8 | ||
|
|
733763c4e2 | ||
|
|
5bb95a8a55 | ||
|
|
30cde52634 | ||
|
|
278530bf04 | ||
|
|
c1bdd22274 | ||
|
|
f8fe4dee8f | ||
|
|
77913eb679 | ||
|
|
0aa0dad478 | ||
|
|
3aa99b9a7f | ||
|
|
14a31c3e9b | ||
|
|
94d0ae0d91 | ||
|
|
0eaca7aafb | ||
|
|
2ff9ea3f80 | ||
|
|
a2ea844494 | ||
|
|
0300ec45eb | ||
|
|
22dade6463 | ||
|
|
db5a42ffac | ||
|
|
eaf595c008 | ||
|
|
d6f9f690e5 | ||
|
|
02a53665c9 | ||
|
|
bf5320eb26 | ||
|
|
3c992b028c | ||
|
|
a755c57b44 | ||
|
|
9ced61fbc2 | ||
|
|
0eede1467f | ||
|
|
35c7fb2038 | ||
|
|
8656b5e948 | ||
|
|
1efaf0c85c |
@@ -19,10 +19,14 @@ Prereqs:
|
||||
|
||||
From the distribution type:
|
||||
* ./runprebuild.sh
|
||||
* nant (or xbuild)
|
||||
* nant (or !* xbuild)
|
||||
* cd bin
|
||||
* copy OpenSim.ini.example to OpenSim.ini and other appropriate files in bin/config-include
|
||||
* run mono OpenSim.exe
|
||||
!* xbuild option switches
|
||||
!* clean: xbuild /target:clean
|
||||
!* debug: (default) xbuild /property:Configuration=Debug
|
||||
!* release: xbuild /property:Configuration=Release
|
||||
|
||||
# Using Monodevelop
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@ what it is today.
|
||||
* alex_carnell
|
||||
* Alan Webb (IBM)
|
||||
* Aleric
|
||||
* Alicia Raven
|
||||
* Allen Kerensky
|
||||
* BigFootAg
|
||||
* BlueWall Slade
|
||||
|
||||
@@ -30,7 +30,7 @@ using Mono.Addins;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.Groups", "0.1")]
|
||||
[assembly: AddinDependency("OpenSim", "0.5")]
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace OpenSim.Groups
|
||||
string method = request["METHOD"].ToString();
|
||||
request.Remove("METHOD");
|
||||
|
||||
m_log.DebugFormat("[Groups.Handler]: {0}", method);
|
||||
// m_log.DebugFormat("[Groups.Handler]: {0}", method);
|
||||
switch (method)
|
||||
{
|
||||
case "PUTGROUP":
|
||||
@@ -665,7 +665,11 @@ namespace OpenSim.Groups
|
||||
GroupInviteInfo invite = m_GroupsService.GetAgentToGroupInvite(request["RequestingAgentID"].ToString(),
|
||||
new UUID(request["InviteID"].ToString()));
|
||||
|
||||
result["RESULT"] = GroupsDataUtils.GroupInviteInfo(invite);
|
||||
if (invite != null)
|
||||
result["RESULT"] = GroupsDataUtils.GroupInviteInfo(invite);
|
||||
else
|
||||
result["RESULT"] = "NULL";
|
||||
|
||||
return Util.UTF8NoBomEncoding.GetBytes(ServerUtils.BuildXmlResponse(result));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ using Mono.Addins;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
[assembly: Addin("OpenSim.OfflineIM", "0.1")]
|
||||
[assembly: AddinDependency("OpenSim", "0.5")]
|
||||
|
||||
@@ -39,6 +39,7 @@ using OpenSim.Region.CoreModules.Avatar.InstantMessage;
|
||||
using OpenSim.Region.CoreModules.Scripting.DynamicTexture;
|
||||
using OpenSim.Region.CoreModules.Scripting.LoadImageURL;
|
||||
using OpenSim.Region.CoreModules.Scripting.XMLRPC;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
{
|
||||
@@ -130,7 +131,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
|
||||
createdScenes.Add(scene);
|
||||
|
||||
if (changed)
|
||||
regionsToLoad[i].EstateSettings.Save();
|
||||
m_openSim.EstateDataService.StoreEstateSettings(regionsToLoad[i].EstateSettings);
|
||||
}
|
||||
|
||||
foreach (IScene scene in createdScenes)
|
||||
|
||||
@@ -62,4 +62,4 @@ using System.Runtime.InteropServices;
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("0.7.6.*")]
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenSim;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
@@ -45,6 +46,12 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Controls whether we load modules from Mono.Addins.
|
||||
/// </summary>
|
||||
/// <remarks>For debug purposes. Defaults to true.</remarks>
|
||||
public bool LoadModulesFromAddins { get; set; }
|
||||
|
||||
// Config access
|
||||
private OpenSimBase m_openSim;
|
||||
|
||||
@@ -61,6 +68,11 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
private List<ISharedRegionModule> m_sharedInstances =
|
||||
new List<ISharedRegionModule>();
|
||||
|
||||
public RegionModulesControllerPlugin()
|
||||
{
|
||||
LoadModulesFromAddins = true;
|
||||
}
|
||||
|
||||
#region IApplicationPlugin implementation
|
||||
|
||||
public void Initialise (OpenSimBase openSim)
|
||||
@@ -69,6 +81,9 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
m_openSim.ApplicationRegistry.RegisterInterface<IRegionModulesController>(this);
|
||||
m_log.DebugFormat("[REGIONMODULES]: Initializing...");
|
||||
|
||||
if (!LoadModulesFromAddins)
|
||||
return;
|
||||
|
||||
// Who we are
|
||||
string id = AddinManager.CurrentAddin.Id;
|
||||
|
||||
@@ -88,40 +103,8 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
Dictionary<RuntimeAddin, IList<int>> loadedModules = new Dictionary<RuntimeAddin, IList<int>>();
|
||||
|
||||
// Scan modules and load all that aren't disabled
|
||||
foreach (TypeExtensionNode node in
|
||||
AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
|
||||
{
|
||||
IList<int> loadedModuleData;
|
||||
|
||||
if (!loadedModules.ContainsKey(node.Addin))
|
||||
loadedModules.Add(node.Addin, new List<int> { 0, 0, 0 });
|
||||
|
||||
loadedModuleData = loadedModules[node.Addin];
|
||||
|
||||
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
|
||||
{
|
||||
if (CheckModuleEnabled(node, modulesConfig))
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_sharedModules.Add(node);
|
||||
loadedModuleData[0]++;
|
||||
}
|
||||
}
|
||||
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
|
||||
{
|
||||
if (CheckModuleEnabled(node, modulesConfig))
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_nonSharedModules.Add(node);
|
||||
loadedModuleData[1]++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
|
||||
loadedModuleData[2]++;
|
||||
}
|
||||
}
|
||||
foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/OpenSim/RegionModules"))
|
||||
AddNode(node, modulesConfig, loadedModules);
|
||||
|
||||
foreach (KeyValuePair<RuntimeAddin, IList<int>> loadedModuleData in loadedModules)
|
||||
{
|
||||
@@ -194,6 +177,41 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
|
||||
#region IPlugin implementation
|
||||
|
||||
private void AddNode(
|
||||
TypeExtensionNode node, IConfig modulesConfig, Dictionary<RuntimeAddin, IList<int>> loadedModules)
|
||||
{
|
||||
IList<int> loadedModuleData;
|
||||
|
||||
if (!loadedModules.ContainsKey(node.Addin))
|
||||
loadedModules.Add(node.Addin, new List<int> { 0, 0, 0 });
|
||||
|
||||
loadedModuleData = loadedModules[node.Addin];
|
||||
|
||||
if (node.Type.GetInterface(typeof(ISharedRegionModule).ToString()) != null)
|
||||
{
|
||||
if (CheckModuleEnabled(node, modulesConfig))
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_sharedModules.Add(node);
|
||||
loadedModuleData[0]++;
|
||||
}
|
||||
}
|
||||
else if (node.Type.GetInterface(typeof(INonSharedRegionModule).ToString()) != null)
|
||||
{
|
||||
if (CheckModuleEnabled(node, modulesConfig))
|
||||
{
|
||||
m_log.DebugFormat("[REGIONMODULES]: Found non-shared region module {0}, class {1}", node.Id, node.Type);
|
||||
m_nonSharedModules.Add(node);
|
||||
loadedModuleData[1]++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat("[REGIONMODULES]: Found unknown type of module {0}, class {1}", node.Id, node.Type);
|
||||
loadedModuleData[2]++;
|
||||
}
|
||||
}
|
||||
|
||||
// We don't do that here
|
||||
//
|
||||
public void Initialise ()
|
||||
@@ -215,6 +233,7 @@ namespace OpenSim.ApplicationPlugins.RegionModulesController
|
||||
m_sharedInstances[0].Close();
|
||||
m_sharedInstances.RemoveAt(0);
|
||||
}
|
||||
|
||||
m_sharedModules.Clear();
|
||||
m_nonSharedModules.Clear();
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -162,6 +162,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
availableMethods["admin_acl_list"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAccessListList);
|
||||
availableMethods["admin_estate_reload"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcEstateReload);
|
||||
|
||||
// Land management
|
||||
availableMethods["admin_reset_land"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcResetLand);
|
||||
|
||||
// Either enable full remote functionality or just selected features
|
||||
string enabledMethods = m_config.GetString("enabled_methods", "all");
|
||||
|
||||
@@ -694,7 +697,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
region.EstateSettings.EstateName = (string) requestData["estate_name"];
|
||||
region.EstateSettings.EstateOwner = userID;
|
||||
// Persistence does not seem to effect the need to save a new estate
|
||||
region.EstateSettings.Save();
|
||||
m_application.EstateDataService.StoreEstateSettings(region.EstateSettings);
|
||||
|
||||
if (!m_application.EstateDataService.LinkRegion(region.RegionID, (int) region.EstateSettings.EstateID))
|
||||
throw new Exception("Failed to join estate.");
|
||||
@@ -724,7 +727,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
// If an access specification was provided, use it.
|
||||
// Otherwise accept the default.
|
||||
newScene.RegionInfo.EstateSettings.PublicAccess = GetBoolean(requestData, "public", m_publicAccess);
|
||||
newScene.RegionInfo.EstateSettings.Save();
|
||||
m_application.EstateDataService.StoreEstateSettings(newScene.RegionInfo.EstateSettings);
|
||||
|
||||
// enable voice on newly created region if
|
||||
// requested by either the XmlRpc request or the
|
||||
@@ -910,7 +913,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
scene.RegionInfo.EstateSettings.PublicAccess =
|
||||
GetBoolean(requestData,"public", scene.RegionInfo.EstateSettings.PublicAccess);
|
||||
if (scene.RegionInfo.Persistent)
|
||||
scene.RegionInfo.EstateSettings.Save();
|
||||
m_application.EstateDataService.StoreEstateSettings(scene.RegionInfo.EstateSettings);
|
||||
|
||||
if (requestData.ContainsKey("enable_voice"))
|
||||
{
|
||||
@@ -1792,7 +1795,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
scene.RegionInfo.EstateSettings.EstateAccess = new UUID[]{};
|
||||
|
||||
if (scene.RegionInfo.Persistent)
|
||||
scene.RegionInfo.EstateSettings.Save();
|
||||
m_application.EstateDataService.StoreEstateSettings(scene.RegionInfo.EstateSettings);
|
||||
|
||||
m_log.Info("[RADMIN]: Access List Clear Request complete");
|
||||
}
|
||||
@@ -1838,7 +1841,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
}
|
||||
scene.RegionInfo.EstateSettings.EstateAccess = accessControlList.ToArray();
|
||||
if (scene.RegionInfo.Persistent)
|
||||
scene.RegionInfo.EstateSettings.Save();
|
||||
m_application.EstateDataService.StoreEstateSettings(scene.RegionInfo.EstateSettings);
|
||||
}
|
||||
|
||||
responseData["added"] = addedUsers;
|
||||
@@ -1887,7 +1890,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
}
|
||||
scene.RegionInfo.EstateSettings.EstateAccess = accessControlList.ToArray();
|
||||
if (scene.RegionInfo.Persistent)
|
||||
scene.RegionInfo.EstateSettings.Save();
|
||||
m_application.EstateDataService.StoreEstateSettings(scene.RegionInfo.EstateSettings);
|
||||
}
|
||||
|
||||
responseData["removed"] = removedUsers;
|
||||
@@ -2063,6 +2066,56 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
responseData["success"] = true;
|
||||
}
|
||||
|
||||
private void XmlRpcResetLand(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
|
||||
{
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
Hashtable responseData = (Hashtable)response.Value;
|
||||
|
||||
string musicURL = string.Empty;
|
||||
UUID groupID = UUID.Zero;
|
||||
uint flags = 0;
|
||||
bool set_group = false, set_music = false, set_flags = false;
|
||||
|
||||
if (requestData.Contains("group") && requestData["group"] != null)
|
||||
set_group = UUID.TryParse(requestData["group"].ToString(), out groupID);
|
||||
if (requestData.Contains("music") && requestData["music"] != null)
|
||||
{
|
||||
musicURL = requestData["music"].ToString();
|
||||
set_music = true;
|
||||
}
|
||||
if (requestData.Contains("flags") && requestData["flags"] != null)
|
||||
set_flags = UInt32.TryParse(requestData["flags"].ToString(), out flags);
|
||||
|
||||
m_log.InfoFormat("[RADMIN]: Received Reset Land Request group={0} musicURL={1} flags={2}",
|
||||
(set_group ? groupID.ToString() : "unchanged"),
|
||||
(set_music ? musicURL : "unchanged"),
|
||||
(set_flags ? flags.ToString() : "unchanged"));
|
||||
|
||||
m_application.SceneManager.ForEachScene(delegate(Scene s)
|
||||
{
|
||||
List<ILandObject> parcels = s.LandChannel.AllParcels();
|
||||
foreach (ILandObject p in parcels)
|
||||
{
|
||||
if (set_music)
|
||||
p.LandData.MusicURL = musicURL;
|
||||
|
||||
if (set_group)
|
||||
p.LandData.GroupID = groupID;
|
||||
|
||||
if (set_flags)
|
||||
p.LandData.Flags = flags;
|
||||
|
||||
s.LandChannel.UpdateLandObject(p.LandData.LocalID, p.LandData);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
responseData["success"] = true;
|
||||
|
||||
m_log.Info("[RADMIN]: Reset Land Request complete");
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Parse a float with the given parameter name from a request data hash table.
|
||||
/// </summary>
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
namespace OpenSim.Data
|
||||
{
|
||||
public interface IEstateDataStore
|
||||
{
|
||||
@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -145,7 +145,11 @@ namespace OpenSim.Data.MySQL
|
||||
cmd.CommandText = sql;
|
||||
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
|
||||
|
||||
return DoLoad(cmd, regionID, create);
|
||||
EstateSettings e = DoLoad(cmd, regionID, create);
|
||||
if (!create && e.EstateID == 0) // Not found
|
||||
return null;
|
||||
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,7 +431,10 @@ namespace OpenSim.Data.MySQL
|
||||
cmd.CommandText = sql;
|
||||
cmd.Parameters.AddWithValue("?EstateID", estateID);
|
||||
|
||||
return DoLoad(cmd, UUID.Zero, false);
|
||||
EstateSettings e = DoLoad(cmd, UUID.Zero, false);
|
||||
if (e.EstateID != estateID)
|
||||
return null;
|
||||
return e;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -59,4 +59,4 @@ using System.Runtime.InteropServices;
|
||||
// Revision
|
||||
//
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -61,5 +61,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -296,6 +296,14 @@ namespace OpenSim.Framework.Communications
|
||||
|
||||
#endregion Async communications with server
|
||||
|
||||
/// <summary>
|
||||
/// Perform a synchronous request
|
||||
/// </summary>
|
||||
public Stream Request()
|
||||
{
|
||||
return Request(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform a synchronous request
|
||||
/// </summary>
|
||||
|
||||
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -111,5 +115,50 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public EstateBan() { }
|
||||
|
||||
public Dictionary<string, object> ToMap()
|
||||
{
|
||||
Dictionary<string, object> map = new Dictionary<string, object>();
|
||||
PropertyInfo[] properties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||
foreach (PropertyInfo p in properties)
|
||||
map[p.Name] = p.GetValue(this, null);
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
public EstateBan(Dictionary<string, object> map)
|
||||
{
|
||||
foreach (KeyValuePair<string, object> kvp in map)
|
||||
{
|
||||
PropertyInfo p = this.GetType().GetProperty(kvp.Key, BindingFlags.Public | BindingFlags.Instance);
|
||||
if (p == null)
|
||||
continue;
|
||||
object value = p.GetValue(this, null);
|
||||
if (value is String)
|
||||
p.SetValue(this, map[p.Name], null);
|
||||
else if (value is UInt32)
|
||||
p.SetValue(this, UInt32.Parse((string)map[p.Name]), null);
|
||||
else if (value is Boolean)
|
||||
p.SetValue(this, Boolean.Parse((string)map[p.Name]), null);
|
||||
else if (value is UUID)
|
||||
p.SetValue(this, UUID.Parse((string)map[p.Name]), null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// For debugging
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
Dictionary<string, object> map = ToMap();
|
||||
string result = string.Empty;
|
||||
foreach (KeyValuePair<string, object> kvp in map)
|
||||
result += string.Format("{0}: {1} {2}", kvp.Key, kvp.Value, Environment.NewLine);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -411,5 +412,119 @@ namespace OpenSim.Framework
|
||||
{
|
||||
return l_EstateGroups.Contains(groupID);
|
||||
}
|
||||
|
||||
public Dictionary<string, object> ToMap()
|
||||
{
|
||||
Dictionary<string, object> map = new Dictionary<string, object>();
|
||||
PropertyInfo[] properties = this.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
|
||||
foreach (PropertyInfo p in properties)
|
||||
{
|
||||
// EstateBans is a complex type, let's treat it as special
|
||||
if (p.Name == "EstateBans")
|
||||
continue;
|
||||
|
||||
object value = p.GetValue(this, null);
|
||||
if (value != null)
|
||||
{
|
||||
if (p.PropertyType.IsArray) // of UUIDs
|
||||
{
|
||||
if (((Array)value).Length > 0)
|
||||
{
|
||||
string[] args = new string[((Array)value).Length];
|
||||
int index = 0;
|
||||
foreach (object o in (Array)value)
|
||||
args[index++] = o.ToString();
|
||||
map[p.Name] = String.Join(",", args);
|
||||
}
|
||||
}
|
||||
else // simple types
|
||||
map[p.Name] = value;
|
||||
}
|
||||
}
|
||||
|
||||
// EstateBans are special
|
||||
if (EstateBans.Length > 0)
|
||||
{
|
||||
Dictionary<string, object> bans = new Dictionary<string, object>();
|
||||
int i = 0;
|
||||
foreach (EstateBan ban in EstateBans)
|
||||
bans["ban" + i++] = ban.ToMap();
|
||||
map["EstateBans"] = bans;
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For debugging
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
Dictionary<string, object> map = ToMap();
|
||||
String result = String.Empty;
|
||||
|
||||
foreach (KeyValuePair<string, object> kvp in map)
|
||||
{
|
||||
if (kvp.Key == "EstateBans")
|
||||
{
|
||||
result += "EstateBans:" + Environment.NewLine;
|
||||
foreach (KeyValuePair<string, object> ban in (Dictionary<string, object>)kvp.Value)
|
||||
result += ban.Value.ToString();
|
||||
}
|
||||
else
|
||||
result += string.Format("{0}: {1} {2}", kvp.Key, kvp.Value.ToString(), Environment.NewLine);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public EstateSettings(Dictionary<string, object> map)
|
||||
{
|
||||
foreach (KeyValuePair<string, object> kvp in map)
|
||||
{
|
||||
PropertyInfo p = this.GetType().GetProperty(kvp.Key, BindingFlags.Public | BindingFlags.Instance);
|
||||
if (p == null)
|
||||
continue;
|
||||
|
||||
// EstateBans is a complex type, let's treat it as special
|
||||
if (p.Name == "EstateBans")
|
||||
continue;
|
||||
|
||||
if (p.PropertyType.IsArray)
|
||||
{
|
||||
string[] elements = ((string)map[p.Name]).Split(new char[] { ',' });
|
||||
UUID[] uuids = new UUID[elements.Length];
|
||||
int i = 0;
|
||||
foreach (string e in elements)
|
||||
uuids[i++] = new UUID(e);
|
||||
p.SetValue(this, uuids, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
object value = p.GetValue(this, null);
|
||||
if (value is String)
|
||||
p.SetValue(this, map[p.Name], null);
|
||||
else if (value is UInt32)
|
||||
p.SetValue(this, UInt32.Parse((string)map[p.Name]), null);
|
||||
else if (value is Boolean)
|
||||
p.SetValue(this, Boolean.Parse((string)map[p.Name]), null);
|
||||
else if (value is UUID)
|
||||
p.SetValue(this, UUID.Parse((string)map[p.Name]), null);
|
||||
}
|
||||
}
|
||||
|
||||
// EstateBans are special
|
||||
if (map.ContainsKey("EstateBans"))
|
||||
{
|
||||
var banData = ((Dictionary<string, object>)map["EstateBans"]).Values;
|
||||
EstateBan[] bans = new EstateBan[banData.Count];
|
||||
int b = 0;
|
||||
foreach (Dictionary<string, object> ban in banData)
|
||||
bans[b++] = new EstateBan(ban);
|
||||
PropertyInfo bansProperty = this.GetType().GetProperty("EstateBans", BindingFlags.Public | BindingFlags.Instance);
|
||||
bansProperty.SetValue(this, bans, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -147,8 +147,29 @@ namespace OpenSim.Framework
|
||||
public uint WorldLocX = 0;
|
||||
public uint WorldLocY = 0;
|
||||
public uint WorldLocZ = 0;
|
||||
|
||||
/// <summary>
|
||||
/// X dimension of the region.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If this is a varregion then the default size set here will be replaced when we load the region config.
|
||||
/// </remarks>
|
||||
public uint RegionSizeX = Constants.RegionSize;
|
||||
|
||||
/// <summary>
|
||||
/// X dimension of the region.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If this is a varregion then the default size set here will be replaced when we load the region config.
|
||||
/// </remarks>
|
||||
public uint RegionSizeY = Constants.RegionSize;
|
||||
|
||||
/// <summary>
|
||||
/// Z dimension of the region.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// XXX: Unknown if this accounts for regions with negative Z.
|
||||
/// </remarks>
|
||||
public uint RegionSizeZ = Constants.RegionHeight;
|
||||
|
||||
private Dictionary<String, String> m_extraSettings = new Dictionary<string, string>();
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ using OpenSim.Framework.Monitoring;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using Timer=System.Timers.Timer;
|
||||
using Nini.Config;
|
||||
|
||||
namespace OpenSim.Framework.Servers
|
||||
{
|
||||
@@ -55,10 +56,16 @@ namespace OpenSim.Framework.Servers
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Used by tests to suppress Environment.Exit(0) so that post-run operations are possible.
|
||||
/// </summary>
|
||||
public bool SuppressExit { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This will control a periodic log printout of the current 'show stats' (if they are active) for this
|
||||
/// server.
|
||||
/// </summary>
|
||||
private int m_periodDiagnosticTimerMS = 60 * 60 * 1000;
|
||||
private Timer m_periodicDiagnosticsTimer = new Timer(60 * 60 * 1000);
|
||||
|
||||
/// <summary>
|
||||
@@ -77,8 +84,6 @@ namespace OpenSim.Framework.Servers
|
||||
// Random uuid for private data
|
||||
m_osSecret = UUID.Random().ToString();
|
||||
|
||||
m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
|
||||
m_periodicDiagnosticsTimer.Enabled = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -89,6 +94,16 @@ namespace OpenSim.Framework.Servers
|
||||
StatsManager.SimExtraStats = new SimExtraStatsCollector();
|
||||
RegisterCommonCommands();
|
||||
RegisterCommonComponents(Config);
|
||||
|
||||
IConfig startupConfig = Config.Configs["Startup"];
|
||||
int logShowStatsSeconds = startupConfig.GetInt("LogShowStatsSeconds", m_periodDiagnosticTimerMS / 1000);
|
||||
m_periodDiagnosticTimerMS = logShowStatsSeconds * 1000;
|
||||
m_periodicDiagnosticsTimer.Elapsed += new ElapsedEventHandler(LogDiagnostics);
|
||||
if (m_periodDiagnosticTimerMS != 0)
|
||||
{
|
||||
m_periodicDiagnosticsTimer.Interval = m_periodDiagnosticTimerMS;
|
||||
m_periodicDiagnosticsTimer.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void ShutdownSpecific()
|
||||
@@ -99,7 +114,8 @@ namespace OpenSim.Framework.Servers
|
||||
|
||||
base.ShutdownSpecific();
|
||||
|
||||
Environment.Exit(0);
|
||||
if (!SuppressExit)
|
||||
Environment.Exit(0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenSim
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.8.0";
|
||||
private const string VERSION_NUMBER = "0.8.1";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
|
||||
public enum Flavour
|
||||
@@ -38,6 +38,7 @@ namespace OpenSim
|
||||
Dev,
|
||||
RC1,
|
||||
RC2,
|
||||
RC3,
|
||||
Release,
|
||||
Post_Fixes,
|
||||
Extended
|
||||
|
||||
@@ -1964,10 +1964,15 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (maxThreads < 2)
|
||||
throw new ArgumentOutOfRangeException("maxThreads", "maxThreads must be greater than 2");
|
||||
|
||||
if (minThreads > maxThreads || minThreads < 2)
|
||||
throw new ArgumentOutOfRangeException("minThreads", "minThreads must be greater than 2 and less than or equal to maxThreads");
|
||||
|
||||
if (m_ThreadPool != null)
|
||||
throw new InvalidOperationException("SmartThreadPool is already initialized");
|
||||
{
|
||||
m_log.Warn("SmartThreadPool is already initialized. Ignoring request.");
|
||||
return;
|
||||
}
|
||||
|
||||
STPStartInfo startInfo = new STPStartInfo();
|
||||
startInfo.ThreadPoolName = "Util";
|
||||
|
||||
@@ -730,7 +730,7 @@ namespace OpenSim
|
||||
CreateRegion(regInfo, true, out scene);
|
||||
|
||||
if (changed)
|
||||
regInfo.EstateSettings.Save();
|
||||
m_estateDataService.StoreEstateSettings(regInfo.EstateSettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -943,6 +943,7 @@ namespace OpenSim
|
||||
cdt.AddColumn("Name", ConsoleDisplayUtil.RegionNameSize);
|
||||
cdt.AddColumn("ID", ConsoleDisplayUtil.UuidSize);
|
||||
cdt.AddColumn("Position", ConsoleDisplayUtil.CoordTupleSize);
|
||||
cdt.AddColumn("Size", 11);
|
||||
cdt.AddColumn("Port", ConsoleDisplayUtil.PortSize);
|
||||
cdt.AddColumn("Ready?", 6);
|
||||
cdt.AddColumn("Estate", ConsoleDisplayUtil.EstateNameSize);
|
||||
@@ -951,8 +952,13 @@ namespace OpenSim
|
||||
{
|
||||
RegionInfo ri = scene.RegionInfo;
|
||||
cdt.AddRow(
|
||||
ri.RegionName, ri.RegionID, string.Format("{0},{1}", ri.RegionLocX, ri.RegionLocY),
|
||||
ri.InternalEndPoint.Port, scene.Ready ? "Yes" : "No", ri.EstateSettings.EstateName);
|
||||
ri.RegionName,
|
||||
ri.RegionID,
|
||||
string.Format("{0},{1}", ri.RegionLocX, ri.RegionLocY),
|
||||
string.Format("{0}x{1}", ri.RegionSizeX, ri.RegionSizeY),
|
||||
ri.InternalEndPoint.Port,
|
||||
scene.Ready ? "Yes" : "No",
|
||||
ri.EstateSettings.EstateName);
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -71,6 +71,20 @@ namespace OpenSim
|
||||
// OpenSim.ini Section name for ESTATES Settings
|
||||
public const string ESTATE_SECTION_NAME = "Estates";
|
||||
|
||||
/// <summary>
|
||||
/// Allow all plugin loading to be disabled for tests/debug.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// true by default
|
||||
/// </remarks>
|
||||
public bool EnableInitialPluginLoad { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Control whether we attempt to load an estate data service.
|
||||
/// </summary>
|
||||
/// <remarks>For tests/debugging</remarks>
|
||||
public bool LoadEstateDataService { get; set; }
|
||||
|
||||
protected string proxyUrl;
|
||||
protected int proxyOffset = 0;
|
||||
|
||||
@@ -96,7 +110,7 @@ namespace OpenSim
|
||||
|
||||
public ConsoleCommand CreateAccount = null;
|
||||
|
||||
protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
|
||||
public List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
|
||||
|
||||
/// <value>
|
||||
/// The config information passed into the OpenSimulator region server.
|
||||
@@ -135,6 +149,8 @@ namespace OpenSim
|
||||
/// <param name="configSource"></param>
|
||||
public OpenSimBase(IConfigSource configSource) : base()
|
||||
{
|
||||
EnableInitialPluginLoad = true;
|
||||
LoadEstateDataService = true;
|
||||
LoadConfigSettings(configSource);
|
||||
}
|
||||
|
||||
@@ -232,28 +248,29 @@ namespace OpenSim
|
||||
module));
|
||||
|
||||
// Load the estate data service
|
||||
IConfig estateDataConfig = Config.Configs["EstateDataStore"];
|
||||
if (estateDataConfig == null)
|
||||
throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?");
|
||||
|
||||
module = estateDataConfig.GetString("LocalServiceModule", String.Empty);
|
||||
module = Util.GetConfigVarFromSections<string>(Config, "LocalServiceModule", new string[]{"EstateDataStore", "EstateService"}, String.Empty);
|
||||
if (String.IsNullOrEmpty(module))
|
||||
throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section");
|
||||
throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] or [EstateService] section");
|
||||
|
||||
m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config });
|
||||
if (m_estateDataService == null)
|
||||
throw new Exception(
|
||||
string.Format(
|
||||
"Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.",
|
||||
module));
|
||||
if (LoadEstateDataService)
|
||||
{
|
||||
m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config });
|
||||
if (m_estateDataService == null)
|
||||
throw new Exception(
|
||||
string.Format(
|
||||
"Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.",
|
||||
module));
|
||||
}
|
||||
|
||||
base.StartupSpecific();
|
||||
|
||||
LoadPlugins();
|
||||
if (EnableInitialPluginLoad)
|
||||
LoadPlugins();
|
||||
|
||||
// We still want to post initalize any plugins even if loading has been disabled since a test may have
|
||||
// inserted them manually.
|
||||
foreach (IApplicationPlugin plugin in m_plugins)
|
||||
{
|
||||
plugin.PostInitialise();
|
||||
}
|
||||
|
||||
if (m_console != null)
|
||||
AddPluginCommands(m_console);
|
||||
@@ -555,7 +572,7 @@ namespace OpenSim
|
||||
else
|
||||
{
|
||||
regionInfo.EstateSettings.EstateOwner = account.PrincipalID;
|
||||
regionInfo.EstateSettings.Save();
|
||||
m_estateDataService.StoreEstateSettings(regionInfo.EstateSettings);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -878,6 +895,9 @@ namespace OpenSim
|
||||
try
|
||||
{
|
||||
SceneManager.Close();
|
||||
|
||||
foreach (IApplicationPlugin plugin in m_plugins)
|
||||
plugin.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -950,7 +970,7 @@ namespace OpenSim
|
||||
// back to the default. The reloading of estate settings by scene could be eliminated if it
|
||||
// knows that the passed in settings in RegionInfo are already valid. Also, it might be
|
||||
// possible to eliminate some additional later saves made by callers of this method.
|
||||
regInfo.EstateSettings.Save();
|
||||
EstateDataService.StoreEstateSettings(regInfo.EstateSettings);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using OpenSim.Framework.Client;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
@@ -536,6 +537,42 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
OSDArray texture_list = (OSDArray)request["texture_list"];
|
||||
SceneObjectGroup grp = null;
|
||||
|
||||
InventoryFolderBase textureUploadFolder = null;
|
||||
|
||||
List<InventoryFolderBase> foldersToUpdate = new List<InventoryFolderBase>();
|
||||
List<InventoryItemBase> itemsToUpdate = new List<InventoryItemBase>();
|
||||
IClientInventory clientInv = null;
|
||||
|
||||
if (texture_list.Count > 0)
|
||||
{
|
||||
ScenePresence avatar = null;
|
||||
IClientAPI client = null;
|
||||
m_Scene.TryGetScenePresence(m_HostCapsObj.AgentID, out avatar);
|
||||
|
||||
if (avatar != null)
|
||||
{
|
||||
IClientCore core = (IClientCore)avatar.ControllingClient;
|
||||
|
||||
if (core.TryGet<IClientInventory>(out clientInv))
|
||||
{
|
||||
var systemTextureFolder = m_Scene.InventoryService.GetFolderForType(m_HostCapsObj.AgentID, AssetType.Texture);
|
||||
textureUploadFolder = new InventoryFolderBase(UUID.Random(), assetName, m_HostCapsObj.AgentID, (short)AssetType.Unknown, systemTextureFolder.ID, 1);
|
||||
if (m_Scene.InventoryService.AddFolder(textureUploadFolder))
|
||||
{
|
||||
foldersToUpdate.Add(textureUploadFolder);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[BUNCH OF CAPS]: Created new folder '{0}' ({1}) for textures uploaded with mesh object {2}",
|
||||
textureUploadFolder.Name, textureUploadFolder.ID, assetName);
|
||||
}
|
||||
else
|
||||
{
|
||||
textureUploadFolder = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
List<UUID> textures = new List<UUID>();
|
||||
for (int i = 0; i < texture_list.Count; i++)
|
||||
{
|
||||
@@ -543,6 +580,38 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
textureAsset.Data = texture_list[i].AsBinary();
|
||||
m_assetService.Store(textureAsset);
|
||||
textures.Add(textureAsset.FullID);
|
||||
|
||||
if (textureUploadFolder != null)
|
||||
{
|
||||
InventoryItemBase textureItem = new InventoryItemBase();
|
||||
textureItem.Owner = m_HostCapsObj.AgentID;
|
||||
textureItem.CreatorId = m_HostCapsObj.AgentID.ToString();
|
||||
textureItem.CreatorData = String.Empty;
|
||||
textureItem.ID = UUID.Random();
|
||||
textureItem.AssetID = textureAsset.FullID;
|
||||
textureItem.Description = assetDescription;
|
||||
textureItem.Name = assetName + " - Texture " + (i + 1).ToString();
|
||||
textureItem.AssetType = (int)AssetType.Texture;
|
||||
textureItem.InvType = (int)InventoryType.Texture;
|
||||
textureItem.Folder = textureUploadFolder.ID;
|
||||
textureItem.CurrentPermissions
|
||||
= (uint)(PermissionMask.Move | PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Export);
|
||||
textureItem.BasePermissions = (uint)PermissionMask.All | (uint)PermissionMask.Export;
|
||||
textureItem.EveryOnePermissions = 0;
|
||||
textureItem.NextPermissions = (uint)PermissionMask.All;
|
||||
textureItem.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
m_Scene.InventoryService.AddItem(textureItem);
|
||||
itemsToUpdate.Add(textureItem);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[BUNCH OF CAPS]: Created new inventory item '{0}' ({1}) for texture uploaded with mesh object {2}",
|
||||
textureItem.Name, textureItem.ID, assetName);
|
||||
}
|
||||
}
|
||||
|
||||
if (clientInv != null && (foldersToUpdate.Count > 0 || itemsToUpdate.Count > 0))
|
||||
{
|
||||
clientInv.SendBulkUpdateInventory(foldersToUpdate.ToArray(), itemsToUpdate.ToArray());
|
||||
}
|
||||
|
||||
for (int i = 0; i < mesh_list.Count; i++)
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -63,8 +63,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
public List<UUID> folders;
|
||||
}
|
||||
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Control whether requests will be processed asynchronously.
|
||||
@@ -438,7 +437,18 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
aPollRequest poolreq = m_queue.Dequeue();
|
||||
|
||||
if (poolreq != null && poolreq.thepoll != null)
|
||||
poolreq.thepoll.Process(poolreq);
|
||||
{
|
||||
try
|
||||
{
|
||||
poolreq.thepoll.Process(poolreq);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[INVENTORY]: Failed to process queued inventory request {0} for {1} in {2}. Exception {3}",
|
||||
poolreq.reqID, poolreq.presence != null ? poolreq.presence.Name : "unknown", Scene.Name, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1154,6 +1154,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
/// <summary>
|
||||
/// Send the region heightmap to the client
|
||||
/// This method is only called when not doing intellegent terrain patch sending and
|
||||
/// is only called when the scene presence is initially created and sends all of the
|
||||
/// region's patches to the client.
|
||||
/// </summary>
|
||||
/// <param name="map">heightmap</param>
|
||||
public virtual void SendLayerData(float[] map)
|
||||
@@ -1237,9 +1240,49 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
// Legacy form of invocation that passes around a bare data array.
|
||||
// Just ignore what was passed and use the real terrain info that is part of the scene.
|
||||
// As a HORRIBLE kludge in an attempt to not change the definition of IClientAPI,
|
||||
// there is a special form for specifying multiple terrain patches to send.
|
||||
// The form is to pass 'px' as negative the number of patches to send and to
|
||||
// pass the float array as pairs of patch X and Y coordinates. So, passing 'px'
|
||||
// as -2 and map= [3, 5, 8, 4] would mean to send two terrain heightmap patches
|
||||
// and the patches to send are <3,5> and <8,4>.
|
||||
public void SendLayerData(int px, int py, float[] map)
|
||||
{
|
||||
SendLayerData(px, py, m_scene.Heightmap.GetTerrainData());
|
||||
if (px >= 0)
|
||||
{
|
||||
SendLayerData(px, py, m_scene.Heightmap.GetTerrainData());
|
||||
}
|
||||
else
|
||||
{
|
||||
int numPatches = -px;
|
||||
int[] xPatches = new int[numPatches];
|
||||
int[] yPatches = new int[numPatches];
|
||||
for (int pp = 0; pp < numPatches; pp++)
|
||||
{
|
||||
xPatches[pp] = (int)map[pp * 2];
|
||||
yPatches[pp] = (int)map[pp * 2 + 1];
|
||||
}
|
||||
|
||||
// DebugSendingPatches("SendLayerData", xPatches, yPatches);
|
||||
|
||||
SendLayerData(xPatches, yPatches, m_scene.Heightmap.GetTerrainData());
|
||||
}
|
||||
}
|
||||
|
||||
private void DebugSendingPatches(string pWho, int[] pX, int[] pY)
|
||||
{
|
||||
if (m_log.IsDebugEnabled)
|
||||
{
|
||||
int numPatches = pX.Length;
|
||||
string Xs = "";
|
||||
string Ys = "";
|
||||
for (int pp = 0; pp < numPatches; pp++)
|
||||
{
|
||||
Xs += String.Format("{0}", (int)pX[pp]) + ",";
|
||||
Ys += String.Format("{0}", (int)pY[pp]) + ",";
|
||||
}
|
||||
m_log.DebugFormat("{0} {1}: numPatches={2}, X={3}, Y={4}", LogHeader, pWho, numPatches, Xs, Ys);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1251,6 +1294,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <param name="py">Patch coordinate (y) 0..15</param>
|
||||
/// <param name="map">heightmap</param>
|
||||
public void SendLayerData(int px, int py, TerrainData terrData)
|
||||
{
|
||||
int[] xPatches = new[] { px };
|
||||
int[] yPatches = new[] { py };
|
||||
SendLayerData(xPatches, yPatches, terrData);
|
||||
}
|
||||
|
||||
private void SendLayerData(int[] px, int[] py, TerrainData terrData)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -1259,31 +1309,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
patchInd[0] = px + (py * Constants.TerrainPatchSize);
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(terrData.GetFloatsSerialized(), patchInd);
|
||||
*/
|
||||
LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLandPacket(terrData, px, py);
|
||||
|
||||
// When a user edits the terrain, so much data is sent, the data queues up fast and presents a sub optimal editing experience.
|
||||
// To alleviate this issue, when the user edits the terrain, we start skipping the queues until they're done editing the terrain.
|
||||
// We also make them unreliable because it's extremely likely that multiple packets will be sent for a terrain patch area
|
||||
// invalidating previous packets for that area.
|
||||
|
||||
// It's possible for an editing user to flood themselves with edited packets but the majority of use cases are such that only a
|
||||
// tiny percentage of users will be editing the terrain. Other, non-editing users will see the edits much slower.
|
||||
|
||||
// One last note on this topic, by the time users are going to be editing the terrain, it's extremely likely that the sim will
|
||||
// have rezzed already and therefore this is not likely going to cause any additional issues with lost packets, objects or terrain
|
||||
// patches.
|
||||
|
||||
// m_justEditedTerrain is volatile, so test once and duplicate two affected statements so we only have one cache miss.
|
||||
if (m_justEditedTerrain)
|
||||
// Many, many patches could have been passed to us. Since the patches will be compressed
|
||||
// into variable sized blocks, we cannot pre-compute how many will fit into one
|
||||
// packet. While some fancy packing algorithm is possible, 4 seems to always fit.
|
||||
int PatchesAssumedToFit = 4;
|
||||
for (int pcnt = 0; pcnt < px.Length; pcnt += PatchesAssumedToFit)
|
||||
{
|
||||
layerpack.Header.Reliable = false;
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Unknown );
|
||||
}
|
||||
else
|
||||
{
|
||||
layerpack.Header.Reliable = true;
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
int remaining = Math.Min(px.Length - pcnt, PatchesAssumedToFit);
|
||||
int[] xPatches = new int[remaining];
|
||||
int[] yPatches = new int[remaining];
|
||||
for (int ii = 0; ii < remaining; ii++)
|
||||
{
|
||||
xPatches[ii] = px[pcnt + ii];
|
||||
yPatches[ii] = py[pcnt + ii];
|
||||
}
|
||||
LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLandPacket(terrData, xPatches, yPatches);
|
||||
// DebugSendingPatches("SendLayerDataInternal", xPatches, yPatches);
|
||||
|
||||
SendTheLayerPacket(layerpack);
|
||||
}
|
||||
// LayerDataPacket layerpack = OpenSimTerrainCompressor.CreateLandPacket(terrData, px, py);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1291,6 +1337,36 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
// When a user edits the terrain, so much data is sent, the data queues up fast and presents a
|
||||
// sub optimal editing experience. To alleviate this issue, when the user edits the terrain, we
|
||||
// start skipping the queues until they're done editing the terrain. We also make them
|
||||
// unreliable because it's extremely likely that multiple packets will be sent for a terrain patch
|
||||
// area invalidating previous packets for that area.
|
||||
|
||||
// It's possible for an editing user to flood themselves with edited packets but the majority
|
||||
// of use cases are such that only a tiny percentage of users will be editing the terrain.
|
||||
// Other, non-editing users will see the edits much slower.
|
||||
|
||||
// One last note on this topic, by the time users are going to be editing the terrain, it's
|
||||
// extremely likely that the sim will have rezzed already and therefore this is not likely going
|
||||
// to cause any additional issues with lost packets, objects or terrain patches.
|
||||
|
||||
// m_justEditedTerrain is volatile, so test once and duplicate two affected statements so we
|
||||
// only have one cache miss.
|
||||
private void SendTheLayerPacket(LayerDataPacket layerpack)
|
||||
{
|
||||
if (m_justEditedTerrain)
|
||||
{
|
||||
layerpack.Header.Reliable = false;
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Unknown );
|
||||
}
|
||||
else
|
||||
{
|
||||
layerpack.Header.Reliable = true;
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Send the wind matrix to the client
|
||||
/// </summary>
|
||||
@@ -1467,10 +1543,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
mapReply.Data[i].Access = mapBlocks2[i].Access;
|
||||
mapReply.Data[i].Agents = mapBlocks2[i].Agents;
|
||||
|
||||
// TODO: hookup varregion sim size here
|
||||
mapReply.Size[i] = new MapBlockReplyPacket.SizeBlock();
|
||||
mapReply.Size[i].SizeX = 256;
|
||||
mapReply.Size[i].SizeY = 256;
|
||||
mapReply.Size[i].SizeX = mapBlocks2[i].SizeX;
|
||||
mapReply.Size[i].SizeY = mapBlocks2[i].SizeY;
|
||||
}
|
||||
OutPacket(mapReply, ThrottleOutPacketType.Land);
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Physics.Manager;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.ClientStack
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@ using System.Reflection;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using PermissionMask = OpenSim.Framework.PermissionMask;
|
||||
@@ -376,6 +377,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
m_Scene.AssetService.Store(m_asset);
|
||||
|
||||
m_transactions.RemoveXferUploader(m_transactionID);
|
||||
|
||||
m_Scene.EventManager.TriggerOnNewInventoryItemUploadComplete(ourClient.AgentId, (AssetType)type, m_asset.FullID, m_asset.Name, 0);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -422,5 +425,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
|
||||
m_transactions.RemoveXferUploader(m_transactionID);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -316,9 +316,12 @@ namespace OpenSim.Region.CoreModules.Asset
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
m_enabled = false;
|
||||
m_cache.Clear();
|
||||
m_cache = null;
|
||||
if (m_enabled)
|
||||
{
|
||||
m_enabled = false;
|
||||
m_cache.Clear();
|
||||
m_cache = null;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1152,16 +1152,24 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
|
||||
}
|
||||
|
||||
parameters = (OSDMap)Params;
|
||||
|
||||
OSDArray list = (OSDArray)parameters["result"];
|
||||
|
||||
foreach(OSD asset in list)
|
||||
{
|
||||
OSDString assetId = (OSDString)asset;
|
||||
|
||||
Scene.AssetService.Get(string.Format("{0}/{1}",assetServerURI, assetId.AsString()));
|
||||
if (parameters.ContainsKey("result"))
|
||||
{
|
||||
OSDArray list = (OSDArray)parameters["result"];
|
||||
|
||||
foreach (OSD asset in list)
|
||||
{
|
||||
OSDString assetId = (OSDString)asset;
|
||||
|
||||
Scene.AssetService.Get(string.Format("{0}/{1}", assetServerURI, assetId.AsString()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[PROFILES]: Problematic response for image_assets_request from {0}", profileServerURI);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -208,7 +208,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
protected virtual void InitialiseCommon(IConfigSource source)
|
||||
{
|
||||
string transferVersionName = "SIMULATION";
|
||||
float maxTransferVersion = 0.2f;
|
||||
float maxTransferVersion = 0.3f;
|
||||
|
||||
IConfig hypergridConfig = source.Configs["Hypergrid"];
|
||||
if (hypergridConfig != null)
|
||||
@@ -760,8 +760,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
string reason;
|
||||
string version;
|
||||
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
|
||||
if (!Scene.SimulationService.QueryAccess(
|
||||
finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, out version, out reason))
|
||||
finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, out version, out reason))
|
||||
{
|
||||
sp.ControllingClient.SendTeleportFailed(reason);
|
||||
|
||||
@@ -820,7 +821,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agentCircuit.Id0 = currentAgentCircuit.Id0;
|
||||
}
|
||||
|
||||
if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
// if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
float dist = (float)Math.Max(sp.Scene.DefaultDrawDistance,
|
||||
(float)Math.Max(sp.Scene.RegionInfo.RegionSizeX, sp.Scene.RegionInfo.RegionSizeY));
|
||||
if (NeedsNewAgent(dist, oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
// brand new agent, let's create a new caps seed
|
||||
agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
|
||||
@@ -833,7 +837,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (versionComponents.Length >= 2)
|
||||
float.TryParse(versionComponents[1], out versionNumber);
|
||||
|
||||
if (versionNumber == 0.2f && MaxOutgoingTransferVersion >= versionNumber)
|
||||
if (versionNumber >= 0.2f && MaxOutgoingTransferVersion >= versionNumber)
|
||||
TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason);
|
||||
else
|
||||
TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason);
|
||||
@@ -894,7 +898,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
IClientIPEndpoint ipepClient;
|
||||
string capsPath = String.Empty;
|
||||
if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
float dist = (float)Math.Max(sp.Scene.DefaultDrawDistance,
|
||||
(float)Math.Max(sp.Scene.RegionInfo.RegionSizeX, sp.Scene.RegionInfo.RegionSizeY));
|
||||
if (NeedsNewAgent(dist, oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for incoming agent {3} from {4}",
|
||||
@@ -1070,7 +1076,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
|
||||
if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
if (NeedsClosing(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
{
|
||||
if (!sp.Scene.IncomingPreCloseClient(sp))
|
||||
return;
|
||||
@@ -1140,7 +1146,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
IClientIPEndpoint ipepClient;
|
||||
string capsPath = String.Empty;
|
||||
if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
float dist = (float)Math.Max(sp.Scene.DefaultDrawDistance,
|
||||
(float)Math.Max(sp.Scene.RegionInfo.RegionSizeX, sp.Scene.RegionInfo.RegionSizeY));
|
||||
if (NeedsNewAgent(dist, oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for agent {3} from {4}",
|
||||
@@ -1236,7 +1244,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
sp.MakeChildAgent();
|
||||
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
if (NeedsClosing(sp.Scene.DefaultDrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
{
|
||||
if (!sp.Scene.IncomingPreCloseClient(sp))
|
||||
return;
|
||||
@@ -1509,8 +1517,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
}
|
||||
|
||||
// Check to see if we have access to the target region.
|
||||
string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
|
||||
if (neighbourRegion != null
|
||||
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, out version, out failureReason))
|
||||
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, out version, out failureReason))
|
||||
{
|
||||
// remember banned
|
||||
m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
|
||||
@@ -1864,7 +1873,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
//foreach (ulong h in agent.ChildrenCapSeeds.Keys)
|
||||
// m_log.DebugFormat("[XXX] --> {0}", h);
|
||||
//m_log.DebugFormat("[XXX] Adding {0}", region.RegionHandle);
|
||||
agent.ChildrenCapSeeds.Add(region.RegionHandle, agent.CapsPath);
|
||||
if (agent.ChildrenCapSeeds.ContainsKey(region.RegionHandle))
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[ENTITY TRANSFER]: Overwriting caps seed {0} with {1} for region {2} (handle {3}) for {4} in {5}",
|
||||
agent.ChildrenCapSeeds[region.RegionHandle], agent.CapsPath,
|
||||
region.RegionName, region.RegionHandle, sp.Name, Scene.Name);
|
||||
}
|
||||
|
||||
agent.ChildrenCapSeeds[region.RegionHandle] = agent.CapsPath;
|
||||
|
||||
if (sp.Scene.CapsModule != null)
|
||||
{
|
||||
@@ -2366,7 +2383,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
// The area to check is as big as the current region.
|
||||
// We presume all adjacent regions are the same size as this region.
|
||||
uint dd = Math.Max((uint)avatar.DrawDistance,
|
||||
uint dd = Math.Max((uint)avatar.Scene.DefaultDrawDistance,
|
||||
Math.Max(Scene.RegionInfo.RegionSizeX, Scene.RegionInfo.RegionSizeY));
|
||||
|
||||
uint startX = Util.RegionToWorldLoc(pRegionLocX) - dd + Constants.RegionSize/2;
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
|
||||
base.AddRegion(scene);
|
||||
m_assMapper = new HGAssetMapper(scene, m_HomeURI);
|
||||
scene.EventManager.OnNewInventoryItemUploadComplete += UploadInventoryItem;
|
||||
scene.EventManager.OnNewInventoryItemUploadComplete += PostInventoryAsset;
|
||||
scene.EventManager.OnTeleportStart += TeleportStart;
|
||||
scene.EventManager.OnTeleportFail += TeleportFail;
|
||||
|
||||
@@ -209,7 +209,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
}
|
||||
|
||||
public void UploadInventoryItem(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel)
|
||||
public void PostInventoryAsset(UUID avatarID, AssetType type, UUID assetID, string name, int userlevel)
|
||||
{
|
||||
if (type == AssetType.Link)
|
||||
return;
|
||||
@@ -248,7 +248,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
{
|
||||
UUID newAssetID = base.CapsUpdateInventoryItemAsset(remoteClient, itemID, data);
|
||||
|
||||
UploadInventoryItem(remoteClient.AgentId, AssetType.Unknown, newAssetID, "", 0);
|
||||
PostInventoryAsset(remoteClient.AgentId, AssetType.Unknown, newAssetID, "", 0);
|
||||
|
||||
return newAssetID;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
{
|
||||
if (base.UpdateInventoryItemAsset(ownerID, item, asset))
|
||||
{
|
||||
UploadInventoryItem(ownerID, (AssetType)asset.Type, asset.FullID, asset.Name, 0);
|
||||
PostInventoryAsset(ownerID, (AssetType)asset.Type, asset.FullID, asset.Name, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
protected override void ExportAsset(UUID agentID, UUID assetID)
|
||||
{
|
||||
if (!assetID.Equals(UUID.Zero))
|
||||
UploadInventoryItem(agentID, AssetType.Unknown, assetID, "", 0);
|
||||
PostInventoryAsset(agentID, AssetType.Unknown, assetID, "", 0);
|
||||
else
|
||||
m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ using Mono.Addins;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
[assembly: Addin("OpenSim.Region.CoreModules", "0.1")]
|
||||
|
||||
@@ -199,6 +199,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
{
|
||||
GridRegion region = null;
|
||||
uint regionX = Util.WorldToRegionLoc((uint)x);
|
||||
uint regionY = Util.WorldToRegionLoc((uint)y);
|
||||
|
||||
// First see if it's a neighbour, even if it isn't on this sim.
|
||||
// Neighbour data is cached in memory, so this is fast
|
||||
@@ -222,11 +224,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
{
|
||||
region = m_GridService.GetRegionByPosition(scopeID, x, y);
|
||||
if (region == null)
|
||||
{
|
||||
m_log.DebugFormat("{0} GetRegionByPosition. Region not found by grid service. Pos=<{1},{2}>",
|
||||
LogHeader, x, y);
|
||||
LogHeader, regionX, regionY);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("{0} GetRegionByPosition. Requested region {1} from grid service. Pos=<{2},{3}>",
|
||||
LogHeader, region.RegionName, x, y);
|
||||
LogHeader, region.RegionName, regionX, regionY);
|
||||
}
|
||||
}
|
||||
return region;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
if (inventoryURL != null && inventoryURL != string.Empty)
|
||||
{
|
||||
inventoryURL = inventoryURL.Trim(new char[] { '/' });
|
||||
m_InventoryURLs.Add(userID, inventoryURL);
|
||||
m_InventoryURLs[userID] = inventoryURL;
|
||||
m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
/// Currently valid versions are "SIMULATION/0.1" and "SIMULATION/0.2"
|
||||
/// </remarks>
|
||||
public string ServiceVersion { get; set; }
|
||||
private float m_VersionNumber = 0.3f;
|
||||
|
||||
/// <summary>
|
||||
/// Map region ID to scene.
|
||||
@@ -84,15 +85,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
|
||||
public void InitialiseService(IConfigSource configSource)
|
||||
{
|
||||
ServiceVersion = "SIMULATION/0.2";
|
||||
ServiceVersion = "SIMULATION/0.3";
|
||||
IConfig config = configSource.Configs["SimulationService"];
|
||||
if (config != null)
|
||||
{
|
||||
ServiceVersion = config.GetString("ConnectorProtocolVersion", ServiceVersion);
|
||||
|
||||
if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2")
|
||||
if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2" && ServiceVersion != "SIMULATION/0.3")
|
||||
throw new Exception(string.Format("Invalid ConnectorProtocolVersion {0}", ServiceVersion));
|
||||
|
||||
string[] versionComponents = ServiceVersion.Split(new char[] { '/' });
|
||||
if (versionComponents.Length >= 2)
|
||||
float.TryParse(versionComponents[1], out m_VersionNumber);
|
||||
|
||||
m_log.InfoFormat(
|
||||
"[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion);
|
||||
}
|
||||
@@ -264,7 +269,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason)
|
||||
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, out string version, out string reason)
|
||||
{
|
||||
reason = "Communications failure";
|
||||
version = ServiceVersion;
|
||||
@@ -276,6 +281,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
// m_log.DebugFormat(
|
||||
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
|
||||
// s.RegionInfo.RegionName, destination.RegionHandle);
|
||||
uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
|
||||
|
||||
float theirVersionNumber = 0f;
|
||||
string[] versionComponents = theirversion.Split(new char[] { '/' });
|
||||
if (versionComponents.Length >= 2)
|
||||
float.TryParse(versionComponents[1], out theirVersionNumber);
|
||||
|
||||
// Var regions here, and the requesting simulator is in an older version.
|
||||
// We will forbide this, because it crashes the viewers
|
||||
if (theirVersionNumber < 0.3f && size > 256)
|
||||
{
|
||||
reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading.";
|
||||
m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber);
|
||||
return false;
|
||||
}
|
||||
|
||||
return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason);
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return m_remoteConnector.UpdateAgent(destination, cAgentData);
|
||||
}
|
||||
|
||||
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason)
|
||||
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason)
|
||||
{
|
||||
reason = "Communications failure";
|
||||
version = "Unknown";
|
||||
@@ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return false;
|
||||
|
||||
// Try local first
|
||||
if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason))
|
||||
if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason))
|
||||
return true;
|
||||
|
||||
// else do the remote thing
|
||||
if (!m_localBackend.IsLocalRegion(destination.RegionID))
|
||||
return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason);
|
||||
return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
else
|
||||
{
|
||||
dbSettings.EstateOwner = account.PrincipalID;
|
||||
dbSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(dbSettings);
|
||||
response = String.Empty;
|
||||
|
||||
// make sure there's a log entry to document the change
|
||||
@@ -292,7 +292,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
string oldName = dbSettings.EstateName;
|
||||
dbSettings.EstateName = newName;
|
||||
dbSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(dbSettings);
|
||||
response = String.Empty;
|
||||
|
||||
// make sure there's a log entry to document the change
|
||||
@@ -367,10 +367,15 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
else
|
||||
{
|
||||
EstateSettings settings = Scene.EstateDataService.CreateNewEstate();
|
||||
settings.EstateOwner = ownerID;
|
||||
settings.EstateName = estateName;
|
||||
settings.Save();
|
||||
response = String.Empty;
|
||||
if (settings == null)
|
||||
response = String.Format("Unable to create estate \"{0}\" at this simulator", estateName);
|
||||
else
|
||||
{
|
||||
settings.EstateOwner = ownerID;
|
||||
settings.EstateName = estateName;
|
||||
Scene.EstateDataService.StoreEstateSettings(settings);
|
||||
response = String.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
return response;
|
||||
@@ -636,13 +641,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
|
||||
estateSettings.AddEstateUser(user);
|
||||
estateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(estateSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scene.RegionInfo.EstateSettings.AddEstateUser(user);
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
|
||||
TriggerEstateInfoChange();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID);
|
||||
@@ -669,13 +674,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
|
||||
estateSettings.RemoveEstateUser(user);
|
||||
estateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(estateSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scene.RegionInfo.EstateSettings.RemoveEstateUser(user);
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
|
||||
TriggerEstateInfoChange();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, Scene.RegionInfo.EstateSettings.EstateAccess, Scene.RegionInfo.EstateSettings.EstateID);
|
||||
@@ -701,13 +706,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
|
||||
estateSettings.AddEstateGroup(user);
|
||||
estateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(estateSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scene.RegionInfo.EstateSettings.AddEstateGroup(user);
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
|
||||
TriggerEstateInfoChange();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID);
|
||||
@@ -733,13 +738,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
|
||||
estateSettings.RemoveEstateGroup(user);
|
||||
estateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(estateSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scene.RegionInfo.EstateSettings.RemoveEstateGroup(user);
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
|
||||
TriggerEstateInfoChange();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, Scene.RegionInfo.EstateSettings.EstateGroups, Scene.RegionInfo.EstateSettings.EstateID);
|
||||
@@ -788,7 +793,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
|
||||
estateSettings.AddBan(bitem);
|
||||
estateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(estateSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -801,7 +806,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
item.BannedHostIPMask = "0.0.0.0";
|
||||
|
||||
Scene.RegionInfo.EstateSettings.AddBan(item);
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
|
||||
TriggerEstateInfoChange();
|
||||
|
||||
@@ -864,13 +869,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
|
||||
estateSettings.RemoveBan(user);
|
||||
estateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(estateSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID);
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
|
||||
TriggerEstateInfoChange();
|
||||
}
|
||||
@@ -903,13 +908,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
|
||||
estateSettings.AddEstateManager(user);
|
||||
estateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(estateSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scene.RegionInfo.EstateSettings.AddEstateManager(user);
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
|
||||
TriggerEstateInfoChange();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID);
|
||||
@@ -935,13 +940,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
estateSettings = Scene.EstateDataService.LoadEstateSettings(estateID);
|
||||
estateSettings.RemoveEstateManager(user);
|
||||
estateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(estateSettings);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Scene.RegionInfo.EstateSettings.RemoveEstateManager(user);
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
|
||||
TriggerEstateInfoChange();
|
||||
remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, Scene.RegionInfo.EstateSettings.EstateManagers, Scene.RegionInfo.EstateSettings.EstateID);
|
||||
@@ -1415,7 +1420,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
else
|
||||
Scene.RegionInfo.EstateSettings.DenyMinors = false;
|
||||
|
||||
Scene.RegionInfo.EstateSettings.Save();
|
||||
Scene.EstateDataService.StoreEstateSettings(Scene.RegionInfo.EstateSettings);
|
||||
TriggerEstateInfoChange();
|
||||
|
||||
Scene.TriggerEstateSunUpdate();
|
||||
|
||||
@@ -1985,15 +1985,17 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
telehub = m_scene.GetSceneObjectGroup(m_scene.RegionInfo.RegionSettings.TelehubObject);
|
||||
|
||||
// Can the user set home here?
|
||||
if (// (a) gods and land managers can set home
|
||||
m_scene.Permissions.IsAdministrator(remoteClient.AgentId) ||
|
||||
m_scene.Permissions.IsGod(remoteClient.AgentId) ||
|
||||
// (b) land owners can set home
|
||||
remoteClient.AgentId == land.LandData.OwnerID ||
|
||||
// (c) members of the land-associated group in roles that can set home
|
||||
((gpowers & (ulong)GroupPowers.AllowSetHome) == (ulong)GroupPowers.AllowSetHome) ||
|
||||
// (d) parcels with telehubs can be the home of anyone
|
||||
(telehub != null && land.ContainsPoint((int)telehub.AbsolutePosition.X, (int)telehub.AbsolutePosition.Y)))
|
||||
if (// Required: local user; foreign users cannot set home
|
||||
m_scene.UserManagementModule.IsLocalGridUser(remoteClient.AgentId) &&
|
||||
(// (a) gods and land managers can set home
|
||||
m_scene.Permissions.IsAdministrator(remoteClient.AgentId) ||
|
||||
m_scene.Permissions.IsGod(remoteClient.AgentId) ||
|
||||
// (b) land owners can set home
|
||||
remoteClient.AgentId == land.LandData.OwnerID ||
|
||||
// (c) members of the land-associated group in roles that can set home
|
||||
((gpowers & (ulong)GroupPowers.AllowSetHome) == (ulong)GroupPowers.AllowSetHome) ||
|
||||
// (d) parcels with telehubs can be the home of anyone
|
||||
(telehub != null && land.ContainsPoint((int)telehub.AbsolutePosition.X, (int)telehub.AbsolutePosition.Y))))
|
||||
{
|
||||
if (m_scene.GridUserService.SetHome(remoteClient.AgentId.ToString(), land.RegionUUID, position, lookAt))
|
||||
// FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot.
|
||||
|
||||
@@ -469,7 +469,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Parse a user set configuration setting
|
||||
/// </summary>
|
||||
@@ -1473,6 +1473,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (parcel.LandData.GroupID != UUID.Zero && IsGroupMember(parcel.LandData.GroupID, owner, (ulong)GroupPowers.AllowRez))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
||||
@@ -96,9 +96,88 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
private Scene m_scene;
|
||||
private volatile bool m_tainted;
|
||||
private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5);
|
||||
|
||||
|
||||
private String m_InitialTerrain = "pinhead-island";
|
||||
|
||||
// If true, send terrain patch updates to clients based on their view distance
|
||||
private bool m_sendTerrainUpdatesByViewDistance = false;
|
||||
|
||||
// Class to keep the per client collection of terrain patches that must be sent.
|
||||
// A patch is set to 'true' meaning it should be sent to the client. Once the
|
||||
// patch packet is queued to the client, the bit for that patch is set to 'false'.
|
||||
private class PatchUpdates
|
||||
{
|
||||
private bool[,] updated; // for each patch, whether it needs to be sent to this client
|
||||
private int updateCount; // number of patches that need to be sent
|
||||
public ScenePresence Presence; // a reference to the client to send to
|
||||
public PatchUpdates(TerrainData terrData, ScenePresence pPresence)
|
||||
{
|
||||
updated = new bool[terrData.SizeX / Constants.TerrainPatchSize, terrData.SizeY / Constants.TerrainPatchSize];
|
||||
updateCount = 0;
|
||||
Presence = pPresence;
|
||||
// Initially, send all patches to the client
|
||||
SetAll(true);
|
||||
}
|
||||
// Returns 'true' if there are any patches marked for sending
|
||||
public bool HasUpdates()
|
||||
{
|
||||
return (updateCount > 0);
|
||||
}
|
||||
public void SetByXY(int x, int y, bool state)
|
||||
{
|
||||
this.SetByPatch(x / Constants.TerrainPatchSize, y / Constants.TerrainPatchSize, state);
|
||||
}
|
||||
public bool GetByPatch(int patchX, int patchY)
|
||||
{
|
||||
return updated[patchX, patchY];
|
||||
}
|
||||
public void SetByPatch(int patchX, int patchY, bool state)
|
||||
{
|
||||
bool prevState = updated[patchX, patchY];
|
||||
if (!prevState && state)
|
||||
updateCount++;
|
||||
if (prevState && !state)
|
||||
updateCount--;
|
||||
updated[patchX, patchY] = state;
|
||||
}
|
||||
public void SetAll(bool state)
|
||||
{
|
||||
updateCount = 0;
|
||||
for (int xx = 0; xx < updated.GetLength(0); xx++)
|
||||
for (int yy = 0; yy < updated.GetLength(1); yy++)
|
||||
updated[xx, yy] = state;
|
||||
if (state)
|
||||
updateCount = updated.GetLength(0) * updated.GetLength(1);
|
||||
}
|
||||
// Logically OR's the terrain data's patch taint map into this client's update map.
|
||||
public void SetAll(TerrainData terrData)
|
||||
{
|
||||
if (updated.GetLength(0) != (terrData.SizeX / Constants.TerrainPatchSize)
|
||||
|| updated.GetLength(1) != (terrData.SizeY / Constants.TerrainPatchSize))
|
||||
{
|
||||
throw new Exception(
|
||||
String.Format("{0} PatchUpdates.SetAll: patch array not same size as terrain. arr=<{1},{2}>, terr=<{3},{4}>",
|
||||
LogHeader, updated.GetLength(0), updated.GetLength(1),
|
||||
terrData.SizeX / Constants.TerrainPatchSize, terrData.SizeY / Constants.TerrainPatchSize)
|
||||
);
|
||||
}
|
||||
for (int xx = 0; xx < terrData.SizeX; xx += Constants.TerrainPatchSize)
|
||||
{
|
||||
for (int yy = 0; yy < terrData.SizeY; yy += Constants.TerrainPatchSize)
|
||||
{
|
||||
// Only set tainted. The patch bit may be set if the patch was to be sent later.
|
||||
if (terrData.IsTaintedAt(xx, yy, false))
|
||||
{
|
||||
this.SetByXY(xx, yy, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The flags of which terrain patches to send for each of the ScenePresence's
|
||||
private Dictionary<UUID, PatchUpdates> m_perClientPatchUpdates = new Dictionary<UUID, PatchUpdates>();
|
||||
|
||||
/// <summary>
|
||||
/// Human readable list of terrain file extensions that are supported.
|
||||
/// </summary>
|
||||
@@ -127,7 +206,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
{
|
||||
IConfig terrainConfig = config.Configs["Terrain"];
|
||||
if (terrainConfig != null)
|
||||
{
|
||||
m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain);
|
||||
m_sendTerrainUpdatesByViewDistance = terrainConfig.GetBoolean("SendTerrainUpdatesByViewDistance", m_sendTerrainUpdatesByViewDistance);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
@@ -422,9 +504,46 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
}
|
||||
}
|
||||
|
||||
// Someone diddled terrain outside the normal code paths. Set the taintedness for all clients.
|
||||
// ITerrainModule.TaintTerrain()
|
||||
public void TaintTerrain ()
|
||||
{
|
||||
m_channel.GetTerrainData().TaintAllTerrain();
|
||||
lock (m_perClientPatchUpdates)
|
||||
{
|
||||
// Set the flags for all clients so the tainted patches will be sent out
|
||||
foreach (PatchUpdates pups in m_perClientPatchUpdates.Values)
|
||||
{
|
||||
pups.SetAll(m_scene.Heightmap.GetTerrainData());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ITerrainModule.PushTerrain()
|
||||
public void PushTerrain(IClientAPI pClient)
|
||||
{
|
||||
if (m_sendTerrainUpdatesByViewDistance)
|
||||
{
|
||||
ScenePresence presence = m_scene.GetScenePresence(pClient.AgentId);
|
||||
if (presence != null)
|
||||
{
|
||||
lock (m_perClientPatchUpdates)
|
||||
{
|
||||
PatchUpdates pups;
|
||||
if (!m_perClientPatchUpdates.TryGetValue(pClient.AgentId, out pups))
|
||||
{
|
||||
// There is a ScenePresence without a send patch map. Create one.
|
||||
pups = new PatchUpdates(m_scene.Heightmap.GetTerrainData(), presence);
|
||||
m_perClientPatchUpdates.Add(presence.UUID, pups);
|
||||
}
|
||||
pups.SetAll(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// The traditional way is to call into the protocol stack to send them all.
|
||||
pClient.SendLayerData(new float[10]);
|
||||
}
|
||||
}
|
||||
|
||||
#region Plugin Loading Methods
|
||||
@@ -676,6 +795,11 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// This event also causes changes to be sent to the clients
|
||||
CheckSendingPatchesToClients();
|
||||
|
||||
// If things changes, generate some events
|
||||
if (shouldTaint)
|
||||
{
|
||||
m_scene.EventManager.TriggerTerrainTainted();
|
||||
@@ -749,30 +873,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
presence.ControllingClient.OnLandUndo -= client_OnLandUndo;
|
||||
presence.ControllingClient.OnUnackedTerrain -= client_OnUnackedTerrain;
|
||||
}
|
||||
if (m_perClientPatchUpdates.ContainsKey(client))
|
||||
{
|
||||
m_perClientPatchUpdates.Remove(client);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks to see if the terrain has been modified since last check
|
||||
/// but won't attempt to limit those changes to the limits specified in the estate settings
|
||||
/// currently invoked by the command line operations in the region server only
|
||||
/// </summary>
|
||||
private void CheckForTerrainUpdates()
|
||||
{
|
||||
CheckForTerrainUpdates(false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks to see if the terrain has been modified since last check.
|
||||
/// If it has been modified, every all the terrain patches are sent to the client.
|
||||
/// If the call is asked to respect the estate settings for terrain_raise_limit and
|
||||
/// terrain_lower_limit, it will clamp terrain updates between these values
|
||||
/// currently invoked by client_OnModifyTerrain only and not the Commander interfaces
|
||||
/// <param name="respectEstateSettings">should height map deltas be limited to the estate settings limits</param>
|
||||
/// </summary>
|
||||
private void CheckForTerrainUpdates(bool respectEstateSettings)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Scan over changes in the terrain and limit height changes. This enforces the
|
||||
/// non-estate owner limits on rate of terrain editting.
|
||||
@@ -857,17 +963,152 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
/// <param name="y">The patch corner to send</param>
|
||||
private void SendToClients(TerrainData terrData, int x, int y)
|
||||
{
|
||||
// We know the actual terrain data passed is ignored. This kludge saves changing IClientAPI.
|
||||
//float[] heightMap = terrData.GetFloatsSerialized();
|
||||
float[] heightMap = new float[10];
|
||||
m_scene.ForEachClient(
|
||||
delegate(IClientAPI controller)
|
||||
if (m_sendTerrainUpdatesByViewDistance)
|
||||
{
|
||||
// Add that this patch needs to be sent to the accounting for each client.
|
||||
lock (m_perClientPatchUpdates)
|
||||
{
|
||||
m_scene.ForEachScenePresence(presence =>
|
||||
{
|
||||
PatchUpdates thisClientUpdates;
|
||||
if (!m_perClientPatchUpdates.TryGetValue(presence.UUID, out thisClientUpdates))
|
||||
{
|
||||
// There is a ScenePresence without a send patch map. Create one.
|
||||
thisClientUpdates = new PatchUpdates(terrData, presence);
|
||||
m_perClientPatchUpdates.Add(presence.UUID, thisClientUpdates);
|
||||
}
|
||||
thisClientUpdates.SetByXY(x, y, true);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Legacy update sending where the update is sent out as soon as noticed
|
||||
// We know the actual terrain data passed is ignored. This kludge saves changing IClientAPI.
|
||||
//float[] heightMap = terrData.GetFloatsSerialized();
|
||||
float[] heightMap = new float[10];
|
||||
m_scene.ForEachClient(
|
||||
delegate(IClientAPI controller)
|
||||
{
|
||||
controller.SendLayerData( x / Constants.TerrainPatchSize,
|
||||
y / Constants.TerrainPatchSize,
|
||||
heightMap);
|
||||
controller.SendLayerData(x / Constants.TerrainPatchSize,
|
||||
y / Constants.TerrainPatchSize,
|
||||
heightMap);
|
||||
}
|
||||
);
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private class PatchesToSend : IComparable<PatchesToSend>
|
||||
{
|
||||
public int PatchX;
|
||||
public int PatchY;
|
||||
public float Dist;
|
||||
public PatchesToSend(int pX, int pY, float pDist)
|
||||
{
|
||||
PatchX = pX;
|
||||
PatchY = pY;
|
||||
Dist = pDist;
|
||||
}
|
||||
public int CompareTo(PatchesToSend other)
|
||||
{
|
||||
return Dist.CompareTo(other.Dist);
|
||||
}
|
||||
}
|
||||
|
||||
// Called each frame time to see if there are any patches to send to any of the
|
||||
// ScenePresences.
|
||||
// Loop through all the per-client info and send any patches necessary.
|
||||
private void CheckSendingPatchesToClients()
|
||||
{
|
||||
lock (m_perClientPatchUpdates)
|
||||
{
|
||||
foreach (PatchUpdates pups in m_perClientPatchUpdates.Values)
|
||||
{
|
||||
if (pups.HasUpdates())
|
||||
{
|
||||
// There is something that could be sent to this client.
|
||||
List<PatchesToSend> toSend = GetModifiedPatchesInViewDistance(pups);
|
||||
if (toSend.Count > 0)
|
||||
{
|
||||
// m_log.DebugFormat("{0} CheckSendingPatchesToClient: sending {1} patches to {2} in region {3}",
|
||||
// LogHeader, toSend.Count, pups.Presence.Name, m_scene.RegionInfo.RegionName);
|
||||
// Sort the patches to send by the distance from the presence
|
||||
toSend.Sort();
|
||||
/*
|
||||
foreach (PatchesToSend pts in toSend)
|
||||
{
|
||||
pups.Presence.ControllingClient.SendLayerData(pts.PatchX, pts.PatchY, null);
|
||||
// presence.ControllingClient.SendLayerData(xs.ToArray(), ys.ToArray(), null, TerrainPatch.LayerType.Land);
|
||||
}
|
||||
*/
|
||||
|
||||
int[] xPieces = new int[toSend.Count];
|
||||
int[] yPieces = new int[toSend.Count];
|
||||
float[] patchPieces = new float[toSend.Count * 2];
|
||||
int pieceIndex = 0;
|
||||
foreach (PatchesToSend pts in toSend)
|
||||
{
|
||||
patchPieces[pieceIndex++] = pts.PatchX;
|
||||
patchPieces[pieceIndex++] = pts.PatchY;
|
||||
}
|
||||
pups.Presence.ControllingClient.SendLayerData(-toSend.Count, 0, patchPieces);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<PatchesToSend> GetModifiedPatchesInViewDistance(PatchUpdates pups)
|
||||
{
|
||||
List<PatchesToSend> ret = new List<PatchesToSend>();
|
||||
|
||||
ScenePresence presence = pups.Presence;
|
||||
if (presence == null)
|
||||
return ret;
|
||||
|
||||
// Compute the area of patches within our draw distance
|
||||
int startX = (((int) (presence.AbsolutePosition.X - presence.DrawDistance))/Constants.TerrainPatchSize) - 2;
|
||||
startX = Math.Max(startX, 0);
|
||||
startX = Math.Min(startX, (int)m_scene.RegionInfo.RegionSizeX/Constants.TerrainPatchSize);
|
||||
int startY = (((int) (presence.AbsolutePosition.Y - presence.DrawDistance))/Constants.TerrainPatchSize) - 2;
|
||||
startY = Math.Max(startY, 0);
|
||||
startY = Math.Min(startY, (int)m_scene.RegionInfo.RegionSizeY/Constants.TerrainPatchSize);
|
||||
int endX = (((int) (presence.AbsolutePosition.X + presence.DrawDistance))/Constants.TerrainPatchSize) + 2;
|
||||
endX = Math.Max(endX, 0);
|
||||
endX = Math.Min(endX, (int)m_scene.RegionInfo.RegionSizeX/Constants.TerrainPatchSize);
|
||||
int endY = (((int) (presence.AbsolutePosition.Y + presence.DrawDistance))/Constants.TerrainPatchSize) + 2;
|
||||
endY = Math.Max(endY, 0);
|
||||
endY = Math.Min(endY, (int)m_scene.RegionInfo.RegionSizeY/Constants.TerrainPatchSize);
|
||||
// m_log.DebugFormat("{0} GetModifiedPatchesInViewDistance. rName={1}, ddist={2}, apos={3}, start=<{4},{5}>, end=<{6},{7}>",
|
||||
// LogHeader, m_scene.RegionInfo.RegionName,
|
||||
// presence.DrawDistance, presence.AbsolutePosition,
|
||||
// startX, startY, endX, endY);
|
||||
for (int x = startX; x < endX; x++)
|
||||
{
|
||||
for (int y = startY; y < endY; y++)
|
||||
{
|
||||
//Need to make sure we don't send the same ones over and over
|
||||
Vector3 presencePos = presence.AbsolutePosition;
|
||||
Vector3 patchPos = new Vector3(x * Constants.TerrainPatchSize, y * Constants.TerrainPatchSize, presencePos.Z);
|
||||
if (pups.GetByPatch(x, y))
|
||||
{
|
||||
//Check which has less distance, camera or avatar position, both have to be done.
|
||||
//Its not a radius, its a diameter and we add 50 so that it doesn't look like it cuts off
|
||||
if (Util.DistanceLessThan(presencePos, patchPos, presence.DrawDistance + 50)
|
||||
|| Util.DistanceLessThan(presence.CameraPosition, patchPos, presence.DrawDistance + 50))
|
||||
{
|
||||
//They can see it, send it to them
|
||||
pups.SetByPatch(x, y, false);
|
||||
float dist = Vector3.DistanceSquared(presencePos, patchPos);
|
||||
ret.Add(new PatchesToSend(x, y, dist));
|
||||
//Wait and send them all at once
|
||||
// pups.client.SendLayerData(x, y, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private void client_OnModifyTerrain(UUID user, float height, float seconds, byte size, byte action,
|
||||
|
||||
@@ -198,6 +198,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
else
|
||||
{
|
||||
MapBlockData data = WorldMap.MapBlockFromGridRegion(info, flags);
|
||||
blocks.Add(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1121,32 +1121,6 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
block.SizeX = (ushort)r.RegionSizeX;
|
||||
block.SizeY = (ushort)r.RegionSizeY;
|
||||
blocks.Add(block);
|
||||
// If these are larger than legacy regions, create fake map entries for the covered
|
||||
// regions. The map system only does legacy sized regions so we have to fake map
|
||||
// entries for all the covered regions.
|
||||
if (r.RegionSizeX > Constants.RegionSize || r.RegionSizeY > Constants.RegionSize)
|
||||
{
|
||||
for (int x = 0; x < r.RegionSizeX / Constants.RegionSize; x++)
|
||||
{
|
||||
for (int y = 0; y < r.RegionSizeY / Constants.RegionSize; y++)
|
||||
{
|
||||
if (x == 0 && y == 0)
|
||||
continue;
|
||||
block = new MapBlockData
|
||||
{
|
||||
Access = r.Access,
|
||||
MapImageId = r.TerrainImage,
|
||||
Name = r.RegionName,
|
||||
X = (ushort)((r.RegionLocX / Constants.RegionSize) + x),
|
||||
Y = (ushort)((r.RegionLocY / Constants.RegionSize) + y),
|
||||
SizeX = (ushort)r.RegionSizeX,
|
||||
SizeY = (ushort)r.RegionSizeY
|
||||
};
|
||||
//Child piece, so ignore it
|
||||
blocks.Add(block);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return blocks;
|
||||
}
|
||||
@@ -1578,12 +1552,20 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
|
||||
private Byte[] GenerateOverlay()
|
||||
{
|
||||
using (Bitmap overlay = new Bitmap(256, 256))
|
||||
// These need to be ints for bitmap generation
|
||||
int regionSizeX = (int)m_scene.RegionInfo.RegionSizeX;
|
||||
int regionSizeY = (int)m_scene.RegionInfo.RegionSizeY;
|
||||
|
||||
int landTileSize = LandManagementModule.LandUnit;
|
||||
int regionLandTilesX = regionSizeX / landTileSize;
|
||||
int regionLandTilesY = regionSizeY / landTileSize;
|
||||
|
||||
using (Bitmap overlay = new Bitmap(regionSizeX, regionSizeY))
|
||||
{
|
||||
bool[,] saleBitmap = new bool[64, 64];
|
||||
for (int x = 0 ; x < 64 ; x++)
|
||||
bool[,] saleBitmap = new bool[regionLandTilesX, regionLandTilesY];
|
||||
for (int x = 0; x < regionLandTilesX; x++)
|
||||
{
|
||||
for (int y = 0 ; y < 64 ; y++)
|
||||
for (int y = 0; y < regionLandTilesY; y++)
|
||||
saleBitmap[x, y] = false;
|
||||
}
|
||||
|
||||
@@ -1596,8 +1578,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
using (Graphics g = Graphics.FromImage(overlay))
|
||||
{
|
||||
using (SolidBrush transparent = new SolidBrush(background))
|
||||
g.FillRectangle(transparent, 0, 0, 256, 256);
|
||||
|
||||
g.FillRectangle(transparent, 0, 0, regionSizeX, regionSizeY);
|
||||
|
||||
foreach (ILandObject land in parcels)
|
||||
{
|
||||
@@ -1620,12 +1601,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
|
||||
using (SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9)))
|
||||
{
|
||||
for (int x = 0 ; x < 64 ; x++)
|
||||
for (int x = 0 ; x < regionLandTilesX ; x++)
|
||||
{
|
||||
for (int y = 0 ; y < 64 ; y++)
|
||||
for (int y = 0 ; y < regionLandTilesY ; y++)
|
||||
{
|
||||
if (saleBitmap[x, y])
|
||||
g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4);
|
||||
g.FillRectangle(
|
||||
yellow, x * landTileSize,
|
||||
regionSizeX - landTileSize - (y * landTileSize),
|
||||
landTileSize,
|
||||
landTileSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1654,4 +1639,4 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
public uint itemtype;
|
||||
public ulong regionhandle;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -24,9 +24,10 @@
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
using System.IO;
|
||||
|
||||
using OpenSim.Framework;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
@@ -43,6 +44,12 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </summary>
|
||||
void TaintTerrain();
|
||||
|
||||
/// <summary>
|
||||
/// When a client initially connects, all the terrain must be pushed to the viewer.
|
||||
/// This call causes all the terrain patches to be sent to the client.
|
||||
/// </summary>
|
||||
void PushTerrain(IClientAPI pClient);
|
||||
|
||||
/// <summary>
|
||||
/// Load a terrain from a stream.
|
||||
/// </summary>
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary>
|
||||
/// Maximum value of the size of a physical prim in each axis
|
||||
/// </summary>
|
||||
public float m_maxPhys = 10;
|
||||
public float m_maxPhys = 64;
|
||||
|
||||
/// <summary>
|
||||
/// Max prims an object will hold
|
||||
@@ -201,7 +201,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool m_clampPrimSize;
|
||||
public bool m_trustBinaries;
|
||||
public bool m_allowScriptCrossings;
|
||||
public bool m_allowScriptCrossings = true;
|
||||
public bool m_useFlySlow;
|
||||
public bool m_useTrashOnDelete = true;
|
||||
|
||||
@@ -1069,18 +1069,22 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <returns>True after all operations complete, throws exceptions otherwise.</returns>
|
||||
public override void OtherRegionUp(GridRegion otherRegion)
|
||||
{
|
||||
uint xcell = Util.WorldToRegionLoc((uint)otherRegion.RegionLocX);
|
||||
uint ycell = Util.WorldToRegionLoc((uint)otherRegion.RegionLocY);
|
||||
|
||||
//m_log.InfoFormat("[SCENE]: (on region {0}): Region {1} up in coords {2}-{3}",
|
||||
// RegionInfo.RegionName, otherRegion.RegionName, xcell, ycell);
|
||||
|
||||
if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
|
||||
{
|
||||
// If these are cast to INT because long + negative values + abs returns invalid data
|
||||
int resultX = Math.Abs((int)xcell - (int)RegionInfo.RegionLocX);
|
||||
int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY);
|
||||
if (resultX <= 1 && resultY <= 1)
|
||||
//// If these are cast to INT because long + negative values + abs returns invalid data
|
||||
//int resultX = Math.Abs((int)xcell - (int)RegionInfo.RegionLocX);
|
||||
//int resultY = Math.Abs((int)ycell - (int)RegionInfo.RegionLocY);
|
||||
//if (resultX <= 1 && resultY <= 1)
|
||||
float dist = (float)Math.Max(DefaultDrawDistance,
|
||||
(float)Math.Max(RegionInfo.RegionSizeX, RegionInfo.RegionSizeY));
|
||||
uint newRegionX, newRegionY, thisRegionX, thisRegionY;
|
||||
Util.RegionHandleToRegionLoc(otherRegion.RegionHandle, out newRegionX, out newRegionY);
|
||||
Util.RegionHandleToRegionLoc(RegionInfo.RegionHandle, out thisRegionX, out thisRegionY);
|
||||
|
||||
//m_log.InfoFormat("[SCENE]: (on region {0}): Region {1} up in coords {2}-{3}",
|
||||
// RegionInfo.RegionName, otherRegion.RegionName, newRegionX, newRegionY);
|
||||
|
||||
if (!Util.IsOutsideView(dist, thisRegionX, newRegionX, thisRegionY, newRegionY))
|
||||
{
|
||||
// Let the grid service module know, so this can be cached
|
||||
m_eventManager.TriggerOnRegionUp(otherRegion);
|
||||
@@ -1894,6 +1898,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
RegionInfo.RegionID,
|
||||
RegionInfo.RegionLocX, RegionInfo.RegionLocY,
|
||||
RegionInfo.RegionSizeX, RegionInfo.RegionSizeY);
|
||||
|
||||
if (error != String.Empty)
|
||||
throw new Exception(error);
|
||||
}
|
||||
@@ -3214,10 +3219,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_authenticateHandler.RemoveCircuit(agentID);
|
||||
}
|
||||
|
||||
// TODO: Can we now remove this lock?
|
||||
lock (acd)
|
||||
@@ -3233,7 +3234,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[SCENE]: Called RemoveClient() with agent ID {0} but no such presence is in the scene.", agentID);
|
||||
|
||||
m_authenticateHandler.RemoveCircuit(agentID);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3310,6 +3312,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Always clean these structures up so that any failure above doesn't cause them to remain in the
|
||||
// scene with possibly bad effects (e.g. continually timing out on unacked packets and triggering
|
||||
// the same cleanup exception continually.
|
||||
m_authenticateHandler.RemoveCircuit(agentID);
|
||||
m_sceneGraph.RemoveScenePresence(agentID);
|
||||
m_clientManager.Remove(agentID);
|
||||
|
||||
|
||||
@@ -213,7 +213,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="RemoteClient">Client to send to</param>
|
||||
public virtual void SendLayerData(IClientAPI RemoteClient)
|
||||
{
|
||||
RemoteClient.SendLayerData(Heightmap.GetFloatsSerialised());
|
||||
// RemoteClient.SendLayerData(Heightmap.GetFloatsSerialised());
|
||||
ITerrainModule terrModule = RequestModuleInterface<ITerrainModule>();
|
||||
if (terrModule != null)
|
||||
{
|
||||
terrModule.PushTerrain(RemoteClient);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public class SceneCommunicationService //one instance per region
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
private static string LogHeader = "[SCENE COMMUNIATION SERVICE]";
|
||||
|
||||
protected RegionInfo m_regionInfo;
|
||||
protected Scene m_scene;
|
||||
@@ -84,15 +85,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (neighbourService != null)
|
||||
neighbour = neighbourService.HelloNeighbour(regionhandle, region);
|
||||
else
|
||||
m_log.DebugFormat(
|
||||
"[SCENE COMMUNICATION SERVICE]: No neighbour service provided for region {0} to inform neigbhours of status",
|
||||
m_scene.Name);
|
||||
m_log.DebugFormat( "{0} neighbour service provided for region {0} to inform neigbhours of status", LogHeader, m_scene.Name);
|
||||
|
||||
if (neighbour != null)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SCENE COMMUNICATION SERVICE]: Region {0} successfully informed neighbour {1} at {2}-{3} that it is up",
|
||||
m_scene.Name, neighbour.RegionName, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y));
|
||||
m_log.DebugFormat( "{0} Region {1} successfully informed neighbour {2} at {3}-{4} that it is up",
|
||||
LogHeader, m_scene.Name, neighbour.RegionName, Util.WorldToRegionLoc(x), Util.WorldToRegionLoc(y));
|
||||
|
||||
m_scene.EventManager.TriggerOnRegionUp(neighbour);
|
||||
}
|
||||
@@ -111,9 +109,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
List<GridRegion> neighbours
|
||||
= m_scene.GridService.GetNeighbours(m_scene.RegionInfo.ScopeID, m_scene.RegionInfo.RegionID);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[SCENE COMMUNICATION SERVICE]: Informing {0} neighbours that region {1} is up",
|
||||
neighbours.Count, m_scene.Name);
|
||||
m_log.DebugFormat("{0} Informing {1} neighbours that region {2} is up", LogHeader, neighbours.Count, m_scene.Name);
|
||||
|
||||
foreach (GridRegion n in neighbours)
|
||||
{
|
||||
|
||||
@@ -873,7 +873,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
|
||||
Animator = new ScenePresenceAnimator(this);
|
||||
PresenceType = type;
|
||||
DrawDistance = world.DefaultDrawDistance;
|
||||
// DrawDistance = world.DefaultDrawDistance;
|
||||
DrawDistance = Constants.RegionSize;
|
||||
RegionHandle = world.RegionInfo.RegionHandle;
|
||||
ControllingClient = client;
|
||||
Firstname = ControllingClient.FirstName;
|
||||
@@ -1918,8 +1919,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// When we get to the point of re-computing neighbors everytime this
|
||||
// changes, then start using the agent's drawdistance rather than the
|
||||
// region's draw distance.
|
||||
// DrawDistance = agentData.Far;
|
||||
DrawDistance = Scene.DefaultDrawDistance;
|
||||
DrawDistance = agentData.Far;
|
||||
// DrawDistance = Scene.DefaultDrawDistance;
|
||||
|
||||
m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
|
||||
m_leftButtonDown = (flags & AgentManager.ControlFlags.AGENT_CONTROL_LBUTTON_DOWN) != 0;
|
||||
@@ -2277,8 +2278,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// When we get to the point of re-computing neighbors everytime this
|
||||
// changes, then start using the agent's drawdistance rather than the
|
||||
// region's draw distance.
|
||||
// DrawDistance = agentData.Far;
|
||||
DrawDistance = Scene.DefaultDrawDistance;
|
||||
DrawDistance = agentData.Far;
|
||||
// DrawDistance = Scene.DefaultDrawDistance;
|
||||
|
||||
// Check if Client has camera in 'follow cam' or 'build' mode.
|
||||
Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
|
||||
@@ -3257,7 +3258,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
float distanceError = Vector3.Distance(OffsetPosition, expectedPosition);
|
||||
|
||||
float speed = Velocity.Length();
|
||||
float velocidyDiff = Vector3.Distance(lastVelocitySentToAllClients, Velocity);
|
||||
float velocityDiff = Vector3.Distance(lastVelocitySentToAllClients, Velocity);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Delta-v {0}, lastVelocity {1}, Velocity {2} for {3} in {4}",
|
||||
// velocidyDiff, lastVelocitySentToAllClients, Velocity, Name, Scene.Name);
|
||||
|
||||
// assuming 5 ms. worst case precision for timer, use 2x that
|
||||
// for distance error threshold
|
||||
@@ -3265,8 +3270,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (speed < 0.01f // allow rotation updates if avatar position is unchanged
|
||||
|| Math.Abs(distanceError) > distanceErrorThreshold
|
||||
|| velocidyDiff > 0.01f) // did velocity change from last update?
|
||||
|| velocityDiff > 0.01f) // did velocity change from last update?
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE PRESENCE]: Update triggered with speed {0}, distanceError {1}, distanceThreshold {2}, delta-v {3} for {4} in {5}",
|
||||
// speed, distanceError, distanceErrorThreshold, velocidyDiff, Name, Scene.Name);
|
||||
|
||||
lastVelocitySentToAllClients = Velocity;
|
||||
lastTerseUpdateToAllClientsTick = currentTick;
|
||||
lastPositionSentToAllClients = OffsetPosition;
|
||||
@@ -3725,7 +3734,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX)));
|
||||
// m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY)));
|
||||
if (Util.IsOutsideView(DrawDistance, x, newRegionX, y, newRegionY))
|
||||
float dist = (float)Math.Max(Scene.DefaultDrawDistance,
|
||||
(float)Math.Max(Scene.RegionInfo.RegionSizeX, Scene.RegionInfo.RegionSizeY));
|
||||
if (Util.IsOutsideView(dist, x, newRegionX, y, newRegionY))
|
||||
{
|
||||
byebyeRegions.Add(handle);
|
||||
}
|
||||
@@ -3816,8 +3827,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// When we get to the point of re-computing neighbors everytime this
|
||||
// changes, then start using the agent's drawdistance rather than the
|
||||
// region's draw distance.
|
||||
// DrawDistance = cAgentData.Far;
|
||||
DrawDistance = Scene.DefaultDrawDistance;
|
||||
DrawDistance = cAgentData.Far;
|
||||
// DrawDistance = Scene.DefaultDrawDistance;
|
||||
|
||||
if (cAgentData.Position != marker) // UGH!!
|
||||
m_pos = cAgentData.Position + offset;
|
||||
@@ -3927,8 +3938,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// When we get to the point of re-computing neighbors everytime this
|
||||
// changes, then start using the agent's drawdistance rather than the
|
||||
// region's draw distance.
|
||||
// DrawDistance = cAgent.Far;
|
||||
DrawDistance = Scene.DefaultDrawDistance;
|
||||
DrawDistance = cAgent.Far;
|
||||
// DrawDistance = Scene.DefaultDrawDistance;
|
||||
|
||||
if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0)
|
||||
ControllingClient.SetChildAgentThrottle(cAgent.Throttles);
|
||||
|
||||
@@ -119,6 +119,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
xPieces[0] = patchX; // patch X dimension
|
||||
yPieces[0] = patchY;
|
||||
|
||||
return CreateLandPacket(terrData, xPieces, yPieces);
|
||||
}
|
||||
|
||||
public static LayerDataPacket CreateLandPacket(TerrainData terrData, int[] xPieces, int[] yPieces)
|
||||
{
|
||||
byte landPacketType = (byte)TerrainPatch.LayerType.Land;
|
||||
if (terrData.SizeX > Constants.RegionSize || terrData.SizeY > Constants.RegionSize)
|
||||
{
|
||||
@@ -148,8 +153,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// Array of indexes in the grid of patches.
|
||||
/// </param>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="pRegionSizeX"></param>
|
||||
/// <param name="pRegionSizeY"></param>
|
||||
/// <returns></returns>
|
||||
public static LayerDataPacket CreateLandPacket(TerrainData terrData, int[] x, int[] y, byte type)
|
||||
{
|
||||
|
||||
249
OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs
Normal file
249
OpenSim/Region/Framework/Scenes/Tests/SharedRegionModuleTests.cs
Normal file
@@ -0,0 +1,249 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim;
|
||||
using OpenSim.ApplicationPlugins.RegionModulesController;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Tests.Common;
|
||||
|
||||
namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
{
|
||||
public class SharedRegionModuleTests : OpenSimTestCase
|
||||
{
|
||||
// [Test]
|
||||
public void TestLifecycle()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
TestHelpers.EnableLogging();
|
||||
|
||||
UUID estateOwnerId = TestHelpers.ParseTail(0x1);
|
||||
UUID regionId = TestHelpers.ParseTail(0x10);
|
||||
|
||||
IConfigSource configSource = new IniConfigSource();
|
||||
configSource.AddConfig("Startup");
|
||||
configSource.AddConfig("Modules");
|
||||
|
||||
// // We use this to skip estate questions
|
||||
// Turns out not to be needed is estate owner id is pre-set in region information.
|
||||
// IConfig estateConfig = configSource.AddConfig(OpenSimBase.ESTATE_SECTION_NAME);
|
||||
// estateConfig.Set("DefaultEstateOwnerName", "Zaphod Beeblebrox");
|
||||
// estateConfig.Set("DefaultEstateOwnerUUID", estateOwnerId);
|
||||
// estateConfig.Set("DefaultEstateOwnerEMail", "zaphod@galaxy.com");
|
||||
// estateConfig.Set("DefaultEstateOwnerPassword", "two heads");
|
||||
|
||||
// For grid servic
|
||||
configSource.AddConfig("GridService");
|
||||
configSource.Configs["Modules"].Set("GridServices", "LocalGridServicesConnector");
|
||||
configSource.Configs["GridService"].Set("StorageProvider", "OpenSim.Data.Null.dll:NullRegionData");
|
||||
configSource.Configs["GridService"].Set("LocalServiceModule", "OpenSim.Services.GridService.dll:GridService");
|
||||
configSource.Configs["GridService"].Set("ConnectionString", "!static");
|
||||
|
||||
LocalGridServicesConnector gridService = new LocalGridServicesConnector();
|
||||
//
|
||||
OpenSim sim = new OpenSim(configSource);
|
||||
|
||||
sim.SuppressExit = true;
|
||||
sim.EnableInitialPluginLoad = false;
|
||||
sim.LoadEstateDataService = false;
|
||||
sim.NetServersInfo.HttpListenerPort = 0;
|
||||
|
||||
IRegistryCore reg = sim.ApplicationRegistry;
|
||||
|
||||
RegionInfo ri = new RegionInfo();
|
||||
ri.RegionID = regionId;
|
||||
ri.EstateSettings.EstateOwner = estateOwnerId;
|
||||
ri.InternalEndPoint = new IPEndPoint(0, 0);
|
||||
|
||||
MockRegionModulesControllerPlugin rmcp = new MockRegionModulesControllerPlugin();
|
||||
sim.m_plugins = new List<IApplicationPlugin>() { rmcp };
|
||||
reg.RegisterInterface<IRegionModulesController>(rmcp);
|
||||
|
||||
// XXX: Have to initialize directly for now
|
||||
rmcp.Initialise(sim);
|
||||
|
||||
rmcp.AddNode(gridService);
|
||||
|
||||
TestSharedRegion tsr = new TestSharedRegion();
|
||||
rmcp.AddNode(tsr);
|
||||
|
||||
// FIXME: Want to use the real one eventually but this is currently directly tied into Mono.Addins
|
||||
// which has been written in such a way that makes it impossible to use for regression tests.
|
||||
// RegionModulesControllerPlugin rmcp = new RegionModulesControllerPlugin();
|
||||
// rmcp.LoadModulesFromAddins = false;
|
||||
//// reg.RegisterInterface<IRegionModulesController>(rmcp);
|
||||
// rmcp.Initialise(sim);
|
||||
// rmcp.PostInitialise();
|
||||
// TypeExtensionNode node = new TypeExtensionNode();
|
||||
// node.
|
||||
// rmcp.AddNode(node, configSource.Configs["Modules"], new Dictionary<RuntimeAddin, IList<int>>());
|
||||
|
||||
sim.Startup();
|
||||
IScene scene;
|
||||
sim.CreateRegion(ri, out scene);
|
||||
|
||||
sim.Shutdown();
|
||||
|
||||
List<string> co = tsr.CallOrder;
|
||||
int expectedEventCount = 6;
|
||||
|
||||
Assert.AreEqual(
|
||||
expectedEventCount,
|
||||
co.Count,
|
||||
"Expected {0} events but only got {1} ({2})",
|
||||
expectedEventCount, co.Count, string.Join(",", co));
|
||||
Assert.AreEqual("Initialise", co[0]);
|
||||
Assert.AreEqual("PostInitialise", co[1]);
|
||||
Assert.AreEqual("AddRegion", co[2]);
|
||||
Assert.AreEqual("RegionLoaded", co[3]);
|
||||
Assert.AreEqual("RemoveRegion", co[4]);
|
||||
Assert.AreEqual("Close", co[5]);
|
||||
}
|
||||
}
|
||||
|
||||
class TestSharedRegion : ISharedRegionModule
|
||||
{
|
||||
// FIXME: Should really use MethodInfo
|
||||
public List<string> CallOrder = new List<string>();
|
||||
|
||||
public string Name { get { return "TestSharedRegion"; } }
|
||||
|
||||
public Type ReplaceableInterface { get { return null; } }
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
CallOrder.Add("PostInitialise");
|
||||
}
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
CallOrder.Add("Initialise");
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
CallOrder.Add("Close");
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
CallOrder.Add("AddRegion");
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
CallOrder.Add("RemoveRegion");
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
CallOrder.Add("RegionLoaded");
|
||||
}
|
||||
}
|
||||
|
||||
class MockRegionModulesControllerPlugin : IRegionModulesController, IApplicationPlugin
|
||||
{
|
||||
// List of shared module instances, for adding to Scenes
|
||||
private List<ISharedRegionModule> m_sharedInstances = new List<ISharedRegionModule>();
|
||||
|
||||
// Config access
|
||||
private OpenSimBase m_openSim;
|
||||
|
||||
public string Version { get { return "0"; } }
|
||||
public string Name { get { return "MockRegionModulesControllerPlugin"; } }
|
||||
|
||||
public void Initialise() {}
|
||||
|
||||
public void Initialise(OpenSimBase sim)
|
||||
{
|
||||
m_openSim = sim;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when the application loading is completed
|
||||
/// </summary>
|
||||
public void PostInitialise()
|
||||
{
|
||||
foreach (ISharedRegionModule module in m_sharedInstances)
|
||||
module.PostInitialise();
|
||||
}
|
||||
|
||||
public void AddRegionToModules(Scene scene)
|
||||
{
|
||||
List<ISharedRegionModule> sharedlist = new List<ISharedRegionModule>();
|
||||
|
||||
foreach (ISharedRegionModule module in m_sharedInstances)
|
||||
{
|
||||
module.AddRegion(scene);
|
||||
scene.AddRegionModule(module.Name, module);
|
||||
|
||||
sharedlist.Add(module);
|
||||
}
|
||||
|
||||
foreach (ISharedRegionModule module in sharedlist)
|
||||
{
|
||||
module.RegionLoaded(scene);
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegionFromModules(Scene scene)
|
||||
{
|
||||
foreach (IRegionModuleBase module in scene.RegionModules.Values)
|
||||
{
|
||||
// m_log.DebugFormat("[REGIONMODULE]: Removing scene {0} from module {1}",
|
||||
// scene.RegionInfo.RegionName, module.Name);
|
||||
module.RemoveRegion(scene);
|
||||
}
|
||||
|
||||
scene.RegionModules.Clear();
|
||||
}
|
||||
|
||||
public void AddNode(ISharedRegionModule module)
|
||||
{
|
||||
m_sharedInstances.Add(module);
|
||||
module.Initialise(m_openSim.ConfigSource.Source);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
// We expect that all regions have been removed already
|
||||
while (m_sharedInstances.Count > 0)
|
||||
{
|
||||
m_sharedInstances[0].Close();
|
||||
m_sharedInstances.RemoveAt(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -216,7 +216,12 @@ namespace OpenSim.Region.OptionalModules.Materials
|
||||
|
||||
GetLegacyStoredMaterialsInPart(part);
|
||||
|
||||
GetStoredMaterialInFace(part, te.DefaultTexture);
|
||||
if (te.DefaultTexture != null)
|
||||
GetStoredMaterialInFace(part, te.DefaultTexture);
|
||||
else
|
||||
m_log.WarnFormat(
|
||||
"[Materials]: Default texture for part {0} (part of object {1)) in {2} unexpectedly null. Ignoring.",
|
||||
part.Name, part.ParentGroup.Name, m_scene.Name);
|
||||
|
||||
foreach (Primitive.TextureEntryFace face in te.FaceTextures)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ using Mono.Addins;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
[assembly: Addin("OpenSim.Region.OptionalModules", "0.1")]
|
||||
|
||||
@@ -76,6 +76,10 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
/// AutoBackupBusyCheck: True/False. Default: True.
|
||||
/// If True, we will only take an auto-backup if a set of conditions are met.
|
||||
/// These conditions are heuristics to try and avoid taking a backup when the sim is busy.
|
||||
/// AutoBackupSkipAssets
|
||||
/// If true, assets are not saved to the oar file. Considerably reduces impact on simulator when backing up. Intended for when assets db is backed up separately
|
||||
/// AutoBackupKeepFilesForDays
|
||||
/// Backup files older than this value (in days) are deleted during the current backup process, 0 will disable this and keep all backup files indefinitely
|
||||
/// AutoBackupScript: String. Default: not specified (disabled).
|
||||
/// File path to an executable script or binary to run when an automatic backup is taken.
|
||||
/// The file should really be (Windows) an .exe or .bat, or (Linux/Mac) a shell script or binary.
|
||||
@@ -258,6 +262,8 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
AutoBackupModuleState abms = this.ParseConfig(scene, false);
|
||||
m_log.Debug("[AUTO BACKUP]: Config for " + scene.RegionInfo.RegionName);
|
||||
m_log.Debug((abms == null ? "DEFAULT" : abms.ToString()));
|
||||
|
||||
m_states.Add(scene, abms);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -334,7 +340,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
double interval =
|
||||
this.ResolveDouble("AutoBackupInterval", this.m_defaultState.IntervalMinutes,
|
||||
config, regionConfig) * 60000.0;
|
||||
if (state == null && interval != this.m_defaultState.IntervalMinutes*60000.0)
|
||||
if (state == null && interval != this.m_defaultState.IntervalMinutes * 60000.0)
|
||||
{
|
||||
state = new AutoBackupModuleState();
|
||||
}
|
||||
@@ -412,6 +418,32 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
state.BusyCheck = tmpBusyCheck;
|
||||
}
|
||||
|
||||
// Included Option To Skip Assets
|
||||
bool tmpSkipAssets = ResolveBoolean("AutoBackupSkipAssets",
|
||||
this.m_defaultState.SkipAssets, config, regionConfig);
|
||||
if (state == null && tmpSkipAssets != this.m_defaultState.SkipAssets)
|
||||
{
|
||||
state = new AutoBackupModuleState();
|
||||
}
|
||||
|
||||
if (state != null)
|
||||
{
|
||||
state.SkipAssets = tmpSkipAssets;
|
||||
}
|
||||
|
||||
// How long to keep backup files in days, 0 Disables this feature
|
||||
int tmpKeepFilesForDays = ResolveInt("AutoBackupKeepFilesForDays",
|
||||
this.m_defaultState.KeepFilesForDays, config, regionConfig);
|
||||
if (state == null && tmpKeepFilesForDays != this.m_defaultState.KeepFilesForDays)
|
||||
{
|
||||
state = new AutoBackupModuleState();
|
||||
}
|
||||
|
||||
if (state != null)
|
||||
{
|
||||
state.KeepFilesForDays = tmpKeepFilesForDays;
|
||||
}
|
||||
|
||||
// Set file naming algorithm
|
||||
string stmpNamingType = ResolveString("AutoBackupNaming",
|
||||
this.m_defaultState.NamingType.ToString(), config, regionConfig);
|
||||
@@ -480,7 +512,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Warn(
|
||||
"BAD NEWS. You won't be able to save backups to directory " +
|
||||
"[AUTO BACKUP]: BAD NEWS. You won't be able to save backups to directory " +
|
||||
state.BackupDir +
|
||||
" because it doesn't exist or there's a permissions issue with it. Here's the exception.",
|
||||
e);
|
||||
@@ -488,6 +520,9 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
}
|
||||
}
|
||||
|
||||
if(state == null)
|
||||
return m_defaultState;
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
@@ -594,7 +629,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
bool heuristicsPassed = false;
|
||||
if (!this.m_timerMap.ContainsKey((Timer) sender))
|
||||
{
|
||||
m_log.Debug("Code-up error: timerMap doesn't contain timer " + sender);
|
||||
m_log.Debug("[AUTO BACKUP]: Code-up error: timerMap doesn't contain timer " + sender);
|
||||
}
|
||||
|
||||
List<IScene> tmap = this.m_timerMap[(Timer) sender];
|
||||
@@ -630,6 +665,9 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
}
|
||||
this.DoRegionBackup(scene);
|
||||
}
|
||||
|
||||
// Remove Old Backups
|
||||
this.RemoveOldFiles(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -640,7 +678,7 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
/// <param name="scene"></param>
|
||||
private void DoRegionBackup(IScene scene)
|
||||
{
|
||||
if (scene.RegionStatus != RegionStatus.Up)
|
||||
if (!scene.Ready)
|
||||
{
|
||||
// We won't backup a region that isn't operating normally.
|
||||
m_log.Warn("[AUTO BACKUP]: Not backing up region " + scene.RegionInfo.RegionName +
|
||||
@@ -662,7 +700,41 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
m_pendingSaves.Add(guid, scene);
|
||||
state.LiveRequests.Add(guid, savePath);
|
||||
((Scene) scene).EventManager.OnOarFileSaved += new EventManager.OarFileSaved(EventManager_OnOarFileSaved);
|
||||
iram.ArchiveRegion(savePath, guid, null);
|
||||
|
||||
m_log.Info("[AUTO BACKUP]: Backing up region " + scene.RegionInfo.RegionName);
|
||||
|
||||
// Must pass options, even if dictionary is empty!
|
||||
Dictionary<string, object> options = new Dictionary<string, object>();
|
||||
|
||||
if (state.SkipAssets)
|
||||
options["noassets"] = true;
|
||||
|
||||
iram.ArchiveRegion(savePath, guid, options);
|
||||
}
|
||||
|
||||
// For the given state, remove backup files older than the states KeepFilesForDays property
|
||||
private void RemoveOldFiles(AutoBackupModuleState state)
|
||||
{
|
||||
// 0 Means Disabled, Keep Files Indefinitely
|
||||
if (state.KeepFilesForDays > 0)
|
||||
{
|
||||
string[] files = Directory.GetFiles(state.BackupDir, "*.oar");
|
||||
DateTime CuttOffDate = DateTime.Now.AddDays(0 - state.KeepFilesForDays);
|
||||
|
||||
foreach (string file in files)
|
||||
{
|
||||
try
|
||||
{
|
||||
FileInfo fi = new FileInfo(file);
|
||||
if (fi.CreationTime < CuttOffDate)
|
||||
fi.Delete();
|
||||
}
|
||||
catch (Exception Ex)
|
||||
{
|
||||
m_log.Error("[AUTO BACKUP]: Error deleting old backup file '" + file + "': " + Ex.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -45,9 +45,11 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
this.Enabled = false;
|
||||
this.BackupDir = ".";
|
||||
this.BusyCheck = true;
|
||||
this.SkipAssets = false;
|
||||
this.Timer = null;
|
||||
this.NamingType = NamingType.Time;
|
||||
this.Script = null;
|
||||
this.KeepFilesForDays = 0;
|
||||
}
|
||||
|
||||
public Dictionary<Guid, string> LiveRequests
|
||||
@@ -91,6 +93,12 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
set;
|
||||
}
|
||||
|
||||
public bool SkipAssets
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public string Script
|
||||
{
|
||||
get;
|
||||
@@ -109,6 +117,12 @@ namespace OpenSim.Region.OptionalModules.World.AutoBackup
|
||||
set;
|
||||
}
|
||||
|
||||
public int KeepFilesForDays
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public new string ToString()
|
||||
{
|
||||
string retval = "";
|
||||
|
||||
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
@@ -205,6 +205,17 @@ public class BSActorAvatarMove : BSActor
|
||||
// Flying and not colliding and velocity nearly zero.
|
||||
m_controllingPrim.ZeroMotion(true /* inTaintTime */);
|
||||
}
|
||||
else
|
||||
{
|
||||
//We are falling but are not touching any keys make sure not falling too fast
|
||||
if (m_controllingPrim.RawVelocity.Z < BSParam.AvatarTerminalVelocity)
|
||||
{
|
||||
|
||||
OMV.Vector3 slowingForce = new OMV.Vector3(0f, 0f, BSParam.AvatarTerminalVelocity - m_controllingPrim.RawVelocity.Z) * m_controllingPrim.Mass;
|
||||
m_physicsScene.PE.ApplyCentralImpulse(m_controllingPrim.PhysBody, slowingForce);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,taint,stopping,target={1},colliding={2}",
|
||||
@@ -227,7 +238,6 @@ public class BSActorAvatarMove : BSActor
|
||||
stepVelocity.Z = m_controllingPrim.RawVelocity.Z;
|
||||
}
|
||||
|
||||
|
||||
// Colliding and not flying with an upward force. The avatar must be trying to jump.
|
||||
if (!m_controllingPrim.Flying && m_controllingPrim.IsColliding && stepVelocity.Z > 0)
|
||||
{
|
||||
@@ -253,12 +263,34 @@ public class BSActorAvatarMove : BSActor
|
||||
}
|
||||
else
|
||||
{
|
||||
// Since we're not affected by anything, whatever vertical motion the avatar has, continue that.
|
||||
stepVelocity.Z = m_controllingPrim.RawVelocity.Z;
|
||||
|
||||
// Since we're not affected by anything, the avatar must be falling and we do not want that to be too fast.
|
||||
if (m_controllingPrim.RawVelocity.Z < BSParam.AvatarTerminalVelocity)
|
||||
{
|
||||
|
||||
stepVelocity.Z = BSParam.AvatarTerminalVelocity;
|
||||
}
|
||||
else
|
||||
{
|
||||
stepVelocity.Z = m_controllingPrim.RawVelocity.Z;
|
||||
}
|
||||
}
|
||||
// DetailLog("{0},BSCharacter.MoveMotor,taint,overrideStepZWithWorldZ,stepVel={1}", LocalID, stepVelocity);
|
||||
}
|
||||
|
||||
//Alicia: Maintain minimum height when flying.
|
||||
// SL has a flying effect that keeps the avatar flying above the ground by some margin
|
||||
if (m_controllingPrim.Flying)
|
||||
{
|
||||
float hover_height = m_physicsScene.TerrainManager.GetTerrainHeightAtXYZ(m_controllingPrim.RawPosition)
|
||||
+ BSParam.AvatarFlyingGroundMargin;
|
||||
|
||||
if( m_controllingPrim.Position.Z < hover_height)
|
||||
{
|
||||
stepVelocity.Z += BSParam.AvatarFlyingGroundUpForce;
|
||||
}
|
||||
}
|
||||
|
||||
// 'stepVelocity' is now the speed we'd like the avatar to move in. Turn that into an instantanous force.
|
||||
OMV.Vector3 moveForce = (stepVelocity - m_controllingPrim.RawVelocity) * m_controllingPrim.Mass;
|
||||
|
||||
|
||||
@@ -744,7 +744,18 @@ public sealed class BSCharacter : BSPhysObject
|
||||
// and will send agent updates to the clients if velocity changes by more than
|
||||
// 0.001m/s. Bullet introduces a lot of jitter in the velocity which causes many
|
||||
// extra updates.
|
||||
if (!entprop.Velocity.ApproxEquals(RawVelocity, 0.1f))
|
||||
//
|
||||
// XXX: Contrary to the above comment, setting an update threshold here above 0.4 actually introduces jitter to
|
||||
// avatar movement rather than removes it. The larger the threshold, the bigger the jitter.
|
||||
// This is most noticeable in level flight and can be seen with
|
||||
// the "show updates" option in a viewer. With an update threshold, the RawVelocity cycles between a lower
|
||||
// bound and an upper bound, where the difference between the two is enough to trigger a large delta v update
|
||||
// and subsequently trigger an update in ScenePresence.SendTerseUpdateToAllClients(). The cause of this cycle (feedback?)
|
||||
// has not yet been identified.
|
||||
//
|
||||
// If there is a threshold below 0.4 or no threshold check at all (as in ODE), then RawVelocity stays constant and extra
|
||||
// updates are not triggered in ScenePresence.SendTerseUpdateToAllClients().
|
||||
// if (!entprop.Velocity.ApproxEquals(RawVelocity, 0.1f))
|
||||
RawVelocity = entprop.Velocity;
|
||||
|
||||
_acceleration = entprop.Acceleration;
|
||||
|
||||
@@ -305,6 +305,10 @@ public sealed class BSLinksetCompound : BSLinkset
|
||||
// Note that this works for rebuilding just the root after a linkset is taken apart.
|
||||
// Called at taint time!!
|
||||
private bool UseBulletSimRootOffsetHack = false; // Attempt to have Bullet track the coords of root compound shape
|
||||
// Number of times to perform rebuilds on broken linkset children. This should only happen when
|
||||
// a linkset is initially being created and should happen only one or two times at the most.
|
||||
// This exists to cause a looping problem to be reported while not rebuilding a linkset forever.
|
||||
private static int LinksetRebuildFailureLoopPrevention = 10;
|
||||
private void RecomputeLinksetCompound()
|
||||
{
|
||||
try
|
||||
@@ -376,9 +380,33 @@ public sealed class BSLinksetCompound : BSLinkset
|
||||
OMV.Quaternion offsetRot = OMV.Quaternion.Normalize(cPrim.RawOrientation) * invRootOrientation;
|
||||
|
||||
// Add the child shape to the compound shape being built
|
||||
m_physicsScene.PE.AddChildShapeToCompoundShape(linksetShape.physShapeInfo, childShape.physShapeInfo, offsetPos, offsetRot);
|
||||
DetailLog("{0},BSLinksetCompound.RecomputeLinksetCompound,addChild,indx={1},cShape={2},offPos={3},offRot={4}",
|
||||
LinksetRoot.LocalID, cPrim.LinksetChildIndex, childShape, offsetPos, offsetRot);
|
||||
if (childShape.physShapeInfo.HasPhysicalShape)
|
||||
{
|
||||
m_physicsScene.PE.AddChildShapeToCompoundShape(linksetShape.physShapeInfo, childShape.physShapeInfo, offsetPos, offsetRot);
|
||||
DetailLog("{0},BSLinksetCompound.RecomputeLinksetCompound,addChild,indx={1},cShape={2},offPos={3},offRot={4}",
|
||||
LinksetRoot.LocalID, cPrim.LinksetChildIndex, childShape, offsetPos, offsetRot);
|
||||
}
|
||||
else
|
||||
{
|
||||
// The linkset must be in an intermediate state where all the children have not yet
|
||||
// been constructed. This sometimes happens on startup when everything is getting
|
||||
// built and some shapes have to wait for assets to be read in.
|
||||
// Just skip this child for the moment and cause the shape to be rebuilt next tick.
|
||||
// One problem might be that the shape is broken somehow and it never becomes completely
|
||||
// available. This might cause the rebuild to happen over and over.
|
||||
if (LinksetRebuildFailureLoopPrevention-- > 0)
|
||||
{
|
||||
LinksetRoot.ForceBodyShapeRebuild(false);
|
||||
DetailLog("{0},BSLinksetCompound.RecomputeLinksetCompound,addChildWithNoShape,indx={1},cShape={2},offPos={3},offRot={4}",
|
||||
LinksetRoot.LocalID, cPrim.LinksetChildIndex, childShape, offsetPos, offsetRot);
|
||||
// Output an annoying warning. It should only happen once but if it keeps coming out,
|
||||
// the user knows there is something wrong and will report it.
|
||||
m_physicsScene.Logger.WarnFormat("{0} Linkset rebuild warning. If this happens more than one or two times, please report in Mantis 7191", LogHeader);
|
||||
m_physicsScene.Logger.WarnFormat("{0} pName={1}, childIdx={2}, shape={3}",
|
||||
LogHeader, LinksetRoot.Name, cPrim.LinksetChildIndex, childShape);
|
||||
return false; // 'false' says to move onto the next child in the list
|
||||
}
|
||||
}
|
||||
|
||||
// Since we are borrowing the shape of the child, disable the origional child body
|
||||
if (!IsRoot(cPrim))
|
||||
|
||||
@@ -136,6 +136,9 @@ public static class BSParam
|
||||
public static float AvatarHeightLowFudge { get; private set; }
|
||||
public static float AvatarHeightMidFudge { get; private set; }
|
||||
public static float AvatarHeightHighFudge { get; private set; }
|
||||
public static float AvatarFlyingGroundMargin { get; private set; }
|
||||
public static float AvatarFlyingGroundUpForce { get; private set; }
|
||||
public static float AvatarTerminalVelocity { get; private set; }
|
||||
public static float AvatarContactProcessingThreshold { get; private set; }
|
||||
public static float AvatarStopZeroThreshold { get; private set; }
|
||||
public static int AvatarJumpFrames { get; private set; }
|
||||
@@ -583,6 +586,12 @@ public static class BSParam
|
||||
0f ),
|
||||
new ParameterDefn<float>("AvatarHeightHighFudge", "A fudge factor to make tall avatars stand on the ground",
|
||||
0f ),
|
||||
new ParameterDefn<float>("AvatarFlyingGroundMargin", "Meters avatar is kept above the ground when flying",
|
||||
5f ),
|
||||
new ParameterDefn<float>("AvatarFlyingGroundUpForce", "Upward force applied to the avatar to keep it at flying ground margin",
|
||||
2.0f ),
|
||||
new ParameterDefn<float>("AvatarTerminalVelocity", "Terminal Velocity of falling avatar",
|
||||
-54.0f ),
|
||||
new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions",
|
||||
0.1f ),
|
||||
new ParameterDefn<float>("AvatarStopZeroThreshold", "Movement velocity below which avatar is assumed to be stopped",
|
||||
|
||||
@@ -462,7 +462,10 @@ public abstract class BSPhysObject : PhysicsActor
|
||||
|
||||
// If someone has subscribed for collision events log the collision so it will be reported up
|
||||
if (SubscribedEvents()) {
|
||||
CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
||||
lock (PhysScene.CollisionLock)
|
||||
{
|
||||
CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
|
||||
}
|
||||
DetailLog("{0},{1}.Collison.AddCollider,call,with={2},point={3},normal={4},depth={5},colliderMoving={6}",
|
||||
LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving);
|
||||
|
||||
@@ -474,12 +477,14 @@ public abstract class BSPhysObject : PhysicsActor
|
||||
// Send the collected collisions into the simulator.
|
||||
// Called at taint time from within the Step() function thus no locking problems
|
||||
// with CollisionCollection and ObjectsWithNoMoreCollisions.
|
||||
// Called with BSScene.CollisionLock locked to protect the collision lists.
|
||||
// Return 'true' if there were some actual collisions passed up
|
||||
public virtual bool SendCollisions()
|
||||
{
|
||||
bool ret = true;
|
||||
|
||||
// If the 'no collision' call, force it to happen right now so quick collision_end
|
||||
// If no collisions this call but there were collisions last call, force the collision
|
||||
// event to be happen right now so quick collision_end.
|
||||
bool force = (CollisionCollection.Count == 0 && CollisionsLastReported.Count != 0);
|
||||
|
||||
// throttle the collisions to the number of milliseconds specified in the subscription
|
||||
|
||||
@@ -705,7 +705,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
|
||||
// this is is under UpdateLock.
|
||||
public void PostUpdate(BSPhysObject updatee)
|
||||
{
|
||||
ObjectsWithUpdates.Add(updatee);
|
||||
lock (UpdateLock)
|
||||
{
|
||||
ObjectsWithUpdates.Add(updatee);
|
||||
}
|
||||
}
|
||||
|
||||
// The simulator thinks it is physics time so return all the collisions and position
|
||||
@@ -803,7 +806,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
|
||||
if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration))
|
||||
{
|
||||
// If a collision was 'good', remember to send it to the simulator
|
||||
ObjectsWithCollisions.Add(collider);
|
||||
lock (CollisionLock)
|
||||
{
|
||||
ObjectsWithCollisions.Add(collider);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all values by your own or you can build default build and revision
|
||||
// numbers with the '*' character (the default):
|
||||
|
||||
[assembly : AssemblyVersion("0.8.0.*")]
|
||||
[assembly : AssemblyVersion("0.8.1.*")]
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -1246,7 +1246,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
World.RegionInfo.EstateSettings.UseGlobalTime = !sunFixed;
|
||||
World.RegionInfo.EstateSettings.SunPosition = sunHour;
|
||||
World.RegionInfo.EstateSettings.FixedSun = sunFixed;
|
||||
World.RegionInfo.EstateSettings.Save();
|
||||
World.EstateDataService.StoreEstateSettings(World.RegionInfo.EstateSettings);
|
||||
|
||||
World.EventManager.TriggerEstateToolsSunUpdate(World.RegionInfo.RegionHandle);
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -410,6 +410,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||
public const int PRIM_POS_LOCAL = 33;
|
||||
public const int PRIM_LINK_TARGET = 34;
|
||||
public const int PRIM_SLICE = 35;
|
||||
public const int PRIM_SPECULAR = 36;
|
||||
public const int PRIM_NORMAL = 37;
|
||||
public const int PRIM_ALPHA_MODE = 38;
|
||||
public const int PRIM_TEXGEN_DEFAULT = 0;
|
||||
public const int PRIM_TEXGEN_PLANAR = 1;
|
||||
|
||||
|
||||
@@ -626,11 +626,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
|
||||
string labelStatement;
|
||||
|
||||
if (m_insertCoopTerminationChecks)
|
||||
labelStatement = m_coopTerminationCheck + "\n";
|
||||
labelStatement = m_coopTerminationCheck;
|
||||
else
|
||||
labelStatement = "NoOp();\n";
|
||||
labelStatement = "NoOp();";
|
||||
|
||||
return Generate(String.Format("{0}: ", CheckName(jl.LabelName)), jl) + labelStatement;
|
||||
return GenerateLine(String.Format("{0}: {1}", CheckName(jl.LabelName), labelStatement), jl);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -724,12 +724,13 @@ namespace SecondLife
|
||||
return assembly;
|
||||
}
|
||||
|
||||
private class kvpSorter : IComparer<KeyValuePair<int, int>>
|
||||
private class kvpSorter : IComparer<KeyValuePair<KeyValuePair<int, int>, KeyValuePair<int, int>>>
|
||||
{
|
||||
public int Compare(KeyValuePair<int, int> a,
|
||||
KeyValuePair<int, int> b)
|
||||
public int Compare(KeyValuePair<KeyValuePair<int, int>, KeyValuePair<int, int>> a,
|
||||
KeyValuePair<KeyValuePair<int, int>, KeyValuePair<int, int>> b)
|
||||
{
|
||||
return a.Key.CompareTo(b.Key);
|
||||
int kc = a.Key.Key.CompareTo(b.Key.Key);
|
||||
return (kc != 0) ? kc : a.Key.Value.CompareTo(b.Key.Value);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -746,30 +747,46 @@ namespace SecondLife
|
||||
out ret))
|
||||
return ret;
|
||||
|
||||
List<KeyValuePair<int, int>> sorted =
|
||||
new List<KeyValuePair<int, int>>(positionMap.Keys);
|
||||
var sorted = new List<KeyValuePair<KeyValuePair<int, int>, KeyValuePair<int, int>>>(positionMap);
|
||||
|
||||
sorted.Sort(new kvpSorter());
|
||||
|
||||
int l = 1;
|
||||
int c = 1;
|
||||
int pl = 1;
|
||||
|
||||
foreach (KeyValuePair<int, int> cspos in sorted)
|
||||
foreach (KeyValuePair<KeyValuePair<int, int>, KeyValuePair<int, int>> posmap in sorted)
|
||||
{
|
||||
if (cspos.Key >= line)
|
||||
//m_log.DebugFormat("[Compiler]: Scanning line map {0},{1} --> {2},{3}", posmap.Key.Key, posmap.Key.Value, posmap.Value.Key, posmap.Value.Value);
|
||||
int nl = posmap.Value.Key + line - posmap.Key.Key; // New, translated LSL line and column.
|
||||
int nc = posmap.Value.Value + col - posmap.Key.Value;
|
||||
// Keep going until we find the first point passed line,col.
|
||||
if (posmap.Key.Key > line)
|
||||
{
|
||||
if (cspos.Key > line)
|
||||
return new KeyValuePair<int, int>(l, c);
|
||||
if (cspos.Value > col)
|
||||
return new KeyValuePair<int, int>(l, c);
|
||||
c = cspos.Value;
|
||||
if (c == 0)
|
||||
c++;
|
||||
//m_log.DebugFormat("[Compiler]: Line is larger than requested {0},{1}, returning {2},{3}", line, col, l, c);
|
||||
if (pl < line)
|
||||
{
|
||||
//m_log.DebugFormat("[Compiler]: Previous line ({0}) is less than requested line ({1}), setting column to 1.", pl, line);
|
||||
c = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
else
|
||||
if (posmap.Key.Key == line && posmap.Key.Value > col)
|
||||
{
|
||||
l = cspos.Key;
|
||||
// Never move l,c backwards.
|
||||
if (nl > l || (nl == l && nc > c))
|
||||
{
|
||||
//m_log.DebugFormat("[Compiler]: Using offset relative to this: {0} + {1} - {2}, {3} + {4} - {5} = {6}, {7}",
|
||||
// posmap.Value.Key, line, posmap.Key.Key, posmap.Value.Value, col, posmap.Key.Value, nl, nc);
|
||||
l = nl;
|
||||
c = nc;
|
||||
}
|
||||
//m_log.DebugFormat("[Compiler]: Column is larger than requested {0},{1}, returning {2},{3}", line, col, l, c);
|
||||
break;
|
||||
}
|
||||
pl = posmap.Key.Key;
|
||||
l = posmap.Value.Key;
|
||||
c = posmap.Value.Value;
|
||||
}
|
||||
return new KeyValuePair<int, int>(l, c);
|
||||
}
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -64,7 +64,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||
// Create the temporary directory for housing build artifacts.
|
||||
Directory.CreateDirectory(m_testDir);
|
||||
}
|
||||
}
|
||||
|
||||
[SetUp]
|
||||
public void SetUp()
|
||||
{
|
||||
// Create a CSCodeProvider and CompilerParameters.
|
||||
m_CSCodeProvider = new CSharpCodeProvider();
|
||||
m_compilerParameters = new CompilerParameters();
|
||||
@@ -85,7 +89,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||
/// Removes the temporary build directory and any build artifacts
|
||||
/// inside it.
|
||||
/// </summary>
|
||||
[TestFixtureTearDown]
|
||||
[TearDown]
|
||||
public void CleanUp()
|
||||
{
|
||||
System.AppDomain.CurrentDomain.AssemblyResolve -= m_resolveEventHandler;
|
||||
@@ -97,6 +101,62 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||
}
|
||||
}
|
||||
|
||||
private CompilerResults CompileScript(
|
||||
string input, out Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> positionMap)
|
||||
{
|
||||
m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
|
||||
|
||||
CSCodeGenerator cg = new CSCodeGenerator();
|
||||
string output = cg.Convert(input);
|
||||
|
||||
output = Compiler.CreateCSCompilerScript(output, "script1", typeof(ScriptBaseClass).FullName, null);
|
||||
// System.Console.WriteLine(output);
|
||||
|
||||
positionMap = cg.PositionMap;
|
||||
|
||||
CompilerResults compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);
|
||||
|
||||
// foreach (KeyValuePair<int, int> key in positionMap.Keys)
|
||||
// {
|
||||
// KeyValuePair<int, int> val = positionMap[key];
|
||||
//
|
||||
// System.Console.WriteLine("{0},{1} => {2},{3}", key.Key, key.Value, val.Key, val.Value);
|
||||
// }
|
||||
//
|
||||
// foreach (CompilerError compErr in m_compilerResults.Errors)
|
||||
// {
|
||||
// System.Console.WriteLine("Error: {0},{1} => {2}", compErr.Line, compErr.Column, compErr);
|
||||
// }
|
||||
|
||||
return compilerResults;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test that line number errors are resolved as expected when preceding code contains a jump.
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestJumpAndSyntaxError()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
|
||||
Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> positionMap;
|
||||
|
||||
CompilerResults compilerResults = CompileScript(
|
||||
@"default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
jump l;
|
||||
@l;
|
||||
i = 1;
|
||||
}
|
||||
}", out positionMap);
|
||||
|
||||
Assert.AreEqual(
|
||||
new KeyValuePair<int, int>(7, 9),
|
||||
positionMap[new KeyValuePair<int, int>(compilerResults.Errors[0].Line, compilerResults.Errors[0].Column)]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Test the C# compiler error message can be mapped to the correct
|
||||
/// line/column in the LSL source when an undeclared variable is used.
|
||||
@@ -106,41 +166,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
|
||||
m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
|
||||
Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> positionMap;
|
||||
|
||||
string input = @"default
|
||||
CompilerResults compilerResults = CompileScript(
|
||||
@"default
|
||||
{
|
||||
state_entry()
|
||||
{
|
||||
integer y = x + 3;
|
||||
}
|
||||
}";
|
||||
|
||||
CSCodeGenerator cg = new CSCodeGenerator();
|
||||
string output = cg.Convert(input);
|
||||
|
||||
output = Compiler.CreateCSCompilerScript(output, "script1", typeof(ScriptBaseClass).FullName, null);
|
||||
// System.Console.WriteLine(output);
|
||||
|
||||
Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> positionMap = cg.PositionMap;
|
||||
|
||||
m_compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);
|
||||
//
|
||||
// foreach (KeyValuePair<int, int> key in positionMap.Keys)
|
||||
// {
|
||||
// KeyValuePair<int, int> val = positionMap[key];
|
||||
//
|
||||
// System.Console.WriteLine("{0},{1} => {2},{3}", key.Key, key.Value, val.Key, val.Value);
|
||||
// }
|
||||
//
|
||||
// foreach (CompilerError compErr in m_compilerResults.Errors)
|
||||
// {
|
||||
// System.Console.WriteLine("Error: {0},{1} => {2}", compErr.Line, compErr.Column, compErr);
|
||||
// }
|
||||
}", out positionMap);
|
||||
|
||||
Assert.AreEqual(
|
||||
new KeyValuePair<int, int>(5, 21),
|
||||
positionMap[new KeyValuePair<int, int>(m_compilerResults.Errors[0].Line, m_compilerResults.Errors[0].Column)]);
|
||||
positionMap[new KeyValuePair<int, int>(compilerResults.Errors[0].Line, compilerResults.Errors[0].Column)]);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -152,9 +191,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools.Tests
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
|
||||
m_compilerParameters.OutputAssembly = Path.Combine(m_testDir, Path.GetRandomFileName() + ".dll");
|
||||
Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> positionMap;
|
||||
|
||||
string input = @"string s = "" a string"";
|
||||
CompilerResults compilerResults = CompileScript(
|
||||
@"string s = "" a string"";
|
||||
|
||||
default
|
||||
{
|
||||
@@ -164,24 +204,9 @@ default
|
||||
string tmp = (string) gAvatarKey + s;
|
||||
llSay(0, tmp);
|
||||
}
|
||||
}";
|
||||
}", out positionMap);
|
||||
|
||||
// System.Console.WriteLine(input);
|
||||
CSCodeGenerator cg = new CSCodeGenerator();
|
||||
string output = cg.Convert(input);
|
||||
|
||||
output = Compiler.CreateCSCompilerScript(output, "script1", typeof(ScriptBaseClass).FullName, null);
|
||||
// System.Console.WriteLine(output);
|
||||
|
||||
m_compilerResults = m_CSCodeProvider.CompileAssemblyFromSource(m_compilerParameters, output);
|
||||
|
||||
System.Console.WriteLine("ERRORS: {0}", m_compilerResults.Errors.Count);
|
||||
foreach (CompilerError compErr in m_compilerResults.Errors)
|
||||
{
|
||||
System.Console.WriteLine("Error: {0}", compErr);
|
||||
}
|
||||
|
||||
Assert.AreEqual(0, m_compilerResults.Errors.Count);
|
||||
Assert.AreEqual(0, compilerResults.Errors.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("0.8.0.*")]
|
||||
[assembly: AssemblyVersion("0.8.1.*")]
|
||||
|
||||
|
||||
@@ -144,12 +144,16 @@ namespace OpenSim.Server.Handlers.Simulation
|
||||
if (args.ContainsKey("agent_home_uri"))
|
||||
agentHomeURI = args["agent_home_uri"].AsString();
|
||||
|
||||
string theirVersion = string.Empty;
|
||||
if (args.ContainsKey("my_version"))
|
||||
theirVersion = args["my_version"].AsString();
|
||||
|
||||
GridRegion destination = new GridRegion();
|
||||
destination.RegionID = regionID;
|
||||
|
||||
string reason;
|
||||
string version;
|
||||
bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason);
|
||||
bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, theirVersion, out version, out reason);
|
||||
|
||||
responsedata["int_response_code"] = HttpStatusCode.OK;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user