Compare commits
40 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fbccff4994 | ||
|
|
84184708de | ||
|
|
8f8b478d36 | ||
|
|
b817c337dc | ||
|
|
d03e878d53 | ||
|
|
b313d16493 | ||
|
|
784263f5e3 | ||
|
|
6baa13ab7a | ||
|
|
0e16e0fb6a | ||
|
|
ba98d6fffe | ||
|
|
972f73ed2b | ||
|
|
c5ff37bf3e | ||
|
|
6b867773a8 | ||
|
|
912aac3447 | ||
|
|
4486b7d8e8 | ||
|
|
1267094a51 | ||
|
|
2b842958cc | ||
|
|
80ec2ac167 | ||
|
|
df960d5767 | ||
|
|
c0760f9f91 | ||
|
|
c906128191 | ||
|
|
f574d3c8fc | ||
|
|
ebe5e1731d | ||
|
|
2ebb421331 | ||
|
|
a9e8bd59a3 | ||
|
|
4589ce61bc | ||
|
|
33e66107be | ||
|
|
db90dea9bd | ||
|
|
04544b4510 | ||
|
|
0b17a66e68 | ||
|
|
04986bbb15 | ||
|
|
b0d02adeee | ||
|
|
48b962c401 | ||
|
|
04a195266b | ||
|
|
21393af631 | ||
|
|
189c67db95 | ||
|
|
b92b9228ef | ||
|
|
f49897a419 | ||
|
|
aab30f5e67 | ||
|
|
e7fd732209 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,6 +1,5 @@
|
||||
.project
|
||||
.settings
|
||||
.gitignore
|
||||
*.csproj
|
||||
*.csproj.user
|
||||
*.build
|
||||
@@ -11,7 +10,6 @@
|
||||
*.pidb
|
||||
*.dll.build
|
||||
*.dll
|
||||
*.log
|
||||
*.VisualState.xml
|
||||
*/*/obj
|
||||
*/*/*/obj
|
||||
@@ -25,7 +23,6 @@
|
||||
*/*/*/*/*/bin
|
||||
*/*/*/*/*/*/bin
|
||||
*/*/*/*/*/*/*/bin
|
||||
addon-modules/
|
||||
bin/Debug/*.dll
|
||||
bin/*.dll.mdb
|
||||
bin/*.db
|
||||
|
||||
@@ -131,7 +131,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
availableMethods["admin_region_query"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRegionQueryMethod);
|
||||
availableMethods["admin_shutdown"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcShutdownMethod);
|
||||
availableMethods["admin_broadcast"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcAlertMethod);
|
||||
availableMethods["admin_dialog"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcDialogMethod);
|
||||
availableMethods["admin_restart"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcRestartMethod);
|
||||
availableMethods["admin_load_heightmap"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcLoadHeightmapMethod);
|
||||
availableMethods["admin_save_heightmap"] = (req, ep) => InvokeXmlRpcMethod(req, ep, XmlRpcSaveHeightmapMethod);
|
||||
@@ -263,70 +262,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
Scene rebootedScene = null;
|
||||
GetSceneFromRegionParams(requestData, responseData, out rebootedScene);
|
||||
|
||||
IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>();
|
||||
|
||||
responseData["success"] = false;
|
||||
responseData["accepted"] = true;
|
||||
responseData["rebooting"] = true;
|
||||
|
||||
string message;
|
||||
List<int> times = new List<int>();
|
||||
|
||||
if (requestData.ContainsKey("alerts"))
|
||||
{
|
||||
string[] alertTimes = requestData["alerts"].ToString().Split( new char[] {','});
|
||||
if (alertTimes.Length == 1 && Convert.ToInt32(alertTimes[0]) == -1)
|
||||
{
|
||||
if (restartModule != null)
|
||||
{
|
||||
message = "Restart has been cancelled";
|
||||
|
||||
if (requestData.ContainsKey("message"))
|
||||
message = requestData["message"].ToString();
|
||||
|
||||
restartModule.AbortRestart(message);
|
||||
|
||||
responseData["success"] = true;
|
||||
responseData["rebooting"] = false;
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
foreach (string a in alertTimes)
|
||||
times.Add(Convert.ToInt32(a));
|
||||
}
|
||||
else
|
||||
{
|
||||
int timeout = 30;
|
||||
if (requestData.ContainsKey("milliseconds"))
|
||||
timeout = Int32.Parse(requestData["milliseconds"].ToString()) / 1000;
|
||||
while (timeout > 0)
|
||||
{
|
||||
times.Add(timeout);
|
||||
if (timeout > 300)
|
||||
timeout -= 120;
|
||||
else if (timeout > 30)
|
||||
timeout -= 30;
|
||||
else
|
||||
timeout -= 15;
|
||||
}
|
||||
}
|
||||
|
||||
message = "Region is restarting in {0}. Please save what you are doing and log out.";
|
||||
|
||||
if (requestData.ContainsKey("message"))
|
||||
message = requestData["message"].ToString();
|
||||
|
||||
bool notice = true;
|
||||
if (requestData.ContainsKey("noticetype")
|
||||
&& ((string)requestData["noticetype"] == "dialog"))
|
||||
{
|
||||
notice = false;
|
||||
}
|
||||
|
||||
IRestartModule restartModule = rebootedScene.RequestModuleInterface<IRestartModule>();
|
||||
if (restartModule != null)
|
||||
{
|
||||
restartModule.ScheduleRestart(UUID.Zero, message, times.ToArray(), notice);
|
||||
List<int> times = new List<int> { 30, 15 };
|
||||
|
||||
restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true);
|
||||
responseData["success"] = true;
|
||||
}
|
||||
}
|
||||
@@ -365,32 +310,6 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
m_log.Info("[RADMIN]: Alert request complete");
|
||||
}
|
||||
|
||||
public void XmlRpcDialogMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
|
||||
{
|
||||
Hashtable responseData = (Hashtable)response.Value;
|
||||
|
||||
m_log.Info("[RADMIN]: Dialog request started");
|
||||
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
|
||||
string message = (string)requestData["message"];
|
||||
string fromuuid = (string)requestData["from"];
|
||||
m_log.InfoFormat("[RADMIN]: Broadcasting: {0}", message);
|
||||
|
||||
responseData["accepted"] = true;
|
||||
responseData["success"] = true;
|
||||
|
||||
m_application.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, fromuuid, message);
|
||||
});
|
||||
|
||||
m_log.Info("[RADMIN]: Dialog request complete");
|
||||
}
|
||||
|
||||
private void XmlRpcLoadHeightmapMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
|
||||
{
|
||||
m_log.Info("[RADMIN]: Load height maps request started");
|
||||
@@ -479,32 +398,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
message = "Region is going down now.";
|
||||
}
|
||||
|
||||
if (requestData.ContainsKey("noticetype")
|
||||
&& ((string) requestData["noticetype"] == "dialog"))
|
||||
{
|
||||
m_application.SceneManager.ForEachScene(
|
||||
|
||||
m_application.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendNotificationToUsersInRegion(UUID.Zero, "System", message);
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!requestData.ContainsKey("noticetype")
|
||||
|| ((string)requestData["noticetype"] != "none"))
|
||||
{
|
||||
m_application.SceneManager.ForEachScene(
|
||||
delegate(Scene scene)
|
||||
{
|
||||
IDialogModule dialogModule = scene.RequestModuleInterface<IDialogModule>();
|
||||
if (dialogModule != null)
|
||||
dialogModule.SendGeneralAlert(message);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Perform shutdown
|
||||
System.Timers.Timer shutdownTimer = new System.Timers.Timer(timeout); // Wait before firing
|
||||
@@ -1670,22 +1570,21 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
|
||||
private void XmlRpcRegionQueryMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
|
||||
{
|
||||
m_log.Info("[RADMIN]: Received Query XML Administrator Request");
|
||||
|
||||
Hashtable responseData = (Hashtable)response.Value;
|
||||
Hashtable requestData = (Hashtable)request.Params[0];
|
||||
|
||||
responseData["success"] = true;
|
||||
|
||||
CheckRegionParams(requestData, responseData);
|
||||
|
||||
Scene scene = null;
|
||||
GetSceneFromRegionParams(requestData, responseData, out scene);
|
||||
|
||||
int flags;
|
||||
string text;
|
||||
int health = scene.GetHealth(out flags, out text);
|
||||
int health = scene.GetHealth();
|
||||
responseData["health"] = health;
|
||||
responseData["flags"] = flags;
|
||||
responseData["message"] = text;
|
||||
|
||||
responseData["success"] = true;
|
||||
m_log.Info("[RADMIN]: Query XML Administrator Request complete");
|
||||
}
|
||||
|
||||
private void XmlRpcConsoleCommandMethod(XmlRpcRequest request, XmlRpcResponse response, IPEndPoint remoteClient)
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenSim.Data
|
||||
{
|
||||
public abstract AssetBase GetAsset(UUID uuid);
|
||||
|
||||
public abstract bool StoreAsset(AssetBase asset);
|
||||
public abstract void StoreAsset(AssetBase asset);
|
||||
public abstract bool ExistsAsset(UUID uuid);
|
||||
|
||||
public abstract List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenSim.Data
|
||||
public interface IAssetDataPlugin : IPlugin
|
||||
{
|
||||
AssetBase GetAsset(UUID uuid);
|
||||
bool StoreAsset(AssetBase asset);
|
||||
void StoreAsset(AssetBase asset);
|
||||
bool ExistsAsset(UUID uuid);
|
||||
List<AssetMetadata> FetchAssetMetadataSet(int start, int count);
|
||||
void Initialise(string connect);
|
||||
|
||||
@@ -50,6 +50,5 @@ namespace OpenSim.Data
|
||||
bool Store(UserAccountData data);
|
||||
bool Delete(string field, string val);
|
||||
UserAccountData[] GetUsers(UUID scopeID, string query);
|
||||
UserAccountData[] GetUsersWhere(UUID scopeID, string where);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenSim.Data.MSSQL
|
||||
/// Create asset in m_database
|
||||
/// </summary>
|
||||
/// <param name="asset">the asset</param>
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
{
|
||||
|
||||
string sql =
|
||||
@@ -192,12 +192,10 @@ namespace OpenSim.Data.MSSQL
|
||||
try
|
||||
{
|
||||
command.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
m_log.Error("[ASSET DB]: Error storing item :" + e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
|
||||
public class MSSQLAvatarData : MSSQLGenericTableHandler<AvatarBaseData>,
|
||||
IAvatarData
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MSSQLAvatarData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "Avatar")
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
public class MSSQLGenericTableHandler<T> where T : class, new()
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// private static readonly ILog m_log =
|
||||
// LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected string m_ConnectionString;
|
||||
protected MSSQLManager m_database; //used for parameter type translation
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
|
||||
public class MSSQLGridUserData : MSSQLGenericTableHandler<GridUserData>,
|
||||
IGridUserData
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MSSQLGridUserData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "GridUserStore")
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenSim.Data.MSSQL
|
||||
/// </summary>
|
||||
public class MSSQLManager
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Connection string for ADO.net
|
||||
@@ -180,8 +180,6 @@ namespace OpenSim.Data.MSSQL
|
||||
return parameter;
|
||||
}
|
||||
|
||||
private static readonly Dictionary<string, string> emptyDictionary = new Dictionary<string, string>();
|
||||
|
||||
/// <summary>
|
||||
/// Checks if we need to do some migrations to the database
|
||||
/// </summary>
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL
|
||||
public class MSSQLPresenceData : MSSQLGenericTableHandler<PresenceData>,
|
||||
IPresenceData
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
public MSSQLPresenceData(string connectionString, string realm) :
|
||||
base(connectionString, realm, "Presence")
|
||||
|
||||
@@ -242,10 +242,5 @@ namespace OpenSim.Data.MSSQL
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
public class MSSQLXInventoryData : IXInventoryData
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(
|
||||
// MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private MSSQLGenericTableHandler<XInventoryFolder> m_Folders;
|
||||
private MSSQLItemHandler m_Items;
|
||||
|
||||
@@ -235,4 +235,11 @@ CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
|
||||
regionName
|
||||
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
|
||||
COMMIT
|
||||
COMMIT
|
||||
|
||||
:VERSION 9
|
||||
|
||||
BEGIN TRANSACTION
|
||||
ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
|
||||
|
||||
COMMIT
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace OpenSim.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset UUID to create</param>
|
||||
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
@@ -203,14 +203,12 @@ namespace OpenSim.Data.MySQL
|
||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||
cmd.ExecuteNonQuery();
|
||||
cmd.Dispose();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,11 +173,6 @@ namespace OpenSim.Data.MySQL
|
||||
int v = Convert.ToInt32(reader[name]);
|
||||
m_Fields[name].SetValue(row, v);
|
||||
}
|
||||
else if (m_Fields[name].FieldType == typeof(uint))
|
||||
{
|
||||
uint v = Convert.ToUInt32(reader[name]);
|
||||
m_Fields[name].SetValue(row, v);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Fields[name].SetValue(row, reader[name]);
|
||||
@@ -299,4 +294,4 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace OpenSim.Data.MySQL
|
||||
Initialise(connectionString);
|
||||
}
|
||||
|
||||
public virtual void Initialise(string connectionString)
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
m_connectionString = connectionString;
|
||||
|
||||
@@ -113,7 +113,7 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
public void Dispose() {}
|
||||
|
||||
public virtual void StoreObject(SceneObjectGroup obj, UUID regionUUID)
|
||||
public void StoreObject(SceneObjectGroup obj, UUID regionUUID)
|
||||
{
|
||||
uint flags = obj.RootPart.GetEffectiveObjectFlags();
|
||||
|
||||
@@ -241,7 +241,7 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void RemoveObject(UUID obj, UUID regionUUID)
|
||||
public void RemoveObject(UUID obj, UUID regionUUID)
|
||||
{
|
||||
// m_log.DebugFormat("[REGION DB]: Deleting scene object {0} from {1} in database", obj, regionUUID);
|
||||
|
||||
@@ -390,7 +390,7 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual List<SceneObjectGroup> LoadObjects(UUID regionID)
|
||||
public List<SceneObjectGroup> LoadObjects(UUID regionID)
|
||||
{
|
||||
const int ROWS_PER_QUERY = 5000;
|
||||
|
||||
@@ -559,51 +559,36 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void StoreTerrain(double[,] ter, UUID regionID)
|
||||
public void StoreTerrain(double[,] ter, UUID regionID)
|
||||
{
|
||||
Util.FireAndForget(delegate(object x)
|
||||
m_log.Info("[REGION DB]: Storing terrain");
|
||||
|
||||
lock (m_dbLock)
|
||||
{
|
||||
double[,] oldTerrain = LoadTerrain(regionID);
|
||||
|
||||
m_log.Info("[REGION DB]: Storing terrain");
|
||||
|
||||
lock (m_dbLock)
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
dbcon.Open();
|
||||
cmd.CommandText = "delete from terrain where RegionUUID = ?RegionUUID";
|
||||
cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString());
|
||||
|
||||
using (MySqlCommand cmd = dbcon.CreateCommand())
|
||||
{
|
||||
cmd.CommandText = "delete from terrain where RegionUUID = ?RegionUUID";
|
||||
cmd.Parameters.AddWithValue("RegionUUID", regionID.ToString());
|
||||
ExecuteNonQuery(cmd);
|
||||
|
||||
using (MySqlCommand cmd2 = dbcon.CreateCommand())
|
||||
{
|
||||
try
|
||||
{
|
||||
cmd2.CommandText = "insert into terrain (RegionUUID, " +
|
||||
"Revision, Heightfield) values (?RegionUUID, " +
|
||||
"1, ?Heightfield)";
|
||||
cmd.CommandText = "insert into terrain (RegionUUID, " +
|
||||
"Revision, Heightfield) values (?RegionUUID, " +
|
||||
"1, ?Heightfield)";
|
||||
|
||||
cmd2.Parameters.AddWithValue("RegionUUID", regionID.ToString());
|
||||
cmd2.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter, oldTerrain));
|
||||
cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter));
|
||||
|
||||
ExecuteNonQuery(cmd);
|
||||
ExecuteNonQuery(cmd2);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
ExecuteNonQuery(cmd);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public virtual double[,] LoadTerrain(UUID regionID)
|
||||
public double[,] LoadTerrain(UUID regionID)
|
||||
{
|
||||
double[,] terrain = null;
|
||||
|
||||
@@ -653,7 +638,7 @@ namespace OpenSim.Data.MySQL
|
||||
return terrain;
|
||||
}
|
||||
|
||||
public virtual void RemoveLandObject(UUID globalID)
|
||||
public void RemoveLandObject(UUID globalID)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
@@ -672,7 +657,7 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void StoreLandObject(ILandObject parcel)
|
||||
public void StoreLandObject(ILandObject parcel)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
@@ -729,7 +714,7 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
|
||||
public RegionLightShareData LoadRegionWindlightSettings(UUID regionUUID)
|
||||
{
|
||||
RegionLightShareData nWP = new RegionLightShareData();
|
||||
nWP.OnSave += StoreRegionWindlightSettings;
|
||||
@@ -751,7 +736,7 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
//No result, so store our default windlight profile and return it
|
||||
nWP.regionID = regionUUID;
|
||||
// StoreRegionWindlightSettings(nWP);
|
||||
StoreRegionWindlightSettings(nWP);
|
||||
return nWP;
|
||||
}
|
||||
else
|
||||
@@ -826,7 +811,7 @@ namespace OpenSim.Data.MySQL
|
||||
return nWP;
|
||||
}
|
||||
|
||||
public virtual RegionSettings LoadRegionSettings(UUID regionUUID)
|
||||
public RegionSettings LoadRegionSettings(UUID regionUUID)
|
||||
{
|
||||
RegionSettings rs = null;
|
||||
|
||||
@@ -866,7 +851,7 @@ namespace OpenSim.Data.MySQL
|
||||
return rs;
|
||||
}
|
||||
|
||||
public virtual void StoreRegionWindlightSettings(RegionLightShareData wl)
|
||||
public void StoreRegionWindlightSettings(RegionLightShareData wl)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
@@ -969,7 +954,7 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void RemoveRegionWindlightSettings(UUID regionID)
|
||||
public void RemoveRegionWindlightSettings(UUID regionID)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
@@ -984,7 +969,7 @@ namespace OpenSim.Data.MySQL
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void StoreRegionSettings(RegionSettings rs)
|
||||
public void StoreRegionSettings(RegionSettings rs)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
@@ -1011,7 +996,7 @@ namespace OpenSim.Data.MySQL
|
||||
"use_estate_sun, fixed_sun, sun_position, " +
|
||||
"covenant, covenant_datetime, Sandbox, sunvectorx, sunvectory, " +
|
||||
"sunvectorz, loaded_creation_datetime, " +
|
||||
"loaded_creation_id, map_tile_ID, block_search, casino, " +
|
||||
"loaded_creation_id, map_tile_ID, " +
|
||||
"TelehubObject, parcel_tile_ID) " +
|
||||
"values (?RegionUUID, ?BlockTerraform, " +
|
||||
"?BlockFly, ?AllowDamage, ?RestrictPushing, " +
|
||||
@@ -1028,8 +1013,7 @@ namespace OpenSim.Data.MySQL
|
||||
"?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " +
|
||||
"?SunVectorX, ?SunVectorY, ?SunVectorZ, " +
|
||||
"?LoadedCreationDateTime, ?LoadedCreationID, " +
|
||||
"?TerrainImageID, ?block_search, ?casino, " +
|
||||
"?TelehubObject, ?ParcelImageID)";
|
||||
"?TerrainImageID, ?TelehubObject, ?ParcelImageID) ";
|
||||
|
||||
FillRegionSettingsCommand(cmd, rs);
|
||||
|
||||
@@ -1040,7 +1024,7 @@ namespace OpenSim.Data.MySQL
|
||||
SaveSpawnPoints(rs);
|
||||
}
|
||||
|
||||
public virtual List<LandData> LoadLandObjects(UUID regionUUID)
|
||||
public List<LandData> LoadLandObjects(UUID regionUUID)
|
||||
{
|
||||
List<LandData> landData = new List<LandData>();
|
||||
|
||||
@@ -1320,9 +1304,6 @@ namespace OpenSim.Data.MySQL
|
||||
newSettings.ParcelImageID = DBGuid.FromDB(row["parcel_tile_ID"]);
|
||||
newSettings.TelehubObject = DBGuid.FromDB(row["TelehubObject"]);
|
||||
|
||||
newSettings.GodBlockSearch = Convert.ToBoolean(row["block_search"]);
|
||||
newSettings.Casino = Convert.ToBoolean(row["casino"]);
|
||||
|
||||
return newSettings;
|
||||
}
|
||||
|
||||
@@ -1420,7 +1401,7 @@ namespace OpenSim.Data.MySQL
|
||||
/// </summary>
|
||||
/// <param name="val"></param>
|
||||
/// <returns></returns>
|
||||
private static Array SerializeTerrain(double[,] val, double[,] oldTerrain)
|
||||
private static Array SerializeTerrain(double[,] val)
|
||||
{
|
||||
MemoryStream str = new MemoryStream(((int)Constants.RegionSize * (int)Constants.RegionSize) *sizeof (double));
|
||||
BinaryWriter bw = new BinaryWriter(str);
|
||||
@@ -1429,11 +1410,7 @@ namespace OpenSim.Data.MySQL
|
||||
for (int x = 0; x < (int)Constants.RegionSize; x++)
|
||||
for (int y = 0; y < (int)Constants.RegionSize; y++)
|
||||
{
|
||||
double height = 20.0;
|
||||
if (oldTerrain != null)
|
||||
height = oldTerrain[x, y];
|
||||
if (!double.IsNaN(val[x, y]))
|
||||
height = val[x, y];
|
||||
double height = val[x, y];
|
||||
if (height == 0.0)
|
||||
height = double.Epsilon;
|
||||
|
||||
@@ -1657,9 +1634,6 @@ namespace OpenSim.Data.MySQL
|
||||
cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime);
|
||||
cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID);
|
||||
cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID);
|
||||
cmd.Parameters.AddWithValue("block_search", settings.GodBlockSearch);
|
||||
cmd.Parameters.AddWithValue("casino", settings.Casino);
|
||||
|
||||
cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID);
|
||||
cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject);
|
||||
}
|
||||
@@ -1820,7 +1794,7 @@ namespace OpenSim.Data.MySQL
|
||||
cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml());
|
||||
}
|
||||
|
||||
public virtual void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
|
||||
public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
|
||||
@@ -46,21 +46,17 @@ namespace OpenSim.Data.MySQL
|
||||
{
|
||||
string[] words = query.Split(new char[] {' '});
|
||||
|
||||
bool valid = false;
|
||||
|
||||
for (int i = 0 ; i < words.Length ; i++)
|
||||
{
|
||||
if (words[i].Length > 2)
|
||||
valid = true;
|
||||
// if (words[i].Length < 3)
|
||||
// {
|
||||
// if (i != words.Length - 1)
|
||||
// Array.Copy(words, i + 1, words, i, words.Length - i - 1);
|
||||
// Array.Resize(ref words, words.Length - 1);
|
||||
// }
|
||||
if (words[i].Length < 3)
|
||||
{
|
||||
if (i != words.Length - 1)
|
||||
Array.Copy(words, i + 1, words, i, words.Length - i - 1);
|
||||
Array.Resize(ref words, words.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
if ((!valid) || words.Length == 0)
|
||||
if (words.Length == 0)
|
||||
return new UserAccountData[0];
|
||||
|
||||
if (words.Length > 2)
|
||||
@@ -70,34 +66,19 @@ namespace OpenSim.Data.MySQL
|
||||
|
||||
if (words.Length == 1)
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?search or LastName like ?search) and active=1", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?search", words[0] + "%");
|
||||
cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?search or LastName like ?search)", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?search", "%" + words[0] + "%");
|
||||
cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst and LastName like ?searchLast) and active=1", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?searchFirst", words[0] + "%");
|
||||
cmd.Parameters.AddWithValue("?searchLast", words[1] + "%");
|
||||
cmd.CommandText = String.Format("select * from {0} where (ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (FirstName like ?searchFirst or LastName like ?searchLast)", m_Realm);
|
||||
cmd.Parameters.AddWithValue("?searchFirst", "%" + words[0] + "%");
|
||||
cmd.Parameters.AddWithValue("?searchLast", "%" + words[1] + "%");
|
||||
cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
|
||||
}
|
||||
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
|
||||
public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
|
||||
{
|
||||
MySqlCommand cmd = new MySqlCommand();
|
||||
|
||||
if (scopeID != UUID.Zero)
|
||||
{
|
||||
where = "(ScopeID=?ScopeID or ScopeID='00000000-0000-0000-0000-000000000000') and (" + where + ")";
|
||||
cmd.Parameters.AddWithValue("?ScopeID", scopeID.ToString());
|
||||
}
|
||||
|
||||
cmd.CommandText = String.Format("select * from {0} where " + where, m_Realm);
|
||||
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -717,7 +717,7 @@ ALTER TABLE regionsettings ADD COLUMN loaded_creation_datetime int unsigned NOT
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 32 #---------------------
|
||||
:VERSION 32
|
||||
|
||||
BEGIN;
|
||||
CREATE TABLE `regionwindlight` (
|
||||
@@ -883,3 +883,4 @@ ALTER TABLE `regionsettings` MODIFY COLUMN `TelehubObject` VARCHAR(36) NOT NULL
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
|
||||
@@ -193,10 +193,5 @@ namespace OpenSim.Data.Null
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,3 +472,95 @@ COMMIT;
|
||||
BEGIN;
|
||||
ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 23
|
||||
BEGIN;
|
||||
CREATE TABLE regionwindlight (
|
||||
region_id VARCHAR(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
|
||||
water_color_r FLOAT NOT NULL DEFAULT '4.000000',
|
||||
water_color_g FLOAT NOT NULL DEFAULT '38.000000',
|
||||
water_color_b FLOAT NOT NULL DEFAULT '64.000000',
|
||||
water_color_i FLOAT NOT NULL DEFAULT '1.000000',
|
||||
water_fog_density_exponent FLOAT NOT NULL DEFAULT '4.0',
|
||||
underwater_fog_modifier FLOAT NOT NULL DEFAULT '0.25',
|
||||
reflection_wavelet_scale_1 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_2 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_3 FLOAT NOT NULL DEFAULT '2.0',
|
||||
fresnel_scale FLOAT NOT NULL DEFAULT '0.40',
|
||||
fresnel_offset FLOAT NOT NULL DEFAULT '0.50',
|
||||
refract_scale_above FLOAT NOT NULL DEFAULT '0.03',
|
||||
refract_scale_below FLOAT NOT NULL DEFAULT '0.20',
|
||||
blur_multiplier FLOAT NOT NULL DEFAULT '0.040',
|
||||
big_wave_direction_x FLOAT NOT NULL DEFAULT '1.05',
|
||||
big_wave_direction_y FLOAT NOT NULL DEFAULT '-0.42',
|
||||
little_wave_direction_x FLOAT NOT NULL DEFAULT '1.11',
|
||||
little_wave_direction_y FLOAT NOT NULL DEFAULT '-1.16',
|
||||
normal_map_texture VARCHAR(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
|
||||
horizon_r FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_g FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_b FLOAT NOT NULL DEFAULT '0.32',
|
||||
horizon_i FLOAT NOT NULL DEFAULT '0.32',
|
||||
haze_horizon FLOAT NOT NULL DEFAULT '0.19',
|
||||
blue_density_r FLOAT NOT NULL DEFAULT '0.12',
|
||||
blue_density_g FLOAT NOT NULL DEFAULT '0.22',
|
||||
blue_density_b FLOAT NOT NULL DEFAULT '0.38',
|
||||
blue_density_i FLOAT NOT NULL DEFAULT '0.38',
|
||||
haze_density FLOAT NOT NULL DEFAULT '0.70',
|
||||
density_multiplier FLOAT NOT NULL DEFAULT '0.18',
|
||||
distance_multiplier FLOAT NOT NULL DEFAULT '0.8',
|
||||
max_altitude INTEGER NOT NULL DEFAULT '1605',
|
||||
sun_moon_color_r FLOAT NOT NULL DEFAULT '0.24',
|
||||
sun_moon_color_g FLOAT NOT NULL DEFAULT '0.26',
|
||||
sun_moon_color_b FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_color_i FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_position FLOAT NOT NULL DEFAULT '0.317',
|
||||
ambient_r FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_g FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_b FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_i FLOAT NOT NULL DEFAULT '0.35',
|
||||
east_angle FLOAT NOT NULL DEFAULT '0.00',
|
||||
sun_glow_focus FLOAT NOT NULL DEFAULT '0.10',
|
||||
sun_glow_size FLOAT NOT NULL DEFAULT '1.75',
|
||||
scene_gamma FLOAT NOT NULL DEFAULT '1.00',
|
||||
star_brightness FLOAT NOT NULL DEFAULT '0.00',
|
||||
cloud_color_r FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_g FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_b FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_i FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_density FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_coverage FLOAT NOT NULL DEFAULT '0.27',
|
||||
cloud_scale FLOAT NOT NULL DEFAULT '0.42',
|
||||
cloud_detail_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_detail_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_detail_density FLOAT NOT NULL DEFAULT '0.12',
|
||||
cloud_scroll_x FLOAT NOT NULL DEFAULT '0.20',
|
||||
cloud_scroll_x_lock INTEGER NOT NULL DEFAULT '0',
|
||||
cloud_scroll_y FLOAT NOT NULL DEFAULT '0.01',
|
||||
cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
|
||||
draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
:VERSION 24
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `spawn_points` (
|
||||
`RegionID` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
|
||||
`Yaw` float NOT NULL,
|
||||
`Pitch` float NOT NULL,
|
||||
`Distance` float NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 25
|
||||
|
||||
BEGIN;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
COMMIT;
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace OpenSim.Data.SQLite
|
||||
/// Create an asset
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset Base</param>
|
||||
override public bool StoreAsset(AssetBase asset)
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
{
|
||||
//m_log.Info("[ASSET DB]: Creating Asset " + asset.FullID.ToString());
|
||||
if (ExistsAsset(asset.FullID))
|
||||
@@ -150,7 +150,6 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,7 +170,6 @@ namespace OpenSim.Data.SQLite
|
||||
cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data));
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -81,10 +81,5 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
|
||||
public UserAccountData[] GetUsersWhere(UUID scopeID, string where)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,8 +60,6 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
private AssetMetadata m_metadata;
|
||||
|
||||
private int m_uploadAttempts;
|
||||
|
||||
// This is needed for .NET serialization!!!
|
||||
// Do NOT "Optimize" away!
|
||||
public AssetBase()
|
||||
@@ -200,12 +198,6 @@ namespace OpenSim.Framework
|
||||
set { m_metadata.Type = value; }
|
||||
}
|
||||
|
||||
public int UploadAttempts
|
||||
{
|
||||
get { return m_uploadAttempts; }
|
||||
set { m_uploadAttempts = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is this a region only asset, or does this exist on the asset server also
|
||||
/// </summary>
|
||||
|
||||
@@ -240,21 +240,6 @@ namespace OpenSim.Framework
|
||||
// }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Invalidate all of the baked textures in the appearance, useful
|
||||
/// if you know that none are valid
|
||||
/// </summary>
|
||||
public virtual void ResetBakedTextures()
|
||||
{
|
||||
SetDefaultTexture();
|
||||
|
||||
//for (int i = 0; i < BAKE_INDICES.Length; i++)
|
||||
// {
|
||||
// int idx = BAKE_INDICES[i];
|
||||
// m_texture.FaceTextures[idx].TextureID = UUID.Zero;
|
||||
// }
|
||||
}
|
||||
|
||||
protected virtual void SetDefaultTexture()
|
||||
{
|
||||
m_texture = new Primitive.TextureEntry(new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
|
||||
@@ -405,18 +390,19 @@ namespace OpenSim.Framework
|
||||
/// </remarks>
|
||||
public List<AvatarAttachment> GetAttachments()
|
||||
{
|
||||
|
||||
List<AvatarAttachment> alist = new List<AvatarAttachment>();
|
||||
|
||||
lock (m_attachments)
|
||||
{
|
||||
List<AvatarAttachment> alist = new List<AvatarAttachment>();
|
||||
foreach (KeyValuePair<int, List<AvatarAttachment>> kvp in m_attachments)
|
||||
{
|
||||
foreach (AvatarAttachment attach in kvp.Value)
|
||||
alist.Add(new AvatarAttachment(attach));
|
||||
}
|
||||
return alist;
|
||||
} }
|
||||
}
|
||||
|
||||
return alist;
|
||||
}
|
||||
|
||||
internal void AppendAttachment(AvatarAttachment attach)
|
||||
{
|
||||
@@ -545,6 +531,7 @@ namespace OpenSim.Framework
|
||||
return kvp.Key;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -611,14 +598,12 @@ namespace OpenSim.Framework
|
||||
OSDBinary visualparams = new OSDBinary(m_visualparams);
|
||||
data["visualparams"] = visualparams;
|
||||
|
||||
lock (m_attachments)
|
||||
{
|
||||
// Attachments
|
||||
OSDArray attachs = new OSDArray(m_attachments.Count);
|
||||
foreach (AvatarAttachment attach in GetAttachments())
|
||||
attachs.Add(attach.Pack());
|
||||
data["attachments"] = attachs;
|
||||
}
|
||||
// Attachments
|
||||
List<AvatarAttachment> attachments = GetAttachments();
|
||||
OSDArray attachs = new OSDArray(attachments.Count);
|
||||
foreach (AvatarAttachment attach in GetAttachments())
|
||||
attachs.Add(attach.Pack());
|
||||
data["attachments"] = attachs;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace OpenSim.Framework.Communications
|
||||
_request = (HttpWebRequest) WebRequest.Create(buildUri());
|
||||
_request.KeepAlive = false;
|
||||
_request.ContentType = "application/xml";
|
||||
_request.Timeout = 30000;
|
||||
_request.Timeout = 900000;
|
||||
_request.Method = RequestMethod;
|
||||
_asyncException = null;
|
||||
_request.ContentLength = src.Length;
|
||||
|
||||
@@ -58,30 +58,6 @@ namespace OpenSim.Framework
|
||||
set { m_EstateName = value; }
|
||||
}
|
||||
|
||||
private bool m_AllowLandmark = true;
|
||||
|
||||
public bool AllowLandmark
|
||||
{
|
||||
get { return m_AllowLandmark; }
|
||||
set { m_AllowLandmark = value; }
|
||||
}
|
||||
|
||||
private bool m_AllowParcelChanges = true;
|
||||
|
||||
public bool AllowParcelChanges
|
||||
{
|
||||
get { return m_AllowParcelChanges; }
|
||||
set { m_AllowParcelChanges = value; }
|
||||
}
|
||||
|
||||
private bool m_AllowSetHome = true;
|
||||
|
||||
public bool AllowSetHome
|
||||
{
|
||||
get { return m_AllowSetHome; }
|
||||
set { m_AllowSetHome = value; }
|
||||
}
|
||||
|
||||
private uint m_ParentEstateID = 1;
|
||||
|
||||
public uint ParentEstateID
|
||||
@@ -362,30 +338,11 @@ namespace OpenSim.Framework
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsBanned(UUID avatarID, int userFlags)
|
||||
public bool IsBanned(UUID avatarID)
|
||||
{
|
||||
foreach (EstateBan ban in l_EstateBans)
|
||||
if (ban.BannedUserID == avatarID)
|
||||
return true;
|
||||
|
||||
if (!IsEstateManager(avatarID) && !HasAccess(avatarID))
|
||||
{
|
||||
if (DenyMinors)
|
||||
{
|
||||
if ((userFlags & 32) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (DenyAnonymous)
|
||||
{
|
||||
if ((userFlags & 4) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -393,7 +350,7 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (ban == null)
|
||||
return;
|
||||
if (!IsBanned(ban.BannedUserID, 32)) //Ignore age-based bans
|
||||
if (!IsBanned(ban.BannedUserID))
|
||||
l_EstateBans.Add(ban);
|
||||
}
|
||||
|
||||
@@ -417,15 +374,6 @@ namespace OpenSim.Framework
|
||||
return l_EstateAccess.Contains(user);
|
||||
}
|
||||
|
||||
public void SetFromFlags(ulong regionFlags)
|
||||
{
|
||||
ResetHomeOnTeleport = ((regionFlags & (ulong)RegionFlags.ResetHomeOnTeleport) == (ulong)RegionFlags.ResetHomeOnTeleport);
|
||||
BlockDwell = ((regionFlags & (ulong)RegionFlags.BlockDwell) == (ulong)RegionFlags.BlockDwell);
|
||||
AllowLandmark = ((regionFlags & (ulong)RegionFlags.AllowLandmark) == (ulong)RegionFlags.AllowLandmark);
|
||||
AllowParcelChanges = ((regionFlags & (ulong)RegionFlags.AllowParcelChanges) == (ulong)RegionFlags.AllowParcelChanges);
|
||||
AllowSetHome = ((regionFlags & (ulong)RegionFlags.AllowSetHome) == (ulong)RegionFlags.AllowSetHome);
|
||||
}
|
||||
|
||||
public bool GroupAccess(UUID groupID)
|
||||
{
|
||||
return l_EstateGroups.Contains(groupID);
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
public interface ICallingCardModule
|
||||
{
|
||||
UUID CreateCallingCard(UUID userID, UUID creatorID, UUID folderID);
|
||||
}
|
||||
}
|
||||
@@ -266,9 +266,6 @@ namespace OpenSim.Framework
|
||||
public delegate void MoveInventoryItem(
|
||||
IClientAPI remoteClient, List<InventoryItemBase> items);
|
||||
|
||||
public delegate void MoveItemsAndLeaveCopy(
|
||||
IClientAPI remoteClient, List<InventoryItemBase> items, UUID destFolder);
|
||||
|
||||
public delegate void RemoveInventoryItem(
|
||||
IClientAPI remoteClient, List<UUID> itemIDs);
|
||||
|
||||
@@ -444,7 +441,6 @@ namespace OpenSim.Framework
|
||||
public delegate void ClassifiedInfoRequest(UUID classifiedID, IClientAPI client);
|
||||
public delegate void ClassifiedInfoUpdate(UUID classifiedID, uint category, string name, string description, UUID parcelID, uint parentEstate, UUID snapshotID, Vector3 globalPos, byte classifiedFlags, int price, IClientAPI client);
|
||||
public delegate void ClassifiedDelete(UUID classifiedID, IClientAPI client);
|
||||
public delegate void ClassifiedGodDelete(UUID classifiedID, UUID queryID, IClientAPI client);
|
||||
|
||||
public delegate void EventNotificationAddRequest(uint EventID, IClientAPI client);
|
||||
public delegate void EventNotificationRemoveRequest(uint EventID, IClientAPI client);
|
||||
@@ -467,9 +463,9 @@ namespace OpenSim.Framework
|
||||
|
||||
public delegate void AgentFOV(IClientAPI client, float verticalAngle);
|
||||
|
||||
public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int type, uint flags);
|
||||
public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int Flags,UUID AgentID);
|
||||
|
||||
public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name);
|
||||
public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name, UUID AgentID);
|
||||
|
||||
public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages);
|
||||
|
||||
@@ -507,7 +503,6 @@ namespace OpenSim.Framework
|
||||
public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID);
|
||||
|
||||
public delegate void SendPostcard(IClientAPI client);
|
||||
public delegate void ChangeInventoryItemFlags(IClientAPI client, UUID itemID, uint flags);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -862,7 +857,6 @@ namespace OpenSim.Framework
|
||||
event RequestTaskInventory OnRequestTaskInventory;
|
||||
event UpdateInventoryItem OnUpdateInventoryItem;
|
||||
event CopyInventoryItem OnCopyInventoryItem;
|
||||
event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
event MoveInventoryItem OnMoveInventoryItem;
|
||||
event RemoveInventoryFolder OnRemoveInventoryFolder;
|
||||
event RemoveInventoryItem OnRemoveInventoryItem;
|
||||
@@ -981,7 +975,7 @@ namespace OpenSim.Framework
|
||||
event ClassifiedInfoRequest OnClassifiedInfoRequest;
|
||||
event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
|
||||
event ClassifiedDelete OnClassifiedDelete;
|
||||
event ClassifiedGodDelete OnClassifiedGodDelete;
|
||||
event ClassifiedDelete OnClassifiedGodDelete;
|
||||
|
||||
event EventNotificationAddRequest OnEventNotificationAddRequest;
|
||||
event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
|
||||
@@ -1020,7 +1014,6 @@ namespace OpenSim.Framework
|
||||
event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
|
||||
event SimWideDeletesDelegate OnSimWideDeletes;
|
||||
event SendPostcard OnSendPostcard;
|
||||
event ChangeInventoryItemFlags OnChangeInventoryItemFlags;
|
||||
event MuteListEntryUpdate OnUpdateMuteListEntry;
|
||||
event MuteListEntryRemove OnRemoveMuteListEntry;
|
||||
event GodlikeMessage onGodlikeMessage;
|
||||
@@ -1034,7 +1027,6 @@ namespace OpenSim.Framework
|
||||
void InPacket(object NewPack);
|
||||
void ProcessInPacket(Packet NewPack);
|
||||
void Close();
|
||||
void Close(bool sendStop);
|
||||
void Kick(string message);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -40,7 +40,6 @@ namespace OpenSim.Framework
|
||||
bool AmountCovered(UUID agentID, int amount);
|
||||
void ApplyCharge(UUID agentID, int amount, string text);
|
||||
void ApplyUploadCharge(UUID agentID, int amount, string text);
|
||||
void MoveMoney(UUID fromUser, UUID toUser, int amount, string text);
|
||||
|
||||
int UploadCharge { get; }
|
||||
int GroupCreationCharge { get; }
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenSim.Framework
|
||||
|
||||
private uint _flags = (uint) ParcelFlags.AllowFly | (uint) ParcelFlags.AllowLandmark |
|
||||
(uint) ParcelFlags.AllowAPrimitiveEntry |
|
||||
(uint) ParcelFlags.AllowDeedToGroup |
|
||||
(uint) ParcelFlags.AllowDeedToGroup | (uint) ParcelFlags.AllowTerraform |
|
||||
(uint) ParcelFlags.CreateObjects | (uint) ParcelFlags.AllowOtherScripts |
|
||||
(uint) ParcelFlags.SoundLocal;
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
public enum ParcelMediaCommandEnum : int
|
||||
public enum ParcelMediaCommandEnum
|
||||
{
|
||||
Stop = 0,
|
||||
Pause = 1,
|
||||
|
||||
@@ -244,22 +244,13 @@ namespace OpenSim.Framework
|
||||
// The Mono addin manager (in Mono.Addins.dll version 0.2.0.0)
|
||||
// occasionally seems to corrupt its addin cache
|
||||
// Hence, as a temporary solution we'll remove it before each startup
|
||||
|
||||
string customDir = Environment.GetEnvironmentVariable ("MONO_ADDINS_REGISTRY");
|
||||
string v0 = "addin-db-000";
|
||||
string v1 = "addin-db-001";
|
||||
if (customDir != null && customDir != String.Empty)
|
||||
{
|
||||
v0 = Path.Combine(customDir, v0);
|
||||
v1 = Path.Combine(customDir, v1);
|
||||
}
|
||||
try
|
||||
{
|
||||
if (Directory.Exists(v0))
|
||||
Directory.Delete(v0, true);
|
||||
if (Directory.Exists("addin-db-000"))
|
||||
Directory.Delete("addin-db-000", true);
|
||||
|
||||
if (Directory.Exists(v1))
|
||||
Directory.Delete(v1, true);
|
||||
if (Directory.Exists("addin-db-001"))
|
||||
Directory.Delete("addin-db-001", true);
|
||||
}
|
||||
catch (IOException)
|
||||
{
|
||||
|
||||
@@ -720,12 +720,7 @@ namespace OpenSim.Framework
|
||||
return _lightColorR;
|
||||
}
|
||||
set {
|
||||
if (value < 0)
|
||||
_lightColorR = 0;
|
||||
else if (value > 1.0f)
|
||||
_lightColorR = 1.0f;
|
||||
else
|
||||
_lightColorR = value;
|
||||
_lightColorR = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,12 +729,7 @@ namespace OpenSim.Framework
|
||||
return _lightColorG;
|
||||
}
|
||||
set {
|
||||
if (value < 0)
|
||||
_lightColorG = 0;
|
||||
else if (value > 1.0f)
|
||||
_lightColorG = 1.0f;
|
||||
else
|
||||
_lightColorG = value;
|
||||
_lightColorG = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -748,12 +738,7 @@ namespace OpenSim.Framework
|
||||
return _lightColorB;
|
||||
}
|
||||
set {
|
||||
if (value < 0)
|
||||
_lightColorB = 0;
|
||||
else if (value > 1.0f)
|
||||
_lightColorB = 1.0f;
|
||||
else
|
||||
_lightColorB = value;
|
||||
_lightColorB = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,12 +747,7 @@ namespace OpenSim.Framework
|
||||
return _lightColorA;
|
||||
}
|
||||
set {
|
||||
if (value < 0)
|
||||
_lightColorA = 0;
|
||||
else if (value > 1.0f)
|
||||
_lightColorA = 1.0f;
|
||||
else
|
||||
_lightColorA = value;
|
||||
_lightColorA = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1430,7 +1410,7 @@ namespace OpenSim.Framework
|
||||
prim.Textures = this.Textures;
|
||||
|
||||
prim.Properties = new Primitive.ObjectProperties();
|
||||
prim.Properties.Name = "Object";
|
||||
prim.Properties.Name = "Primitive";
|
||||
prim.Properties.Description = "";
|
||||
prim.Properties.CreatorID = UUID.Zero;
|
||||
prim.Properties.GroupID = UUID.Zero;
|
||||
|
||||
@@ -40,7 +40,6 @@ using OpenMetaverse.StructuredData;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
{
|
||||
[Serializable]
|
||||
public class RegionLightShareData : ICloneable
|
||||
{
|
||||
public bool valid = false;
|
||||
@@ -103,7 +102,6 @@ namespace OpenSim.Framework
|
||||
|
||||
public bool commFailTF = false;
|
||||
public ConfigurationMember configMember;
|
||||
public string DataStore = String.Empty;
|
||||
public string RegionFile = String.Empty;
|
||||
public bool isSandbox = false;
|
||||
public bool Persistent = true;
|
||||
@@ -645,9 +643,6 @@ namespace OpenSim.Framework
|
||||
string location = String.Format("{0},{1}", m_regionLocX, m_regionLocY);
|
||||
config.Set("Location", location);
|
||||
|
||||
if (DataStore != String.Empty)
|
||||
config.Set("Datastore", DataStore);
|
||||
|
||||
config.Set("InternalAddress", m_internalEndPoint.Address.ToString());
|
||||
config.Set("InternalPort", m_internalEndPoint.Port);
|
||||
|
||||
@@ -833,9 +828,6 @@ namespace OpenSim.Framework
|
||||
case "sim_location_y":
|
||||
m_regionLocY = (uint) configuration_result;
|
||||
break;
|
||||
case "datastore":
|
||||
DataStore = (string) configuration_result;
|
||||
break;
|
||||
case "internal_ip_address":
|
||||
IPAddress address = (IPAddress) configuration_result;
|
||||
m_internalEndPoint = new IPEndPoint(address, 0);
|
||||
@@ -986,11 +978,6 @@ namespace OpenSim.Framework
|
||||
return regionInfo;
|
||||
}
|
||||
|
||||
public int getInternalEndPointPort()
|
||||
{
|
||||
return m_internalEndPoint.Port;
|
||||
}
|
||||
|
||||
public Dictionary<string, object> ToKeyValuePairs()
|
||||
{
|
||||
Dictionary<string, object> kvp = new Dictionary<string, object>();
|
||||
@@ -1009,4 +996,4 @@ namespace OpenSim.Framework
|
||||
return kvp;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -48,9 +48,6 @@ namespace OpenSim.Framework.RegionLoader.Web
|
||||
|
||||
public RegionInfo[] LoadRegions()
|
||||
{
|
||||
int tries = 3;
|
||||
int wait = 2000;
|
||||
|
||||
if (m_configSource == null)
|
||||
{
|
||||
m_log.Error("[WEBLOADER]: Unable to load configuration source!");
|
||||
@@ -69,72 +66,63 @@ namespace OpenSim.Framework.RegionLoader.Web
|
||||
}
|
||||
else
|
||||
{
|
||||
while(tries > 0)
|
||||
{
|
||||
RegionInfo[] regionInfos = new RegionInfo[] {};
|
||||
int regionCount = 0;
|
||||
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
|
||||
webRequest.Timeout = 30000; //30 Second Timeout
|
||||
m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url);
|
||||
RegionInfo[] regionInfos = new RegionInfo[] {};
|
||||
int regionCount = 0;
|
||||
HttpWebRequest webRequest = (HttpWebRequest) WebRequest.Create(url);
|
||||
webRequest.Timeout = 30000; //30 Second Timeout
|
||||
m_log.DebugFormat("[WEBLOADER]: Sending download request to {0}", url);
|
||||
|
||||
try
|
||||
{
|
||||
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
|
||||
m_log.Debug("[WEBLOADER]: Downloading region information...");
|
||||
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
|
||||
string xmlSource = String.Empty;
|
||||
string tempStr = reader.ReadLine();
|
||||
while (tempStr != null)
|
||||
{
|
||||
xmlSource = xmlSource + tempStr;
|
||||
tempStr = reader.ReadLine();
|
||||
}
|
||||
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
|
||||
xmlSource.Length);
|
||||
XmlDocument xmlDoc = new XmlDocument();
|
||||
xmlDoc.LoadXml(xmlSource);
|
||||
if (xmlDoc.FirstChild.Name == "Regions")
|
||||
{
|
||||
regionCount = xmlDoc.FirstChild.ChildNodes.Count;
|
||||
|
||||
if (regionCount > 0)
|
||||
{
|
||||
regionInfos = new RegionInfo[regionCount];
|
||||
int i;
|
||||
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
|
||||
{
|
||||
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
|
||||
regionInfos[i] =
|
||||
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound)
|
||||
{
|
||||
if (!allowRegionless)
|
||||
throw ex;
|
||||
}
|
||||
else
|
||||
throw ex;
|
||||
}
|
||||
|
||||
if (regionCount > 0 | allowRegionless)
|
||||
return regionInfos;
|
||||
|
||||
m_log.Debug("[WEBLOADER]: Request yielded no regions.");
|
||||
tries--;
|
||||
if (tries > 0)
|
||||
try
|
||||
{
|
||||
HttpWebResponse webResponse = (HttpWebResponse) webRequest.GetResponse();
|
||||
m_log.Debug("[WEBLOADER]: Downloading region information...");
|
||||
StreamReader reader = new StreamReader(webResponse.GetResponseStream());
|
||||
string xmlSource = String.Empty;
|
||||
string tempStr = reader.ReadLine();
|
||||
while (tempStr != null)
|
||||
{
|
||||
m_log.Debug("[WEBLOADER]: Retrying");
|
||||
System.Threading.Thread.Sleep(wait);
|
||||
xmlSource = xmlSource + tempStr;
|
||||
tempStr = reader.ReadLine();
|
||||
}
|
||||
}
|
||||
m_log.Debug("[WEBLOADER]: Done downloading region information from server. Total Bytes: " +
|
||||
xmlSource.Length);
|
||||
XmlDocument xmlDoc = new XmlDocument();
|
||||
xmlDoc.LoadXml(xmlSource);
|
||||
if (xmlDoc.FirstChild.Name == "Regions")
|
||||
{
|
||||
regionCount = xmlDoc.FirstChild.ChildNodes.Count;
|
||||
|
||||
if (regionCount > 0)
|
||||
{
|
||||
regionInfos = new RegionInfo[regionCount];
|
||||
int i;
|
||||
for (i = 0; i < xmlDoc.FirstChild.ChildNodes.Count; i++)
|
||||
{
|
||||
m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml);
|
||||
regionInfos[i] =
|
||||
new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (WebException ex)
|
||||
{
|
||||
if (((HttpWebResponse)ex.Response).StatusCode == HttpStatusCode.NotFound)
|
||||
{
|
||||
if (!allowRegionless)
|
||||
throw ex;
|
||||
}
|
||||
else
|
||||
throw ex;
|
||||
}
|
||||
|
||||
m_log.Error("[WEBLOADER]: No region configs were available.");
|
||||
return null;
|
||||
if (regionCount > 0 | allowRegionless)
|
||||
return regionInfos;
|
||||
else
|
||||
{
|
||||
m_log.Error("[WEBLOADER]: No region configs were available.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,28 +455,6 @@ namespace OpenSim.Framework
|
||||
set { m_LoadedCreationID = value; }
|
||||
}
|
||||
|
||||
private bool m_GodBlockSearch = false;
|
||||
public bool GodBlockSearch
|
||||
{
|
||||
get { return m_GodBlockSearch; }
|
||||
set { m_GodBlockSearch = value; }
|
||||
}
|
||||
|
||||
private bool m_Casino = false;
|
||||
public bool Casino
|
||||
{
|
||||
get { return m_Casino; }
|
||||
set { m_Casino = value; }
|
||||
}
|
||||
|
||||
// Telehub support
|
||||
private bool m_TelehubEnabled = false;
|
||||
public bool HasTelehub
|
||||
{
|
||||
get { return m_TelehubEnabled; }
|
||||
set { m_TelehubEnabled = value; }
|
||||
}
|
||||
|
||||
// Connected Telehub object
|
||||
private UUID m_TelehubObject;
|
||||
public UUID TelehubObject
|
||||
|
||||
@@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="nodeToFill"></param>
|
||||
/// <param name="processors">/param>
|
||||
/// <param name="xtr"></param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
|
||||
{
|
||||
ExecuteReadProcessors(
|
||||
return ExecuteReadProcessors(
|
||||
nodeToFill,
|
||||
processors,
|
||||
xtr,
|
||||
(o, name, e)
|
||||
=> m_log.ErrorFormat(
|
||||
=> m_log.DebugFormat(
|
||||
"[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
|
||||
name, e.Message, e.StackTrace));
|
||||
}
|
||||
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="parseExceptionAction">
|
||||
/// Action to take if there is a parsing problem. This will usually just be to log the exception
|
||||
/// </param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill,
|
||||
Dictionary<string, Action<NodeType, XmlTextReader>> processors,
|
||||
XmlTextReader xtr,
|
||||
Action<NodeType, string, Exception> parseExceptionAction)
|
||||
{
|
||||
bool errors = false;
|
||||
|
||||
string nodeName = string.Empty;
|
||||
while (xtr.NodeType != XmlNodeType.EndElement)
|
||||
{
|
||||
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errors = true;
|
||||
parseExceptionAction(nodeToFill, nodeName, e);
|
||||
|
||||
if (xtr.NodeType == XmlNodeType.EndElement)
|
||||
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
|
||||
xtr.ReadOuterXml(); // ignore
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
UUID.TryParse(node.InnerText, out uuid);
|
||||
creator = userService.GetUserAccount(scopeID, uuid);
|
||||
}
|
||||
|
||||
if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
|
||||
hasCreatorData = true;
|
||||
|
||||
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
|
||||
doc.Save(wr);
|
||||
return wr.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -304,11 +304,13 @@ namespace OpenSim.Framework.Servers
|
||||
|
||||
EnhanceVersionInformation();
|
||||
|
||||
m_log.Info("[STARTUP]: Careminster version: " + m_version + Environment.NewLine);
|
||||
m_log.Info("[STARTUP]: OpenSimulator version: " + m_version + Environment.NewLine);
|
||||
// clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
|
||||
// the clr version number doesn't match the project version number under Mono.
|
||||
//m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
|
||||
m_log.Info("[STARTUP]: Operating system version: " + Environment.OSVersion + Environment.NewLine);
|
||||
m_log.InfoFormat(
|
||||
"[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
|
||||
Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
|
||||
|
||||
StartupSpecific();
|
||||
|
||||
|
||||
@@ -1539,34 +1539,11 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
|
||||
internal void DoHTTPGruntWork(Hashtable responsedata, OSHttpResponse response)
|
||||
{
|
||||
int responsecode;
|
||||
string responseString;
|
||||
string contentType;
|
||||
//m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response");
|
||||
int responsecode = (int)responsedata["int_response_code"];
|
||||
string responseString = (string)responsedata["str_response_string"];
|
||||
string contentType = (string)responsedata["content_type"];
|
||||
|
||||
if (responsedata == null)
|
||||
{
|
||||
responsecode = 500;
|
||||
responseString = "No response could be obtained";
|
||||
contentType = "text/plain";
|
||||
responsedata = new Hashtable();
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
//m_log.Info("[BASE HTTP SERVER]: Doing HTTP Grunt work with response");
|
||||
responsecode = (int)responsedata["int_response_code"];
|
||||
responseString = (string)responsedata["str_response_string"];
|
||||
contentType = (string)responsedata["content_type"];
|
||||
}
|
||||
catch
|
||||
{
|
||||
responsecode = 500;
|
||||
responseString = "No response could be obtained";
|
||||
contentType = "text/plain";
|
||||
responsedata = new Hashtable();
|
||||
}
|
||||
}
|
||||
|
||||
if (responsedata.ContainsKey("error_status_text"))
|
||||
{
|
||||
|
||||
@@ -29,11 +29,11 @@ namespace OpenSim
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7.3CM";
|
||||
private const string VERSION_NUMBER = "0.7.3";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
|
||||
public enum Flavour
|
||||
{
|
||||
{
|
||||
Unknown,
|
||||
Dev,
|
||||
RC1,
|
||||
@@ -49,7 +49,7 @@ namespace OpenSim
|
||||
|
||||
public static string GetVersionString(string versionNumber, Flavour flavour)
|
||||
{
|
||||
string versionString = "Careminster " + versionNumber + " " + flavour;
|
||||
string versionString = "OpenSim " + versionNumber + " " + flavour;
|
||||
return versionString.PadRight(VERSIONINFO_VERSION_LENGTH);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,13 +27,9 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using System.Diagnostics;
|
||||
using System.Xml.Schema;
|
||||
using System.Xml.Serialization;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Framework
|
||||
@@ -49,155 +45,6 @@ namespace OpenSim.Framework
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static XmlSerializer tiiSerializer = new XmlSerializer(typeof (TaskInventoryItem));
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Thread LockedByThread;
|
||||
private string WriterStack;
|
||||
|
||||
private Dictionary<Thread, string> ReadLockers =
|
||||
new Dictionary<Thread, string>();
|
||||
|
||||
/// <value>
|
||||
/// An advanced lock for inventory data
|
||||
/// </value>
|
||||
private System.Threading.ReaderWriterLockSlim m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
|
||||
/// <summary>
|
||||
/// Are we readlocked by the calling thread?
|
||||
/// </summary>
|
||||
public bool IsReadLockedByMe()
|
||||
{
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock our inventory list for reading (many can read, one can write)
|
||||
/// </summary>
|
||||
public void LockItemsForRead(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
if (m_itemLock.IsWriteLockHeld && LockedByThread != null)
|
||||
{
|
||||
if (!LockedByThread.IsAlive)
|
||||
{
|
||||
//Locked by dead thread, reset.
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
}
|
||||
}
|
||||
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
try
|
||||
{
|
||||
StackTrace stackTrace = new StackTrace(); // get call stack
|
||||
StackFrame[] stackFrames = stackTrace.GetFrames(); // get method calls (frames)
|
||||
|
||||
// write call stack method names
|
||||
foreach (StackFrame stackFrame in stackFrames)
|
||||
{
|
||||
m_log.Error("[SceneObjectGroup.m_parts] "+(stackFrame.GetMethod().Name)); // write method name
|
||||
}
|
||||
}
|
||||
catch
|
||||
{}
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
|
||||
while (!m_itemLock.TryEnterReadLock(60000))
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire READ lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
if (m_itemLock.IsWriteLockHeld)
|
||||
{
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
System.Console.WriteLine("Locker's call stack:\n" + WriterStack);
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
LockedByThread = null;
|
||||
ReadLockers.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_itemLock.RecursiveReadCount>0)
|
||||
{
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Lock our inventory list for writing (many can read, one can write)
|
||||
/// </summary>
|
||||
public void LockItemsForWrite(bool locked)
|
||||
{
|
||||
if (locked)
|
||||
{
|
||||
//Enter a write lock, wait indefinately for one to open.
|
||||
if (m_itemLock.RecursiveReadCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive read lock requested. This should not happen and means something needs to be fixed. For now though, it's safe to continue.");
|
||||
m_itemLock.ExitReadLock();
|
||||
}
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_log.Error("[TaskInventoryDictionary] Recursive write lock requested. This should not happen and means something needs to be fixed.");
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
while (!m_itemLock.TryEnterWriteLock(60000))
|
||||
{
|
||||
if (m_itemLock.IsWriteLockHeld)
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by thread " + LockedByThread.Name + ". I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
System.Console.WriteLine("Locker's call stack:\n" + WriterStack);
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Error("Thread lock detected while trying to aquire WRITE lock in TaskInventoryDictionary. Locked by a reader. I'm going to try to solve the thread lock automatically to preserve region stability, but this needs to be fixed.");
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
System.Console.WriteLine("My call stack:\n" + Environment.StackTrace);
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
foreach (KeyValuePair<Thread, string> kvp in ReadLockers)
|
||||
{
|
||||
System.Console.WriteLine("Locker name {0} call stack:\n" + kvp.Value, kvp.Key.Name);
|
||||
System.Console.WriteLine("------------------------------------------");
|
||||
}
|
||||
}
|
||||
m_itemLock = new System.Threading.ReaderWriterLockSlim();
|
||||
ReadLockers.Clear();
|
||||
}
|
||||
|
||||
LockedByThread = Thread.CurrentThread;
|
||||
WriterStack = Environment.StackTrace;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (m_itemLock.RecursiveWriteCount > 0)
|
||||
{
|
||||
m_itemLock.ExitWriteLock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
@@ -205,13 +52,14 @@ namespace OpenSim.Framework
|
||||
{
|
||||
TaskInventoryDictionary clone = new TaskInventoryDictionary();
|
||||
|
||||
m_itemLock.EnterReadLock();
|
||||
foreach (UUID uuid in Keys)
|
||||
lock (this)
|
||||
{
|
||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||
foreach (UUID uuid in Keys)
|
||||
{
|
||||
clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
|
||||
}
|
||||
}
|
||||
m_itemLock.ExitReadLock();
|
||||
|
||||
|
||||
return clone;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,9 +68,6 @@ namespace OpenSim.Framework
|
||||
private UUID _loadedID = UUID.Zero;
|
||||
|
||||
private bool _ownerChanged = false;
|
||||
|
||||
// This used ONLY during copy. It can't be relied on at other times!
|
||||
private bool _scriptRunning = true;
|
||||
|
||||
public UUID AssetID {
|
||||
get {
|
||||
@@ -343,15 +340,6 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
public bool ScriptRunning {
|
||||
get {
|
||||
return _scriptRunning;
|
||||
}
|
||||
set {
|
||||
_scriptRunning = value;
|
||||
}
|
||||
}
|
||||
|
||||
// See ICloneable
|
||||
|
||||
#region ICloneable Members
|
||||
|
||||
@@ -217,12 +217,12 @@ namespace OpenSim.Framework.Tests
|
||||
BannedHostNameMask = string.Empty,
|
||||
BannedUserID = bannedUserId}
|
||||
);
|
||||
Assert.IsTrue(es.IsBanned(bannedUserId, 32), "User Should be banned but is not.");
|
||||
Assert.IsFalse(es.IsBanned(UUID.Zero, 32), "User Should not be banned but is.");
|
||||
Assert.IsTrue(es.IsBanned(bannedUserId), "User Should be banned but is not.");
|
||||
Assert.IsFalse(es.IsBanned(UUID.Zero), "User Should not be banned but is.");
|
||||
|
||||
es.RemoveBan(bannedUserId);
|
||||
|
||||
Assert.IsFalse(es.IsBanned(bannedUserId, 32), "User Should not be banned but is.");
|
||||
Assert.IsFalse(es.IsBanned(bannedUserId), "User Should not be banned but is.");
|
||||
|
||||
es.AddEstateManager(UUID.Zero);
|
||||
|
||||
|
||||
@@ -35,7 +35,8 @@ using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Security.Cryptography;
|
||||
@@ -375,6 +376,20 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is the platform Windows?
|
||||
/// </summary>
|
||||
/// <returns>true if so, false otherwise</returns>
|
||||
public static bool IsWindows()
|
||||
{
|
||||
PlatformID platformId = Environment.OSVersion.Platform;
|
||||
|
||||
return (platformId == PlatformID.Win32NT
|
||||
|| platformId == PlatformID.Win32S
|
||||
|| platformId == PlatformID.Win32Windows
|
||||
|| platformId == PlatformID.WinCE);
|
||||
}
|
||||
|
||||
public static bool IsEnvironmentSupported(ref string reason)
|
||||
@@ -433,25 +448,19 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public static string Md5Hash(string data)
|
||||
{
|
||||
return Md5Hash(data, Encoding.Default);
|
||||
}
|
||||
|
||||
public static string Md5Hash(string data, Encoding encoding)
|
||||
{
|
||||
byte[] dataMd5 = ComputeMD5Hash(data, encoding);
|
||||
byte[] dataMd5 = ComputeMD5Hash(data);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < dataMd5.Length; i++)
|
||||
sb.AppendFormat("{0:x2}", dataMd5[i]);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static byte[] ComputeMD5Hash(string data, Encoding encoding)
|
||||
private static byte[] ComputeMD5Hash(string data)
|
||||
{
|
||||
MD5 md5 = MD5.Create();
|
||||
return md5.ComputeHash(encoding.GetBytes(data));
|
||||
return md5.ComputeHash(Encoding.Default.GetBytes(data));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -459,12 +468,6 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
|
||||
public static string SHA1Hash(string data, Encoding enc)
|
||||
{
|
||||
return SHA1Hash(enc.GetBytes(data));
|
||||
}
|
||||
|
||||
public static string SHA1Hash(string data)
|
||||
{
|
||||
return SHA1Hash(Encoding.Default.GetBytes(data));
|
||||
@@ -1069,19 +1072,19 @@ namespace OpenSim.Framework
|
||||
{
|
||||
string os = String.Empty;
|
||||
|
||||
// if (Environment.OSVersion.Platform != PlatformID.Unix)
|
||||
// {
|
||||
// os = Environment.OSVersion.ToString();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// os = ReadEtcIssue();
|
||||
// }
|
||||
//
|
||||
// if (os.Length > 45)
|
||||
// {
|
||||
// os = os.Substring(0, 45);
|
||||
// }
|
||||
if (Environment.OSVersion.Platform != PlatformID.Unix)
|
||||
{
|
||||
os = Environment.OSVersion.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
os = ReadEtcIssue();
|
||||
}
|
||||
|
||||
if (os.Length > 45)
|
||||
{
|
||||
os = os.Substring(0, 45);
|
||||
}
|
||||
|
||||
return os;
|
||||
}
|
||||
@@ -1214,7 +1217,7 @@ namespace OpenSim.Framework
|
||||
|
||||
public static Guid GetHashGuid(string data, string salt)
|
||||
{
|
||||
byte[] hash = ComputeMD5Hash(data + salt, Encoding.Default);
|
||||
byte[] hash = ComputeMD5Hash(data + salt);
|
||||
|
||||
//string s = BitConverter.ToString(hash);
|
||||
|
||||
@@ -1469,6 +1472,27 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to trigger an early library load on Windows systems.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Required to get 32-bit and 64-bit processes to automatically use the
|
||||
/// appropriate native library.
|
||||
/// </remarks>
|
||||
/// <param name="dllToLoad"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr LoadLibrary(string dllToLoad);
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the current process is 64 bit
|
||||
/// </summary>
|
||||
/// <returns>true if so, false if not</returns>
|
||||
public static bool Is64BitProcess()
|
||||
{
|
||||
return IntPtr.Size == 8;
|
||||
}
|
||||
|
||||
#region FireAndForget Threading Pattern
|
||||
|
||||
@@ -240,7 +240,7 @@ namespace OpenSim.Framework
|
||||
|
||||
lock (m_threads)
|
||||
{
|
||||
int now = Environment.TickCount;
|
||||
int now = Environment.TickCount & Int32.MaxValue;
|
||||
|
||||
foreach (ThreadWatchdogInfo threadInfo in m_threads.Values)
|
||||
{
|
||||
@@ -266,4 +266,4 @@ namespace OpenSim.Framework
|
||||
m_watchdogTimer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -243,7 +243,6 @@ namespace OpenSim.Framework
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = ex.Message;
|
||||
m_log.Debug("[WEB UTIL]: Exception making request: " + ex.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
@@ -310,7 +309,7 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
public static OSDMap PostToService(string url, NameValueCollection data)
|
||||
{
|
||||
return ServiceFormRequest(url,data, 20000);
|
||||
return ServiceFormRequest(url,data,10000);
|
||||
}
|
||||
|
||||
public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout)
|
||||
@@ -923,19 +922,12 @@ namespace OpenSim.Framework
|
||||
/// <exception cref="System.Net.WebException">Thrown if we encounter a network issue while posting
|
||||
/// the request. You'll want to make sure you deal with this as they're not uncommon</exception>
|
||||
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj)
|
||||
{
|
||||
return MakeRequest<TRequest, TResponse>(verb, requestUrl, obj, 0);
|
||||
}
|
||||
|
||||
public static TResponse MakeRequest<TRequest, TResponse>(string verb, string requestUrl, TRequest obj, int pTimeout)
|
||||
{
|
||||
Type type = typeof(TRequest);
|
||||
TResponse deserial = default(TResponse);
|
||||
|
||||
WebRequest request = WebRequest.Create(requestUrl);
|
||||
request.Method = verb;
|
||||
if (pTimeout != 0)
|
||||
request.Timeout = pTimeout * 1000;
|
||||
|
||||
if ((verb == "POST") || (verb == "PUT"))
|
||||
{
|
||||
|
||||
@@ -484,7 +484,7 @@ namespace OpenSim
|
||||
if (alert != null)
|
||||
presence.ControllingClient.Kick(alert);
|
||||
else
|
||||
presence.ControllingClient.Kick("\nYou have been logged out by an administrator.\n");
|
||||
presence.ControllingClient.Kick("\nThe OpenSim manager kicked you out.\n");
|
||||
|
||||
// ...and close on our side
|
||||
presence.Scene.IncomingCloseAgent(presence.UUID);
|
||||
@@ -1228,7 +1228,7 @@ namespace OpenSim
|
||||
MainConsole.Instance.Output(String.Format("loadOffsets <X,Y,Z> = <{0},{1},{2}>",loadOffset.X,loadOffset.Y,loadOffset.Z));
|
||||
}
|
||||
}
|
||||
m_sceneManager.LoadCurrentSceneFromXml(cmdparams[0], generateNewIDS, loadOffset);
|
||||
m_sceneManager.LoadCurrentSceneFromXml(cmdparams[2], generateNewIDS, loadOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -93,10 +93,6 @@ namespace OpenSim
|
||||
|
||||
protected List<IApplicationPlugin> m_plugins = new List<IApplicationPlugin>();
|
||||
|
||||
private List<string> m_permsModules;
|
||||
|
||||
private bool m_securePermissionsLoading = true;
|
||||
|
||||
/// <value>
|
||||
/// The config information passed into the OpenSimulator region server.
|
||||
/// </value>
|
||||
@@ -201,11 +197,6 @@ namespace OpenSim
|
||||
CreatePIDFile(pidFile);
|
||||
|
||||
userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
|
||||
|
||||
m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
|
||||
|
||||
string permissionModules = startupConfig.GetString("permissionmodules", "DefaultPermissionsModule");
|
||||
m_permsModules = new List<string>(permissionModules.Split(','));
|
||||
}
|
||||
|
||||
// Load the simulation data service
|
||||
@@ -234,12 +225,6 @@ namespace OpenSim
|
||||
m_moduleLoader = new ModuleLoader(m_config.Source);
|
||||
|
||||
LoadPlugins();
|
||||
|
||||
if (m_plugins.Count == 0) // We failed to load any modules. Mono Addins glitch!
|
||||
{
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
foreach (IApplicationPlugin plugin in m_plugins)
|
||||
{
|
||||
plugin.PostInitialise();
|
||||
@@ -387,41 +372,7 @@ namespace OpenSim
|
||||
}
|
||||
else m_log.Error("[REGIONMODULES]: The new RegionModulesController is missing...");
|
||||
|
||||
if (m_securePermissionsLoading)
|
||||
{
|
||||
foreach (string s in m_permsModules)
|
||||
{
|
||||
if (!scene.RegionModules.ContainsKey(s))
|
||||
{
|
||||
bool found = false;
|
||||
foreach (IRegionModule m in modules)
|
||||
{
|
||||
if (m.Name == s)
|
||||
{
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
m_log.Fatal("[MODULES]: Required module " + s + " not found.");
|
||||
Environment.Exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scene.SetModuleInterfaces();
|
||||
// First Step of bootreport sequence
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.ColdStart(1,scene);
|
||||
scene.SnmpService.LinkDown(scene);
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Loading prins", scene);
|
||||
}
|
||||
|
||||
while (regionInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
|
||||
SetUpEstateOwner(scene);
|
||||
@@ -435,11 +386,6 @@ namespace OpenSim
|
||||
scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
|
||||
scene.EventManager.TriggerParcelPrimCountUpdate();
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Grid Registration in progress", scene);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
scene.RegisterRegionWithGrid();
|
||||
@@ -450,29 +396,15 @@ namespace OpenSim
|
||||
"[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.Critical("Grid registration failed. Startup aborted.", scene);
|
||||
}
|
||||
// Carrying on now causes a lot of confusion down the
|
||||
// line - we need to get the user's attention
|
||||
Environment.Exit(1);
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Grid Registration done", scene);
|
||||
}
|
||||
|
||||
// We need to do this after we've initialized the
|
||||
// scripting engines.
|
||||
scene.CreateScriptInstances();
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("ScriptEngine started", scene);
|
||||
}
|
||||
|
||||
m_sceneManager.Add(scene);
|
||||
|
||||
if (m_autoCreateClientStack)
|
||||
@@ -481,10 +413,6 @@ namespace OpenSim
|
||||
clientServer.Start();
|
||||
}
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("Initializing region modules", scene);
|
||||
}
|
||||
if (do_post_init)
|
||||
{
|
||||
foreach (IRegionModule module in modules)
|
||||
@@ -496,14 +424,7 @@ namespace OpenSim
|
||||
|
||||
mscene = scene;
|
||||
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("The region is operational", scene);
|
||||
scene.SnmpService.LinkUp(scene);
|
||||
}
|
||||
|
||||
scene.StartTimer();
|
||||
scene.StartTimerWatchdog();
|
||||
|
||||
scene.StartScripts();
|
||||
|
||||
@@ -580,11 +501,6 @@ namespace OpenSim
|
||||
private void ShutdownRegion(Scene scene)
|
||||
{
|
||||
m_log.DebugFormat("[SHUTDOWN]: Shutting down region {0}", scene.RegionInfo.RegionName);
|
||||
if (scene.SnmpService != null)
|
||||
{
|
||||
scene.SnmpService.BootInfo("The region is shutting down", scene);
|
||||
scene.SnmpService.LinkDown(scene);
|
||||
}
|
||||
IRegionModulesController controller;
|
||||
if (ApplicationRegistry.TryGet<IRegionModulesController>(out controller))
|
||||
{
|
||||
@@ -1028,7 +944,7 @@ namespace OpenSim
|
||||
= MainConsole.Instance.CmdPrompt(
|
||||
string.Format(
|
||||
"Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
|
||||
"no",
|
||||
"yes",
|
||||
new List<string>() { "yes", "no" });
|
||||
|
||||
if (response == "no")
|
||||
@@ -1044,15 +960,12 @@ namespace OpenSim
|
||||
= MainConsole.Instance.CmdPrompt(
|
||||
string.Format(
|
||||
"Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
|
||||
"None");
|
||||
|
||||
if (response == "None")
|
||||
continue;
|
||||
estateNames[0]);
|
||||
|
||||
List<int> estateIDs = EstateDataService.GetEstates(response);
|
||||
if (estateIDs.Count < 1)
|
||||
{
|
||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
|
||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -234,9 +234,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
m_stopPacket = TexturePacketCount();
|
||||
}
|
||||
|
||||
//Give them at least two packets, to play nice with some broken viewers (SL also behaves this way)
|
||||
if (m_stopPacket == 1 && m_layers[0].End > FIRST_PACKET_SIZE) m_stopPacket++;
|
||||
|
||||
m_currentPacket = StartPacket;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public event RequestTaskInventory OnRequestTaskInventory;
|
||||
public event UpdateInventoryItem OnUpdateInventoryItem;
|
||||
public event CopyInventoryItem OnCopyInventoryItem;
|
||||
public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
|
||||
public event MoveInventoryItem OnMoveInventoryItem;
|
||||
public event RemoveInventoryItem OnRemoveInventoryItem;
|
||||
public event RemoveInventoryFolder OnRemoveInventoryFolder;
|
||||
@@ -257,7 +256,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public event ClassifiedInfoRequest OnClassifiedInfoRequest;
|
||||
public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
|
||||
public event ClassifiedDelete OnClassifiedDelete;
|
||||
public event ClassifiedGodDelete OnClassifiedGodDelete;
|
||||
public event ClassifiedDelete OnClassifiedGodDelete;
|
||||
public event EventNotificationAddRequest OnEventNotificationAddRequest;
|
||||
public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
|
||||
public event EventGodDelete OnEventGodDelete;
|
||||
@@ -288,7 +287,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
|
||||
public event SimWideDeletesDelegate OnSimWideDeletes;
|
||||
public event SendPostcard OnSendPostcard;
|
||||
public event ChangeInventoryItemFlags OnChangeInventoryItemFlags;
|
||||
public event MuteListEntryUpdate OnUpdateMuteListEntry;
|
||||
public event MuteListEntryRemove OnRemoveMuteListEntry;
|
||||
public event GodlikeMessage onGodlikeMessage;
|
||||
@@ -339,7 +337,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// thread servicing the m_primFullUpdates queue after a kill. If this happens the object persists as an
|
||||
/// ownerless phantom.
|
||||
///
|
||||
/// All manipulation of this set has to occur under an m_entityUpdates.SyncRoot lock
|
||||
/// All manipulation of this set has to occur under a lock
|
||||
///
|
||||
/// </value>
|
||||
protected HashSet<uint> m_killRecord;
|
||||
@@ -347,7 +345,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// protected HashSet<uint> m_attachmentsSent;
|
||||
|
||||
private int m_moneyBalance;
|
||||
private bool m_deliverPackets = true;
|
||||
private int m_animationSequenceNumber = 1;
|
||||
private bool m_SendLogoutPacketWhenClosing = true;
|
||||
private AgentUpdateArgs lastarg;
|
||||
@@ -387,14 +384,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
get { return m_startpos; }
|
||||
set { m_startpos = value; }
|
||||
}
|
||||
public bool DeliverPackets
|
||||
{
|
||||
get { return m_deliverPackets; }
|
||||
set {
|
||||
m_deliverPackets = value;
|
||||
m_udpClient.m_deliverPackets = value;
|
||||
}
|
||||
}
|
||||
public UUID AgentId { get { return m_agentId; } }
|
||||
public ISceneAgent SceneAgent { get; private set; }
|
||||
public UUID ActiveGroupId { get { return m_activeGroupID; } }
|
||||
@@ -499,30 +488,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
#region Client Methods
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Shut down the client view
|
||||
/// </summary>
|
||||
public void Close()
|
||||
{
|
||||
Close(true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shut down the client view
|
||||
/// </summary>
|
||||
public void Close(bool sendStop)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[CLIENT]: Close has been called for {0} attached to scene {1}",
|
||||
Name, m_scene.RegionInfo.RegionName);
|
||||
|
||||
if (sendStop)
|
||||
{
|
||||
// Send the STOP packet
|
||||
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
|
||||
OutPacket(disable, ThrottleOutPacketType.Unknown);
|
||||
}
|
||||
// Send the STOP packet
|
||||
DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
|
||||
OutPacket(disable, ThrottleOutPacketType.Unknown);
|
||||
|
||||
IsActive = false;
|
||||
|
||||
@@ -822,7 +799,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
reply.ChatData.OwnerID = fromAgentID;
|
||||
reply.ChatData.SourceID = fromAgentID;
|
||||
|
||||
OutPacket(reply, ThrottleOutPacketType.Unknown);
|
||||
OutPacket(reply, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1108,10 +1085,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
public virtual void SendLayerData(float[] map)
|
||||
{
|
||||
Util.FireAndForget(DoSendLayerData, map);
|
||||
|
||||
// Send it sync, and async. It's not that much data
|
||||
// and it improves user experience just so much!
|
||||
DoSendLayerData(map);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1124,13 +1097,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
try
|
||||
{
|
||||
for (int y = 0; y < 16; y++)
|
||||
{
|
||||
for (int x = 0; x < 16; x+=4)
|
||||
{
|
||||
SendLayerPacket(x, y, map);
|
||||
}
|
||||
}
|
||||
//for (int y = 0; y < 16; y++)
|
||||
//{
|
||||
// for (int x = 0; x < 16; x++)
|
||||
// {
|
||||
// SendLayerData(x, y, map);
|
||||
// }
|
||||
//}
|
||||
|
||||
// Send LayerData in a spiral pattern. Fun!
|
||||
SendLayerTopRight(map, 0, 0, 15, 15);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -1138,35 +1114,51 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
|
||||
private void SendLayerTopRight(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row
|
||||
for (int i = x1; i <= x2; i++)
|
||||
SendLayerData(i, y1, map);
|
||||
|
||||
// Column
|
||||
for (int j = y1 + 1; j <= y2; j++)
|
||||
SendLayerData(x2, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerBottomLeft(map, x1, y1 + 1, x2 - 1, y2);
|
||||
}
|
||||
|
||||
void SendLayerBottomLeft(float[] map, int x1, int y1, int x2, int y2)
|
||||
{
|
||||
// Row in reverse
|
||||
for (int i = x2; i >= x1; i--)
|
||||
SendLayerData(i, y2, map);
|
||||
|
||||
// Column in reverse
|
||||
for (int j = y2 - 1; j >= y1; j--)
|
||||
SendLayerData(x1, j, map);
|
||||
|
||||
if (x2 - x1 > 0)
|
||||
SendLayerTopRight(map, x1 + 1, y1, x2, y2 - 1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends a set of four patches (x, x+1, ..., x+3) to the client
|
||||
/// </summary>
|
||||
/// <param name="map">heightmap</param>
|
||||
/// <param name="px">X coordinate for patches 0..12</param>
|
||||
/// <param name="py">Y coordinate for patches 0..15</param>
|
||||
private void SendLayerPacket(int x, int y, float[] map)
|
||||
{
|
||||
int[] patches = new int[4];
|
||||
patches[0] = x + 0 + y * 16;
|
||||
patches[1] = x + 1 + y * 16;
|
||||
patches[2] = x + 2 + y * 16;
|
||||
patches[3] = x + 3 + y * 16;
|
||||
// private void SendLayerPacket(float[] map, int y, int x)
|
||||
// {
|
||||
// int[] patches = new int[4];
|
||||
// patches[0] = x + 0 + y * 16;
|
||||
// patches[1] = x + 1 + y * 16;
|
||||
// patches[2] = x + 2 + y * 16;
|
||||
// patches[3] = x + 3 + y * 16;
|
||||
|
||||
float[] heightmap = (map.Length == 65536) ?
|
||||
map :
|
||||
LLHeightFieldMoronize(map);
|
||||
|
||||
try
|
||||
{
|
||||
Packet layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
}
|
||||
catch
|
||||
{
|
||||
for (int px = x ; px < x + 4 ; px++)
|
||||
SendLayerData(px, y, map);
|
||||
}
|
||||
}
|
||||
// Packet layerpack = LLClientView.TerrainManager.CreateLandPacket(map, patches);
|
||||
// OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Sends a specified patch to a client
|
||||
@@ -1186,7 +1178,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
LayerDataPacket layerpack = TerrainCompressor.CreateLandPacket(heightmap, patches);
|
||||
layerpack.Header.Reliable = true;
|
||||
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Task);
|
||||
OutPacket(layerpack, ThrottleOutPacketType.Land);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -2310,15 +2302,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
OutPacket(sound, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
public void SendTransferAbort(TransferRequestPacket transferRequest)
|
||||
{
|
||||
TransferAbortPacket abort = (TransferAbortPacket)PacketPool.Instance.GetPacket(PacketType.TransferAbort);
|
||||
abort.TransferInfo.TransferID = transferRequest.TransferInfo.TransferID;
|
||||
abort.TransferInfo.ChannelType = transferRequest.TransferInfo.ChannelType;
|
||||
m_log.Debug("[Assets] Aborting transfer; asset request failed");
|
||||
OutPacket(abort, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
public void SendTriggeredSound(UUID soundID, UUID ownerID, UUID objectID, UUID parentID, ulong handle, Vector3 position, float gain)
|
||||
{
|
||||
SoundTriggerPacket sound = (SoundTriggerPacket)PacketPool.Instance.GetPacket(PacketType.SoundTrigger);
|
||||
@@ -2766,10 +2749,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
reply.Data.ParcelID = parcelID;
|
||||
reply.Data.OwnerID = land.OwnerID;
|
||||
reply.Data.Name = Utils.StringToBytes(land.Name);
|
||||
if (land != null && land.Description != null && land.Description != String.Empty)
|
||||
reply.Data.Desc = Utils.StringToBytes(land.Description.Substring(0, land.Description.Length > 254 ? 254: land.Description.Length));
|
||||
else
|
||||
reply.Data.Desc = new Byte[0];
|
||||
reply.Data.Desc = Utils.StringToBytes(land.Description);
|
||||
reply.Data.ActualArea = land.Area;
|
||||
reply.Data.BillableArea = land.Area; // TODO: what is this?
|
||||
|
||||
@@ -3632,15 +3612,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// </summary>
|
||||
public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
|
||||
{
|
||||
if (entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart e = (SceneObjectPart)entity;
|
||||
SceneObjectGroup g = e.ParentGroup;
|
||||
if (g.RootPart.Shape.State > 30) // HUD
|
||||
if (g.OwnerID != AgentId)
|
||||
return; // Don't send updates for other people's HUDs
|
||||
}
|
||||
|
||||
//double priority = m_prioritizer.GetUpdatePriority(this, entity);
|
||||
uint priority = m_prioritizer.GetUpdatePriority(this, entity);
|
||||
|
||||
lock (m_entityUpdates.SyncRoot)
|
||||
@@ -3707,230 +3679,211 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
// We must lock for both manipulating the kill record and sending the packet, in order to avoid a race
|
||||
// condition where a kill can be processed before an out-of-date update for the same object.
|
||||
float avgTimeDilation = 1.0f;
|
||||
IEntityUpdate iupdate;
|
||||
Int32 timeinqueue; // this is just debugging code & can be dropped later
|
||||
|
||||
while (updatesThisCall < maxUpdates)
|
||||
lock (m_killRecord)
|
||||
{
|
||||
lock (m_entityUpdates.SyncRoot)
|
||||
if (!m_entityUpdates.TryDequeue(out iupdate, out timeinqueue))
|
||||
break;
|
||||
float avgTimeDilation = 1.0f;
|
||||
IEntityUpdate iupdate;
|
||||
Int32 timeinqueue; // this is just debugging code & can be dropped later
|
||||
|
||||
EntityUpdate update = (EntityUpdate)iupdate;
|
||||
|
||||
avgTimeDilation += update.TimeDilation;
|
||||
avgTimeDilation *= 0.5f;
|
||||
|
||||
if (update.Entity is SceneObjectPart)
|
||||
while (updatesThisCall < maxUpdates)
|
||||
{
|
||||
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
||||
lock (m_entityUpdates.SyncRoot)
|
||||
if (!m_entityUpdates.TryDequeue(out iupdate, out timeinqueue))
|
||||
break;
|
||||
|
||||
// Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
|
||||
// will never receive an update after a prim kill. Even then, keeping the kill record may be a good
|
||||
// safety measure.
|
||||
//
|
||||
// If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
|
||||
// after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
|
||||
// updates and kills on different threads with different scheduling strategies, hence this protection.
|
||||
//
|
||||
// This doesn't appear to apply to child prims - a client will happily ignore these updates
|
||||
// after the root prim has been deleted.
|
||||
lock (m_killRecord)
|
||||
EntityUpdate update = (EntityUpdate)iupdate;
|
||||
|
||||
avgTimeDilation += update.TimeDilation;
|
||||
avgTimeDilation *= 0.5f;
|
||||
|
||||
if (update.Entity is SceneObjectPart)
|
||||
{
|
||||
SceneObjectPart part = (SceneObjectPart)update.Entity;
|
||||
|
||||
// Please do not remove this unless you can demonstrate on the OpenSim mailing list that a client
|
||||
// will never receive an update after a prim kill. Even then, keeping the kill record may be a good
|
||||
// safety measure.
|
||||
//
|
||||
// If a Linden Lab 1.23.5 client (and possibly later and earlier) receives an object update
|
||||
// after a kill, it will keep displaying the deleted object until relog. OpenSim currently performs
|
||||
// updates and kills on different threads with different scheduling strategies, hence this protection.
|
||||
//
|
||||
// This doesn't appear to apply to child prims - a client will happily ignore these updates
|
||||
// after the root prim has been deleted.
|
||||
if (m_killRecord.Contains(part.LocalId))
|
||||
continue;
|
||||
if (m_killRecord.Contains(part.ParentGroup.RootPart.LocalId))
|
||||
continue;
|
||||
}
|
||||
|
||||
if (part.ParentGroup.IsDeleted)
|
||||
continue;
|
||||
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
{ // Someone else's HUD, why are we getting these?
|
||||
if (part.ParentGroup.OwnerID != AgentId &&
|
||||
part.ParentGroup.RootPart.Shape.State >= 30)
|
||||
continue;
|
||||
ScenePresence sp;
|
||||
// Owner is not in the sim, don't update it to
|
||||
// anyone
|
||||
if (!m_scene.TryGetScenePresence(part.OwnerID, out sp))
|
||||
continue;
|
||||
|
||||
List<SceneObjectGroup> atts = sp.GetAttachments();
|
||||
bool found = false;
|
||||
foreach (SceneObjectGroup att in atts)
|
||||
{
|
||||
if (att == part.ParentGroup)
|
||||
// m_log.WarnFormat(
|
||||
// "[CLIENT]: Preventing update for prim with local id {0} after client for user {1} told it was deleted",
|
||||
// part.LocalId, Name);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (part.ParentGroup.IsAttachment && m_disableFacelights)
|
||||
{
|
||||
if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand &&
|
||||
part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand)
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
part.Shape.LightEntry = false;
|
||||
}
|
||||
}
|
||||
|
||||
// It's an attachment of a valid avatar, but
|
||||
// doesn't seem to be attached, skip
|
||||
if (!found)
|
||||
continue;
|
||||
}
|
||||
if (part.ParentGroup.IsAttachment && m_disableFacelights)
|
||||
{
|
||||
if (part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.LeftHand &&
|
||||
part.ParentGroup.RootPart.Shape.State != (byte)AttachmentPoint.RightHand)
|
||||
{
|
||||
part.Shape.LightEntry = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
++updatesThisCall;
|
||||
|
||||
#region UpdateFlags to packet type conversion
|
||||
|
||||
PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags;
|
||||
|
||||
bool canUseCompressed = true;
|
||||
bool canUseImproved = true;
|
||||
|
||||
// Compressed object updates only make sense for LL primitives
|
||||
if (!(update.Entity is SceneObjectPart))
|
||||
{
|
||||
canUseCompressed = false;
|
||||
}
|
||||
|
||||
if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate))
|
||||
{
|
||||
canUseCompressed = false;
|
||||
canUseImproved = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Acceleration) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Joint))
|
||||
|
||||
++updatesThisCall;
|
||||
|
||||
#region UpdateFlags to packet type conversion
|
||||
|
||||
PrimUpdateFlags updateFlags = (PrimUpdateFlags)update.Flags;
|
||||
|
||||
bool canUseCompressed = true;
|
||||
bool canUseImproved = true;
|
||||
|
||||
// Compressed object updates only make sense for LL primitives
|
||||
if (!(update.Entity is SceneObjectPart))
|
||||
{
|
||||
canUseCompressed = false;
|
||||
}
|
||||
|
||||
if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.ParentID) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Scale) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.PrimData) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Text) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.NameValue) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.ExtraData) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Sound) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Particles) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Material) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.ClickAction) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.MediaURL) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Joint))
|
||||
|
||||
if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate))
|
||||
{
|
||||
canUseCompressed = false;
|
||||
canUseImproved = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion UpdateFlags to packet type conversion
|
||||
|
||||
#region Block Construction
|
||||
|
||||
// TODO: Remove this once we can build compressed updates
|
||||
canUseCompressed = false;
|
||||
|
||||
if (!canUseImproved && !canUseCompressed)
|
||||
{
|
||||
if (update.Entity is ScenePresence)
|
||||
else
|
||||
{
|
||||
objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity));
|
||||
if (updateFlags.HasFlag(PrimUpdateFlags.Velocity) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Acceleration) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.CollisionPlane) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Joint))
|
||||
{
|
||||
canUseCompressed = false;
|
||||
}
|
||||
|
||||
if (updateFlags.HasFlag(PrimUpdateFlags.PrimFlags) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.ParentID) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Scale) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.PrimData) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Text) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.NameValue) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.ExtraData) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.TextureAnim) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Sound) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Particles) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Material) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.ClickAction) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.MediaURL) ||
|
||||
updateFlags.HasFlag(PrimUpdateFlags.Joint))
|
||||
{
|
||||
canUseImproved = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion UpdateFlags to packet type conversion
|
||||
|
||||
#region Block Construction
|
||||
|
||||
// TODO: Remove this once we can build compressed updates
|
||||
canUseCompressed = false;
|
||||
|
||||
if (!canUseImproved && !canUseCompressed)
|
||||
{
|
||||
if (update.Entity is ScenePresence)
|
||||
{
|
||||
objectUpdateBlocks.Value.Add(CreateAvatarUpdateBlock((ScenePresence)update.Entity));
|
||||
objectUpdates.Value.Add(update);
|
||||
}
|
||||
else
|
||||
{
|
||||
objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId));
|
||||
objectUpdates.Value.Add(update);
|
||||
}
|
||||
}
|
||||
else if (!canUseImproved)
|
||||
{
|
||||
compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags));
|
||||
compressedUpdates.Value.Add(update);
|
||||
}
|
||||
else
|
||||
{
|
||||
objectUpdateBlocks.Value.Add(CreatePrimUpdateBlock((SceneObjectPart)update.Entity, this.m_agentId));
|
||||
if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId)
|
||||
{
|
||||
// Self updates go into a special list
|
||||
terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
|
||||
terseAgentUpdates.Value.Add(update);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Everything else goes here
|
||||
terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
|
||||
terseUpdates.Value.Add(update);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Block Construction
|
||||
}
|
||||
else if (!canUseImproved)
|
||||
|
||||
|
||||
#region Packet Sending
|
||||
ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f);
|
||||
|
||||
if (terseAgentUpdateBlocks.IsValueCreated)
|
||||
{
|
||||
compressedUpdateBlocks.Value.Add(CreateCompressedUpdateBlock((SceneObjectPart)update.Entity, updateFlags));
|
||||
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value;
|
||||
|
||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||
|
||||
for (int i = 0; i < blocks.Count; i++)
|
||||
packet.ObjectData[i] = blocks[i];
|
||||
// If any of the packets created from this call go unacknowledged, all of the updates will be resent
|
||||
OutPacket(packet, ThrottleOutPacketType.Unknown, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseAgentUpdates.Value, oPacket); });
|
||||
}
|
||||
else
|
||||
|
||||
if (objectUpdateBlocks.IsValueCreated)
|
||||
{
|
||||
if (update.Entity is ScenePresence && ((ScenePresence)update.Entity).UUID == AgentId)
|
||||
// Self updates go into a special list
|
||||
terseAgentUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
|
||||
else
|
||||
// Everything else goes here
|
||||
terseUpdateBlocks.Value.Add(CreateImprovedTerseBlock(update.Entity, updateFlags.HasFlag(PrimUpdateFlags.Textures)));
|
||||
List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value;
|
||||
|
||||
ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||
|
||||
for (int i = 0; i < blocks.Count; i++)
|
||||
packet.ObjectData[i] = blocks[i];
|
||||
// If any of the packets created from this call go unacknowledged, all of the updates will be resent
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(objectUpdates.Value, oPacket); });
|
||||
}
|
||||
|
||||
if (compressedUpdateBlocks.IsValueCreated)
|
||||
{
|
||||
List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value;
|
||||
|
||||
ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed);
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count];
|
||||
|
||||
for (int i = 0; i < blocks.Count; i++)
|
||||
packet.ObjectData[i] = blocks[i];
|
||||
// If any of the packets created from this call go unacknowledged, all of the updates will be resent
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(compressedUpdates.Value, oPacket); });
|
||||
}
|
||||
|
||||
#endregion Block Construction
|
||||
}
|
||||
|
||||
#region Packet Sending
|
||||
|
||||
const float TIME_DILATION = 1.0f;
|
||||
ushort timeDilation = Utils.FloatToUInt16(avgTimeDilation, 0.0f, 1.0f);
|
||||
|
||||
if (terseAgentUpdateBlocks.IsValueCreated)
|
||||
{
|
||||
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseAgentUpdateBlocks.Value;
|
||||
|
||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||
|
||||
for (int i = 0; i < blocks.Count; i++)
|
||||
packet.ObjectData[i] = blocks[i];
|
||||
|
||||
OutPacket(packet, ThrottleOutPacketType.Unknown, true);
|
||||
}
|
||||
|
||||
if (objectUpdateBlocks.IsValueCreated)
|
||||
{
|
||||
List<ObjectUpdatePacket.ObjectDataBlock> blocks = objectUpdateBlocks.Value;
|
||||
|
||||
ObjectUpdatePacket packet = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||
|
||||
for (int i = 0; i < blocks.Count; i++)
|
||||
packet.ObjectData[i] = blocks[i];
|
||||
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
||||
}
|
||||
|
||||
if (compressedUpdateBlocks.IsValueCreated)
|
||||
{
|
||||
List<ObjectUpdateCompressedPacket.ObjectDataBlock> blocks = compressedUpdateBlocks.Value;
|
||||
|
||||
ObjectUpdateCompressedPacket packet = (ObjectUpdateCompressedPacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdateCompressed);
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ObjectUpdateCompressedPacket.ObjectDataBlock[blocks.Count];
|
||||
|
||||
for (int i = 0; i < blocks.Count; i++)
|
||||
packet.ObjectData[i] = blocks[i];
|
||||
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
||||
}
|
||||
|
||||
if (terseUpdateBlocks.IsValueCreated)
|
||||
{
|
||||
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value;
|
||||
|
||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||
|
||||
for (int i = 0; i < blocks.Count; i++)
|
||||
packet.ObjectData[i] = blocks[i];
|
||||
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
||||
if (terseUpdateBlocks.IsValueCreated)
|
||||
{
|
||||
List<ImprovedTerseObjectUpdatePacket.ObjectDataBlock> blocks = terseUpdateBlocks.Value;
|
||||
|
||||
ImprovedTerseObjectUpdatePacket packet = new ImprovedTerseObjectUpdatePacket();
|
||||
packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
|
||||
packet.RegionData.TimeDilation = timeDilation;
|
||||
packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[blocks.Count];
|
||||
|
||||
for (int i = 0; i < blocks.Count; i++)
|
||||
packet.ObjectData[i] = blocks[i];
|
||||
// If any of the packets created from this call go unacknowledged, all of the updates will be resent
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); });
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Packet Sending
|
||||
@@ -4223,13 +4176,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
// Pass in the delegate so that if this packet needs to be resent, we send the current properties
|
||||
// of the object rather than the properties when the packet was created
|
||||
// HACK : Remove intelligent resending until it's fixed in core
|
||||
//OutPacket(packet, ThrottleOutPacketType.Task, true,
|
||||
// delegate(OutgoingPacket oPacket)
|
||||
// {
|
||||
// ResendPropertyUpdates(updates, oPacket);
|
||||
// });
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true,
|
||||
delegate(OutgoingPacket oPacket)
|
||||
{
|
||||
ResendPropertyUpdates(updates, oPacket);
|
||||
});
|
||||
|
||||
// pbcnt += blocks.Count;
|
||||
// ppcnt++;
|
||||
@@ -4255,13 +4206,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// of the object rather than the properties when the packet was created
|
||||
List<ObjectPropertyUpdate> updates = new List<ObjectPropertyUpdate>();
|
||||
updates.Add(familyUpdates.Value[i]);
|
||||
// HACK : Remove intelligent resending until it's fixed in core
|
||||
//OutPacket(packet, ThrottleOutPacketType.Task, true,
|
||||
// delegate(OutgoingPacket oPacket)
|
||||
// {
|
||||
// ResendPropertyUpdates(updates, oPacket);
|
||||
// });
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true);
|
||||
OutPacket(packet, ThrottleOutPacketType.Task, true,
|
||||
delegate(OutgoingPacket oPacket)
|
||||
{
|
||||
ResendPropertyUpdates(updates, oPacket);
|
||||
});
|
||||
|
||||
// fpcnt++;
|
||||
// fbcnt++;
|
||||
@@ -4410,44 +4359,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (bl[i].BannedUserID == UUID.Zero)
|
||||
continue;
|
||||
BannedUsers.Add(bl[i].BannedUserID);
|
||||
|
||||
if (BannedUsers.Count >= 50 || (i == (bl.Length - 1) && BannedUsers.Count > 0))
|
||||
{
|
||||
EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
|
||||
packet.AgentData.TransactionID = UUID.Random();
|
||||
packet.AgentData.AgentID = AgentId;
|
||||
packet.AgentData.SessionID = SessionId;
|
||||
packet.MethodData.Invoice = invoice;
|
||||
packet.MethodData.Method = Utils.StringToBytes("setaccess");
|
||||
|
||||
EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count];
|
||||
|
||||
int j;
|
||||
for (j = 0; j < (6 + BannedUsers.Count); j++)
|
||||
{
|
||||
returnblock[j] = new EstateOwnerMessagePacket.ParamListBlock();
|
||||
}
|
||||
j = 0;
|
||||
|
||||
returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes(BannedUsers.Count.ToString()); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
|
||||
|
||||
foreach (UUID banned in BannedUsers)
|
||||
{
|
||||
returnblock[j].Parameter = banned.GetBytes(); j++;
|
||||
}
|
||||
packet.ParamList = returnblock;
|
||||
packet.Header.Reliable = true;
|
||||
OutPacket(packet, ThrottleOutPacketType.Task);
|
||||
|
||||
BannedUsers.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket();
|
||||
packet.AgentData.TransactionID = UUID.Random();
|
||||
packet.AgentData.AgentID = AgentId;
|
||||
packet.AgentData.SessionID = SessionId;
|
||||
packet.MethodData.Invoice = invoice;
|
||||
packet.MethodData.Method = Utils.StringToBytes("setaccess");
|
||||
|
||||
EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + BannedUsers.Count];
|
||||
|
||||
for (int i = 0; i < (6 + BannedUsers.Count); i++)
|
||||
{
|
||||
returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock();
|
||||
}
|
||||
int j = 0;
|
||||
|
||||
returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateBans).ToString()); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes(BannedUsers.Count.ToString()); j++;
|
||||
returnblock[j].Parameter = Utils.StringToBytes("0"); j++;
|
||||
|
||||
foreach (UUID banned in BannedUsers)
|
||||
{
|
||||
returnblock[j].Parameter = banned.GetBytes(); j++;
|
||||
}
|
||||
packet.ParamList = returnblock;
|
||||
packet.Header.Reliable = false;
|
||||
OutPacket(packet, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
public void SendRegionInfoToEstateMenu(RegionInfoForEstateMenuArgs args)
|
||||
@@ -4633,10 +4575,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (landData.SimwideArea > 0)
|
||||
{
|
||||
int simulatorCapacity = (int)((long)landData.SimwideArea * (long)m_scene.RegionInfo.ObjectCapacity * (long)m_scene.RegionInfo.RegionSettings.ObjectBonus / 65536L);
|
||||
// Never report more than sim total capacity
|
||||
if (simulatorCapacity > m_scene.RegionInfo.ObjectCapacity)
|
||||
simulatorCapacity = m_scene.RegionInfo.ObjectCapacity;
|
||||
int simulatorCapacity = (int)(((float)landData.SimwideArea / 65536.0f) * (float)m_scene.RegionInfo.ObjectCapacity * (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
|
||||
updateMessage.SimWideMaxPrims = simulatorCapacity;
|
||||
}
|
||||
else
|
||||
@@ -4765,14 +4704,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
if (notifyCount > 0)
|
||||
{
|
||||
// if (notifyCount > 32)
|
||||
// {
|
||||
// m_log.InfoFormat(
|
||||
// "[LAND]: More than {0} avatars own prims on this parcel. Only sending back details of first {0}"
|
||||
// + " - a developer might want to investigate whether this is a hard limit", 32);
|
||||
//
|
||||
// notifyCount = 32;
|
||||
// }
|
||||
if (notifyCount > 32)
|
||||
{
|
||||
m_log.InfoFormat(
|
||||
"[LAND]: More than {0} avatars own prims on this parcel. Only sending back details of first {0}"
|
||||
+ " - a developer might want to investigate whether this is a hard limit", 32);
|
||||
|
||||
notifyCount = 32;
|
||||
}
|
||||
|
||||
ParcelObjectOwnersReplyPacket.DataBlock[] dataBlock
|
||||
= new ParcelObjectOwnersReplyPacket.DataBlock[notifyCount];
|
||||
@@ -5305,7 +5244,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
AddLocalPacketHandler(PacketType.TransferAbort, HandleTransferAbort, false);
|
||||
AddLocalPacketHandler(PacketType.MuteListRequest, HandleMuteListRequest, false);
|
||||
AddLocalPacketHandler(PacketType.UseCircuitCode, HandleUseCircuitCode);
|
||||
AddLocalPacketHandler(PacketType.CreateNewOutfitAttachments, HandleCreateNewOutfitAttachments);
|
||||
AddLocalPacketHandler(PacketType.AgentHeightWidth, HandleAgentHeightWidth, false);
|
||||
AddLocalPacketHandler(PacketType.InventoryDescendents, HandleInventoryDescendents);
|
||||
AddLocalPacketHandler(PacketType.DirPlacesQuery, HandleDirPlacesQuery);
|
||||
@@ -5372,7 +5310,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest);
|
||||
AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes);
|
||||
AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard);
|
||||
AddLocalPacketHandler(PacketType.ChangeInventoryItemFlags, HandleChangeInventoryItemFlags);
|
||||
|
||||
AddGenericPacketHandler("autopilot", HandleAutopilot);
|
||||
}
|
||||
@@ -5408,7 +5345,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
(x.CameraLeftAxis != lastarg.CameraLeftAxis) ||
|
||||
(x.CameraUpAxis != lastarg.CameraUpAxis) ||
|
||||
(x.ControlFlags != lastarg.ControlFlags) ||
|
||||
(x.ControlFlags != 0) ||
|
||||
(x.Far != lastarg.Far) ||
|
||||
(x.Flags != lastarg.Flags) ||
|
||||
(x.State != lastarg.State) ||
|
||||
@@ -5786,7 +5722,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
args.Channel = ch;
|
||||
args.From = String.Empty;
|
||||
args.Message = Utils.BytesToString(msg);
|
||||
args.Type = ChatTypeEnum.Region; //Behaviour in SL is that the response can be heard from any distance
|
||||
args.Type = ChatTypeEnum.Shout;
|
||||
args.Position = new Vector3();
|
||||
args.Scene = Scene;
|
||||
args.Sender = this;
|
||||
@@ -9831,7 +9767,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID,
|
||||
Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName),
|
||||
UpdateMuteListEntry.MuteData.MuteType,
|
||||
UpdateMuteListEntry.MuteData.MuteFlags);
|
||||
UpdateMuteListEntry.AgentData.AgentID);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -9846,7 +9782,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
{
|
||||
handlerRemoveMuteListEntry(this,
|
||||
RemoveMuteListEntry.MuteData.MuteID,
|
||||
Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName));
|
||||
Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName),
|
||||
RemoveMuteListEntry.AgentData.AgentID);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -9890,55 +9827,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool HandleChangeInventoryItemFlags(IClientAPI client, Packet packet)
|
||||
{
|
||||
ChangeInventoryItemFlagsPacket ChangeInventoryItemFlags =
|
||||
(ChangeInventoryItemFlagsPacket)packet;
|
||||
ChangeInventoryItemFlags handlerChangeInventoryItemFlags = OnChangeInventoryItemFlags;
|
||||
if (handlerChangeInventoryItemFlags != null)
|
||||
{
|
||||
foreach(ChangeInventoryItemFlagsPacket.InventoryDataBlock b in ChangeInventoryItemFlags.InventoryData)
|
||||
handlerChangeInventoryItemFlags(this, b.ItemID, b.Flags);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool HandleUseCircuitCode(IClientAPI sender, Packet Pack)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool HandleCreateNewOutfitAttachments(IClientAPI sender, Packet Pack)
|
||||
{
|
||||
CreateNewOutfitAttachmentsPacket packet = (CreateNewOutfitAttachmentsPacket)Pack;
|
||||
|
||||
#region Packet Session and User Check
|
||||
if (m_checkPackets)
|
||||
{
|
||||
if (packet.AgentData.SessionID != SessionId ||
|
||||
packet.AgentData.AgentID != AgentId)
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
MoveItemsAndLeaveCopy handlerMoveItemsAndLeaveCopy = null;
|
||||
List<InventoryItemBase> items = new List<InventoryItemBase>();
|
||||
foreach (CreateNewOutfitAttachmentsPacket.ObjectDataBlock n in packet.ObjectData)
|
||||
{
|
||||
InventoryItemBase b = new InventoryItemBase();
|
||||
b.ID = n.OldItemID;
|
||||
b.Folder = n.OldFolderID;
|
||||
items.Add(b);
|
||||
}
|
||||
|
||||
handlerMoveItemsAndLeaveCopy = OnMoveItemsAndLeaveCopy;
|
||||
if (handlerMoveItemsAndLeaveCopy != null)
|
||||
{
|
||||
handlerMoveItemsAndLeaveCopy(this, items, packet.HeaderData.NewFolderID);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private bool HandleAgentHeightWidth(IClientAPI sender, Packet Pack)
|
||||
{
|
||||
@@ -10365,20 +10257,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
groupProfileReply.GroupData.MaturePublish = d.MaturePublish;
|
||||
groupProfileReply.GroupData.OwnerRole = d.OwnerRole;
|
||||
|
||||
Scene scene = (Scene)m_scene;
|
||||
if (scene.Permissions.IsGod(sender.AgentId) && (!sender.IsGroupMember(groupProfileRequest.GroupData.GroupID)))
|
||||
{
|
||||
ScenePresence p;
|
||||
if (scene.TryGetScenePresence(sender.AgentId, out p))
|
||||
{
|
||||
if (p.GodLevel >= 200)
|
||||
{
|
||||
groupProfileReply.GroupData.OpenEnrollment = true;
|
||||
groupProfileReply.GroupData.MembershipFee = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
OutPacket(groupProfileReply, ThrottleOutPacketType.Task);
|
||||
}
|
||||
return true;
|
||||
@@ -10952,16 +10830,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
StartLure handlerStartLure = OnStartLure;
|
||||
if (handlerStartLure != null)
|
||||
{
|
||||
for (int i = 0 ; i < startLureRequest.TargetData.Length ; i++)
|
||||
{
|
||||
handlerStartLure(startLureRequest.Info.LureType,
|
||||
Utils.BytesToString(
|
||||
startLureRequest.Info.Message),
|
||||
startLureRequest.TargetData[i].TargetID,
|
||||
this);
|
||||
}
|
||||
}
|
||||
handlerStartLure(startLureRequest.Info.LureType,
|
||||
Utils.BytesToString(
|
||||
startLureRequest.Info.Message),
|
||||
startLureRequest.TargetData[0].TargetID,
|
||||
this);
|
||||
return true;
|
||||
}
|
||||
private bool HandleTeleportLureRequest(IClientAPI sender, Packet Pack)
|
||||
@@ -11075,11 +10948,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
#endregion
|
||||
|
||||
ClassifiedGodDelete handlerClassifiedGodDelete = OnClassifiedGodDelete;
|
||||
ClassifiedDelete handlerClassifiedGodDelete = OnClassifiedGodDelete;
|
||||
if (handlerClassifiedGodDelete != null)
|
||||
handlerClassifiedGodDelete(
|
||||
classifiedGodDelete.Data.ClassifiedID,
|
||||
classifiedGodDelete.Data.QueryID,
|
||||
this);
|
||||
return true;
|
||||
}
|
||||
@@ -12128,10 +12000,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
|
||||
|
||||
|
||||
//Note, the bool returned from the below function is useless since it is always false.
|
||||
m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -158,7 +158,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private int m_defaultRTO = 1000; // 1sec is the recommendation in the RFC
|
||||
private int m_maxRTO = 60000;
|
||||
public bool m_deliverPackets = true;
|
||||
|
||||
/// <summary>
|
||||
/// Default constructor
|
||||
@@ -440,13 +439,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (category >= 0 && category < m_packetOutboxes.Length)
|
||||
{
|
||||
OpenSim.Framework.LocklessQueue<OutgoingPacket> queue = m_packetOutboxes[category];
|
||||
|
||||
if (m_deliverPackets == false)
|
||||
{
|
||||
queue.Enqueue(packet);
|
||||
return true;
|
||||
}
|
||||
|
||||
TokenBucket bucket = m_throttleCategories[category];
|
||||
|
||||
// Don't send this packet if there is already a packet waiting in the queue
|
||||
@@ -496,9 +488,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
/// <returns>True if any packets were sent, otherwise false</returns>
|
||||
public bool DequeueOutgoing()
|
||||
{
|
||||
if (m_deliverPackets == false) return false;
|
||||
|
||||
OutgoingPacket packet = null;
|
||||
OutgoingPacket packet;
|
||||
OpenSim.Framework.LocklessQueue<OutgoingPacket> queue;
|
||||
TokenBucket bucket;
|
||||
bool packetSent = false;
|
||||
@@ -530,49 +520,32 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
// No dequeued packet waiting to be sent, try to pull one off
|
||||
// this queue
|
||||
queue = m_packetOutboxes[i];
|
||||
if (queue != null)
|
||||
if (queue.Dequeue(out packet))
|
||||
{
|
||||
bool success = false;
|
||||
try
|
||||
// A packet was pulled off the queue. See if we have
|
||||
// enough tokens in the bucket to send it out
|
||||
if (bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||
{
|
||||
success = queue.Dequeue(out packet);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>();
|
||||
}
|
||||
if (success)
|
||||
{
|
||||
// A packet was pulled off the queue. See if we have
|
||||
// enough tokens in the bucket to send it out
|
||||
if (bucket.RemoveTokens(packet.Buffer.DataLength))
|
||||
{
|
||||
// Send the packet
|
||||
m_udpServer.SendPacketFinal(packet);
|
||||
packetSent = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Save the dequeued packet for the next iteration
|
||||
m_nextPackets[i] = packet;
|
||||
}
|
||||
|
||||
// If the queue is empty after this dequeue, fire the queue
|
||||
// empty callback now so it has a chance to fill before we
|
||||
// get back here
|
||||
if (queue.Count == 0)
|
||||
emptyCategories |= CategoryToFlag(i);
|
||||
// Send the packet
|
||||
m_udpServer.SendPacketFinal(packet);
|
||||
packetSent = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// No packets in this queue. Fire the queue empty callback
|
||||
// if it has not been called recently
|
||||
emptyCategories |= CategoryToFlag(i);
|
||||
// Save the dequeued packet for the next iteration
|
||||
m_nextPackets[i] = packet;
|
||||
}
|
||||
|
||||
// If the queue is empty after this dequeue, fire the queue
|
||||
// empty callback now so it has a chance to fill before we
|
||||
// get back here
|
||||
if (queue.Count == 0)
|
||||
emptyCategories |= CategoryToFlag(i);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_packetOutboxes[i] = new OpenSim.Framework.LocklessQueue<OutgoingPacket>();
|
||||
// No packets in this queue. Fire the queue empty callback
|
||||
// if it has not been called recently
|
||||
emptyCategories |= CategoryToFlag(i);
|
||||
}
|
||||
}
|
||||
@@ -730,4 +703,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -903,47 +903,64 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private void HandleUseCircuitCode(object o)
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
IPEndPoint remoteEndPoint = null;
|
||||
IClientAPI client = null;
|
||||
|
||||
try
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
|
||||
|
||||
remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
{
|
||||
// Begin the process of adding the client to the simulator
|
||||
client
|
||||
= AddClient(
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
sessionInfo);
|
||||
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
client.SceneAgent.SendInitialDataToMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
|
||||
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
|
||||
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
|
||||
|
||||
IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
{
|
||||
// Begin the process of adding the client to the simulator
|
||||
IClientAPI client
|
||||
= AddClient(
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
sessionInfo);
|
||||
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
client.SceneAgent.SendInitialDataToMe();
|
||||
}
|
||||
else
|
||||
catch (Exception e)
|
||||
{
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
|
||||
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
m_log.ErrorFormat(
|
||||
"[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
|
||||
remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
|
||||
client != null ? client.Name : "unknown",
|
||||
client != null ? client.AgentId.ToString() : "unknown",
|
||||
e.Message,
|
||||
e.StackTrace);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
|
||||
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1031,7 +1048,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
if (m_scene.TryGetClient(udpClient.AgentID, out client))
|
||||
{
|
||||
client.IsLoggingOut = true;
|
||||
client.Close(false);
|
||||
client.Close();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1043,7 +1060,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
while (base.IsRunning)
|
||||
{
|
||||
m_scene.ThreadAlive(1);
|
||||
try
|
||||
{
|
||||
IncomingPacket incomingPacket = null;
|
||||
@@ -1086,7 +1102,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
while (base.IsRunning)
|
||||
{
|
||||
m_scene.ThreadAlive(2);
|
||||
try
|
||||
{
|
||||
m_packetSent = false;
|
||||
|
||||
@@ -100,6 +100,10 @@ namespace OpenMetaverse
|
||||
const int SIO_UDP_CONNRESET = -1744830452;
|
||||
|
||||
IPEndPoint ipep = new IPEndPoint(m_localBindAddress, m_udpPort);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[UDPBASE]: Binding UDP listener using internal IP address config {0}:{1}",
|
||||
ipep.Address, ipep.Port);
|
||||
|
||||
m_udpSocket = new Socket(
|
||||
AddressFamily.InterNetwork,
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -39,13 +38,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
{
|
||||
public class AssetXferUploader
|
||||
{
|
||||
// Viewer's notion of the default texture
|
||||
private List<UUID> defaultIDs = new List<UUID> {
|
||||
new UUID("5748decc-f629-461c-9a36-a35a221fe21f"),
|
||||
new UUID("7ca39b4c-bd19-4699-aff7-f93fd03d3e7b"),
|
||||
new UUID("6522e74d-1660-4e7f-b601-6f48c1659a77"),
|
||||
new UUID("c228d1cf-4b5d-4ba8-84f4-899a0796aa97")
|
||||
};
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
@@ -73,7 +65,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
private UUID TransactionID = UUID.Zero;
|
||||
private sbyte type = 0;
|
||||
private byte wearableType = 0;
|
||||
private byte[] m_oldData = null;
|
||||
public ulong XferID;
|
||||
private Scene m_Scene;
|
||||
|
||||
@@ -311,7 +302,6 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
|
||||
private void DoCreateItem(uint callbackID)
|
||||
{
|
||||
ValidateAssets();
|
||||
m_Scene.AssetService.Store(m_asset);
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase();
|
||||
@@ -332,84 +322,12 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
item.Flags = (uint) wearableType;
|
||||
item.CreationDate = Util.UnixTimeSinceEpoch();
|
||||
|
||||
m_log.DebugFormat("[XFER]: Created item {0} with asset {1}",
|
||||
item.ID, item.AssetID);
|
||||
|
||||
if (m_Scene.AddInventoryItem(item))
|
||||
ourClient.SendInventoryItemCreateUpdate(item, callbackID);
|
||||
else
|
||||
ourClient.SendAlertMessage("Unable to create inventory item");
|
||||
}
|
||||
|
||||
private void ValidateAssets()
|
||||
{
|
||||
if (m_asset.Type == (sbyte)AssetType.Clothing ||
|
||||
m_asset.Type == (sbyte)AssetType.Bodypart)
|
||||
{
|
||||
string content = System.Text.Encoding.ASCII.GetString(m_asset.Data);
|
||||
string[] lines = content.Split(new char[] {'\n'});
|
||||
|
||||
List<string> validated = new List<string>();
|
||||
|
||||
Dictionary<int, UUID> allowed = ExtractTexturesFromOldData();
|
||||
|
||||
int textures = 0;
|
||||
|
||||
foreach (string line in lines)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (line.StartsWith("textures "))
|
||||
{
|
||||
textures = Convert.ToInt32(line.Substring(9));
|
||||
validated.Add(line);
|
||||
}
|
||||
else if (textures > 0)
|
||||
{
|
||||
string[] parts = line.Split(new char[] {' '});
|
||||
|
||||
UUID tx = new UUID(parts[1]);
|
||||
int id = Convert.ToInt32(parts[0]);
|
||||
|
||||
if (defaultIDs.Contains(tx) || tx == UUID.Zero ||
|
||||
(allowed.ContainsKey(id) && allowed[id] == tx))
|
||||
{
|
||||
validated.Add(parts[0] + " " + tx.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
int perms = m_Scene.InventoryService.GetAssetPermissions(ourClient.AgentId, tx);
|
||||
int full = (int)(PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Copy);
|
||||
|
||||
if ((perms & full) != full)
|
||||
{
|
||||
m_log.ErrorFormat("[ASSET UPLOADER]: REJECTED update with texture {0} from {1} because they do not own the texture", tx, ourClient.AgentId);
|
||||
validated.Add(parts[0] + " " + UUID.Zero.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
validated.Add(line);
|
||||
}
|
||||
}
|
||||
textures--;
|
||||
}
|
||||
else
|
||||
{
|
||||
validated.Add(line);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// If it's malformed, skip it
|
||||
}
|
||||
}
|
||||
|
||||
string final = String.Join("\n", validated.ToArray());
|
||||
|
||||
m_asset.Data = System.Text.Encoding.ASCII.GetBytes(final);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the asset data uploaded in this transfer.
|
||||
/// </summary>
|
||||
@@ -418,55 +336,10 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
|
||||
{
|
||||
if (m_finished)
|
||||
{
|
||||
ValidateAssets();
|
||||
return m_asset;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void SetOldData(byte[] d)
|
||||
{
|
||||
m_oldData = d;
|
||||
}
|
||||
|
||||
private Dictionary<int,UUID> ExtractTexturesFromOldData()
|
||||
{
|
||||
Dictionary<int,UUID> result = new Dictionary<int,UUID>();
|
||||
if (m_oldData == null)
|
||||
return result;
|
||||
|
||||
string content = System.Text.Encoding.ASCII.GetString(m_oldData);
|
||||
string[] lines = content.Split(new char[] {'\n'});
|
||||
|
||||
int textures = 0;
|
||||
|
||||
foreach (string line in lines)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (line.StartsWith("textures "))
|
||||
{
|
||||
textures = Convert.ToInt32(line.Substring(9));
|
||||
}
|
||||
else if (textures > 0)
|
||||
{
|
||||
string[] parts = line.Split(new char[] {' '});
|
||||
|
||||
UUID tx = new UUID(parts[1]);
|
||||
int id = Convert.ToInt32(parts[0]);
|
||||
result[id] = tx;
|
||||
textures--;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// If it's malformed, skip it
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -257,66 +257,53 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
|
||||
private void UpdateFileCache(string key, AssetBase asset)
|
||||
{
|
||||
// TODO: Spawn this off to some seperate thread to do the actual writing
|
||||
if (asset != null)
|
||||
string filename = GetFileName(asset.ID);
|
||||
|
||||
try
|
||||
{
|
||||
string filename = GetFileName(key);
|
||||
|
||||
try
|
||||
// If the file is already cached, don't cache it, just touch it so access time is updated
|
||||
if (File.Exists(filename))
|
||||
{
|
||||
// If the file is already cached, don't cache it, just touch it so access time is updated
|
||||
if (File.Exists(filename))
|
||||
File.SetLastAccessTime(filename, DateTime.Now);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Once we start writing, make sure we flag that we're writing
|
||||
// that object to the cache so that we don't try to write the
|
||||
// same file multiple times.
|
||||
lock (m_CurrentlyWriting)
|
||||
{
|
||||
// We don't really want to know about sharing
|
||||
// violations here. If the file is locked, then
|
||||
// the other thread has updated the time for us.
|
||||
try
|
||||
{
|
||||
File.SetLastAccessTime(filename, DateTime.Now);
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
} else {
|
||||
|
||||
// Once we start writing, make sure we flag that we're writing
|
||||
// that object to the cache so that we don't try to write the
|
||||
// same file multiple times.
|
||||
lock (m_CurrentlyWriting)
|
||||
{
|
||||
#if WAIT_ON_INPROGRESS_REQUESTS
|
||||
if (m_CurrentlyWriting.ContainsKey(filename))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_CurrentlyWriting.Add(filename, new ManualResetEvent(false));
|
||||
}
|
||||
if (m_CurrentlyWriting.ContainsKey(filename))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_CurrentlyWriting.Add(filename, new ManualResetEvent(false));
|
||||
}
|
||||
|
||||
#else
|
||||
if (m_CurrentlyWriting.Contains(filename))
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_CurrentlyWriting.Add(filename);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (m_CurrentlyWriting.Contains(filename))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Util.FireAndForget(
|
||||
delegate { WriteFileCache(filename, asset); });
|
||||
else
|
||||
{
|
||||
m_CurrentlyWriting.Add(filename);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Util.FireAndForget(
|
||||
delegate { WriteFileCache(filename, asset); });
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[FLOTSAM ASSET CACHE]: Failed to update cache for asset {0}. Exception {1} {2}",
|
||||
asset.ID, e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[FLOTSAM ASSET CACHE]: Failed to update cache for asset {0}. Exception {1} {2}",
|
||||
asset.ID, e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
@@ -39,7 +38,6 @@ using OpenSim.Region.Framework;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Scenes.Serialization;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
{
|
||||
@@ -117,40 +115,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
// m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing any attachments for {0}", sp.Name);
|
||||
|
||||
XmlDocument doc = new XmlDocument();
|
||||
string stateData = String.Empty;
|
||||
|
||||
IAttachmentsService attServ = m_scene.RequestModuleInterface<IAttachmentsService>();
|
||||
if (attServ != null)
|
||||
{
|
||||
m_log.DebugFormat("[ATTACHMENT]: Loading attachment data from attachment service");
|
||||
stateData = attServ.Get(sp.UUID.ToString());
|
||||
if (stateData != String.Empty)
|
||||
{
|
||||
try
|
||||
{
|
||||
doc.LoadXml(stateData);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
Dictionary<UUID, string> itemData = new Dictionary<UUID, string>();
|
||||
|
||||
XmlNodeList nodes = doc.GetElementsByTagName("Attachment");
|
||||
if (nodes.Count > 0)
|
||||
{
|
||||
foreach (XmlNode n in nodes)
|
||||
{
|
||||
XmlElement elem = (XmlElement)n;
|
||||
string itemID = elem.GetAttribute("ItemID");
|
||||
string xml = elem.InnerXml;
|
||||
|
||||
itemData[new UUID(itemID)] = xml;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<AvatarAttachment> attachments = sp.Appearance.GetAttachments();
|
||||
foreach (AvatarAttachment attach in attachments)
|
||||
{
|
||||
@@ -170,22 +134,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
try
|
||||
{
|
||||
string xmlData;
|
||||
XmlDocument d = null;
|
||||
UUID asset;
|
||||
if (itemData.TryGetValue(attach.ItemID, out xmlData))
|
||||
{
|
||||
d = new XmlDocument();
|
||||
d.LoadXml(xmlData);
|
||||
m_log.InfoFormat("[ATTACHMENT]: Found saved state for item {0}, loading it", attach.ItemID);
|
||||
}
|
||||
|
||||
// If we're an NPC then skip all the item checks and manipulations since we don't have an
|
||||
// inventory right now.
|
||||
if (sp.PresenceType == PresenceType.Npc)
|
||||
RezSingleAttachmentFromInventoryInternal(sp, UUID.Zero, attach.AssetID, p, null);
|
||||
RezSingleAttachmentFromInventoryInternal(sp, UUID.Zero, attach.AssetID, p);
|
||||
else
|
||||
RezSingleAttachmentFromInventory(sp, attach.ItemID, p, true, d);
|
||||
RezSingleAttachmentFromInventory(sp, attach.ItemID, p);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -310,11 +264,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
}
|
||||
|
||||
public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt)
|
||||
{
|
||||
return RezSingleAttachmentFromInventory(sp, itemID, AttachmentPt, true, null);
|
||||
}
|
||||
|
||||
public ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc)
|
||||
{
|
||||
if (!Enabled)
|
||||
return null;
|
||||
@@ -353,7 +302,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
return null;
|
||||
}
|
||||
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(sp, itemID, UUID.Zero, AttachmentPt, doc);
|
||||
SceneObjectGroup att = RezSingleAttachmentFromInventoryInternal(sp, itemID, UUID.Zero, AttachmentPt);
|
||||
|
||||
if (att == null)
|
||||
DetachSingleAttachmentToInv(sp, itemID);
|
||||
@@ -633,11 +582,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
Vector3 inventoryStoredPosition = new Vector3
|
||||
(((grp.AbsolutePosition.X > (int)Constants.RegionSize)
|
||||
? (float)Constants.RegionSize - 6
|
||||
? Constants.RegionSize - 6
|
||||
: grp.AbsolutePosition.X)
|
||||
,
|
||||
(grp.AbsolutePosition.Y > (int)Constants.RegionSize)
|
||||
? (float)Constants.RegionSize - 6
|
||||
? Constants.RegionSize - 6
|
||||
: grp.AbsolutePosition.Y,
|
||||
grp.AbsolutePosition.Z);
|
||||
|
||||
@@ -755,8 +704,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
}
|
||||
}
|
||||
|
||||
protected SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
||||
IScenePresence sp, UUID itemID, UUID assetID, uint attachmentPt, XmlDocument doc)
|
||||
private SceneObjectGroup RezSingleAttachmentFromInventoryInternal(
|
||||
IScenePresence sp, UUID itemID, UUID assetID, uint attachmentPt)
|
||||
{
|
||||
IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
|
||||
if (invAccess != null)
|
||||
@@ -764,7 +713,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
lock (sp.AttachmentsSyncLock)
|
||||
{
|
||||
SceneObjectGroup objatt;
|
||||
|
||||
|
||||
if (itemID != UUID.Zero)
|
||||
objatt = invAccess.RezObject(sp.ControllingClient,
|
||||
itemID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
|
||||
@@ -773,11 +722,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
objatt = invAccess.RezObject(sp.ControllingClient,
|
||||
null, assetID, Vector3.Zero, Vector3.Zero, UUID.Zero, (byte)1, true,
|
||||
false, false, sp.UUID, true);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}",
|
||||
// objatt.Name, remoteClient.Name, AttachmentPt);
|
||||
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[ATTACHMENTS MODULE]: Retrieved single object {0} for attachment to {1} on point {2}",
|
||||
// objatt.Name, remoteClient.Name, AttachmentPt);
|
||||
|
||||
if (objatt != null)
|
||||
{
|
||||
// HasGroupChanged is being set from within RezObject. Ideally it would be set by the caller.
|
||||
@@ -785,7 +734,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
bool tainted = false;
|
||||
if (attachmentPt != 0 && attachmentPt != objatt.AttachmentPoint)
|
||||
tainted = true;
|
||||
|
||||
|
||||
// This will throw if the attachment fails
|
||||
try
|
||||
{
|
||||
@@ -796,27 +745,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
m_log.ErrorFormat(
|
||||
"[ATTACHMENTS MODULE]: Failed to attach {0} {1} for {2}, exception {3}{4}",
|
||||
objatt.Name, objatt.UUID, sp.Name, e.Message, e.StackTrace);
|
||||
|
||||
|
||||
// Make sure the object doesn't stick around and bail
|
||||
sp.RemoveAttachment(objatt);
|
||||
m_scene.DeleteSceneObject(objatt, false);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
if (tainted)
|
||||
objatt.HasGroupChanged = true;
|
||||
|
||||
if (doc != null)
|
||||
{
|
||||
objatt.LoadScriptState(doc);
|
||||
objatt.ResetOwnerChangeFlag();
|
||||
}
|
||||
|
||||
// Fire after attach, so we don't get messy perms dialogs
|
||||
// 4 == AttachedRez
|
||||
objatt.CreateScriptInstances(0, true, m_scene.DefaultScriptEngine, 4);
|
||||
objatt.ResumeScripts();
|
||||
|
||||
|
||||
// Do this last so that event listeners have access to all the effects of the attachment
|
||||
m_scene.EventManager.TriggerOnAttach(objatt.LocalId, itemID, sp.UUID);
|
||||
|
||||
@@ -830,7 +773,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,6 +111,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
|
||||
#region IAvatarFactoryModule
|
||||
|
||||
/// </summary>
|
||||
/// <param name="sp"></param>
|
||||
/// <param name="texture"></param>
|
||||
/// <param name="visualParam"></param>
|
||||
public void SetAppearance(IScenePresence sp, AvatarAppearance appearance)
|
||||
{
|
||||
SetAppearance(sp, appearance.Texture, appearance.VisualParams);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set appearance data (texture asset IDs and slider settings)
|
||||
/// </summary>
|
||||
@@ -156,14 +165,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
|
||||
|
||||
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
|
||||
if (!ValidateBakedTextureCache(sp))
|
||||
|
||||
// If bake textures are missing and this is not an NPC, request a rebake from client
|
||||
if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc))
|
||||
RequestRebake(sp, true);
|
||||
|
||||
// This appears to be set only in the final stage of the appearance
|
||||
// update transaction. In theory, we should be able to do an immediate
|
||||
// appearance send and save here.
|
||||
}
|
||||
|
||||
|
||||
// NPC should send to clients immediately and skip saving appearance
|
||||
if (((ScenePresence)sp).PresenceType == PresenceType.Npc)
|
||||
{
|
||||
SendAppearance((ScenePresence)sp);
|
||||
return;
|
||||
}
|
||||
|
||||
// save only if there were changes, send no matter what (doesn't hurt to send twice)
|
||||
if (changed)
|
||||
QueueAppearanceSave(sp.ControllingClient.AgentId);
|
||||
@@ -174,6 +192,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
|
||||
}
|
||||
|
||||
private void SendAppearance(ScenePresence sp)
|
||||
{
|
||||
// Send the appearance to everyone in the scene
|
||||
sp.SendAppearanceToAllOtherAgents();
|
||||
|
||||
// Send animations back to the avatar as well
|
||||
sp.Animator.SendAnimPack();
|
||||
}
|
||||
|
||||
public bool SendAppearance(UUID agentId)
|
||||
{
|
||||
// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
|
||||
@@ -185,12 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send the appearance to everyone in the scene
|
||||
sp.SendAppearanceToAllOtherAgents();
|
||||
|
||||
// Send animations back to the avatar as well
|
||||
sp.Animator.SendAnimPack();
|
||||
|
||||
SendAppearance(sp);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -474,6 +496,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
SetAppearanceAssets(sp.UUID, sp.Appearance);
|
||||
|
||||
m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
|
||||
|
||||
// Trigger this here because it's the final step in the set/queue/save process for appearance setting.
|
||||
// Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
|
||||
m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
|
||||
}
|
||||
|
||||
private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)
|
||||
@@ -626,4 +652,4 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,8 +49,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
private int m_shoutdistance = 100;
|
||||
private int m_whisperdistance = 10;
|
||||
private List<Scene> m_scenes = new List<Scene>();
|
||||
private List<string> FreezeCache = new List<string>();
|
||||
private string m_adminPrefix = "";
|
||||
|
||||
internal object m_syncy = new object();
|
||||
|
||||
internal IConfig m_config;
|
||||
@@ -77,7 +76,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
|
||||
m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance);
|
||||
m_shoutdistance = config.Configs["Chat"].GetInt("shout_distance", m_shoutdistance);
|
||||
m_adminPrefix = config.Configs["Chat"].GetString("admin_prefix", "");
|
||||
}
|
||||
|
||||
public virtual void AddRegion(Scene scene)
|
||||
@@ -173,15 +171,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
return;
|
||||
}
|
||||
|
||||
if (FreezeCache.Contains(c.Sender.AgentId.ToString()))
|
||||
{
|
||||
if (c.Type != ChatTypeEnum.StartTyping || c.Type != ChatTypeEnum.StopTyping)
|
||||
c.Sender.SendAgentAlertMessage("You may not talk as you are frozen.", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeliverChatToAvatars(ChatSourceType.Agent, c);
|
||||
}
|
||||
DeliverChatToAvatars(ChatSourceType.Agent, c);
|
||||
}
|
||||
|
||||
public virtual void OnChatFromWorld(Object sender, OSChatMessage c)
|
||||
@@ -195,7 +185,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
protected virtual void DeliverChatToAvatars(ChatSourceType sourceType, OSChatMessage c)
|
||||
{
|
||||
string fromName = c.From;
|
||||
string fromNamePrefix = "";
|
||||
UUID fromID = UUID.Zero;
|
||||
string message = c.Message;
|
||||
IScene scene = c.Scene;
|
||||
@@ -218,10 +207,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
fromPos = avatar.AbsolutePosition;
|
||||
fromName = avatar.Name;
|
||||
fromID = c.Sender.AgentId;
|
||||
if (avatar.GodLevel >= 200)
|
||||
{
|
||||
fromNamePrefix = m_adminPrefix;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case ChatSourceType.Object:
|
||||
@@ -247,20 +233,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
s.ForEachRootScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
ILandObject Presencecheck = s.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y);
|
||||
if (Presencecheck != null)
|
||||
{
|
||||
// This will pass all chat from objects. Not
|
||||
// perfect, but it will do. For now. Better
|
||||
// than the prior behavior of muting all
|
||||
// objects on a parcel with access restrictions
|
||||
if (c.Sender == null || Presencecheck.IsEitherBannedOrRestricted(c.Sender.AgentId) != true)
|
||||
{
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromNamePrefix + fromName, c.Type, message, sourceType))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
}
|
||||
|
||||
if (TrySendChatMessage(presence, fromPos, regionPos, fromID, fromName, c.Type, message, sourceType))
|
||||
receiverIDs.Add(presence.UUID);
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -304,29 +278,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[CHAT] Broadcast: fromID {0} fromName {1}, cType {2}, sType {3}", fromID, fromName, cType, sourceType);
|
||||
|
||||
HashSet<UUID> receiverIDs = new HashSet<UUID>();
|
||||
|
||||
if (c.Scene != null)
|
||||
{
|
||||
((Scene)c.Scene).ForEachRootClient
|
||||
(
|
||||
delegate(IClientAPI client)
|
||||
{
|
||||
// don't forward SayOwner chat from objects to
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
receiverIDs.Add(client.AgentId);
|
||||
}
|
||||
);
|
||||
(c.Scene as Scene).EventManager.TriggerOnChatToClients(
|
||||
fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully);
|
||||
}
|
||||
((Scene)c.Scene).ForEachRootClient(
|
||||
delegate(IClientAPI client)
|
||||
{
|
||||
// don't forward SayOwner chat from objects to
|
||||
// non-owner agents
|
||||
if ((c.Type == ChatTypeEnum.Owner) &&
|
||||
(null != c.SenderObject) &&
|
||||
(((SceneObjectPart)c.SenderObject).OwnerID != client.AgentId))
|
||||
return;
|
||||
|
||||
client.SendChatMessage(c.Message, (byte)cType, CenterOfRegion, fromName, fromID,
|
||||
(byte)sourceType, (byte)ChatAudibleLevel.Fully);
|
||||
receiverIDs.Add(client.AgentId);
|
||||
});
|
||||
|
||||
(c.Scene as Scene).EventManager.TriggerOnChatToClients(
|
||||
fromID, receiverIDs, c.Message, cType, CenterOfRegion, fromName, sourceType, ChatAudibleLevel.Fully);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -369,35 +340,5 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
|
||||
public void ParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
System.Threading.Timer Timer;
|
||||
if (flags == 0)
|
||||
{
|
||||
FreezeCache.Add(target.ToString());
|
||||
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
|
||||
Timer = new System.Threading.Timer(timeCB, target, 30000, 0);
|
||||
Timers.Add(target, Timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
FreezeCache.Remove(target.ToString());
|
||||
Timers.TryGetValue(target, out Timer);
|
||||
Timers.Remove(target);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEndParcelFrozen(object avatar)
|
||||
{
|
||||
UUID target = (UUID)avatar;
|
||||
FreezeCache.Remove(target.ToString());
|
||||
System.Threading.Timer Timer;
|
||||
Timers.TryGetValue(target, out Timer);
|
||||
Timers.Remove(target);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,4 +216,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -328,7 +328,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
//m_log.DebugFormat("[XXX]: OnClientLogin!");
|
||||
// Inform the friends that this user is online
|
||||
StatusChange(agentID, true);
|
||||
|
||||
|
||||
// Register that we need to send the list of online friends to this user
|
||||
lock (m_NeedsListOfOnlineFriends)
|
||||
m_NeedsListOfOnlineFriends.Add(agentID);
|
||||
@@ -603,12 +603,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
{
|
||||
StoreFriendships(client.AgentId, friendID);
|
||||
|
||||
ICallingCardModule ccm = client.Scene.RequestModuleInterface<ICallingCardModule>();
|
||||
if (ccm != null)
|
||||
{
|
||||
ccm.CreateCallingCard(client.AgentId, friendID, UUID.Zero);
|
||||
}
|
||||
|
||||
// Update the local cache
|
||||
RecacheFriends(client);
|
||||
|
||||
@@ -785,13 +779,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
(byte)OpenMetaverse.InstantMessageDialog.FriendshipAccepted, userID.ToString(), false, Vector3.Zero);
|
||||
friendClient.SendInstantMessage(im);
|
||||
|
||||
ICallingCardModule ccm = friendClient.Scene.RequestModuleInterface<ICallingCardModule>();
|
||||
if (ccm != null)
|
||||
{
|
||||
ccm.CreateCallingCard(friendID, userID, UUID.Zero);
|
||||
}
|
||||
|
||||
|
||||
// Update the local cache
|
||||
RecacheFriends(friendClient);
|
||||
|
||||
@@ -814,7 +801,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
// we're done
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -866,7 +853,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
|
||||
|
||||
public bool LocalStatusNotification(UUID userID, UUID friendID, bool online)
|
||||
{
|
||||
//m_log.DebugFormat("[FRIENDS]: Local Status Notify {0} that user {1} is {2}", friendID, userID, online);
|
||||
// m_log.DebugFormat("[FRIENDS]: Local Status Notify {0} that user {1} is {2}", friendID, userID, online);
|
||||
IClientAPI friendClient = LocateClientObject(friendID);
|
||||
if (friendClient != null)
|
||||
{
|
||||
|
||||
@@ -31,40 +31,16 @@ using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Collections;
|
||||
using System.Collections.Specialized;
|
||||
using System.Reflection;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using OpenMetaverse.Messages.Linden;
|
||||
using OpenMetaverse.StructuredData;
|
||||
using OpenSim.Framework.Capabilities;
|
||||
using OpenSim.Framework.Servers;
|
||||
using OpenSim.Framework.Servers.HttpServer;
|
||||
using Caps = OpenSim.Framework.Capabilities.Caps;
|
||||
using OSDArray = OpenMetaverse.StructuredData.OSDArray;
|
||||
using OSDMap = OpenMetaverse.StructuredData.OSDMap;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
{
|
||||
public class GodsModule : IRegionModule, IGodsModule
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>Special UUID for actions that apply to all agents</summary>
|
||||
private static readonly UUID ALL_AGENTS = new UUID("44e87126-e794-4ded-05b3-7c42da3d5cdb");
|
||||
|
||||
protected Scene m_scene;
|
||||
protected IDialogModule m_dialogModule;
|
||||
|
||||
protected Dictionary<UUID, string> m_capsDict =
|
||||
new Dictionary<UUID, string>();
|
||||
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
@@ -72,10 +48,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
m_dialogModule = m_scene.RequestModuleInterface<IDialogModule>();
|
||||
m_scene.RegisterModuleInterface<IGodsModule>(this);
|
||||
m_scene.EventManager.OnNewClient += SubscribeToClientEvents;
|
||||
m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||
m_scene.EventManager.OnClientClosed += OnClientClosed;
|
||||
scene.EventManager.OnIncomingInstantMessage +=
|
||||
OnIncomingInstantMessage;
|
||||
}
|
||||
|
||||
public void PostInitialise() {}
|
||||
@@ -95,54 +67,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
client.OnRequestGodlikePowers -= RequestGodlikePowers;
|
||||
}
|
||||
|
||||
private void OnClientClosed(UUID agentID, Scene scene)
|
||||
{
|
||||
m_capsDict.Remove(agentID);
|
||||
}
|
||||
|
||||
private void OnRegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
string uri = "/CAPS/" + UUID.Random();
|
||||
m_capsDict[agentID] = uri;
|
||||
|
||||
caps.RegisterHandler("UntrustedSimulatorMessage",
|
||||
new RestStreamHandler("POST", uri,
|
||||
HandleUntrustedSimulatorMessage));
|
||||
}
|
||||
|
||||
private string HandleUntrustedSimulatorMessage(string request,
|
||||
string path, string param, IOSHttpRequest httpRequest,
|
||||
IOSHttpResponse httpResponse)
|
||||
{
|
||||
OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request);
|
||||
|
||||
string message = osd["message"].AsString();
|
||||
|
||||
if (message == "GodKickUser")
|
||||
{
|
||||
OSDMap body = (OSDMap)osd["body"];
|
||||
OSDArray userInfo = (OSDArray)body["UserInfo"];
|
||||
OSDMap userData = (OSDMap)userInfo[0];
|
||||
|
||||
UUID agentID = userData["AgentID"].AsUUID();
|
||||
UUID godID = userData["GodID"].AsUUID();
|
||||
UUID godSessionID = userData["GodSessionID"].AsUUID();
|
||||
uint kickFlags = userData["KickFlags"].AsUInteger();
|
||||
string reason = userData["Reason"].AsString();
|
||||
|
||||
ScenePresence god = m_scene.GetScenePresence(godID);
|
||||
if (god == null || god.ControllingClient.SessionId != godSessionID)
|
||||
return String.Empty;
|
||||
|
||||
KickUser(godID, godSessionID, agentID, kickFlags, Util.StringToBytes1024(reason));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat("[GOD]: Unhandled UntrustedSimulatorMessage: {0}", message);
|
||||
}
|
||||
return String.Empty;
|
||||
}
|
||||
|
||||
public void RequestGodlikePowers(
|
||||
UUID agentID, UUID sessionID, UUID token, bool godLike, IClientAPI controllingClient)
|
||||
{
|
||||
@@ -191,85 +115,69 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods
|
||||
/// <param name="reason">The message to send to the user after it's been turned into a field</param>
|
||||
public void KickUser(UUID godID, UUID sessionID, UUID agentID, uint kickflags, byte[] reason)
|
||||
{
|
||||
if (!m_scene.Permissions.IsGod(godID))
|
||||
return;
|
||||
|
||||
UUID kickUserID = ALL_AGENTS;
|
||||
|
||||
ScenePresence sp = m_scene.GetScenePresence(agentID);
|
||||
|
||||
if (sp == null && agentID != ALL_AGENTS)
|
||||
if (sp != null || agentID == kickUserID)
|
||||
{
|
||||
IMessageTransferModule transferModule =
|
||||
m_scene.RequestModuleInterface<IMessageTransferModule>();
|
||||
if (transferModule != null)
|
||||
if (m_scene.Permissions.IsGod(godID))
|
||||
{
|
||||
m_log.DebugFormat("[GODS]: Sending nonlocal kill for agent {0}", agentID);
|
||||
transferModule.SendInstantMessage(new GridInstantMessage(
|
||||
m_scene, godID, "God", agentID, (byte)250, false,
|
||||
Utils.BytesToString(reason), UUID.Zero, true,
|
||||
new Vector3(), new byte[] {(byte)kickflags}),
|
||||
delegate(bool success) {} );
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (kickflags == 0)
|
||||
{
|
||||
if (agentID == kickUserID)
|
||||
{
|
||||
string reasonStr = Utils.BytesToString(reason);
|
||||
|
||||
switch (kickflags)
|
||||
{
|
||||
case 0:
|
||||
if (sp != null)
|
||||
{
|
||||
KickPresence(sp, Utils.BytesToString(reason));
|
||||
}
|
||||
else if (agentID == ALL_AGENTS)
|
||||
{
|
||||
m_scene.ForEachRootScenePresence(
|
||||
delegate(ScenePresence p)
|
||||
{
|
||||
if (p.UUID != godID && (!m_scene.Permissions.IsGod(p.UUID)))
|
||||
KickPresence(p, Utils.BytesToString(reason));
|
||||
}
|
||||
);
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (sp != null)
|
||||
{
|
||||
sp.AllowMovement = false;
|
||||
m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
|
||||
m_dialogModule.SendAlertToUser(godID, "User Frozen");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (sp != null)
|
||||
{
|
||||
sp.AllowMovement = true;
|
||||
m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
|
||||
m_dialogModule.SendAlertToUser(godID, "User Unfrozen");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
m_scene.ForEachClient(
|
||||
delegate(IClientAPI controller)
|
||||
{
|
||||
if (controller.AgentId != godID)
|
||||
controller.Kick(reasonStr);
|
||||
}
|
||||
);
|
||||
|
||||
private void KickPresence(ScenePresence sp, string reason)
|
||||
{
|
||||
if (sp.IsChildAgent)
|
||||
return;
|
||||
sp.ControllingClient.Kick(reason);
|
||||
sp.Scene.IncomingCloseAgent(sp.UUID);
|
||||
}
|
||||
// This is a bit crude. It seems the client will be null before it actually stops the thread
|
||||
// The thread will kill itself eventually :/
|
||||
// Is there another way to make sure *all* clients get this 'inter region' message?
|
||||
m_scene.ForEachRootClient(
|
||||
delegate(IClientAPI client)
|
||||
{
|
||||
if (client.AgentId != godID)
|
||||
{
|
||||
client.Close();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_scene.SceneGraph.removeUserCount(!sp.IsChildAgent);
|
||||
|
||||
private void OnIncomingInstantMessage(GridInstantMessage msg)
|
||||
{
|
||||
if (msg.dialog == (uint)250) // Nonlocal kick
|
||||
{
|
||||
UUID agentID = new UUID(msg.toAgentID);
|
||||
string reason = msg.message;
|
||||
UUID godID = new UUID(msg.fromAgentID);
|
||||
uint kickMode = (uint)msg.binaryBucket[0];
|
||||
|
||||
KickUser(godID, UUID.Zero, agentID, kickMode, Util.StringToBytes1024(reason));
|
||||
sp.ControllingClient.Kick(Utils.BytesToString(reason));
|
||||
sp.ControllingClient.Close();
|
||||
}
|
||||
}
|
||||
|
||||
if (kickflags == 1)
|
||||
{
|
||||
sp.AllowMovement = false;
|
||||
m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
|
||||
m_dialogModule.SendAlertToUser(godID, "User Frozen");
|
||||
}
|
||||
|
||||
if (kickflags == 2)
|
||||
{
|
||||
sp.AllowMovement = true;
|
||||
m_dialogModule.SendAlertToUser(agentID, Utils.BytesToString(reason));
|
||||
m_dialogModule.SendAlertToUser(godID, "User Unfrozen");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_dialogModule.SendAlertToUser(godID, "Kick request denied");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Timers;
|
||||
using log4net;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
@@ -43,10 +42,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
private static readonly ILog m_log = LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private Timer m_logTimer = new Timer(10000);
|
||||
private List<GridInstantMessage> m_logData = new List<GridInstantMessage>();
|
||||
private string m_restUrl;
|
||||
|
||||
/// <value>
|
||||
/// Is this module enabled?
|
||||
/// </value>
|
||||
@@ -66,12 +61,9 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
"InstantMessageModule", "InstantMessageModule") !=
|
||||
"InstantMessageModule")
|
||||
return;
|
||||
m_restUrl = config.Configs["Messaging"].GetString("LogURL", String.Empty);
|
||||
}
|
||||
|
||||
m_enabled = true;
|
||||
m_logTimer.AutoReset = false;
|
||||
m_logTimer.Elapsed += LogTimerElapsed;
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
@@ -156,9 +148,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
{
|
||||
byte dialog = im.dialog;
|
||||
|
||||
if (client != null && dialog == (byte)InstantMessageDialog.MessageFromAgent)
|
||||
LogInstantMesssage(im);
|
||||
|
||||
if (dialog != (byte)InstantMessageDialog.MessageFromAgent
|
||||
&& dialog != (byte)InstantMessageDialog.StartTyping
|
||||
&& dialog != (byte)InstantMessageDialog.StopTyping
|
||||
@@ -168,32 +157,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
return;
|
||||
}
|
||||
|
||||
//DateTime dt = DateTime.UtcNow;
|
||||
|
||||
// Ticks from UtcNow, but make it look like local. Evil, huh?
|
||||
//dt = DateTime.SpecifyKind(dt, DateTimeKind.Local);
|
||||
|
||||
//try
|
||||
//{
|
||||
// // Convert that to the PST timezone
|
||||
// TimeZoneInfo timeZoneInfo = TimeZoneInfo.FindSystemTimeZoneById("America/Los_Angeles");
|
||||
// dt = TimeZoneInfo.ConvertTime(dt, timeZoneInfo);
|
||||
//}
|
||||
//catch
|
||||
//{
|
||||
// //m_log.Info("[OFFLINE MESSAGING]: No PST timezone found on this machine. Saving with local timestamp.");
|
||||
//}
|
||||
|
||||
//// And make it look local again to fool the unix time util
|
||||
//dt = DateTime.SpecifyKind(dt, DateTimeKind.Utc);
|
||||
|
||||
// If client is null, this message comes from storage and IS offline
|
||||
if (client != null)
|
||||
im.offline = 0;
|
||||
|
||||
if (im.offline == 0)
|
||||
im.timestamp = (uint)Util.UnixTimeSinceEpoch();
|
||||
|
||||
if (m_TransferModule != null)
|
||||
{
|
||||
if (client != null)
|
||||
@@ -237,35 +200,5 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
//
|
||||
OnInstantMessage(null, msg);
|
||||
}
|
||||
|
||||
private void LogInstantMesssage(GridInstantMessage im)
|
||||
{
|
||||
if (m_logData.Count < 20)
|
||||
{
|
||||
// Restart the log write timer
|
||||
m_logTimer.Stop();
|
||||
}
|
||||
if (!m_logTimer.Enabled)
|
||||
m_logTimer.Start();
|
||||
|
||||
lock (m_logData)
|
||||
{
|
||||
m_logData.Add(im);
|
||||
}
|
||||
}
|
||||
|
||||
private void LogTimerElapsed(object source, ElapsedEventArgs e)
|
||||
{
|
||||
lock (m_logData)
|
||||
{
|
||||
if (m_restUrl != String.Empty && m_logData.Count > 0)
|
||||
{
|
||||
bool success = SynchronousRestObjectRequester.MakeRequest<List<GridInstantMessage>, bool>("POST", m_restUrl + "/LogMessages/", m_logData);
|
||||
if (!success)
|
||||
m_log.ErrorFormat("[INSTANT MESSAGE]: Failed to save log data");
|
||||
}
|
||||
m_logData.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private bool m_Enabled = false;
|
||||
protected string m_MessageKey = String.Empty;
|
||||
protected List<Scene> m_Scenes = new List<Scene>();
|
||||
protected Dictionary<UUID, UUID> m_UserRegionMap = new Dictionary<UUID, UUID>();
|
||||
|
||||
@@ -68,17 +67,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
public virtual void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig cnf = config.Configs["Messaging"];
|
||||
if (cnf != null)
|
||||
if (cnf != null && cnf.GetString(
|
||||
"MessageTransferModule", "MessageTransferModule") !=
|
||||
"MessageTransferModule")
|
||||
{
|
||||
if (cnf.GetString("MessageTransferModule",
|
||||
"MessageTransferModule") != "MessageTransferModule")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
m_MessageKey = cnf.GetString("MessageKey", String.Empty);
|
||||
m_log.Debug("[MESSAGE TRANSFER]: Disabled by configuration");
|
||||
return;
|
||||
}
|
||||
m_log.Debug("[MESSAGE TRANSFER]: Module enabled");
|
||||
|
||||
m_Enabled = true;
|
||||
}
|
||||
|
||||
@@ -248,19 +244,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
&& requestData.ContainsKey("position_z") && requestData.ContainsKey("region_id")
|
||||
&& requestData.ContainsKey("binary_bucket"))
|
||||
{
|
||||
if (m_MessageKey != String.Empty)
|
||||
{
|
||||
XmlRpcResponse error_resp = new XmlRpcResponse();
|
||||
Hashtable error_respdata = new Hashtable();
|
||||
error_respdata["success"] = "FALSE";
|
||||
error_resp.Value = error_respdata;
|
||||
|
||||
if (!requestData.Contains("message_key"))
|
||||
return error_resp;
|
||||
if (m_MessageKey != (string)requestData["message_key"])
|
||||
return error_resp;
|
||||
}
|
||||
|
||||
// Do the easy way of validating the UUIDs
|
||||
UUID.TryParse((string)requestData["from_agent_id"], out fromAgentID);
|
||||
UUID.TryParse((string)requestData["to_agent_id"], out toAgentID);
|
||||
@@ -437,37 +420,24 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
return resp;
|
||||
}
|
||||
|
||||
private delegate void GridInstantMessageDelegate(GridInstantMessage im, MessageResultNotification result);
|
||||
/// <summary>
|
||||
/// delegate for sending a grid instant message asynchronously
|
||||
/// </summary>
|
||||
public delegate void GridInstantMessageDelegate(GridInstantMessage im, MessageResultNotification result, UUID prevRegionID);
|
||||
|
||||
private class GIM {
|
||||
public GridInstantMessage im;
|
||||
public MessageResultNotification result;
|
||||
};
|
||||
|
||||
private Queue<GIM> pendingInstantMessages = new Queue<GIM>();
|
||||
private int numInstantMessageThreads = 0;
|
||||
|
||||
private void SendGridInstantMessageViaXMLRPC(GridInstantMessage im, MessageResultNotification result)
|
||||
protected virtual void GridInstantMessageCompleted(IAsyncResult iar)
|
||||
{
|
||||
lock (pendingInstantMessages) {
|
||||
if (numInstantMessageThreads >= 4) {
|
||||
GIM gim = new GIM();
|
||||
gim.im = im;
|
||||
gim.result = result;
|
||||
pendingInstantMessages.Enqueue(gim);
|
||||
} else {
|
||||
++ numInstantMessageThreads;
|
||||
//m_log.DebugFormat("[SendGridInstantMessageViaXMLRPC]: ++numInstantMessageThreads={0}", numInstantMessageThreads);
|
||||
GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsyncMain;
|
||||
d.BeginInvoke(im, result, GridInstantMessageCompleted, d);
|
||||
}
|
||||
}
|
||||
GridInstantMessageDelegate icon =
|
||||
(GridInstantMessageDelegate)iar.AsyncState;
|
||||
icon.EndInvoke(iar);
|
||||
}
|
||||
|
||||
private void GridInstantMessageCompleted(IAsyncResult iar)
|
||||
|
||||
protected virtual void SendGridInstantMessageViaXMLRPC(GridInstantMessage im, MessageResultNotification result)
|
||||
{
|
||||
GridInstantMessageDelegate d = (GridInstantMessageDelegate)iar.AsyncState;
|
||||
d.EndInvoke(iar);
|
||||
GridInstantMessageDelegate d = SendGridInstantMessageViaXMLRPCAsync;
|
||||
|
||||
d.BeginInvoke(im, result, UUID.Zero, GridInstantMessageCompleted, d);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -482,31 +452,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
/// Pass in 0 the first time this method is called. It will be called recursively with the last
|
||||
/// regionhandle tried
|
||||
/// </param>
|
||||
private void SendGridInstantMessageViaXMLRPCAsyncMain(GridInstantMessage im, MessageResultNotification result)
|
||||
protected virtual void SendGridInstantMessageViaXMLRPCAsync(GridInstantMessage im, MessageResultNotification result, UUID prevRegionID)
|
||||
{
|
||||
GIM gim;
|
||||
do {
|
||||
try {
|
||||
SendGridInstantMessageViaXMLRPCAsync(im, result, UUID.Zero);
|
||||
} catch (Exception e) {
|
||||
m_log.Error("[SendGridInstantMessageViaXMLRPC]: exception " + e.Message);
|
||||
}
|
||||
lock (pendingInstantMessages) {
|
||||
if (pendingInstantMessages.Count > 0) {
|
||||
gim = pendingInstantMessages.Dequeue();
|
||||
im = gim.im;
|
||||
result = gim.result;
|
||||
} else {
|
||||
gim = null;
|
||||
-- numInstantMessageThreads;
|
||||
//m_log.DebugFormat("[SendGridInstantMessageViaXMLRPC]: --numInstantMessageThreads={0}", numInstantMessageThreads);
|
||||
}
|
||||
}
|
||||
} while (gim != null);
|
||||
}
|
||||
private void SendGridInstantMessageViaXMLRPCAsync(GridInstantMessage im, MessageResultNotification result, UUID prevRegionID)
|
||||
{
|
||||
|
||||
UUID toAgentID = new UUID(im.toAgentID);
|
||||
|
||||
PresenceInfo upd = null;
|
||||
@@ -573,7 +520,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
if (upd != null)
|
||||
{
|
||||
GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(UUID.Zero,
|
||||
GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID,
|
||||
upd.RegionID);
|
||||
if (reginfo != null)
|
||||
{
|
||||
@@ -722,8 +669,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
gim["position_z"] = msg.Position.Z.ToString();
|
||||
gim["region_id"] = msg.RegionID.ToString();
|
||||
gim["binary_bucket"] = Convert.ToBase64String(msg.binaryBucket,Base64FormattingOptions.None);
|
||||
if (m_MessageKey != String.Empty)
|
||||
gim["message_key"] = m_MessageKey;
|
||||
return gim;
|
||||
}
|
||||
|
||||
|
||||
@@ -171,11 +171,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
|
||||
private void RetrieveInstantMessages(IClientAPI client)
|
||||
{
|
||||
if (m_RestURL == String.Empty)
|
||||
{
|
||||
return;
|
||||
}
|
||||
else
|
||||
if (m_RestURL != "")
|
||||
{
|
||||
m_log.DebugFormat("[OFFLINE MESSAGING]: Retrieving stored messages for {0}", client.AgentId);
|
||||
|
||||
@@ -183,25 +179,22 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
= SynchronousRestObjectRequester.MakeRequest<UUID, List<GridInstantMessage>>(
|
||||
"POST", m_RestURL + "/RetrieveMessages/", client.AgentId);
|
||||
|
||||
if (msglist != null)
|
||||
if (msglist == null)
|
||||
m_log.WarnFormat("[OFFLINE MESSAGING]: WARNING null message list.");
|
||||
|
||||
foreach (GridInstantMessage im in msglist)
|
||||
{
|
||||
foreach (GridInstantMessage im in msglist)
|
||||
{
|
||||
// client.SendInstantMessage(im);
|
||||
// client.SendInstantMessage(im);
|
||||
|
||||
// Send through scene event manager so all modules get a chance
|
||||
// to look at this message before it gets delivered.
|
||||
//
|
||||
// Needed for proper state management for stored group
|
||||
// invitations
|
||||
//
|
||||
|
||||
im.offline = 1;
|
||||
|
||||
Scene s = FindScene(client.AgentId);
|
||||
if (s != null)
|
||||
s.EventManager.TriggerIncomingInstantMessage(im);
|
||||
}
|
||||
// Send through scene event manager so all modules get a chance
|
||||
// to look at this message before it gets delivered.
|
||||
//
|
||||
// Needed for proper state management for stored group
|
||||
// invitations
|
||||
//
|
||||
Scene s = FindScene(client.AgentId);
|
||||
if (s != null)
|
||||
s.EventManager.TriggerIncomingInstantMessage(im);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -212,19 +205,24 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||
im.dialog != (byte)InstantMessageDialog.MessageFromAgent &&
|
||||
im.dialog != (byte)InstantMessageDialog.GroupNotice &&
|
||||
im.dialog != (byte)InstantMessageDialog.GroupInvitation &&
|
||||
im.dialog != (byte)InstantMessageDialog.InventoryOffered &&
|
||||
im.dialog != (byte)InstantMessageDialog.TaskInventoryOffered)
|
||||
im.dialog != (byte)InstantMessageDialog.InventoryOffered)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_ForwardOfflineGroupMessages)
|
||||
{
|
||||
if (im.dialog == (byte)InstantMessageDialog.GroupNotice ||
|
||||
im.dialog != (byte)InstantMessageDialog.GroupInvitation)
|
||||
return;
|
||||
}
|
||||
|
||||
Scene scene = FindScene(new UUID(im.fromAgentID));
|
||||
if (scene == null)
|
||||
scene = m_SceneList[0];
|
||||
|
||||
bool success = SynchronousRestObjectRequester.MakeRequest<GridInstantMessage, bool>(
|
||||
"POST", m_RestURL+"/SaveMessage/?scope=" +
|
||||
scene.RegionInfo.ScopeID.ToString(), im);
|
||||
"POST", m_RestURL+"/SaveMessage/", im);
|
||||
|
||||
if (im.dialog == (byte)InstantMessageDialog.MessageFromAgent)
|
||||
{
|
||||
|
||||
@@ -635,4 +635,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
m_assetsLoaded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,6 +178,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
InventoryFolderBase inventoryFolder, string path, bool saveThisFolderItself,
|
||||
Dictionary<string, object> options, IUserAccountService userAccountService)
|
||||
{
|
||||
if (options.ContainsKey("verbose"))
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Saving folder {0}", inventoryFolder.Name);
|
||||
|
||||
if (saveThisFolderItself)
|
||||
{
|
||||
path += CreateArchiveFolderName(inventoryFolder);
|
||||
@@ -446,4 +449,4 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
return s;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -175,8 +175,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
if (im.binaryBucket.Length < 17) // Invalid
|
||||
return;
|
||||
|
||||
UUID recipientID = new UUID(im.toAgentID);
|
||||
ScenePresence user = scene.GetScenePresence(recipientID);
|
||||
UUID receipientID = new UUID(im.toAgentID);
|
||||
ScenePresence user = scene.GetScenePresence(receipientID);
|
||||
UUID copyID;
|
||||
|
||||
// First byte is the asset type
|
||||
@@ -191,7 +191,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
folderID, new UUID(im.toAgentID));
|
||||
|
||||
InventoryFolderBase folderCopy
|
||||
= scene.GiveInventoryFolder(recipientID, client.AgentId, folderID, UUID.Zero);
|
||||
= scene.GiveInventoryFolder(receipientID, client.AgentId, folderID, UUID.Zero);
|
||||
|
||||
if (folderCopy == null)
|
||||
{
|
||||
@@ -244,8 +244,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
im.imSessionID = itemID.Guid;
|
||||
}
|
||||
|
||||
im.offline = 0;
|
||||
|
||||
// Send the IM to the recipient. The item is already
|
||||
// in their inventory, so it will not be lost if
|
||||
// they are offline.
|
||||
@@ -265,8 +263,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted ||
|
||||
im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted)
|
||||
{
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
||||
|
||||
@@ -277,11 +274,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
else
|
||||
{
|
||||
if (m_TransferModule != null)
|
||||
m_TransferModule.SendInstantMessage(im, delegate(bool success) {});
|
||||
m_TransferModule.SendInstantMessage(im, delegate(bool success) {
|
||||
|
||||
// justincc - FIXME: Comment out for now. This code was added in commit db91044 Mon Aug 22 2011
|
||||
// and is apparently supposed to fix bulk inventory updates after accepting items. But
|
||||
// instead it appears to cause two copies of an accepted folder for the receiving user in
|
||||
// at least some cases. Folder/item update is already done when the offer is made (see code above)
|
||||
|
||||
// // Send BulkUpdateInventory
|
||||
// IInventoryService invService = scene.InventoryService;
|
||||
// UUID inventoryEntityID = new UUID(im.imSessionID); // The inventory item /folder, back from it's trip
|
||||
//
|
||||
// InventoryFolderBase folder = new InventoryFolderBase(inventoryEntityID, client.AgentId);
|
||||
// folder = invService.GetFolder(folder);
|
||||
//
|
||||
// ScenePresence fromUser = scene.GetScenePresence(new UUID(im.fromAgentID));
|
||||
//
|
||||
// // If the user has left the scene by the time the message comes back then we can't send
|
||||
// // them the update.
|
||||
// if (fromUser != null)
|
||||
// fromUser.ControllingClient.SendBulkUpdateInventory(folder);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined ||
|
||||
im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined)
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryDeclined)
|
||||
{
|
||||
// Here, the recipient is local and we can assume that the
|
||||
// inventory is loaded. Courtesy of the above bulk update,
|
||||
@@ -317,7 +333,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
{
|
||||
folder.ParentID = trashFolder.ID;
|
||||
invService.MoveFolder(folder);
|
||||
client.SendBulkUpdateInventory(folder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -418,113 +433,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="msg"></param>
|
||||
private void OnGridInstantMessage(GridInstantMessage im)
|
||||
private void OnGridInstantMessage(GridInstantMessage msg)
|
||||
{
|
||||
// Check if this is ours to handle
|
||||
//
|
||||
Scene scene = FindClientScene(new UUID(im.toAgentID));
|
||||
Scene scene = FindClientScene(new UUID(msg.toAgentID));
|
||||
|
||||
if (scene == null)
|
||||
return;
|
||||
|
||||
// Find agent to deliver to
|
||||
//
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
|
||||
if (user == null)
|
||||
return;
|
||||
ScenePresence user = scene.GetScenePresence(new UUID(msg.toAgentID));
|
||||
|
||||
// This requires a little bit of processing because we have to make the
|
||||
// new item visible in the recipient's inventory here
|
||||
//
|
||||
if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
|
||||
{
|
||||
if (im.binaryBucket.Length < 17) // Invalid
|
||||
return;
|
||||
|
||||
UUID recipientID = new UUID(im.toAgentID);
|
||||
// Just forward to local handling
|
||||
OnInstantMessage(user.ControllingClient, msg);
|
||||
|
||||
// First byte is the asset type
|
||||
AssetType assetType = (AssetType)im.binaryBucket[0];
|
||||
|
||||
if (AssetType.Folder == assetType)
|
||||
{
|
||||
UUID folderID = new UUID(im.binaryBucket, 1);
|
||||
|
||||
InventoryFolderBase given =
|
||||
new InventoryFolderBase(folderID, recipientID);
|
||||
InventoryFolderBase folder =
|
||||
scene.InventoryService.GetFolder(given);
|
||||
|
||||
if (folder != null)
|
||||
user.ControllingClient.SendBulkUpdateInventory(folder);
|
||||
}
|
||||
else
|
||||
{
|
||||
UUID itemID = new UUID(im.binaryBucket, 1);
|
||||
|
||||
InventoryItemBase given =
|
||||
new InventoryItemBase(itemID, recipientID);
|
||||
InventoryItemBase item =
|
||||
scene.InventoryService.GetItem(given);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
user.ControllingClient.SendBulkUpdateInventory(item);
|
||||
}
|
||||
}
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
}
|
||||
if (im.dialog == (byte) InstantMessageDialog.TaskInventoryOffered)
|
||||
{
|
||||
if (im.binaryBucket.Length < 1) // Invalid
|
||||
return;
|
||||
|
||||
UUID recipientID = new UUID(im.toAgentID);
|
||||
|
||||
// Bucket is the asset type
|
||||
AssetType assetType = (AssetType)im.binaryBucket[0];
|
||||
|
||||
if (AssetType.Folder == assetType)
|
||||
{
|
||||
UUID folderID = new UUID(im.imSessionID);
|
||||
|
||||
InventoryFolderBase given =
|
||||
new InventoryFolderBase(folderID, recipientID);
|
||||
InventoryFolderBase folder =
|
||||
scene.InventoryService.GetFolder(given);
|
||||
|
||||
if (folder != null)
|
||||
user.ControllingClient.SendBulkUpdateInventory(folder);
|
||||
}
|
||||
else
|
||||
{
|
||||
UUID itemID = new UUID(im.imSessionID);
|
||||
|
||||
InventoryItemBase given =
|
||||
new InventoryItemBase(itemID, recipientID);
|
||||
InventoryItemBase item =
|
||||
scene.InventoryService.GetItem(given);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
user.ControllingClient.SendBulkUpdateInventory(item);
|
||||
}
|
||||
}
|
||||
|
||||
// Fix up binary bucket since this may be 17 chars long here
|
||||
Byte[] bucket = new Byte[1];
|
||||
bucket[0] = im.binaryBucket[0];
|
||||
im.binaryBucket = bucket;
|
||||
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
}
|
||||
else if (im.dialog == (byte) InstantMessageDialog.InventoryAccepted ||
|
||||
im.dialog == (byte) InstantMessageDialog.InventoryDeclined ||
|
||||
im.dialog == (byte) InstantMessageDialog.TaskInventoryDeclined ||
|
||||
im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
|
||||
{
|
||||
user.ControllingClient.SendInstantMessage(im);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,29 +155,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
|
||||
scene.RegionInfo.RegionHandle,
|
||||
(uint)presence.AbsolutePosition.X,
|
||||
(uint)presence.AbsolutePosition.Y,
|
||||
(uint)presence.AbsolutePosition.Z + 2);
|
||||
(uint)presence.AbsolutePosition.Z);
|
||||
|
||||
m_log.DebugFormat("[LURE]: TP invite with message {0}", message);
|
||||
|
||||
GridInstantMessage m;
|
||||
|
||||
if (scene.Permissions.IsAdministrator(client.AgentId) && presence.GodLevel >= 200 && (!scene.Permissions.IsAdministrator(targetid)))
|
||||
{
|
||||
m = new GridInstantMessage(scene, client.AgentId,
|
||||
client.FirstName+" "+client.LastName, targetid,
|
||||
(byte)InstantMessageDialog.GodLikeRequestTeleport, false,
|
||||
message, dest, false, presence.AbsolutePosition,
|
||||
new Byte[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
m = new GridInstantMessage(scene, client.AgentId,
|
||||
client.FirstName+" "+client.LastName, targetid,
|
||||
(byte)InstantMessageDialog.RequestTeleport, false,
|
||||
message, dest, false, presence.AbsolutePosition,
|
||||
new Byte[0]);
|
||||
}
|
||||
m_log.DebugFormat("TP invite with message {0}", message);
|
||||
|
||||
GridInstantMessage m = new GridInstantMessage(scene, client.AgentId,
|
||||
client.FirstName+" "+client.LastName, targetid,
|
||||
(byte)InstantMessageDialog.RequestTeleport, false,
|
||||
message, dest, false, presence.AbsolutePosition,
|
||||
new Byte[0]);
|
||||
|
||||
if (m_TransferModule != null)
|
||||
{
|
||||
m_TransferModule.SendInstantMessage(m,
|
||||
@@ -212,8 +199,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
|
||||
{
|
||||
// Forward remote teleport requests
|
||||
//
|
||||
if (msg.dialog != (byte)InstantMessageDialog.RequestTeleport &&
|
||||
msg.dialog != (byte)InstantMessageDialog.GodLikeRequestTeleport)
|
||||
if (msg.dialog != 22)
|
||||
return;
|
||||
|
||||
if (m_TransferModule != null)
|
||||
|
||||
@@ -101,8 +101,7 @@ namespace OpenSim.Region.CoreModules.Framework
|
||||
|
||||
public void CreateCaps(UUID agentId)
|
||||
{
|
||||
int flags = m_scene.GetUserFlags(agentId);
|
||||
if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId, flags))
|
||||
if (m_scene.RegionInfo.EstateSettings.IsBanned(agentId))
|
||||
return;
|
||||
|
||||
String capsObjectPath = GetCapsPath(agentId);
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
protected virtual void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnTeleportHomeRequest += TriggerTeleportHome;
|
||||
client.OnTeleportHomeRequest += TeleportHome;
|
||||
client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
|
||||
}
|
||||
|
||||
@@ -204,7 +204,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
||||
|
||||
sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
|
||||
sp.TeleportFlags = (Constants.TeleportFlags)teleportFlags;
|
||||
sp.Teleport(position);
|
||||
|
||||
foreach (SceneObjectGroup grp in sp.GetAttachments())
|
||||
@@ -320,7 +319,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// This may be a costly operation. The reg.ExternalEndPoint field is not a passive field,
|
||||
// it's actually doing a lot of work.
|
||||
IPEndPoint endPoint = finalDestination.ExternalEndPoint;
|
||||
if (endPoint != null && endPoint.Address != null)
|
||||
if (endPoint.Address != null)
|
||||
{
|
||||
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
|
||||
// both regions
|
||||
@@ -631,12 +630,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
#region Teleport Home
|
||||
|
||||
public virtual void TriggerTeleportHome(UUID id, IClientAPI client)
|
||||
{
|
||||
TeleportHome(id, client);
|
||||
}
|
||||
|
||||
public virtual bool TeleportHome(UUID id, IClientAPI client)
|
||||
public virtual void TeleportHome(UUID id, IClientAPI client)
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
|
||||
|
||||
@@ -645,18 +639,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
if (uinfo != null)
|
||||
{
|
||||
if (uinfo.HomeRegionID == UUID.Zero)
|
||||
{
|
||||
// can't find the Home region: Tell viewer and abort
|
||||
client.SendTeleportFailed("You don't have a home position set.");
|
||||
return false;
|
||||
}
|
||||
GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
|
||||
if (regionInfo == null)
|
||||
{
|
||||
// can't find the Home region: Tell viewer and abort
|
||||
client.SendTeleportFailed("Your home region could not be found.");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
|
||||
@@ -667,13 +655,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt,
|
||||
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
|
||||
}
|
||||
else
|
||||
{
|
||||
// can't find the Home region: Tell viewer and abort
|
||||
client.SendTeleportFailed("Your home region could not be found.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1143,14 +1124,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agent.Id0 = currentAgentCircuit.Id0;
|
||||
}
|
||||
|
||||
IPEndPoint external = region.ExternalEndPoint;
|
||||
if (external != null)
|
||||
{
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
d.BeginInvoke(sp, agent, region, external, true,
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
d.BeginInvoke(sp, agent, region, region.ExternalEndPoint, true,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -1284,7 +1261,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
try
|
||||
{
|
||||
//neighbour.ExternalEndPoint may return null, which will be caught
|
||||
d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
@@ -1398,6 +1374,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
m_log.Debug("[ENTITY TRANSFER MODULE]: Completed inform client about neighbour " + endPoint.ToString());
|
||||
}
|
||||
if (!regionAccepted)
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Region {0} did not accept agent: {1}", reg.RegionName, reason);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1731,17 +1709,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
|
||||
|
||||
// Need to turn off the physics flags, otherwise the object will continue to attempt to
|
||||
// move out of the region creating an infinite loop of failed attempts to cross
|
||||
grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
|
||||
|
||||
// We are going to move the object back to the old position so long as the old position
|
||||
// is in the region
|
||||
oldGroupPosition.X = Util.Clamp<float>(oldGroupPosition.X,1.0f,(float)Constants.RegionSize-1);
|
||||
oldGroupPosition.Y = Util.Clamp<float>(oldGroupPosition.Y,1.0f,(float)Constants.RegionSize-1);
|
||||
oldGroupPosition.Z = Util.Clamp<float>(oldGroupPosition.Z,1.0f,4096.0f);
|
||||
|
||||
grp.AbsolutePosition = oldGroupPosition;
|
||||
grp.RootPart.GroupPosition = oldGroupPosition;
|
||||
|
||||
// Need to turn off the physics flags, otherwise the object will continue to attempt to
|
||||
// move out of the region creating an infinite loop of failed attempts to cross
|
||||
grp.UpdatePrimFlags(grp.RootPart.LocalId,false,grp.IsTemporary,grp.IsPhantom,false);
|
||||
|
||||
grp.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
protected override void OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnTeleportHomeRequest += TriggerTeleportHome;
|
||||
client.OnTeleportHomeRequest += TeleportHome;
|
||||
client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
|
||||
client.OnConnectionClosed += new Action<IClientAPI>(OnConnectionClosed);
|
||||
}
|
||||
@@ -182,12 +182,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
|
||||
}
|
||||
|
||||
public void TriggerTeleportHome(UUID id, IClientAPI client)
|
||||
{
|
||||
TeleportHome(id, client);
|
||||
}
|
||||
|
||||
public override bool TeleportHome(UUID id, IClientAPI client)
|
||||
public override void TeleportHome(UUID id, IClientAPI client)
|
||||
{
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Request to teleport {0} {1} home", client.FirstName, client.LastName);
|
||||
|
||||
@@ -197,7 +192,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
// local grid user
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: User is local");
|
||||
return base.TeleportHome(id, client);
|
||||
base.TeleportHome(id, client);
|
||||
return;
|
||||
}
|
||||
|
||||
// Foreign user wants to go home
|
||||
@@ -207,7 +203,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
client.SendTeleportFailed("Your information has been lost");
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Unable to locate agent's gateway information");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
IUserAgentService userAgentService = new UserAgentServiceConnector(aCircuit.ServiceURLs["HomeURI"].ToString());
|
||||
@@ -217,7 +213,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
client.SendTeleportFailed("Your home region could not be found");
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent's home region not found");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
ScenePresence sp = ((Scene)(client.Scene)).GetScenePresence(client.AgentId);
|
||||
@@ -225,7 +221,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
client.SendTeleportFailed("Internal error");
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent not found in the scene where it is supposed to be");
|
||||
return false;
|
||||
return;
|
||||
}
|
||||
|
||||
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
|
||||
@@ -235,7 +231,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
aCircuit.firstname, aCircuit.lastname, finalDestination.RegionName, homeGatekeeper.ServerURI, homeGatekeeper.RegionName);
|
||||
|
||||
DoTeleport(sp, homeGatekeeper, finalDestination, position, lookAt, (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome), eq);
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -367,11 +367,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
|
||||
originalPositions[objectGroup.UUID] = objectGroup.AbsolutePosition;
|
||||
|
||||
// Restore attachment data after trip through the sim
|
||||
if (objectGroup.RootPart.AttachPoint > 0)
|
||||
inventoryStoredPosition = objectGroup.RootPart.AttachOffset;
|
||||
objectGroup.RootPart.Shape.State = objectGroup.RootPart.AttachPoint;
|
||||
|
||||
objectGroup.AbsolutePosition = inventoryStoredPosition;
|
||||
|
||||
// Make sure all bits but the ones we want are clear
|
||||
@@ -481,17 +476,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
IClientAPI remoteClient)
|
||||
{
|
||||
uint effectivePerms = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify | PermissionMask.Move) | 7;
|
||||
// For the porposes of inventory, an object is modify if the prims
|
||||
// are modify. This allows renaming an object that contains no
|
||||
// mod items.
|
||||
foreach (SceneObjectGroup grp in objsForEffectivePermissions)
|
||||
{
|
||||
uint groupPerms = grp.GetEffectivePermissions(true);
|
||||
if ((grp.RootPart.BaseMask & (uint)PermissionMask.Modify) != 0)
|
||||
groupPerms |= (uint)PermissionMask.Modify;
|
||||
|
||||
effectivePerms &= groupPerms;
|
||||
}
|
||||
effectivePerms &= grp.GetEffectivePermissions();
|
||||
effectivePerms |= (uint)PermissionMask.Move;
|
||||
|
||||
if (remoteClient != null && (remoteClient.AgentId != so.RootPart.OwnerID) && m_Scene.Permissions.PropagatePermissions())
|
||||
@@ -565,9 +551,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
|
||||
// action, remoteClient.Name, userID);
|
||||
}
|
||||
else if (so.RootPart.OwnerID == so.RootPart.GroupID)
|
||||
{
|
||||
// Group owned objects go to the last owner before the object was transferred.
|
||||
userID = so.RootPart.LastOwnerID;
|
||||
}
|
||||
else
|
||||
{
|
||||
// All returns / deletes go to the object owner
|
||||
// Other returns / deletes go to the object owner
|
||||
//
|
||||
userID = so.RootPart.OwnerID;
|
||||
|
||||
@@ -666,8 +657,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
if (so.RootPart.FromFolderID != UUID.Zero && userID == remoteClient.AgentId)
|
||||
{
|
||||
InventoryFolderBase f = new InventoryFolderBase(so.RootPart.FromFolderID, userID);
|
||||
if (f != null)
|
||||
folder = m_Scene.InventoryService.GetFolder(f);
|
||||
folder = m_Scene.InventoryService.GetFolder(f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -697,11 +687,15 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
|
||||
{
|
||||
// m_log.DebugFormat("[INVENTORY ACCESS MODULE]: RezObject for {0}, item {1}", remoteClient.Name, itemID);
|
||||
|
||||
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
|
||||
item = m_Scene.InventoryService.GetItem(item);
|
||||
|
||||
if (item == null)
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[InventoryAccessModule]: Could not find item {0} for {1} in RezObject()",
|
||||
itemID, remoteClient.Name);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -753,11 +747,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
if (e == null || attachment) // Single
|
||||
{
|
||||
SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData);
|
||||
if (!attachment)
|
||||
{
|
||||
g.RootPart.AttachPoint = g.RootPart.Shape.State;
|
||||
g.RootPart.AttachOffset = g.AbsolutePosition;
|
||||
}
|
||||
|
||||
objlist.Add(g);
|
||||
veclist.Add(new Vector3(0, 0, 0));
|
||||
@@ -787,8 +776,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
foreach (XmlNode n in groups)
|
||||
{
|
||||
SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml);
|
||||
g.RootPart.AttachPoint = g.RootPart.Shape.State;
|
||||
g.RootPart.AttachOffset = g.AbsolutePosition;
|
||||
|
||||
objlist.Add(g);
|
||||
XmlElement el = (XmlElement)n;
|
||||
@@ -808,35 +795,12 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
}
|
||||
|
||||
int primcount = 0;
|
||||
foreach (SceneObjectGroup g in objlist)
|
||||
primcount += g.PrimCount;
|
||||
|
||||
if (!m_Scene.Permissions.CanRezObject(
|
||||
primcount, remoteClient.AgentId, pos)
|
||||
&& !attachment)
|
||||
{
|
||||
// The client operates in no fail mode. It will
|
||||
// have already removed the item from the folder
|
||||
// if it's no copy.
|
||||
// Put it back if it's not an attachment
|
||||
//
|
||||
if (item != null)
|
||||
{
|
||||
if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!attachment))
|
||||
remoteClient.SendBulkUpdateInventory(item);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
if (item != null && !DoPreRezWhenFromItem(remoteClient, item, objlist, pos, attachment))
|
||||
return null;
|
||||
|
||||
for (int i = 0; i < objlist.Count; i++)
|
||||
{
|
||||
group = objlist[i];
|
||||
SceneObjectPart rootPart = group.RootPart;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[InventoryAccessModule]: Preparing to rez {0} {1} {2} ownermask={3:X} nextownermask={4:X} groupmask={5:X} everyonemask={6:X} for {7}",
|
||||
@@ -897,6 +861,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
|
||||
if (!attachment)
|
||||
{
|
||||
SceneObjectPart rootPart = group.RootPart;
|
||||
|
||||
if (rootPart.Shape.PCode == (byte)PCode.Prim)
|
||||
group.ClearPartAttachmentData();
|
||||
|
||||
@@ -914,8 +880,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
// remoteClient.Name);
|
||||
}
|
||||
|
||||
group.SetGroup(remoteClient.ActiveGroupId, remoteClient);
|
||||
|
||||
if (item != null)
|
||||
DoPostRezWhenFromItem(item, attachment);
|
||||
|
||||
@@ -955,6 +919,25 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
}
|
||||
}
|
||||
|
||||
int primcount = 0;
|
||||
foreach (SceneObjectGroup g in objlist)
|
||||
primcount += g.PrimCount;
|
||||
|
||||
if (!m_Scene.Permissions.CanRezObject(
|
||||
primcount, remoteClient.AgentId, pos)
|
||||
&& !isAttachment)
|
||||
{
|
||||
// The client operates in no fail mode. It will
|
||||
// have already removed the item from the folder
|
||||
// if it's no copy.
|
||||
// Put it back if it's not an attachment
|
||||
//
|
||||
if (((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0) && (!isAttachment))
|
||||
remoteClient.SendBulkUpdateInventory(item);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int i = 0; i < objlist.Count; i++)
|
||||
{
|
||||
SceneObjectGroup so = objlist[i];
|
||||
@@ -970,11 +953,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
{
|
||||
rootPart.Name = item.Name;
|
||||
rootPart.Description = item.Description;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectSlamSale) != 0)
|
||||
{
|
||||
rootPart.ObjectSaleType = item.SaleType;
|
||||
rootPart.SalePrice = item.SalePrice;
|
||||
}
|
||||
rootPart.ObjectSaleType = item.SaleType;
|
||||
rootPart.SalePrice = item.SalePrice;
|
||||
}
|
||||
|
||||
rootPart.FromFolderID = item.Folder;
|
||||
@@ -983,8 +963,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
// rootPart.OwnerID, item.Owner, item.CurrentPermissions);
|
||||
|
||||
if ((rootPart.OwnerID != item.Owner) ||
|
||||
(item.CurrentPermissions & 16) != 0 ||
|
||||
(item.Flags & (uint)InventoryItemFlags.ObjectSlamPerm) != 0)
|
||||
(item.CurrentPermissions & 16) != 0)
|
||||
{
|
||||
//Need to kill the for sale here
|
||||
rootPart.ObjectSaleType = 0;
|
||||
@@ -994,43 +973,31 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
{
|
||||
foreach (SceneObjectPart part in so.Parts)
|
||||
{
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
||||
{
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
}
|
||||
part.GroupMask = 0; // DO NOT propagate here
|
||||
|
||||
part.LastOwnerID = part.OwnerID;
|
||||
part.OwnerID = item.Owner;
|
||||
part.Inventory.ChangeInventoryOwner(item.Owner);
|
||||
}
|
||||
|
||||
so.ApplyNextOwnerPermissions();
|
||||
|
||||
// In case the user has changed flags on a received item
|
||||
// we have to apply those changes after the slam. Else we
|
||||
// get a net loss of permissions
|
||||
foreach (SceneObjectPart part in so.Parts)
|
||||
{
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectHasMultipleItems) == 0)
|
||||
{
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
|
||||
part.EveryoneMask = item.EveryOnePermissions & part.BaseMask;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
|
||||
part.NextOwnerMask = item.NextPermissions & part.BaseMask;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
foreach (SceneObjectPart part in so.Parts)
|
||||
{
|
||||
foreach (SceneObjectPart part in so.Parts)
|
||||
{
|
||||
part.FromUserInventoryItemID = fromUserInventoryItemId;
|
||||
part.FromUserInventoryItemID = fromUserInventoryItemId;
|
||||
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteEveryone) != 0)
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteNextOwner) != 0)
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
if ((item.Flags & (uint)InventoryItemFlags.ObjectOverwriteGroup) != 0)
|
||||
part.GroupMask = item.GroupPermissions;
|
||||
if ((part.OwnerID != item.Owner) ||
|
||||
(item.CurrentPermissions & 16) != 0)
|
||||
{
|
||||
part.Inventory.ChangeInventoryOwner(item.Owner);
|
||||
part.GroupMask = 0; // DO NOT propagate here
|
||||
}
|
||||
|
||||
part.EveryoneMask = item.EveryOnePermissions;
|
||||
part.NextOwnerMask = item.NextPermissions;
|
||||
}
|
||||
|
||||
rootPart.TrimPermissions();
|
||||
@@ -1168,4 +1135,4 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -170,8 +170,7 @@ namespace OpenSim.Region.CoreModules.World.LightShare
|
||||
|
||||
private void EventManager_OnMakeRootAgent(ScenePresence presence)
|
||||
{
|
||||
if (m_enableWindlight && m_scene.RegionInfo.WindlightSettings.valid)
|
||||
m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
|
||||
m_log.Debug("[WINDLIGHT]: Sending windlight scene to new client");
|
||||
SendProfileToClient(presence.ControllingClient);
|
||||
}
|
||||
|
||||
|
||||
@@ -382,10 +382,6 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
try
|
||||
{
|
||||
Request = (HttpWebRequest) WebRequest.Create(Url);
|
||||
|
||||
//This works around some buggy HTTP Servers like Lighttpd
|
||||
Request.ServicePoint.Expect100Continue = false;
|
||||
|
||||
Request.Method = HttpMethod;
|
||||
Request.ContentType = HttpMIMEType;
|
||||
|
||||
@@ -462,36 +458,15 @@ namespace OpenSim.Region.CoreModules.Scripting.HttpRequest
|
||||
|
||||
// continue building the string
|
||||
sb.Append(tempString);
|
||||
if (sb.Length > 2048)
|
||||
break;
|
||||
}
|
||||
} while (count > 0); // any more data to read?
|
||||
|
||||
ResponseBody = sb.ToString().Replace("\r", "");
|
||||
ResponseBody = sb.ToString();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (e is WebException && ((WebException)e).Status == WebExceptionStatus.ProtocolError)
|
||||
{
|
||||
HttpWebResponse webRsp = (HttpWebResponse)((WebException)e).Response;
|
||||
Status = (int)webRsp.StatusCode;
|
||||
try
|
||||
{
|
||||
using (Stream responseStream = webRsp.GetResponseStream())
|
||||
{
|
||||
ResponseBody = responseStream.GetStreamString();
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
ResponseBody = webRsp.StatusDescription;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = (int)OSHttpStatusCode.ClientErrorJoker;
|
||||
ResponseBody = e.Message;
|
||||
}
|
||||
Status = (int)OSHttpStatusCode.ClientErrorJoker;
|
||||
ResponseBody = e.Message;
|
||||
|
||||
_finished = true;
|
||||
return;
|
||||
|
||||
@@ -61,7 +61,6 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
//public ManualResetEvent ev;
|
||||
public bool requestDone;
|
||||
public int startTime;
|
||||
public bool responseSent;
|
||||
public string uri;
|
||||
}
|
||||
|
||||
@@ -78,7 +77,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
new Dictionary<string, UrlData>();
|
||||
|
||||
|
||||
private int m_TotalUrls = 5000;
|
||||
private int m_TotalUrls = 100;
|
||||
|
||||
private uint https_port = 0;
|
||||
private IHttpServer m_HttpServer = null;
|
||||
@@ -158,7 +157,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
engine.PostScriptEvent(itemID, "http_request", new Object[] { urlcode.ToString(), "URL_REQUEST_DENIED", "" });
|
||||
return urlcode;
|
||||
}
|
||||
string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString();
|
||||
string url = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + "/lslhttp/" + urlcode.ToString() + "/";
|
||||
|
||||
UrlData urlData = new UrlData();
|
||||
urlData.hostID = host.UUID;
|
||||
@@ -167,10 +166,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
urlData.url = url;
|
||||
urlData.urlcode = urlcode;
|
||||
urlData.requests = new Dictionary<UUID, RequestData>();
|
||||
|
||||
|
||||
m_UrlMap[url] = urlData;
|
||||
|
||||
string uri = "/lslhttp/" + urlcode.ToString();
|
||||
string uri = "/lslhttp/" + urlcode.ToString() + "/";
|
||||
|
||||
m_HttpServer.AddPollServiceHTTPHandler(
|
||||
uri,
|
||||
@@ -235,12 +234,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
return;
|
||||
}
|
||||
|
||||
lock (m_RequestMap)
|
||||
{
|
||||
foreach (UUID req in data.requests.Keys)
|
||||
m_RequestMap.Remove(req);
|
||||
}
|
||||
|
||||
foreach (UUID req in data.requests.Keys)
|
||||
m_RequestMap.Remove(req);
|
||||
|
||||
RemoveUrl(data);
|
||||
m_UrlMap.Remove(url);
|
||||
}
|
||||
@@ -248,42 +244,32 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
|
||||
public void HttpResponse(UUID request, int status, string body)
|
||||
{
|
||||
lock (m_RequestMap)
|
||||
if (m_RequestMap.ContainsKey(request))
|
||||
{
|
||||
if (m_RequestMap.ContainsKey(request))
|
||||
{
|
||||
UrlData urlData = m_RequestMap[request];
|
||||
if (!urlData.requests[request].responseSent)
|
||||
{
|
||||
urlData.requests[request].responseCode = status;
|
||||
urlData.requests[request].responseBody = body;
|
||||
//urlData.requests[request].ev.Set();
|
||||
urlData.requests[request].requestDone = true;
|
||||
urlData.requests[request].responseSent = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString());
|
||||
}
|
||||
UrlData urlData = m_RequestMap[request];
|
||||
urlData.requests[request].responseCode = status;
|
||||
urlData.requests[request].responseBody = body;
|
||||
//urlData.requests[request].ev.Set();
|
||||
urlData.requests[request].requestDone =true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Info("[HttpRequestHandler] There is no http-in request with id " + request.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
public string GetHttpHeader(UUID requestId, string header)
|
||||
{
|
||||
lock (m_RequestMap)
|
||||
if (m_RequestMap.ContainsKey(requestId))
|
||||
{
|
||||
if (m_RequestMap.ContainsKey(requestId))
|
||||
{
|
||||
UrlData urlData = m_RequestMap[requestId];
|
||||
string value;
|
||||
if (urlData.requests[requestId].headers.TryGetValue(header, out value))
|
||||
return value;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[HttpRequestHandler] There was no http-in request with id " + requestId);
|
||||
}
|
||||
UrlData urlData=m_RequestMap[requestId];
|
||||
string value;
|
||||
if (urlData.requests[requestId].headers.TryGetValue(header,out value))
|
||||
return value;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[HttpRequestHandler] There was no http-in request with id " + requestId);
|
||||
}
|
||||
return String.Empty;
|
||||
}
|
||||
@@ -307,11 +293,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
{
|
||||
RemoveUrl(url.Value);
|
||||
removeURLs.Add(url.Key);
|
||||
lock (m_RequestMap)
|
||||
{
|
||||
foreach (UUID req in url.Value.requests.Keys)
|
||||
m_RequestMap.Remove(req);
|
||||
}
|
||||
foreach (UUID req in url.Value.requests.Keys)
|
||||
m_RequestMap.Remove(req);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,11 +315,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
{
|
||||
RemoveUrl(url.Value);
|
||||
removeURLs.Add(url.Key);
|
||||
lock (m_RequestMap)
|
||||
{
|
||||
foreach (UUID req in url.Value.requests.Keys)
|
||||
m_RequestMap.Remove(req);
|
||||
}
|
||||
foreach (UUID req in url.Value.requests.Keys)
|
||||
m_RequestMap.Remove(req);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,16 +335,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
{
|
||||
Hashtable response = new Hashtable();
|
||||
UrlData url;
|
||||
int startTime = 0;
|
||||
lock (m_RequestMap)
|
||||
{
|
||||
if (!m_RequestMap.ContainsKey(requestID))
|
||||
return response;
|
||||
url = m_RequestMap[requestID];
|
||||
startTime = url.requests[requestID].startTime;
|
||||
}
|
||||
|
||||
if (System.Environment.TickCount - startTime > 25000)
|
||||
if (System.Environment.TickCount - url.requests[requestID].startTime > 25000)
|
||||
{
|
||||
response["int_response_code"] = 500;
|
||||
response["str_response_string"] = "Script timeout";
|
||||
@@ -373,12 +351,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
response["reusecontext"] = false;
|
||||
|
||||
//remove from map
|
||||
lock (url.requests)
|
||||
lock (url)
|
||||
{
|
||||
url.requests.Remove(requestID);
|
||||
}
|
||||
lock (m_RequestMap)
|
||||
{
|
||||
m_RequestMap.Remove(requestID);
|
||||
}
|
||||
|
||||
@@ -400,25 +375,22 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
return false;
|
||||
}
|
||||
url = m_RequestMap[requestID];
|
||||
}
|
||||
lock (url.requests)
|
||||
{
|
||||
if (!url.requests.ContainsKey(requestID))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (System.Environment.TickCount - url.requests[requestID].startTime > 25000)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if (url.requests[requestID].requestDone)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (System.Environment.TickCount-url.requests[requestID].startTime>25000)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (url.requests[requestID].requestDone)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
||||
}
|
||||
private Hashtable GetEvents(UUID requestID, UUID sessionID, string request)
|
||||
{
|
||||
@@ -430,12 +402,9 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
if (!m_RequestMap.ContainsKey(requestID))
|
||||
return NoEvents(requestID,sessionID);
|
||||
url = m_RequestMap[requestID];
|
||||
}
|
||||
lock (url.requests)
|
||||
{
|
||||
requestData = url.requests[requestID];
|
||||
}
|
||||
|
||||
|
||||
if (!requestData.requestDone)
|
||||
return NoEvents(requestID,sessionID);
|
||||
|
||||
@@ -458,18 +427,14 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
response["reusecontext"] = false;
|
||||
|
||||
//remove from map
|
||||
lock (url.requests)
|
||||
lock (url)
|
||||
{
|
||||
url.requests.Remove(requestID);
|
||||
}
|
||||
lock (m_RequestMap)
|
||||
{
|
||||
m_RequestMap.Remove(requestID);
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public void HttpRequestHandler(UUID requestID, Hashtable request)
|
||||
{
|
||||
lock (request)
|
||||
@@ -485,8 +450,8 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
|
||||
int pos1 = uri.IndexOf("/");// /lslhttp
|
||||
int pos2 = uri.IndexOf("/", pos1 + 1);// /lslhttp/
|
||||
int pos3 = pos2 + 37; // /lslhttp/urlcode
|
||||
string uri_tmp = uri.Substring(0, pos3);
|
||||
int pos3 = uri.IndexOf("/", pos2 + 1);// /lslhttp/<UUID>/
|
||||
string uri_tmp = uri.Substring(0, pos3 + 1);
|
||||
//HTTP server code doesn't provide us with QueryStrings
|
||||
string pathInfo;
|
||||
string queryString;
|
||||
@@ -495,21 +460,10 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
pathInfo = uri.Substring(pos3);
|
||||
|
||||
UrlData url = null;
|
||||
string urlkey;
|
||||
if (!is_ssl)
|
||||
urlkey = "http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp;
|
||||
//m_UrlMap[];
|
||||
url = m_UrlMap["http://" + m_ExternalHostNameForLSL + ":" + m_HttpServer.Port.ToString() + uri_tmp];
|
||||
else
|
||||
urlkey = "https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp;
|
||||
|
||||
if (m_UrlMap.ContainsKey(urlkey))
|
||||
{
|
||||
url = m_UrlMap[urlkey];
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.Warn("[HttpRequestHandler]: http-in request failed; no such url: "+urlkey.ToString());
|
||||
}
|
||||
url = m_UrlMap["https://" + m_ExternalHostNameForLSL + ":" + m_HttpsServer.Port.ToString() + uri_tmp];
|
||||
|
||||
//for llGetHttpHeader support we need to store original URI here
|
||||
//to make x-path-info / x-query-string / x-script-url / x-remote-ip headers
|
||||
@@ -539,14 +493,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LSLHttp
|
||||
if (request.ContainsKey(key))
|
||||
{
|
||||
string val = (String)request[key];
|
||||
if (key != "")
|
||||
{
|
||||
queryString = queryString + key + "=" + val + "&";
|
||||
}
|
||||
else
|
||||
{
|
||||
queryString = queryString + val + "&";
|
||||
}
|
||||
queryString = queryString + key + "=" + val + "&";
|
||||
}
|
||||
}
|
||||
if (queryString.Length > 1)
|
||||
|
||||
@@ -271,6 +271,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
||||
return s.QueryAccess(id, position, out reason);
|
||||
}
|
||||
//m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -300,24 +301,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
||||
{
|
||||
//m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent");
|
||||
return s.IncomingCloseAgent(id);
|
||||
}
|
||||
}
|
||||
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseChildAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
foreach (Scene s in m_sceneList)
|
||||
{
|
||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
||||
{
|
||||
//m_log.Debug("[LOCAL COMMS]: Found region to SendCloseAgent");
|
||||
return s.IncomingCloseChildAgent(id);
|
||||
// Let's spawn a threadlet right here, because this may take
|
||||
// a while
|
||||
Util.FireAndForget(delegate { s.IncomingCloseAgent(id); });
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent");
|
||||
|
||||
@@ -261,21 +261,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseChildAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
// Try local first
|
||||
if (m_localBackend.CloseChildAgent(destination, id))
|
||||
return true;
|
||||
|
||||
// else do the remote thing
|
||||
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
|
||||
return m_remoteConnector.CloseChildAgent(destination, id);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool CloseAgent(GridRegion destination, UUID id)
|
||||
{
|
||||
|
||||
@@ -127,7 +127,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||
// FIXME: Why do we bother setting this module and caching up if we just end up registering the inner
|
||||
// user account service?!
|
||||
scene.RegisterModuleInterface<IUserAccountService>(UserAccountService);
|
||||
scene.RegisterModuleInterface<IUserAccountCacheModule>(m_Cache);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
@@ -180,11 +179,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||
return UserAccountService.GetUserAccount(scopeID, Email);
|
||||
}
|
||||
|
||||
public List<UserAccount> GetUserAccountsWhere(UUID scopeID, string query)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<UserAccount> GetUserAccounts(UUID scopeID, string query)
|
||||
{
|
||||
return UserAccountService.GetUserAccounts(scopeID, query);
|
||||
@@ -199,4 +193,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,6 @@ using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Services.Connectors;
|
||||
using OpenSim.Framework;
|
||||
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -102,9 +101,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||
return;
|
||||
|
||||
scene.RegisterModuleInterface<IUserAccountService>(this);
|
||||
scene.RegisterModuleInterface<IUserAccountCacheModule>(m_Cache);
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
@@ -119,14 +115,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||
return;
|
||||
}
|
||||
|
||||
// When a user actually enters the sim, clear them from
|
||||
// cache so the sim will have the current values for
|
||||
// flags, title, etc. And country, don't forget country!
|
||||
private void OnNewClient(IClientAPI client)
|
||||
{
|
||||
m_Cache.Remove(client.Name);
|
||||
}
|
||||
|
||||
#region Overwritten methods from IUserAccountService
|
||||
|
||||
public override UserAccount GetUserAccount(UUID scopeID, UUID userID)
|
||||
|
||||
@@ -34,7 +34,7 @@ using log4net;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||
{
|
||||
public class UserAccountCache : IUserAccountCacheModule
|
||||
public class UserAccountCache
|
||||
{
|
||||
private const double CACHE_EXPIRATION_SECONDS = 120000.0; // 33 hours!
|
||||
|
||||
@@ -92,18 +92,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Remove(string name)
|
||||
{
|
||||
if (!m_NameCache.Contains(name))
|
||||
return;
|
||||
|
||||
UUID uuid = UUID.Zero;
|
||||
if (m_NameCache.TryGetValue(name, out uuid))
|
||||
{
|
||||
m_NameCache.Remove(name);
|
||||
m_UUIDCache.Remove(uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,23 +298,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
// being no copy/no mod for everyone
|
||||
lock (part.TaskInventory)
|
||||
{
|
||||
if (!ResolveUserUuid(part.CreatorID))
|
||||
part.CreatorID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
if (!ResolveUserUuid(part.OwnerID))
|
||||
part.OwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
if (!ResolveUserUuid(part.LastOwnerID))
|
||||
part.LastOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
|
||||
|
||||
// And zap any troublesome sit target information
|
||||
part.SitTargetOrientation = new Quaternion(0, 0, 0, 1);
|
||||
part.SitTargetPosition = new Vector3(0, 0, 0);
|
||||
|
||||
// Fix ownership/creator of inventory items
|
||||
// Not doing so results in inventory items
|
||||
// being no copy/no mod for everyone
|
||||
part.TaskInventory.LockItemsForRead(true);
|
||||
TaskInventoryDictionary inv = part.TaskInventory;
|
||||
foreach (KeyValuePair<UUID, TaskInventoryItem> kvp in inv)
|
||||
{
|
||||
@@ -330,7 +313,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
if (UserManager != null)
|
||||
UserManager.AddUser(kvp.Value.CreatorID, kvp.Value.CreatorData);
|
||||
}
|
||||
part.TaskInventory.LockItemsForRead(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -251,14 +251,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
if (asset != null)
|
||||
{
|
||||
// m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id);
|
||||
if (m_options.ContainsKey("verbose"))
|
||||
m_log.InfoFormat("[ARCHIVER]: Writing asset {0}", id);
|
||||
|
||||
m_foundAssetUuids.Add(asset.FullID);
|
||||
|
||||
m_assetsArchiver.WriteAsset(PostProcess(asset));
|
||||
}
|
||||
else
|
||||
{
|
||||
// m_log.DebugFormat("[ARCHIVER]: Recording asset {0} as not found", id);
|
||||
if (m_options.ContainsKey("verbose"))
|
||||
m_log.InfoFormat("[ARCHIVER]: Recording asset {0} as not found", id);
|
||||
|
||||
m_notFoundAssetUuids.Add(new UUID(id));
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Security;
|
||||
using System.Timers;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
@@ -48,7 +47,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
private delegate void LookupUUIDS(List<UUID> uuidLst);
|
||||
|
||||
private Timer m_regionChangeTimer = new Timer();
|
||||
public Scene Scene { get; private set; }
|
||||
public IUserManagement UserManager { get; private set; }
|
||||
|
||||
@@ -63,12 +61,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
#region Packet Data Responders
|
||||
|
||||
private void clientSendDetailedEstateData(IClientAPI remote_client, UUID invoice)
|
||||
{
|
||||
sendDetailedEstateData(remote_client, invoice);
|
||||
sendEstateLists(remote_client, invoice);
|
||||
}
|
||||
|
||||
private void sendDetailedEstateData(IClientAPI remote_client, UUID invoice)
|
||||
{
|
||||
uint sun = 0;
|
||||
@@ -91,10 +83,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
(uint) Scene.RegionInfo.RegionSettings.CovenantChangedDateTime,
|
||||
Scene.RegionInfo.EstateSettings.AbuseEmail,
|
||||
estateOwner);
|
||||
}
|
||||
|
||||
private void sendEstateLists(IClientAPI remote_client, UUID invoice)
|
||||
{
|
||||
remote_client.SendEstateList(invoice,
|
||||
(int)Constants.EstateAccessCodex.EstateManagers,
|
||||
Scene.RegionInfo.EstateSettings.EstateManagers,
|
||||
@@ -257,12 +246,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
IRestartModule restartModule = Scene.RequestModuleInterface<IRestartModule>();
|
||||
if (restartModule != null)
|
||||
{
|
||||
if (timeInSeconds == -1)
|
||||
{
|
||||
restartModule.AbortRestart("Restart aborted by region manager");
|
||||
return;
|
||||
}
|
||||
|
||||
List<int> times = new List<int>();
|
||||
while (timeInSeconds > 0)
|
||||
{
|
||||
@@ -275,7 +258,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
timeInSeconds -= 15;
|
||||
}
|
||||
|
||||
restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), false);
|
||||
restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -483,11 +466,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
if (!s.IsChildAgent)
|
||||
{
|
||||
if (!Scene.TeleportClientHome(user, s.ControllingClient))
|
||||
{
|
||||
s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out.");
|
||||
s.ControllingClient.Close();
|
||||
}
|
||||
Scene.TeleportClientHome(user, s.ControllingClient);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -496,7 +475,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
remote_client.SendAlertMessage("User is already on the region ban list");
|
||||
}
|
||||
//Scene.RegionInfo.regionBanlist.Add(Manager(user);
|
||||
//m_scene.RegionInfo.regionBanlist.Add(Manager(user);
|
||||
remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
@@ -551,7 +530,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
remote_client.SendAlertMessage("User is not on the region ban list");
|
||||
}
|
||||
|
||||
//Scene.RegionInfo.regionBanlist.Add(Manager(user);
|
||||
//m_scene.RegionInfo.regionBanlist.Add(Manager(user);
|
||||
remote_client.SendBannedUserList(invoice, Scene.RegionInfo.EstateSettings.EstateBans, Scene.RegionInfo.EstateSettings.EstateID);
|
||||
}
|
||||
else
|
||||
@@ -716,11 +695,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
ScenePresence s = Scene.GetScenePresence(prey);
|
||||
if (s != null)
|
||||
{
|
||||
if (!Scene.TeleportClientHome(prey, s.ControllingClient))
|
||||
{
|
||||
s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
|
||||
s.ControllingClient.Close();
|
||||
}
|
||||
Scene.TeleportClientHome(prey, s.ControllingClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -738,13 +713,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
// Also make sure they are actually in the region
|
||||
ScenePresence p;
|
||||
if(Scene.TryGetScenePresence(client.AgentId, out p))
|
||||
{
|
||||
if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient))
|
||||
{
|
||||
p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
|
||||
p.ControllingClient.Close();
|
||||
}
|
||||
}
|
||||
Scene.TeleportClientHome(p.UUID, p.ControllingClient);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -988,7 +957,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
for (int i = 0; i < uuidarr.Length; i++)
|
||||
{
|
||||
// string lookupname = Scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
|
||||
// string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
|
||||
|
||||
IUserManagement userManager = Scene.RequestModuleInterface<IUserManagement>();
|
||||
if (userManager != null)
|
||||
@@ -1129,10 +1098,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
m_regionChangeTimer.AutoReset = false;
|
||||
m_regionChangeTimer.Interval = 2000;
|
||||
m_regionChangeTimer.Elapsed += RaiseRegionInfoChange;
|
||||
|
||||
Scene = scene;
|
||||
Scene.RegisterModuleInterface<IEstateModule>(this);
|
||||
Scene.EventManager.OnNewClient += EventManager_OnNewClient;
|
||||
@@ -1183,7 +1148,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
|
||||
private void EventManager_OnNewClient(IClientAPI client)
|
||||
{
|
||||
client.OnDetailedEstateDataRequest += clientSendDetailedEstateData;
|
||||
client.OnDetailedEstateDataRequest += sendDetailedEstateData;
|
||||
client.OnSetEstateFlagsRequest += estateSetRegionInfoHandler;
|
||||
// client.OnSetEstateTerrainBaseTexture += setEstateTerrainBaseTexture;
|
||||
client.OnSetEstateTerrainDetailTexture += setEstateTerrainBaseTexture;
|
||||
@@ -1235,10 +1200,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
flags |= RegionFlags.AllowParcelChanges;
|
||||
if (Scene.RegionInfo.RegionSettings.BlockShowInSearch)
|
||||
flags |= RegionFlags.BlockParcelSearch;
|
||||
if (Scene.RegionInfo.RegionSettings.GodBlockSearch)
|
||||
flags |= (RegionFlags)(1 << 11);
|
||||
if (Scene.RegionInfo.RegionSettings.Casino)
|
||||
flags |= (RegionFlags)(1 << 10);
|
||||
|
||||
if (Scene.RegionInfo.RegionSettings.FixedSun)
|
||||
flags |= RegionFlags.SunFixed;
|
||||
@@ -1246,15 +1207,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
flags |= RegionFlags.Sandbox;
|
||||
if (Scene.RegionInfo.EstateSettings.AllowVoice)
|
||||
flags |= RegionFlags.AllowVoice;
|
||||
if (Scene.RegionInfo.EstateSettings.AllowLandmark)
|
||||
flags |= RegionFlags.AllowLandmark;
|
||||
if (Scene.RegionInfo.EstateSettings.AllowSetHome)
|
||||
flags |= RegionFlags.AllowSetHome;
|
||||
if (Scene.RegionInfo.EstateSettings.BlockDwell)
|
||||
flags |= RegionFlags.BlockDwell;
|
||||
if (Scene.RegionInfo.EstateSettings.ResetHomeOnTeleport)
|
||||
flags |= RegionFlags.ResetHomeOnTeleport;
|
||||
|
||||
// Fudge these to always on, so the menu options activate
|
||||
//
|
||||
flags |= RegionFlags.AllowLandmark;
|
||||
flags |= RegionFlags.AllowSetHome;
|
||||
|
||||
// TODO: SkipUpdateInterestList
|
||||
|
||||
@@ -1295,12 +1252,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
flags |= RegionFlags.ResetHomeOnTeleport;
|
||||
if (Scene.RegionInfo.EstateSettings.TaxFree)
|
||||
flags |= RegionFlags.TaxFree;
|
||||
if (Scene.RegionInfo.EstateSettings.AllowLandmark)
|
||||
flags |= RegionFlags.AllowLandmark;
|
||||
if (Scene.RegionInfo.EstateSettings.AllowParcelChanges)
|
||||
flags |= RegionFlags.AllowParcelChanges;
|
||||
if (Scene.RegionInfo.EstateSettings.AllowSetHome)
|
||||
flags |= RegionFlags.AllowSetHome;
|
||||
if (Scene.RegionInfo.EstateSettings.DenyMinors)
|
||||
flags |= (RegionFlags)(1 << 30);
|
||||
|
||||
@@ -1320,12 +1271,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
}
|
||||
|
||||
public void TriggerRegionInfoChange()
|
||||
{
|
||||
m_regionChangeTimer.Stop();
|
||||
m_regionChangeTimer.Start();
|
||||
}
|
||||
|
||||
protected void RaiseRegionInfoChange(object sender, ElapsedEventArgs e)
|
||||
{
|
||||
ChangeDelegate change = OnRegionInfoChange;
|
||||
|
||||
|
||||
@@ -91,8 +91,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
private int m_lastLandLocalID = LandChannel.START_LAND_LOCAL_ID - 1;
|
||||
|
||||
private bool m_allowedForcefulBans = true;
|
||||
private UUID DefaultGodParcelGroup;
|
||||
private string DefaultGodParcelName;
|
||||
|
||||
// caches ExtendedLandData
|
||||
private Cache parcelInfoCache;
|
||||
@@ -108,12 +106,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
IConfig cnf = source.Configs["LandManagement"];
|
||||
if (cnf != null)
|
||||
{
|
||||
DefaultGodParcelGroup = new UUID(cnf.GetString("DefaultAdministratorGroupUUID", UUID.Zero.ToString()));
|
||||
DefaultGodParcelName = cnf.GetString("DefaultAdministratorParcelName", "Default Parcel");
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
@@ -165,6 +157,13 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
m_scene.UnregisterModuleCommander(m_commander.Name);
|
||||
}
|
||||
|
||||
// private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason)
|
||||
// {
|
||||
// ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y);
|
||||
// reason = "You are not allowed to enter this sim.";
|
||||
// return nearestParcel != null;
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Processes commandline input. Do not call directly.
|
||||
/// </summary>
|
||||
@@ -205,8 +204,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
client.OnParcelInfoRequest += ClientOnParcelInfoRequest;
|
||||
client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup;
|
||||
client.OnPreAgentUpdate += ClientOnPreAgentUpdate;
|
||||
client.OnParcelEjectUser += ClientOnParcelEjectUser;
|
||||
client.OnParcelFreezeUser += ClientOnParcelFreezeUser;
|
||||
|
||||
EntityBase presenceEntity;
|
||||
if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence)
|
||||
@@ -218,6 +215,36 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData)
|
||||
{
|
||||
//If we are forcing a position for them to go
|
||||
if (forcedPosition.ContainsKey(remoteClient.AgentId))
|
||||
{
|
||||
ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId);
|
||||
|
||||
//Putting the user into flying, both keeps the avatar in fligth when it bumps into something and stopped from going another direction AND
|
||||
//When the avatar walks into a ban line on the ground, it prevents getting stuck
|
||||
agentData.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
||||
|
||||
|
||||
//Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines
|
||||
if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2)
|
||||
{
|
||||
Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition));
|
||||
forcedPosition.Remove(remoteClient.AgentId);
|
||||
}
|
||||
//if we are far away, teleport
|
||||
else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3)
|
||||
{
|
||||
Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition));
|
||||
clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]);
|
||||
forcedPosition.Remove(remoteClient.AgentId);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Forces them toward the forced position we want if they aren't there yet
|
||||
agentData.UseClientAgentPosition = true;
|
||||
agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -336,16 +363,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
private void ForceAvatarToPosition(ScenePresence avatar, Vector3? position)
|
||||
{
|
||||
if (m_scene.Permissions.IsGod(avatar.UUID)) return;
|
||||
|
||||
if (!position.HasValue)
|
||||
return;
|
||||
|
||||
bool isFlying = avatar.PhysicsActor.Flying;
|
||||
avatar.RemoveFromPhysicalScene();
|
||||
|
||||
avatar.AbsolutePosition = (Vector3)position;
|
||||
|
||||
avatar.AddToPhysicalScene(isFlying);
|
||||
if (position.HasValue)
|
||||
{
|
||||
forcedPosition[avatar.ControllingClient.AgentId] = (Vector3)position;
|
||||
}
|
||||
}
|
||||
|
||||
public void SendYouAreRestrictedNotice(ScenePresence avatar)
|
||||
@@ -365,7 +386,29 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
}
|
||||
|
||||
if (parcelAvatarIsEntering != null)
|
||||
EnforceBans(parcelAvatarIsEntering, avatar);
|
||||
{
|
||||
if (avatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT)
|
||||
{
|
||||
if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID))
|
||||
{
|
||||
SendYouAreBannedNotice(avatar);
|
||||
ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar));
|
||||
}
|
||||
else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID))
|
||||
{
|
||||
SendYouAreRestrictedNotice(avatar);
|
||||
ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar));
|
||||
}
|
||||
else
|
||||
{
|
||||
avatar.sentMessageAboutRestrictedParcelFlyingDown = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
avatar.sentMessageAboutRestrictedParcelFlyingDown = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -469,7 +512,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
//when we are finally in a safe place, lets release the forced position lock
|
||||
forcedPosition.Remove(clientAvatar.ControllingClient.AgentId);
|
||||
}
|
||||
EnforceBans(parcel, clientAvatar);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -678,7 +720,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
int x;
|
||||
int y;
|
||||
|
||||
if (x_float > Constants.RegionSize || x_float < 0 || y_float > Constants.RegionSize || y_float < 0)
|
||||
if (x_float >= Constants.RegionSize || x_float < 0 || y_float >= Constants.RegionSize || y_float < 0)
|
||||
return null;
|
||||
|
||||
try
|
||||
@@ -728,13 +770,14 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
{
|
||||
try
|
||||
{
|
||||
//if (m_landList.ContainsKey(m_landIDList[x / 4, y / 4]))
|
||||
return m_landList[m_landIDList[x / 4, y / 4]];
|
||||
//else
|
||||
// return null;
|
||||
return m_landList[m_landIDList[x / 4, y / 4]];
|
||||
}
|
||||
catch (IndexOutOfRangeException)
|
||||
{
|
||||
// m_log.WarnFormat(
|
||||
// "[LAND MANAGEMENT MODULE]: Tried to retrieve land object from out of bounds co-ordinate ({0},{1}) in {2}",
|
||||
// x, y, m_scene.RegionInfo.RegionName);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1017,10 +1060,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
//Owner Flag
|
||||
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_REQUESTER);
|
||||
}
|
||||
else if (currentParcelBlock.LandData.IsGroupOwned && remote_client.IsGroupMember(currentParcelBlock.LandData.GroupID))
|
||||
{
|
||||
tempByte = Convert.ToByte(tempByte | LandChannel.LAND_TYPE_OWNED_BY_GROUP);
|
||||
}
|
||||
else if (currentParcelBlock.LandData.SalePrice > 0 &&
|
||||
(currentParcelBlock.LandData.AuthBuyerID == UUID.Zero ||
|
||||
currentParcelBlock.LandData.AuthBuyerID == remote_client.AgentId))
|
||||
@@ -1321,31 +1360,18 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
public void EventManagerOnIncomingLandDataFromStorage(List<LandData> data)
|
||||
{
|
||||
lock (m_landList)
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
//Remove all the land objects in the sim and then process our new data
|
||||
foreach (int n in m_landList.Keys)
|
||||
{
|
||||
m_scene.EventManager.TriggerLandObjectRemoved(m_landList[n].LandData.GlobalID);
|
||||
}
|
||||
m_landIDList.Initialize();
|
||||
m_landList.Clear();
|
||||
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
{
|
||||
IncomingLandObjectFromStorage(data[i]);
|
||||
}
|
||||
IncomingLandObjectFromStorage(data[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void IncomingLandObjectFromStorage(LandData data)
|
||||
{
|
||||
|
||||
ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene);
|
||||
new_land.LandData = data.Copy();
|
||||
new_land.SetLandBitmapFromByteArray();
|
||||
AddLandObject(new_land);
|
||||
new_land.SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient)
|
||||
@@ -1623,168 +1649,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
UpdateLandObject(localID, land.LandData);
|
||||
}
|
||||
|
||||
public void ClientOnParcelGodMark(IClientAPI client, UUID god, int landID)
|
||||
{
|
||||
ILandObject land = null;
|
||||
List<ILandObject> Land = ((Scene)client.Scene).LandChannel.AllParcels();
|
||||
foreach (ILandObject landObject in Land)
|
||||
{
|
||||
if (landObject.LandData.LocalID == landID)
|
||||
{
|
||||
land = landObject;
|
||||
}
|
||||
}
|
||||
land.DeedToGroup(DefaultGodParcelGroup);
|
||||
land.LandData.Name = DefaultGodParcelName;
|
||||
land.SendLandUpdateToAvatarsOverMe();
|
||||
}
|
||||
|
||||
private void ClientOnSimWideDeletes(IClientAPI client, UUID agentID, int flags, UUID targetID)
|
||||
{
|
||||
ScenePresence SP;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out SP);
|
||||
List<SceneObjectGroup> returns = new List<SceneObjectGroup>();
|
||||
if (SP.UserLevel != 0)
|
||||
{
|
||||
if (flags == 0) //All parcels, scripted or not
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (flags == 4) //All parcels, scripted object
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
if (e.scriptScore >= 0.01)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
if (flags == 4) //not target parcel, scripted object
|
||||
{
|
||||
((Scene)client.Scene).ForEachSOG(delegate(SceneObjectGroup e)
|
||||
{
|
||||
if (e.OwnerID == targetID)
|
||||
{
|
||||
ILandObject landobject = ((Scene)client.Scene).LandChannel.GetLandObject(e.AbsolutePosition.X, e.AbsolutePosition.Y);
|
||||
if (landobject.LandData.OwnerID != e.OwnerID)
|
||||
{
|
||||
if (e.scriptScore >= 0.01)
|
||||
{
|
||||
returns.Add(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
foreach (SceneObjectGroup ol in returns)
|
||||
{
|
||||
ReturnObject(ol, client);
|
||||
}
|
||||
}
|
||||
}
|
||||
public void ReturnObject(SceneObjectGroup obj, IClientAPI client)
|
||||
{
|
||||
SceneObjectGroup[] objs = new SceneObjectGroup[1];
|
||||
objs[0] = obj;
|
||||
((Scene)client.Scene).returnObjects(objs, client.AgentId);
|
||||
}
|
||||
|
||||
Dictionary<UUID, System.Threading.Timer> Timers = new Dictionary<UUID, System.Threading.Timer>();
|
||||
|
||||
public void ClientOnParcelFreezeUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
ScenePresence targetAvatar = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(target, out targetAvatar);
|
||||
ScenePresence parcelManager = null;
|
||||
((Scene)client.Scene).TryGetScenePresence(client.AgentId, out parcelManager);
|
||||
System.Threading.Timer Timer;
|
||||
|
||||
if (targetAvatar.UserLevel == 0)
|
||||
{
|
||||
ILandObject land = ((Scene)client.Scene).LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!((Scene)client.Scene).Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze))
|
||||
return;
|
||||
if (flags == 0)
|
||||
{
|
||||
targetAvatar.AllowMovement = false;
|
||||
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has frozen you for 30 seconds. You cannot move or interact with the world.");
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Frozen.");
|
||||
System.Threading.TimerCallback timeCB = new System.Threading.TimerCallback(OnEndParcelFrozen);
|
||||
Timer = new System.Threading.Timer(timeCB, targetAvatar, 30000, 0);
|
||||
Timers.Add(targetAvatar.UUID, Timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
targetAvatar.AllowMovement = true;
|
||||
targetAvatar.ControllingClient.SendAlertMessage(parcelManager.Firstname + " " + parcelManager.Lastname + " has unfrozen you.");
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Unfrozen.");
|
||||
Timers.TryGetValue(targetAvatar.UUID, out Timer);
|
||||
Timers.Remove(targetAvatar.UUID);
|
||||
Timer.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
private void OnEndParcelFrozen(object avatar)
|
||||
{
|
||||
ScenePresence targetAvatar = (ScenePresence)avatar;
|
||||
targetAvatar.AllowMovement = true;
|
||||
System.Threading.Timer Timer;
|
||||
Timers.TryGetValue(targetAvatar.UUID, out Timer);
|
||||
Timers.Remove(targetAvatar.UUID);
|
||||
targetAvatar.ControllingClient.SendAgentAlertMessage("The freeze has worn off; you may go about your business.", false);
|
||||
}
|
||||
|
||||
|
||||
public void ClientOnParcelEjectUser(IClientAPI client, UUID parcelowner, uint flags, UUID target)
|
||||
{
|
||||
ScenePresence targetAvatar = null;
|
||||
ScenePresence parcelManager = null;
|
||||
|
||||
// Must have presences
|
||||
if (!m_scene.TryGetScenePresence(target, out targetAvatar) ||
|
||||
!m_scene.TryGetScenePresence(client.AgentId, out parcelManager))
|
||||
return;
|
||||
|
||||
// Cannot eject estate managers or gods
|
||||
if (m_scene.Permissions.IsAdministrator(target))
|
||||
return;
|
||||
|
||||
// Check if you even have permission to do this
|
||||
ILandObject land = m_scene.LandChannel.GetLandObject(targetAvatar.AbsolutePosition.X, targetAvatar.AbsolutePosition.Y);
|
||||
if (!m_scene.Permissions.CanEditParcelProperties(client.AgentId, land, GroupPowers.LandEjectAndFreeze) &&
|
||||
!m_scene.Permissions.IsAdministrator(client.AgentId))
|
||||
return;
|
||||
|
||||
Vector3 pos = m_scene.GetNearestAllowedPosition(targetAvatar, land);
|
||||
|
||||
targetAvatar.TeleportWithMomentum(pos);
|
||||
targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname);
|
||||
parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected.");
|
||||
|
||||
if ((flags & 1) != 0) // Ban TODO: Remove magic number
|
||||
{
|
||||
LandAccessEntry entry = new LandAccessEntry();
|
||||
entry.AgentID = targetAvatar.UUID;
|
||||
entry.Flags = AccessList.Ban;
|
||||
entry.Expires = 0; // Perm
|
||||
|
||||
land.LandData.ParcelAccessList.Add(entry);
|
||||
}
|
||||
}
|
||||
|
||||
protected void InstallInterfaces()
|
||||
{
|
||||
@@ -1847,27 +1711,5 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
MainConsole.Instance.Output(report.ToString());
|
||||
}
|
||||
|
||||
public void EnforceBans(ILandObject land, ScenePresence avatar)
|
||||
{
|
||||
if (avatar.AbsolutePosition.Z > LandChannel.BAN_LINE_SAFETY_HIEGHT)
|
||||
return;
|
||||
|
||||
if (land.IsEitherBannedOrRestricted(avatar.UUID))
|
||||
{
|
||||
if (land.ContainsPoint(Convert.ToInt32(avatar.lastKnownAllowedPosition.X), Convert.ToInt32(avatar.lastKnownAllowedPosition.Y)))
|
||||
{
|
||||
Vector3? pos = m_scene.GetNearestAllowedPosition(avatar);
|
||||
if (pos == null)
|
||||
m_scene.TeleportClientHome(avatar.UUID, avatar.ControllingClient);
|
||||
else
|
||||
ForceAvatarToPosition(avatar, (Vector3)pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
ForceAvatarToPosition(avatar, avatar.lastKnownAllowedPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,27 +190,10 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
else
|
||||
{
|
||||
// Normal Calculations
|
||||
int parcelMax = (int)((long)LandData.Area
|
||||
* (long)m_scene.RegionInfo.ObjectCapacity
|
||||
* (long)m_scene.RegionInfo.RegionSettings.ObjectBonus
|
||||
/ 65536L);
|
||||
m_log.DebugFormat("Area: {0}, Capacity {1}, Bonus {2}, Parcel {3}", LandData.Area, m_scene.RegionInfo.ObjectCapacity, m_scene.RegionInfo.RegionSettings.ObjectBonus, parcelMax);
|
||||
return parcelMax;
|
||||
}
|
||||
}
|
||||
|
||||
private int GetParcelBasePrimCount()
|
||||
{
|
||||
if (overrideParcelMaxPrimCount != null)
|
||||
{
|
||||
return overrideParcelMaxPrimCount(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Normal Calculations
|
||||
int parcelMax = (int)((long)LandData.Area
|
||||
* (long)m_scene.RegionInfo.ObjectCapacity
|
||||
/ 65536L);
|
||||
int parcelMax = (int)(((float)LandData.Area / 65536.0f)
|
||||
* (float)m_scene.RegionInfo.ObjectCapacity
|
||||
* (float)m_scene.RegionInfo.RegionSettings.ObjectBonus);
|
||||
// TODO: The calculation of ObjectBonus should be refactored. It does still not work in the same manner as SL!
|
||||
return parcelMax;
|
||||
}
|
||||
}
|
||||
@@ -224,9 +207,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
else
|
||||
{
|
||||
//Normal Calculations
|
||||
int simMax = (int)((long)LandData.SimwideArea
|
||||
* (long)m_scene.RegionInfo.ObjectCapacity / 65536L);
|
||||
// m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}", LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax);
|
||||
int simMax = (int)(((float)LandData.SimwideArea / 65536.0f)
|
||||
* (float)m_scene.RegionInfo.ObjectCapacity);
|
||||
return simMax;
|
||||
}
|
||||
}
|
||||
@@ -263,7 +245,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
remote_client.SendLandProperties(seq_id,
|
||||
snap_selection, request_result, this,
|
||||
(float)m_scene.RegionInfo.RegionSettings.ObjectBonus,
|
||||
GetParcelBasePrimCount(),
|
||||
GetParcelMaxPrimCount(),
|
||||
GetSimulatorMaxPrimCount(), regionFlags);
|
||||
}
|
||||
|
||||
@@ -322,7 +304,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
allowedDelta |= (uint)(ParcelFlags.ShowDirectory |
|
||||
ParcelFlags.AllowPublish |
|
||||
ParcelFlags.MaturePublish) | (uint)(1 << 23);
|
||||
ParcelFlags.MaturePublish);
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId,this, GroupPowers.LandChangeIdentity))
|
||||
@@ -434,37 +416,6 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool HasGroupAccess(UUID avatar)
|
||||
{
|
||||
if (LandData.GroupID != UUID.Zero && (LandData.Flags & (uint)ParcelFlags.UseAccessGroup) == (uint)ParcelFlags.UseAccessGroup)
|
||||
{
|
||||
ScenePresence sp;
|
||||
if (!m_scene.TryGetScenePresence(avatar, out sp))
|
||||
{
|
||||
IGroupsModule groupsModule = m_scene.RequestModuleInterface<IGroupsModule>();
|
||||
if (groupsModule == null)
|
||||
return false;
|
||||
|
||||
GroupMembershipData[] membership = groupsModule.GetMembershipData(avatar);
|
||||
if (membership == null || membership.Length == 0)
|
||||
return false;
|
||||
|
||||
foreach (GroupMembershipData d in membership)
|
||||
{
|
||||
if (d.GroupID == LandData.GroupID)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sp.ControllingClient.IsGroupMember(LandData.GroupID))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool IsBannedFromLand(UUID avatar)
|
||||
{
|
||||
ExpireAccessList();
|
||||
@@ -517,13 +468,9 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
return false;
|
||||
}) == -1)
|
||||
{
|
||||
if (!HasGroupAccess(avatar))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
if (m_ParcelCounts.TryGetValue(landData.GlobalID, out parcelCounts))
|
||||
{
|
||||
UUID landOwner = landData.OwnerID;
|
||||
int partCount = obj.GetPartCount();
|
||||
int partCount = obj.Parts.Length;
|
||||
|
||||
m_SimwideCounts[landOwner] += partCount;
|
||||
if (parcelCounts.Users.ContainsKey(obj.OwnerID))
|
||||
@@ -593,4 +593,4 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -176,13 +176,6 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((perms & (uint)PermissionMask.Copy) == 0)
|
||||
{
|
||||
if (m_dialogModule != null)
|
||||
m_dialogModule.SendAlertToUser(remoteClient, "This sale has been blocked by the permissions system");
|
||||
return false;
|
||||
}
|
||||
|
||||
AssetBase asset = m_scene.CreateAsset(
|
||||
group.GetPartName(localID),
|
||||
group.GetPartDescription(localID),
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "DefaultPermissionsModule"; }
|
||||
get { return "PermissionsModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
@@ -707,7 +707,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
// Object owners should be able to edit their own content
|
||||
if (currentUser == objectOwner)
|
||||
{
|
||||
permission = true;
|
||||
// there is no way that later code can change this back to false
|
||||
// so just return true immediately and short circuit the more
|
||||
// expensive group checks
|
||||
return true;
|
||||
|
||||
//permission = true;
|
||||
}
|
||||
else if (group.IsAttachment)
|
||||
{
|
||||
|
||||
@@ -28,8 +28,6 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Timers;
|
||||
using System.IO;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using log4net;
|
||||
@@ -58,23 +56,13 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
protected UUID m_Initiator;
|
||||
protected bool m_Notice = false;
|
||||
protected IDialogModule m_DialogModule = null;
|
||||
protected string m_MarkerPath = String.Empty;
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig restartConfig = config.Configs["RestartModule"];
|
||||
if (restartConfig != null)
|
||||
{
|
||||
m_MarkerPath = restartConfig.GetString("MarkerPath", String.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
if (m_MarkerPath != String.Empty)
|
||||
File.Delete(Path.Combine(m_MarkerPath,
|
||||
scene.RegionInfo.RegionID.ToString()));
|
||||
|
||||
m_Scene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IRestartModule>(this);
|
||||
@@ -133,7 +121,6 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
|
||||
if (alerts == null)
|
||||
{
|
||||
CreateMarkerFile();
|
||||
m_Scene.RestartNow();
|
||||
return;
|
||||
}
|
||||
@@ -147,7 +134,6 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
|
||||
if (m_Alerts[0] == 0)
|
||||
{
|
||||
CreateMarkerFile();
|
||||
m_Scene.RestartNow();
|
||||
return;
|
||||
}
|
||||
@@ -161,7 +147,6 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
{
|
||||
if (m_Alerts.Count == 0 || m_Alerts[0] == 0)
|
||||
{
|
||||
CreateMarkerFile();
|
||||
m_Scene.RestartNow();
|
||||
return 0;
|
||||
}
|
||||
@@ -240,9 +225,6 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
if (m_DialogModule != null && message != String.Empty)
|
||||
m_DialogModule.SendGeneralAlert(message);
|
||||
}
|
||||
if (m_MarkerPath != String.Empty)
|
||||
File.Delete(Path.Combine(m_MarkerPath,
|
||||
m_Scene.RegionInfo.RegionID.ToString()));
|
||||
}
|
||||
|
||||
private void HandleRegionRestart(string module, string[] args)
|
||||
@@ -284,25 +266,5 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
|
||||
ScheduleRestart(UUID.Zero, args[3], times.ToArray(), notice);
|
||||
}
|
||||
|
||||
protected void CreateMarkerFile()
|
||||
{
|
||||
if (m_MarkerPath == String.Empty)
|
||||
return;
|
||||
|
||||
string path = Path.Combine(m_MarkerPath, m_Scene.RegionInfo.RegionID.ToString());
|
||||
try
|
||||
{
|
||||
string pidstring = System.Diagnostics.Process.GetCurrentProcess().Id.ToString();
|
||||
FileStream fs = File.Create(path);
|
||||
System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
|
||||
Byte[] buf = enc.GetBytes(pidstring);
|
||||
fs.Write(buf, 0, buf.Length);
|
||||
fs.Close();
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,6 +148,113 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||
<OtherParts />
|
||||
</SceneObjectGroup>";
|
||||
|
||||
private string badFloatsXml = @"
|
||||
<SceneObjectGroup>
|
||||
<RootPart>
|
||||
<SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
|
||||
<AllowedDrop>false</AllowedDrop>
|
||||
<CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
|
||||
<FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID>
|
||||
<InventorySerial>1</InventorySerial>
|
||||
<TaskInventory />
|
||||
<ObjectFlags>0</ObjectFlags>
|
||||
<UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
|
||||
<LocalId>2698615125</LocalId>
|
||||
<Name>NaughtyPrim</Name>
|
||||
<Material>0</Material>
|
||||
<PassTouches>false</PassTouches>
|
||||
<RegionHandle>1099511628032000</RegionHandle>
|
||||
<ScriptAccessPin>0</ScriptAccessPin>
|
||||
<GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition>
|
||||
<OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
|
||||
<RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset>
|
||||
<Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
|
||||
<RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
|
||||
<AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
|
||||
<Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
|
||||
<Description />
|
||||
<Color />
|
||||
<Text />
|
||||
<SitName />
|
||||
<TouchName />
|
||||
<LinkNum>0</LinkNum>
|
||||
<ClickAction>0</ClickAction>
|
||||
<Shape>
|
||||
<ProfileCurve>1</ProfileCurve>
|
||||
<TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
|
||||
<ExtraParams>AA==</ExtraParams>
|
||||
<PathBegin>0</PathBegin>
|
||||
<PathCurve>16</PathCurve>
|
||||
<PathEnd>0</PathEnd>
|
||||
<PathRadiusOffset>0</PathRadiusOffset>
|
||||
<PathRevolutions>0</PathRevolutions>
|
||||
<PathScaleX>100</PathScaleX>
|
||||
<PathScaleY>100</PathScaleY>
|
||||
<PathShearX>0</PathShearX>
|
||||
<PathShearY>0</PathShearY>
|
||||
<PathSkew>0</PathSkew>
|
||||
<PathTaperX>0</PathTaperX>
|
||||
<PathTaperY>0</PathTaperY>
|
||||
<PathTwist>0</PathTwist>
|
||||
<PathTwistBegin>0</PathTwistBegin>
|
||||
<PCode>9</PCode>
|
||||
<ProfileBegin>0</ProfileBegin>
|
||||
<ProfileEnd>0</ProfileEnd>
|
||||
<ProfileHollow>0</ProfileHollow>
|
||||
<Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
|
||||
<State>0</State>
|
||||
<ProfileShape>Square</ProfileShape>
|
||||
<HollowShape>Same</HollowShape>
|
||||
<SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
|
||||
<SculptType>0</SculptType><SculptData />
|
||||
<FlexiSoftness>0</FlexiSoftness>
|
||||
<FlexiTension>0,5</FlexiTension>
|
||||
<FlexiDrag>yo mamma</FlexiDrag>
|
||||
<FlexiGravity>0</FlexiGravity>
|
||||
<FlexiWind>0</FlexiWind>
|
||||
<FlexiForceX>0</FlexiForceX>
|
||||
<FlexiForceY>0</FlexiForceY>
|
||||
<FlexiForceZ>0</FlexiForceZ>
|
||||
<LightColorR>0</LightColorR>
|
||||
<LightColorG>0</LightColorG>
|
||||
<LightColorB>0</LightColorB>
|
||||
<LightColorA>1</LightColorA>
|
||||
<LightRadius>0</LightRadius>
|
||||
<LightCutoff>0</LightCutoff>
|
||||
<LightFalloff>0</LightFalloff>
|
||||
<LightIntensity>1</LightIntensity>
|
||||
<FlexiEntry>false</FlexiEntry>
|
||||
<LightEntry>false</LightEntry>
|
||||
<SculptEntry>false</SculptEntry>
|
||||
</Shape>
|
||||
<Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
|
||||
<UpdateFlag>0</UpdateFlag>
|
||||
<SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
|
||||
<SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
|
||||
<SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
|
||||
<SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
|
||||
<ParentID>0</ParentID>
|
||||
<CreationDate>1211330445</CreationDate>
|
||||
<Category>0</Category>
|
||||
<SalePrice>0</SalePrice>
|
||||
<ObjectSaleType>0</ObjectSaleType>
|
||||
<OwnershipCost>0</OwnershipCost>
|
||||
<GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
|
||||
<OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID>
|
||||
<LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID>
|
||||
<BaseMask>2147483647</BaseMask>
|
||||
<OwnerMask>2147483647</OwnerMask>
|
||||
<GroupMask>0</GroupMask>
|
||||
<EveryoneMask>0</EveryoneMask>
|
||||
<NextOwnerMask>2147483647</NextOwnerMask>
|
||||
<Flags>None</Flags>
|
||||
<CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
|
||||
<CollisionSoundVolume>0</CollisionSoundVolume>
|
||||
</SceneObjectPart>
|
||||
</RootPart>
|
||||
<OtherParts />
|
||||
</SceneObjectGroup>";
|
||||
|
||||
private string xml2 = @"
|
||||
<SceneObjectGroup>
|
||||
<SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
|
||||
@@ -256,6 +363,32 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||
// TODO: Check other properties
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDeserializeBadFloatsXml()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml);
|
||||
SceneObjectPart rootPart = so.RootPart;
|
||||
|
||||
Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
|
||||
Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
|
||||
Assert.That(rootPart.Name, Is.EqualTo("NaughtyPrim"));
|
||||
|
||||
// This terminates the deserialization earlier if couldn't be parsed.
|
||||
// TODO: Need to address this
|
||||
Assert.That(rootPart.GroupPosition.X, Is.EqualTo(147.23f));
|
||||
|
||||
Assert.That(rootPart.Shape.PathCurve, Is.EqualTo(16));
|
||||
|
||||
// Defaults for bad parses
|
||||
Assert.That(rootPart.Shape.FlexiTension, Is.EqualTo(0));
|
||||
Assert.That(rootPart.Shape.FlexiDrag, Is.EqualTo(0));
|
||||
|
||||
// TODO: Check other properties
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSerializeXml()
|
||||
{
|
||||
|
||||
@@ -606,8 +606,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
m_scene.PhysicsScene.SetTerrain(m_channel.GetFloatsSerialised());
|
||||
m_scene.SaveTerrain();
|
||||
|
||||
m_scene.EventManager.TriggerTerrainUpdate();
|
||||
|
||||
// Clients who look at the map will never see changes after they looked at the map, so i've commented this out.
|
||||
//m_scene.CreateTerrainTexture(true);
|
||||
}
|
||||
|
||||
@@ -86,9 +86,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
|
||||
private void OnMapNameRequest(IClientAPI remoteClient, string mapName, uint flags)
|
||||
{
|
||||
if (mapName.Length < 2)
|
||||
if (mapName.Length < 3)
|
||||
{
|
||||
remoteClient.SendAlertMessage("Use a search string with at least 2 characters");
|
||||
remoteClient.SendAlertMessage("Use a search string with at least 3 characters");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
|
||||
// try to fetch from GridServer
|
||||
List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
|
||||
// if (regionInfos.Count == 0)
|
||||
// remoteClient.SendAlertMessage("Hyperlink could not be established.");
|
||||
if (regionInfos.Count == 0)
|
||||
remoteClient.SendAlertMessage("Hyperlink could not be established.");
|
||||
|
||||
//m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count);
|
||||
m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions. Flags={2}", mapName, regionInfos.Count, flags);
|
||||
List<MapBlockData> blocks = new List<MapBlockData>();
|
||||
|
||||
MapBlockData data;
|
||||
@@ -128,7 +128,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
data.Agents = 0;
|
||||
data.Access = 255;
|
||||
data.MapImageId = UUID.Zero;
|
||||
data.Name = mapName;
|
||||
data.Name = ""; // mapName;
|
||||
data.RegionFlags = 0;
|
||||
data.WaterHeight = 0; // not used
|
||||
data.X = 0;
|
||||
|
||||
@@ -1239,7 +1239,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
}
|
||||
else
|
||||
{
|
||||
OSDArray responsearr = new OSDArray(); // Don't preallocate. MT (m_scene.GetRootAgentCount());
|
||||
OSDArray responsearr = new OSDArray(m_scene.GetRootAgentCount());
|
||||
m_scene.ForEachRootScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
OSDMap responsemapdata = new OSDMap();
|
||||
@@ -1458,10 +1458,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
Color background = Color.FromArgb(0, 0, 0, 0);
|
||||
SolidBrush transparent = new SolidBrush(background);
|
||||
Graphics g = Graphics.FromImage(overlay);
|
||||
g.FillRectangle(transparent, 0, 0, 255, 255);
|
||||
g.FillRectangle(transparent, 0, 0, 256, 256);
|
||||
|
||||
SolidBrush yellow = new SolidBrush(Color.FromArgb(255, 249, 223, 9));
|
||||
Pen grey = new Pen(Color.FromArgb(255, 92, 92, 92));
|
||||
|
||||
foreach (ILandObject land in parcels)
|
||||
{
|
||||
@@ -1470,41 +1469,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
{
|
||||
landForSale = true;
|
||||
|
||||
bool[,] landBitmap = land.GetLandBitmap();
|
||||
|
||||
for (int x = 0 ; x < 64 ; x++)
|
||||
{
|
||||
for (int y = 0 ; y < 64 ; y++)
|
||||
{
|
||||
if (landBitmap[x, y])
|
||||
{
|
||||
g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4);
|
||||
|
||||
if (x > 0)
|
||||
{
|
||||
if ((saleBitmap[x - 1, y] || landBitmap[x - 1, y]) == false)
|
||||
g.DrawLine(grey, x * 4, 252 - (y * 4), x * 4, 255 - (y * 4));
|
||||
}
|
||||
if (y > 0)
|
||||
{
|
||||
if ((saleBitmap[x, y-1] || landBitmap[x, y-1]) == false)
|
||||
g.DrawLine(grey, x * 4, 255 - (y * 4), x * 4 + 3, 255 - (y * 4));
|
||||
}
|
||||
if (x < 63)
|
||||
{
|
||||
if ((saleBitmap[x + 1, y] || landBitmap[x + 1, y]) == false)
|
||||
g.DrawLine(grey, x * 4 + 3, 252 - (y * 4), x * 4 + 3, 255 - (y * 4));
|
||||
}
|
||||
if (y < 63)
|
||||
{
|
||||
if ((saleBitmap[x, y + 1] || landBitmap[x, y + 1]) == false)
|
||||
g.DrawLine(grey, x * 4, 252 - (y * 4), x * 4 + 3, 252 - (y * 4));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
saleBitmap = land.MergeLandBitmaps(saleBitmap, landBitmap);
|
||||
saleBitmap = land.MergeLandBitmaps(saleBitmap, land.GetLandBitmap());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1516,6 +1481,15 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
|
||||
m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, genrating overlay", m_scene.RegionInfo.RegionName);
|
||||
|
||||
for (int x = 0 ; x < 64 ; x++)
|
||||
{
|
||||
for (int y = 0 ; y < 64 ; y++)
|
||||
{
|
||||
if (saleBitmap[x, y])
|
||||
g.FillRectangle(yellow, x * 4, 252 - (y * 4), 4, 4);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return OpenJPEG.EncodeFromImage(overlay, true);
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Xml;
|
||||
using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -76,10 +75,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <returns>The scene object that was attached. Null if the scene object could not be found</returns>
|
||||
ISceneEntity RezSingleAttachmentFromInventory(IScenePresence sp, UUID itemID, uint AttachmentPt);
|
||||
|
||||
// Same as above, but also load script states from a separate doc
|
||||
ISceneEntity RezSingleAttachmentFromInventory(
|
||||
IScenePresence presence, UUID itemID, uint AttachmentPt, bool updateInventoryStatus, XmlDocument doc);
|
||||
|
||||
/// <summary>
|
||||
/// Rez multiple attachments from a user's inventory
|
||||
/// </summary>
|
||||
@@ -101,6 +96,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <param name="itemID"></param>
|
||||
void DetachSingleAttachmentToInv(IScenePresence sp, UUID itemID);
|
||||
|
||||
/// <summary>
|
||||
/// Update the position of an attachment.
|
||||
/// </summary>
|
||||
/// <param name="sog"></param>
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
|
||||
public interface IAvatarFactoryModule
|
||||
{
|
||||
void SetAppearance(IScenePresence sp, AvatarAppearance appearance);
|
||||
void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -115,8 +115,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// <param name="stateSource"></param>
|
||||
void CreateScriptInstance(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
||||
|
||||
ArrayList CreateScriptInstanceEr(UUID itemId, int startParam, bool postOnRez, string engine, int stateSource);
|
||||
|
||||
/// <summary>
|
||||
/// Stop a script which is in this prim's inventory.
|
||||
/// </summary>
|
||||
@@ -231,6 +229,5 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// A <see cref="Dictionary`2"/>
|
||||
/// </returns>
|
||||
Dictionary<UUID, string> GetScriptStates();
|
||||
Dictionary<UUID, string> GetScriptStates(bool oldIDs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
void Teleport(ScenePresence agent, ulong regionHandle, Vector3 position,
|
||||
Vector3 lookAt, uint teleportFlags);
|
||||
|
||||
bool TeleportHome(UUID id, IClientAPI client);
|
||||
|
||||
void DoTeleport(ScenePresence sp, GridRegion reg, GridRegion finalDestination,
|
||||
Vector3 position, Vector3 lookAt, uint teleportFlags, IEventQueue eq);
|
||||
|
||||
void TeleportHome(UUID id, IClientAPI client);
|
||||
|
||||
bool Cross(ScenePresence agent, bool isFlying);
|
||||
|
||||
void AgentArrivedAtDestination(UUID agent);
|
||||
|
||||
@@ -45,7 +45,5 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// Tell all clients about the current state of the region (terrain textures, water height, etc.).
|
||||
/// </summary>
|
||||
void sendRegionHandshakeToAll();
|
||||
void TriggerEstateInfoChange();
|
||||
void TriggerRegionInfoChange();
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user