diff options
Diffstat (limited to '')
37 files changed, 293 insertions, 212 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 6da5558..d7904a6 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -1237,9 +1237,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
1237 | } | 1237 | } |
1238 | else | 1238 | else |
1239 | { | 1239 | { |
1240 | PresenceInfo[] pinfos = m_app.SceneManager.CurrentOrFirstScene.PresenceService.GetAgents(new string[] { account.PrincipalID.ToString() }); | 1240 | GridUserInfo guinfo = m_app.SceneManager.CurrentOrFirstScene.GridUserService.GetGridUserInfo(account.PrincipalID.ToString()); |
1241 | if (pinfos != null && pinfos.Length >= 1) | 1241 | if (guinfo != null) |
1242 | responseData["lastlogin"] = pinfos[0].Login; | 1242 | responseData["lastlogin"] = guinfo.Login; |
1243 | else | 1243 | else |
1244 | responseData["lastlogin"] = 0; | 1244 | responseData["lastlogin"] = 0; |
1245 | 1245 | ||
diff --git a/OpenSim/Data/AssetDataBase.cs b/OpenSim/Data/AssetDataBase.cs index 5deb44e..e1a810c 100644 --- a/OpenSim/Data/AssetDataBase.cs +++ b/OpenSim/Data/AssetDataBase.cs | |||
@@ -48,5 +48,6 @@ namespace OpenSim.Data | |||
48 | public abstract void Initialise(string connect); | 48 | public abstract void Initialise(string connect); |
49 | public abstract void Initialise(); | 49 | public abstract void Initialise(); |
50 | public abstract void Dispose(); | 50 | public abstract void Dispose(); |
51 | public abstract bool Delete(string id); | ||
51 | } | 52 | } |
52 | } | 53 | } |
diff --git a/OpenSim/Data/IAssetData.cs b/OpenSim/Data/IAssetData.cs index 2149bca..90d5eeb 100644 --- a/OpenSim/Data/IAssetData.cs +++ b/OpenSim/Data/IAssetData.cs | |||
@@ -38,6 +38,7 @@ namespace OpenSim.Data | |||
38 | bool ExistsAsset(UUID uuid); | 38 | bool ExistsAsset(UUID uuid); |
39 | List<AssetMetadata> FetchAssetMetadataSet(int start, int count); | 39 | List<AssetMetadata> FetchAssetMetadataSet(int start, int count); |
40 | void Initialise(string connect); | 40 | void Initialise(string connect); |
41 | bool Delete(string id); | ||
41 | } | 42 | } |
42 | 43 | ||
43 | public class AssetDataInitialiser : PluginInitialiserBase | 44 | public class AssetDataInitialiser : PluginInitialiserBase |
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index d6ea262..8475b22 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -322,6 +322,10 @@ namespace OpenSim.Data.MSSQL | |||
322 | return retList; | 322 | return retList; |
323 | } | 323 | } |
324 | 324 | ||
325 | public override bool Delete(string id) | ||
326 | { | ||
327 | return false; | ||
328 | } | ||
325 | #endregion | 329 | #endregion |
326 | } | 330 | } |
327 | } | 331 | } |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index d55369a..13f5fa2 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -111,7 +111,7 @@ namespace OpenSim.Data.MySQL | |||
111 | dbcon.Open(); | 111 | dbcon.Open(); |
112 | 112 | ||
113 | using (MySqlCommand cmd = new MySqlCommand( | 113 | using (MySqlCommand cmd = new MySqlCommand( |
114 | "SELECT name, description, assetType, local, temporary, data FROM assets WHERE id=?id", | 114 | "SELECT name, description, assetType, local, temporary, asset_flags, data FROM assets WHERE id=?id", |
115 | dbcon)) | 115 | dbcon)) |
116 | { | 116 | { |
117 | cmd.Parameters.AddWithValue("?id", assetID.ToString()); | 117 | cmd.Parameters.AddWithValue("?id", assetID.ToString()); |
@@ -133,6 +133,7 @@ namespace OpenSim.Data.MySQL | |||
133 | asset.Local = false; | 133 | asset.Local = false; |
134 | 134 | ||
135 | asset.Temporary = Convert.ToBoolean(dbReader["temporary"]); | 135 | asset.Temporary = Convert.ToBoolean(dbReader["temporary"]); |
136 | asset.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]); | ||
136 | } | 137 | } |
137 | } | 138 | } |
138 | } | 139 | } |
@@ -161,8 +162,8 @@ namespace OpenSim.Data.MySQL | |||
161 | 162 | ||
162 | MySqlCommand cmd = | 163 | MySqlCommand cmd = |
163 | new MySqlCommand( | 164 | new MySqlCommand( |
164 | "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, data)" + | 165 | "replace INTO assets(id, name, description, assetType, local, temporary, create_time, access_time, asset_flags, data)" + |
165 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?data)", | 166 | "VALUES(?id, ?name, ?description, ?assetType, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?data)", |
166 | dbcon); | 167 | dbcon); |
167 | 168 | ||
168 | string assetName = asset.Name; | 169 | string assetName = asset.Name; |
@@ -194,6 +195,7 @@ namespace OpenSim.Data.MySQL | |||
194 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); | 195 | cmd.Parameters.AddWithValue("?temporary", asset.Temporary); |
195 | cmd.Parameters.AddWithValue("?create_time", now); | 196 | cmd.Parameters.AddWithValue("?create_time", now); |
196 | cmd.Parameters.AddWithValue("?access_time", now); | 197 | cmd.Parameters.AddWithValue("?access_time", now); |
198 | cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags); | ||
197 | cmd.Parameters.AddWithValue("?data", asset.Data); | 199 | cmd.Parameters.AddWithValue("?data", asset.Data); |
198 | cmd.ExecuteNonQuery(); | 200 | cmd.ExecuteNonQuery(); |
199 | cmd.Dispose(); | 201 | cmd.Dispose(); |
@@ -302,7 +304,7 @@ namespace OpenSim.Data.MySQL | |||
302 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 304 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
303 | { | 305 | { |
304 | dbcon.Open(); | 306 | dbcon.Open(); |
305 | MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id FROM assets LIMIT ?start, ?count", dbcon); | 307 | MySqlCommand cmd = new MySqlCommand("SELECT name,description,assetType,temporary,id,asset_flags FROM assets LIMIT ?start, ?count", dbcon); |
306 | cmd.Parameters.AddWithValue("?start", start); | 308 | cmd.Parameters.AddWithValue("?start", start); |
307 | cmd.Parameters.AddWithValue("?count", count); | 309 | cmd.Parameters.AddWithValue("?count", count); |
308 | 310 | ||
@@ -317,6 +319,7 @@ namespace OpenSim.Data.MySQL | |||
317 | metadata.Description = (string)dbReader["description"]; | 319 | metadata.Description = (string)dbReader["description"]; |
318 | metadata.Type = (sbyte)dbReader["assetType"]; | 320 | metadata.Type = (sbyte)dbReader["assetType"]; |
319 | metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. | 321 | metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct. |
322 | metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]); | ||
320 | metadata.FullID = new UUID((string)dbReader["id"]); | 323 | metadata.FullID = new UUID((string)dbReader["id"]); |
321 | 324 | ||
322 | // Current SHA1s are not stored/computed. | 325 | // Current SHA1s are not stored/computed. |
@@ -336,6 +339,24 @@ namespace OpenSim.Data.MySQL | |||
336 | return retList; | 339 | return retList; |
337 | } | 340 | } |
338 | 341 | ||
342 | public override bool Delete(string id) | ||
343 | { | ||
344 | lock (m_dbLock) | ||
345 | { | ||
346 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
347 | { | ||
348 | dbcon.Open(); | ||
349 | MySqlCommand cmd = new MySqlCommand("delete from assets where id=?id", dbcon); | ||
350 | cmd.Parameters.AddWithValue("?id", id); | ||
351 | cmd.ExecuteNonQuery(); | ||
352 | |||
353 | cmd.Dispose(); | ||
354 | } | ||
355 | } | ||
356 | |||
357 | return true; | ||
358 | } | ||
359 | |||
339 | #endregion | 360 | #endregion |
340 | } | 361 | } |
341 | } | 362 | } |
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs index a395ddc..07371e7 100644 --- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs +++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs | |||
@@ -975,7 +975,7 @@ namespace OpenSim.Data.MySQL | |||
975 | "use_estate_sun, fixed_sun, sun_position, " + | 975 | "use_estate_sun, fixed_sun, sun_position, " + |
976 | "covenant, Sandbox, sunvectorx, sunvectory, " + | 976 | "covenant, Sandbox, sunvectorx, sunvectory, " + |
977 | "sunvectorz, loaded_creation_datetime, " + | 977 | "sunvectorz, loaded_creation_datetime, " + |
978 | "loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " + | 978 | "loaded_creation_id, map_tile_ID) values (?RegionUUID, ?BlockTerraform, " + |
979 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + | 979 | "?BlockFly, ?AllowDamage, ?RestrictPushing, " + |
980 | "?AllowLandResell, ?AllowLandJoinDivide, " + | 980 | "?AllowLandResell, ?AllowLandJoinDivide, " + |
981 | "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + | 981 | "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + |
@@ -989,7 +989,8 @@ namespace OpenSim.Data.MySQL | |||
989 | "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + | 989 | "?TerrainLowerLimit, ?UseEstateSun, ?FixedSun, " + |
990 | "?SunPosition, ?Covenant, ?Sandbox, " + | 990 | "?SunPosition, ?Covenant, ?Sandbox, " + |
991 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 991 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
992 | "?LoadedCreationDateTime, ?LoadedCreationID)"; | 992 | "?LoadedCreationDateTime, ?LoadedCreationID, " + |
993 | "?TerrainImageID)"; | ||
993 | 994 | ||
994 | FillRegionSettingsCommand(cmd, rs); | 995 | FillRegionSettingsCommand(cmd, rs); |
995 | 996 | ||
@@ -1276,6 +1277,8 @@ namespace OpenSim.Data.MySQL | |||
1276 | else | 1277 | else |
1277 | newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; | 1278 | newSettings.LoadedCreationID = (String) row["loaded_creation_id"]; |
1278 | 1279 | ||
1280 | newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]); | ||
1281 | |||
1279 | return newSettings; | 1282 | return newSettings; |
1280 | } | 1283 | } |
1281 | 1284 | ||
@@ -1596,6 +1599,7 @@ namespace OpenSim.Data.MySQL | |||
1596 | cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); | 1599 | cmd.Parameters.AddWithValue("Covenant", settings.Covenant.ToString()); |
1597 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); | 1600 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); |
1598 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); | 1601 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); |
1602 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); | ||
1599 | 1603 | ||
1600 | } | 1604 | } |
1601 | 1605 | ||
diff --git a/OpenSim/Data/MySQL/Resources/007_AssetStore.sql b/OpenSim/Data/MySQL/Resources/007_AssetStore.sql new file mode 100644 index 0000000..f06121a --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/007_AssetStore.sql | |||
@@ -0,0 +1,5 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0; | ||
4 | |||
5 | COMMIT; | ||
diff --git a/OpenSim/Data/MySQL/Resources/033_RegionStore.sql b/OpenSim/Data/MySQL/Resources/033_RegionStore.sql new file mode 100644 index 0000000..2832b41 --- /dev/null +++ b/OpenSim/Data/MySQL/Resources/033_RegionStore.sql | |||
@@ -0,0 +1,3 @@ | |||
1 | BEGIN; | ||
2 | ALTER TABLE regionsettings ADD map_tile_ID CHAR(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000'; | ||
3 | COMMIT; | ||
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs index 30ad747..d596698 100644 --- a/OpenSim/Data/Null/NullRegionData.cs +++ b/OpenSim/Data/Null/NullRegionData.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Data.Null | |||
40 | { | 40 | { |
41 | private static NullRegionData Instance = null; | 41 | private static NullRegionData Instance = null; |
42 | 42 | ||
43 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
44 | 44 | ||
45 | Dictionary<UUID, RegionData> m_regionData = new Dictionary<UUID, RegionData>(); | 45 | Dictionary<UUID, RegionData> m_regionData = new Dictionary<UUID, RegionData>(); |
46 | 46 | ||
@@ -62,12 +62,14 @@ namespace OpenSim.Data.Null | |||
62 | { | 62 | { |
63 | if (regionName.Contains("%")) | 63 | if (regionName.Contains("%")) |
64 | { | 64 | { |
65 | if (r.RegionName.Contains(regionName.Replace("%", ""))) | 65 | string cleanname = regionName.Replace("%", ""); |
66 | m_log.DebugFormat("[NULL REGION DATA]: comparing {0} to {1}", cleanname.ToLower(), r.RegionName.ToLower()); | ||
67 | if (r.RegionName.ToLower().Contains(cleanname.ToLower())) | ||
66 | ret.Add(r); | 68 | ret.Add(r); |
67 | } | 69 | } |
68 | else | 70 | else |
69 | { | 71 | { |
70 | if (r.RegionName == regionName) | 72 | if (r.RegionName.ToLower() == regionName.ToLower()) |
71 | ret.Add(r); | 73 | ret.Add(r); |
72 | } | 74 | } |
73 | } | 75 | } |
diff --git a/OpenSim/Data/SQLite/Resources/005_AssetStore.sql b/OpenSim/Data/SQLite/Resources/005_AssetStore.sql new file mode 100644 index 0000000..f06121a --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/005_AssetStore.sql | |||
@@ -0,0 +1,5 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE assets ADD COLUMN asset_flags INTEGER NOT NULL DEFAULT 0; | ||
4 | |||
5 | COMMIT; | ||
diff --git a/OpenSim/Data/SQLite/Resources/019_RegionStore.sql b/OpenSim/Data/SQLite/Resources/019_RegionStore.sql new file mode 100644 index 0000000..d62f848 --- /dev/null +++ b/OpenSim/Data/SQLite/Resources/019_RegionStore.sql | |||
@@ -0,0 +1,5 @@ | |||
1 | BEGIN; | ||
2 | |||
3 | ALTER TABLE regionsettings ADD COLUMN map_tile_ID varchar(36) NOT NULL default '00000000-0000-0000-0000-000000000000'; | ||
4 | |||
5 | COMMIT; \ No newline at end of file | ||
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 636bf86..7081f99 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -44,10 +44,10 @@ namespace OpenSim.Data.SQLite | |||
44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; | 46 | private const string SelectAssetSQL = "select * from assets where UUID=:UUID"; |
47 | private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, UUID from assets limit :start, :count"; | 47 | private const string SelectAssetMetadataSQL = "select Name, Description, Type, Temporary, asset_flags, UUID from assets limit :start, :count"; |
48 | private const string DeleteAssetSQL = "delete from assets where UUID=:UUID"; | 48 | private const string DeleteAssetSQL = "delete from assets where UUID=:UUID"; |
49 | private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, Local, Temporary, Data) values(:UUID, :Name, :Description, :Type, :Local, :Temporary, :Data)"; | 49 | private const string InsertAssetSQL = "insert into assets(UUID, Name, Description, Type, Local, Temporary, asset_flags, Data) values(:UUID, :Name, :Description, :Type, :Local, :Temporary, :Flags, :Data)"; |
50 | private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, Local=:Local, Temporary=:Temporary, Data=:Data where UUID=:UUID"; | 50 | private const string UpdateAssetSQL = "update assets set Name=:Name, Description=:Description, Type=:Type, Local=:Local, Temporary=:Temporary, asset_flags=:Flags, Data=:Data where UUID=:UUID"; |
51 | private const string assetSelect = "select * from assets"; | 51 | private const string assetSelect = "select * from assets"; |
52 | 52 | ||
53 | private SqliteConnection m_conn; | 53 | private SqliteConnection m_conn; |
@@ -136,6 +136,7 @@ namespace OpenSim.Data.SQLite | |||
136 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 136 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
137 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 137 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
138 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 138 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
139 | cmd.Parameters.Add(new SqliteParameter(":Flags", asset.Flags)); | ||
139 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 140 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
140 | 141 | ||
141 | cmd.ExecuteNonQuery(); | 142 | cmd.ExecuteNonQuery(); |
@@ -154,6 +155,7 @@ namespace OpenSim.Data.SQLite | |||
154 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); | 155 | cmd.Parameters.Add(new SqliteParameter(":Type", asset.Type)); |
155 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); | 156 | cmd.Parameters.Add(new SqliteParameter(":Local", asset.Local)); |
156 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); | 157 | cmd.Parameters.Add(new SqliteParameter(":Temporary", asset.Temporary)); |
158 | cmd.Parameters.Add(new SqliteParameter(":Flags", asset.Flags)); | ||
157 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); | 159 | cmd.Parameters.Add(new SqliteParameter(":Data", asset.Data)); |
158 | 160 | ||
159 | cmd.ExecuteNonQuery(); | 161 | cmd.ExecuteNonQuery(); |
@@ -208,20 +210,6 @@ namespace OpenSim.Data.SQLite | |||
208 | } | 210 | } |
209 | 211 | ||
210 | /// <summary> | 212 | /// <summary> |
211 | /// Delete an asset from database | ||
212 | /// </summary> | ||
213 | /// <param name="uuid"></param> | ||
214 | public void DeleteAsset(UUID uuid) | ||
215 | { | ||
216 | using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn)) | ||
217 | { | ||
218 | cmd.Parameters.Add(new SqliteParameter(":UUID", uuid.ToString())); | ||
219 | |||
220 | cmd.ExecuteNonQuery(); | ||
221 | } | ||
222 | } | ||
223 | |||
224 | /// <summary> | ||
225 | /// | 213 | /// |
226 | /// </summary> | 214 | /// </summary> |
227 | /// <param name="row"></param> | 215 | /// <param name="row"></param> |
@@ -241,7 +229,8 @@ namespace OpenSim.Data.SQLite | |||
241 | asset.Description = (String) row["Description"]; | 229 | asset.Description = (String) row["Description"]; |
242 | asset.Local = Convert.ToBoolean(row["Local"]); | 230 | asset.Local = Convert.ToBoolean(row["Local"]); |
243 | asset.Temporary = Convert.ToBoolean(row["Temporary"]); | 231 | asset.Temporary = Convert.ToBoolean(row["Temporary"]); |
244 | asset.Data = (byte[]) row["Data"]; | 232 | asset.Flags = (AssetFlags)Convert.ToInt32(row["asset_flags"]); |
233 | asset.Data = (byte[])row["Data"]; | ||
245 | return asset; | 234 | return asset; |
246 | } | 235 | } |
247 | 236 | ||
@@ -254,6 +243,7 @@ namespace OpenSim.Data.SQLite | |||
254 | metadata.Description = (string) row["Description"]; | 243 | metadata.Description = (string) row["Description"]; |
255 | metadata.Type = Convert.ToSByte(row["Type"]); | 244 | metadata.Type = Convert.ToSByte(row["Type"]); |
256 | metadata.Temporary = Convert.ToBoolean(row["Temporary"]); // Not sure if this is correct. | 245 | metadata.Temporary = Convert.ToBoolean(row["Temporary"]); // Not sure if this is correct. |
246 | metadata.Flags = (AssetFlags)Convert.ToInt32(row["asset_flags"]); | ||
257 | 247 | ||
258 | // Current SHA1s are not stored/computed. | 248 | // Current SHA1s are not stored/computed. |
259 | metadata.SHA1 = new byte[] {}; | 249 | metadata.SHA1 = new byte[] {}; |
@@ -338,6 +328,26 @@ namespace OpenSim.Data.SQLite | |||
338 | get { return "SQLite Asset storage engine"; } | 328 | get { return "SQLite Asset storage engine"; } |
339 | } | 329 | } |
340 | 330 | ||
331 | public override bool Delete(string id) | ||
332 | { | ||
333 | UUID assetID; | ||
334 | |||
335 | if (!UUID.TryParse(id, out assetID)) | ||
336 | return false; | ||
337 | |||
338 | lock (this) | ||
339 | { | ||
340 | using (SqliteCommand cmd = new SqliteCommand(DeleteAssetSQL, m_conn)) | ||
341 | { | ||
342 | cmd.Parameters.Add(new SqliteParameter(":UUID", assetID.ToString())); | ||
343 | |||
344 | cmd.ExecuteNonQuery(); | ||
345 | } | ||
346 | } | ||
347 | |||
348 | return true; | ||
349 | } | ||
350 | |||
341 | #endregion | 351 | #endregion |
342 | } | 352 | } |
343 | } | 353 | } |
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs index 997664a..85703dc 100644 --- a/OpenSim/Data/SQLite/SQLiteRegionData.cs +++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs | |||
@@ -1156,6 +1156,7 @@ namespace OpenSim.Data.SQLite | |||
1156 | createCol(regionsettings, "fixed_sun", typeof (Int32)); | 1156 | createCol(regionsettings, "fixed_sun", typeof (Int32)); |
1157 | createCol(regionsettings, "sun_position", typeof (Double)); | 1157 | createCol(regionsettings, "sun_position", typeof (Double)); |
1158 | createCol(regionsettings, "covenant", typeof(String)); | 1158 | createCol(regionsettings, "covenant", typeof(String)); |
1159 | createCol(regionsettings, "map_tile_ID", typeof(String)); | ||
1159 | regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] }; | 1160 | regionsettings.PrimaryKey = new DataColumn[] { regionsettings.Columns["regionUUID"] }; |
1160 | return regionsettings; | 1161 | return regionsettings; |
1161 | } | 1162 | } |
@@ -1474,6 +1475,7 @@ namespace OpenSim.Data.SQLite | |||
1474 | newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); | 1475 | newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]); |
1475 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); | 1476 | newSettings.SunPosition = Convert.ToDouble(row["sun_position"]); |
1476 | newSettings.Covenant = new UUID((String) row["covenant"]); | 1477 | newSettings.Covenant = new UUID((String) row["covenant"]); |
1478 | newSettings.TerrainImageID = new UUID((String)row["map_tile_ID"]); | ||
1477 | 1479 | ||
1478 | return newSettings; | 1480 | return newSettings; |
1479 | } | 1481 | } |
@@ -1792,6 +1794,7 @@ namespace OpenSim.Data.SQLite | |||
1792 | row["fixed_sun"] = settings.FixedSun; | 1794 | row["fixed_sun"] = settings.FixedSun; |
1793 | row["sun_position"] = settings.SunPosition; | 1795 | row["sun_position"] = settings.SunPosition; |
1794 | row["covenant"] = settings.Covenant.ToString(); | 1796 | row["covenant"] = settings.Covenant.ToString(); |
1797 | row["map_tile_ID"] = settings.TerrainImageID.ToString(); | ||
1795 | } | 1798 | } |
1796 | 1799 | ||
1797 | /// <summary> | 1800 | /// <summary> |
diff --git a/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs b/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs index 0d63dea..df50902 100644 --- a/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLiteLegacy/SQLiteAssetData.cs | |||
@@ -338,6 +338,10 @@ namespace OpenSim.Data.SQLiteLegacy | |||
338 | get { return "SQLite Asset storage engine"; } | 338 | get { return "SQLite Asset storage engine"; } |
339 | } | 339 | } |
340 | 340 | ||
341 | public override bool Delete(string id) | ||
342 | { | ||
343 | return false; | ||
344 | } | ||
341 | #endregion | 345 | #endregion |
342 | } | 346 | } |
343 | } \ No newline at end of file | 347 | } |
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs index 19ca232..53d28be 100644 --- a/OpenSim/Framework/AssetBase.cs +++ b/OpenSim/Framework/AssetBase.cs | |||
@@ -33,6 +33,15 @@ using OpenMetaverse; | |||
33 | 33 | ||
34 | namespace OpenSim.Framework | 34 | namespace OpenSim.Framework |
35 | { | 35 | { |
36 | [Flags] | ||
37 | public enum AssetFlags : int | ||
38 | { | ||
39 | Normal = 0, // Immutable asset | ||
40 | Maptile = 1, // What it says | ||
41 | Rewritable = 2, // Content can be rewritten | ||
42 | Collectable = 4 // Can be GC'ed after some time | ||
43 | } | ||
44 | |||
36 | /// <summary> | 45 | /// <summary> |
37 | /// Asset class. All Assets are reference by this class or a class derived from this class | 46 | /// Asset class. All Assets are reference by this class or a class derived from this class |
38 | /// </summary> | 47 | /// </summary> |
@@ -206,6 +215,12 @@ namespace OpenSim.Framework | |||
206 | set { m_metadata.Temporary = value; } | 215 | set { m_metadata.Temporary = value; } |
207 | } | 216 | } |
208 | 217 | ||
218 | public AssetFlags Flags | ||
219 | { | ||
220 | get { return m_metadata.Flags; } | ||
221 | set { m_metadata.Flags = value; } | ||
222 | } | ||
223 | |||
209 | [XmlIgnore] | 224 | [XmlIgnore] |
210 | public AssetMetadata Metadata | 225 | public AssetMetadata Metadata |
211 | { | 226 | { |
@@ -233,6 +248,7 @@ namespace OpenSim.Framework | |||
233 | private bool m_local; | 248 | private bool m_local; |
234 | private bool m_temporary; | 249 | private bool m_temporary; |
235 | private string m_creatorid; | 250 | private string m_creatorid; |
251 | private AssetFlags m_flags; | ||
236 | 252 | ||
237 | public UUID FullID | 253 | public UUID FullID |
238 | { | 254 | { |
@@ -330,5 +346,11 @@ namespace OpenSim.Framework | |||
330 | get { return m_creatorid; } | 346 | get { return m_creatorid; } |
331 | set { m_creatorid = value; } | 347 | set { m_creatorid = value; } |
332 | } | 348 | } |
349 | |||
350 | public AssetFlags Flags | ||
351 | { | ||
352 | get { return m_flags; } | ||
353 | set { m_flags = value; } | ||
354 | } | ||
333 | } | 355 | } |
334 | } | 356 | } |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index ba2c2de..f053911 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -365,7 +365,7 @@ namespace OpenSim | |||
365 | 365 | ||
366 | // moved these here as the terrain texture has to be created after the modules are initialized | 366 | // moved these here as the terrain texture has to be created after the modules are initialized |
367 | // and has to happen before the region is registered with the grid. | 367 | // and has to happen before the region is registered with the grid. |
368 | scene.CreateTerrainTexture(false); | 368 | scene.CreateTerrainTexture(); |
369 | 369 | ||
370 | // TODO : Try setting resource for region xstats here on scene | 370 | // TODO : Try setting resource for region xstats here on scene |
371 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); | 371 | MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs index 53d2cef..f8e3d59 100644 --- a/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Assets/GetTextureModule.cs | |||
@@ -121,6 +121,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
121 | UUID textureID; | 121 | UUID textureID; |
122 | if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID)) | 122 | if (!String.IsNullOrEmpty(textureStr) && UUID.TryParse(textureStr, out textureID)) |
123 | { | 123 | { |
124 | //m_log.DebugFormat("[GETTEXTURE]: {0}", textureID); | ||
124 | AssetBase texture; | 125 | AssetBase texture; |
125 | 126 | ||
126 | if (!String.IsNullOrEmpty(REDIRECT_URL)) | 127 | if (!String.IsNullOrEmpty(REDIRECT_URL)) |
@@ -167,6 +168,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
167 | private void SendTexture(OSHttpRequest request, OSHttpResponse response, AssetBase texture) | 168 | private void SendTexture(OSHttpRequest request, OSHttpResponse response, AssetBase texture) |
168 | { | 169 | { |
169 | string range = request.Headers.GetOne("Range"); | 170 | string range = request.Headers.GetOne("Range"); |
171 | //m_log.DebugFormat("[GETTEXTURE]: Range {0}", range); | ||
170 | if (!String.IsNullOrEmpty(range)) | 172 | if (!String.IsNullOrEmpty(range)) |
171 | { | 173 | { |
172 | // Range request | 174 | // Range request |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 57dde76..8f84d81 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -345,8 +345,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
345 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, new UUID(im.fromAgentID)); | 345 | UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(client.Scene.RegionInfo.ScopeID, new UUID(im.fromAgentID)); |
346 | im.fromAgentName = account.FirstName + " " + account.LastName; | 346 | im.fromAgentName = account.FirstName + " " + account.LastName; |
347 | 347 | ||
348 | PresenceInfo presence = null; | ||
348 | PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); | 349 | PresenceInfo[] presences = PresenceService.GetAgents(new string[] { fid }); |
349 | PresenceInfo presence = PresenceInfo.GetOnlinePresence(presences); | 350 | if (presences != null && presences.Length > 0) |
351 | presence = presences[0]; | ||
350 | if (presence != null) | 352 | if (presence != null) |
351 | im.offline = 0; | 353 | im.offline = 0; |
352 | 354 | ||
@@ -380,13 +382,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
380 | PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray()); | 382 | PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray()); |
381 | 383 | ||
382 | foreach (PresenceInfo pi in presence) | 384 | foreach (PresenceInfo pi in presence) |
383 | { | 385 | online.Add(new UUID(pi.UserID)); |
384 | if (pi.Online) | 386 | //m_log.DebugFormat("[XXX] {0} friend online {1}", userID, pi.UserID); |
385 | { | ||
386 | online.Add(new UUID(pi.UserID)); | ||
387 | //m_log.DebugFormat("[XXX] {0} friend online {1}", userID, pi.UserID); | ||
388 | } | ||
389 | } | ||
390 | 387 | ||
391 | return online; | 388 | return online; |
392 | } | 389 | } |
@@ -495,11 +492,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
495 | 492 | ||
496 | // The friend is not here [as root]. Let's forward. | 493 | // The friend is not here [as root]. Let's forward. |
497 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); | 494 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); |
498 | PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions); | 495 | if (friendSessions != null && friendSessions.Length > 0) |
499 | if (friendSession != null) | ||
500 | { | 496 | { |
501 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 497 | PresenceInfo friendSession = friendSessions[0]; |
502 | m_FriendsSimConnector.StatusNotify(region, userID, friendID, online); | 498 | if (friendSession != null) |
499 | { | ||
500 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | ||
501 | m_FriendsSimConnector.StatusNotify(region, userID, friendID, online); | ||
502 | } | ||
503 | } | 503 | } |
504 | 504 | ||
505 | // Friend is not online. Ignore. | 505 | // Friend is not online. Ignore. |
@@ -537,13 +537,15 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
537 | 537 | ||
538 | // The prospective friend is not here [as root]. Let's forward. | 538 | // The prospective friend is not here [as root]. Let's forward. |
539 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); | 539 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); |
540 | PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions); | 540 | if (friendSessions != null && friendSessions.Length > 0) |
541 | if (friendSession != null) | ||
542 | { | 541 | { |
543 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 542 | PresenceInfo friendSession = friendSessions[0]; |
544 | m_FriendsSimConnector.FriendshipOffered(region, agentID, friendID, im.message); | 543 | if (friendSession != null) |
544 | { | ||
545 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | ||
546 | m_FriendsSimConnector.FriendshipOffered(region, agentID, friendID, im.message); | ||
547 | } | ||
545 | } | 548 | } |
546 | |||
547 | // If the prospective friend is not online, he'll get the message upon login. | 549 | // If the prospective friend is not online, he'll get the message upon login. |
548 | } | 550 | } |
549 | 551 | ||
@@ -569,14 +571,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
569 | 571 | ||
570 | // The friend is not here | 572 | // The friend is not here |
571 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); | 573 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); |
572 | PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions); | 574 | if (friendSessions != null && friendSessions.Length > 0) |
573 | if (friendSession != null) | ||
574 | { | 575 | { |
575 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 576 | PresenceInfo friendSession = friendSessions[0]; |
576 | m_FriendsSimConnector.FriendshipApproved(region, agentID, client.Name, friendID); | 577 | if (friendSession != null) |
577 | client.SendAgentOnline(new UUID[] { friendID }); | 578 | { |
579 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | ||
580 | m_FriendsSimConnector.FriendshipApproved(region, agentID, client.Name, friendID); | ||
581 | client.SendAgentOnline(new UUID[] { friendID }); | ||
582 | } | ||
578 | } | 583 | } |
579 | |||
580 | } | 584 | } |
581 | 585 | ||
582 | private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) | 586 | private void OnDenyFriendRequest(IClientAPI client, UUID agentID, UUID friendID, List<UUID> callingCardFolders) |
@@ -595,11 +599,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
595 | return; | 599 | return; |
596 | 600 | ||
597 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); | 601 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); |
598 | PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions); | 602 | if (friendSessions != null && friendSessions.Length > 0) |
599 | if (friendSession != null) | ||
600 | { | 603 | { |
601 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 604 | PresenceInfo friendSession = friendSessions[0]; |
602 | m_FriendsSimConnector.FriendshipDenied(region, agentID, client.Name, friendID); | 605 | if (friendSession != null) |
606 | { | ||
607 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | ||
608 | m_FriendsSimConnector.FriendshipDenied(region, agentID, client.Name, friendID); | ||
609 | } | ||
603 | } | 610 | } |
604 | } | 611 | } |
605 | 612 | ||
@@ -622,11 +629,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
622 | return; | 629 | return; |
623 | 630 | ||
624 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() }); | 631 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { exfriendID.ToString() }); |
625 | PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions); | 632 | if (friendSessions != null && friendSessions.Length > 0) |
626 | if (friendSession != null) | ||
627 | { | 633 | { |
628 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 634 | PresenceInfo friendSession = friendSessions[0]; |
629 | m_FriendsSimConnector.FriendshipTerminated(region, agentID, exfriendID); | 635 | if (friendSession != null) |
636 | { | ||
637 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | ||
638 | m_FriendsSimConnector.FriendshipTerminated(region, agentID, exfriendID); | ||
639 | } | ||
630 | } | 640 | } |
631 | } | 641 | } |
632 | 642 | ||
@@ -664,13 +674,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
664 | return; | 674 | return; |
665 | 675 | ||
666 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { target.ToString() }); | 676 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { target.ToString() }); |
667 | PresenceInfo friendSession = PresenceInfo.GetOnlinePresence(friendSessions); | 677 | if (friendSessions != null && friendSessions.Length > 0) |
668 | if (friendSession != null) | ||
669 | { | 678 | { |
670 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); | 679 | PresenceInfo friendSession = friendSessions[0]; |
671 | // TODO: You might want to send the delta to save the lookup | 680 | if (friendSession != null) |
672 | // on the other end!! | 681 | { |
673 | m_FriendsSimConnector.GrantRights(region, requester, target, myFlags, rights); | 682 | GridRegion region = GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, friendSession.RegionID); |
683 | // TODO: You might want to send the delta to save the lookup | ||
684 | // on the other end!! | ||
685 | m_FriendsSimConnector.GrantRights(region, requester, target, myFlags, rights); | ||
686 | } | ||
674 | } | 687 | } |
675 | } | 688 | } |
676 | } | 689 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index ad050a1..5d20e63 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -471,7 +471,6 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
471 | if (m_UserRegionMap.ContainsKey(toAgentID)) | 471 | if (m_UserRegionMap.ContainsKey(toAgentID)) |
472 | { | 472 | { |
473 | upd = new PresenceInfo(); | 473 | upd = new PresenceInfo(); |
474 | upd.Online = true; | ||
475 | upd.RegionID = m_UserRegionMap[toAgentID]; | 474 | upd.RegionID = m_UserRegionMap[toAgentID]; |
476 | 475 | ||
477 | // We need to compare the current regionhandle with the previous region handle | 476 | // We need to compare the current regionhandle with the previous region handle |
@@ -493,15 +492,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
493 | { | 492 | { |
494 | // Non-cached user agent lookup. | 493 | // Non-cached user agent lookup. |
495 | PresenceInfo[] presences = PresenceService.GetAgents(new string[] { toAgentID.ToString() }); | 494 | PresenceInfo[] presences = PresenceService.GetAgents(new string[] { toAgentID.ToString() }); |
496 | if (presences != null) | 495 | if (presences != null && presences.Length > 0) |
497 | { | 496 | upd = presences[0]; |
498 | foreach (PresenceInfo p in presences) | ||
499 | if (p.Online) | ||
500 | { | ||
501 | upd = presences[0]; | ||
502 | break; | ||
503 | } | ||
504 | } | ||
505 | 497 | ||
506 | if (upd != null) | 498 | if (upd != null) |
507 | { | 499 | { |
@@ -525,61 +517,53 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
525 | 517 | ||
526 | if (upd != null) | 518 | if (upd != null) |
527 | { | 519 | { |
528 | if (upd.Online) | 520 | GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, |
521 | upd.RegionID); | ||
522 | if (reginfo != null) | ||
529 | { | 523 | { |
530 | GridRegion reginfo = m_Scenes[0].GridService.GetRegionByUUID(m_Scenes[0].RegionInfo.ScopeID, | 524 | Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(im); |
531 | upd.RegionID); | 525 | // Not actually used anymore, left in for compatibility |
532 | if (reginfo != null) | 526 | // Remove at next interface change |
527 | // | ||
528 | msgdata["region_handle"] = 0; | ||
529 | bool imresult = doIMSending(reginfo, msgdata); | ||
530 | if (imresult) | ||
533 | { | 531 | { |
534 | Hashtable msgdata = ConvertGridInstantMessageToXMLRPC(im); | 532 | // IM delivery successful, so store the Agent's location in our local cache. |
535 | // Not actually used anymore, left in for compatibility | 533 | lock (m_UserRegionMap) |
536 | // Remove at next interface change | ||
537 | // | ||
538 | msgdata["region_handle"] = 0; | ||
539 | bool imresult = doIMSending(reginfo, msgdata); | ||
540 | if (imresult) | ||
541 | { | 534 | { |
542 | // IM delivery successful, so store the Agent's location in our local cache. | 535 | if (m_UserRegionMap.ContainsKey(toAgentID)) |
543 | lock (m_UserRegionMap) | ||
544 | { | 536 | { |
545 | if (m_UserRegionMap.ContainsKey(toAgentID)) | 537 | m_UserRegionMap[toAgentID] = upd.RegionID; |
546 | { | 538 | } |
547 | m_UserRegionMap[toAgentID] = upd.RegionID; | 539 | else |
548 | } | 540 | { |
549 | else | 541 | m_UserRegionMap.Add(toAgentID, upd.RegionID); |
550 | { | ||
551 | m_UserRegionMap.Add(toAgentID, upd.RegionID); | ||
552 | } | ||
553 | } | 542 | } |
554 | result(true); | ||
555 | } | ||
556 | else | ||
557 | { | ||
558 | // try again, but lookup user this time. | ||
559 | // Warning, this must call the Async version | ||
560 | // of this method or we'll be making thousands of threads | ||
561 | // The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync | ||
562 | // The version that spawns the thread is SendGridInstantMessageViaXMLRPC | ||
563 | |||
564 | // This is recursive!!!!! | ||
565 | SendGridInstantMessageViaXMLRPCAsync(im, result, | ||
566 | upd.RegionID); | ||
567 | } | 543 | } |
544 | result(true); | ||
568 | } | 545 | } |
569 | else | 546 | else |
570 | { | 547 | { |
571 | m_log.WarnFormat("[GRID INSTANT MESSAGE]: Unable to find region {0}", upd.RegionID); | 548 | // try again, but lookup user this time. |
572 | HandleUndeliveredMessage(im, result); | 549 | // Warning, this must call the Async version |
550 | // of this method or we'll be making thousands of threads | ||
551 | // The version within the spawned thread is SendGridInstantMessageViaXMLRPCAsync | ||
552 | // The version that spawns the thread is SendGridInstantMessageViaXMLRPC | ||
553 | |||
554 | // This is recursive!!!!! | ||
555 | SendGridInstantMessageViaXMLRPCAsync(im, result, | ||
556 | upd.RegionID); | ||
573 | } | 557 | } |
574 | } | 558 | } |
575 | else | 559 | else |
576 | { | 560 | { |
561 | m_log.WarnFormat("[GRID INSTANT MESSAGE]: Unable to find region {0}", upd.RegionID); | ||
577 | HandleUndeliveredMessage(im, result); | 562 | HandleUndeliveredMessage(im, result); |
578 | } | 563 | } |
579 | } | 564 | } |
580 | else | 565 | else |
581 | { | 566 | { |
582 | m_log.WarnFormat("[GRID INSTANT MESSAGE]: Unable to find user {0}", toAgentID); | ||
583 | HandleUndeliveredMessage(im, result); | 567 | HandleUndeliveredMessage(im, result); |
584 | } | 568 | } |
585 | } | 569 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs index bafad82..dd17f3c 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/PresenceModule.cs | |||
@@ -133,20 +133,14 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
133 | foreach (PresenceInfo pi in status) | 133 | foreach (PresenceInfo pi in status) |
134 | { | 134 | { |
135 | UUID uuid = new UUID(pi.UserID); | 135 | UUID uuid = new UUID(pi.UserID); |
136 | if (pi.Online) | 136 | if (!online.Contains(uuid)) |
137 | { | 137 | online.Add(uuid); |
138 | if (!online.Contains(uuid)) | 138 | } |
139 | { | 139 | foreach (string s in args) |
140 | online.Add(uuid); | 140 | { |
141 | if (offline.Contains(uuid)) | 141 | UUID uuid = new UUID(s); |
142 | offline.Remove(uuid); | 142 | if (!online.Contains(uuid) && !offline.Contains(uuid)) |
143 | } | 143 | offline.Add(uuid); |
144 | } | ||
145 | else | ||
146 | { | ||
147 | if (!online.Contains(uuid) && !offline.Contains(uuid)) | ||
148 | offline.Add(uuid); | ||
149 | } | ||
150 | } | 144 | } |
151 | 145 | ||
152 | if (online.Count > 0) | 146 | if (online.Count > 0) |
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs index 137dfec..7d26e3f 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs | |||
@@ -245,6 +245,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
245 | return; | 245 | return; |
246 | } | 246 | } |
247 | 247 | ||
248 | // Let's find out if this is a foreign user or a local user | ||
249 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, obj.AgentId); | ||
250 | if (account != null) | ||
251 | { | ||
252 | // local grid user | ||
253 | return; | ||
254 | } | ||
255 | |||
248 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); | 256 | AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); |
249 | 257 | ||
250 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) | 258 | if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index d44ddf4..46741a5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -197,7 +197,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
197 | if (grinfo != null) | 197 | if (grinfo != null) |
198 | { | 198 | { |
199 | //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetRegionsByName {0} found {1} regions", name, grinfo.Count); | 199 | //m_log.DebugFormat("[REMOTE GRID CONNECTOR]: Remote GetRegionsByName {0} found {1} regions", name, grinfo.Count); |
200 | rinfo.AddRange(grinfo); | 200 | foreach (GridRegion r in grinfo) |
201 | if (rinfo.Find(delegate(GridRegion gr) { return gr.RegionID == r.RegionID; }) == null) | ||
202 | rinfo.Add(r); | ||
201 | } | 203 | } |
202 | 204 | ||
203 | return rinfo; | 205 | return rinfo; |
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index 2b0e83f..ac6a633 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | |||
@@ -1000,7 +1000,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1000 | return responsemap; | 1000 | return responsemap; |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | public void LazySaveGeneratedMaptile(byte[] data, bool temporary) | 1003 | public void RegenerateMaptile(byte[] data) |
1004 | { | 1004 | { |
1005 | // Overwrites the local Asset cache with new maptile data | 1005 | // Overwrites the local Asset cache with new maptile data |
1006 | // Assets are single write, this causes the asset server to ignore this update, | 1006 | // Assets are single write, this causes the asset server to ignore this update, |
@@ -1010,7 +1010,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1010 | // map tile while protecting the (grid) asset database from bloat caused by a new asset each | 1010 | // map tile while protecting the (grid) asset database from bloat caused by a new asset each |
1011 | // time a mapimage is generated! | 1011 | // time a mapimage is generated! |
1012 | 1012 | ||
1013 | UUID lastMapRegionUUID = m_scene.RegionInfo.lastMapUUID; | 1013 | UUID lastMapRegionUUID = m_scene.RegionInfo.RegionSettings.TerrainImageID; |
1014 | 1014 | ||
1015 | int lastMapRefresh = 0; | 1015 | int lastMapRefresh = 0; |
1016 | int twoDays = 172800; | 1016 | int twoDays = 172800; |
@@ -1030,21 +1030,9 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1030 | { | 1030 | { |
1031 | } | 1031 | } |
1032 | 1032 | ||
1033 | UUID TerrainImageUUID = UUID.Random(); | 1033 | m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE"); |
1034 | 1034 | ||
1035 | if (lastMapRegionUUID == UUID.Zero || (lastMapRefresh + RefreshSeconds) < Util.UnixTimeSinceEpoch()) | 1035 | m_scene.RegionInfo.RegionSettings.TerrainImageID = UUID.Random(); |
1036 | { | ||
1037 | m_scene.RegionInfo.SaveLastMapUUID(TerrainImageUUID); | ||
1038 | |||
1039 | m_log.Debug("[MAPTILE]: STORING MAPTILE IMAGE"); | ||
1040 | } | ||
1041 | else | ||
1042 | { | ||
1043 | TerrainImageUUID = lastMapRegionUUID; | ||
1044 | m_log.Debug("[MAPTILE]: REUSING OLD MAPTILE IMAGE ID"); | ||
1045 | } | ||
1046 | |||
1047 | m_scene.RegionInfo.RegionSettings.TerrainImageID = TerrainImageUUID; | ||
1048 | 1036 | ||
1049 | AssetBase asset = new AssetBase( | 1037 | AssetBase asset = new AssetBase( |
1050 | m_scene.RegionInfo.RegionSettings.TerrainImageID, | 1038 | m_scene.RegionInfo.RegionSettings.TerrainImageID, |
@@ -1053,8 +1041,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap | |||
1053 | m_scene.RegionInfo.RegionID.ToString()); | 1041 | m_scene.RegionInfo.RegionID.ToString()); |
1054 | asset.Data = data; | 1042 | asset.Data = data; |
1055 | asset.Description = m_scene.RegionInfo.RegionName; | 1043 | asset.Description = m_scene.RegionInfo.RegionName; |
1056 | asset.Temporary = temporary; | 1044 | asset.Temporary = false; |
1045 | asset.Flags = AssetFlags.Maptile; | ||
1046 | |||
1047 | // Store the new one | ||
1048 | m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID); | ||
1057 | m_scene.AssetService.Store(asset); | 1049 | m_scene.AssetService.Store(asset); |
1050 | m_scene.RegionInfo.RegionSettings.Save(); | ||
1051 | |||
1052 | // Delete the old one | ||
1053 | m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastMapRegionUUID); | ||
1054 | m_scene.AssetService.Delete(lastMapRegionUUID.ToString()); | ||
1058 | } | 1055 | } |
1059 | 1056 | ||
1060 | private void MakeRootAgent(ScenePresence avatar) | 1057 | private void MakeRootAgent(ScenePresence avatar) |
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs index de1bcd4..ac6afed 100644 --- a/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IWorldMapModule.cs | |||
@@ -29,6 +29,6 @@ namespace OpenSim.Region.Framework.Interfaces | |||
29 | { | 29 | { |
30 | public interface IWorldMapModule | 30 | public interface IWorldMapModule |
31 | { | 31 | { |
32 | void LazySaveGeneratedMaptile(byte[] data, bool temporary); | 32 | void RegenerateMaptile(byte[] data); |
33 | } | 33 | } |
34 | } | 34 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 122ed02..e920ff5 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1851,7 +1851,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1851 | /// <summary> | 1851 | /// <summary> |
1852 | /// Create a terrain texture for this scene | 1852 | /// Create a terrain texture for this scene |
1853 | /// </summary> | 1853 | /// </summary> |
1854 | public void CreateTerrainTexture(bool temporary) | 1854 | public void CreateTerrainTexture() |
1855 | { | 1855 | { |
1856 | //create a texture asset of the terrain | 1856 | //create a texture asset of the terrain |
1857 | IMapImageGenerator terrain = RequestModuleInterface<IMapImageGenerator>(); | 1857 | IMapImageGenerator terrain = RequestModuleInterface<IMapImageGenerator>(); |
@@ -1869,7 +1869,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1869 | IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); | 1869 | IWorldMapModule mapModule = RequestModuleInterface<IWorldMapModule>(); |
1870 | 1870 | ||
1871 | if (mapModule != null) | 1871 | if (mapModule != null) |
1872 | mapModule.LazySaveGeneratedMaptile(data, temporary); | 1872 | mapModule.RegenerateMaptile(data); |
1873 | else | ||
1874 | m_log.DebugFormat("[SCENE]: MapModule is null, can't save maptile"); | ||
1873 | } | 1875 | } |
1874 | } | 1876 | } |
1875 | 1877 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6ab3c62..68f6e7b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4108,8 +4108,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4108 | 4108 | ||
4109 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); | 4109 | UserAccount account = World.UserAccountService.GetUserAccount(World.RegionInfo.ScopeID, uuid); |
4110 | 4110 | ||
4111 | PresenceInfo pinfo = null; | ||
4111 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); | 4112 | PresenceInfo[] pinfos = World.PresenceService.GetAgents(new string[] { uuid.ToString() }); |
4112 | PresenceInfo pinfo = PresenceInfo.GetOnlinePresence(pinfos); | 4113 | if (pinfos != null && pinfos.Length > 0) |
4114 | pinfo = pinfos[0]; | ||
4113 | 4115 | ||
4114 | if (pinfo == null) | 4116 | if (pinfo == null) |
4115 | return UUID.Zero.ToString(); | 4117 | return UUID.Zero.ToString(); |
@@ -5822,7 +5824,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
5822 | public LSL_String llGetLandOwnerAt(LSL_Vector pos) | 5824 | public LSL_String llGetLandOwnerAt(LSL_Vector pos) |
5823 | { | 5825 | { |
5824 | m_host.AddScriptLPS(1); | 5826 | m_host.AddScriptLPS(1); |
5825 | return World.LandChannel.GetLandObject((float)pos.x, (float)pos.y).LandData.OwnerID.ToString(); | 5827 | ILandObject land = World.LandChannel.GetLandObject((float)pos.x, (float)pos.y); |
5828 | if (land == null) | ||
5829 | return UUID.Zero.ToString(); | ||
5830 | return land.LandData.OwnerID.ToString(); | ||
5826 | } | 5831 | } |
5827 | 5832 | ||
5828 | /// <summary> | 5833 | /// <summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs index d354fde..a5b1124 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs | |||
@@ -485,7 +485,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
485 | } | 485 | } |
486 | else | 486 | else |
487 | { | 487 | { |
488 | // If full circle is asked for, just add it | ||
489 | sensedEntities.Add(new SensedEntity(dis, presence.UUID)); | 488 | sensedEntities.Add(new SensedEntity(dis, presence.UUID)); |
490 | } | 489 | } |
491 | } | 490 | } |
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs index f7eb292..b6425f4 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs | |||
@@ -59,9 +59,11 @@ namespace OpenSim.Server.Handlers.Asset | |||
59 | m_AssetService = | 59 | m_AssetService = |
60 | ServerUtils.LoadPlugin<IAssetService>(assetService, args); | 60 | ServerUtils.LoadPlugin<IAssetService>(assetService, args); |
61 | 61 | ||
62 | bool allowDelete = serverConfig.GetBoolean("AllowRemoteDelete", false); | ||
63 | |||
62 | server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); | 64 | server.AddStreamHandler(new AssetServerGetHandler(m_AssetService)); |
63 | server.AddStreamHandler(new AssetServerPostHandler(m_AssetService)); | 65 | server.AddStreamHandler(new AssetServerPostHandler(m_AssetService)); |
64 | server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService)); | 66 | server.AddStreamHandler(new AssetServerDeleteHandler(m_AssetService, allowDelete)); |
65 | } | 67 | } |
66 | } | 68 | } |
67 | } | 69 | } |
diff --git a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs index f33bb90..8014fb5 100644 --- a/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerDeleteHandler.cs | |||
@@ -47,11 +47,13 @@ namespace OpenSim.Server.Handlers.Asset | |||
47 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
48 | 48 | ||
49 | private IAssetService m_AssetService; | 49 | private IAssetService m_AssetService; |
50 | protected bool m_allowDelete; | ||
50 | 51 | ||
51 | public AssetServerDeleteHandler(IAssetService service) : | 52 | public AssetServerDeleteHandler(IAssetService service, bool allowDelete) : |
52 | base("DELETE", "/assets") | 53 | base("DELETE", "/assets") |
53 | { | 54 | { |
54 | m_AssetService = service; | 55 | m_AssetService = service; |
56 | m_allowDelete = allowDelete; | ||
55 | } | 57 | } |
56 | 58 | ||
57 | public override byte[] Handle(string path, Stream request, | 59 | public override byte[] Handle(string path, Stream request, |
@@ -61,9 +63,9 @@ namespace OpenSim.Server.Handlers.Asset | |||
61 | 63 | ||
62 | string[] p = SplitParams(path); | 64 | string[] p = SplitParams(path); |
63 | 65 | ||
64 | if (p.Length > 0) | 66 | if (p.Length > 0 && m_allowDelete) |
65 | { | 67 | { |
66 | // result = m_AssetService.Delete(p[0]); | 68 | result = m_AssetService.Delete(p[0]); |
67 | } | 69 | } |
68 | 70 | ||
69 | XmlSerializer xs = new XmlSerializer(typeof(bool)); | 71 | XmlSerializer xs = new XmlSerializer(typeof(bool)); |
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index 4e512e7..470a4dd 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs | |||
@@ -156,6 +156,22 @@ namespace OpenSim.Services.AssetService | |||
156 | 156 | ||
157 | public bool Delete(string id) | 157 | public bool Delete(string id) |
158 | { | 158 | { |
159 | m_log.DebugFormat("[ASSET SERVICE]: Deleting asset {0}", id); | ||
160 | UUID assetID; | ||
161 | if (!UUID.TryParse(id, out assetID)) | ||
162 | return false; | ||
163 | |||
164 | AssetBase asset = m_Database.GetAsset(assetID); | ||
165 | if (asset == null) | ||
166 | return false; | ||
167 | |||
168 | if ((int)(asset.Flags & AssetFlags.Maptile) != 0) | ||
169 | { | ||
170 | return m_Database.Delete(id); | ||
171 | } | ||
172 | else | ||
173 | m_log.DebugFormat("[ASSET SERVICE]: Request to delete asset {0}, but flags are not Maptile", id); | ||
174 | |||
159 | return false; | 175 | return false; |
160 | } | 176 | } |
161 | 177 | ||
@@ -181,6 +197,7 @@ namespace OpenSim.Services.AssetService | |||
181 | MainConsole.Instance.Output(String.Format("Description: {0}", asset.Description)); | 197 | MainConsole.Instance.Output(String.Format("Description: {0}", asset.Description)); |
182 | MainConsole.Instance.Output(String.Format("Type: {0}", asset.Type)); | 198 | MainConsole.Instance.Output(String.Format("Type: {0}", asset.Type)); |
183 | MainConsole.Instance.Output(String.Format("Content-type: {0}", asset.Metadata.ContentType)); | 199 | MainConsole.Instance.Output(String.Format("Content-type: {0}", asset.Metadata.ContentType)); |
200 | MainConsole.Instance.Output(String.Format("Flags: {0}", asset.Metadata.Flags.ToString())); | ||
184 | 201 | ||
185 | for (i = 0 ; i < 5 ; i++) | 202 | for (i = 0 ; i < 5 ; i++) |
186 | { | 203 | { |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index e48b7de..b86c45c 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs | |||
@@ -511,20 +511,8 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
511 | 511 | ||
512 | PresenceInfo info = new PresenceInfo(); | 512 | PresenceInfo info = new PresenceInfo(); |
513 | 513 | ||
514 | info.Online = true; | ||
515 | info.UserID = sessionResponse["UserID"].AsUUID().ToString(); | 514 | info.UserID = sessionResponse["UserID"].AsUUID().ToString(); |
516 | info.RegionID = sessionResponse["SceneID"].AsUUID(); | 515 | info.RegionID = sessionResponse["SceneID"].AsUUID(); |
517 | info.Position = sessionResponse["ScenePosition"].AsVector3(); | ||
518 | info.LookAt = sessionResponse["SceneLookAt"].AsVector3(); | ||
519 | |||
520 | if (userResponse != null && userResponse["User"] is OSDMap) | ||
521 | { | ||
522 | OSDMap user = (OSDMap)userResponse["User"]; | ||
523 | |||
524 | info.Login = user["LastLoginDate"].AsDate(); | ||
525 | info.Logout = user["LastLogoutDate"].AsDate(); | ||
526 | DeserializeLocation(user["HomeLocation"].AsString(), out info.HomeRegionID, out info.HomePosition, out info.HomeLookAt); | ||
527 | } | ||
528 | 516 | ||
529 | return info; | 517 | return info; |
530 | } | 518 | } |
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 4089fce..7c98642 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -324,6 +324,7 @@ namespace OpenSim.Services.GridService | |||
324 | 324 | ||
325 | if (rdatas != null) | 325 | if (rdatas != null) |
326 | { | 326 | { |
327 | m_log.DebugFormat("[GRID SERVICE]: Found {0} regions", rdatas.Count); | ||
327 | foreach (RegionData rdata in rdatas) | 328 | foreach (RegionData rdata in rdatas) |
328 | { | 329 | { |
329 | if (count++ < maxNumber) | 330 | if (count++ < maxNumber) |
@@ -331,7 +332,7 @@ namespace OpenSim.Services.GridService | |||
331 | } | 332 | } |
332 | } | 333 | } |
333 | 334 | ||
334 | if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0) && name.Contains("."))) | 335 | if (m_AllowHypergridMapSearch && (rdatas == null || (rdatas != null && rdatas.Count == 0)) && name.Contains(".")) |
335 | { | 336 | { |
336 | GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name); | 337 | GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name); |
337 | if (r != null) | 338 | if (r != null) |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 3af7ef9..64f7e8a 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -185,6 +185,10 @@ namespace OpenSim.Services.HypergridService | |||
185 | foreach (UUID session in travels) | 185 | foreach (UUID session in travels) |
186 | m_TravelingAgents.Remove(session); | 186 | m_TravelingAgents.Remove(session); |
187 | } | 187 | } |
188 | |||
189 | GridUserInfo guinfo = m_GridUserService.GetGridUserInfo(userID.ToString()); | ||
190 | if (guinfo != null) | ||
191 | m_GridUserService.LoggedOut(userID.ToString(), guinfo.LastRegionID, guinfo.LastPosition, guinfo.LastLookAt); | ||
188 | } | 192 | } |
189 | 193 | ||
190 | // We need to prevent foreign users with the same UUID as a local user | 194 | // We need to prevent foreign users with the same UUID as a local user |
diff --git a/OpenSim/Services/Interfaces/IPresenceService.cs b/OpenSim/Services/Interfaces/IPresenceService.cs index abbae2c..8d583ff 100644 --- a/OpenSim/Services/Interfaces/IPresenceService.cs +++ b/OpenSim/Services/Interfaces/IPresenceService.cs | |||
@@ -36,14 +36,6 @@ namespace OpenSim.Services.Interfaces | |||
36 | { | 36 | { |
37 | public string UserID; | 37 | public string UserID; |
38 | public UUID RegionID; | 38 | public UUID RegionID; |
39 | public bool Online; | ||
40 | public DateTime Login; | ||
41 | public DateTime Logout; | ||
42 | public Vector3 Position; | ||
43 | public Vector3 LookAt; | ||
44 | public UUID HomeRegionID; | ||
45 | public Vector3 HomePosition; | ||
46 | public Vector3 HomeLookAt; | ||
47 | 39 | ||
48 | public PresenceInfo() | 40 | public PresenceInfo() |
49 | { | 41 | { |
@@ -65,26 +57,6 @@ namespace OpenSim.Services.Interfaces | |||
65 | 57 | ||
66 | return result; | 58 | return result; |
67 | } | 59 | } |
68 | |||
69 | public static PresenceInfo[] GetOnlinePresences(PresenceInfo[] pinfos) | ||
70 | { | ||
71 | if (pinfos == null) | ||
72 | return null; | ||
73 | |||
74 | List<PresenceInfo> lst = new List<PresenceInfo>(pinfos); | ||
75 | lst = lst.FindAll(delegate(PresenceInfo each) { return each.Online; }); | ||
76 | |||
77 | return lst.ToArray(); | ||
78 | } | ||
79 | |||
80 | public static PresenceInfo GetOnlinePresence(PresenceInfo[] pinfos) | ||
81 | { | ||
82 | pinfos = GetOnlinePresences(pinfos); | ||
83 | if (pinfos != null && pinfos.Length >= 1) | ||
84 | return pinfos[0]; | ||
85 | |||
86 | return null; | ||
87 | } | ||
88 | } | 60 | } |
89 | 61 | ||
90 | public interface IPresenceService | 62 | public interface IPresenceService |
diff --git a/OpenSim/Services/PresenceService/PresenceService.cs b/OpenSim/Services/PresenceService/PresenceService.cs index 7e7e98e..19f636a 100644 --- a/OpenSim/Services/PresenceService/PresenceService.cs +++ b/OpenSim/Services/PresenceService/PresenceService.cs | |||
@@ -115,10 +115,6 @@ namespace OpenSim.Services.PresenceService | |||
115 | 115 | ||
116 | ret.UserID = data.UserID; | 116 | ret.UserID = data.UserID; |
117 | ret.RegionID = data.RegionID; | 117 | ret.RegionID = data.RegionID; |
118 | if (data.Data.ContainsKey("Position")) | ||
119 | ret.Position = Vector3.Parse(data.Data["Position"]); | ||
120 | if (data.Data.ContainsKey("LookAt")) | ||
121 | ret.LookAt = Vector3.Parse(data.Data["LookAt"]); | ||
122 | 118 | ||
123 | return ret; | 119 | return ret; |
124 | } | 120 | } |
@@ -138,8 +134,6 @@ namespace OpenSim.Services.PresenceService | |||
138 | 134 | ||
139 | ret.UserID = d.UserID; | 135 | ret.UserID = d.UserID; |
140 | ret.RegionID = d.RegionID; | 136 | ret.RegionID = d.RegionID; |
141 | ret.Position = Vector3.Parse(d.Data["Position"]); | ||
142 | ret.LookAt = Vector3.Parse(d.Data["LookAt"]); | ||
143 | 137 | ||
144 | info.Add(ret); | 138 | info.Add(ret); |
145 | } | 139 | } |
diff --git a/OpenSim/Tests/Clients/Presence/PresenceClient.cs b/OpenSim/Tests/Clients/Presence/PresenceClient.cs index 0f6b80e..fd3905a 100644 --- a/OpenSim/Tests/Clients/Presence/PresenceClient.cs +++ b/OpenSim/Tests/Clients/Presence/PresenceClient.cs | |||
@@ -73,8 +73,8 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
73 | if (pinfo == null) | 73 | if (pinfo == null) |
74 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0}", user1); | 74 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0}", user1); |
75 | else | 75 | else |
76 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}", | 76 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={1}", |
77 | pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID); | 77 | pinfo.UserID, pinfo.RegionID); |
78 | 78 | ||
79 | System.Console.WriteLine("\n"); | 79 | System.Console.WriteLine("\n"); |
80 | success = m_Connector.ReportAgent(session1, region1); | 80 | success = m_Connector.ReportAgent(session1, region1); |
@@ -86,8 +86,8 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
86 | if (pinfo == null) | 86 | if (pinfo == null) |
87 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for second time", user1); | 87 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for second time", user1); |
88 | else | 88 | else |
89 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}", | 89 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={2}", |
90 | pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID); | 90 | pinfo.UserID, pinfo.RegionID); |
91 | 91 | ||
92 | System.Console.WriteLine("\n"); | 92 | System.Console.WriteLine("\n"); |
93 | success = m_Connector.LogoutAgent(session1); | 93 | success = m_Connector.LogoutAgent(session1); |
@@ -99,8 +99,8 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
99 | if (pinfo == null) | 99 | if (pinfo == null) |
100 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for fourth time", user1); | 100 | m_log.InfoFormat("[PRESENCE CLIENT]: Unable to retrieve presence for {0} for fourth time", user1); |
101 | else | 101 | else |
102 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; Online={1}; regionID={2}; homeRegion={3}", | 102 | m_log.InfoFormat("[PRESENCE CLIENT]: Presence retrieved correctly: userID={0}; regionID={1}", |
103 | pinfo.UserID, pinfo.Online, pinfo.RegionID, pinfo.HomeRegionID); | 103 | pinfo.UserID, pinfo.RegionID); |
104 | 104 | ||
105 | System.Console.WriteLine("\n"); | 105 | System.Console.WriteLine("\n"); |
106 | success = m_Connector.ReportAgent(session1, UUID.Random()); | 106 | success = m_Connector.ReportAgent(session1, UUID.Random()); |
diff --git a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs index cc1dfbf..4a15cf2 100644 --- a/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs +++ b/OpenSim/Tests/Common/Mock/MockAssetDataPlugin.cs | |||
@@ -60,5 +60,10 @@ namespace OpenSim.Tests.Common.Mock | |||
60 | } | 60 | } |
61 | 61 | ||
62 | public List<AssetMetadata> FetchAssetMetadataSet(int start, int count) { return new List<AssetMetadata>(count); } | 62 | public List<AssetMetadata> FetchAssetMetadataSet(int start, int count) { return new List<AssetMetadata>(count); } |
63 | |||
64 | public bool Delete(string id) | ||
65 | { | ||
66 | return false; | ||
67 | } | ||
63 | } | 68 | } |
64 | } \ No newline at end of file | 69 | } |