Merge branch 'master' into careminster-presence-refactor

avinationmerge
Melanie 2010-03-30 21:34:27 +01:00
commit 5693870fe2
75 changed files with 1160 additions and 1046 deletions

View File

@ -1,8 +1,59 @@
<!-- -*- xml -*- -->
<!-- please leave the top comment for us emacs folks -->
<property name="projectdir" value="opensim-0.5.5" />
<property name="nunitcmd" value="nunit-console" />
<!-- For safety/laziness sake, we're going to take the approach of deleting known extraneous files here rather than
trying to copy across only the essential ones -->
<property name="distbindir" value="distbin" />
<target name="distbin">
<copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/>
<delete dir="${distbindir}"/>
<!-- <copy file="*" todir="${distbindir}"/> -->
<copy todir="${distbindir}">
<fileset>
<include name="**"/>
</fileset>
</copy>
<delete dir="${distbindir}/OpenSim"/>
<delete dir="${distbindir}/Prebuild"/>
<delete dir="${distbindir}/%temp%"/>
<delete dir="${distbindir}/.nant"/>
<delete>
<fileset basedir="${distbindir}">
<include name="Makefile"/>
<include name="nant-color"/>
<include name="OpenSim.*"/>
<include name="prebuild.xml"/>
<include name="runprebuild*"/>
<include name="TESTING.txt"/>
<include name="TestResult.xml"/>
<include name="bin/OpenSim.Server.ini"/>
<include name="bin/Regions/*"/>
<include name="bin/*.db"/>
<include name="**/.git/**"/>
<include name=".gitignore"/>
<include name=".hgignore"/>
</fileset>
</delete>
</target>
<!-- I don't think these targets are being actively used. But just in case, we'll just comment them out for now - justincc -->
<!--
<property name="projectdir" value="opensim-0.6.9" />
<target name="dist" depends="distdir">
<zip zipfile="${projectdir}.zip">
<fileset basedir=".">
<include name="${projectdir}/**" />
</fileset>
</zip>
<tar destfile="${projectdir}.tar.gz" compression="GZip">
<fileset basedir=".">
<include name="${projectdir}/**" />
</fileset>
</tar>
</target>
<target name="distdir">
<delete dir="${projectdir}" />
<copy todir="${projectdir}">
@ -21,14 +72,14 @@
<include name="bin/assets/**" />
<include name="bin/data/**" />
<include name="bin/OpenSim*xml" />
<!-- the next is to exclude built libs -->
<exclude name="bin/OpenSim.*dll" />
<include name="bin/OpenSim.ini" />
<include name="bin/defaultstripe.png" />
<exclude name="bin/OpenSim.*dll" />
</fileset>
</copy>
<touch file="${projectdir}/bin/startup_commands.txt" />
</target>
-->
<target name="test" depends="build, find-nunit">
<setenv name="MONO_THREADS_PER_CPU" value="100" />
@ -296,17 +347,3 @@
<target name="doxygen">
<exec program="doxygen" workingdir="doc" commandline="doxygen.conf" />
</target>
<target name="dist" depends="distdir">
<zip zipfile="${projectdir}.zip">
<fileset basedir=".">
<include name="${projectdir}/**" />
</fileset>
</zip>
<tar destfile="${projectdir}.tar.gz" compression="GZip">
<fileset basedir=".">
<include name="${projectdir}/**" />
</fileset>
</tar>
</target>

View File

@ -123,10 +123,15 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
private void DoMove(RequestData rdata)
{
if (rdata.Parameters.Length >= 6)
if (rdata.Parameters.Length < 6)
{
Rest.Log.WarnFormat("{0} Move: No movement information provided", MsgId);
rdata.Fail(Rest.HttpStatusCodeBadRequest, "no movement information provided");
}
else
{
string[] names = rdata.Parameters[PARM_MOVE_AVATAR].Split(Rest.CA_SPACE);
ScenePresence avatar = null;
ScenePresence presence = null;
Scene scene = null;
if (names.Length != 2)
@ -141,21 +146,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
// The first parameter should be an avatar name, look for the
// avatar in the known regions first.
foreach (Scene cs in Rest.main.SceneManager.Scenes)
Rest.main.SceneManager.ForEachScene(delegate(Scene s)
{
foreach (ScenePresence presence in cs.GetAvatars())
s.ForEachScenePresence(delegate(ScenePresence sp)
{
if (presence.Firstname == names[0] &&
presence.Lastname == names[1])
if (sp.Firstname == names[0] && sp.Lastname == names[1])
{
scene = cs;
avatar = presence;
break;
scene = s;
presence = sp;
}
}
}
});
});
if (avatar != null)
if (presence != null)
{
Rest.Log.DebugFormat("{0} Move : Avatar {1} located in region {2}",
MsgId, rdata.Parameters[PARM_MOVE_AVATAR], scene.RegionInfo.RegionName);
@ -166,14 +169,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
float y = Convert.ToSingle(rdata.Parameters[PARM_MOVE_Y]);
float z = Convert.ToSingle(rdata.Parameters[PARM_MOVE_Z]);
Vector3 vector = new Vector3(x,y,z);
avatar.DoAutoPilot(0,vector,avatar.ControllingClient);
presence.DoAutoPilot(0,vector,presence.ControllingClient);
}
catch (Exception e)
{
rdata.Fail(Rest.HttpStatusCodeBadRequest,
String.Format("invalid parameters: {0}", e.Message));
}
}
else
{
@ -183,12 +185,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory.Tests
rdata.Complete();
rdata.Respond("OK");
}
else
{
Rest.Log.WarnFormat("{0} Move: No movement information provided", MsgId);
rdata.Fail(Rest.HttpStatusCodeBadRequest, "no movement information provided");
}
}

View File

@ -192,7 +192,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
protected string RegionStats(OSHttpResponse httpResponse, Scene scene)
{
int users = scene.GetAvatars().Count;
int users = scene.GetRootAgentCount();
int objects = scene.Entities.Count - users;
RestXmlWriter rxw = new RestXmlWriter(new StringWriter());

View File

@ -117,7 +117,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
rxw.WriteString(s.RegionInfo.InternalEndPoint.ToString());
rxw.WriteEndAttribute();
int users = s.GetAvatars().Count;
int users = s.GetRootAgentCount();
rxw.WriteStartAttribute(String.Empty, "avatars", String.Empty);
rxw.WriteValue(users);
rxw.WriteEndAttribute();

View File

@ -83,7 +83,7 @@ namespace OpenSim.Data.MSSQL
/// </summary>
/// <param name="regionID">region ID.</param>
/// <returns></returns>
public EstateSettings LoadEstateSettings(UUID regionID)
public EstateSettings LoadEstateSettings(UUID regionID, bool create)
{
EstateSettings es = new EstateSettings();
@ -127,7 +127,7 @@ namespace OpenSim.Data.MSSQL
}
if (insertEstate)
if (insertEstate && create)
{
List<string> names = new List<string>(FieldList);
@ -173,25 +173,6 @@ namespace OpenSim.Data.MSSQL
}
}
// Munge and transfer the ban list
sql = string.Format("insert into estateban select {0}, bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = @UUID", es.EstateID);
using (SqlConnection conn = new SqlConnection(m_connectionString))
using (SqlCommand cmd = new SqlCommand(sql, conn))
{
cmd.Parameters.Add(_Database.CreateParameter("@UUID", regionID));
try
{
conn.Open();
cmd.ExecuteNonQuery();
}
catch (Exception)
{
_Log.Debug("[ESTATE DB]: Error setting up estateban from regionban");
}
}
//TODO check if this is needed??
es.Save();
}
@ -365,6 +346,31 @@ namespace OpenSim.Data.MSSQL
}
}
}
public EstateSettings LoadEstateSettings(int estateID)
{
return new EstateSettings();
}
public List<int> GetEstates(string search)
{
return new List<int>();
}
public bool LinkRegion(UUID regionID, int estateID)
{
return false;
}
public List<UUID> GetRegions(int estateID)
{
return new List<UUID>();
}
public bool DeleteEstate(int estateID)
{
return false;
}
#endregion
}
}

View File

@ -121,111 +121,110 @@ namespace OpenSim.Data.MySQL
}
}
public EstateSettings LoadEstateSettings(UUID regionID)
public EstateSettings LoadEstateSettings(UUID regionID, bool create)
{
EstateSettings es = new EstateSettings();
es.OnSave += StoreEstateSettings;
string sql = "select estate_settings." + String.Join(",estate_settings.", FieldList) +
" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = ?RegionID";
bool migration = true;
using (MySqlCommand cmd = new MySqlCommand())
{
cmd.CommandText = sql;
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
return DoLoad(cmd, regionID, create);
}
}
private EstateSettings DoLoad(MySqlCommand cmd, UUID regionID, bool create)
{
EstateSettings es = new EstateSettings();
es.OnSave += StoreEstateSettings;
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = dbcon.CreateCommand())
cmd.Connection = dbcon;
bool found = false;
using (IDataReader r = cmd.ExecuteReader())
{
cmd.CommandText = sql;
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
using (IDataReader r = cmd.ExecuteReader())
if (r.Read())
{
if (r.Read())
found = true;
foreach (string name in FieldList)
{
migration = false;
foreach (string name in FieldList)
if (m_FieldMap[name].GetValue(es) is bool)
{
if (m_FieldMap[name].GetValue(es) is bool)
{
int v = Convert.ToInt32(r[name]);
if (v != 0)
m_FieldMap[name].SetValue(es, true);
else
m_FieldMap[name].SetValue(es, false);
}
else if (m_FieldMap[name].GetValue(es) is UUID)
{
UUID uuid = UUID.Zero;
UUID.TryParse(r[name].ToString(), out uuid);
m_FieldMap[name].SetValue(es, uuid);
}
int v = Convert.ToInt32(r[name]);
if (v != 0)
m_FieldMap[name].SetValue(es, true);
else
{
m_FieldMap[name].SetValue(es, r[name]);
}
m_FieldMap[name].SetValue(es, false);
}
else if (m_FieldMap[name].GetValue(es) is UUID)
{
UUID uuid = UUID.Zero;
UUID.TryParse(r[name].ToString(), out uuid);
m_FieldMap[name].SetValue(es, uuid);
}
else
{
m_FieldMap[name].SetValue(es, r[name]);
}
}
}
}
if (migration)
if (!found && create)
{
// Migration case
List<string> names = new List<string>(FieldList);
names.Remove("EstateID");
sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")";
string sql = "insert into estate_settings (" + String.Join(",", names.ToArray()) + ") values ( ?" + String.Join(", ?", names.ToArray()) + ")";
using (MySqlCommand cmd = dbcon.CreateCommand())
using (MySqlCommand cmd2 = dbcon.CreateCommand())
{
cmd.CommandText = sql;
cmd.Parameters.Clear();
cmd2.CommandText = sql;
cmd2.Parameters.Clear();
foreach (string name in FieldList)
{
if (m_FieldMap[name].GetValue(es) is bool)
{
if ((bool)m_FieldMap[name].GetValue(es))
cmd.Parameters.AddWithValue("?" + name, "1");
cmd2.Parameters.AddWithValue("?" + name, "1");
else
cmd.Parameters.AddWithValue("?" + name, "0");
cmd2.Parameters.AddWithValue("?" + name, "0");
}
else
{
cmd.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString());
cmd2.Parameters.AddWithValue("?" + name, m_FieldMap[name].GetValue(es).ToString());
}
}
cmd.ExecuteNonQuery();
cmd2.ExecuteNonQuery();
cmd.CommandText = "select LAST_INSERT_ID() as id";
cmd.Parameters.Clear();
cmd2.CommandText = "select LAST_INSERT_ID() as id";
cmd2.Parameters.Clear();
using (IDataReader r = cmd.ExecuteReader())
using (IDataReader r = cmd2.ExecuteReader())
{
r.Read();
es.EstateID = Convert.ToUInt32(r["id"]);
}
cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
cmd.Parameters.AddWithValue("?RegionID", regionID.ToString());
cmd.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
cmd2.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
cmd2.Parameters.AddWithValue("?RegionID", regionID.ToString());
cmd2.Parameters.AddWithValue("?EstateID", es.EstateID.ToString());
// This will throw on dupe key
try { cmd.ExecuteNonQuery(); }
catch (Exception) { }
// Munge and transfer the ban list
cmd.Parameters.Clear();
cmd.CommandText = "insert into estateban select " + es.EstateID.ToString() + ", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = ?UUID";
cmd.Parameters.AddWithValue("?UUID", regionID.ToString());
try { cmd.ExecuteNonQuery(); }
try { cmd2.ExecuteNonQuery(); }
catch (Exception) { }
es.Save();
@ -398,5 +397,89 @@ namespace OpenSim.Data.MySQL
return uuids.ToArray();
}
public EstateSettings LoadEstateSettings(int estateID)
{
using (MySqlCommand cmd = new MySqlCommand())
{
string sql = "select estate_settings." + String.Join(",estate_settings.", FieldList) + " from estate_settings where EstateID = ?EstateID";
cmd.CommandText = sql;
cmd.Parameters.AddWithValue("?EstateID", estateID);
return DoLoad(cmd, UUID.Zero, false);
}
}
public List<int> GetEstates(string search)
{
List<int> result = new List<int>();
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = dbcon.CreateCommand())
{
cmd.CommandText = "select estateID from estate_settings where EstateName = ?EstateName";
cmd.Parameters.AddWithValue("?EstateName", search);
using (IDataReader reader = cmd.ExecuteReader())
{
while (reader.Read())
{
result.Add(Convert.ToInt32(reader["EstateID"]));
}
reader.Close();
}
}
dbcon.Close();
}
return result;
}
public bool LinkRegion(UUID regionID, int estateID)
{
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
try
{
using (MySqlCommand cmd = dbcon.CreateCommand())
{
cmd.CommandText = "insert into estate_map values (?RegionID, ?EstateID)";
cmd.Parameters.AddWithValue("?RegionID", regionID);
cmd.Parameters.AddWithValue("?EstateID", estateID);
int ret = cmd.ExecuteNonQuery();
dbcon.Close();
return (ret != 0);
}
}
catch (MySqlException ex)
{
m_log.Error("[REGION DB]: LinkRegion failed: " + ex.Message);
}
dbcon.Close();
}
return false;
}
public List<UUID> GetRegions(int estateID)
{
return new List<UUID>();
}
public bool DeleteEstate(int estateID)
{
return false;
}
}
}

View File

@ -67,4 +67,5 @@ CREATE TABLE `regionwindlight` (
PRIMARY KEY (`region_id`)
);
COMMIT;
ALTER TABLE estate_settings AUTO_INCREMENT = 100;
COMMIT;

View File

@ -40,7 +40,7 @@ namespace OpenSim.Data.Null
{
private static NullRegionData Instance = null;
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
Dictionary<UUID, RegionData> m_regionData = new Dictionary<UUID, RegionData>();
@ -192,4 +192,4 @@ namespace OpenSim.Data.Null
return ret;
}
}
}
}

View File

@ -80,11 +80,8 @@ namespace OpenSim.Data.SQLite
get { return new List<string>(m_FieldMap.Keys).ToArray(); }
}
public EstateSettings LoadEstateSettings(UUID regionID)
public EstateSettings LoadEstateSettings(UUID regionID, bool create)
{
EstateSettings es = new EstateSettings();
es.OnSave += StoreEstateSettings;
string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_map left join estate_settings on estate_map.EstateID = estate_settings.EstateID where estate_settings.EstateID is not null and RegionID = :RegionID";
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
@ -92,6 +89,14 @@ namespace OpenSim.Data.SQLite
cmd.CommandText = sql;
cmd.Parameters.Add(":RegionID", regionID.ToString());
return DoLoad(cmd, regionID, create);
}
private EstateSettings DoLoad(SqliteCommand cmd, UUID regionID, bool create)
{
EstateSettings es = new EstateSettings();
es.OnSave += StoreEstateSettings;
IDataReader r = cmd.ExecuteReader();
if (r.Read())
@ -120,17 +125,15 @@ namespace OpenSim.Data.SQLite
}
r.Close();
}
else
else if (create)
{
// Migration case
//
r.Close();
List<string> names = new List<string>(FieldList);
names.Remove("EstateID");
sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
string sql = "insert into estate_settings ("+String.Join(",", names.ToArray())+") values ( :"+String.Join(", :", names.ToArray())+")";
cmd.CommandText = sql;
cmd.Parameters.Clear();
@ -176,20 +179,6 @@ namespace OpenSim.Data.SQLite
{
}
// Munge and transfer the ban list
//
cmd.Parameters.Clear();
cmd.CommandText = "insert into estateban select "+es.EstateID.ToString()+", bannedUUID, bannedIp, bannedIpHostMask, '' from regionban where regionban.regionUUID = :UUID";
cmd.Parameters.Add(":UUID", regionID.ToString());
try
{
cmd.ExecuteNonQuery();
}
catch (Exception)
{
}
es.Save();
}
@ -336,5 +325,63 @@ namespace OpenSim.Data.SQLite
return uuids.ToArray();
}
public EstateSettings LoadEstateSettings(int estateID)
{
string sql = "select estate_settings."+String.Join(",estate_settings.", FieldList)+" from estate_settings where estate_settings.EstateID :EstateID";
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
cmd.CommandText = sql;
cmd.Parameters.Add(":EstateID", estateID.ToString());
return DoLoad(cmd, UUID.Zero, false);
}
public List<int> GetEstates(string search)
{
List<int> result = new List<int>();
string sql = "select EstateID from estate_settings where estate_settings.EstateName :EstateName";
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
cmd.CommandText = sql;
cmd.Parameters.Add(":EstateName", search);
IDataReader r = cmd.ExecuteReader();
while (r.Read())
{
result.Add(Convert.ToInt32(r["EstateID"]));
}
r.Close();
return result;
}
public bool LinkRegion(UUID regionID, int estateID)
{
SqliteCommand cmd = (SqliteCommand)m_connection.CreateCommand();
cmd.CommandText = "insert into estate_map values (:RegionID, :EstateID)";
cmd.Parameters.Add(":RegionID", regionID.ToString());
cmd.Parameters.Add(":EstateID", estateID.ToString());
if (cmd.ExecuteNonQuery() == 0)
return false;
return true;
}
public List<UUID> GetRegions(int estateID)
{
return new List<UUID>();
}
public bool DeleteEstate(int estateID)
{
return false;
}
}
}

View File

@ -158,7 +158,7 @@ namespace OpenSim.Data.Tests
public void T012_EstateSettingsRandomStorage()
{
// Letting estate store generate rows to database for us
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
new PropertyScrambler<EstateSettings>()
.DontScramble(x=>x.EstateID)
.Scramble(originalSettings);
@ -167,7 +167,7 @@ namespace OpenSim.Data.Tests
db.StoreEstateSettings(originalSettings);
// Loading settings to another instance variable.
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID, true);
// Checking that loaded values are correct.
Assert.That(loadedSettings, Constraints.PropertyCompareConstraint(originalSettings));
@ -177,7 +177,7 @@ namespace OpenSim.Data.Tests
public void T020_EstateSettingsManagerList()
{
// Letting estate store generate rows to database for us
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
originalSettings.EstateManagers = new UUID[] { MANAGER_ID_1, MANAGER_ID_2 };
@ -185,7 +185,7 @@ namespace OpenSim.Data.Tests
db.StoreEstateSettings(originalSettings);
// Loading settings to another instance variable.
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID, true);
Assert.AreEqual(2, loadedSettings.EstateManagers.Length);
Assert.AreEqual(MANAGER_ID_1, loadedSettings.EstateManagers[0]);
@ -196,7 +196,7 @@ namespace OpenSim.Data.Tests
public void T021_EstateSettingsUserList()
{
// Letting estate store generate rows to database for us
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
originalSettings.EstateAccess = new UUID[] { USER_ID_1, USER_ID_2 };
@ -204,7 +204,7 @@ namespace OpenSim.Data.Tests
db.StoreEstateSettings(originalSettings);
// Loading settings to another instance variable.
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID, true);
Assert.AreEqual(2, loadedSettings.EstateAccess.Length);
Assert.AreEqual(USER_ID_1, loadedSettings.EstateAccess[0]);
@ -215,7 +215,7 @@ namespace OpenSim.Data.Tests
public void T022_EstateSettingsGroupList()
{
// Letting estate store generate rows to database for us
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
originalSettings.EstateGroups = new UUID[] { GROUP_ID_1, GROUP_ID_2 };
@ -223,7 +223,7 @@ namespace OpenSim.Data.Tests
db.StoreEstateSettings(originalSettings);
// Loading settings to another instance variable.
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID, true);
Assert.AreEqual(2, loadedSettings.EstateAccess.Length);
Assert.AreEqual(GROUP_ID_1, loadedSettings.EstateGroups[0]);
@ -234,7 +234,7 @@ namespace OpenSim.Data.Tests
public void T022_EstateSettingsBanList()
{
// Letting estate store generate rows to database for us
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings originalSettings = db.LoadEstateSettings(REGION_ID, true);
EstateBan estateBan1 = new EstateBan();
estateBan1.BannedUserID = DataTestUtil.UUID_MIN;
@ -248,7 +248,7 @@ namespace OpenSim.Data.Tests
db.StoreEstateSettings(originalSettings);
// Loading settings to another instance variable.
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID);
EstateSettings loadedSettings = db.LoadEstateSettings(REGION_ID, true);
Assert.AreEqual(2, loadedSettings.EstateBans.Length);
Assert.AreEqual(DataTestUtil.UUID_MIN, loadedSettings.EstateBans[0].BannedUserID);
@ -290,7 +290,7 @@ namespace OpenSim.Data.Tests
{
// Letting estate store generate rows to database for us
EstateSettings originalSettings = db.LoadEstateSettings(regionId);
EstateSettings originalSettings = db.LoadEstateSettings(regionId, true);
SetEstateSettings(
originalSettings,
@ -347,7 +347,7 @@ namespace OpenSim.Data.Tests
db.StoreEstateSettings(originalSettings);
// Loading settings to another instance variable.
EstateSettings loadedSettings = db.LoadEstateSettings(regionId);
EstateSettings loadedSettings = db.LoadEstateSettings(regionId, true);
// Checking that loaded values are correct.
ValidateEstateSettings(

View File

@ -35,7 +35,6 @@ namespace OpenSim.Framework
public class EstateSettings
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private readonly ConfigurationMember configMember;
public delegate void SaveDelegate(EstateSettings rs);
@ -43,7 +42,7 @@ namespace OpenSim.Framework
// Only the client uses these
//
private uint m_EstateID = 100;
private uint m_EstateID = 0;
public uint EstateID
{
@ -51,7 +50,7 @@ namespace OpenSim.Framework
set { m_EstateID = value; }
}
private string m_EstateName;
private string m_EstateName = "My Estate";
public string EstateName
{
@ -59,7 +58,7 @@ namespace OpenSim.Framework
set { m_EstateName = value; }
}
private uint m_ParentEstateID = 100;
private uint m_ParentEstateID = 1;
public uint ParentEstateID
{
@ -67,7 +66,7 @@ namespace OpenSim.Framework
set { m_ParentEstateID = value; }
}
private float m_BillableFactor;
private float m_BillableFactor = 0.0f;
public float BillableFactor
{
@ -75,7 +74,7 @@ namespace OpenSim.Framework
set { m_BillableFactor = value; }
}
private int m_PricePerMeter;
private int m_PricePerMeter = 1;
public int PricePerMeter
{
@ -83,7 +82,7 @@ namespace OpenSim.Framework
set { m_PricePerMeter = value; }
}
private int m_RedirectGridX;
private int m_RedirectGridX = 0;
public int RedirectGridX
{
@ -91,7 +90,7 @@ namespace OpenSim.Framework
set { m_RedirectGridX = value; }
}
private int m_RedirectGridY;
private int m_RedirectGridY = 0;
public int RedirectGridY
{
@ -273,25 +272,6 @@ namespace OpenSim.Framework
public EstateSettings()
{
if (configMember == null)
{
try
{
// Load legacy defaults
//
configMember =
new ConfigurationMember(Path.Combine(Util.configDir(),
"estate_settings.xml"), "ESTATE SETTINGS",
loadConfigurationOptions,
handleIncomingConfiguration, true);
l_EstateManagers.Clear();
configMember.performConfigurationRetrieve();
}
catch (Exception)
{
}
}
}
public void Save()
@ -393,165 +373,5 @@ namespace OpenSim.Framework
return l_EstateAccess.Contains(user);
}
public void loadConfigurationOptions()
{
configMember.addConfigurationOption("billable_factor",
ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
String.Empty, "0.0", true);
// configMember.addConfigurationOption("estate_id",
// ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
// String.Empty, "100", true);
// configMember.addConfigurationOption("parent_estate_id",
// ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
// String.Empty, "1", true);
configMember.addConfigurationOption("redirect_grid_x",
ConfigurationOption.ConfigurationTypes.TYPE_INT32,
String.Empty, "0", true);
configMember.addConfigurationOption("redirect_grid_y",
ConfigurationOption.ConfigurationTypes.TYPE_INT32,
String.Empty, "0", true);
configMember.addConfigurationOption("price_per_meter",
ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
String.Empty, "1", true);
configMember.addConfigurationOption("estate_name",
ConfigurationOption.ConfigurationTypes.TYPE_STRING,
String.Empty, "My Estate", true);
configMember.addConfigurationOption("estate_manager_0",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_1",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_2",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_3",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_4",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_5",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_6",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_7",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_8",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("estate_manager_9",
ConfigurationOption.ConfigurationTypes.TYPE_UUID,
String.Empty, "00000000-0000-0000-0000-000000000000", true);
configMember.addConfigurationOption("region_flags",
ConfigurationOption.ConfigurationTypes.TYPE_UINT32,
String.Empty, "336723974", true);
}
public bool handleIncomingConfiguration(string configuration_key, object configuration_result)
{
switch (configuration_key)
{
case "region_flags":
RegionFlags flags = (RegionFlags)(uint)configuration_result;
if ((flags & (RegionFlags)(1<<29)) != 0)
m_AllowVoice = true;
if ((flags & RegionFlags.AllowDirectTeleport) != 0)
m_AllowDirectTeleport = true;
if ((flags & RegionFlags.DenyAnonymous) != 0)
m_DenyAnonymous = true;
if ((flags & RegionFlags.DenyIdentified) != 0)
m_DenyIdentified = true;
if ((flags & RegionFlags.DenyTransacted) != 0)
m_DenyTransacted = true;
if ((flags & RegionFlags.AbuseEmailToEstateOwner) != 0)
m_AbuseEmailToEstateOwner = true;
if ((flags & RegionFlags.BlockDwell) != 0)
m_BlockDwell = true;
if ((flags & RegionFlags.EstateSkipScripts) != 0)
m_EstateSkipScripts = true;
if ((flags & RegionFlags.ResetHomeOnTeleport) != 0)
m_ResetHomeOnTeleport = true;
if ((flags & RegionFlags.TaxFree) != 0)
m_TaxFree = true;
if ((flags & RegionFlags.PublicAllowed) != 0)
m_PublicAccess = true;
break;
case "billable_factor":
m_BillableFactor = (float) configuration_result;
break;
// case "estate_id":
// m_EstateID = (uint) configuration_result;
// break;
// case "parent_estate_id":
// m_ParentEstateID = (uint) configuration_result;
// break;
case "redirect_grid_x":
m_RedirectGridX = (int) configuration_result;
break;
case "redirect_grid_y":
m_RedirectGridY = (int) configuration_result;
break;
case "price_per_meter":
m_PricePerMeter = Convert.ToInt32(configuration_result);
break;
case "estate_name":
m_EstateName = (string) configuration_result;
break;
case "estate_manager_0":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_1":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_2":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_3":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_4":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_5":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_6":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_7":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_8":
AddEstateManager((UUID)configuration_result);
break;
case "estate_manager_9":
AddEstateManager((UUID)configuration_result);
break;
}
return true;
}
}
}

View File

@ -48,7 +48,6 @@ namespace OpenSim.Framework
public class GroupMembershipData
{
// Group base data
//
public UUID GroupID;
public string GroupName;
public bool AllowPublish = true;
@ -61,7 +60,6 @@ namespace OpenSim.Framework
public bool ShowInList = true;
// Per user data
//
public bool AcceptNotices = true;
public int Contribution = 0;
public ulong GroupPowers = 0;

View File

@ -91,7 +91,7 @@ namespace OpenSim.Framework
/// </exception>
bool PresenceChildStatus(UUID agentId);
bool TryGetAvatar(UUID agentID, out object scenePresence);
bool TryGetScenePresence(UUID agentID, out object scenePresence);
T RequestModuleInterface<T>();
T[] RequestModuleInterfaces<T>();

View File

@ -25,13 +25,17 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using OpenSim.Framework.Servers.HttpServer;
using System.Collections.Generic;
using System.Reflection;
using log4net;
using OpenSim.Framework.Servers.HttpServer;
namespace OpenSim.Framework
{
public class MainServer
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static BaseHttpServer instance = null;
private static Dictionary<uint, BaseHttpServer> m_Servers =
new Dictionary<uint, BaseHttpServer>();
@ -53,6 +57,8 @@ namespace OpenSim.Framework
return m_Servers[port];
m_Servers[port] = new BaseHttpServer(port);
m_log.InfoFormat("[MAIN HTTP SERVER]: Starting main http server on port {0}", port);
m_Servers[port].Start();
return m_Servers[port];

View File

@ -310,7 +310,7 @@ namespace OpenSim.Framework.Servers.HttpServer
}
catch (Exception e)
{
m_log.ErrorFormat("[BASE HTTP SERVER]: OnRequest() failed with {0} {1}", e.Message, e.StackTrace);
m_log.Error(string.Format("[BASE HTTP SERVER]: OnRequest() failed with "), e);
}
}
@ -1580,7 +1580,6 @@ namespace OpenSim.Framework.Servers.HttpServer
public void Start()
{
m_log.Info("[BASE HTTP SERVER]: Starting up HTTP Server");
StartHTTP();
}
@ -1588,7 +1587,6 @@ namespace OpenSim.Framework.Servers.HttpServer
{
try
{
m_log.Debug("[BASE HTTP SERVER]: Spawned main thread OK");
//m_httpListener = new HttpListener();
NotSocketErrors = 0;
if (!m_ssl)

View File

@ -29,7 +29,7 @@ namespace OpenSim
{
public class VersionInfo
{
private const string VERSION_NUMBER = "0.6.8CM";
private const string VERSION_NUMBER = "0.7CM";
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
public enum Flavour
{

View File

@ -263,8 +263,12 @@ namespace OpenSim.Framework
foreach (string key in parameters.Keys)
{
foreach (string value in parameters.GetValues(key))
items.Add(String.Concat(key, "=", HttpUtility.UrlEncode(value ?? String.Empty)));
string[] values = parameters.GetValues(key);
if (values != null)
{
foreach (string value in values)
items.Add(String.Concat(key, "=", HttpUtility.UrlEncode(value ?? String.Empty)));
}
}
return String.Join("&", items.ToArray());

View File

@ -40,7 +40,6 @@ using OpenMetaverse.Packets;
using OpenMetaverse.StructuredData;
using OpenSim.Framework;
using OpenSim.Framework.Client;
using OpenSim.Framework.Statistics;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
@ -353,6 +352,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
protected PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_avatarTerseUpdates;
private PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock> m_primTerseUpdates;
private PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock> m_primFullUpdates;
/// <value>
/// List used in construction of data blocks for an object update packet. This is to stop us having to
/// continually recreate it.
/// </value>
protected List<ObjectUpdatePacket.ObjectDataBlock> m_fullUpdateDataBlocksBuilder;
/// <value>
/// Maintain a record of all the objects killed. This allows us to stop an update being sent from the
/// 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 a m_primFullUpdate.SyncRoot lock
///
/// </value>
protected HashSet<uint> m_killRecord;
private int m_moneyBalance;
private int m_animationSequenceNumber = 1;
private bool m_SendLogoutPacketWhenClosing = true;
@ -449,6 +465,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_avatarTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
m_primTerseUpdates = new PriorityQueue<double, ImprovedTerseObjectUpdatePacket.ObjectDataBlock>();
m_primFullUpdates = new PriorityQueue<double, ObjectUpdatePacket.ObjectDataBlock>(m_scene.Entities.Count);
m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>();
m_killRecord = new HashSet<uint>();
m_assetService = m_scene.RequestModuleInterface<IAssetService>();
m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>();
@ -1474,7 +1492,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
kill.ObjectData[0].ID = localID;
kill.Header.Reliable = true;
kill.Header.Zerocoded = true;
OutPacket(kill, ThrottleOutPacketType.State);
lock (m_primFullUpdates.SyncRoot)
{
m_killRecord.Add(localID);
OutPacket(kill, ThrottleOutPacketType.State);
}
}
/// <summary>
@ -3521,21 +3544,34 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (count == 0)
return;
outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[count];
m_fullUpdateDataBlocksBuilder.Clear();
for (int i = 0; i < count; i++)
{
outPacket.ObjectData[i] = m_primFullUpdates.Dequeue();
ObjectUpdatePacket.ObjectDataBlock block = m_primFullUpdates.Dequeue();
if (!m_killRecord.Contains(block.ID))
{
m_fullUpdateDataBlocksBuilder.Add(block);
// string text = Util.FieldToString(outPacket.ObjectData[i].Text);
// if (text.IndexOf("\n") >= 0)
// text = text.Remove(text.IndexOf("\n"));
// m_log.DebugFormat(
// "[CLIENT]: Sending full info about prim {0} text {1} to client {2}",
// outPacket.ObjectData[i].ID, text, Name);
}
// else
// {
// m_log.WarnFormat(
// "[CLIENT]: Preventing full update for {0} after kill to {1}", block.ID, Name);
// }
}
}
OutPacket(outPacket, ThrottleOutPacketType.State);
outPacket.ObjectData = m_fullUpdateDataBlocksBuilder.ToArray();
OutPacket(outPacket, ThrottleOutPacketType.State);
}
}
public void SendPrimTerseUpdate(SendPrimitiveTerseData data)
@ -5965,7 +6001,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|| avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f)
{
ScenePresence avatar = null;
if (((Scene)m_scene).TryGetAvatar(AgentId, out avatar))
if (((Scene)m_scene).TryGetScenePresence(AgentId, out avatar))
{
if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f)
{

View File

@ -98,10 +98,10 @@ namespace OpenSim.Region.ClientStack
if (m_networkServersInfo.HttpUsesSSL && (m_networkServersInfo.HttpListenerPort == m_networkServersInfo.httpSSLPort))
{
m_log.Error("[HTTP]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
m_log.Error("[REGION SERVER]: HTTP Server config failed. HTTP Server and HTTPS server must be on different ports");
}
m_log.Info("[REGION]: Starting HTTP server");
m_log.InfoFormat("[REGION SERVER]: Starting HTTP server on port {0}", m_httpServerPort);
m_httpServer.Start();
MainServer.Instance = m_httpServer;
@ -129,4 +129,4 @@ namespace OpenSim.Region.ClientStack
return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier);
}
}
}
}

View File

@ -86,7 +86,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
// Save avatar attachment information
ScenePresence presence;
if (m_scene.AvatarFactory != null && m_scene.TryGetAvatar(remoteClient.AgentId, out presence))
if (m_scene.AvatarFactory != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
{
m_log.Info(
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
@ -255,7 +255,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
AttachmentPt = att.RootPart.AttachmentPoint;
ScenePresence presence;
if (m_scene.TryGetAvatar(remoteClient.AgentId, out presence))
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
{
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
item = m_scene.InventoryService.GetItem(item);
@ -299,7 +299,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
}
ScenePresence presence;
if (m_scene.TryGetAvatar(remoteClient.AgentId, out presence))
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
{
// XXYY!!
InventoryItemBase item = new InventoryItemBase(itemID, remoteClient.AgentId);
@ -314,7 +314,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient)
{
ScenePresence presence;
if (m_scene.TryGetAvatar(remoteClient.AgentId, out presence))
if (m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
{
presence.Appearance.DetachAttachment(itemID);

View File

@ -388,7 +388,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
try
{
if (m_aScene.AuthenticationService.Authenticate(account.PrincipalID, pass, 1) != string.Empty)
string encpass = Util.Md5Hash(pass);
if (m_aScene.AuthenticationService.Authenticate(account.PrincipalID, encpass, 1) != string.Empty)
{
return account;
}

View File

@ -358,7 +358,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
{
ScenePresence presence;
if (s.TryGetAvatar(agentID, out presence))
if (s.TryGetScenePresence(agentID, out presence))
{
// If the agent is in this scene, then we
// are being called twice in a single

View File

@ -82,7 +82,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps
responsedata["str_response_string"] = "Request wasn't what was expected";
ScenePresence avatar;
if (!m_scene.TryGetAvatar(AgentId, out avatar))
if (!m_scene.TryGetScenePresence(AgentId, out avatar))
return responsedata;

View File

@ -190,7 +190,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (account == null) // foreign
{
ScenePresence sp = null;
if (m_Scene.TryGetAvatar(userID, out sp))
if (m_Scene.TryGetScenePresence(userID, out sp))
{
AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
if (aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))

View File

@ -1206,7 +1206,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
{
Scene homeScene = GetRootScene();
ScenePresence avatar = null;
if (homeScene.TryGetAvatar(avatarId,out avatar))
if (homeScene.TryGetScenePresence(avatarId,out avatar))
{
KillAUser ku = new KillAUser(avatar,mod);
Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true);

View File

@ -131,8 +131,8 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
{
// Start http server
// Attach xmlrpc handlers
m_log.Info("[REMOTE_DATA]: " +
"Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
m_log.Info("[XML RPC MODULE]: " +
"Starting up XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort);
httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
httpServer.Start();
@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
// This should no longer happen, but the check is reasonable anyway
if (null == m_openChannels)
{
m_log.Warn("[RemoteDataReply] Attempt to open channel before initialization is complete");
m_log.Warn("[XML RPC MODULE]: Attempt to open channel before initialization is complete");
return newChannel;
}
@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
}
else
{
m_log.Warn("[RemoteDataReply]: Channel or message_id not found");
m_log.Warn("[XML RPC MODULE]: Channel or message_id not found");
}
}
@ -340,7 +340,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
}
else
{
m_log.Error("UNABLE TO REMOVE COMPLETED REQUEST");
m_log.Error("[XML RPC MODULE]: UNABLE TO REMOVE COMPLETED REQUEST");
}
}
}
@ -728,4 +728,4 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC
return ReqID;
}
}
}
}

View File

@ -502,7 +502,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
private UUID GetSessionID(UUID userID)
{
ScenePresence sp = null;
if (m_Scene.TryGetAvatar(userID, out sp))
if (m_Scene.TryGetScenePresence(userID, out sp))
{
return sp.ControllingClient.SessionId;
}
@ -521,7 +521,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
if (account == null) // foreign user
{
ScenePresence sp = null;
m_Scene.TryGetAvatar(userID, out sp);
m_Scene.TryGetScenePresence(userID, out sp);
if (sp != null)
{
AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);

View File

@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
ScenePresence sp = null;
foreach (Scene s in m_Scenes)
{
s.TryGetAvatar(clientID, out sp);
s.TryGetScenePresence(clientID, out sp);
if ((sp != null) && !sp.IsChildAgent && (s != scene))
{
m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping system folders in cache",

View File

@ -88,7 +88,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
Vector3 position = new Vector3(128, 128, 0);
Vector3 lookat = new Vector3(0, 1, 0);
if (client.Scene.TryGetAvatar(client.AgentId, out sp))
if (client.Scene.TryGetScenePresence(client.AgentId, out sp))
{
if (sp is ScenePresence)
{

View File

@ -468,26 +468,20 @@ namespace OpenSim.Region.CoreModules.World.Estate
private void handleEstateTeleportAllUsersHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID)
{
// Get a fresh list that will not change as people get teleported away
List<ScenePresence> presences = m_scene.GetScenePresences();
foreach(ScenePresence p in presences)
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
if (p.UUID != senderID)
if (sp.UUID != senderID)
{
ScenePresence p = m_scene.GetScenePresence(sp.UUID);
// make sure they are still there, we could be working down a long list
ScenePresence s = m_scene.GetScenePresence(p.UUID);
if (s != null)
// Also make sure they are actually in the region
if (p != null && !p.IsChildAgent)
{
// Also make sure they are actually in the region
if (!s.IsChildAgent)
{
s.ControllingClient.SendTeleportLocationStart();
m_scene.TeleportClientHome(s.UUID, s.ControllingClient);
}
p.ControllingClient.SendTeleportLocationStart();
m_scene.TeleportClientHome(p.UUID, p.ControllingClient);
}
}
}
});
}
private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID)
{
@ -765,12 +759,11 @@ namespace OpenSim.Region.CoreModules.World.Estate
public void sendRegionInfoPacketToAll()
{
List<ScenePresence> avatars = m_scene.GetAvatars();
for (int i = 0; i < avatars.Count; i++)
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
HandleRegionInfoRequest(avatars[i].ControllingClient);
}
if (!sp.IsChildAgent)
HandleRegionInfoRequest(sp.ControllingClient);
});
}
public void sendRegionHandshake(IClientAPI remoteClient)

View File

@ -199,9 +199,9 @@ namespace OpenSim.Region.CoreModules.World.Land
forcedPosition = null;
}
//if we are far away, teleport
else if (Vector3.Distance(clientAvatar.AbsolutePosition,forcedPosition.Value) > 3)
else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) > 3)
{
Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}",forcedPosition.Value,clientAvatar.AbsolutePosition));
Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition));
clientAvatar.Teleport(forcedPosition.Value);
forcedPosition = null;
}
@ -382,30 +382,27 @@ namespace OpenSim.Region.CoreModules.World.Land
}
}
public void SendOutNearestBanLine(IClientAPI avatar)
public void SendOutNearestBanLine(IClientAPI client)
{
List<ScenePresence> avatars = m_scene.GetAvatars();
foreach (ScenePresence presence in avatars)
ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
if (sp == null || sp.IsChildAgent)
return;
List<ILandObject> checkLandParcels = ParcelsNearPoint(sp.AbsolutePosition);
foreach (ILandObject checkBan in checkLandParcels)
{
if (presence.UUID == avatar.AgentId)
if (checkBan.IsBannedFromLand(client.AgentId))
{
List<ILandObject> checkLandParcels = ParcelsNearPoint(presence.AbsolutePosition);
foreach (ILandObject checkBan in checkLandParcels)
{
if (checkBan.IsBannedFromLand(avatar.AgentId))
{
checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, avatar);
return; //Only send one
}
if (checkBan.IsRestrictedFromLand(avatar.AgentId))
{
checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, avatar);
return; //Only send one
}
}
return;
checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionBanned, false, (int)ParcelResult.Single, client);
return; //Only send one
}
if (checkBan.IsRestrictedFromLand(client.AgentId))
{
checkBan.SendLandProperties((int)ParcelPropertiesStatus.CollisionNotOnAccessList, false, (int)ParcelResult.Single, client);
return; //Only send one
}
}
return;
}
public void SendLandUpdate(ScenePresence avatar, bool force)

View File

@ -332,36 +332,38 @@ namespace OpenSim.Region.CoreModules.World.Land
public void SendLandUpdateToAvatarsOverMe(bool snap_selection)
{
List<ScenePresence> avatars = m_scene.GetAvatars();
ILandObject over = null;
for (int i = 0; i < avatars.Count; i++)
m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
if (avatar.IsChildAgent)
return;
ILandObject over = null;
try
{
over =
m_scene.LandChannel.GetLandObject(Util.Clamp<int>((int)Math.Round(avatars[i].AbsolutePosition.X), 0, ((int)Constants.RegionSize - 1)),
Util.Clamp<int>((int)Math.Round(avatars[i].AbsolutePosition.Y), 0, ((int)Constants.RegionSize - 1)));
m_scene.LandChannel.GetLandObject(Util.Clamp<int>((int)Math.Round(avatar.AbsolutePosition.X), 0, ((int)Constants.RegionSize - 1)),
Util.Clamp<int>((int)Math.Round(avatar.AbsolutePosition.Y), 0, ((int)Constants.RegionSize - 1)));
}
catch (Exception)
{
m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatars[i].AbsolutePosition.X) + " y: " +
Math.Round(avatars[i].AbsolutePosition.Y));
m_log.Warn("[LAND]: " + "unable to get land at x: " + Math.Round(avatar.AbsolutePosition.X) + " y: " +
Math.Round(avatar.AbsolutePosition.Y));
}
if (over != null)
{
if (over.LandData.LocalID == LandData.LocalID)
{
if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) &&
if (((over.LandData.Flags & (uint)ParcelFlags.AllowDamage) != 0) &&
m_scene.RegionInfo.RegionSettings.AllowDamage)
avatars[i].Invulnerable = false;
avatar.Invulnerable = false;
else
avatars[i].Invulnerable = true;
avatar.Invulnerable = true;
SendLandUpdateToClient(snap_selection, avatars[i].ControllingClient);
SendLandUpdateToClient(snap_selection, avatar.ControllingClient);
}
}
}
});
}
#endregion

View File

@ -1324,9 +1324,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions
// Group voodoo
//
if (land.LandData.IsGroupOwned)
if (l.LandData.IsGroupOwned)
{
powers = (GroupPowers)client.GetGroupPowers(land.LandData.GroupID);
powers = (GroupPowers)client.GetGroupPowers(l.LandData.GroupID);
// Not a group member, or no rights at all
//
if (powers == (GroupPowers)0)

View File

@ -62,40 +62,46 @@ namespace OpenSim.Region.CoreModules.World.Sound
public virtual void PlayAttachedSound(
UUID soundID, UUID ownerID, UUID objectID, double gain, Vector3 position, byte flags, float radius)
{
foreach (ScenePresence p in m_scene.GetAvatars())
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
double dis = Util.GetDistanceTo(p.AbsolutePosition, position);
if (sp.IsChildAgent)
return;
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
if (dis > 100.0) // Max audio distance
continue;
return;
// Scale by distance
if (radius == 0)
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
else
gain = (float)((double)gain * ((radius - dis) / radius));
p.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
}
sp.ControllingClient.SendPlayAttachedSound(soundID, objectID, ownerID, (float)gain, flags);
});
}
public virtual void TriggerSound(
UUID soundId, UUID ownerID, UUID objectID, UUID parentID, double gain, Vector3 position, UInt64 handle, float radius)
{
foreach (ScenePresence p in m_scene.GetAvatars())
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
double dis = Util.GetDistanceTo(p.AbsolutePosition, position);
if (sp.IsChildAgent)
return;
double dis = Util.GetDistanceTo(sp.AbsolutePosition, position);
if (dis > 100.0) // Max audio distance
continue;
return;
// Scale by distance
if (radius == 0)
gain = (float)((double)gain * ((100.0 - dis) / 100.0));
else
gain = (float)((double)gain * ((radius - dis) / radius));
p.ControllingClient.SendTriggeredSound(
sp.ControllingClient.SendTriggeredSound(
soundId, ownerID, objectID, parentID, handle, position, (float)gain);
}
});
}
}
}

View File

@ -509,14 +509,13 @@ namespace OpenSim.Region.CoreModules
private void SunUpdateToAllClients()
{
List<ScenePresence> avatars = m_scene.GetAvatars();
foreach (ScenePresence avatar in avatars)
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
if (!avatar.IsChildAgent)
if (!sp.IsChildAgent)
{
SunToClient(avatar.ControllingClient);
SunToClient(sp.ControllingClient);
}
}
});
}
#region ISunModule Members

View File

@ -425,9 +425,7 @@ namespace OpenSim.Region.CoreModules
{
if (m_ready)
{
List<ScenePresence> avatars = m_scene.GetAvatars();
if (avatars.Count > 0)
if(m_scene.GetRootAgentCount() > 0)
{
// Ask wind plugin to generate a LL wind array to be cached locally
// Try not to update this too often, as it may involve array copies
@ -437,11 +435,11 @@ namespace OpenSim.Region.CoreModules
m_frameLastUpdateClientArray = m_frame;
}
foreach (ScenePresence avatar in avatars)
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
if (!avatar.IsChildAgent)
avatar.ControllingClient.SendWindData(windSpeeds);
}
if (!sp.IsChildAgent)
sp.ControllingClient.SendWindData(windSpeeds);
});
}
}
}

View File

@ -210,7 +210,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
// this is here because CAPS map requests work even beyond the 10,000 limit.
ScenePresence avatarPresence = null;
m_scene.TryGetAvatar(agentID, out avatarPresence);
m_scene.TryGetScenePresence(agentID, out avatarPresence);
if (avatarPresence != null)
{
@ -304,25 +304,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
/// <param name="AgentId">AgentID that logged out</param>
private void ClientLoggedOut(UUID AgentId, Scene scene)
{
List<ScenePresence> presences = m_scene.GetAvatars();
int rootcount = 0;
for (int i=0;i<presences.Count;i++)
{
if (presences[i] != null)
{
if (!presences[i].IsChildAgent)
rootcount++;
}
}
if (rootcount <= 1)
StopThread();
lock (m_rootAgents)
{
if (m_rootAgents.Contains(AgentId))
{
m_rootAgents.Remove(AgentId);
}
m_rootAgents.Remove(AgentId);
if(m_rootAgents.Count == 0)
StopThread();
}
}
#endregion
@ -375,11 +361,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
if (regionhandle == 0 || regionhandle == m_scene.RegionInfo.RegionHandle)
{
// Local Map Item Request
List<ScenePresence> avatars = m_scene.GetAvatars();
int tc = Environment.TickCount;
List<mapItemReply> mapitems = new List<mapItemReply>();
mapItemReply mapitem = new mapItemReply();
if (avatars.Count == 0 || avatars.Count == 1)
if (m_scene.GetRootAgentCount() <= 1)
{
mapitem = new mapItemReply();
mapitem.x = (uint)(xstart + 1);
@ -392,21 +377,21 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
}
else
{
foreach (ScenePresence av in avatars)
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
// Don't send a green dot for yourself
if (av.UUID != remoteClient.AgentId)
if (!sp.IsChildAgent && sp.UUID != remoteClient.AgentId)
{
mapitem = new mapItemReply();
mapitem.x = (uint)(xstart + av.AbsolutePosition.X);
mapitem.y = (uint)(ystart + av.AbsolutePosition.Y);
mapitem.x = (uint)(xstart + sp.AbsolutePosition.X);
mapitem.y = (uint)(ystart + sp.AbsolutePosition.Y);
mapitem.id = UUID.Zero;
mapitem.name = Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString());
mapitem.Extra = 1;
mapitem.Extra2 = 0;
mapitems.Add(mapitem);
}
}
});
}
remoteClient.SendMapItemReply(mapitems.ToArray(), itemtype, flags);
}
@ -504,7 +489,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
if (mrs.agentID != UUID.Zero)
{
ScenePresence av = null;
m_scene.TryGetAvatar(mrs.agentID, out av);
m_scene.TryGetScenePresence(mrs.agentID, out av);
if (av != null)
{
if (response.ContainsKey(mrs.itemtype.ToString()))
@ -981,51 +966,35 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
Utils.LongToUInts(m_scene.RegionInfo.RegionHandle,out xstart,out ystart);
OSDMap responsemap = new OSDMap();
List<ScenePresence> avatars = m_scene.GetAvatars();
OSDArray responsearr = new OSDArray(avatars.Count);
OSDMap responsemapdata = new OSDMap();
int tc = Environment.TickCount;
/*
foreach (ScenePresence av in avatars)
if (m_scene.GetRootAgentCount() == 0)
{
responsemapdata = new OSDMap();
responsemapdata["X"] = OSD.FromInteger((int)(xstart + av.AbsolutePosition.X));
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + av.AbsolutePosition.Y));
responsemapdata["ID"] = OSD.FromUUID(UUID.Zero);
responsemapdata["Name"] = OSD.FromString("TH");
responsemapdata["Extra"] = OSD.FromInteger(0);
responsemapdata["Extra2"] = OSD.FromInteger(0);
responsearr.Add(responsemapdata);
}
responsemap["1"] = responsearr;
*/
if (avatars.Count == 0)
{
responsemapdata = new OSDMap();
OSDMap responsemapdata = new OSDMap();
responsemapdata["X"] = OSD.FromInteger((int)(xstart + 1));
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + 1));
responsemapdata["ID"] = OSD.FromUUID(UUID.Zero);
responsemapdata["Name"] = OSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString()));
responsemapdata["Extra"] = OSD.FromInteger(0);
responsemapdata["Extra2"] = OSD.FromInteger(0);
OSDArray responsearr = new OSDArray();
responsearr.Add(responsemapdata);
responsemap["6"] = responsearr;
}
else
{
responsearr = new OSDArray(avatars.Count);
foreach (ScenePresence av in avatars)
OSDArray responsearr = new OSDArray(m_scene.GetRootAgentCount());
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
responsemapdata = new OSDMap();
responsemapdata["X"] = OSD.FromInteger((int)(xstart + av.AbsolutePosition.X));
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + av.AbsolutePosition.Y));
OSDMap responsemapdata = new OSDMap();
responsemapdata["X"] = OSD.FromInteger((int)(xstart + sp.AbsolutePosition.X));
responsemapdata["Y"] = OSD.FromInteger((int)(ystart + sp.AbsolutePosition.Y));
responsemapdata["ID"] = OSD.FromUUID(UUID.Zero);
responsemapdata["Name"] = OSD.FromString(Util.Md5Hash(m_scene.RegionInfo.RegionName + tc.ToString()));
responsemapdata["Extra"] = OSD.FromInteger(1);
responsemapdata["Extra2"] = OSD.FromInteger(0);
responsearr.Add(responsemapdata);
}
});
responsemap["6"] = responsearr;
}
return responsemap;
@ -1107,25 +1076,11 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
private void MakeChildAgent(ScenePresence avatar)
{
List<ScenePresence> presences = m_scene.GetAvatars();
int rootcount = 0;
for (int i = 0; i < presences.Count; i++)
{
if (presences[i] != null)
{
if (!presences[i].IsChildAgent)
rootcount++;
}
}
if (rootcount <= 1)
StopThread();
lock (m_rootAgents)
{
if (m_rootAgents.Contains(avatar.UUID))
{
m_rootAgents.Remove(avatar.UUID);
}
m_rootAgents.Remove(avatar.UUID);
if (m_rootAgents.Count == 0)
StopThread();
}
}

View File

@ -88,12 +88,12 @@ namespace OpenSim.Region.Examples.SimpleModule
m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false);
}
List<ScenePresence> avatars = m_scene.GetAvatars();
foreach (ScenePresence avatar in avatars)
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
avatar.AbsolutePosition =
new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2);
}
if (!sp.IsChildAgent)
sp.AbsolutePosition =
new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2);
});
}
// private void AddComplexObjects(RegionInfo regionInfo, Vector3 pos)

View File

@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Collections.Generic;
using OpenMetaverse;
using OpenSim.Framework;
@ -34,7 +35,12 @@ namespace OpenSim.Region.Framework.Interfaces
{
void Initialise(string connectstring);
EstateSettings LoadEstateSettings(UUID regionID);
EstateSettings LoadEstateSettings(UUID regionID, bool create);
EstateSettings LoadEstateSettings(int estateID);
void StoreEstateSettings(EstateSettings es);
List<int> GetEstates(string search);
bool LinkRegion(UUID regionID, int estateID);
List<UUID> GetRegions(int estateID);
bool DeleteEstate(int estateID);
}
}

View File

@ -37,21 +37,51 @@ namespace OpenSim.Region.Framework.Interfaces
{
event NewGroupNotice OnNewGroupNotice;
/// <summary>
/// Create a group
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="name"></param>
/// <param name="charter"></param>
/// <param name="showInList"></param>
/// <param name="insigniaID"></param>
/// <param name="membershipFee"></param>
/// <param name="openEnrollment"></param>
/// <param name="allowPublish"></param>
/// <param name="maturePublish"></param>
/// <returns>The UUID of the created group</returns>
UUID CreateGroup(
IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee,
bool openEnrollment, bool allowPublish, bool maturePublish);
/// <summary>
/// Get a group
/// </summary>
/// <param name="name">Name of the group</param>
/// <returns>The group's data. Null if there is no such group.</returns>
GroupRecord GetGroupRecord(string name);
/// <summary>
/// Get a group
/// </summary>
/// <param name="GroupID">ID of the group</param>
/// <returns>The group's data. Null if there is no such group.</returns>
GroupRecord GetGroupRecord(UUID GroupID);
void ActivateGroup(IClientAPI remoteClient, UUID groupID);
List<GroupTitlesData> GroupTitlesRequest(IClientAPI remoteClient, UUID groupID);
List<GroupMembersData> GroupMembersRequest(IClientAPI remoteClient, UUID groupID);
List<GroupRolesData> GroupRoleDataRequest(IClientAPI remoteClient, UUID groupID);
List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID);
GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID);
GroupMembershipData[] GetMembershipData(UUID UserID);
GroupMembershipData[] GetMembershipData(UUID UserID);
GroupMembershipData GetMembershipData(UUID GroupID, UUID UserID);
void UpdateGroupInfo(IClientAPI remoteClient, UUID groupID, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish);
void SetGroupAcceptNotices(IClientAPI remoteClient, UUID groupID, bool acceptNotices, bool listInProfile);
void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID);
UUID CreateGroup(IClientAPI remoteClient, string name, string charter, bool showInList, UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish);
void GroupTitleUpdate(IClientAPI remoteClient, UUID GroupID, UUID TitleRoleID);
GroupNoticeData[] GroupNoticesListRequest(IClientAPI remoteClient, UUID GroupID);
string GetGroupTitle(UUID avatarID);
@ -64,7 +94,6 @@ namespace OpenSim.Region.Framework.Interfaces
void LeaveGroupRequest(IClientAPI remoteClient, UUID GroupID);
void EjectGroupMemberRequest(IClientAPI remoteClient, UUID GroupID, UUID EjecteeID);
void InviteGroupRequest(IClientAPI remoteClient, UUID GroupID, UUID InviteeID, UUID RoleID);
GroupRecord GetGroupRecord(UUID GroupID);
void NotifyChange(UUID GroupID);
}
}
}

View File

@ -132,7 +132,7 @@ namespace OpenSim.Region.Framework.Scenes
{
ScenePresence avatar;
if (TryGetAvatar(avatarId, out avatar))
if (TryGetScenePresence(avatarId, out avatar))
{
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
if (invAccess != null)
@ -230,7 +230,7 @@ namespace OpenSim.Region.Framework.Scenes
{
ScenePresence avatar;
if (TryGetAvatar(avatarId, out avatar))
if (TryGetScenePresence(avatarId, out avatar))
{
return CapsUpdateTaskInventoryScriptAsset(
avatar.ControllingClient, itemId, primId, isScriptRunning, data);
@ -683,7 +683,7 @@ namespace OpenSim.Region.Framework.Scenes
if (transactionID == UUID.Zero)
{
ScenePresence presence;
if (TryGetAvatar(remoteClient.AgentId, out presence))
if (TryGetScenePresence(remoteClient.AgentId, out presence))
{
byte[] data = null;
@ -945,7 +945,7 @@ namespace OpenSim.Region.Framework.Scenes
{
ScenePresence avatar;
if (TryGetAvatar(avatarId, out avatar))
if (TryGetScenePresence(avatarId, out avatar))
{
return MoveTaskInventoryItem(avatar.ControllingClient, folderId, part, itemId);
}
@ -1059,7 +1059,7 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence avatar;
if (TryGetAvatar(srcTaskItem.OwnerID, out avatar))
if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar))
{
destPart.GetProperties(avatar.ControllingClient);
}
@ -1087,7 +1087,7 @@ namespace OpenSim.Region.Framework.Scenes
}
ScenePresence avatar = null;
if (TryGetAvatar(destID, out avatar))
if (TryGetScenePresence(destID, out avatar))
{
//profile.SendInventoryDecendents(avatar.ControllingClient,
// profile.RootFolder.ID, true, false);
@ -1424,7 +1424,7 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence avatar;
if (TryGetAvatar(srcTaskItem.OwnerID, out avatar))
if (TryGetScenePresence(srcTaskItem.OwnerID, out avatar))
{
destPart.GetProperties(avatar.ControllingClient);
}
@ -1865,7 +1865,7 @@ namespace OpenSim.Region.Framework.Scenes
UUID inventoryID = part.ParentGroup.GetFromItemID();
ScenePresence presence;
if (TryGetAvatar(remoteClient.AgentId, out presence))
if (TryGetScenePresence(remoteClient.AgentId, out presence))
{
if (!Permissions.CanRezObject(part.ParentGroup.Children.Count, remoteClient.AgentId, presence.AbsolutePosition))
return;

View File

@ -606,7 +606,46 @@ namespace OpenSim.Region.Framework.Scenes
if (m_storageManager.EstateDataStore != null)
{
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID);
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, false);
if (m_regInfo.EstateSettings.EstateID == 0) // No record at all
{
MainConsole.Instance.Output("Your region is not part of an estate.");
while (true)
{
string response = MainConsole.Instance.CmdPrompt("Do you wish to join an existing estate?", "no", new List<string>() {"yes", "no"});
if (response == "no")
{
// Create a new estate
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(m_regInfo.RegionID, true);
m_regInfo.EstateSettings.EstateName = MainConsole.Instance.CmdPrompt("New estate name", m_regInfo.EstateSettings.EstateName);
m_regInfo.EstateSettings.Save();
break;
}
else
{
response = MainConsole.Instance.CmdPrompt("Estate name to join", "None");
if (response == "None")
continue;
List<int> estateIDs = m_storageManager.EstateDataStore.GetEstates(response);
if (estateIDs.Count < 1)
{
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again");
continue;
}
int estateID = estateIDs[0];
m_regInfo.EstateSettings = m_storageManager.EstateDataStore.LoadEstateSettings(estateID);
if (m_storageManager.EstateDataStore.LinkRegion(m_regInfo.RegionID, estateID))
break;
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
}
}
}
}
//Bind Storage Manager functions to some land manager functions for this scene
@ -1229,6 +1268,84 @@ namespace OpenSim.Region.Framework.Scenes
m_dialogModule = RequestModuleInterface<IDialogModule>();
m_capsModule = RequestModuleInterface<ICapabilitiesModule>();
m_teleportModule = RequestModuleInterface<IEntityTransferModule>();
// Shoving this in here for now, because we have the needed
// interfaces at this point
//
// TODO: Find a better place for this
//
while (m_regInfo.EstateSettings.EstateOwner == UUID.Zero && MainConsole.Instance != null)
{
MainConsole.Instance.Output("The current estate has no owner set.");
string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test");
string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User");
UserAccount account = UserAccountService.GetUserAccount(m_regInfo.ScopeID, first, last);
if (account == null)
{
// Create a new account
account = new UserAccount(m_regInfo.ScopeID, first, last, String.Empty);
if (account.ServiceURLs == null || (account.ServiceURLs != null && account.ServiceURLs.Count == 0))
{
account.ServiceURLs = new Dictionary<string, object>();
account.ServiceURLs["HomeURI"] = string.Empty;
account.ServiceURLs["GatekeeperURI"] = string.Empty;
account.ServiceURLs["InventoryServerURI"] = string.Empty;
account.ServiceURLs["AssetServerURI"] = string.Empty;
}
if (UserAccountService.StoreUserAccount(account))
{
string password = MainConsole.Instance.PasswdPrompt("Password");
string email = MainConsole.Instance.CmdPrompt("Email", "");
account.Email = email;
UserAccountService.StoreUserAccount(account);
bool success = false;
success = AuthenticationService.SetPassword(account.PrincipalID, password);
if (!success)
m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set password for account {0} {1}.",
first, last);
GridRegion home = null;
if (GridService != null)
{
List<GridRegion> defaultRegions = GridService.GetDefaultRegions(UUID.Zero);
if (defaultRegions != null && defaultRegions.Count >= 1)
home = defaultRegions[0];
if (PresenceService != null && home != null)
PresenceService.SetHomeLocation(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0));
else
m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.",
first, last);
}
else
m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to retrieve home region for account {0} {1}.",
first, last);
if (InventoryService != null)
success = InventoryService.CreateUserInventory(account.PrincipalID);
if (!success)
m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to create inventory for account {0} {1}.",
first, last);
m_log.InfoFormat("[USER ACCOUNT SERVICE]: Account {0} {1} created successfully", first, last);
m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
m_regInfo.EstateSettings.Save();
}
}
else
{
m_regInfo.EstateSettings.EstateOwner = account.PrincipalID;
m_regInfo.EstateSettings.Save();
}
}
}
#endregion
@ -3296,7 +3413,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
ScenePresence sp = m_sceneGraph.GetScenePresence(agent.AgentID);
ScenePresence sp = GetScenePresence(agent.AgentID);
if (sp != null)
{
m_log.DebugFormat(
@ -3594,8 +3711,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="message">message to display to the user. Reason for being logged off</param>
public void HandleLogOffUserFromGrid(UUID AvatarID, UUID RegionSecret, string message)
{
ScenePresence loggingOffUser = null;
loggingOffUser = GetScenePresence(AvatarID);
ScenePresence loggingOffUser = GetScenePresence(AvatarID);
if (loggingOffUser != null)
{
UUID localRegionSecret = UUID.Zero;
@ -3631,8 +3747,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="isFlying"></param>
public virtual void AgentCrossing(UUID agentID, Vector3 position, bool isFlying)
{
ScenePresence presence;
if(m_sceneGraph.TryGetAvatar(agentID, out presence))
ScenePresence presence = GetScenePresence(agentID);
if(presence != null)
{
try
{
@ -3806,8 +3922,8 @@ namespace OpenSim.Region.Framework.Scenes
public void RequestTeleportLocation(IClientAPI remoteClient, ulong regionHandle, Vector3 position,
Vector3 lookAt, uint teleportFlags)
{
ScenePresence sp;
if(m_sceneGraph.TryGetAvatar(remoteClient.AgentId, out sp))
ScenePresence sp = GetScenePresence(remoteClient.AgentId);
if (sp != null)
{
uint regionX = m_regInfo.RegionLocX;
uint regionY = m_regInfo.RegionLocY;
@ -3985,17 +4101,17 @@ namespace OpenSim.Region.Framework.Scenes
m_log.ErrorFormat("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname",
"Agent ID", "Session ID", "Circuit", "IP", "World");
foreach (ScenePresence scenePresence in GetAvatars())
ForEachScenePresence(delegate(ScenePresence sp)
{
m_log.ErrorFormat("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}",
scenePresence.Firstname,
scenePresence.Lastname,
scenePresence.UUID,
scenePresence.ControllingClient.AgentId,
sp.Firstname,
sp.Lastname,
sp.UUID,
sp.ControllingClient.AgentId,
"Unknown",
"Unknown",
RegionInfo.RegionName);
}
});
break;
}
@ -4161,72 +4277,42 @@ namespace OpenSim.Region.Framework.Scenes
m_sceneGraph.RemovePhysicalPrim(num);
}
//The idea is to have a group of method that return a list of avatars meeting some requirement
// ie it could be all m_scenePresences within a certain range of the calling prim/avatar.
//
// GetAvatars returns a new list of all root agent presences in the scene
// GetScenePresences returns a new list of all presences in the scene or a filter may be passed.
// GetScenePresence returns the presence with matching UUID or first/last name.
// ForEachScenePresence requests the Scene to run a delegate function against all presences.
/// <summary>
/// Return a list of all avatars in this region.
/// This list is a new object, so it can be iterated over without locking.
/// </summary>
/// <returns></returns>
public List<ScenePresence> GetAvatars()
public int GetRootAgentCount()
{
return m_sceneGraph.GetAvatars();
return m_sceneGraph.GetRootAgentCount();
}
public int GetChildAgentCount()
{
return m_sceneGraph.GetChildAgentCount();
}
/// <summary>
/// Return a list of all ScenePresences in this region. This returns child agents as well as root agents.
/// This list is a new object, so it can be iterated over without locking.
/// Request a scene presence by UUID. Fast, indexed lookup.
/// </summary>
/// <returns></returns>
public List<ScenePresence> GetScenePresences()
/// <param name="agentID"></param>
/// <returns>null if the presence was not found</returns>
public ScenePresence GetScenePresence(UUID agentID)
{
return m_sceneGraph.GetScenePresences();
return m_sceneGraph.GetScenePresence(agentID);
}
/// <summary>
/// Request a filtered list of ScenePresences in this region.
/// This list is a new object, so it can be iterated over without locking.
/// </summary>
/// <param name="filter"></param>
/// <returns></returns>
public List<ScenePresence> GetScenePresences(FilterAvatarList filter)
{
return m_sceneGraph.GetScenePresences(filter);
}
/// <summary>
/// Request a scene presence by UUID
/// </summary>
/// <param name="avatarID"></param>
/// <returns></returns>
public ScenePresence GetScenePresence(UUID avatarID)
{
return m_sceneGraph.GetScenePresence(avatarID);
}
/// <summary>
/// Request the ScenePresence in this region by first/last name.
/// Should normally only be a single match, but first is always returned
/// Request the scene presence by name.
/// </summary>
/// <param name="firstName"></param>
/// <param name="lastName"></param>
/// <returns></returns>
/// <returns>null if the presence was not found</returns>
public ScenePresence GetScenePresence(string firstName, string lastName)
{
return m_sceneGraph.GetScenePresence(firstName, lastName);
}
/// <summary>
/// Request the ScenePresence in this region by localID.
/// Request the scene presence by localID.
/// </summary>
/// <param name="localID"></param>
/// <returns></returns>
/// <returns>null if the presence was not found</returns>
public ScenePresence GetScenePresence(uint localID)
{
return m_sceneGraph.GetScenePresence(localID);
@ -4318,9 +4404,9 @@ namespace OpenSim.Region.Framework.Scenes
return m_sceneGraph.GetGroupByPrim(localID);
}
public override bool TryGetAvatar(UUID avatarId, out ScenePresence avatar)
public override bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)
{
return m_sceneGraph.TryGetAvatar(avatarId, out avatar);
return m_sceneGraph.TryGetScenePresence(avatarId, out avatar);
}
public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)

View File

@ -190,11 +190,11 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="agentID"></param>
public abstract void RemoveClient(UUID agentID);
public bool TryGetAvatar(UUID agentID, out object scenePresence)
public bool TryGetScenePresence(UUID agentID, out object scenePresence)
{
scenePresence = null;
ScenePresence sp = null;
if (TryGetAvatar(agentID, out sp))
if (TryGetScenePresence(agentID, out sp))
{
scenePresence = sp;
return true;
@ -203,7 +203,7 @@ namespace OpenSim.Region.Framework.Scenes
return false;
}
public abstract bool TryGetAvatar(UUID agentID, out ScenePresence scenePresence);
public abstract bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence);
#endregion

View File

@ -723,116 +723,84 @@ namespace OpenSim.Region.Framework.Scenes
return null;
}
// The idea is to have a group of method that return a list of avatars meeting some requirement
// ie it could be all m_scenePresences within a certain range of the calling prim/avatar.
//
// GetAvatars returns a new list of all root agent presences in the scene
// GetScenePresences returns a new list of all presences in the scene or a filter may be passed.
// GetScenePresence returns the presence with matching UUID or the first presence matching the passed filter.
// ForEachScenePresence requests the Scene to run a delegate function against all presences.
/// <summary>
/// Request a list of all avatars in this region (no child agents)
/// This list is a new object, so it can be iterated over without locking.
/// </summary>
/// <returns></returns>
public List<ScenePresence> GetAvatars()
{
return GetScenePresences(delegate(ScenePresence scenePresence)
{
return !scenePresence.IsChildAgent;
});
}
/// <summary>
/// Request a list of m_scenePresences in this World
/// Returns a copy so it can be iterated without a lock.
/// Request a copy of m_scenePresences in this World
/// There is no guarantee that presences will remain in the scene after the list is returned.
/// This list should remain private to SceneGraph. Callers wishing to iterate should instead
/// pass a delegate to ForEachScenePresence.
/// </summary>
/// <returns></returns>
protected internal List<ScenePresence> GetScenePresences()
private List<ScenePresence> GetScenePresences()
{
List<ScenePresence> result;
lock (m_scenePresences)
{
result = new List<ScenePresence>(m_scenePresenceArray.Length);
result.AddRange(m_scenePresenceArray);
}
return result;
return new List<ScenePresence>(m_scenePresenceArray);
}
/// <summary>
/// Request a filtered list of m_scenePresences in this World
/// Returns a copy so it can be iterated without a lock.
/// There is no guarantee that presences will remain in the scene after the list is returned.
/// </summary>
/// <returns></returns>
protected internal List<ScenePresence> GetScenePresences(FilterAvatarList filter)
{
List<ScenePresence> result = new List<ScenePresence>();
// Check each ScenePresence against the filter
ForEachScenePresence(delegate(ScenePresence presence)
{
if (filter(presence))
result.Add(presence);
});
return result;
}
/// <summary>
/// Request the ScenePresence in this region matching filter.
/// Only the first match is returned.
///
/// </summary>
/// <param name="filter"></param>
/// <returns></returns>
protected internal ScenePresence GetScenePresence(FilterAvatarList filter)
{
ScenePresence result = null;
// Get all of the ScenePresences
List<ScenePresence> presences = GetScenePresences();
foreach (ScenePresence presence in presences)
{
if (filter(presence))
{
result = presence;
break;
}
}
return result;
}
protected internal ScenePresence GetScenePresence(string firstName, string lastName)
{
return GetScenePresence(delegate(ScenePresence presence)
{
return(presence.Firstname == firstName && presence.Lastname == lastName);
});
}
/// <summary>
/// Request a scene presence by UUID
/// Request a scene presence by UUID. Fast, indexed lookup.
/// </summary>
/// <param name="agentID"></param>
/// <returns>null if the agent was not found</returns>
/// <returns>null if the presence was not found</returns>
protected internal ScenePresence GetScenePresence(UUID agentID)
{
ScenePresence sp;
TryGetAvatar(agentID, out sp);
lock (m_scenePresences)
{
m_scenePresences.TryGetValue(agentID, out sp);
}
return sp;
}
/// <summary>
/// Request the ScenePresence in this region by localID.
/// Request the scene presence by name.
/// </summary>
/// <param name="firstName"></param>
/// <param name="lastName"></param>
/// <returns>null if the presence was not found</returns>
protected internal ScenePresence GetScenePresence(string firstName, string lastName)
{
foreach (ScenePresence presence in GetScenePresences())
{
if (presence.Firstname == firstName && presence.Lastname == lastName)
return presence;
}
return null;
}
/// <summary>
/// Request the scene presence by localID.
/// </summary>
/// <param name="localID"></param>
/// <returns></returns>
/// <returns>null if the presence was not found</returns>
protected internal ScenePresence GetScenePresence(uint localID)
{
return GetScenePresence(delegate(ScenePresence presence)
foreach (ScenePresence presence in GetScenePresences())
if (presence.LocalId == localID)
return presence;
return null;
}
protected internal bool TryGetScenePresence(UUID agentID, out ScenePresence avatar)
{
lock (m_scenePresences)
{
return (presence.LocalId == localID);
});
m_scenePresences.TryGetValue(agentID, out avatar);
}
return (avatar != null);
}
protected internal bool TryGetAvatarByName(string name, out ScenePresence avatar)
{
avatar = null;
foreach (ScenePresence presence in GetScenePresences())
{
if (String.Compare(name, presence.ControllingClient.Name, true) == 0)
{
avatar = presence;
break;
}
}
return (avatar != null);
}
/// <summary>
@ -986,24 +954,6 @@ namespace OpenSim.Region.Framework.Scenes
return group.GetChildPart(fullID);
}
protected internal bool TryGetAvatar(UUID avatarId, out ScenePresence avatar)
{
lock (m_scenePresences)
{
m_scenePresences.TryGetValue(avatarId, out avatar);
}
return (avatar != null);
}
protected internal bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)
{
avatar = GetScenePresence(delegate(ScenePresence presence)
{
return (String.Compare(avatarName, presence.ControllingClient.Name, true) == 0);
});
return (avatar != null);
}
/// <summary>
/// Returns a list of the entities in the scene. This is a new list so no locking is required to iterate over
/// it
@ -1066,6 +1016,10 @@ namespace OpenSim.Region.Framework.Scenes
return UUID.Zero;
}
/// <summary>
/// Performs action on all scene object groups.
/// </summary>
/// <param name="action"></param>
protected internal void ForEachSOG(Action<SceneObjectGroup> action)
{
List<SceneObjectGroup> objlist = new List<SceneObjectGroup>(SceneObjectGroupsByFullID.Values);
@ -1085,23 +1039,41 @@ namespace OpenSim.Region.Framework.Scenes
/// <summary>
/// Performs action on all scene presences.
/// Performs action on all scene presences. This can ultimately run the actions in parallel but
/// any delegates passed in will need to implement their own locking on data they reference and
/// modify outside of the scope of the delegate.
/// </summary>
/// <param name="action"></param>
public void ForEachScenePresence(Action<ScenePresence> action)
{
List<ScenePresence> presences = GetScenePresences();
try
{
foreach(ScenePresence presence in presences)
// Once all callers have their delegates configured for parallelism, we can unleash this
/*
Action<ScenePresence> protectedAction = new Action<ScenePresence>(delegate(ScenePresence sp)
{
action(presence);
}
}
catch (Exception e)
try
{
action(sp);
}
catch (Exception e)
{
m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
m_log.Info("[BUG] Stack Trace: " + e.StackTrace);
}
});
Parallel.ForEach<ScenePresence>(GetScenePresences(), protectedAction);
*/
// For now, perform actiona serially
foreach (ScenePresence sp in GetScenePresences())
{
m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
m_log.Info("[BUG] Stack Trace: " + e.StackTrace);
try
{
action(sp);
}
catch (Exception e)
{
m_log.Info("[BUG] in " + m_parentScene.RegionInfo.RegionName + ": " + e.ToString());
m_log.Info("[BUG] Stack Trace: " + e.StackTrace);
}
}
}

View File

@ -454,8 +454,10 @@ namespace OpenSim.Region.Framework.Scenes
ForEachCurrentScene(delegate(Scene scene)
{
List<ScenePresence> scenePresences = scene.GetScenePresences();
presences.AddRange(scenePresences);
scene.ForEachScenePresence(delegate(ScenePresence sp)
{
presences.Add(sp);
});
});
return presences;
@ -484,11 +486,11 @@ namespace OpenSim.Region.Framework.Scenes
ForEachCurrentScene(delegate(Scene scene) { scene.HandleEditCommand(cmdparams); });
}
public bool TryGetAvatar(UUID avatarId, out ScenePresence avatar)
public bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar)
{
foreach (Scene scene in m_localScenes)
{
if (scene.TryGetAvatar(avatarId, out avatar))
if (scene.TryGetScenePresence(avatarId, out avatar))
{
return true;
}
@ -503,7 +505,7 @@ namespace OpenSim.Region.Framework.Scenes
ScenePresence avatar = null;
foreach (Scene mScene in m_localScenes)
{
if (mScene.TryGetAvatar(avatarId, out avatar))
if (mScene.TryGetScenePresence(avatarId, out avatar))
{
scene = mScene;
return true;

View File

@ -682,7 +682,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_parentGroup != null) // TODO can there be a SOP without a SOG?
{
ScenePresence avatar;
if (m_parentGroup.Scene.TryGetAvatar(m_sitTargetAvatar, out avatar))
if (m_parentGroup.Scene.TryGetScenePresence(m_sitTargetAvatar, out avatar))
{
avatar.ParentPosition = GetWorldPosition();
}
@ -1332,11 +1332,11 @@ namespace OpenSim.Region.Framework.Scenes
if (volume < 0)
volume = 0;
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
foreach (ScenePresence p in avatarts)
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp)
{
p.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
}
if(!sp.IsChildAgent)
sp.ControllingClient.SendAttachedSoundGainChange(UUID, (float)volume);
});
}
/// <summary>
@ -2626,12 +2626,13 @@ namespace OpenSim.Region.Framework.Scenes
TaskInventory.LockItemsForRead(false);
}
List<ScenePresence> avatarts = m_parentGroup.Scene.GetAvatars();
foreach (ScenePresence p in avatarts)
m_parentGroup.Scene.ForEachScenePresence(delegate(ScenePresence sp)
{
if (!(Util.GetDistanceTo(p.AbsolutePosition, AbsolutePosition) >= 100))
p.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
}
if (sp.IsChildAgent)
return;
if (!(Util.GetDistanceTo(sp.AbsolutePosition, AbsolutePosition) >= 100))
sp.ControllingClient.SendPreLoadSound(objectID, objectID, soundID);
});
}
public void RemFlag(PrimFlags flag)

View File

@ -2598,35 +2598,33 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
List<Vector3> CoarseLocations = new List<Vector3>();
List<UUID> AvatarUUIDs = new List<UUID>();
List<ScenePresence> avatars = m_scene.GetAvatars();
for (int i = 0; i < avatars.Count; i++)
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
// Requested by LibOMV. Send Course Location on self.
//if (avatars[i] != this)
//{
if (avatars[i].ParentID != 0)
if (sp.IsChildAgent)
return;
if (sp.ParentID != 0)
{
// sitting avatar
SceneObjectPart sop = m_scene.GetSceneObjectPart(sp.ParentID);
if (sop != null)
{
// sitting avatar
SceneObjectPart sop = m_scene.GetSceneObjectPart(avatars[i].ParentID);
if (sop != null)
{
CoarseLocations.Add(sop.AbsolutePosition + avatars[i].m_pos);
AvatarUUIDs.Add(avatars[i].UUID);
}
else
{
// we can't find the parent.. ! arg!
CoarseLocations.Add(avatars[i].m_pos);
AvatarUUIDs.Add(avatars[i].UUID);
}
CoarseLocations.Add(sop.AbsolutePosition + sp.m_pos);
AvatarUUIDs.Add(sp.UUID);
}
else
{
CoarseLocations.Add(avatars[i].m_pos);
AvatarUUIDs.Add(avatars[i].UUID);
// we can't find the parent.. ! arg!
CoarseLocations.Add(sp.m_pos);
AvatarUUIDs.Add(sp.UUID);
}
//}
}
}
else
{
CoarseLocations.Add(sp.m_pos);
AvatarUUIDs.Add(sp.UUID);
}
});
m_controllingClient.SendCoarseLocationUpdate(AvatarUUIDs, CoarseLocations);
@ -2700,13 +2698,15 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
m_perfMonMS = Util.EnvironmentTickCount();
// only send update from root agents to other clients; children are only "listening posts"
List<ScenePresence> avatars = m_scene.GetAvatars();
foreach (ScenePresence avatar in avatars)
int count = 0;
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
{
SendFullUpdateToOtherClient(avatar);
}
m_scene.StatsReporter.AddAgentUpdates(avatars.Count);
if (sp.IsChildAgent)
return;
SendFullUpdateToOtherClient(sp);
++count;
});
m_scene.StatsReporter.AddAgentUpdates(count);
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
Animator.SendAnimPack();

View File

@ -66,7 +66,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
throw new NotImplementedException();
}
public override bool TryGetAvatar(UUID agentID, out ScenePresence scenePresence)
public override bool TryGetScenePresence(UUID agentID, out ScenePresence scenePresence)
{
throw new NotImplementedException();
}

View File

@ -318,9 +318,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
{
Scene scene = client.Scene as Scene;
m_log.DebugFormat("[Concierge]: {0} logs off from {1}", client.Name, scene.RegionInfo.RegionName);
List<ScenePresence> avs = scene.GetAvatars();
AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, client.Name, scene.RegionInfo.RegionName, avs.Count));
UpdateBroker(scene, avs);
AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, client.Name, scene.RegionInfo.RegionName, scene.GetRootAgentCount()));
UpdateBroker(scene);
}
}
@ -331,11 +330,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
{
Scene scene = agent.Scene;
m_log.DebugFormat("[Concierge]: {0} enters {1}", agent.Name, scene.RegionInfo.RegionName);
List<ScenePresence> avs = scene.GetAvatars();
WelcomeAvatar(agent, scene);
AnnounceToAgentsRegion(scene, String.Format(m_announceEntering, agent.Name,
scene.RegionInfo.RegionName, avs.Count));
UpdateBroker(scene, avs);
scene.RegionInfo.RegionName, scene.GetRootAgentCount()));
UpdateBroker(scene);
}
}
@ -346,10 +344,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
{
Scene scene = agent.Scene;
m_log.DebugFormat("[Concierge]: {0} leaves {1}", agent.Name, scene.RegionInfo.RegionName);
List<ScenePresence> avs = scene.GetAvatars();
AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, agent.Name,
scene.RegionInfo.RegionName, avs.Count));
UpdateBroker(scene, avs);
scene.RegionInfo.RegionName, scene.GetRootAgentCount()));
UpdateBroker(scene);
}
}
@ -368,7 +365,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
}
}
protected void UpdateBroker(IScene scene, List<ScenePresence> avatars)
protected void UpdateBroker(Scene scene)
{
if (String.IsNullOrEmpty(m_brokerURI))
return;
@ -377,24 +374,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
// create XML sniplet
StringBuilder list = new StringBuilder();
if (0 == avatars.Count)
{
list.Append(String.Format("<avatars count=\"0\" region_name=\"{0}\" region_uuid=\"{1}\" timestamp=\"{2}\" />",
scene.RegionInfo.RegionName, scene.RegionInfo.RegionID,
list.Append(String.Format("<avatars count=\"{0}\" region_name=\"{1}\" region_uuid=\"{2}\" timestamp=\"{3}\">\n",
scene.GetRootAgentCount(), scene.RegionInfo.RegionName,
scene.RegionInfo.RegionID,
DateTime.UtcNow.ToString("s")));
}
else
scene.ForEachScenePresence(delegate(ScenePresence sp)
{
list.Append(String.Format("<avatars count=\"{0}\" region_name=\"{1}\" region_uuid=\"{2}\" timestamp=\"{3}\">\n",
avatars.Count, scene.RegionInfo.RegionName,
scene.RegionInfo.RegionID,
DateTime.UtcNow.ToString("s")));
foreach (ScenePresence av in avatars)
if (!sp.IsChildAgent)
{
list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", av.Name, av.UUID));
list.Append(String.Format(" <avatar name=\"{0}\" uuid=\"{1}\" />\n", sp.Name, sp.UUID));
list.Append("</avatars>");
}
list.Append("</avatars>");
}
});
string payload = list.ToString();
// post via REST to broker
@ -529,7 +520,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge
// protected void AnnounceToAgentsRegion(Scene scene, string msg)
// {
// ScenePresence agent = null;
// if ((client.Scene is Scene) && (client.Scene as Scene).TryGetAvatar(client.AgentId, out agent))
// if ((client.Scene is Scene) && (client.Scene as Scene).TryGetScenePresence(client.AgentId, out agent))
// AnnounceToAgentsRegion(agent, msg);
// else
// m_log.DebugFormat("[Concierge]: could not find an agent for client {0}", client.Name);

View File

@ -328,17 +328,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
}
*/
void OnDirFindQuery(IClientAPI remoteClient, UUID queryID, string queryText, uint queryFlags, int queryStart)
{
if (((DirFindFlags)queryFlags & DirFindFlags.Groups) == DirFindFlags.Groups)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called with queryText({1}) queryFlags({2}) queryStart({3})", System.Reflection.MethodBase.GetCurrentMethod().Name, queryText, (DirFindFlags)queryFlags, queryStart);
if (m_debugEnabled)
m_log.DebugFormat(
"[GROUPS]: {0} called with queryText({1}) queryFlags({2}) queryStart({3})",
System.Reflection.MethodBase.GetCurrentMethod().Name, queryText, (DirFindFlags)queryFlags, queryStart);
// TODO: This currently ignores pretty much all the query flags including Mature and sort order
remoteClient.SendDirGroupsReply(queryID, m_groupData.FindGroups(GetClientGroupRequestID(remoteClient), queryText).ToArray());
}
remoteClient.SendDirGroupsReply(
queryID, m_groupData.FindGroups(GetClientGroupRequestID(remoteClient), queryText).ToArray());
}
}
private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID)
@ -363,7 +365,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
SendScenePresenceUpdate(dataForAgentID, activeGroupTitle);
}
private void HandleUUIDGroupNameRequest(UUID GroupID,IClientAPI remoteClient)
private void HandleUUIDGroupNameRequest(UUID GroupID, IClientAPI remoteClient)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
@ -593,6 +595,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return m_groupData.GetGroupRecord(null, GroupID, null);
}
public GroupRecord GetGroupRecord(string name)
{
return m_groupData.GetGroupRecord(null, UUID.Zero, name);
}
public void ActivateGroup(IClientAPI remoteClient, UUID groupID)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
@ -652,7 +659,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
List<GroupRolesData> data = m_groupData.GetGroupRoles(GetClientGroupRequestID(remoteClient), groupID);
return data;
}
public List<GroupRoleMembersData> GroupRoleMembersRequest(IClientAPI remoteClient, UUID groupID)
@ -662,8 +668,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
List<GroupRoleMembersData> data = m_groupData.GetGroupRoleMembers(GetClientGroupRequestID(remoteClient), groupID);
return data;
}
public GroupProfileData GroupProfileRequest(IClientAPI remoteClient, UUID groupID)
@ -712,7 +716,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
public GroupMembershipData GetMembershipData(UUID groupID, UUID agentID)
{
if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
if (m_debugEnabled)
m_log.DebugFormat(
"[GROUPS]: {0} called with groupID={1}, agentID={2}",
System.Reflection.MethodBase.GetCurrentMethod().Name, groupID, agentID);
return m_groupData.GetAgentGroupMembership(null, agentID, groupID);
}
@ -746,7 +753,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return UUID.Zero;
}
// is there is a money module present ?
IMoneyModule money=remoteClient.Scene.RequestModuleInterface<IMoneyModule>();
IMoneyModule money = remoteClient.Scene.RequestModuleInterface<IMoneyModule>();
if (money != null)
{
// do the transaction, that is if the agent has got sufficient funds
@ -1166,8 +1173,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
else
{
string domain = string.Empty; //m_sceneList[0].CommsManager.NetworkServersInfo.UserURL;
if (account.ServiceURLs["HomeURI"] != null)
domain = account.ServiceURLs["HomeURI"].ToString();
object homeUriObj;
if (account.ServiceURLs.TryGetValue("HomeURI", out homeUriObj) && homeUriObj != null)
domain = homeUriObj.ToString();
// They're a local user, use this:
info.RequestID.UserServiceURL = domain;
}

View File

@ -55,7 +55,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
GroupInviteInfo GetAgentToGroupInvite(GroupRequestID requestID, UUID inviteID);
void RemoveAgentToGroupInvite(GroupRequestID requestID, UUID inviteID);
void AddAgentToGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID);
void RemoveAgentFromGroupRole(GroupRequestID requestID, UUID AgentID, UUID GroupID, UUID RoleID);
List<GroupRolesData> GetAgentGroupRoles(GroupRequestID requestID, UUID AgentID, UUID GroupID);

View File

@ -47,9 +47,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
public class XmlRpcGroupsServicesConnectorModule : ISharedRegionModule, IGroupsServicesConnector
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome |
GroupPowers.Accountable |
@ -354,11 +352,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
MemberGroupProfile.PowersMask = MemberInfo.GroupPowers;
return MemberGroupProfile;
}
public void SetAgentActiveGroup(GroupRequestID requestID, UUID AgentID, UUID GroupID)
{
Hashtable param = new Hashtable();
@ -470,7 +465,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
XmlRpcCall(requestID, "groups.removeAgentFromGroupRole", param);
}
public List<DirGroupsReplyData> FindGroups(GroupRequestID requestID, string search)
{
Hashtable param = new Hashtable();
@ -531,7 +525,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return HashTableToGroupMembershipData(respData);
}
public List<GroupMembershipData> GetAgentGroupMemberships(GroupRequestID requestID, UUID AgentID)
{
Hashtable param = new Hashtable();
@ -778,7 +771,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
private GroupRecord GroupProfileHashtableToGroupRecord(Hashtable groupProfile)
{
GroupRecord group = new GroupRecord();
group.GroupID = UUID.Parse((string)groupProfile["GroupID"]);
group.GroupName = groupProfile["Name"].ToString();
@ -797,6 +789,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
return group;
}
private static GroupMembershipData HashTableToGroupMembershipData(Hashtable respData)
{
GroupMembershipData data = new GroupMembershipData();
@ -829,6 +822,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
data.MembershipFee = int.Parse((string)respData["MembershipFee"]);
data.OpenEnrollment = ((string)respData["OpenEnrollment"] == "1");
data.ShowInList = ((string)respData["ShowInList"] == "1");
return data;
}

View File

@ -110,7 +110,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
if (m_avatars.ContainsKey(agentID))
{
ScenePresence sp;
scene.TryGetAvatar(agentID, out sp);
scene.TryGetScenePresence(agentID, out sp);
sp.DoAutoPilot(0, pos, m_avatars[agentID]);
}
}
@ -165,7 +165,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
p_scene.AddNewClient(npcAvatar);
ScenePresence sp;
if (p_scene.TryGetAvatar(npcAvatar.AgentId, out sp))
if (p_scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
{
AvatarAppearance x = GetAppearance(p_cloneAppearanceFrom, p_scene);

View File

@ -625,36 +625,37 @@ namespace OpenSim.Region.RegionCombinerModule
return;
}
List<ScenePresence> avatars = connectiondata.RegionScene.GetAvatars();
List<Vector3> CoarseLocations = new List<Vector3>();
List<UUID> AvatarUUIDs = new List<UUID>();
for (int i = 0; i < avatars.Count; i++)
connectiondata.RegionScene.ForEachScenePresence(delegate(ScenePresence sp)
{
if (avatars[i].UUID != presence.UUID)
if (sp.IsChildAgent)
return;
if (sp.UUID != presence.UUID)
{
if (avatars[i].ParentID != 0)
if (sp.ParentID != 0)
{
// sitting avatar
SceneObjectPart sop = connectiondata.RegionScene.GetSceneObjectPart(avatars[i].ParentID);
SceneObjectPart sop = connectiondata.RegionScene.GetSceneObjectPart(sp.ParentID);
if (sop != null)
{
CoarseLocations.Add(sop.AbsolutePosition + avatars[i].AbsolutePosition);
AvatarUUIDs.Add(avatars[i].UUID);
CoarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
AvatarUUIDs.Add(sp.UUID);
}
else
{
// we can't find the parent.. ! arg!
CoarseLocations.Add(avatars[i].AbsolutePosition);
AvatarUUIDs.Add(avatars[i].UUID);
CoarseLocations.Add(sp.AbsolutePosition);
AvatarUUIDs.Add(sp.UUID);
}
}
else
{
CoarseLocations.Add(avatars[i].AbsolutePosition);
AvatarUUIDs.Add(avatars[i].UUID);
CoarseLocations.Add(sp.AbsolutePosition);
AvatarUUIDs.Add(sp.UUID);
}
}
}
});
DistributeCourseLocationUpdates(CoarseLocations, AvatarUUIDs, connectiondata, presence);
}

View File

@ -5293,7 +5293,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public LSL_Integer llGetRegionAgentCount()
{
m_host.AddScriptLPS(1);
return new LSL_Integer(World.GetAvatars().Count);
return new LSL_Integer(World.GetRootAgentCount());
}
public LSL_Vector llGetRegionCorner()
@ -9096,17 +9096,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
landObject.SetMediaUrl(url);
// now send to all (non-child) agents
List<ScenePresence> agents = World.GetAvatars();
foreach (ScenePresence agent in agents)
World.ForEachScenePresence(delegate(ScenePresence sp)
{
agent.ControllingClient.SendParcelMediaUpdate(landData.MediaURL,
landData.MediaID,
landData.MediaAutoScale,
mediaType,
description,
width, height,
loop);
}
if (!sp.IsChildAgent)
{
sp.ControllingClient.SendParcelMediaUpdate(landData.MediaURL,
landData.MediaID,
landData.MediaAutoScale,
mediaType,
description,
width, height,
loop);
}
});
}
else if (!presence.IsChildAgent)
{
@ -9127,13 +9129,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (presence == null)
{
// send to all (non-child) agents
List<ScenePresence> agents = World.GetAvatars();
foreach (ScenePresence agent in agents)
World.ForEachScenePresence(delegate(ScenePresence sp)
{
agent.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this?
(ParcelMediaCommandEnum)commandToSend,
time);
}
if (!sp.IsChildAgent)
{
sp.ControllingClient.SendParcelMediaCommand(0x4, // TODO what is this?
(ParcelMediaCommandEnum)commandToSend,
time);
}
});
}
else if (!presence.IsChildAgent)
{

View File

@ -697,10 +697,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.None, "osGetAgents");
LSL_List result = new LSL_List();
foreach (ScenePresence avatar in World.GetAvatars())
World.ForEachScenePresence(delegate(ScenePresence sp)
{
result.Add(avatar.Name);
}
if (!sp.IsChildAgent)
result.Add(sp.Name);
});
return result;
}
@ -1989,19 +1990,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
{
foreach (ScenePresence presence in World.GetAvatars())
World.ForEachScenePresence(delegate(ScenePresence sp)
{
if ((presence.Firstname == FirstName) &&
presence.Lastname == SurName)
if (!sp.IsChildAgent &&
sp.Firstname == FirstName &&
sp.Lastname == SurName)
{
// kick client...
if (alert != null)
presence.ControllingClient.Kick(alert);
sp.ControllingClient.Kick(alert);
// ...and close on our side
presence.Scene.IncomingCloseAgent(presence.UUID);
sp.Scene.IncomingCloseAgent(sp.UUID);
}
}
});
}
}

View File

@ -404,70 +404,40 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
private List<SensedEntity> doAgentSensor(SenseRepeatClass ts)
{
List<ScenePresence> presences;
List<SensedEntity> sensedEntities = new List<SensedEntity>();
// If this is an avatar sense by key try to get them directly
// rather than getting a list to scan through
if (ts.keyID != UUID.Zero)
{
ScenePresence p = m_CmdManager.m_ScriptEngine.World.GetScenePresence(ts.keyID);
if (p == null)
return sensedEntities;
presences = new List<ScenePresence>();
presences.Add(p);
}
else
{
presences = new List<ScenePresence>(m_CmdManager.m_ScriptEngine.World.GetScenePresences());
}
// If nobody about quit fast
if (presences.Count == 0)
if(m_CmdManager.m_ScriptEngine.World.GetRootAgentCount() == 0)
return sensedEntities;
SceneObjectPart SensePoint = ts.host;
Vector3 fromRegionPos = SensePoint.AbsolutePosition;
Quaternion q = SensePoint.RotationOffset;
LSL_Types.Quaternion r = new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
LSL_Types.Vector3 forward_dir = (new LSL_Types.Vector3(1, 0, 0) * r);
double mag_fwd = LSL_Types.Vector3.Mag(forward_dir);
bool attached = (SensePoint.AttachmentPoint != 0);
bool nameSearch = (ts.name != null && ts.name != "");
Vector3 toRegionPos;
double dis;
for (int i = 0; i < presences.Count; i++)
Action<ScenePresence> senseEntity = new Action<ScenePresence>(delegate(ScenePresence presence)
{
ScenePresence presence = presences[i];
bool keep = true;
if (presence.IsDeleted || presence.IsChildAgent || presence.GodLevel > 0.0)
return;
// if the object the script is in is attached and the avatar is the owner
// then this one is not wanted
if (attached && presence.UUID == SensePoint.OwnerID)
return;
if (presence.IsDeleted)
continue;
if (presence.IsChildAgent)
keep = false;
toRegionPos = presence.AbsolutePosition;
dis = Math.Abs(Util.GetDistanceTo(toRegionPos, fromRegionPos));
// are they in range
if (keep && dis <= ts.range)
if (dis <= ts.range)
{
// if the object the script is in is attached and the avatar is the owner
// then this one is not wanted
if (attached && presence.UUID == SensePoint.OwnerID)
keep = false;
// check the name if needed
if (keep && nameSearch && ts.name != presence.Name)
keep = false;
// Are they in the required angle of view
if (keep && ts.arc < Math.PI)
if (ts.arc < Math.PI)
{
// not omni-directional. Can you see it ?
// vec forward_dir = llRot2Fwd(llGetRot())
@ -488,26 +458,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
catch
{
}
if (ang_obj > ts.arc) keep = false;
if (ang_obj <= ts.arc)
{
sensedEntities.Add(new SensedEntity(dis, presence.UUID));
}
}
}
else
{
keep = false;
}
});
// Do not report gods, not even minor ones
if (keep && presence.GodLevel > 0.0)
keep = false;
if (keep) // add to list with distance
{
sensedEntities.Add(new SensedEntity(dis, presence.UUID));
}
// If this is a search by name and we have just found it then no more to do
if (nameSearch && ts.name == presence.Name)
// If this is an avatar sense by key try to get them directly
// rather than getting a list to scan through
if (ts.keyID != UUID.Zero)
{
ScenePresence sp;
// Try direct lookup by UUID
if(!m_CmdManager.m_ScriptEngine.World.TryGetScenePresence(ts.keyID, out sp))
return sensedEntities;
senseEntity(sp);
}
else if (ts.name != null && ts.name != "")
{
ScenePresence sp;
// Try lookup by name will return if/when found
if (!m_CmdManager.m_ScriptEngine.World.TryGetAvatarByName(ts.name, out sp))
return sensedEntities;
senseEntity(sp);
}
else
{
m_CmdManager.m_ScriptEngine.World.ForEachScenePresence(senseEntity);
}
return sensedEntities;
}

View File

@ -68,17 +68,15 @@ namespace OpenSim.Region.UserStatistics
HTMLUtil.OL_O(ref output, "");
foreach (Scene scene in all_scenes)
{
List<ScenePresence> avatarInScene = scene.GetScenePresences();
HTMLUtil.LI_O(ref output, String.Empty);
output.Append(scene.RegionInfo.RegionName);
HTMLUtil.OL_O(ref output, String.Empty);
foreach (ScenePresence av in avatarInScene)
scene.ForEachScenePresence(delegate(ScenePresence av)
{
Dictionary<string,string> queues = new Dictionary<string, string>();
Dictionary<string, string> queues = new Dictionary<string, string>();
if (av.ControllingClient is IStatsCollector)
{
IStatsCollector isClient = (IStatsCollector) av.ControllingClient;
IStatsCollector isClient = (IStatsCollector)av.ControllingClient;
queues = decodeQueueReport(isClient.Report());
}
HTMLUtil.LI_O(ref output, String.Empty);
@ -92,8 +90,8 @@ namespace OpenSim.Region.UserStatistics
else
{
output.Append(string.Format("<br /><NOBR>Position: <{0},{1},{2}></NOBR>", (int)av.AbsolutePosition.X,
(int) av.AbsolutePosition.Y,
(int) av.AbsolutePosition.Z));
(int)av.AbsolutePosition.Y,
(int)av.AbsolutePosition.Z));
}
Dictionary<string, int> throttles = DecodeClientThrottles(av.ControllingClient.GetThrottlesPacked(1));
@ -124,7 +122,7 @@ namespace OpenSim.Region.UserStatistics
HTMLUtil.UL_C(ref output);
HTMLUtil.LI_C(ref output);
}
});
HTMLUtil.OL_C(ref output);
}
HTMLUtil.OL_C(ref output);

View File

@ -71,6 +71,8 @@ namespace OpenSim.Server.Base
return m_Servers[port];
m_Servers[port] = new BaseHttpServer(port);
m_Log.InfoFormat("[SERVER]: Starting new HTTP server on port {0}", port);
m_Servers[port].Start();
return m_Servers[port];
@ -109,6 +111,7 @@ namespace OpenSim.Server.Base
protected override void Initialise()
{
m_Log.InfoFormat("[SERVER]: Starting HTTP server on port {0}", m_HttpServer.Port);
m_HttpServer.Start();
if (MainConsole.Instance is RemoteConsole)

View File

@ -90,14 +90,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig gridConfig = source.Configs["AssetService"];
if (gridConfig == null)
{
m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini");
m_log.Error("[SIMIAN ASSET CONNECTOR]: AssetService missing from OpenSim.ini");
throw new Exception("Asset connector init error");
}
string serviceUrl = gridConfig.GetString("AssetServerURI");
if (String.IsNullOrEmpty(serviceUrl))
{
m_log.Error("[ASSET CONNECTOR]: No AssetServerURI in section AssetService");
m_log.Error("[SIMIAN ASSET CONNECTOR]: No AssetServerURI in section AssetService");
throw new Exception("Asset connector init error");
}
@ -162,7 +162,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
catch (Exception ex)
{
m_log.Warn("[ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message);
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message);
return null;
}
}
@ -220,7 +220,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
catch (Exception ex)
{
m_log.Warn("[ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message);
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Asset GET from " + url + " failed: " + ex.Message);
}
return metadata;
@ -356,7 +356,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
errorMessage = ex.Message;
}
m_log.WarnFormat("[ASSET CONNECTOR]: Failed to store asset \"{0}\" ({1}, {2}): {3}",
m_log.WarnFormat("[SIMIAN ASSET CONNECTOR]: Failed to store asset \"{0}\" ({1}, {2}): {3}",
asset.Name, asset.ID, asset.Metadata.ContentType, errorMessage);
return null;
}
@ -374,7 +374,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (asset == null)
{
m_log.Warn("[ASSET CONNECTOR]: Failed to fetch asset " + id + " for updating");
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to fetch asset " + id + " for updating");
return false;
}
@ -400,7 +400,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (response["Success"].AsBoolean())
return true;
else
m_log.Warn("[ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service");
m_log.Warn("[SIMIAN ASSET CONNECTOR]: Failed to delete asset " + id + " from the asset service");
return false;
}

View File

@ -78,14 +78,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig assetConfig = source.Configs["AuthenticationService"];
if (assetConfig == null)
{
m_log.Error("[AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini");
m_log.Error("[SIMIAN AUTH CONNECTOR]: AuthenticationService missing from OpenSim.ini");
throw new Exception("Authentication connector init error");
}
string serviceURI = assetConfig.GetString("AuthenticationServerURI");
if (String.IsNullOrEmpty(serviceURI))
{
m_log.Error("[AUTH CONNECTOR]: No Server URI named in section AuthenticationService");
m_log.Error("[SIMIAN AUTH CONNECTOR]: No Server URI named in section AuthenticationService");
throw new Exception("Authentication connector init error");
}
@ -114,17 +114,17 @@ namespace OpenSim.Services.Connectors.SimianGrid
{
string credential = identity["Credential"].AsString();
if (password == credential || Utils.MD5String(password) == credential)
if (password == credential || "$1$" + Utils.MD5String(password) == credential)
return Authorize(principalID);
}
}
}
m_log.Warn("[AUTH CONNECTOR]: Authentication failed for " + principalID);
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Authentication failed for " + principalID);
}
else
{
m_log.Warn("[AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " +
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " +
response["Message"].AsString());
}
@ -146,7 +146,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[AUTH CONNECTOR]: Could not verify session for " + principalID + ": " +
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Could not verify session for " + principalID + ": " +
response["Message"].AsString());
}
@ -168,7 +168,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[AUTH CONNECTOR]: Failed to remove session for " + principalID + ": " +
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Failed to remove session for " + principalID + ": " +
response["Message"].AsString());
}
@ -177,9 +177,46 @@ namespace OpenSim.Services.Connectors.SimianGrid
public bool SetPassword(UUID principalID, string passwd)
{
// TODO: Use GetIdentities to find the md5hash identity for principalID
// and then update it with AddIdentity
m_log.Error("[AUTH CONNECTOR]: Changing passwords is not implemented yet");
// Fetch the user name first
NameValueCollection requestArgs = new NameValueCollection
{
{ "RequestMethod", "GetUser" },
{ "UserID", principalID.ToString() }
};
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
if (response["Success"].AsBoolean() && response["User"] is OSDMap)
{
OSDMap userMap = (OSDMap)response["User"];
string identifier = userMap["Name"].AsString();
if (!String.IsNullOrEmpty(identifier))
{
// Add/update the md5hash identity
requestArgs = new NameValueCollection
{
{ "RequestMethod", "AddIdentity" },
{ "Identifier", identifier },
{ "Credential", "$1$" + Utils.MD5String(passwd) },
{ "Type", "md5hash" },
{ "UserID", principalID.ToString() }
};
response = WebUtil.PostToService(m_serverUrl, requestArgs);
bool success = response["Success"].AsBoolean();
if (!success)
m_log.WarnFormat("[SIMIAN AUTH CONNECTOR]: Failed to set password for {0} ({1})", identifier, principalID);
return success;
}
}
else
{
m_log.Warn("[SIMIAN AUTH CONNECTOR]: Failed to retrieve identities for " + principalID + ": " +
response["Message"].AsString());
}
return false;
}

View File

@ -83,14 +83,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig gridConfig = source.Configs["AvatarService"];
if (gridConfig == null)
{
m_log.Error("[AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini");
m_log.Error("[SIMIAN AVATAR CONNECTOR]: AvatarService missing from OpenSim.ini");
throw new Exception("Avatar connector init error");
}
string serviceUrl = gridConfig.GetString("AvatarServerURI");
if (String.IsNullOrEmpty(serviceUrl))
{
m_log.Error("[AVATAR CONNECTOR]: No AvatarServerURI in section AvatarService");
m_log.Error("[SIMIAN AVATAR CONNECTOR]: No AvatarServerURI in section AvatarService");
throw new Exception("Avatar connector init error");
}
@ -156,14 +156,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[AVATAR CONNECTOR]: Failed to get user appearance for " + userID +
m_log.Warn("[SIMIAN AVATAR CONNECTOR]: Failed to get user appearance for " + userID +
", LLAppearance is missing or invalid");
return null;
}
}
else
{
m_log.Warn("[AVATAR CONNECTOR]: Failed to get user appearance for " + userID + ": " +
m_log.Warn("[SIMIAN AVATAR CONNECTOR]: Failed to get user appearance for " + userID + ": " +
response["Message"].AsString());
}
@ -172,7 +172,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public bool SetAvatar(UUID userID, AvatarData avatar)
{
m_log.Debug("[AVATAR CONNECTOR]: SetAvatar called for " + userID);
m_log.Debug("[SIMIAN AVATAR CONNECTOR]: SetAvatar called for " + userID);
if (avatar.AvatarType == 1) // LLAvatar
{
@ -228,32 +228,32 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[AVATAR CONNECTOR]: Failed saving appearance for " + userID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN AVATAR CONNECTOR]: Failed saving appearance for " + userID + ": " + response["Message"].AsString());
return success;
}
else
{
m_log.Error("[AVATAR CONNECTOR]: Can't save appearance for " + userID + ". Unhandled avatar type " + avatar.AvatarType);
m_log.Error("[SIMIAN AVATAR CONNECTOR]: Can't save appearance for " + userID + ". Unhandled avatar type " + avatar.AvatarType);
return false;
}
}
public bool ResetAvatar(UUID userID)
{
m_log.Error("[AVATAR CONNECTOR]: ResetAvatar called for " + userID + ", implement this");
m_log.Error("[SIMIAN AVATAR CONNECTOR]: ResetAvatar called for " + userID + ", implement this");
return false;
}
public bool SetItems(UUID userID, string[] names, string[] values)
{
m_log.Error("[AVATAR CONNECTOR]: SetItems called for " + userID + " with " + names.Length + " names and " + values.Length + " values, implement this");
m_log.Error("[SIMIAN AVATAR CONNECTOR]: SetItems called for " + userID + " with " + names.Length + " names and " + values.Length + " values, implement this");
return false;
}
public bool RemoveItems(UUID userID, string[] names)
{
m_log.Error("[AVATAR CONNECTOR]: RemoveItems called for " + userID + " with " + names.Length + " names, implement this");
m_log.Error("[SIMIAN AVATAR CONNECTOR]: RemoveItems called for " + userID + " with " + names.Length + " names, implement this");
return false;
}

View File

@ -89,14 +89,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig assetConfig = source.Configs["FriendsService"];
if (assetConfig == null)
{
m_log.Error("[FRIENDS CONNECTOR]: FriendsService missing from OpenSim.ini");
m_log.Error("[SIMIAN FRIENDS CONNECTOR]: FriendsService missing from OpenSim.ini");
throw new Exception("Friends connector init error");
}
string serviceURI = assetConfig.GetString("FriendsServerURI");
if (String.IsNullOrEmpty(serviceURI))
{
m_log.Error("[FRIENDS CONNECTOR]: No Server URI named in section FriendsService");
m_log.Error("[SIMIAN FRIENDS CONNECTOR]: No Server URI named in section FriendsService");
throw new Exception("Friends connector init error");
}
@ -169,7 +169,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Error("[FRIENDS CONNECTOR]: Failed to store friend " + friend + " for user " + principalID + ": " + response["Message"].AsString());
m_log.Error("[SIMIAN FRIENDS CONNECTOR]: Failed to store friend " + friend + " for user " + principalID + ": " + response["Message"].AsString());
return success;
}
@ -188,7 +188,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Error("[FRIENDS CONNECTOR]: Failed to remove friend " + friend + " for user " + principalID + ": " + response["Message"].AsString());
m_log.Error("[SIMIAN FRIENDS CONNECTOR]: Failed to remove friend " + friend + " for user " + principalID + ": " + response["Message"].AsString());
return success;
}
@ -211,7 +211,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[FRIENDS CONNECTOR]: Failed to retrieve friends for user " + ownerID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN FRIENDS CONNECTOR]: Failed to retrieve friends for user " + ownerID + ": " + response["Message"].AsString());
return new OSDArray(0);
}
}
@ -232,7 +232,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[FRIENDS CONNECTOR]: Failed to retrieve reverse friends for user " + ownerID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN FRIENDS CONNECTOR]: Failed to retrieve reverse friends for user " + ownerID + ": " + response["Message"].AsString());
return new OSDArray(0);
}
}

View File

@ -85,14 +85,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig gridConfig = source.Configs["GridService"];
if (gridConfig == null)
{
m_log.Error("[GRID CONNECTOR]: GridService missing from OpenSim.ini");
m_log.Error("[SIMIAN GRID CONNECTOR]: GridService missing from OpenSim.ini");
throw new Exception("Grid connector init error");
}
string serviceUrl = gridConfig.GetString("GridServerURI");
if (String.IsNullOrEmpty(serviceUrl))
{
m_log.Error("[GRID CONNECTOR]: No Server URI named in section GridService");
m_log.Error("[SIMIAN GRID CONNECTOR]: No Server URI named in section GridService");
throw new Exception("Grid connector init error");
}
@ -155,7 +155,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[GRID CONNECTOR]: Region deregistration for " + regionID + " failed: " + response["Message"].AsString());
m_log.Warn("[SIMIAN GRID CONNECTOR]: Region deregistration for " + regionID + " failed: " + response["Message"].AsString());
return success;
}
@ -181,7 +181,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
}
m_log.Debug("[GRID CONNECTOR]: Found " + regions.Count + " neighbors for region " + regionID);
m_log.Debug("[SIMIAN GRID CONNECTOR]: Found " + regions.Count + " neighbors for region " + regionID);
return regions;
}
@ -203,7 +203,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[GRID CONNECTOR]: Grid service did not find a match for region " + regionID);
m_log.Warn("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region " + regionID);
return null;
}
}
@ -228,7 +228,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
//m_log.InfoFormat("[GRID CONNECTOR]: Grid service did not find a match for region at {0},{1}",
//m_log.InfoFormat("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region at {0},{1}",
// x / Constants.RegionSize, y / Constants.RegionSize);
return null;
}
@ -238,7 +238,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
{
List<GridRegion> regions = GetRegionsByName(scopeID, regionName, 1);
m_log.Debug("[GRID CONNECTOR]: Got " + regions.Count + " matches for region name " + regionName);
m_log.Debug("[SIMIAN GRID CONNECTOR]: Got " + regions.Count + " matches for region name " + regionName);
if (regions.Count > 0)
return regions[0];
@ -349,7 +349,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[GRID CONNECTOR]: Grid service did not find a match for region " + regionID + " during region flags check");
m_log.Warn("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region " + regionID + " during region flags check");
return -1;
}
}
@ -374,7 +374,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[GRID CONNECTOR]: Grid service did not find a match for region at " + position);
m_log.Warn("[SIMIAN GRID CONNECTOR]: Grid service did not find a match for region at " + position);
return null;
}
}

View File

@ -97,14 +97,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig gridConfig = source.Configs["InventoryService"];
if (gridConfig == null)
{
m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
m_log.Error("[SIMIAN INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
throw new Exception("Inventory connector init error");
}
string serviceUrl = gridConfig.GetString("InventoryServerURI");
if (String.IsNullOrEmpty(serviceUrl))
{
m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService");
m_log.Error("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section InventoryService");
throw new Exception("Inventory connector init error");
}
@ -117,11 +117,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!String.IsNullOrEmpty(serviceUrl))
m_userServerUrl = serviceUrl;
else
m_log.Info("[INVENTORY CONNECTOR]: No Server URI named in section UserAccountService");
m_log.Info("[SIMIAN INVENTORY CONNECTOR]: No Server URI named in section UserAccountService");
}
else
{
m_log.Warn("[INVENTORY CONNECTOR]: UserAccountService missing from OpenSim.ini");
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: UserAccountService missing from OpenSim.ini");
}
}
}
@ -143,7 +143,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[INVENTORY CONNECTOR]: Inventory creation for " + userID + " failed: " + response["Message"].AsString());
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Inventory creation for " + userID + " failed: " + response["Message"].AsString());
return success;
}
@ -173,7 +173,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[INVENTORY CONNECTOR]: Failed to retrieve inventory skeleton for " + userID + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Failed to retrieve inventory skeleton for " + userID + ": " +
response["Message"].AsString());
return new List<InventoryFolderBase>(0);
}
@ -187,7 +187,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
[Obsolete]
public InventoryCollection GetUserInventory(UUID userID)
{
m_log.Error("[INVENTORY CONNECTOR]: Obsolete GetUserInventory called for " + userID);
m_log.Error("[SIMIAN INVENTORY CONNECTOR]: Obsolete GetUserInventory called for " + userID);
InventoryCollection inventory = new InventoryCollection();
inventory.UserID = userID;
@ -206,7 +206,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
[Obsolete]
public void GetUserInventory(UUID userID, InventoryReceiptCallback callback)
{
m_log.Error("[INVENTORY CONNECTOR]: Obsolete GetUserInventory called for " + userID);
m_log.Error("[SIMIAN INVENTORY CONNECTOR]: Obsolete GetUserInventory called for " + userID);
callback(new List<InventoryFolderImpl>(0), new List<InventoryItemBase>(0));
}
@ -273,7 +273,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[INVENTORY CONNECTOR]: Default folder not found for content type " + contentType);
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Default folder not found for content type " + contentType + ": " + response["Message"].AsString());
return GetRootFolder(userID);
}
}
@ -311,7 +311,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
}
m_log.Warn("[INVENTORY CONNECTOR]: Item " + item.ID + " owned by " + item.Owner + " not found");
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Item " + item.ID + " owned by " + item.Owner + " not found");
return null;
}
@ -376,7 +376,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[INVENTORY CONNECTOR]: Error fetching folder " + folderID + " content for " + userID + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Error fetching folder " + folderID + " content for " + userID + ": " +
response["Message"].AsString());
inventory.Folders = new List<InventoryFolderBase>(0);
inventory.Items = new List<InventoryItemBase>(0);
@ -414,7 +414,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[INVENTORY CONNECTOR]: Error fetching folder " + folderID + " for " + userID + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Error fetching folder " + folderID + " for " + userID + ": " +
response["Message"].AsString());
return new List<InventoryItemBase>(0);
}
@ -442,7 +442,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!success)
{
m_log.Warn("[INVENTORY CONNECTOR]: Error creating folder " + folder.Name + " for " + folder.Owner + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Error creating folder " + folder.Name + " for " + folder.Owner + ": " +
response["Message"].AsString());
}
@ -506,7 +506,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!success)
{
m_log.Warn("[INVENTORY CONNECTOR]: Error removing item " + itemID + " for " + userID + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Error removing item " + itemID + " for " + userID + ": " +
response["Message"].AsString());
allSuccess = false;
}
@ -534,7 +534,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!success)
{
m_log.Warn("[INVENTORY CONNECTOR]: Error purging folder " + folder.ID + " for " + folder.Owner + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Error purging folder " + folder.ID + " for " + folder.Owner + ": " +
response["Message"].AsString());
}
@ -562,7 +562,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
UpdateGesture(item.Owner, item.ID, item.Flags == 1);
if (item.BasePermissions == 0)
m_log.WarnFormat("[INVENTORY CONNECTOR]: Adding inventory item {0} ({1}) with no base permissions", item.Name, item.ID);
m_log.WarnFormat("[SIMIAN INVENTORY CONNECTOR]: Adding inventory item {0} ({1}) with no base permissions", item.Name, item.ID);
OSDMap permissions = new OSDMap
{
@ -601,7 +601,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!success)
{
m_log.Warn("[INVENTORY CONNECTOR]: Error creating item " + item.Name + " for " + item.Owner + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Error creating item " + item.Name + " for " + item.Owner + ": " +
response["Message"].AsString());
}
@ -785,7 +785,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (invItem.BasePermissions == 0)
{
m_log.InfoFormat("[INVENTORY CONNECTOR]: Forcing item permissions to full for item {0} ({1})",
m_log.InfoFormat("[SIMIAN INVENTORY CONNECTOR]: Forcing item permissions to full for item {0} ({1})",
invItem.Name, invItem.ID);
invItem.BasePermissions = (uint)PermissionMask.All;
invItem.CurrentPermissions = (uint)PermissionMask.All;
@ -820,7 +820,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (!success)
{
m_log.Warn("[INVENTORY CONNECTOR]: Failed to move " + items.Count + " items to " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Failed to move " + items.Count + " items to " +
destFolderID + ": " + response["Message"].AsString());
}
@ -863,12 +863,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (gestures != null && gestures is OSDArray)
return (OSDArray)gestures;
else
m_log.Error("[INVENTORY CONNECTOR]: Unrecognized active gestures data for " + userID);
m_log.Error("[SIMIAN INVENTORY CONNECTOR]: Unrecognized active gestures data for " + userID);
}
}
else
{
m_log.Warn("[INVENTORY CONNECTOR]: Failed to fetch active gestures for " + userID + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Failed to fetch active gestures for " + userID + ": " +
response["Message"].AsString());
}
@ -887,7 +887,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
OSDMap response = WebUtil.PostToService(m_userServerUrl, requestArgs);
if (!response["Success"].AsBoolean())
{
m_log.Warn("[INVENTORY CONNECTOR]: Failed to save active gestures for " + userID + ": " +
m_log.Warn("[SIMIAN INVENTORY CONNECTOR]: Failed to save active gestures for " + userID + ": " +
response["Message"].AsString());
}
}

View File

@ -109,14 +109,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig gridConfig = source.Configs["PresenceService"];
if (gridConfig == null)
{
m_log.Error("[PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini");
m_log.Error("[SIMIAN PRESENCE CONNECTOR]: PresenceService missing from OpenSim.ini");
throw new Exception("Presence connector init error");
}
string serviceUrl = gridConfig.GetString("PresenceServerURI");
if (String.IsNullOrEmpty(serviceUrl))
{
m_log.Error("[PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService");
m_log.Error("[SIMIAN PRESENCE CONNECTOR]: No PresenceServerURI in section PresenceService");
throw new Exception("Presence connector init error");
}
@ -128,7 +128,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID)
{
m_log.ErrorFormat("[PRESENCE CONNECTOR]: Login requested, UserID={0}, SessionID={1}, SecureSessionID={2}",
m_log.ErrorFormat("[SIMIAN PRESENCE CONNECTOR]: Login requested, UserID={0}, SessionID={1}, SecureSessionID={2}",
userID, sessionID, secureSessionID);
NameValueCollection requestArgs = new NameValueCollection
@ -146,14 +146,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[PRESENCE CONNECTOR]: Failed to login agent " + userID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to login agent " + userID + ": " + response["Message"].AsString());
return success;
}
public bool LogoutAgent(UUID sessionID, Vector3 position, Vector3 lookAt)
{
m_log.InfoFormat("[PRESENCE CONNECTOR]: Logout requested for agent with sessionID " + sessionID);
m_log.InfoFormat("[SIMIAN PRESENCE CONNECTOR]: Logout requested for agent with sessionID " + sessionID);
NameValueCollection requestArgs = new NameValueCollection
{
@ -165,14 +165,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[PRESENCE CONNECTOR]: Failed to logout agent with sessionID " + sessionID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to logout agent with sessionID " + sessionID + ": " + response["Message"].AsString());
return success;
}
public bool LogoutRegionAgents(UUID regionID)
{
m_log.InfoFormat("[PRESENCE CONNECTOR]: Logout requested for all agents in region " + regionID);
m_log.InfoFormat("[SIMIAN PRESENCE CONNECTOR]: Logout requested for all agents in region " + regionID);
NameValueCollection requestArgs = new NameValueCollection
{
@ -184,14 +184,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[PRESENCE CONNECTOR]: Failed to logout agents from region " + regionID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to logout agents from region " + regionID + ": " + response["Message"].AsString());
return success;
}
public bool ReportAgent(UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt)
{
//m_log.DebugFormat("[PRESENCE CONNECTOR]: Updating session data for agent with sessionID " + sessionID);
//m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Updating session data for agent with sessionID " + sessionID);
NameValueCollection requestArgs = new NameValueCollection
{
@ -206,14 +206,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[PRESENCE CONNECTOR]: Failed to update agent session " + sessionID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to update agent session " + sessionID + ": " + response["Message"].AsString());
return success;
}
public PresenceInfo GetAgent(UUID sessionID)
{
m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting session data for agent with sessionID " + sessionID);
m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for agent with sessionID " + sessionID);
NameValueCollection requestArgs = new NameValueCollection
{
@ -225,7 +225,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (sessionResponse["Success"].AsBoolean())
{
UUID userID = sessionResponse["UserID"].AsUUID();
m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting user data for " + userID);
m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting user data for " + userID);
requestArgs = new NameValueCollection
{
@ -237,11 +237,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (userResponse["Success"].AsBoolean())
return ResponseToPresenceInfo(sessionResponse, userResponse);
else
m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve user data for " + userID + ": " + userResponse["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve user data for " + userID + ": " + userResponse["Message"].AsString());
}
else
{
m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve session " + sessionID + ": " + sessionResponse["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve session " + sessionID + ": " + sessionResponse["Message"].AsString());
}
return null;
@ -263,7 +263,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt)
{
m_log.DebugFormat("[PRESENCE CONNECTOR]: Setting home location for user " + userID);
m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Setting home location for user " + userID);
NameValueCollection requestArgs = new NameValueCollection
{
@ -276,7 +276,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[PRESENCE CONNECTOR]: Failed to set home location for " + userID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to set home location for " + userID + ": " + response["Message"].AsString());
return success;
}
@ -301,7 +301,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private void SignificantClientMovementHandler(IClientAPI client)
{
ScenePresence sp;
if (client.Scene is Scene && ((Scene)client.Scene).TryGetAvatar(client.AgentId, out sp))
if (client.Scene is Scene && ((Scene)client.Scene).TryGetScenePresence(client.AgentId, out sp))
ReportAgent(sp.ControllingClient.SessionId, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat);
}
@ -312,7 +312,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
client.OnConnectionClosed -= LogoutHandler;
object obj;
if (client.Scene.TryGetAvatar(client.AgentId, out obj) && obj is ScenePresence)
if (client.Scene.TryGetScenePresence(client.AgentId, out obj) && obj is ScenePresence)
{
// The avatar is still in the scene, we can get the exact logout position
ScenePresence sp = (ScenePresence)obj;
@ -335,7 +335,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private OSDMap GetUserData(UUID userID)
{
m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting user data for " + userID);
m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting user data for " + userID);
NameValueCollection requestArgs = new NameValueCollection
{
@ -347,14 +347,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (response["Success"].AsBoolean() && response["User"] is OSDMap)
return response;
else
m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve user data for " + userID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve user data for " + userID + ": " + response["Message"].AsString());
return null;
}
private OSDMap GetSessionData(UUID sessionID)
{
m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting session data for session " + sessionID);
m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting session data for session " + sessionID);
NameValueCollection requestArgs = new NameValueCollection
{
@ -366,7 +366,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (response["Success"].AsBoolean())
return response;
else
m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve session data for session " + sessionID);
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve session data for session " + sessionID);
return null;
}
@ -378,7 +378,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
OSDMap userResponse = GetUserData(userID);
if (userResponse != null)
{
m_log.DebugFormat("[PRESENCE CONNECTOR]: Requesting sessions for " + userID);
m_log.DebugFormat("[SIMIAN PRESENCE CONNECTOR]: Requesting sessions for " + userID);
NameValueCollection requestArgs = new NameValueCollection
{
@ -395,7 +395,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve sessions for " + userID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve sessions for " + userID + ": " + response["Message"].AsString());
}
}
@ -428,7 +428,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[PRESENCE CONNECTOR]: Failed to retrieve presence information for session " + sessionID +
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to retrieve presence information for session " + sessionID +
" while saving last location: " + response["Message"].AsString());
}
@ -448,7 +448,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.Warn("[PRESENCE CONNECTOR]: Failed to set last location for " + userID + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN PRESENCE CONNECTOR]: Failed to set last location for " + userID + ": " + response["Message"].AsString());
return success;
}

View File

@ -93,14 +93,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig gridConfig = source.Configs["UserAccountService"];
if (gridConfig == null)
{
m_log.Error("[PROFILES]: UserAccountService missing from OpenSim.ini");
m_log.Error("[SIMIAN PROFILES]: UserAccountService missing from OpenSim.ini");
throw new Exception("Profiles init error");
}
string serviceUrl = gridConfig.GetString("UserAccountServerURI");
if (String.IsNullOrEmpty(serviceUrl))
{
m_log.Error("[PROFILES]: No UserAccountServerURI in section UserAccountService");
m_log.Error("[SIMIAN PROFILES]: No UserAccountServerURI in section UserAccountService");
throw new Exception("Profiles init error");
}
@ -153,7 +153,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
UUID targetAvatarID;
if (args.Count < 1 || !UUID.TryParse(args[0], out targetAvatarID))
{
m_log.Error("[PROFILES]: Unrecognized arguments for " + method);
m_log.Error("[SIMIAN PROFILES]: Unrecognized arguments for " + method);
return;
}
@ -193,7 +193,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
UUID targetAvatarID;
if (args.Count < 1 || !UUID.TryParse(args[0], out targetAvatarID))
{
m_log.Error("[PROFILES]: Unrecognized arguments for " + method);
m_log.Error("[SIMIAN PROFILES]: Unrecognized arguments for " + method);
return;
}
@ -211,7 +211,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
UUID pickID;
if (args.Count < 2 || !UUID.TryParse(args[0], out avatarID) || !UUID.TryParse(args[1], out pickID))
{
m_log.Error("[PROFILES]: Unrecognized arguments for " + method);
m_log.Error("[SIMIAN PROFILES]: Unrecognized arguments for " + method);
return;
}
@ -244,7 +244,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
UUID targetAvatarID;
if (args.Count < 1 || !UUID.TryParse(args[0], out targetAvatarID))
{
m_log.Error("[PROFILES]: Unrecognized arguments for " + method);
m_log.Error("[SIMIAN PROFILES]: Unrecognized arguments for " + method);
return;
}
@ -305,7 +305,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values");
m_log.Warn("[SIMIAN PROFILES]: Failed to fetch profile information for " + client.Name + ", returning default values");
client.SendAvatarProperties(avatarID, String.Empty, "1/1/1970", Utils.EmptyBytes,
String.Empty, (uint)flags, UUID.Zero, UUID.Zero, String.Empty, UUID.Zero);
}
@ -342,7 +342,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private void UserInfoRequestHandler(IClientAPI client)
{
m_log.Error("[PROFILES]: UserInfoRequestHandler");
m_log.Error("[SIMIAN PROFILES]: UserInfoRequestHandler");
// Fetch this user's e-mail address
NameValueCollection requestArgs = new NameValueCollection
@ -355,14 +355,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
string email = response["Email"].AsString();
if (!response["Success"].AsBoolean())
m_log.Warn("[PROFILES]: GetUser failed during a user info request for " + client.Name);
m_log.Warn("[SIMIAN PROFILES]: GetUser failed during a user info request for " + client.Name);
client.SendUserInfoReply(false, true, email);
}
private void UpdateUserInfoHandler(bool imViaEmail, bool visible, IClientAPI client)
{
m_log.Info("[PROFILES]: Ignoring user info update from " + client.Name);
m_log.Info("[SIMIAN PROFILES]: Ignoring user info update from " + client.Name);
}
#endregion Profiles
@ -380,7 +380,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
UserAccount admin = scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, UUID.Zero);
if (admin != null)
{
m_log.InfoFormat("[PROFILES]: Setting estate {0} (ID: {1}) owner to {2}", estate.EstateName,
m_log.InfoFormat("[SIMIAN PROFILES]: Setting estate {0} (ID: {1}) owner to {2}", estate.EstateName,
estate.EstateID, admin.Name);
estate.EstateOwner = admin.PrincipalID;
@ -388,7 +388,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.WarnFormat("[PROFILES]: Estate {0} (ID: {1}) does not have an owner", estate.EstateName, estate.EstateID);
m_log.WarnFormat("[SIMIAN PROFILES]: Estate {0} (ID: {1}) does not have an owner", estate.EstateName, estate.EstateID);
}
}
}
@ -406,7 +406,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
bool success = response["Success"].AsBoolean();
if (!success)
m_log.WarnFormat("[PROFILES]: Failed to add user data with key {0} for {1}: {2}", key, userID, response["Message"].AsString());
m_log.WarnFormat("[SIMIAN PROFILES]: Failed to add user data with key {0} for {1}: {2}", key, userID, response["Message"].AsString());
return success;
}
@ -426,7 +426,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Error("[PROFILES]: Failed to fetch user data for " + userID + ": " + response["Message"].AsString());
m_log.Error("[SIMIAN PROFILES]: Failed to fetch user data for " + userID + ": " + response["Message"].AsString());
}
return null;

View File

@ -82,14 +82,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
IConfig assetConfig = source.Configs["UserAccountService"];
if (assetConfig == null)
{
m_log.Error("[ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini");
m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: UserAccountService missing from OpenSim.ini");
throw new Exception("User account connector init error");
}
string serviceURI = assetConfig.GetString("UserAccountServerURI");
if (String.IsNullOrEmpty(serviceURI))
{
m_log.Error("[ACCOUNT CONNECTOR]: No UserAccountServerURI in section UserAccountService, skipping SimianUserAccountServiceConnector");
m_log.Error("[SIMIAN ACCOUNT CONNECTOR]: No UserAccountServerURI in section UserAccountService, skipping SimianUserAccountServiceConnector");
throw new Exception("User account connector init error");
}
@ -140,7 +140,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
{
List<UserAccount> accounts = new List<UserAccount>();
m_log.DebugFormat("[ACCOUNT CONNECTOR]: Searching for user accounts with name query " + query);
m_log.DebugFormat("[SIMIAN ACCOUNT CONNECTOR]: Searching for user accounts with name query " + query);
NameValueCollection requestArgs = new NameValueCollection
{
@ -163,12 +163,12 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[ACCOUNT CONNECTOR]: Account search failed, response data was in an invalid format");
m_log.Warn("[SIMIAN ACCOUNT CONNECTOR]: Account search failed, response data was in an invalid format");
}
}
else
{
m_log.Warn("[ACCOUNT CONNECTOR]: Failed to search for account data by name " + query);
m_log.Warn("[SIMIAN ACCOUNT CONNECTOR]: Failed to search for account data by name " + query);
}
return accounts;
@ -176,7 +176,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
public bool StoreUserAccount(UserAccount data)
{
m_log.InfoFormat("[ACCOUNT CONNECTOR]: Storing user account for " + data.Name);
m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account for " + data.Name);
NameValueCollection requestArgs = new NameValueCollection
{
@ -191,7 +191,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (response["Success"].AsBoolean())
{
m_log.InfoFormat("[ACCOUNT CONNECTOR]: Storing user account data for " + data.Name);
m_log.InfoFormat("[SIMIAN ACCOUNT CONNECTOR]: Storing user account data for " + data.Name);
requestArgs = new NameValueCollection
{
@ -212,14 +212,14 @@ namespace OpenSim.Services.Connectors.SimianGrid
}
else
{
m_log.Warn("[ACCOUNT CONNECTOR]: Failed to store user account data for " + data.Name + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN ACCOUNT CONNECTOR]: Failed to store user account data for " + data.Name + ": " + response["Message"].AsString());
}
return success;
}
else
{
m_log.Warn("[ACCOUNT CONNECTOR]: Failed to store user account for " + data.Name + ": " + response["Message"].AsString());
m_log.Warn("[SIMIAN ACCOUNT CONNECTOR]: Failed to store user account for " + data.Name + ": " + response["Message"].AsString());
}
return false;
@ -233,7 +233,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
private UserAccount GetUser(NameValueCollection requestArgs)
{
string lookupValue = (requestArgs.Count > 1) ? requestArgs[1] : "(Unknown)";
m_log.DebugFormat("[ACCOUNT CONNECTOR]: Looking up user account with query: " + lookupValue);
m_log.DebugFormat("[SIMIAN ACCOUNT CONNECTOR]: Looking up user account with query: " + lookupValue);
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
if (response["Success"].AsBoolean())
@ -242,11 +242,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
if (user != null)
return ResponseToUserAccount(user);
else
m_log.Warn("[ACCOUNT CONNECTOR]: Account search failed, response data was in an invalid format");
m_log.Warn("[SIMIAN ACCOUNT CONNECTOR]: Account search failed, response data was in an invalid format");
}
else
{
m_log.Warn("[ACCOUNT CONNECTOR]: Failed to lookup user account with query: " + lookupValue);
m_log.Warn("[SIMIAN ACCOUNT CONNECTOR]: Failed to lookup user account with query: " + lookupValue);
}
return null;

View File

@ -150,10 +150,10 @@ namespace OpenSim.Services.Interfaces
List<UserAccount> GetUserAccounts(UUID scopeID, string query);
/// <summary>
/// Store the data given, wich replaces the sotred data, therefore must be complete.
/// Store the data given, wich replaces the stored data, therefore must be complete.
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
bool StoreUserAccount(UserAccount data);
}
}
}

View File

@ -339,9 +339,16 @@ namespace OpenSim.Services.LLLoginService
where = "safe";
}
else
m_log.WarnFormat(
"[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations.",
{
m_log.WarnFormat("[LLOGIN SERVICE]: User {0} {1} does not have a valid home and this grid does not have default locations. Attempting to find random region",
account.FirstName, account.LastName);
defaults = m_GridService.GetRegionsByName(account.ScopeID, "", 1);
if (defaults != null && defaults.Count > 0)
{
region = defaults[0];
where = "safe";
}
}
}
return region;
@ -364,6 +371,17 @@ namespace OpenSim.Services.LLLoginService
region = defaults[0];
where = "safe";
}
else
{
m_log.Info("[LLOGIN SERVICE]: Last Region Not Found Attempting to find random region");
defaults = m_GridService.GetRegionsByName(account.ScopeID, "", 1);
if (defaults != null && defaults.Count > 0)
{
region = defaults[0];
where = "safe";
}
}
}
else
{
@ -396,7 +414,6 @@ namespace OpenSim.Services.LLLoginService
{
if (!regionName.Contains("@"))
{
List<GridRegion> regions = m_GridService.GetRegionsByName(account.ScopeID, regionName, 1);
if ((regions == null) || (regions != null && regions.Count == 0))
{
@ -429,6 +446,7 @@ namespace OpenSim.Services.LLLoginService
return null;
}
// Valid specification of a remote grid
regionName = parts[0];
string domainLocator = parts[1];
parts = domainLocator.Split(new char[] {':'});
@ -436,6 +454,7 @@ namespace OpenSim.Services.LLLoginService
uint port = 0;
if (parts.Length > 1)
UInt32.TryParse(parts[1], out port);
GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper);
return region;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.