Compare commits
236 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
33c14cb107 | ||
|
|
1e4180fc93 | ||
|
|
a4dca88a57 | ||
|
|
a2009ffe2e | ||
|
|
59b6f6a6e0 | ||
|
|
bece2023e7 | ||
|
|
9497a7c7bd | ||
|
|
922d8c9312 | ||
|
|
6e8f80f1ab | ||
|
|
05bb2e4275 | ||
|
|
05a1493fff | ||
|
|
421b562a04 | ||
|
|
78e992dbd0 | ||
|
|
b19be657b6 | ||
|
|
aa881e8065 | ||
|
|
34f6f87b6c | ||
|
|
8550a4a07e | ||
|
|
c386b68373 | ||
|
|
7df4a544fe | ||
|
|
a4b01ef38a | ||
|
|
0548eeb571 | ||
|
|
18d1d6d3b4 | ||
|
|
df144eb9e2 | ||
|
|
f52917288a | ||
|
|
5a9560db28 | ||
|
|
e5612553ce | ||
|
|
8b5298a62e | ||
|
|
402ff75d78 | ||
|
|
fd4ad82367 | ||
|
|
10731732b4 | ||
|
|
697ac7fd9d | ||
|
|
acb1355ff2 | ||
|
|
2d32401e23 | ||
|
|
f0c1746063 | ||
|
|
5ddda89238 | ||
|
|
2f81e53f63 | ||
|
|
12cebb12d5 | ||
|
|
d6dd3c42d1 | ||
|
|
479dd65a63 | ||
|
|
5a09572393 | ||
|
|
95ec96bf86 | ||
|
|
37828c9b9a | ||
|
|
4eb2605c79 | ||
|
|
25592bbd85 | ||
|
|
e0dd38f672 | ||
|
|
1547fe959e | ||
|
|
13fb582c12 | ||
|
|
824eb7ed20 | ||
|
|
291dc39691 | ||
|
|
05e821c444 | ||
|
|
6e26f17923 | ||
|
|
5507752dc5 | ||
|
|
1693799623 | ||
|
|
3a5928f813 | ||
|
|
d6ebf2d6ca | ||
|
|
7b8e9d88e3 | ||
|
|
bdc968f1fc | ||
|
|
5c5a493791 | ||
|
|
35f2479858 | ||
|
|
a58152bd2a | ||
|
|
81869c4a3f | ||
|
|
f545d669de | ||
|
|
7db5ba7702 | ||
|
|
06dda14505 | ||
|
|
205c36d3a4 | ||
|
|
94e58ff6b9 | ||
|
|
b454326273 | ||
|
|
c22446ede0 | ||
|
|
8a34d1b710 | ||
|
|
73c47f7205 | ||
|
|
42a7a85062 | ||
|
|
df4b06aed1 | ||
|
|
034c9d6bcc | ||
|
|
3c5bd7c35a | ||
|
|
0cbdf9dad2 | ||
|
|
9c8ef96301 | ||
|
|
675d40357c | ||
|
|
fa2a64564a | ||
|
|
dfdb0e140c | ||
|
|
650d761c06 | ||
|
|
430304c176 | ||
|
|
749c3fef8a | ||
|
|
6bdea15ecf | ||
|
|
a1b28a61a6 | ||
|
|
7769362687 | ||
|
|
f3678d217f | ||
|
|
23aba007dd | ||
|
|
3376979923 | ||
|
|
98251cdab3 | ||
|
|
e9d8eb5a27 | ||
|
|
0f4cdc0c5b | ||
|
|
b3449e998a | ||
|
|
a92153ed88 | ||
|
|
85198a45cb | ||
|
|
1dc03e5c4f | ||
|
|
d44b7c486a | ||
|
|
413bc1e77e | ||
|
|
441449e240 | ||
|
|
fd2b285b1b | ||
|
|
ac934e2dbb | ||
|
|
33a154e446 | ||
|
|
3780df8a32 | ||
|
|
75dc8b1aed | ||
|
|
2535a4cafc | ||
|
|
94b323d1d8 | ||
|
|
7113b44bdd | ||
|
|
98ad6ed255 | ||
|
|
e81b3502ef | ||
|
|
c2c102d33e | ||
|
|
089fd61a3b | ||
|
|
d242d47e5c | ||
|
|
6fc350725d | ||
|
|
64a036b4cf | ||
|
|
8d249f8456 | ||
|
|
6e3523e25e | ||
|
|
2a2656f629 | ||
|
|
be4199c3bc | ||
|
|
8fccd2b555 | ||
|
|
e8779cd9e5 | ||
|
|
dd63cd1656 | ||
|
|
ec48a2f32b | ||
|
|
94971bf3b9 | ||
|
|
d8c4985527 | ||
|
|
dcfd05c8ea | ||
|
|
8a375f3c30 | ||
|
|
7a88d21e59 | ||
|
|
a2b0ed537e | ||
|
|
0007711eb5 | ||
|
|
255afbf08a | ||
|
|
aabbbb32ff | ||
|
|
1e95b01f13 | ||
|
|
69c999033b | ||
|
|
1a54e76948 | ||
|
|
df75f5ae37 | ||
|
|
afc9a7d3f9 | ||
|
|
9f597c2d42 | ||
|
|
a181fae722 | ||
|
|
40c838896c | ||
|
|
670c7842a4 | ||
|
|
2fce7dd593 | ||
|
|
a813e7ffdd | ||
|
|
4268427ac3 | ||
|
|
142f8a4aec | ||
|
|
4177571a78 | ||
|
|
01f454242d | ||
|
|
4a5f9fe6a2 | ||
|
|
6159110258 | ||
|
|
ca19b9078f | ||
|
|
6138662716 | ||
|
|
3fbcd21916 | ||
|
|
b48b0b1e58 | ||
|
|
f9066e7d86 | ||
|
|
7b5e42c744 | ||
|
|
bafef292f4 | ||
|
|
9e6ffe7798 | ||
|
|
84735b644c | ||
|
|
f67f37074f | ||
|
|
fe229f10e6 | ||
|
|
0b9f4d7e74 | ||
|
|
f034958bdc | ||
|
|
90ea00a109 | ||
|
|
af377470e1 | ||
|
|
9ed4245d9e | ||
|
|
1dfc990264 | ||
|
|
165ae251ec | ||
|
|
67bea681e2 | ||
|
|
5d31267185 | ||
|
|
cf9b3e7708 | ||
|
|
1c533eb520 | ||
|
|
5397a6d4c6 | ||
|
|
76f411147d | ||
|
|
15ce73caca | ||
|
|
7cf970fb27 | ||
|
|
a27e5a9c95 | ||
|
|
daee2eda93 | ||
|
|
a15b00d3ef | ||
|
|
1b906ef2ad | ||
|
|
68a4ef5ef6 | ||
|
|
90dc5f47e7 | ||
|
|
19d271d3fc | ||
|
|
4a329098e8 | ||
|
|
99b9c1a9d5 | ||
|
|
1c3ee5d1ce | ||
|
|
b489c85226 | ||
|
|
dcea23906b | ||
|
|
20c65ac438 | ||
|
|
bcb9577495 | ||
|
|
d22715126c | ||
|
|
a114367b9b | ||
|
|
2ffc055f7e | ||
|
|
14e9bf894c | ||
|
|
f4cd35322f | ||
|
|
7bdcf9eb26 | ||
|
|
9846a1e56e | ||
|
|
4cc97df8f3 | ||
|
|
0ef64fbe03 | ||
|
|
fbccff4994 | ||
|
|
84184708de | ||
|
|
8f8b478d36 | ||
|
|
b817c337dc | ||
|
|
d03e878d53 | ||
|
|
b313d16493 | ||
|
|
784263f5e3 | ||
|
|
6baa13ab7a | ||
|
|
0e16e0fb6a | ||
|
|
ba98d6fffe | ||
|
|
972f73ed2b | ||
|
|
c5ff37bf3e | ||
|
|
6b867773a8 | ||
|
|
912aac3447 | ||
|
|
4486b7d8e8 | ||
|
|
1267094a51 | ||
|
|
2b842958cc | ||
|
|
80ec2ac167 | ||
|
|
df960d5767 | ||
|
|
c0760f9f91 | ||
|
|
c906128191 | ||
|
|
f574d3c8fc | ||
|
|
ebe5e1731d | ||
|
|
2ebb421331 | ||
|
|
a9e8bd59a3 | ||
|
|
4589ce61bc | ||
|
|
33e66107be | ||
|
|
db90dea9bd | ||
|
|
04544b4510 | ||
|
|
0b17a66e68 | ||
|
|
04986bbb15 | ||
|
|
b0d02adeee | ||
|
|
48b962c401 | ||
|
|
04a195266b | ||
|
|
21393af631 | ||
|
|
189c67db95 | ||
|
|
b92b9228ef | ||
|
|
f49897a419 | ||
|
|
aab30f5e67 | ||
|
|
e7fd732209 |
@@ -2,13 +2,37 @@
|
||||
<!-- please leave the top comment for us emacs folks -->
|
||||
<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">
|
||||
<!-- This target produces a source distribution of OpenSimulator -->
|
||||
<!-- TODO: A few parameters still need to be tweaked after running this - need to do this automatically with sed or similar -->
|
||||
<target name="distsrc">
|
||||
<copy file="bin/OpenSim.ini.example" tofile="bin/OpenSim.ini"/>
|
||||
<copy file="bin/config-include/StandaloneCommon.ini.example" tofile="bin/config-include/StandaloneCommon.ini"/>
|
||||
<copy file="bin/config-include/FlotsamCache.ini.example" tofile="bin/config-include/FlotsamCache.ini"/>
|
||||
<!-- delete files generated by runprebuild.sh which had to be run in order to generate the build file for this target-->
|
||||
<delete>
|
||||
<fileset basedir="OpenSim">
|
||||
<include name="**/*.build"/>
|
||||
<include name="**/*.csproj*"/>
|
||||
<include name="**/*.dll.build"/>
|
||||
<include name="**/*.pidb"/>
|
||||
<exclude name="Tools/OpenSim.32BitLaunch/**"/>
|
||||
<exclude name="Tools/Robust.32BitLaunch/**"/>
|
||||
<exclude name="Tools/LaunchSLClient/**"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
<delete>
|
||||
<fileset>
|
||||
<include name="OpenSim.build"/>
|
||||
<include name="OpenSim.sln"/>
|
||||
</fileset>
|
||||
</delete>
|
||||
</target>
|
||||
|
||||
<property name="distbindir" value="distbin" />
|
||||
<!-- This target produces a binary directory called distbin/ in OpenSim/bin which contains everything needed for binary distribution -->
|
||||
<!-- 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 -->
|
||||
<target name="distbin">
|
||||
<delete dir="${distbindir}"/>
|
||||
<copy todir="${distbindir}">
|
||||
<fileset>
|
||||
|
||||
@@ -86,6 +86,7 @@ what it is today.
|
||||
* Grumly57
|
||||
* GuduleLapointe
|
||||
* Ewe Loon
|
||||
* Fernando Oliveira
|
||||
* Fly-Man
|
||||
* Flyte Xevious
|
||||
* Imaze Rhiano
|
||||
@@ -135,6 +136,7 @@ what it is today.
|
||||
* Ruud Lathorp
|
||||
* SachaMagne
|
||||
* Salahzar Stenvaag
|
||||
* satguru p srivastava
|
||||
* sempuki
|
||||
* SignpostMarv
|
||||
* SpotOn3D
|
||||
|
||||
@@ -89,5 +89,11 @@ namespace OpenSim.Data.MSSQL
|
||||
return DoQuery(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
public FriendsData[] GetFriends(Guid principalID)
|
||||
{
|
||||
return GetFriends(principalID.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -813,7 +813,7 @@ namespace OpenSim.Data.MSSQL
|
||||
{
|
||||
try
|
||||
{
|
||||
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryfolders WHERE folderID=@folderID", connection))
|
||||
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryfolders WHERE folderID=@folderID and type=-1", connection))
|
||||
{
|
||||
command.Parameters.Add(database.CreateParameter("folderID", folderID));
|
||||
|
||||
|
||||
@@ -675,7 +675,7 @@ VALUES
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags]) VALUES (@LandUUID,@AccessUUID,@Flags)";
|
||||
sql = "INSERT INTO [landaccesslist] ([LandUUID],[AccessUUID],[Flags],[Expires]) VALUES (@LandUUID,@AccessUUID,@Flags,@Expires)";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
@@ -1215,6 +1215,8 @@ VALUES
|
||||
//Store new values
|
||||
StoreNewRegionSettings(regionSettings);
|
||||
|
||||
LoadSpawnPoints(regionSettings);
|
||||
|
||||
return regionSettings;
|
||||
}
|
||||
|
||||
@@ -1252,7 +1254,7 @@ VALUES
|
||||
,[elevation_1_ne] = @elevation_1_ne ,[elevation_2_ne] = @elevation_2_ne ,[elevation_1_se] = @elevation_1_se ,[elevation_2_se] = @elevation_2_se
|
||||
,[elevation_1_sw] = @elevation_1_sw ,[elevation_2_sw] = @elevation_2_sw ,[water_height] = @water_height ,[terrain_raise_limit] = @terrain_raise_limit
|
||||
,[terrain_lower_limit] = @terrain_lower_limit ,[use_estate_sun] = @use_estate_sun ,[fixed_sun] = @fixed_sun ,[sun_position] = @sun_position
|
||||
,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id
|
||||
,[covenant] = @covenant ,[covenant_datetime] = @covenant_datetime, [sunvectorx] = @sunvectorx, [sunvectory] = @sunvectory, [sunvectorz] = @sunvectorz, [Sandbox] = @Sandbox, [loaded_creation_datetime] = @loaded_creation_datetime, [loaded_creation_id] = @loaded_creation_id, [map_tile_id] = @TerrainImageID, [telehubobject] = @telehubobject, [parcel_tile_id] = @ParcelImageID
|
||||
WHERE [regionUUID] = @regionUUID";
|
||||
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
@@ -1263,6 +1265,7 @@ VALUES
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
SaveSpawnPoints(regionSettings);
|
||||
}
|
||||
|
||||
public void Shutdown()
|
||||
@@ -1367,7 +1370,7 @@ VALUES
|
||||
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
|
||||
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
|
||||
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
|
||||
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
|
||||
newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]);
|
||||
newSettings.FixedSun = Convert.ToBoolean(row["fixed_sun"]);
|
||||
newSettings.SunPosition = Convert.ToDouble(row["sun_position"]);
|
||||
newSettings.SunVector = new Vector3(
|
||||
@@ -1383,6 +1386,11 @@ VALUES
|
||||
newSettings.LoadedCreationID = "";
|
||||
else
|
||||
newSettings.LoadedCreationID = (String)row["loaded_creation_id"];
|
||||
|
||||
newSettings.TerrainImageID = new UUID((string)row["map_tile_ID"]);
|
||||
newSettings.ParcelImageID = new UUID((Guid)row["parcel_tile_ID"]);
|
||||
newSettings.TelehubObject = new UUID((Guid)row["TelehubObject"]);
|
||||
|
||||
return newSettings;
|
||||
}
|
||||
|
||||
@@ -1454,6 +1462,13 @@ VALUES
|
||||
}
|
||||
|
||||
newData.ParcelAccessList = new List<LandAccessEntry>();
|
||||
newData.MediaDescription = (string)row["MediaDescription"];
|
||||
newData.MediaType = (string)row["MediaType"];
|
||||
newData.MediaWidth = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[0]);
|
||||
newData.MediaHeight = Convert.ToInt32((((string)row["MediaSize"]).Split(','))[1]);
|
||||
newData.MediaLoop = Convert.ToBoolean(row["MediaLoop"]);
|
||||
newData.ObscureMusic = Convert.ToBoolean(row["ObscureMusic"]);
|
||||
newData.ObscureMedia = Convert.ToBoolean(row["ObscureMedia"]);
|
||||
|
||||
return newData;
|
||||
}
|
||||
@@ -1468,7 +1483,7 @@ VALUES
|
||||
LandAccessEntry entry = new LandAccessEntry();
|
||||
entry.AgentID = new UUID((Guid)row["AccessUUID"]);
|
||||
entry.Flags = (AccessList)Convert.ToInt32(row["Flags"]);
|
||||
entry.Expires = 0;
|
||||
entry.Expires = Convert.ToInt32(row["Expires"]);
|
||||
return entry;
|
||||
}
|
||||
|
||||
@@ -1497,7 +1512,8 @@ VALUES
|
||||
prim.TouchName = (string)primRow["TouchName"];
|
||||
// permissions
|
||||
prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
|
||||
prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
|
||||
//prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
|
||||
prim.CreatorIdentification = (string)primRow["CreatorID"];
|
||||
prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
|
||||
prim.GroupID = new UUID((Guid)primRow["GroupID"]);
|
||||
prim.LastOwnerID = new UUID((Guid)primRow["LastOwnerID"]);
|
||||
@@ -1691,7 +1707,8 @@ VALUES
|
||||
taskItem.Name = (string)inventoryRow["name"];
|
||||
taskItem.Description = (string)inventoryRow["description"];
|
||||
taskItem.CreationDate = Convert.ToUInt32(inventoryRow["creationDate"]);
|
||||
taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]);
|
||||
//taskItem.CreatorID = new UUID((Guid)inventoryRow["creatorID"]);
|
||||
taskItem.CreatorIdentification = (string)inventoryRow["creatorID"];
|
||||
taskItem.OwnerID = new UUID((Guid)inventoryRow["ownerID"]);
|
||||
taskItem.LastOwnerID = new UUID((Guid)inventoryRow["lastOwnerID"]);
|
||||
taskItem.GroupID = new UUID((Guid)inventoryRow["groupID"]);
|
||||
@@ -1782,7 +1799,7 @@ VALUES
|
||||
parameters.Add(_Database.CreateParameter("terrain_raise_limit", settings.TerrainRaiseLimit));
|
||||
parameters.Add(_Database.CreateParameter("terrain_lower_limit", settings.TerrainLowerLimit));
|
||||
parameters.Add(_Database.CreateParameter("use_estate_sun", settings.UseEstateSun));
|
||||
parameters.Add(_Database.CreateParameter("sandbox", settings.Sandbox));
|
||||
parameters.Add(_Database.CreateParameter("Sandbox", settings.Sandbox));
|
||||
parameters.Add(_Database.CreateParameter("fixed_sun", settings.FixedSun));
|
||||
parameters.Add(_Database.CreateParameter("sun_position", settings.SunPosition));
|
||||
parameters.Add(_Database.CreateParameter("sunvectorx", settings.SunVector.X));
|
||||
@@ -1792,6 +1809,9 @@ VALUES
|
||||
parameters.Add(_Database.CreateParameter("covenant_datetime", settings.CovenantChangedDateTime));
|
||||
parameters.Add(_Database.CreateParameter("Loaded_Creation_DateTime", settings.LoadedCreationDateTime));
|
||||
parameters.Add(_Database.CreateParameter("Loaded_Creation_ID", settings.LoadedCreationID));
|
||||
parameters.Add(_Database.CreateParameter("TerrainImageID", settings.TerrainImageID));
|
||||
parameters.Add(_Database.CreateParameter("ParcelImageID", settings.ParcelImageID));
|
||||
parameters.Add(_Database.CreateParameter("TelehubObject", settings.TelehubObject));
|
||||
|
||||
return parameters.ToArray();
|
||||
}
|
||||
@@ -1859,6 +1879,7 @@ VALUES
|
||||
parameters.Add(_Database.CreateParameter("LandUUID", parcelID));
|
||||
parameters.Add(_Database.CreateParameter("AccessUUID", parcelAccessEntry.AgentID));
|
||||
parameters.Add(_Database.CreateParameter("Flags", parcelAccessEntry.Flags));
|
||||
parameters.Add(_Database.CreateParameter("Expires", parcelAccessEntry.Expires));
|
||||
|
||||
return parameters.ToArray();
|
||||
}
|
||||
@@ -2063,5 +2084,57 @@ VALUES
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
private void LoadSpawnPoints(RegionSettings rs)
|
||||
{
|
||||
rs.ClearSpawnPoints();
|
||||
|
||||
string sql = "SELECT Yaw, Pitch, Distance FROM spawn_points WHERE RegionUUID = @RegionUUID";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID.ToString()));
|
||||
conn.Open();
|
||||
using (SqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
SpawnPoint sp = new SpawnPoint();
|
||||
|
||||
sp.Yaw = (float)reader["Yaw"];
|
||||
sp.Pitch = (float)reader["Pitch"];
|
||||
sp.Distance = (float)reader["Distance"];
|
||||
|
||||
rs.AddSpawnPoint(sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SaveSpawnPoints(RegionSettings rs)
|
||||
{
|
||||
string sql = "DELETE FROM spawn_points WHERE RegionUUID = @RegionUUID";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID));
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
foreach (SpawnPoint p in rs.SpawnPoints())
|
||||
{
|
||||
sql = "INSERT INTO spawn_points (RegionUUID, Yaw, Pitch, Distance) VALUES (@RegionUUID, @Yaw, @Pitch, @Distance)";
|
||||
using (SqlConnection conn = new SqlConnection(m_connectionString))
|
||||
using (SqlCommand cmd = new SqlCommand(sql, conn))
|
||||
{
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@RegionUUID", rs.RegionUUID));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@Yaw", p.Yaw));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@Pitch", p.Pitch));
|
||||
cmd.Parameters.Add(_Database.CreateParameter("@Distance", p.Distance));
|
||||
conn.Open();
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,4 +235,11 @@ CREATE NONCLUSTERED INDEX IX_regions_name ON dbo.regions
|
||||
regionName
|
||||
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
|
||||
COMMIT
|
||||
COMMIT
|
||||
|
||||
:VERSION 9
|
||||
|
||||
BEGIN TRANSACTION
|
||||
ALTER TABLE regions ADD parcelMapTexture uniqueidentifier NULL;
|
||||
|
||||
COMMIT
|
||||
|
||||
@@ -1044,10 +1044,93 @@ ALTER TABLE primitems ALTER COLUMN CreatorID uniqueidentifier NOT NULL
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 29 #---------------------
|
||||
:VERSION 29 #----------------- Region Covenant changed time
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE regionsettings ADD covenant_datetime int NOT NULL default 0
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 30 #------------------Migrate creatorID storage to varchars instead of UUIDs for HG support
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
EXECUTE sp_rename N'dbo.prims.creatorid', N'creatoridold', 'COLUMN'
|
||||
EXECUTE sp_rename N'dbo.primitems.creatorid', N'creatoridold', 'COLUMN'
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 31 #---------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE prims ADD CreatorID varchar(255)
|
||||
ALTER TABLE primitems ADD CreatorID varchar(255)
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 32 #---------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
UPDATE prims SET prims.CreatorID = CONVERT(varchar(255), creatoridold)
|
||||
UPDATE primitems SET primitems.CreatorID = CONVERT(varchar(255), creatoridold)
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 33 #---------------------
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE prims
|
||||
ADD CONSTRAINT DF_prims_CreatorIDNew
|
||||
DEFAULT '00000000-0000-0000-0000-000000000000'
|
||||
FOR CreatorID
|
||||
|
||||
ALTER TABLE prims ALTER COLUMN CreatorID varchar(255) NOT NULL
|
||||
|
||||
ALTER TABLE primitems
|
||||
ADD CONSTRAINT DF_primitems_CreatorIDNew
|
||||
DEFAULT '00000000-0000-0000-0000-000000000000'
|
||||
FOR CreatorID
|
||||
|
||||
ALTER TABLE primitems ALTER COLUMN CreatorID varchar(255) NOT NULL
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 34 #--------------- Telehub support
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
CREATE TABLE [dbo].[Spawn_Points](
|
||||
[RegionUUID] [uniqueidentifier] NOT NULL,
|
||||
[Yaw] [float] NOT NULL,
|
||||
[Pitch] [float] NOT NULL,
|
||||
[Distance] [float] NOT NULL,
|
||||
PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[RegionUUID] ASC
|
||||
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
|
||||
ALTER TABLE regionsettings ADD TelehubObject uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 35 #---------------- Parcels for sale
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE regionsettings ADD parcel_tile_ID uniqueidentifier NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT
|
||||
|
||||
:VERSION 36 #---------------- Timed bans/access
|
||||
|
||||
BEGIN TRANSACTION
|
||||
|
||||
ALTER TABLE landaccesslist ADD Expires integer NOT NULL DEFAULT 0;
|
||||
|
||||
COMMIT
|
||||
|
||||
|
||||
@@ -1283,7 +1283,7 @@ namespace OpenSim.Data.MySQL
|
||||
newSettings.TerrainRaiseLimit = Convert.ToDouble(row["terrain_raise_limit"]);
|
||||
newSettings.TerrainLowerLimit = Convert.ToDouble(row["terrain_lower_limit"]);
|
||||
newSettings.UseEstateSun = Convert.ToBoolean(row["use_estate_sun"]);
|
||||
newSettings.Sandbox = Convert.ToBoolean(row["sandbox"]);
|
||||
newSettings.Sandbox = Convert.ToBoolean(row["Sandbox"]);
|
||||
newSettings.SunVector = new Vector3 (
|
||||
Convert.ToSingle(row["sunvectorx"]),
|
||||
Convert.ToSingle(row["sunvectory"]),
|
||||
|
||||
500
OpenSim/Data/MySQL/MySQLXAssetData.cs
Normal file
500
OpenSim/Data/MySQL/MySQLXAssetData.cs
Normal file
@@ -0,0 +1,500 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Reflection;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using log4net;
|
||||
using MySql.Data.MySqlClient;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Data;
|
||||
|
||||
namespace OpenSim.Data.MySQL
|
||||
{
|
||||
public class MySQLXAssetData : AssetDataBase
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected virtual Assembly Assembly
|
||||
{
|
||||
get { return GetType().Assembly; }
|
||||
}
|
||||
|
||||
private bool m_enableCompression = false;
|
||||
private string m_connectionString;
|
||||
private object m_dbLock = new object();
|
||||
|
||||
/// <summary>
|
||||
/// We can reuse this for all hashing since all methods are single-threaded through m_dbBLock
|
||||
/// </summary>
|
||||
private HashAlgorithm hasher = new SHA256CryptoServiceProvider();
|
||||
|
||||
#region IPlugin Members
|
||||
|
||||
public override string Version { get { return "1.0.0.0"; } }
|
||||
|
||||
/// <summary>
|
||||
/// <para>Initialises Asset interface</para>
|
||||
/// <para>
|
||||
/// <list type="bullet">
|
||||
/// <item>Loads and initialises the MySQL storage plugin.</item>
|
||||
/// <item>Warns and uses the obsolete mysql_connection.ini if connect string is empty.</item>
|
||||
/// <item>Check for migration</item>
|
||||
/// </list>
|
||||
/// </para>
|
||||
/// </summary>
|
||||
/// <param name="connect">connect string</param>
|
||||
public override void Initialise(string connect)
|
||||
{
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: THIS PLUGIN IS STRICTLY EXPERIMENTAL.");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: DO NOT USE FOR ANY DATA THAT YOU DO NOT MIND LOSING.");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: DATABASE TABLES CAN CHANGE AT ANY TIME, CAUSING EXISTING DATA TO BE LOST.");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
m_log.ErrorFormat("[MYSQL XASSETDATA]: ***********************************************************");
|
||||
|
||||
m_connectionString = connect;
|
||||
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
Migration m = new Migration(dbcon, Assembly, "XAssetStore");
|
||||
m.Update();
|
||||
}
|
||||
}
|
||||
|
||||
public override void Initialise()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Dispose() { }
|
||||
|
||||
/// <summary>
|
||||
/// The name of this DB provider
|
||||
/// </summary>
|
||||
override public string Name
|
||||
{
|
||||
get { return "MySQL XAsset storage engine"; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IAssetDataPlugin Members
|
||||
|
||||
/// <summary>
|
||||
/// Fetch Asset <paramref name="assetID"/> from database
|
||||
/// </summary>
|
||||
/// <param name="assetID">Asset UUID to fetch</param>
|
||||
/// <returns>Return the asset</returns>
|
||||
/// <remarks>On failure : throw an exception and attempt to reconnect to database</remarks>
|
||||
override public AssetBase GetAsset(UUID assetID)
|
||||
{
|
||||
// m_log.DebugFormat("[MYSQL XASSET DATA]: Looking for asset {0}", assetID);
|
||||
|
||||
AssetBase asset = null;
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand(
|
||||
"SELECT name, description, asset_type, local, temporary, asset_flags, creator_id, data FROM xassetsmeta JOIN xassetsdata ON xassetsmeta.hash = xassetsdata.hash WHERE id=?id",
|
||||
dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?id", assetID.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||
{
|
||||
if (dbReader.Read())
|
||||
{
|
||||
asset = new AssetBase(assetID, (string)dbReader["name"], (sbyte)dbReader["asset_type"], dbReader["creator_id"].ToString());
|
||||
asset.Data = (byte[])dbReader["data"];
|
||||
asset.Description = (string)dbReader["description"];
|
||||
|
||||
string local = dbReader["local"].ToString();
|
||||
if (local.Equals("1") || local.Equals("true", StringComparison.InvariantCultureIgnoreCase))
|
||||
asset.Local = true;
|
||||
else
|
||||
asset.Local = false;
|
||||
|
||||
asset.Temporary = Convert.ToBoolean(dbReader["temporary"]);
|
||||
asset.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
|
||||
|
||||
if (m_enableCompression)
|
||||
{
|
||||
using (GZipStream decompressionStream = new GZipStream(new MemoryStream(asset.Data), CompressionMode.Decompress))
|
||||
{
|
||||
MemoryStream outputStream = new MemoryStream();
|
||||
WebUtil.CopyStream(decompressionStream, outputStream, int.MaxValue);
|
||||
// int compressedLength = asset.Data.Length;
|
||||
asset.Data = outputStream.ToArray();
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Decompressed {0} {1} to {2} bytes from {3}",
|
||||
// asset.ID, asset.Name, asset.Data.Length, compressedLength);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[MYSQL XASSET DATA]: MySql failure fetching asset " + assetID + ": " + e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return asset;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an asset in database, or update it if existing.
|
||||
/// </summary>
|
||||
/// <param name="asset">Asset UUID to create</param>
|
||||
/// <remarks>On failure : Throw an exception and attempt to reconnect to database</remarks>
|
||||
override public void StoreAsset(AssetBase asset)
|
||||
{
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlTransaction transaction = dbcon.BeginTransaction())
|
||||
{
|
||||
string assetName = asset.Name;
|
||||
if (asset.Name.Length > 64)
|
||||
{
|
||||
assetName = asset.Name.Substring(0, 64);
|
||||
m_log.Warn("[XASSET DB]: Name field truncated from " + asset.Name.Length + " to " + assetName.Length + " characters on add");
|
||||
}
|
||||
|
||||
string assetDescription = asset.Description;
|
||||
if (asset.Description.Length > 64)
|
||||
{
|
||||
assetDescription = asset.Description.Substring(0, 64);
|
||||
m_log.Warn("[XASSET DB]: Description field truncated from " + asset.Description.Length + " to " + assetDescription.Length + " characters on add");
|
||||
}
|
||||
|
||||
if (m_enableCompression)
|
||||
{
|
||||
MemoryStream outputStream = new MemoryStream();
|
||||
|
||||
using (GZipStream compressionStream = new GZipStream(outputStream, CompressionMode.Compress, false))
|
||||
{
|
||||
// Console.WriteLine(WebUtil.CopyTo(new MemoryStream(asset.Data), compressionStream, int.MaxValue));
|
||||
// We have to close the compression stream in order to make sure it writes everything out to the underlying memory output stream.
|
||||
compressionStream.Close();
|
||||
byte[] compressedData = outputStream.ToArray();
|
||||
asset.Data = compressedData;
|
||||
}
|
||||
}
|
||||
|
||||
byte[] hash = hasher.ComputeHash(asset.Data);
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[XASSET DB]: Compressed data size for {0} {1}, hash {2} is {3}",
|
||||
// asset.ID, asset.Name, hash, compressedData.Length);
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlCommand cmd =
|
||||
new MySqlCommand(
|
||||
"replace INTO xassetsmeta(id, hash, name, description, asset_type, local, temporary, create_time, access_time, asset_flags, creator_id)" +
|
||||
"VALUES(?id, ?hash, ?name, ?description, ?asset_type, ?local, ?temporary, ?create_time, ?access_time, ?asset_flags, ?creator_id)",
|
||||
dbcon))
|
||||
{
|
||||
// create unix epoch time
|
||||
int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
|
||||
cmd.Parameters.AddWithValue("?id", asset.ID);
|
||||
cmd.Parameters.AddWithValue("?hash", hash);
|
||||
cmd.Parameters.AddWithValue("?name", assetName);
|
||||
cmd.Parameters.AddWithValue("?description", assetDescription);
|
||||
cmd.Parameters.AddWithValue("?asset_type", asset.Type);
|
||||
cmd.Parameters.AddWithValue("?local", asset.Local);
|
||||
cmd.Parameters.AddWithValue("?temporary", asset.Temporary);
|
||||
cmd.Parameters.AddWithValue("?create_time", now);
|
||||
cmd.Parameters.AddWithValue("?access_time", now);
|
||||
cmd.Parameters.AddWithValue("?creator_id", asset.Metadata.CreatorID);
|
||||
cmd.Parameters.AddWithValue("?asset_flags", (int)asset.Flags);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[ASSET DB]: MySQL failure creating asset metadata {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
|
||||
transaction.Rollback();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ExistsData(dbcon, transaction, hash))
|
||||
{
|
||||
try
|
||||
{
|
||||
using (MySqlCommand cmd =
|
||||
new MySqlCommand(
|
||||
"INSERT INTO xassetsdata(hash, data) VALUES(?hash, ?data)",
|
||||
dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?hash", hash);
|
||||
cmd.Parameters.AddWithValue("?data", asset.Data);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[XASSET DB]: MySQL failure creating asset data {0} with name \"{1}\". Error: {2}",
|
||||
asset.FullID, asset.Name, e.Message);
|
||||
|
||||
transaction.Rollback();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// private void UpdateAccessTime(AssetBase asset)
|
||||
// {
|
||||
// lock (m_dbLock)
|
||||
// {
|
||||
// using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
// {
|
||||
// dbcon.Open();
|
||||
// MySqlCommand cmd =
|
||||
// new MySqlCommand("update assets set access_time=?access_time where id=?id",
|
||||
// dbcon);
|
||||
//
|
||||
// // need to ensure we dispose
|
||||
// try
|
||||
// {
|
||||
// using (cmd)
|
||||
// {
|
||||
// // create unix epoch time
|
||||
// int now = (int)Utils.DateTimeToUnixTime(DateTime.UtcNow);
|
||||
// cmd.Parameters.AddWithValue("?id", asset.ID);
|
||||
// cmd.Parameters.AddWithValue("?access_time", now);
|
||||
// cmd.ExecuteNonQuery();
|
||||
// cmd.Dispose();
|
||||
// }
|
||||
// }
|
||||
// catch (Exception e)
|
||||
// {
|
||||
// m_log.ErrorFormat(
|
||||
// "[ASSETS DB]: " +
|
||||
// "MySql failure updating access_time for asset {0} with name {1}" + Environment.NewLine + e.ToString()
|
||||
// + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// We assume we already have the m_dbLock.
|
||||
/// </summary>
|
||||
/// TODO: need to actually use the transaction.
|
||||
/// <param name="dbcon"></param>
|
||||
/// <param name="transaction"></param>
|
||||
/// <param name="hash"></param>
|
||||
/// <returns></returns>
|
||||
private bool ExistsData(MySqlConnection dbcon, MySqlTransaction transaction, byte[] hash)
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
|
||||
|
||||
bool exists = false;
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand("SELECT hash FROM xassetsdata WHERE hash=?hash", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?hash", hash);
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||
{
|
||||
if (dbReader.Read())
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
|
||||
exists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[XASSETS DB]: MySql failure in ExistsData fetching hash {0}. Exception {1}{2}",
|
||||
hash, e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
return exists;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the asset exists in the database
|
||||
/// </summary>
|
||||
/// <param name="uuid">The asset UUID</param>
|
||||
/// <returns>true if it exists, false otherwise.</returns>
|
||||
override public bool ExistsAsset(UUID uuid)
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Checking for asset {0}", uuid);
|
||||
|
||||
bool assetExists = false;
|
||||
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
using (MySqlCommand cmd = new MySqlCommand("SELECT id FROM xassetsmeta WHERE id=?id", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?id", uuid.ToString());
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow))
|
||||
{
|
||||
if (dbReader.Read())
|
||||
{
|
||||
// m_log.DebugFormat("[ASSETS DB]: Found asset {0}", uuid);
|
||||
assetExists = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[XASSETS DB]: MySql failure fetching asset {0}" + Environment.NewLine + e.ToString(), uuid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return assetExists;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of AssetMetadata objects. The list is a subset of
|
||||
/// the entire data set offset by <paramref name="start" /> containing
|
||||
/// <paramref name="count" /> elements.
|
||||
/// </summary>
|
||||
/// <param name="start">The number of results to discard from the total data set.</param>
|
||||
/// <param name="count">The number of rows the returned list should contain.</param>
|
||||
/// <returns>A list of AssetMetadata objects.</returns>
|
||||
public override List<AssetMetadata> FetchAssetMetadataSet(int start, int count)
|
||||
{
|
||||
List<AssetMetadata> retList = new List<AssetMetadata>(count);
|
||||
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
MySqlCommand cmd = new MySqlCommand("SELECT name,description,asset_type,temporary,id,asset_flags,creator_id FROM xassetsmeta LIMIT ?start, ?count", dbcon);
|
||||
cmd.Parameters.AddWithValue("?start", start);
|
||||
cmd.Parameters.AddWithValue("?count", count);
|
||||
|
||||
try
|
||||
{
|
||||
using (MySqlDataReader dbReader = cmd.ExecuteReader())
|
||||
{
|
||||
while (dbReader.Read())
|
||||
{
|
||||
AssetMetadata metadata = new AssetMetadata();
|
||||
metadata.Name = (string)dbReader["name"];
|
||||
metadata.Description = (string)dbReader["description"];
|
||||
metadata.Type = (sbyte)dbReader["asset_type"];
|
||||
metadata.Temporary = Convert.ToBoolean(dbReader["temporary"]); // Not sure if this is correct.
|
||||
metadata.Flags = (AssetFlags)Convert.ToInt32(dbReader["asset_flags"]);
|
||||
metadata.FullID = DBGuid.FromDB(dbReader["id"]);
|
||||
metadata.CreatorID = dbReader["creator_id"].ToString();
|
||||
|
||||
// We'll ignore this for now - it appears unused!
|
||||
// metadata.SHA1 = dbReader["hash"]);
|
||||
|
||||
retList.Add(metadata);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.Error("[XASSETS DB]: MySql failure fetching asset set" + Environment.NewLine + e.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return retList;
|
||||
}
|
||||
|
||||
public override bool Delete(string id)
|
||||
{
|
||||
// m_log.DebugFormat("[XASSETS DB]: Deleting asset {0}", id);
|
||||
|
||||
lock (m_dbLock)
|
||||
{
|
||||
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
|
||||
{
|
||||
dbcon.Open();
|
||||
|
||||
using (MySqlCommand cmd = new MySqlCommand("delete from xassetsmeta where id=?id", dbcon))
|
||||
{
|
||||
cmd.Parameters.AddWithValue("?id", id);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
// TODO: How do we deal with data from deleted assets? Probably not easily reapable unless we
|
||||
// keep a reference count (?)
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
27
OpenSim/Data/MySQL/Resources/XAssetStore.migrations
Normal file
27
OpenSim/Data/MySQL/Resources/XAssetStore.migrations
Normal file
@@ -0,0 +1,27 @@
|
||||
# -----------------
|
||||
:VERSION 1
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE `xassetsmeta` (
|
||||
`id` char(36) NOT NULL,
|
||||
`hash` binary(32) NOT NULL,
|
||||
`name` varchar(64) NOT NULL,
|
||||
`description` varchar(64) NOT NULL,
|
||||
`asset_type` tinyint(4) NOT NULL,
|
||||
`local` tinyint(1) NOT NULL,
|
||||
`temporary` tinyint(1) NOT NULL,
|
||||
`create_time` int(11) NOT NULL,
|
||||
`access_time` int(11) NOT NULL,
|
||||
`asset_flags` int(11) NOT NULL,
|
||||
`creator_id` varchar(128) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Version 1';
|
||||
|
||||
CREATE TABLE `xassetsdata` (
|
||||
`hash` binary(32) NOT NULL,
|
||||
`data` longblob NOT NULL,
|
||||
PRIMARY KEY (`hash`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Version 1';
|
||||
|
||||
COMMIT;
|
||||
@@ -472,3 +472,95 @@ COMMIT;
|
||||
BEGIN;
|
||||
ALTER TABLE regionsettings ADD COLUMN covenant_datetime INTEGER NOT NULL default 0;
|
||||
COMMIT;
|
||||
|
||||
:VERSION 23
|
||||
BEGIN;
|
||||
CREATE TABLE regionwindlight (
|
||||
region_id VARCHAR(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000' PRIMARY KEY,
|
||||
water_color_r FLOAT NOT NULL DEFAULT '4.000000',
|
||||
water_color_g FLOAT NOT NULL DEFAULT '38.000000',
|
||||
water_color_b FLOAT NOT NULL DEFAULT '64.000000',
|
||||
water_color_i FLOAT NOT NULL DEFAULT '1.000000',
|
||||
water_fog_density_exponent FLOAT NOT NULL DEFAULT '4.0',
|
||||
underwater_fog_modifier FLOAT NOT NULL DEFAULT '0.25',
|
||||
reflection_wavelet_scale_1 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_2 FLOAT NOT NULL DEFAULT '2.0',
|
||||
reflection_wavelet_scale_3 FLOAT NOT NULL DEFAULT '2.0',
|
||||
fresnel_scale FLOAT NOT NULL DEFAULT '0.40',
|
||||
fresnel_offset FLOAT NOT NULL DEFAULT '0.50',
|
||||
refract_scale_above FLOAT NOT NULL DEFAULT '0.03',
|
||||
refract_scale_below FLOAT NOT NULL DEFAULT '0.20',
|
||||
blur_multiplier FLOAT NOT NULL DEFAULT '0.040',
|
||||
big_wave_direction_x FLOAT NOT NULL DEFAULT '1.05',
|
||||
big_wave_direction_y FLOAT NOT NULL DEFAULT '-0.42',
|
||||
little_wave_direction_x FLOAT NOT NULL DEFAULT '1.11',
|
||||
little_wave_direction_y FLOAT NOT NULL DEFAULT '-1.16',
|
||||
normal_map_texture VARCHAR(36) NOT NULL DEFAULT '822ded49-9a6c-f61c-cb89-6df54f42cdf4',
|
||||
horizon_r FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_g FLOAT NOT NULL DEFAULT '0.25',
|
||||
horizon_b FLOAT NOT NULL DEFAULT '0.32',
|
||||
horizon_i FLOAT NOT NULL DEFAULT '0.32',
|
||||
haze_horizon FLOAT NOT NULL DEFAULT '0.19',
|
||||
blue_density_r FLOAT NOT NULL DEFAULT '0.12',
|
||||
blue_density_g FLOAT NOT NULL DEFAULT '0.22',
|
||||
blue_density_b FLOAT NOT NULL DEFAULT '0.38',
|
||||
blue_density_i FLOAT NOT NULL DEFAULT '0.38',
|
||||
haze_density FLOAT NOT NULL DEFAULT '0.70',
|
||||
density_multiplier FLOAT NOT NULL DEFAULT '0.18',
|
||||
distance_multiplier FLOAT NOT NULL DEFAULT '0.8',
|
||||
max_altitude INTEGER NOT NULL DEFAULT '1605',
|
||||
sun_moon_color_r FLOAT NOT NULL DEFAULT '0.24',
|
||||
sun_moon_color_g FLOAT NOT NULL DEFAULT '0.26',
|
||||
sun_moon_color_b FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_color_i FLOAT NOT NULL DEFAULT '0.30',
|
||||
sun_moon_position FLOAT NOT NULL DEFAULT '0.317',
|
||||
ambient_r FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_g FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_b FLOAT NOT NULL DEFAULT '0.35',
|
||||
ambient_i FLOAT NOT NULL DEFAULT '0.35',
|
||||
east_angle FLOAT NOT NULL DEFAULT '0.00',
|
||||
sun_glow_focus FLOAT NOT NULL DEFAULT '0.10',
|
||||
sun_glow_size FLOAT NOT NULL DEFAULT '1.75',
|
||||
scene_gamma FLOAT NOT NULL DEFAULT '1.00',
|
||||
star_brightness FLOAT NOT NULL DEFAULT '0.00',
|
||||
cloud_color_r FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_g FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_b FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_color_i FLOAT NOT NULL DEFAULT '0.41',
|
||||
cloud_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_density FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_coverage FLOAT NOT NULL DEFAULT '0.27',
|
||||
cloud_scale FLOAT NOT NULL DEFAULT '0.42',
|
||||
cloud_detail_x FLOAT NOT NULL DEFAULT '1.00',
|
||||
cloud_detail_y FLOAT NOT NULL DEFAULT '0.53',
|
||||
cloud_detail_density FLOAT NOT NULL DEFAULT '0.12',
|
||||
cloud_scroll_x FLOAT NOT NULL DEFAULT '0.20',
|
||||
cloud_scroll_x_lock INTEGER NOT NULL DEFAULT '0',
|
||||
cloud_scroll_y FLOAT NOT NULL DEFAULT '0.01',
|
||||
cloud_scroll_y_lock INTEGER NOT NULL DEFAULT '0',
|
||||
draw_classic_clouds INTEGER NOT NULL DEFAULT '1');
|
||||
|
||||
COMMIT;
|
||||
|
||||
|
||||
:VERSION 24
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `spawn_points` (
|
||||
`RegionID` varchar(36) NOT NULL DEFAULT '000000-0000-0000-0000-000000000000',
|
||||
`Yaw` float NOT NULL,
|
||||
`Pitch` float NOT NULL,
|
||||
`Distance` float NOT NULL
|
||||
);
|
||||
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `TelehubObject` varchar(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
COMMIT;
|
||||
|
||||
:VERSION 25
|
||||
|
||||
BEGIN;
|
||||
ALTER TABLE `regionsettings` ADD COLUMN `parcel_tile_ID` char(36) NOT NULL DEFAULT '00000000-0000-0000-0000-000000000000';
|
||||
COMMIT;
|
||||
|
||||
@@ -81,6 +81,9 @@ namespace OpenSim.Data.SQLite
|
||||
/// <param name="dbconnect">connect string</param>
|
||||
override public void Initialise(string dbconnect)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
if (dbconnect == string.Empty)
|
||||
{
|
||||
dbconnect = "URI=file:Asset.db,version=3";
|
||||
|
||||
@@ -65,6 +65,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
if (!m_initialized)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_Connection = new SqliteConnection(connectionString);
|
||||
m_Connection.Open();
|
||||
|
||||
|
||||
@@ -69,6 +69,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
public void Initialise(string connectionString)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_connectionString = connectionString;
|
||||
|
||||
m_log.Info("[ESTATE DB]: Sqlite - connecting: "+m_connectionString);
|
||||
|
||||
@@ -48,6 +48,8 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
protected SQLiteFramework(string connectionString)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -77,6 +77,9 @@ namespace OpenSim.Data.SQLite
|
||||
{
|
||||
m_Initialized = true;
|
||||
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
if (dbconnect == string.Empty)
|
||||
{
|
||||
dbconnect = "URI=file:inventoryStore.db,version=3";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -52,6 +52,9 @@ namespace OpenSim.Data.SQLite
|
||||
|
||||
public SQLiteXInventoryData(string conn, string realm)
|
||||
{
|
||||
if (Util.IsWindows())
|
||||
Util.LoadArchSpecificWindowsDll("sqlite3.dll");
|
||||
|
||||
m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>(
|
||||
conn, "inventoryfolders", "XInventoryStore");
|
||||
m_Items = new SqliteItemHandler(
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Xml;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -40,6 +41,8 @@ namespace OpenSim.Framework.Console
|
||||
{
|
||||
public class Commands : ICommands
|
||||
{
|
||||
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
/// <summary>
|
||||
/// Encapsulates a command that can be invoked from the console
|
||||
/// </summary>
|
||||
@@ -76,12 +79,19 @@ namespace OpenSim.Framework.Console
|
||||
public List<CommandDelegate> fn;
|
||||
}
|
||||
|
||||
public const string GeneralHelpText = "For more information, type 'help <item>' where <item> is one of the following categories:";
|
||||
|
||||
/// <value>
|
||||
/// Commands organized by keyword in a tree
|
||||
/// </value>
|
||||
private Dictionary<string, object> tree =
|
||||
new Dictionary<string, object>();
|
||||
|
||||
/// <summary>
|
||||
/// Commands organized by module
|
||||
/// </summary>
|
||||
private Dictionary<string, List<CommandInfo>> m_modulesCommands = new Dictionary<string, List<CommandInfo>>();
|
||||
|
||||
/// <summary>
|
||||
/// Get help for the given help string
|
||||
/// </summary>
|
||||
@@ -98,8 +108,8 @@ namespace OpenSim.Framework.Console
|
||||
// General help
|
||||
if (helpParts.Count == 0)
|
||||
{
|
||||
help.AddRange(CollectHelp(tree));
|
||||
help.Sort();
|
||||
help.Add(GeneralHelpText);
|
||||
help.AddRange(CollectModulesHelp(tree));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -118,6 +128,13 @@ namespace OpenSim.Framework.Console
|
||||
{
|
||||
string originalHelpRequest = string.Join(" ", helpParts.ToArray());
|
||||
List<string> help = new List<string>();
|
||||
|
||||
// Check modules first to see if we just need to display a list of those commands
|
||||
if (TryCollectModuleHelp(originalHelpRequest, help))
|
||||
{
|
||||
help.Insert(0, GeneralHelpText);
|
||||
return help;
|
||||
}
|
||||
|
||||
Dictionary<string, object> dict = tree;
|
||||
while (helpParts.Count > 0)
|
||||
@@ -161,25 +178,61 @@ namespace OpenSim.Framework.Console
|
||||
return help;
|
||||
}
|
||||
|
||||
private List<string> CollectHelp(Dictionary<string, object> dict)
|
||||
/// <summary>
|
||||
/// Try to collect help for the given module if that module exists.
|
||||
/// </summary>
|
||||
/// <param name="moduleName"></param>
|
||||
/// <param name="helpText">/param>
|
||||
/// <returns>true if there was the module existed, false otherwise.</returns>
|
||||
private bool TryCollectModuleHelp(string moduleName, List<string> helpText)
|
||||
{
|
||||
List<string> result = new List<string>();
|
||||
|
||||
foreach (KeyValuePair<string, object> kvp in dict)
|
||||
lock (m_modulesCommands)
|
||||
{
|
||||
if (kvp.Value is Dictionary<string, Object>)
|
||||
if (m_modulesCommands.ContainsKey(moduleName))
|
||||
{
|
||||
result.AddRange(CollectHelp((Dictionary<string, Object>)kvp.Value));
|
||||
List<CommandInfo> commands = m_modulesCommands[moduleName];
|
||||
var ourHelpText = commands.ConvertAll(c => string.Format("{0} - {1}", c.help_text, c.long_help));
|
||||
ourHelpText.Sort();
|
||||
helpText.AddRange(ourHelpText);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((CommandInfo)kvp.Value).long_help != String.Empty)
|
||||
result.Add(((CommandInfo)kvp.Value).help_text+" - "+
|
||||
((CommandInfo)kvp.Value).long_help);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private List<string> CollectModulesHelp(Dictionary<string, object> dict)
|
||||
{
|
||||
lock (m_modulesCommands)
|
||||
{
|
||||
List<string> helpText = new List<string>(m_modulesCommands.Keys);
|
||||
helpText.Sort();
|
||||
return helpText;
|
||||
}
|
||||
}
|
||||
|
||||
// private List<string> CollectHelp(Dictionary<string, object> dict)
|
||||
// {
|
||||
// List<string> result = new List<string>();
|
||||
//
|
||||
// foreach (KeyValuePair<string, object> kvp in dict)
|
||||
// {
|
||||
// if (kvp.Value is Dictionary<string, Object>)
|
||||
// {
|
||||
// result.AddRange(CollectHelp((Dictionary<string, Object>)kvp.Value));
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// if (((CommandInfo)kvp.Value).long_help != String.Empty)
|
||||
// result.Add(((CommandInfo)kvp.Value).help_text+" - "+
|
||||
// ((CommandInfo)kvp.Value).long_help);
|
||||
// }
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Add a command to those which can be invoked from the console.
|
||||
@@ -212,21 +265,19 @@ namespace OpenSim.Framework.Console
|
||||
|
||||
Dictionary<string, Object> current = tree;
|
||||
|
||||
foreach (string s in parts)
|
||||
foreach (string part in parts)
|
||||
{
|
||||
if (current.ContainsKey(s))
|
||||
if (current.ContainsKey(part))
|
||||
{
|
||||
if (current[s] is Dictionary<string, Object>)
|
||||
{
|
||||
current = (Dictionary<string, Object>)current[s];
|
||||
}
|
||||
if (current[part] is Dictionary<string, Object>)
|
||||
current = (Dictionary<string, Object>)current[part];
|
||||
else
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
current[s] = new Dictionary<string, Object>();
|
||||
current = (Dictionary<string, Object>)current[s];
|
||||
current[part] = new Dictionary<string, Object>();
|
||||
current = (Dictionary<string, Object>)current[part];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,6 +301,24 @@ namespace OpenSim.Framework.Console
|
||||
info.fn = new List<CommandDelegate>();
|
||||
info.fn.Add(fn);
|
||||
current[String.Empty] = info;
|
||||
|
||||
// Now add command to modules dictionary
|
||||
lock (m_modulesCommands)
|
||||
{
|
||||
List<CommandInfo> commands;
|
||||
if (m_modulesCommands.ContainsKey(module))
|
||||
{
|
||||
commands = m_modulesCommands[module];
|
||||
}
|
||||
else
|
||||
{
|
||||
commands = new List<CommandInfo>();
|
||||
m_modulesCommands[module] = commands;
|
||||
}
|
||||
|
||||
// m_log.DebugFormat("[COMMAND CONSOLE]: Adding to category {0} command {1}", module, command);
|
||||
commands.Add(info);
|
||||
}
|
||||
}
|
||||
|
||||
public string[] FindNextOption(string[] cmd, bool term)
|
||||
@@ -607,8 +676,9 @@ namespace OpenSim.Framework.Console
|
||||
{
|
||||
Commands = new Commands();
|
||||
|
||||
Commands.AddCommand("console", false, "help", "help [<command>]",
|
||||
"Get general command list or more detailed help on a specific command", Help);
|
||||
Commands.AddCommand(
|
||||
"Help", false, "help", "help [<item>]",
|
||||
"Display help on a particular command or on a list of commands in a category", Help);
|
||||
}
|
||||
|
||||
private void Help(string module, string[] cmd)
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Threading;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Xml;
|
||||
|
||||
namespace OpenSim.Framework.Console
|
||||
{
|
||||
@@ -37,28 +38,42 @@ namespace OpenSim.Framework.Console
|
||||
/// Don't use this except for Unit Testing or you're in for a world of hurt when the
|
||||
/// sim gets to ReadLine
|
||||
/// </summary>
|
||||
public class MockConsole : CommandConsole
|
||||
public class MockConsole : ICommandConsole
|
||||
{
|
||||
public MockConsole(string defaultPrompt) : base(defaultPrompt)
|
||||
{
|
||||
}
|
||||
public override void Output(string text)
|
||||
{
|
||||
}
|
||||
public override void Output(string text, string level)
|
||||
{
|
||||
}
|
||||
private MockCommands m_commands = new MockCommands();
|
||||
|
||||
public override string ReadLine(string p, bool isCommand, bool e)
|
||||
{
|
||||
//Thread.CurrentThread.Join(1000);
|
||||
return string.Empty;
|
||||
}
|
||||
public override void UnlockOutput()
|
||||
{
|
||||
}
|
||||
public override void LockOutput()
|
||||
{
|
||||
}
|
||||
public ICommands Commands { get { return m_commands; } }
|
||||
|
||||
public void Prompt() {}
|
||||
|
||||
public void RunCommand(string cmd) {}
|
||||
|
||||
public string ReadLine(string p, bool isCommand, bool e) { return ""; }
|
||||
|
||||
public object ConsoleScene { get { return null; } }
|
||||
|
||||
public void Output(string text, string level) {}
|
||||
public void Output(string text) {}
|
||||
public void OutputFormat(string format, params object[] components) {}
|
||||
|
||||
public string CmdPrompt(string p) { return ""; }
|
||||
public string CmdPrompt(string p, string def) { return ""; }
|
||||
public string CmdPrompt(string p, List<char> excludedCharacters) { return ""; }
|
||||
public string CmdPrompt(string p, string def, List<char> excludedCharacters) { return ""; }
|
||||
|
||||
public string CmdPrompt(string prompt, string defaultresponse, List<string> options) { return ""; }
|
||||
|
||||
public string PasswdPrompt(string p) { return ""; }
|
||||
}
|
||||
}
|
||||
|
||||
public class MockCommands : ICommands
|
||||
{
|
||||
public void FromXml(XmlElement root, CommandDelegate fn) {}
|
||||
public List<string> GetHelp(string[] cmd) { return null; }
|
||||
public void AddCommand(string module, bool shared, string command, string help, string longhelp, CommandDelegate fn) {}
|
||||
public void AddCommand(string module, bool shared, string command, string help, string longhelp, string descriptivehelp, CommandDelegate fn) {}
|
||||
public string[] FindNextOption(string[] cmd, bool term) { return null; }
|
||||
public string[] Resolve(string[] cmd) { return null; }
|
||||
public XmlElement GetXml(XmlDocument doc) { return null; }
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ namespace OpenSim.Framework
|
||||
/// <summary>
|
||||
/// Get help for the given help string
|
||||
/// </summary>
|
||||
/// <param name="helpParts">Parsed parts of the help string. If empty then general help is returned.</param>
|
||||
/// <param name="cmd">Parsed parts of the help string. If empty then general help is returned.</param>
|
||||
/// <returns></returns>
|
||||
List<string> GetHelp(string[] cmd);
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace OpenSim.Framework
|
||||
// Copy the temporary stream to the network stream
|
||||
formDataStream.Seek(0, SeekOrigin.Begin);
|
||||
using (Stream requestStream = request.GetRequestStream())
|
||||
formDataStream.CopyTo(requestStream, (int)formDataStream.Length);
|
||||
formDataStream.CopyStream(requestStream, (int)formDataStream.Length);
|
||||
}
|
||||
|
||||
#endregion Stream Writing
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
using OpenMetaverse;
|
||||
|
||||
@@ -39,6 +40,13 @@ namespace OpenSim.Framework
|
||||
|
||||
#region SL / file extension / content-type conversions
|
||||
|
||||
public static Dictionary<string, UUID> DefaultAvatarAnimations = new Dictionary<string, UUID>();
|
||||
|
||||
static SLUtil()
|
||||
{
|
||||
DefaultAvatarAnimations = LoadDefaultAvatarAnimations("data/avataranimations.xml");
|
||||
}
|
||||
|
||||
public static string SLAssetTypeToContentType(int assetType)
|
||||
{
|
||||
switch ((AssetType)assetType)
|
||||
@@ -374,5 +382,47 @@ namespace OpenSim.Framework
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load the default SL avatar animations.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static Dictionary<string, UUID> LoadDefaultAvatarAnimations(string path)
|
||||
{
|
||||
Dictionary<string, UUID> animations = new Dictionary<string, UUID>();
|
||||
|
||||
using (XmlTextReader reader = new XmlTextReader(path))
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(reader);
|
||||
if (doc.DocumentElement != null)
|
||||
{
|
||||
foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
|
||||
{
|
||||
if (nod.Attributes["name"] != null)
|
||||
{
|
||||
string name = nod.Attributes["name"].Value.ToLower();
|
||||
string id = nod.InnerText;
|
||||
animations.Add(name, (UUID)id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return animations;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the default SL avatar animation with the given name.
|
||||
/// </summary>
|
||||
/// <param name="name"></param>
|
||||
/// <returns></returns>
|
||||
public static UUID GetDefaultAvatarAnimation(string name)
|
||||
{
|
||||
if (DefaultAvatarAnimations.ContainsKey(name))
|
||||
return DefaultAvatarAnimations[name];
|
||||
|
||||
return UUID.Zero;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -49,15 +49,16 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="nodeToFill"></param>
|
||||
/// <param name="processors">/param>
|
||||
/// <param name="xtr"></param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr)
|
||||
{
|
||||
ExecuteReadProcessors(
|
||||
return ExecuteReadProcessors(
|
||||
nodeToFill,
|
||||
processors,
|
||||
xtr,
|
||||
(o, name, e)
|
||||
=> m_log.ErrorFormat(
|
||||
=> m_log.DebugFormat(
|
||||
"[ExternalRepresentationUtils]: Exception while parsing element {0}, continuing. Exception {1}{2}",
|
||||
name, e.Message, e.StackTrace));
|
||||
}
|
||||
@@ -71,12 +72,15 @@ namespace OpenSim.Framework.Serialization.External
|
||||
/// <param name="parseExceptionAction">
|
||||
/// Action to take if there is a parsing problem. This will usually just be to log the exception
|
||||
/// </param>
|
||||
public static void ExecuteReadProcessors<NodeType>(
|
||||
/// <returns>true on successful, false if there were any processing failures</returns>
|
||||
public static bool ExecuteReadProcessors<NodeType>(
|
||||
NodeType nodeToFill,
|
||||
Dictionary<string, Action<NodeType, XmlTextReader>> processors,
|
||||
XmlTextReader xtr,
|
||||
Action<NodeType, string, Exception> parseExceptionAction)
|
||||
{
|
||||
bool errors = false;
|
||||
|
||||
string nodeName = string.Empty;
|
||||
while (xtr.NodeType != XmlNodeType.EndElement)
|
||||
{
|
||||
@@ -95,6 +99,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
errors = true;
|
||||
parseExceptionAction(nodeToFill, nodeName, e);
|
||||
|
||||
if (xtr.NodeType == XmlNodeType.EndElement)
|
||||
@@ -107,6 +112,8 @@ namespace OpenSim.Framework.Serialization.External
|
||||
xtr.ReadOuterXml(); // ignore
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -140,6 +147,7 @@ namespace OpenSim.Framework.Serialization.External
|
||||
UUID.TryParse(node.InnerText, out uuid);
|
||||
creator = userService.GetUserAccount(scopeID, uuid);
|
||||
}
|
||||
|
||||
if (node.Name == "CreatorData" && node.InnerText != null && node.InnerText != string.Empty)
|
||||
hasCreatorData = true;
|
||||
|
||||
@@ -163,7 +171,6 @@ namespace OpenSim.Framework.Serialization.External
|
||||
doc.Save(wr);
|
||||
return wr.ToString();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -161,43 +161,43 @@ namespace OpenSim.Framework.Servers
|
||||
Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold));
|
||||
}
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "quit",
|
||||
m_console.Commands.AddCommand("General", false, "quit",
|
||||
"quit",
|
||||
"Quit the application", HandleQuit);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "shutdown",
|
||||
m_console.Commands.AddCommand("General", false, "shutdown",
|
||||
"shutdown",
|
||||
"Quit the application", HandleQuit);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "set log level",
|
||||
m_console.Commands.AddCommand("General", false, "set log level",
|
||||
"set log level <level>",
|
||||
"Set the console logging level", HandleLogLevel);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show info",
|
||||
m_console.Commands.AddCommand("General", false, "show info",
|
||||
"show info",
|
||||
"Show general information about the server", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show stats",
|
||||
m_console.Commands.AddCommand("General", false, "show stats",
|
||||
"show stats",
|
||||
"Show statistics", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show threads",
|
||||
m_console.Commands.AddCommand("General", false, "show threads",
|
||||
"show threads",
|
||||
"Show thread status", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show uptime",
|
||||
m_console.Commands.AddCommand("General", false, "show uptime",
|
||||
"show uptime",
|
||||
"Show server uptime", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "show version",
|
||||
m_console.Commands.AddCommand("General", false, "show version",
|
||||
"show version",
|
||||
"Show server version", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "threads abort",
|
||||
m_console.Commands.AddCommand("General", false, "threads abort",
|
||||
"threads abort <thread-id>",
|
||||
"Abort a managed thread. Use \"show threads\" to find possible threads.", HandleThreadsAbort);
|
||||
|
||||
m_console.Commands.AddCommand("base", false, "threads show",
|
||||
m_console.Commands.AddCommand("General", false, "threads show",
|
||||
"threads show",
|
||||
"Show thread status. Synonym for \"show threads\"",
|
||||
(string module, string[] args) => Notice(GetThreadsReport()));
|
||||
@@ -247,7 +247,7 @@ namespace OpenSim.Framework.Servers
|
||||
string reportFormat = "{0,6} {1,35} {2,16} {3,13} {4,10} {5,30}";
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreads();
|
||||
Watchdog.ThreadWatchdogInfo[] threads = Watchdog.GetThreadsInfo();
|
||||
|
||||
sb.Append(threads.Length + " threads are being tracked:" + Environment.NewLine);
|
||||
|
||||
@@ -269,15 +269,19 @@ namespace OpenSim.Framework.Servers
|
||||
t.Priority,
|
||||
t.ThreadState);
|
||||
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append("\n");
|
||||
}
|
||||
|
||||
int workers = 0, ports = 0, maxWorkers = 0, maxPorts = 0;
|
||||
ThreadPool.GetAvailableThreads(out workers, out ports);
|
||||
ThreadPool.GetMaxThreads(out maxWorkers, out maxPorts);
|
||||
sb.Append("\n");
|
||||
|
||||
sb.Append(Environment.NewLine + "*** ThreadPool threads ***" + Environment.NewLine);
|
||||
sb.Append("workers: " + (maxWorkers - workers) + " (" + maxWorkers + "); ports: " + (maxPorts - ports) + " (" + maxPorts + ")" + Environment.NewLine);
|
||||
// For some reason mono 2.6.7 returns an empty threads set! Not going to confuse people by reporting
|
||||
// zero active threads.
|
||||
int totalThreads = Process.GetCurrentProcess().Threads.Count;
|
||||
if (totalThreads > 0)
|
||||
sb.AppendFormat("Total threads active: {0}\n\n", totalThreads);
|
||||
|
||||
sb.Append("Main threadpool (excluding script engine pools)\n");
|
||||
sb.Append(Util.GetThreadPoolReport());
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -308,7 +312,9 @@ namespace OpenSim.Framework.Servers
|
||||
// clr version potentially is more confusing than helpful, since it doesn't tell us if we're running under Mono/MS .NET and
|
||||
// the clr version number doesn't match the project version number under Mono.
|
||||
//m_log.Info("[STARTUP]: Virtual machine runtime version: " + Environment.Version + Environment.NewLine);
|
||||
m_log.Info("[STARTUP]: Operating system version: " + Environment.OSVersion + Environment.NewLine);
|
||||
m_log.InfoFormat(
|
||||
"[STARTUP]: Operating system version: {0}, .NET platform {1}, {2}-bit\n",
|
||||
Environment.OSVersion, Environment.OSVersion.Platform, Util.Is64BitProcess() ? "64" : "32");
|
||||
|
||||
StartupSpecific();
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
String.Format("PollServiceWorkerThread{0}", i),
|
||||
ThreadPriority.Normal,
|
||||
false,
|
||||
true,
|
||||
int.MaxValue);
|
||||
}
|
||||
|
||||
@@ -73,6 +74,7 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||
"PollServiceWatcherThread",
|
||||
ThreadPriority.Normal,
|
||||
false,
|
||||
true,
|
||||
1000 * 60 * 10);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenSim
|
||||
{
|
||||
public class VersionInfo
|
||||
{
|
||||
private const string VERSION_NUMBER = "0.7.3";
|
||||
private const string VERSION_NUMBER = "0.7.4";
|
||||
private const Flavour VERSION_FLAVOUR = Flavour.Dev;
|
||||
|
||||
public enum Flavour
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Text;
|
||||
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.StructuredData;
|
||||
|
||||
@@ -46,8 +46,12 @@ namespace OpenSim.Framework.Statistics
|
||||
sb.Append(Environment.NewLine);
|
||||
sb.Append(
|
||||
string.Format(
|
||||
"Allocated to OpenSim : {0} MB" + Environment.NewLine,
|
||||
"Allocated to OpenSim objects: {0} MB\n",
|
||||
Math.Round(GC.GetTotalMemory(false) / 1024.0 / 1024.0)));
|
||||
sb.Append(
|
||||
string.Format(
|
||||
"Process memory : {0} MB\n",
|
||||
Math.Round(Process.GetCurrentProcess().WorkingSet64 / 1024.0 / 1024.0)));
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,8 @@ using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Reflection;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Security.Cryptography;
|
||||
@@ -80,12 +81,15 @@ namespace OpenSim.Framework
|
||||
|
||||
private static uint nextXferID = 5000;
|
||||
private static Random randomClass = new Random();
|
||||
|
||||
// Get a list of invalid file characters (OS dependent)
|
||||
private static string regexInvalidFileChars = "[" + new String(Path.GetInvalidFileNameChars()) + "]";
|
||||
private static string regexInvalidPathChars = "[" + new String(Path.GetInvalidPathChars()) + "]";
|
||||
private static object XferLock = new object();
|
||||
/// <summary>Thread pool used for Util.FireAndForget if
|
||||
/// FireAndForgetMethod.SmartThreadPool is used</summary>
|
||||
|
||||
/// <summary>
|
||||
/// Thread pool used for Util.FireAndForget if FireAndForgetMethod.SmartThreadPool is used
|
||||
/// </summary>
|
||||
private static SmartThreadPool m_ThreadPool;
|
||||
|
||||
// Unix-epoch starts at January 1st 1970, 00:00:00 UTC. And all our times in the server are (or at least should be) in UTC.
|
||||
@@ -143,7 +147,6 @@ namespace OpenSim.Framework
|
||||
return lerp(y, lerp(x, a, b), lerp(x, c, d));
|
||||
}
|
||||
|
||||
|
||||
public static Encoding UTF8 = Encoding.UTF8;
|
||||
|
||||
/// <value>
|
||||
@@ -375,6 +378,50 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Is the platform Windows?
|
||||
/// </summary>
|
||||
/// <returns>true if so, false otherwise</returns>
|
||||
public static bool IsWindows()
|
||||
{
|
||||
PlatformID platformId = Environment.OSVersion.Platform;
|
||||
|
||||
return (platformId == PlatformID.Win32NT
|
||||
|| platformId == PlatformID.Win32S
|
||||
|| platformId == PlatformID.Win32Windows
|
||||
|| platformId == PlatformID.WinCE);
|
||||
}
|
||||
|
||||
public static bool LoadArchSpecificWindowsDll(string libraryName)
|
||||
{
|
||||
// We do this so that OpenSimulator on Windows loads the correct native library depending on whether
|
||||
// it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
|
||||
// will find it already loaded later on.
|
||||
//
|
||||
// This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
|
||||
// controlled in config files.
|
||||
string nativeLibraryPath;
|
||||
|
||||
if (Util.Is64BitProcess())
|
||||
nativeLibraryPath = "lib64/" + libraryName;
|
||||
else
|
||||
nativeLibraryPath = "lib32/" + libraryName;
|
||||
|
||||
m_log.DebugFormat("[UTIL]: Loading native Windows library at {0}", nativeLibraryPath);
|
||||
|
||||
if (Util.LoadLibrary(nativeLibraryPath) == IntPtr.Zero)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[UTIL]: Couldn't find native Windows library at {0}", nativeLibraryPath);
|
||||
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsEnvironmentSupported(ref string reason)
|
||||
@@ -1457,6 +1504,27 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to trigger an early library load on Windows systems.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Required to get 32-bit and 64-bit processes to automatically use the
|
||||
/// appropriate native library.
|
||||
/// </remarks>
|
||||
/// <param name="dllToLoad"></param>
|
||||
/// <returns></returns>
|
||||
[DllImport("kernel32.dll")]
|
||||
public static extern IntPtr LoadLibrary(string dllToLoad);
|
||||
|
||||
/// <summary>
|
||||
/// Determine whether the current process is 64 bit
|
||||
/// </summary>
|
||||
/// <returns>true if so, false if not</returns>
|
||||
public static bool Is64BitProcess()
|
||||
{
|
||||
return IntPtr.Size == 8;
|
||||
}
|
||||
|
||||
#region FireAndForget Threading Pattern
|
||||
@@ -1605,6 +1673,61 @@ namespace OpenSim.Framework
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a thread pool report.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static string GetThreadPoolReport()
|
||||
{
|
||||
string threadPoolUsed = null;
|
||||
int maxThreads = 0;
|
||||
int minThreads = 0;
|
||||
int allocatedThreads = 0;
|
||||
int inUseThreads = 0;
|
||||
int waitingCallbacks = 0;
|
||||
int completionPortThreads = 0;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (FireAndForgetMethod == FireAndForgetMethod.SmartThreadPool)
|
||||
{
|
||||
threadPoolUsed = "SmartThreadPool";
|
||||
maxThreads = m_ThreadPool.MaxThreads;
|
||||
minThreads = m_ThreadPool.MinThreads;
|
||||
inUseThreads = m_ThreadPool.InUseThreads;
|
||||
allocatedThreads = m_ThreadPool.ActiveThreads;
|
||||
waitingCallbacks = m_ThreadPool.WaitingCallbacks;
|
||||
}
|
||||
else if (
|
||||
FireAndForgetMethod == FireAndForgetMethod.UnsafeQueueUserWorkItem
|
||||
|| FireAndForgetMethod == FireAndForgetMethod.UnsafeQueueUserWorkItem)
|
||||
{
|
||||
threadPoolUsed = "BuiltInThreadPool";
|
||||
ThreadPool.GetMaxThreads(out maxThreads, out completionPortThreads);
|
||||
ThreadPool.GetMinThreads(out minThreads, out completionPortThreads);
|
||||
int availableThreads;
|
||||
ThreadPool.GetAvailableThreads(out availableThreads, out completionPortThreads);
|
||||
inUseThreads = maxThreads - availableThreads;
|
||||
allocatedThreads = -1;
|
||||
waitingCallbacks = -1;
|
||||
}
|
||||
|
||||
if (threadPoolUsed != null)
|
||||
{
|
||||
sb.AppendFormat("Thread pool used : {0}\n", threadPoolUsed);
|
||||
sb.AppendFormat("Max threads : {0}\n", maxThreads);
|
||||
sb.AppendFormat("Min threads : {0}\n", minThreads);
|
||||
sb.AppendFormat("Allocated threads : {0}\n", allocatedThreads < 0 ? "not applicable" : allocatedThreads.ToString());
|
||||
sb.AppendFormat("In use threads : {0}\n", inUseThreads);
|
||||
sb.AppendFormat("Work items waiting : {0}\n", waitingCallbacks < 0 ? "not available" : waitingCallbacks.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("Thread pool not used\n");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static object SmartThreadPoolCallback(object o)
|
||||
{
|
||||
object[] array = (object[])o;
|
||||
|
||||
@@ -72,6 +72,11 @@ namespace OpenSim.Framework
|
||||
/// </summary>
|
||||
public bool IsTimedOut { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Will this thread trigger the alarm function if it has timed out?
|
||||
/// </summary>
|
||||
public bool AlarmIfTimeout { get; set; }
|
||||
|
||||
public ThreadWatchdogInfo(Thread thread, int timeout)
|
||||
{
|
||||
Thread = thread;
|
||||
@@ -112,12 +117,13 @@ namespace OpenSim.Framework
|
||||
/// <param name="start">The method that will be executed in a new thread</param>
|
||||
/// <param name="name">A name to give to the new thread</param>
|
||||
/// <param name="priority">Priority to run the thread at</param>
|
||||
/// <param name="isBackground">True to run this thread as a background
|
||||
/// thread, otherwise false</param>
|
||||
/// <param name="isBackground">True to run this thread as a background thread, otherwise false</param>
|
||||
/// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param>
|
||||
/// <returns>The newly created Thread object</returns>
|
||||
public static Thread StartThread(ThreadStart start, string name, ThreadPriority priority, bool isBackground)
|
||||
public static Thread StartThread(
|
||||
ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout)
|
||||
{
|
||||
return StartThread(start, name, priority, isBackground, WATCHDOG_TIMEOUT_MS);
|
||||
return StartThread(start, name, priority, isBackground, alarmIfTimeout, WATCHDOG_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -128,21 +134,21 @@ namespace OpenSim.Framework
|
||||
/// <param name="priority">Priority to run the thread at</param>
|
||||
/// <param name="isBackground">True to run this thread as a background
|
||||
/// thread, otherwise false</param>
|
||||
/// <param name="timeout">
|
||||
/// Number of milliseconds to wait until we issue a warning about timeout.
|
||||
/// </para>
|
||||
/// <param name="alarmIfTimeout">Trigger an alarm function is we have timed out</param>
|
||||
/// <param name="timeout">Number of milliseconds to wait until we issue a warning about timeout.</param>
|
||||
/// <returns>The newly created Thread object</returns>
|
||||
public static Thread StartThread(
|
||||
ThreadStart start, string name, ThreadPriority priority, bool isBackground, int timeout)
|
||||
ThreadStart start, string name, ThreadPriority priority, bool isBackground, bool alarmIfTimeout, int timeout)
|
||||
{
|
||||
Thread thread = new Thread(start);
|
||||
thread.Name = name;
|
||||
thread.Priority = priority;
|
||||
thread.IsBackground = isBackground;
|
||||
|
||||
ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout);
|
||||
ThreadWatchdogInfo twi = new ThreadWatchdogInfo(thread, timeout) { AlarmIfTimeout = alarmIfTimeout };
|
||||
|
||||
m_log.Debug("[WATCHDOG]: Started tracking thread \"" + twi.Thread.Name + "\" (ID " + twi.Thread.ManagedThreadId + ")");
|
||||
m_log.DebugFormat(
|
||||
"[WATCHDOG]: Started tracking thread {0}, ID {1}", twi.Thread.Name, twi.Thread.ManagedThreadId);
|
||||
|
||||
lock (m_threads)
|
||||
m_threads.Add(twi.Thread.ManagedThreadId, twi);
|
||||
@@ -224,19 +230,39 @@ namespace OpenSim.Framework
|
||||
/// Get currently watched threads for diagnostic purposes
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static ThreadWatchdogInfo[] GetThreads()
|
||||
public static ThreadWatchdogInfo[] GetThreadsInfo()
|
||||
{
|
||||
lock (m_threads)
|
||||
return m_threads.Values.ToArray();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return the current thread's watchdog info.
|
||||
/// </summary>
|
||||
/// <returns>The watchdog info. null if the thread isn't being monitored.</returns>
|
||||
public static ThreadWatchdogInfo GetCurrentThreadInfo()
|
||||
{
|
||||
lock (m_threads)
|
||||
{
|
||||
if (m_threads.ContainsKey(Thread.CurrentThread.ManagedThreadId))
|
||||
return m_threads[Thread.CurrentThread.ManagedThreadId];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check watched threads. Fire alarm if appropriate.
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private static void WatchdogTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
|
||||
{
|
||||
WatchdogTimeout callback = OnWatchdogTimeout;
|
||||
|
||||
if (callback != null)
|
||||
{
|
||||
ThreadWatchdogInfo timedOut = null;
|
||||
List<ThreadWatchdogInfo> callbackInfos = null;
|
||||
|
||||
lock (m_threads)
|
||||
{
|
||||
@@ -246,21 +272,31 @@ namespace OpenSim.Framework
|
||||
{
|
||||
if (threadInfo.Thread.ThreadState == ThreadState.Stopped)
|
||||
{
|
||||
timedOut = threadInfo;
|
||||
RemoveThread(threadInfo.Thread.ManagedThreadId);
|
||||
break;
|
||||
|
||||
if (callbackInfos == null)
|
||||
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||
|
||||
callbackInfos.Add(threadInfo);
|
||||
}
|
||||
else if (!threadInfo.IsTimedOut && now - threadInfo.LastTick >= threadInfo.Timeout)
|
||||
{
|
||||
threadInfo.IsTimedOut = true;
|
||||
timedOut = threadInfo;
|
||||
break;
|
||||
|
||||
if (threadInfo.AlarmIfTimeout)
|
||||
{
|
||||
if (callbackInfos == null)
|
||||
callbackInfos = new List<ThreadWatchdogInfo>();
|
||||
|
||||
callbackInfos.Add(threadInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (timedOut != null)
|
||||
callback(timedOut.Thread, timedOut.LastTick);
|
||||
if (callbackInfos != null)
|
||||
foreach (ThreadWatchdogInfo callbackInfo in callbackInfos)
|
||||
callback(callbackInfo.Thread, callbackInfo.LastTick);
|
||||
}
|
||||
|
||||
m_watchdogTimer.Start();
|
||||
|
||||
@@ -63,77 +63,32 @@ namespace OpenSim.Framework
|
||||
// a "long" call for warning & debugging purposes
|
||||
public const int LongCallTime = 500;
|
||||
|
||||
// /// <summary>
|
||||
// /// Send LLSD to an HTTP client in application/llsd+json form
|
||||
// /// </summary>
|
||||
// /// <param name="response">HTTP response to send the data in</param>
|
||||
// /// <param name="body">LLSD to send to the client</param>
|
||||
// public static void SendJSONResponse(OSHttpResponse response, OSDMap body)
|
||||
// {
|
||||
// byte[] responseData = Encoding.UTF8.GetBytes(OSDParser.SerializeJsonString(body));
|
||||
//
|
||||
// response.ContentEncoding = Encoding.UTF8;
|
||||
// response.ContentLength = responseData.Length;
|
||||
// response.ContentType = "application/llsd+json";
|
||||
// response.Body.Write(responseData, 0, responseData.Length);
|
||||
// }
|
||||
//
|
||||
// /// <summary>
|
||||
// /// Send LLSD to an HTTP client in application/llsd+xml form
|
||||
// /// </summary>
|
||||
// /// <param name="response">HTTP response to send the data in</param>
|
||||
// /// <param name="body">LLSD to send to the client</param>
|
||||
// public static void SendXMLResponse(OSHttpResponse response, OSDMap body)
|
||||
// {
|
||||
// byte[] responseData = OSDParser.SerializeLLSDXmlBytes(body);
|
||||
//
|
||||
// response.ContentEncoding = Encoding.UTF8;
|
||||
// response.ContentLength = responseData.Length;
|
||||
// response.ContentType = "application/llsd+xml";
|
||||
// response.Body.Write(responseData, 0, responseData.Length);
|
||||
// }
|
||||
// dictionary of end points
|
||||
private static Dictionary<string,object> m_endpointSerializer = new Dictionary<string,object>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Make a GET or GET-like request to a web service that returns LLSD
|
||||
/// or JSON data
|
||||
/// </summary>
|
||||
public static OSDMap ServiceRequest(string url, string httpVerb)
|
||||
private static object EndPointLock(string url)
|
||||
{
|
||||
string errorMessage;
|
||||
System.Uri uri = new System.Uri(url);
|
||||
string endpoint = string.Format("{0}:{1}",uri.Host,uri.Port);
|
||||
|
||||
try
|
||||
lock (m_endpointSerializer)
|
||||
{
|
||||
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
|
||||
request.Method = httpVerb;
|
||||
object eplock = null;
|
||||
|
||||
using (WebResponse response = request.GetResponse())
|
||||
if (! m_endpointSerializer.TryGetValue(endpoint,out eplock))
|
||||
{
|
||||
using (Stream responseStream = response.GetResponseStream())
|
||||
{
|
||||
try
|
||||
{
|
||||
string responseStr = responseStream.GetStreamString();
|
||||
OSD responseOSD = OSDParser.Deserialize(responseStr);
|
||||
if (responseOSD.Type == OSDType.Map)
|
||||
return (OSDMap)responseOSD;
|
||||
else
|
||||
errorMessage = "Response format was invalid.";
|
||||
}
|
||||
catch
|
||||
{
|
||||
errorMessage = "Failed to parse the response.";
|
||||
}
|
||||
}
|
||||
eplock = new object();
|
||||
m_endpointSerializer.Add(endpoint,eplock);
|
||||
// m_log.WarnFormat("[WEB UTIL] add a new host to end point serializer {0}",endpoint);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
m_log.Warn(httpVerb + " on URL " + url + " failed: " + ex.Message);
|
||||
errorMessage = ex.Message;
|
||||
}
|
||||
|
||||
return new OSDMap { { "Message", OSD.FromString("Service request failed. " + errorMessage) } };
|
||||
return eplock;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#region JSONRequest
|
||||
|
||||
/// <summary>
|
||||
/// PUT JSON-encoded data to a web service that returns LLSD or
|
||||
@@ -165,6 +120,14 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
public static OSDMap ServiceOSDRequest(string url, OSDMap data, string method, int timeout, bool compressed)
|
||||
{
|
||||
lock (EndPointLock(url))
|
||||
{
|
||||
return ServiceOSDRequestWorker(url,data,method,timeout,compressed);
|
||||
}
|
||||
}
|
||||
|
||||
private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed)
|
||||
{
|
||||
int reqnum = m_requestNumber++;
|
||||
// m_log.DebugFormat("[WEB UTIL]: <{0}> start osd request for {1}, method {2}",reqnum,url,method);
|
||||
@@ -303,6 +266,10 @@ namespace OpenSim.Framework
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion JSONRequest
|
||||
|
||||
#region FormRequest
|
||||
|
||||
/// <summary>
|
||||
/// POST URL-encoded form data to a web service that returns LLSD or
|
||||
/// JSON data
|
||||
@@ -313,6 +280,14 @@ namespace OpenSim.Framework
|
||||
}
|
||||
|
||||
public static OSDMap ServiceFormRequest(string url, NameValueCollection data, int timeout)
|
||||
{
|
||||
lock (EndPointLock(url))
|
||||
{
|
||||
return ServiceFormRequestWorker(url,data,timeout);
|
||||
}
|
||||
}
|
||||
|
||||
private static OSDMap ServiceFormRequestWorker(string url, NameValueCollection data, int timeout)
|
||||
{
|
||||
int reqnum = m_requestNumber++;
|
||||
string method = (data != null && data["RequestMethod"] != null) ? data["RequestMethod"] : "unknown";
|
||||
@@ -397,6 +372,8 @@ namespace OpenSim.Framework
|
||||
result["Message"] = OSD.FromString("Service request failed: " + msg);
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion FormRequest
|
||||
|
||||
#region Uri
|
||||
|
||||
@@ -533,8 +510,13 @@ namespace OpenSim.Framework
|
||||
/// <remarks>
|
||||
/// Copying begins at the streams' current positions. The positions are
|
||||
/// NOT reset after copying is complete.
|
||||
/// NOTE!! .NET 4.0 adds the method 'Stream.CopyTo(stream, bufferSize)'.
|
||||
/// This function could be replaced with that method once we move
|
||||
/// totally to .NET 4.0. For versions before, this routine exists.
|
||||
/// This routine used to be named 'CopyTo' but the int parameter has
|
||||
/// a different meaning so this method was renamed to avoid any confusion.
|
||||
/// </remarks>
|
||||
public static int CopyTo(this Stream copyFrom, Stream copyTo, int maximumBytesToCopy)
|
||||
public static int CopyStream(this Stream copyFrom, Stream copyTo, int maximumBytesToCopy)
|
||||
{
|
||||
byte[] buffer = new byte[4096];
|
||||
int readBytes;
|
||||
|
||||
@@ -225,12 +225,12 @@ namespace OpenSim
|
||||
/// </summary>
|
||||
private void RegisterConsoleCommands()
|
||||
{
|
||||
m_console.Commands.AddCommand("region", false, "force update",
|
||||
m_console.Commands.AddCommand("Regions", false, "force update",
|
||||
"force update",
|
||||
"Force the update of all objects on clients",
|
||||
HandleForceUpdate);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug packet",
|
||||
m_console.Commands.AddCommand("Comms", false, "debug packet",
|
||||
"debug packet <level> [<avatar-first-name> <avatar-last-name>]",
|
||||
"Turn on packet debugging",
|
||||
"If level > 255 then all incoming and outgoing packets are logged.\n"
|
||||
@@ -242,7 +242,7 @@ namespace OpenSim
|
||||
+ "If an avatar name is given then only packets from that avatar are logged",
|
||||
Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug http",
|
||||
m_console.Commands.AddCommand("Comms", false, "debug http",
|
||||
"debug http <level>",
|
||||
"Turn on inbound http request debugging for everything except the event queue (see debug eq).",
|
||||
"If level >= 2 then the handler used to service the request is logged.\n"
|
||||
@@ -250,37 +250,37 @@ namespace OpenSim
|
||||
+ "If level <= 0 then no extra http logging is done.\n",
|
||||
Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
|
||||
m_console.Commands.AddCommand("Comms", false, "debug teleport", "debug teleport", "Toggle teleport route debugging", Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "debug scene",
|
||||
m_console.Commands.AddCommand("Regions", false, "debug scene",
|
||||
"debug scene <scripting> <collisions> <physics>",
|
||||
"Turn on scene debugging", Debug);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "change region",
|
||||
m_console.Commands.AddCommand("General", false, "change region",
|
||||
"change region <region name>",
|
||||
"Change current console region", ChangeSelectedRegion);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "save xml",
|
||||
m_console.Commands.AddCommand("Archiving", false, "save xml",
|
||||
"save xml",
|
||||
"Save a region's data in XML format", SaveXml);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "save xml2",
|
||||
m_console.Commands.AddCommand("Archiving", false, "save xml2",
|
||||
"save xml2",
|
||||
"Save a region's data in XML2 format", SaveXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "load xml",
|
||||
m_console.Commands.AddCommand("Archiving", false, "load xml",
|
||||
"load xml [-newIDs [<x> <y> <z>]]",
|
||||
"Load a region's data from XML format", LoadXml);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "load xml2",
|
||||
m_console.Commands.AddCommand("Archiving", false, "load xml2",
|
||||
"load xml2",
|
||||
"Load a region's data from XML2 format", LoadXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "save prims xml2",
|
||||
m_console.Commands.AddCommand("Archiving", false, "save prims xml2",
|
||||
"save prims xml2 [<prim name> <file name>]",
|
||||
"Save named prim to XML2", SavePrimsXml2);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "load oar",
|
||||
m_console.Commands.AddCommand("Archiving", false, "load oar",
|
||||
"load oar [--merge] [--skip-assets] [<OAR path>]",
|
||||
"Load a region's data from an OAR archive.",
|
||||
"--merge will merge the OAR with the existing scene." + Environment.NewLine
|
||||
@@ -289,7 +289,7 @@ namespace OpenSim
|
||||
+ " If this is not given then the command looks for an OAR named region.oar in the current directory.",
|
||||
LoadOar);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "save oar",
|
||||
m_console.Commands.AddCommand("Archiving", false, "save oar",
|
||||
//"save oar [-v|--version=<N>] [-p|--profile=<url>] [<OAR path>]",
|
||||
"save oar [-h|--home=<url>] [--noassets] [--publish] [--perm=<permissions>] [<OAR path>]",
|
||||
"Save a region's data to an OAR archive.",
|
||||
@@ -306,54 +306,54 @@ namespace OpenSim
|
||||
+ " If this is not given then the oar is saved to region.oar in the current directory.",
|
||||
SaveOar);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "edit scale",
|
||||
m_console.Commands.AddCommand("Regions", false, "edit scale",
|
||||
"edit scale <name> <x> <y> <z>",
|
||||
"Change the scale of a named prim", HandleEditScale);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "kick user",
|
||||
m_console.Commands.AddCommand("Users", false, "kick user",
|
||||
"kick user <first> <last> [message]",
|
||||
"Kick a user off the simulator", KickUserCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show users",
|
||||
m_console.Commands.AddCommand("Users", false, "show users",
|
||||
"show users [full]",
|
||||
"Show user data for users currently on the region",
|
||||
"Without the 'full' option, only users actually on the region are shown."
|
||||
+ " With the 'full' option child agents of users in neighbouring regions are also shown.",
|
||||
HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show connections",
|
||||
m_console.Commands.AddCommand("Comms", false, "show connections",
|
||||
"show connections",
|
||||
"Show connection data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show circuits",
|
||||
m_console.Commands.AddCommand("Comms", false, "show circuits",
|
||||
"show circuits",
|
||||
"Show agent circuit data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show http-handlers",
|
||||
m_console.Commands.AddCommand("Comms", false, "show http-handlers",
|
||||
"show http-handlers",
|
||||
"Show all registered http handlers", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show pending-objects",
|
||||
m_console.Commands.AddCommand("Comms", false, "show pending-objects",
|
||||
"show pending-objects",
|
||||
"Show # of objects on the pending queues of all scene viewers", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show modules",
|
||||
m_console.Commands.AddCommand("General", false, "show modules",
|
||||
"show modules",
|
||||
"Show module data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show regions",
|
||||
m_console.Commands.AddCommand("Regions", false, "show regions",
|
||||
"show regions",
|
||||
"Show region data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "show ratings",
|
||||
m_console.Commands.AddCommand("Regions", false, "show ratings",
|
||||
"show ratings",
|
||||
"Show rating data", HandleShow);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "backup",
|
||||
m_console.Commands.AddCommand("Regions", false, "backup",
|
||||
"backup",
|
||||
"Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "create region",
|
||||
m_console.Commands.AddCommand("Regions", false, "create region",
|
||||
"create region [\"region name\"] <region_file.ini>",
|
||||
"Create a new region.",
|
||||
"The settings for \"region name\" are read from <region_file.ini>. Paths specified with <region_file.ini> are relative to your Regions directory, unless an absolute path is given."
|
||||
@@ -362,62 +362,57 @@ namespace OpenSim
|
||||
+ "If <region_file.ini> does not exist, it will be created.",
|
||||
HandleCreateRegion);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "restart",
|
||||
m_console.Commands.AddCommand("Regions", false, "restart",
|
||||
"restart",
|
||||
"Restart all sims in this instance", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "config set",
|
||||
m_console.Commands.AddCommand("General", false, "config set",
|
||||
"config set <section> <key> <value>",
|
||||
"Set a config option. In most cases this is not useful since changed parameters are not dynamically reloaded. Neither do changed parameters persist - you will have to change a config file manually and restart.", HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "config get",
|
||||
m_console.Commands.AddCommand("General", false, "config get",
|
||||
"config get [<section>] [<key>]",
|
||||
"Synonym for config show",
|
||||
HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "config show",
|
||||
m_console.Commands.AddCommand("General", false, "config show",
|
||||
"config show [<section>] [<key>]",
|
||||
"Show config information",
|
||||
"If neither section nor field are specified, then the whole current configuration is printed." + Environment.NewLine
|
||||
+ "If a section is given but not a field, then all fields in that section are printed.",
|
||||
HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "config save",
|
||||
m_console.Commands.AddCommand("General", false, "config save",
|
||||
"config save <path>",
|
||||
"Save current configuration to a file at the given path", HandleConfig);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "command-script",
|
||||
m_console.Commands.AddCommand("General", false, "command-script",
|
||||
"command-script <script>",
|
||||
"Run a command script from file", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "remove-region",
|
||||
m_console.Commands.AddCommand("Regions", false, "remove-region",
|
||||
"remove-region <name>",
|
||||
"Remove a region from this simulator", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "delete-region",
|
||||
m_console.Commands.AddCommand("Regions", false, "delete-region",
|
||||
"delete-region <name>",
|
||||
"Delete a region from disk", RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "modules list",
|
||||
m_console.Commands.AddCommand("General", false, "modules list",
|
||||
"modules list",
|
||||
"List modules", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "modules load",
|
||||
m_console.Commands.AddCommand("General", false, "modules load",
|
||||
"modules load <name>",
|
||||
"Load a module", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "modules unload",
|
||||
m_console.Commands.AddCommand("General", false, "modules unload",
|
||||
"modules unload <name>",
|
||||
"Unload a module", HandleModules);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "Add-InventoryHost",
|
||||
"Add-InventoryHost <host>",
|
||||
String.Empty, RunCommand);
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "kill uuid",
|
||||
m_console.Commands.AddCommand("Regions", false, "kill uuid",
|
||||
"kill uuid <UUID>",
|
||||
"Kill an object by UUID", KillUUID);
|
||||
|
||||
}
|
||||
|
||||
public override void ShutdownSpecific()
|
||||
@@ -508,7 +503,11 @@ namespace OpenSim
|
||||
string currentCommand;
|
||||
while ((currentCommand = readFile.ReadLine()) != null)
|
||||
{
|
||||
if (currentCommand != String.Empty)
|
||||
currentCommand = currentCommand.Trim();
|
||||
if (!(currentCommand == ""
|
||||
|| currentCommand.StartsWith(";")
|
||||
|| currentCommand.StartsWith("//")
|
||||
|| currentCommand.StartsWith("#")))
|
||||
{
|
||||
m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
|
||||
m_console.RunCommand(currentCommand);
|
||||
@@ -829,14 +828,6 @@ namespace OpenSim
|
||||
case "restart":
|
||||
m_sceneManager.RestartCurrentScene();
|
||||
break;
|
||||
|
||||
case "Add-InventoryHost":
|
||||
if (cmdparams.Length > 0)
|
||||
{
|
||||
MainConsole.Instance.Output("Not implemented.");
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
@@ -67,6 +68,9 @@ namespace OpenSim
|
||||
private const string PLUGIN_ASSET_CACHE = "/OpenSim/AssetCache";
|
||||
private const string PLUGIN_ASSET_SERVER_CLIENT = "/OpenSim/AssetClient";
|
||||
|
||||
// OpenSim.ini Section name for ESTATES Settings
|
||||
public const string ESTATE_SECTION_NAME = "Estates";
|
||||
|
||||
protected string proxyUrl;
|
||||
protected int proxyOffset = 0;
|
||||
|
||||
@@ -242,15 +246,17 @@ namespace OpenSim
|
||||
|
||||
foreach (string topic in topics)
|
||||
{
|
||||
m_console.Commands.AddCommand("plugin", false, "help " + topic,
|
||||
"help " + topic,
|
||||
string capitalizedTopic = char.ToUpper(topic[0]) + topic.Substring(1);
|
||||
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false, "help " + capitalizedTopic,
|
||||
"help " + capitalizedTopic,
|
||||
"Get help on plugin command '" + topic + "'",
|
||||
HandleCommanderHelp);
|
||||
|
||||
m_console.Commands.AddCommand("plugin", false, topic,
|
||||
topic,
|
||||
"Execute subcommand for plugin '" + topic + "'",
|
||||
null);
|
||||
//
|
||||
// m_console.Commands.AddCommand("General", false, topic,
|
||||
// topic,
|
||||
// "Execute subcommand for plugin '" + topic + "'",
|
||||
// null);
|
||||
|
||||
ICommander commander = null;
|
||||
|
||||
@@ -267,7 +273,7 @@ namespace OpenSim
|
||||
|
||||
foreach (string command in commander.Commands.Keys)
|
||||
{
|
||||
m_console.Commands.AddCommand(topic, false,
|
||||
m_console.Commands.AddCommand(capitalizedTopic, false,
|
||||
topic + " " + command,
|
||||
topic + " " + commander.Commands[command].ShortHelp(),
|
||||
String.Empty, HandleCommanderCommand);
|
||||
@@ -286,7 +292,7 @@ namespace OpenSim
|
||||
// Only safe for the interactive console, since it won't
|
||||
// let us come here unless both scene and commander exist
|
||||
//
|
||||
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1]);
|
||||
ICommander moduleCommander = SceneManager.CurrentOrFirstScene.GetCommander(cmd[1].ToLower());
|
||||
if (moduleCommander != null)
|
||||
m_console.Output(moduleCommander.Help);
|
||||
}
|
||||
@@ -443,12 +449,42 @@ namespace OpenSim
|
||||
{
|
||||
RegionInfo regionInfo = scene.RegionInfo;
|
||||
|
||||
string estateOwnerFirstName = null;
|
||||
string estateOwnerLastName = null;
|
||||
string estateOwnerEMail = null;
|
||||
string estateOwnerPassword = null;
|
||||
string rawEstateOwnerUuid = null;
|
||||
|
||||
if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
|
||||
{
|
||||
string defaultEstateOwnerName
|
||||
= m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "").Trim();
|
||||
string[] ownerNames = defaultEstateOwnerName.Split(' ');
|
||||
|
||||
if (ownerNames.Length >= 2)
|
||||
{
|
||||
estateOwnerFirstName = ownerNames[0];
|
||||
estateOwnerLastName = ownerNames[1];
|
||||
}
|
||||
|
||||
// Info to be used only on Standalone Mode
|
||||
rawEstateOwnerUuid = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerUUID", null);
|
||||
estateOwnerEMail = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerEMail", null);
|
||||
estateOwnerPassword = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", null);
|
||||
}
|
||||
|
||||
MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName);
|
||||
List<char> excluded = new List<char>(new char[1]{' '});
|
||||
string first = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
|
||||
string last = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
|
||||
|
||||
UserAccount account = scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, first, last);
|
||||
|
||||
if (estateOwnerFirstName == null || estateOwnerLastName == null)
|
||||
{
|
||||
estateOwnerFirstName = MainConsole.Instance.CmdPrompt("Estate owner first name", "Test", excluded);
|
||||
estateOwnerLastName = MainConsole.Instance.CmdPrompt("Estate owner last name", "User", excluded);
|
||||
}
|
||||
|
||||
UserAccount account
|
||||
= scene.UserAccountService.GetUserAccount(regionInfo.ScopeID, estateOwnerFirstName, estateOwnerLastName);
|
||||
|
||||
if (account == null)
|
||||
{
|
||||
@@ -467,23 +503,35 @@ namespace OpenSim
|
||||
|
||||
if (scene.UserAccountService is UserAccountService)
|
||||
{
|
||||
string password = MainConsole.Instance.PasswdPrompt("Password");
|
||||
string email = MainConsole.Instance.CmdPrompt("Email", "");
|
||||
if (estateOwnerPassword == null)
|
||||
estateOwnerPassword = MainConsole.Instance.PasswdPrompt("Password");
|
||||
|
||||
string rawPrincipalId = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
|
||||
if (estateOwnerEMail == null)
|
||||
estateOwnerEMail = MainConsole.Instance.CmdPrompt("Email");
|
||||
|
||||
if (rawEstateOwnerUuid == null)
|
||||
rawEstateOwnerUuid = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
|
||||
|
||||
UUID principalId = UUID.Zero;
|
||||
if (!UUID.TryParse(rawPrincipalId, out principalId))
|
||||
UUID estateOwnerUuid = UUID.Zero;
|
||||
if (!UUID.TryParse(rawEstateOwnerUuid, out estateOwnerUuid))
|
||||
{
|
||||
m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawPrincipalId);
|
||||
m_log.ErrorFormat("[OPENSIM]: ID {0} is not a valid UUID", rawEstateOwnerUuid);
|
||||
return;
|
||||
}
|
||||
|
||||
// If we've been given a zero uuid then this signals that we should use a random user id
|
||||
if (estateOwnerUuid == UUID.Zero)
|
||||
estateOwnerUuid = UUID.Random();
|
||||
|
||||
account
|
||||
= ((UserAccountService)scene.UserAccountService).CreateUser(
|
||||
regionInfo.ScopeID, principalId, first, last, password, email);
|
||||
regionInfo.ScopeID,
|
||||
estateOwnerUuid,
|
||||
estateOwnerFirstName,
|
||||
estateOwnerLastName,
|
||||
estateOwnerPassword,
|
||||
estateOwnerEMail);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
if (account == null)
|
||||
@@ -883,15 +931,21 @@ namespace OpenSim
|
||||
/// This method doesn't allow an estate to be created with the same name as existing estates.
|
||||
/// </remarks>
|
||||
/// <param name="regInfo"></param>
|
||||
/// <param name="existingName">A list of estate names that already exist.</param>
|
||||
/// <param name="estatesByName">A list of estate names that already exist.</param>
|
||||
/// <param name="estateName">Estate name to create if already known</param>
|
||||
/// <returns>true if the estate was created, false otherwise</returns>
|
||||
public bool CreateEstate(RegionInfo regInfo, List<string> existingNames)
|
||||
public bool CreateEstate(RegionInfo regInfo, Dictionary<string, EstateSettings> estatesByName, string estateName)
|
||||
{
|
||||
// Create a new estate
|
||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, true);
|
||||
string newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
|
||||
|
||||
if (existingNames.Contains(newName))
|
||||
string newName;
|
||||
if (estateName != null && estateName != "")
|
||||
newName = estateName;
|
||||
else
|
||||
newName = MainConsole.Instance.CmdPrompt("New estate name", regInfo.EstateSettings.EstateName);
|
||||
|
||||
if (estatesByName.ContainsKey(newName))
|
||||
{
|
||||
MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName);
|
||||
return false;
|
||||
@@ -918,66 +972,102 @@ namespace OpenSim
|
||||
if (EstateDataService != null)
|
||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
|
||||
|
||||
if (regInfo.EstateSettings.EstateID == 0) // No record at all
|
||||
if (regInfo.EstateSettings.EstateID != 0)
|
||||
return;
|
||||
|
||||
m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
|
||||
|
||||
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
|
||||
Dictionary<string, EstateSettings> estatesByName = new Dictionary<string, EstateSettings>();
|
||||
|
||||
foreach (EstateSettings estate in estates)
|
||||
estatesByName[estate.EstateName] = estate;
|
||||
|
||||
string defaultEstateName = null;
|
||||
|
||||
if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null)
|
||||
{
|
||||
m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
|
||||
|
||||
List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
|
||||
List<string> estateNames = new List<string>();
|
||||
foreach (EstateSettings estate in estates)
|
||||
estateNames.Add(estate.EstateName);
|
||||
|
||||
while (true)
|
||||
defaultEstateName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateName", null);
|
||||
|
||||
if (defaultEstateName != null)
|
||||
{
|
||||
if (estates.Count == 0)
|
||||
{
|
||||
m_log.Info("[ESTATE] No existing estates found. You must create a new one.");
|
||||
|
||||
if (CreateEstate(regInfo, estateNames))
|
||||
break;
|
||||
EstateSettings defaultEstate;
|
||||
bool defaultEstateJoined = false;
|
||||
|
||||
if (estatesByName.ContainsKey(defaultEstateName))
|
||||
{
|
||||
defaultEstate = estatesByName[defaultEstateName];
|
||||
|
||||
if (EstateDataService.LinkRegion(regInfo.RegionID, (int)defaultEstate.EstateID))
|
||||
defaultEstateJoined = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CreateEstate(regInfo, estatesByName, defaultEstateName))
|
||||
defaultEstateJoined = true;
|
||||
}
|
||||
|
||||
if (defaultEstateJoined)
|
||||
return;
|
||||
else
|
||||
m_log.ErrorFormat(
|
||||
"[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName);
|
||||
}
|
||||
}
|
||||
|
||||
// If we have no default estate or creation of the default estate failed then ask the user.
|
||||
while (true)
|
||||
{
|
||||
if (estates.Count == 0)
|
||||
{
|
||||
m_log.Info("[ESTATE]: No existing estates found. You must create a new one.");
|
||||
|
||||
if (CreateEstate(regInfo, estatesByName, null))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
string response
|
||||
= MainConsole.Instance.CmdPrompt(
|
||||
string.Format(
|
||||
"Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
|
||||
"yes",
|
||||
new List<string>() { "yes", "no" });
|
||||
|
||||
if (response == "no")
|
||||
{
|
||||
if (CreateEstate(regInfo, estatesByName, null))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
string response
|
||||
string[] estateNames = estatesByName.Keys.ToArray();
|
||||
response
|
||||
= MainConsole.Instance.CmdPrompt(
|
||||
string.Format(
|
||||
"Do you wish to join region {0} to an existing estate (yes/no)?", regInfo.RegionName),
|
||||
"yes",
|
||||
new List<string>() { "yes", "no" });
|
||||
|
||||
if (response == "no")
|
||||
"Name of estate to join. Existing estate names are ({0})",
|
||||
string.Join(", ", estateNames)),
|
||||
estateNames[0]);
|
||||
|
||||
List<int> estateIDs = EstateDataService.GetEstates(response);
|
||||
if (estateIDs.Count < 1)
|
||||
{
|
||||
if (CreateEstate(regInfo, estateNames))
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
response
|
||||
= MainConsole.Instance.CmdPrompt(
|
||||
string.Format(
|
||||
"Name of estate to join. Existing estate names are ({0})", string.Join(", ", estateNames.ToArray())),
|
||||
estateNames[0]);
|
||||
|
||||
List<int> estateIDs = EstateDataService.GetEstates(response);
|
||||
if (estateIDs.Count < 1)
|
||||
{
|
||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
|
||||
continue;
|
||||
}
|
||||
|
||||
int estateID = estateIDs[0];
|
||||
|
||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
|
||||
|
||||
if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
|
||||
break;
|
||||
|
||||
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
||||
MainConsole.Instance.Output("The name you have entered matches no known estate. Please try again.");
|
||||
continue;
|
||||
}
|
||||
|
||||
int estateID = estateIDs[0];
|
||||
|
||||
regInfo.EstateSettings = EstateDataService.LoadEstateSettings(estateID);
|
||||
|
||||
if (EstateDataService.LinkRegion(regInfo.RegionID, estateID))
|
||||
break;
|
||||
|
||||
MainConsole.Instance.Output("Joining the estate failed. Please try again.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
{
|
||||
try
|
||||
{
|
||||
m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
|
||||
// m_log.Debug("[CAPS]: ScriptTaskInventory Request in region: " + m_regionName);
|
||||
//m_log.DebugFormat("[CAPS]: request: {0}, path: {1}, param: {2}", request, path, param);
|
||||
|
||||
Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace OpenSim.Region.ClientStack.Linden
|
||||
scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
"event queue",
|
||||
"Comms",
|
||||
false,
|
||||
"debug eq",
|
||||
"debug eq [0|1]",
|
||||
|
||||
@@ -317,7 +317,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
protected readonly UUID m_agentId;
|
||||
private readonly uint m_circuitCode;
|
||||
private readonly byte[] m_channelVersion = Utils.EmptyBytes;
|
||||
private readonly Dictionary<string, UUID> m_defaultAnimations = new Dictionary<string, UUID>();
|
||||
private readonly IGroupsModule m_GroupsModule;
|
||||
|
||||
private int m_cachedTextureSerial;
|
||||
@@ -452,10 +451,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
RegisterInterface<IClientChat>(this);
|
||||
RegisterInterface<IClientIPEndpoint>(this);
|
||||
|
||||
InitDefaultAnimations();
|
||||
|
||||
m_scene = scene;
|
||||
|
||||
m_entityUpdates = new PriorityQueue(m_scene.Entities.Count);
|
||||
m_entityProps = new PriorityQueue(m_scene.Entities.Count);
|
||||
m_fullUpdateDataBlocksBuilder = new List<ObjectUpdatePacket.ObjectDataBlock>();
|
||||
@@ -11210,30 +11206,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
OutPacket(scriptQuestion, ThrottleOutPacketType.Task);
|
||||
}
|
||||
|
||||
private void InitDefaultAnimations()
|
||||
{
|
||||
using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
|
||||
{
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.Load(reader);
|
||||
if (doc.DocumentElement != null)
|
||||
foreach (XmlNode nod in doc.DocumentElement.ChildNodes)
|
||||
{
|
||||
if (nod.Attributes["name"] != null)
|
||||
{
|
||||
string name = nod.Attributes["name"].Value.ToLower();
|
||||
string id = nod.InnerText;
|
||||
m_defaultAnimations.Add(name, (UUID)id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public UUID GetDefaultAnimation(string name)
|
||||
{
|
||||
if (m_defaultAnimations.ContainsKey(name))
|
||||
return m_defaultAnimations[name];
|
||||
return UUID.Zero;
|
||||
return SLUtil.GetDefaultAvatarAnimation(name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -244,8 +244,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
base.Start(m_recvBufferSize, m_asyncPacketHandling);
|
||||
|
||||
// Start the packet processing threads
|
||||
Watchdog.StartThread(IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false);
|
||||
Watchdog.StartThread(OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false);
|
||||
Watchdog.StartThread(
|
||||
IncomingPacketHandler, "Incoming Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false, true);
|
||||
Watchdog.StartThread(
|
||||
OutgoingPacketHandler, "Outgoing Packets (" + m_scene.RegionInfo.RegionName + ")", ThreadPriority.Normal, false, true);
|
||||
|
||||
m_elapsedMSSinceLastStatReport = Environment.TickCount;
|
||||
}
|
||||
|
||||
@@ -903,47 +906,64 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||
|
||||
private void HandleUseCircuitCode(object o)
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
IPEndPoint remoteEndPoint = null;
|
||||
IClientAPI client = null;
|
||||
|
||||
try
|
||||
{
|
||||
// DateTime startTime = DateTime.Now;
|
||||
object[] array = (object[])o;
|
||||
UDPPacketBuffer buffer = (UDPPacketBuffer)array[0];
|
||||
UseCircuitCodePacket uccp = (UseCircuitCodePacket)array[1];
|
||||
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
|
||||
|
||||
remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
{
|
||||
// Begin the process of adding the client to the simulator
|
||||
client
|
||||
= AddClient(
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
sessionInfo);
|
||||
|
||||
m_log.DebugFormat("[LLUDPSERVER]: Handling UseCircuitCode request from {0}", buffer.RemoteEndPoint);
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
client.SceneAgent.SendInitialDataToMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
|
||||
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
|
||||
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
|
||||
|
||||
IPEndPoint remoteEndPoint = (IPEndPoint)buffer.RemoteEndPoint;
|
||||
|
||||
AuthenticateResponse sessionInfo;
|
||||
if (IsClientAuthorized(uccp, out sessionInfo))
|
||||
{
|
||||
// Begin the process of adding the client to the simulator
|
||||
IClientAPI client
|
||||
= AddClient(
|
||||
uccp.CircuitCode.Code,
|
||||
uccp.CircuitCode.ID,
|
||||
uccp.CircuitCode.SessionID,
|
||||
remoteEndPoint,
|
||||
sessionInfo);
|
||||
|
||||
// Send ack straight away to let the viewer know that the connection is active.
|
||||
// The client will be null if it already exists (e.g. if on a region crossing the client sends a use
|
||||
// circuit code to the existing child agent. This is not particularly obvious.
|
||||
SendAckImmediate(remoteEndPoint, uccp.Header.Sequence);
|
||||
|
||||
// We only want to send initial data to new clients, not ones which are being converted from child to root.
|
||||
if (client != null)
|
||||
client.SceneAgent.SendInitialDataToMe();
|
||||
}
|
||||
else
|
||||
catch (Exception e)
|
||||
{
|
||||
// Don't create clients for unauthorized requesters.
|
||||
m_log.WarnFormat(
|
||||
"[LLUDPSERVER]: Connection request for client {0} connecting with unnotified circuit code {1} from {2}",
|
||||
uccp.CircuitCode.ID, uccp.CircuitCode.Code, remoteEndPoint);
|
||||
m_log.ErrorFormat(
|
||||
"[LLUDPSERVER]: UseCircuitCode handling from endpoint {0}, client {1} {2} failed. Exception {3}{4}",
|
||||
remoteEndPoint != null ? remoteEndPoint.ToString() : "n/a",
|
||||
client != null ? client.Name : "unknown",
|
||||
client != null ? client.AgentId.ToString() : "unknown",
|
||||
e.Message,
|
||||
e.StackTrace);
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[LLUDPSERVER]: Handling UseCircuitCode request from {0} took {1}ms",
|
||||
// buffer.RemoteEndPoint, (DateTime.Now - startTime).Milliseconds);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -203,10 +203,10 @@ namespace Flotsam.RegionModules.AssetCache
|
||||
m_CacheDirectoryTierLen = 4;
|
||||
}
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(Name, true, "fcache status", "fcache status", "Display cache status", HandleConsoleCommand);
|
||||
MainConsole.Instance.Commands.AddCommand(Name, true, "fcache clear", "fcache clear [file] [memory]", "Remove all assets in the cache. If file or memory is specified then only this cache is cleared.", HandleConsoleCommand);
|
||||
MainConsole.Instance.Commands.AddCommand(Name, true, "fcache assets", "fcache assets", "Attempt a deep scan and cache of all assets in all scenes", HandleConsoleCommand);
|
||||
MainConsole.Instance.Commands.AddCommand(Name, true, "fcache expire", "fcache expire <datetime>", "Purge cached assets older then the specified date/time", HandleConsoleCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache status", "fcache status", "Display cache status", HandleConsoleCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache clear", "fcache clear [file] [memory]", "Remove all assets in the cache. If file or memory is specified then only this cache is cleared.", HandleConsoleCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache assets", "fcache assets", "Attempt a deep scan and cache of all assets in all scenes", HandleConsoleCommand);
|
||||
MainConsole.Instance.Commands.AddCommand("Assets", true, "fcache expire", "fcache expire <datetime>", "Purge cached assets older then the specified date/time", HandleConsoleCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +111,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
|
||||
#region IAvatarFactoryModule
|
||||
|
||||
/// </summary>
|
||||
/// <param name="sp"></param>
|
||||
/// <param name="texture"></param>
|
||||
/// <param name="visualParam"></param>
|
||||
public void SetAppearance(IScenePresence sp, AvatarAppearance appearance)
|
||||
{
|
||||
SetAppearance(sp, appearance.Texture, appearance.VisualParams);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set appearance data (texture asset IDs and slider settings)
|
||||
/// </summary>
|
||||
@@ -156,14 +165,23 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
changed = sp.Appearance.SetTextureEntries(textureEntry) || changed;
|
||||
|
||||
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
|
||||
if (!ValidateBakedTextureCache(sp))
|
||||
|
||||
// If bake textures are missing and this is not an NPC, request a rebake from client
|
||||
if (!ValidateBakedTextureCache(sp) && (((ScenePresence)sp).PresenceType != PresenceType.Npc))
|
||||
RequestRebake(sp, true);
|
||||
|
||||
// This appears to be set only in the final stage of the appearance
|
||||
// update transaction. In theory, we should be able to do an immediate
|
||||
// appearance send and save here.
|
||||
}
|
||||
|
||||
|
||||
// NPC should send to clients immediately and skip saving appearance
|
||||
if (((ScenePresence)sp).PresenceType == PresenceType.Npc)
|
||||
{
|
||||
SendAppearance((ScenePresence)sp);
|
||||
return;
|
||||
}
|
||||
|
||||
// save only if there were changes, send no matter what (doesn't hurt to send twice)
|
||||
if (changed)
|
||||
QueueAppearanceSave(sp.ControllingClient.AgentId);
|
||||
@@ -174,6 +192,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// m_log.WarnFormat("[AVFACTORY]: complete SetAppearance for {0}:\n{1}",client.AgentId,sp.Appearance.ToString());
|
||||
}
|
||||
|
||||
private void SendAppearance(ScenePresence sp)
|
||||
{
|
||||
// Send the appearance to everyone in the scene
|
||||
sp.SendAppearanceToAllOtherAgents();
|
||||
|
||||
// Send animations back to the avatar as well
|
||||
sp.Animator.SendAnimPack();
|
||||
}
|
||||
|
||||
public bool SendAppearance(UUID agentId)
|
||||
{
|
||||
// m_log.DebugFormat("[AVFACTORY]: Sending appearance for {0}", agentId);
|
||||
@@ -185,12 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
return false;
|
||||
}
|
||||
|
||||
// Send the appearance to everyone in the scene
|
||||
sp.SendAppearanceToAllOtherAgents();
|
||||
|
||||
// Send animations back to the avatar as well
|
||||
sp.Animator.SendAnimPack();
|
||||
|
||||
SendAppearance(sp);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -474,6 +496,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
SetAppearanceAssets(sp.UUID, sp.Appearance);
|
||||
|
||||
m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
|
||||
|
||||
// Trigger this here because it's the final step in the set/queue/save process for appearance setting.
|
||||
// Everything has been updated and stored. Ensures bakes have been persisted (if option is set to persist bakes).
|
||||
m_scene.EventManager.TriggerAvatarAppearanceChanged(sp);
|
||||
}
|
||||
|
||||
private void SetAppearanceAssets(UUID userID, AvatarAppearance appearance)
|
||||
@@ -626,4 +652,4 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
outputAction("{0} baked appearance texture is {1}", sp.Name, bakedTextureValid ? "OK" : "corrupt");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,12 +51,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Dialog
|
||||
m_scene.RegisterModuleInterface<IDialogModule>(this);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert", "alert <message>",
|
||||
"Users", this, "alert", "alert <message>",
|
||||
"Send an alert to everyone",
|
||||
HandleAlertConsoleCommand);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "alert-user", "alert-user <first> <last> <message>",
|
||||
"Users", this, "alert-user", "alert-user <first> <last> <message>",
|
||||
"Send an alert to a user",
|
||||
HandleAlertConsoleCommand);
|
||||
}
|
||||
|
||||
@@ -270,12 +270,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
|
||||
m_archiveWriter = new TarArchiveWriter(m_saveStream);
|
||||
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Adding control file to archive.");
|
||||
|
||||
// Write out control file. This has to be done first so that subsequent loaders will see this file first
|
||||
// XXX: I know this is a weak way of doing it since external non-OAR aware tar executables will not do this
|
||||
// not sure how to fix this though, short of going with a completely different file format.
|
||||
m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, CreateControlFile(options));
|
||||
m_log.InfoFormat("[INVENTORY ARCHIVER]: Added control file to archive.");
|
||||
|
||||
|
||||
if (inventoryFolder != null)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
OnInventoryArchiveSaved += SaveInvConsoleCommandCompleted;
|
||||
|
||||
scene.AddCommand(
|
||||
this, "load iar",
|
||||
"Archiving", this, "load iar",
|
||||
"load iar [-m|--merge] <first> <last> <inventory path> <password> [<IAR path>]",
|
||||
"Load user inventory archive (IAR).",
|
||||
"-m|--merge is an option which merges the loaded IAR with existing inventory folders where possible, rather than always creating new ones"
|
||||
@@ -121,18 +121,18 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
HandleLoadInvConsoleCommand);
|
||||
|
||||
scene.AddCommand(
|
||||
this, "save iar",
|
||||
"Archiving", this, "save iar",
|
||||
"save iar [-h|--home=<url>] [--noassets] <first> <last> <inventory path> <password> [<IAR path>] [-c|--creators] [-v|--verbose]",
|
||||
"Save user inventory archive (IAR).",
|
||||
"<first> is the user's first name." + Environment.NewLine
|
||||
+ "<last> is the user's last name." + Environment.NewLine
|
||||
+ "<inventory path> is the path inside the user's inventory for the folder/item to be saved." + Environment.NewLine
|
||||
+ "-h|--home=<url> adds the url of the profile service to the saved user information." + Environment.NewLine
|
||||
+ "-c|--creators preserves information about foreign creators." + Environment.NewLine
|
||||
+ "-v|--verbose extra debug messages." + Environment.NewLine
|
||||
+ "--noassets stops assets being saved to the IAR."
|
||||
"<first> is the user's first name.\n"
|
||||
+ "<last> is the user's last name.\n"
|
||||
+ "<inventory path> is the path inside the user's inventory for the folder/item to be saved.\n"
|
||||
+ "<IAR path> is the filesystem path at which to save the IAR."
|
||||
+ string.Format(" If this is not given then the filename {0} in the current directory is used", DEFAULT_INV_BACKUP_FILENAME),
|
||||
+ string.Format(" If this is not given then the filename {0} in the current directory is used.\n", DEFAULT_INV_BACKUP_FILENAME)
|
||||
+ "-h|--home=<url> adds the url of the profile service to the saved user information.\n"
|
||||
+ "-c|--creators preserves information about foreign creators.\n"
|
||||
+ "-v|--verbose extra debug messages.\n"
|
||||
+ "--noassets stops assets being saved to the IAR.",
|
||||
HandleSaveInvConsoleCommand);
|
||||
|
||||
m_aScene = scene;
|
||||
@@ -349,8 +349,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
{
|
||||
try
|
||||
{
|
||||
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
|
||||
|
||||
Dictionary<string, object> options = new Dictionary<string, object>();
|
||||
OptionSet optionSet = new OptionSet().Add("m|merge", delegate (string v) { options["merge"] = v != null; });
|
||||
|
||||
@@ -412,7 +410,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
|
||||
return;
|
||||
}
|
||||
|
||||
m_log.Info("[INVENTORY ARCHIVER]: PLEASE NOTE THAT THIS FACILITY IS EXPERIMENTAL. BUG REPORTS WELCOME.");
|
||||
if (options.ContainsKey("home"))
|
||||
m_log.WarnFormat("[INVENTORY ARCHIVER]: Please be aware that inventory archives with creator information are not compatible with OpenSim 0.7.0.2 and earlier. Do not use the -home option if you want to produce a compatible IAR");
|
||||
|
||||
|
||||
@@ -150,7 +150,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
|
||||
string skillsText = String.Empty;
|
||||
string languages = String.Empty;
|
||||
|
||||
Byte[] charterMember = Utils.StringToBytes("Avatar");
|
||||
UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, avatarID);
|
||||
|
||||
string name = "Avatar";
|
||||
int created = 0;
|
||||
if (account != null)
|
||||
{
|
||||
name = account.FirstName + " " + account.LastName;
|
||||
created = account.Created;
|
||||
}
|
||||
Byte[] charterMember = Utils.StringToBytes(name);
|
||||
|
||||
profileUrl = "No profile data";
|
||||
aboutText = string.Empty;
|
||||
@@ -160,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Profile
|
||||
partner = UUID.Zero;
|
||||
|
||||
remoteClient.SendAvatarProperties(avatarID, aboutText,
|
||||
Util.ToDateTime(0).ToString(
|
||||
Util.ToDateTime(created).ToString(
|
||||
"M/d/yyyy", CultureInfo.InvariantCulture),
|
||||
charterMember, firstLifeAboutText,
|
||||
(uint)(0 & 0xff),
|
||||
|
||||
@@ -69,9 +69,10 @@ namespace OpenSim.Region.CoreModules.Framework
|
||||
{
|
||||
m_scene = scene;
|
||||
m_scene.RegisterModuleInterface<ICapabilitiesModule>(this);
|
||||
MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps",
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("Comms", false, "show caps",
|
||||
"show caps",
|
||||
"Shows all registered capabilities", HandleShowCapsCommand);
|
||||
"Shows all registered capabilities for users", HandleShowCapsCommand);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
|
||||
@@ -304,6 +304,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this.
|
||||
return;
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Request Teleport to {0} ({1}) {2}/{3}",
|
||||
reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
|
||||
@@ -994,6 +997,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
neighbourRegion.RegionHandle);
|
||||
return agent;
|
||||
}
|
||||
// No turning back
|
||||
agent.IsChildAgent = true;
|
||||
|
||||
string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
|
||||
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
|
||||
@@ -1138,7 +1144,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
/// <summary>
|
||||
/// This informs all neighbouring regions about agent "avatar".
|
||||
/// Calls an asynchronous method to do so.. so it doesn't lag the sim.
|
||||
/// </summary>
|
||||
/// <param name="sp"></param>
|
||||
public void EnableChildAgents(ScenePresence sp)
|
||||
@@ -1258,12 +1263,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle)
|
||||
{
|
||||
InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
try
|
||||
{
|
||||
d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
||||
InformClientOfNeighbourCompleted,
|
||||
d);
|
||||
// Let's put this back at sync, so that it doesn't clog
|
||||
// the network, especially for regions in the same physical server.
|
||||
// We're really not in a hurry here.
|
||||
InformClientOfNeighbourAsync(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent);
|
||||
//InformClientOfNeighbourDelegate d = InformClientOfNeighbourAsync;
|
||||
//d.BeginInvoke(sp, cagents[count], neighbour, neighbour.ExternalEndPoint, newAgent,
|
||||
// InformClientOfNeighbourCompleted,
|
||||
// d);
|
||||
}
|
||||
|
||||
catch (ArgumentOutOfRangeException)
|
||||
@@ -1698,14 +1707,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
// Offset the positions for the new region across the border
|
||||
Vector3 oldGroupPosition = grp.RootPart.GroupPosition;
|
||||
grp.RootPart.GroupPosition = pos;
|
||||
|
||||
// If we fail to cross the border, then reset the position of the scene object on that border.
|
||||
uint x = 0, y = 0;
|
||||
Utils.LongToUInts(newRegionHandle, out x, out y);
|
||||
GridRegion destination = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
|
||||
|
||||
if (destination == null || !CrossPrimGroupIntoNewRegion(destination, grp, silent))
|
||||
if (destination == null || !CrossPrimGroupIntoNewRegion(destination, pos, grp, silent))
|
||||
{
|
||||
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}",grp.UUID);
|
||||
|
||||
@@ -1735,7 +1743,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
/// true if the crossing itself was successful, false on failure
|
||||
/// FIMXE: we still return true if the crossing object was not successfully deleted from the originating region
|
||||
/// </returns>
|
||||
protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, SceneObjectGroup grp, bool silent)
|
||||
protected bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent)
|
||||
{
|
||||
//m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<");
|
||||
|
||||
@@ -1760,7 +1768,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
//if (m_interregionCommsOut != null)
|
||||
// successYN = m_interregionCommsOut.SendCreateObject(newRegionHandle, grp, true);
|
||||
if (m_aScene.SimulationService != null)
|
||||
successYN = m_aScene.SimulationService.CreateObject(destination, grp, true);
|
||||
successYN = m_aScene.SimulationService.CreateObject(destination, newPosition, grp, true);
|
||||
|
||||
if (successYN)
|
||||
{
|
||||
@@ -1819,7 +1827,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
gobj.IsAttachment = false;
|
||||
//gobj.RootPart.LastOwnerID = gobj.GetFromAssetID();
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending attachment {0} to region {1}", gobj.UUID, destination.RegionName);
|
||||
CrossPrimGroupIntoNewRegion(destination, gobj, silent);
|
||||
CrossPrimGroupIntoNewRegion(destination, Vector3.Zero, gobj, silent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1856,6 +1864,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
}
|
||||
}
|
||||
|
||||
protected bool IsInTransit(UUID id)
|
||||
{
|
||||
lock (m_agentsInTransit)
|
||||
{
|
||||
if (m_agentsInTransit.Contains(id))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected bool ResetFromTransit(UUID id)
|
||||
{
|
||||
lock (m_agentsInTransit)
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
string userAssetServer = string.Empty;
|
||||
if (IsForeignUser(avatarID, out userAssetServer) && userAssetServer != string.Empty && m_OutboundPermission)
|
||||
{
|
||||
Util.FireAndForget(delegate { m_assMapper.Post(assetID, avatarID, userAssetServer); });
|
||||
m_assMapper.Post(assetID, avatarID, userAssetServer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -551,9 +551,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
||||
// "[INVENTORY ACCESS MODULE]: Target of {0} in CreateItemForObject() is {1} {2}",
|
||||
// action, remoteClient.Name, userID);
|
||||
}
|
||||
else if (so.RootPart.OwnerID == so.RootPart.GroupID)
|
||||
{
|
||||
// Group owned objects go to the last owner before the object was transferred.
|
||||
userID = so.RootPart.LastOwnerID;
|
||||
}
|
||||
else
|
||||
{
|
||||
// All returns / deletes go to the object owner
|
||||
// Other returns / deletes go to the object owner
|
||||
//
|
||||
userID = so.RootPart.OwnerID;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
|
||||
|
||||
m_scene = scene;
|
||||
|
||||
m_scene.AddCommand(this, "monitor report",
|
||||
m_scene.AddCommand("General", this, "monitor report",
|
||||
"monitor report",
|
||||
"Returns a variety of statistics about the current region and/or simulator",
|
||||
DebugMonitors);
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
MainConsole.Instance.Commands.AddCommand("grid", true,
|
||||
MainConsole.Instance.Commands.AddCommand("Users", true,
|
||||
"show names",
|
||||
"show names",
|
||||
"Show the bindings between user UUIDs and user names",
|
||||
|
||||
@@ -1210,7 +1210,7 @@ namespace OpenSim.Region.CoreModules.InterGrid
|
||||
if (homeScene.TryGetScenePresence(avatarId,out avatar))
|
||||
{
|
||||
KillAUser ku = new KillAUser(avatar,mod);
|
||||
Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true);
|
||||
Watchdog.StartThread(ku.ShutdownNoLogout, "OGPShutdown", ThreadPriority.Normal, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -151,6 +151,14 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||
|
||||
#region IWorldComm Members
|
||||
|
||||
public int ListenerCount
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_listenerManager.ListenerCount;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create a listen event callback with the specified filters.
|
||||
/// The parameters localID,itemID are needed to uniquely identify
|
||||
@@ -438,6 +446,18 @@ namespace OpenSim.Region.CoreModules.Scripting.WorldComm
|
||||
private int m_maxhandles;
|
||||
private int m_curlisteners;
|
||||
|
||||
/// <summary>
|
||||
/// Total number of listeners
|
||||
/// </summary>
|
||||
public int ListenerCount
|
||||
{
|
||||
get
|
||||
{
|
||||
lock (m_listeners)
|
||||
return m_listeners.Count;
|
||||
}
|
||||
}
|
||||
|
||||
public ListenerManager(int maxlisteners, int maxhandles)
|
||||
{
|
||||
m_maxlisteners = maxlisteners;
|
||||
|
||||
@@ -73,14 +73,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
|
||||
return;
|
||||
}
|
||||
|
||||
string serviceDll = assetConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
string serviceDll = assetConfig.GetString("LocalServiceModule", String.Empty);
|
||||
|
||||
if (serviceDll == String.Empty)
|
||||
{
|
||||
m_log.Error("[LOCAL ASSET SERVICES CONNECTOR]: No LocalServiceModule named in section AssetService");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Loading asset service at {0}", serviceDll);
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { source };
|
||||
m_AssetService = ServerUtils.LoadPlugin<IAssetService>(serviceDll, args);
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are met:
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* * Neither the name of the OpenSimulator Project nor the
|
||||
* names of its contributors may be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
|
||||
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
|
||||
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using Nini.Config;
|
||||
using log4net;
|
||||
using OpenSim.Framework;
|
||||
using OpenSim.Services.Interfaces;
|
||||
using OpenSim.Region.Framework.Interfaces;
|
||||
using OpenSim.Region.Framework.Scenes;
|
||||
using OpenMetaverse;
|
||||
|
||||
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
|
||||
{
|
||||
public class AuthorizationService : IAuthorizationService
|
||||
{
|
||||
private enum AccessFlags
|
||||
{
|
||||
None = 0, /* No restrictions */
|
||||
DisallowResidents = 1, /* Only gods and managers*/
|
||||
DisallowForeigners = 2, /* Only local people */
|
||||
}
|
||||
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IUserManagement m_UserManagement;
|
||||
private IGridService m_GridService;
|
||||
|
||||
private Scene m_Scene;
|
||||
AccessFlags m_accessValue = AccessFlags.None;
|
||||
|
||||
|
||||
public AuthorizationService(IConfig config, Scene scene)
|
||||
{
|
||||
m_Scene = scene;
|
||||
m_UserManagement = scene.RequestModuleInterface<IUserManagement>();
|
||||
m_GridService = scene.GridService;
|
||||
|
||||
if (config != null)
|
||||
{
|
||||
string accessStr = config.GetString("Region_" + scene.RegionInfo.RegionName.Replace(' ', '_'), String.Empty);
|
||||
if (accessStr != string.Empty)
|
||||
{
|
||||
try
|
||||
{
|
||||
m_accessValue = (AccessFlags)Enum.Parse(typeof(AccessFlags), accessStr);
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
m_log.WarnFormat("[AuthorizationService]: {0} is not a valid access flag", accessStr);
|
||||
}
|
||||
}
|
||||
m_log.DebugFormat("[AuthorizationService]: Region {0} access restrictions: {1}", m_Scene.RegionInfo.RegionName, m_accessValue);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public bool IsAuthorizedForRegion(
|
||||
string user, string firstName, string lastName, string regionID, out string message)
|
||||
{
|
||||
message = "authorized";
|
||||
|
||||
// This should not happen
|
||||
if (m_Scene.RegionInfo.RegionID.ToString() != regionID)
|
||||
{
|
||||
m_log.WarnFormat("[AuthorizationService]: Service for region {0} received request to authorize for region {1}",
|
||||
m_Scene.RegionInfo.RegionID, regionID);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_accessValue == AccessFlags.None)
|
||||
return true;
|
||||
|
||||
UUID userID = new UUID(user);
|
||||
bool authorized = true;
|
||||
if ((m_accessValue & AccessFlags.DisallowForeigners) == AccessFlags.DisallowForeigners)
|
||||
{
|
||||
authorized = m_UserManagement.IsLocalGridUser(userID);
|
||||
if (!authorized)
|
||||
message = "no foreigner users allowed in this region";
|
||||
}
|
||||
if (authorized && (m_accessValue & AccessFlags.DisallowResidents) == AccessFlags.DisallowResidents)
|
||||
{
|
||||
authorized = m_Scene.Permissions.IsGod(userID) | m_Scene.Permissions.IsAdministrator(userID);
|
||||
if (!authorized)
|
||||
message = "only Admins and Managers allowed in this region";
|
||||
}
|
||||
|
||||
return authorized;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -39,13 +39,15 @@ using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
|
||||
{
|
||||
public class LocalAuthorizationServicesConnector : ISharedRegionModule, IAuthorizationService
|
||||
public class LocalAuthorizationServicesConnector : INonSharedRegionModule, IAuthorizationService
|
||||
{
|
||||
private static readonly ILog m_log =
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private IAuthorizationService m_AuthorizationService;
|
||||
private Scene m_Scene;
|
||||
private IConfig m_AuthorizationConfig;
|
||||
|
||||
private bool m_Enabled = false;
|
||||
|
||||
@@ -69,33 +71,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
|
||||
string name = moduleConfig.GetString("AuthorizationServices", string.Empty);
|
||||
if (name == Name)
|
||||
{
|
||||
IConfig authorizationConfig = source.Configs["AuthorizationService"];
|
||||
if (authorizationConfig == null)
|
||||
{
|
||||
m_log.Error("[AUTHORIZATION CONNECTOR]: AuthorizationService missing from OpenSim.ini");
|
||||
return;
|
||||
}
|
||||
|
||||
string serviceDll = authorizationConfig.GetString("LocalServiceModule",
|
||||
String.Empty);
|
||||
|
||||
if (serviceDll == String.Empty)
|
||||
{
|
||||
m_log.Error("[AUTHORIZATION CONNECTOR]: No LocalServiceModule named in section AuthorizationService");
|
||||
return;
|
||||
}
|
||||
|
||||
Object[] args = new Object[] { source };
|
||||
m_AuthorizationService =
|
||||
ServerUtils.LoadPlugin<IAuthorizationService>(serviceDll,
|
||||
args);
|
||||
|
||||
if (m_AuthorizationService == null)
|
||||
{
|
||||
m_log.Error("[AUTHORIZATION CONNECTOR]: Can't load authorization service");
|
||||
return;
|
||||
}
|
||||
m_Enabled = true;
|
||||
m_AuthorizationConfig = source.Configs["AuthorizationService"];
|
||||
m_log.Info("[AUTHORIZATION CONNECTOR]: Local authorization connector enabled");
|
||||
}
|
||||
}
|
||||
@@ -115,6 +92,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
|
||||
return;
|
||||
|
||||
scene.RegisterModuleInterface<IAuthorizationService>(this);
|
||||
m_Scene = scene;
|
||||
|
||||
scene.EventManager.OnLoginsEnabled += new EventManager.LoginsEnabled(OnLoginsEnabled);
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
@@ -131,9 +111,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
|
||||
scene.RegionInfo.RegionName);
|
||||
}
|
||||
|
||||
private void OnLoginsEnabled(string regionName)
|
||||
{
|
||||
m_AuthorizationService = new AuthorizationService(m_AuthorizationConfig, m_Scene);
|
||||
}
|
||||
|
||||
public bool IsAuthorizedForRegion(
|
||||
string userID, string firstName, string lastName, string regionID, out string message)
|
||||
{
|
||||
message = "";
|
||||
if (!m_Enabled)
|
||||
return true;
|
||||
|
||||
return m_AuthorizationService.IsAuthorizedForRegion(userID, firstName, lastName, regionID, out message);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,8 +48,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
LogManager.GetLogger(
|
||||
MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private static LocalGridServicesConnector m_MainInstance;
|
||||
|
||||
private IGridService m_GridService;
|
||||
private Dictionary<UUID, RegionCache> m_LocalCache = new Dictionary<UUID, RegionCache>();
|
||||
|
||||
@@ -62,7 +60,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
public LocalGridServicesConnector(IConfigSource source)
|
||||
{
|
||||
m_log.Debug("[LOCAL GRID CONNECTOR]: LocalGridServicesConnector instantiated");
|
||||
m_MainInstance = this;
|
||||
InitialiseService(source);
|
||||
}
|
||||
|
||||
@@ -87,7 +84,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
if (name == Name)
|
||||
{
|
||||
InitialiseService(source);
|
||||
m_MainInstance = this;
|
||||
m_Enabled = true;
|
||||
m_log.Info("[LOCAL GRID CONNECTOR]: Local grid connector enabled");
|
||||
}
|
||||
@@ -126,12 +122,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
if (m_MainInstance == this)
|
||||
{
|
||||
MainConsole.Instance.Commands.AddCommand("LocalGridConnector", false, "show neighbours",
|
||||
"show neighbours",
|
||||
"Shows the local regions' neighbours", NeighboursCommand);
|
||||
}
|
||||
MainConsole.Instance.Commands.AddCommand("Regions", false, "show neighbours",
|
||||
"show neighbours",
|
||||
"Shows the local regions' neighbours", NeighboursCommand);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
@@ -143,22 +136,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
if (m_Enabled)
|
||||
scene.RegisterModuleInterface<IGridService>(this);
|
||||
|
||||
if (m_MainInstance == this)
|
||||
{
|
||||
if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID))
|
||||
m_log.ErrorFormat("[LOCAL GRID CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!");
|
||||
else
|
||||
m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene));
|
||||
}
|
||||
if (m_LocalCache.ContainsKey(scene.RegionInfo.RegionID))
|
||||
m_log.ErrorFormat("[LOCAL GRID CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!");
|
||||
else
|
||||
m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene));
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
if (m_MainInstance == this)
|
||||
{
|
||||
m_LocalCache[scene.RegionInfo.RegionID].Clear();
|
||||
m_LocalCache.Remove(scene.RegionInfo.RegionID);
|
||||
}
|
||||
m_LocalCache[scene.RegionInfo.RegionID].Clear();
|
||||
m_LocalCache.Remove(scene.RegionInfo.RegionID);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
@@ -259,6 +246,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
|
||||
MainConsole.Instance.Output(caps.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,13 +65,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
}
|
||||
}
|
||||
|
||||
internal struct ScopedRegionPosition
|
||||
{
|
||||
public UUID m_scopeID;
|
||||
public ulong m_regionHandle;
|
||||
public ScopedRegionPosition(UUID scopeID, ulong handle)
|
||||
{
|
||||
m_scopeID = scopeID;
|
||||
m_regionHandle = handle;
|
||||
}
|
||||
}
|
||||
|
||||
private ExpiringCache<ScopedRegionUUID, GridRegion> m_UUIDCache;
|
||||
private ExpiringCache<ScopedRegionName, ScopedRegionUUID> m_NameCache;
|
||||
private ExpiringCache<ScopedRegionPosition, GridRegion> m_PositionCache;
|
||||
|
||||
public RegionInfoCache()
|
||||
{
|
||||
m_UUIDCache = new ExpiringCache<ScopedRegionUUID, GridRegion>();
|
||||
m_NameCache = new ExpiringCache<ScopedRegionName, ScopedRegionUUID>();
|
||||
m_NameCache = new ExpiringCache<ScopedRegionName, ScopedRegionUUID>();
|
||||
m_PositionCache = new ExpiringCache<ScopedRegionPosition, GridRegion>();
|
||||
}
|
||||
|
||||
public void Cache(GridRegion rinfo)
|
||||
@@ -96,6 +109,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
{
|
||||
ScopedRegionName name = new ScopedRegionName(scopeID,rinfo.RegionName);
|
||||
m_NameCache.AddOrUpdate(name, id, CACHE_EXPIRATION_SECONDS);
|
||||
|
||||
ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, rinfo.RegionHandle);
|
||||
m_PositionCache.AddOrUpdate(pos, rinfo, CACHE_EXPIRATION_SECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,6 +130,22 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
return null;
|
||||
}
|
||||
|
||||
public GridRegion Get(UUID scopeID, ulong handle, out bool inCache)
|
||||
{
|
||||
inCache = false;
|
||||
|
||||
GridRegion rinfo = null;
|
||||
ScopedRegionPosition pos = new ScopedRegionPosition(scopeID, handle);
|
||||
if (m_PositionCache.TryGetValue(pos, out rinfo))
|
||||
{
|
||||
inCache = true;
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public GridRegion Get(UUID scopeID, string name, out bool inCache)
|
||||
{
|
||||
inCache = false;
|
||||
|
||||
@@ -186,10 +186,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||
|
||||
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
{
|
||||
GridRegion rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
|
||||
bool inCache = false;
|
||||
GridRegion rinfo = m_RegionInfoCache.Get(scopeID, Util.UIntsToLong((uint)x, (uint)y), out inCache);
|
||||
if (inCache)
|
||||
return rinfo;
|
||||
|
||||
rinfo = m_LocalGridService.GetRegionByPosition(scopeID, x, y);
|
||||
if (rinfo == null)
|
||||
rinfo = m_RemoteGridService.GetRegionByPosition(scopeID, x, y);
|
||||
|
||||
m_RegionInfoCache.Cache(rinfo);
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -58,6 +58,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
private List<Scene> m_Scenes = new List<Scene>();
|
||||
|
||||
private InventoryCache m_Cache = new InventoryCache();
|
||||
|
||||
protected IUserManagement m_UserManagement;
|
||||
protected IUserManagement UserManagementModule
|
||||
{
|
||||
@@ -312,6 +314,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
public InventoryFolderBase GetRootFolder(UUID userID)
|
||||
{
|
||||
//m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID);
|
||||
InventoryFolderBase root = m_Cache.GetRootFolder(userID);
|
||||
if (root != null)
|
||||
return root;
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
@@ -320,12 +325,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
IInventoryService connector = GetConnector(invURL);
|
||||
|
||||
return connector.GetRootFolder(userID);
|
||||
root = connector.GetRootFolder(userID);
|
||||
|
||||
m_Cache.Cache(userID, root);
|
||||
|
||||
return root;
|
||||
}
|
||||
|
||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
||||
{
|
||||
//m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type);
|
||||
InventoryFolderBase f = m_Cache.GetFolderForType(userID, type);
|
||||
if (f != null)
|
||||
return f;
|
||||
|
||||
string invURL = GetInventoryServiceURL(userID);
|
||||
|
||||
@@ -334,7 +346,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
|
||||
IInventoryService connector = GetConnector(invURL);
|
||||
|
||||
return connector.GetFolderForType(userID, type);
|
||||
f = connector.GetFolderForType(userID, type);
|
||||
|
||||
m_Cache.Cache(userID, type, f);
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using OpenSim.Framework;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
|
||||
{
|
||||
public class InventoryCache
|
||||
{
|
||||
private const double CACHE_EXPIRATION_SECONDS = 3600.0; // 1 hour
|
||||
|
||||
private static ExpiringCache<UUID, InventoryFolderBase> m_RootFolders = new ExpiringCache<UUID, InventoryFolderBase>();
|
||||
private static ExpiringCache<UUID, Dictionary<AssetType, InventoryFolderBase>> m_FolderTypes = new ExpiringCache<UUID, Dictionary<AssetType, InventoryFolderBase>>();
|
||||
|
||||
public void Cache(UUID userID, InventoryFolderBase root)
|
||||
{
|
||||
lock (m_RootFolders)
|
||||
m_RootFolders.AddOrUpdate(userID, root, CACHE_EXPIRATION_SECONDS);
|
||||
}
|
||||
|
||||
public InventoryFolderBase GetRootFolder(UUID userID)
|
||||
{
|
||||
InventoryFolderBase root = null;
|
||||
if (m_RootFolders.TryGetValue(userID, out root))
|
||||
return root;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Cache(UUID userID, AssetType type, InventoryFolderBase folder)
|
||||
{
|
||||
lock (m_FolderTypes)
|
||||
{
|
||||
Dictionary<AssetType, InventoryFolderBase> ff = null;
|
||||
if (!m_FolderTypes.TryGetValue(userID, out ff))
|
||||
{
|
||||
ff = new Dictionary<AssetType, InventoryFolderBase>();
|
||||
m_FolderTypes.Add(userID, ff, CACHE_EXPIRATION_SECONDS);
|
||||
}
|
||||
if (!ff.ContainsKey(type))
|
||||
ff.Add(type, folder);
|
||||
}
|
||||
}
|
||||
|
||||
public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
|
||||
{
|
||||
Dictionary<AssetType, InventoryFolderBase> ff = null;
|
||||
if (m_FolderTypes.TryGetValue(userID, out ff))
|
||||
{
|
||||
InventoryFolderBase f = null;
|
||||
if (ff.TryGetValue(type, out f))
|
||||
return f;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,7 +315,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
* Object-related communications
|
||||
*/
|
||||
|
||||
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
|
||||
public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall)
|
||||
{
|
||||
if (destination == null)
|
||||
return false;
|
||||
@@ -330,12 +330,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
// We need to make a local copy of the object
|
||||
ISceneObject sogClone = sog.CloneForNewScene();
|
||||
sogClone.SetState(sog.GetStateSnapshot(), s);
|
||||
return s.IncomingCreateObject(sogClone);
|
||||
return s.IncomingCreateObject(newPosition, sogClone);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Use the object as it came through the wire
|
||||
return s.IncomingCreateObject(sog);
|
||||
return s.IncomingCreateObject(newPosition, sog);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,13 +282,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
* Object-related communications
|
||||
*/
|
||||
|
||||
public bool CreateObject(GridRegion destination, ISceneObject sog, bool isLocalCall)
|
||||
public bool CreateObject(GridRegion destination, Vector3 newPosition, ISceneObject sog, bool isLocalCall)
|
||||
{
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
// Try local first
|
||||
if (m_localBackend.CreateObject(destination, sog, isLocalCall))
|
||||
if (m_localBackend.CreateObject(destination, newPosition, sog, isLocalCall))
|
||||
{
|
||||
//m_log.Debug("[REST COMMS]: LocalBackEnd SendCreateObject succeeded");
|
||||
return true;
|
||||
@@ -296,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
|
||||
// else do the remote thing
|
||||
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
|
||||
return m_remoteConnector.CreateObject(destination, sog, isLocalCall);
|
||||
return m_remoteConnector.CreateObject(destination, newPosition, sog, isLocalCall);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -47,21 +47,21 @@ namespace OpenSim.Region.CoreModules.World
|
||||
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
MainConsole.Instance.Commands.AddCommand("access", true,
|
||||
MainConsole.Instance.Commands.AddCommand("Users", true,
|
||||
"login enable",
|
||||
"login enable",
|
||||
"Enable simulator logins",
|
||||
String.Empty,
|
||||
HandleLoginCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("access", true,
|
||||
MainConsole.Instance.Commands.AddCommand("Users", true,
|
||||
"login disable",
|
||||
"login disable",
|
||||
"Disable simulator logins",
|
||||
String.Empty,
|
||||
HandleLoginCommand);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("access", true,
|
||||
MainConsole.Instance.Commands.AddCommand("Users", true,
|
||||
"login status",
|
||||
"login status",
|
||||
"Show login status",
|
||||
|
||||
@@ -108,12 +108,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
// "[ARCHIVER]: Received {0} of {1} assets requested",
|
||||
// assetsFoundUuids.Count, assetsFoundUuids.Count + assetsNotFoundUuids.Count);
|
||||
|
||||
m_log.InfoFormat("[ARCHIVER]: Adding region settings to archive.");
|
||||
|
||||
// Write out region settings
|
||||
string settingsPath
|
||||
= String.Format("{0}{1}.xml", ArchiveConstants.SETTINGS_PATH, m_scene.RegionInfo.RegionName);
|
||||
m_archiveWriter.WriteFile(settingsPath, RegionSettingsSerializer.Serialize(m_scene.RegionInfo.RegionSettings));
|
||||
|
||||
m_log.InfoFormat("[ARCHIVER]: Added region settings to archive.");
|
||||
m_log.InfoFormat("[ARCHIVER]: Adding parcel settings to archive.");
|
||||
|
||||
// Write out land data (aka parcel) settings
|
||||
List<ILandObject>landObjects = m_scene.LandChannel.AllParcels();
|
||||
@@ -124,7 +126,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
landData.GlobalID.ToString());
|
||||
m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData));
|
||||
}
|
||||
m_log.InfoFormat("[ARCHIVER]: Added parcel settings to archive.");
|
||||
|
||||
m_log.InfoFormat("[ARCHIVER]: Adding terrain information to archive.");
|
||||
|
||||
// Write out terrain
|
||||
string terrainPath
|
||||
@@ -135,7 +138,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
m_archiveWriter.WriteFile(terrainPath, ms.ToArray());
|
||||
ms.Close();
|
||||
|
||||
m_log.InfoFormat("[ARCHIVER]: Added terrain information to archive.");
|
||||
m_log.InfoFormat("[ARCHIVER]: Adding scene objects to archive.");
|
||||
|
||||
// Write out scene object metadata
|
||||
foreach (SceneObjectGroup sceneObject in m_sceneObjects)
|
||||
@@ -145,10 +148,6 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
string serializedObject = m_serialiser.SerializeGroupToXml2(sceneObject, m_options);
|
||||
m_archiveWriter.WriteFile(ArchiveHelpers.CreateObjectPath(sceneObject), serializedObject);
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[ARCHIVER]: Added scene objects to archive.");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -219,12 +219,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
m_log.InfoFormat("[ARCHIVER]: Added control file to archive.");
|
||||
|
||||
if (SaveAssets)
|
||||
new AssetsRequest(
|
||||
new AssetsArchiver(archiveWriter), assetUuids,
|
||||
m_scene.AssetService, m_scene.UserAccountService,
|
||||
m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets).Execute();
|
||||
{
|
||||
AssetsRequest ar
|
||||
= new AssetsRequest(
|
||||
new AssetsArchiver(archiveWriter), assetUuids,
|
||||
m_scene.AssetService, m_scene.UserAccountService,
|
||||
m_scene.RegionInfo.ScopeID, options, awre.ReceivedAllAssets);
|
||||
|
||||
Util.FireAndForget(o => ar.Execute());
|
||||
}
|
||||
else
|
||||
{
|
||||
awre.ReceivedAllAssets(new List<UUID>(), new List<UUID>());
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
@@ -141,13 +141,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
PerformAssetsRequestCallback(null);
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
|
||||
{
|
||||
m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
|
||||
}
|
||||
|
||||
m_requestCallbackTimer.Enabled = true;
|
||||
|
||||
foreach (KeyValuePair<UUID, AssetType> kvp in m_uuids)
|
||||
{
|
||||
// m_assetService.Get(kvp.Key.ToString(), kvp.Value, PreAssetRequestCallback);
|
||||
AssetBase asset = m_assetService.Get(kvp.Key.ToString());
|
||||
PreAssetRequestCallback(kvp.Key.ToString(), kvp.Value, asset);
|
||||
}
|
||||
}
|
||||
|
||||
protected void OnRequestCallbackTimeout(object source, ElapsedEventArgs args)
|
||||
|
||||
@@ -62,58 +62,25 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName);
|
||||
|
||||
m_module.Scene.AddCommand(m_module, "set terrain texture",
|
||||
m_module.Scene.AddCommand("Regions", m_module, "set terrain texture",
|
||||
"set terrain texture <number> <uuid> [<x>] [<y>]",
|
||||
"Sets the terrain <number> to <uuid>, if <x> or <y> are specified, it will only " +
|
||||
"set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
|
||||
" that coordinate.",
|
||||
consoleSetTerrainTexture);
|
||||
|
||||
m_module.Scene.AddCommand(m_module, "set terrain heights",
|
||||
m_module.Scene.AddCommand("Regions", m_module, "set terrain heights",
|
||||
"set terrain heights <corner> <min> <max> [<x>] [<y>]",
|
||||
"Sets the terrain texture heights on corner #<corner> to <min>/<max>, if <x> or <y> are specified, it will only " +
|
||||
"set it on regions with a matching coordinate. Specify -1 in <x> or <y> to wildcard" +
|
||||
" that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3.",
|
||||
consoleSetTerrainHeights);
|
||||
|
||||
Command showCommand
|
||||
= new Command("show", CommandIntentions.COMMAND_STATISTICAL, ShowEstatesCommand, "Shows all estates on the simulator.");
|
||||
consoleSetTerrainHeights);
|
||||
|
||||
m_commander.RegisterCommand("show", showCommand);
|
||||
|
||||
m_module.Scene.RegisterModuleCommander(m_commander);
|
||||
|
||||
m_module.Scene.EventManager.OnPluginConsole += EventManagerOnPluginConsole;
|
||||
m_module.Scene.AddCommand(
|
||||
"Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand);
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_module.Scene.EventManager.OnPluginConsole -= EventManagerOnPluginConsole;
|
||||
m_module.Scene.UnregisterModuleCommander(m_commander.Name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Processes commandline input. Do not call directly.
|
||||
/// </summary>
|
||||
/// <param name="args">Commandline arguments</param>
|
||||
protected void EventManagerOnPluginConsole(string[] args)
|
||||
{
|
||||
if (args[0] == "estate")
|
||||
{
|
||||
if (args.Length == 1)
|
||||
{
|
||||
m_commander.ProcessConsoleCommand("help", new string[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
string[] tmpArgs = new string[args.Length - 2];
|
||||
int i;
|
||||
for (i = 2; i < args.Length; i++)
|
||||
tmpArgs[i - 2] = args[i];
|
||||
|
||||
m_commander.ProcessConsoleCommand(args[1], tmpArgs);
|
||||
}
|
||||
}
|
||||
public void Close() {}
|
||||
|
||||
protected void consoleSetTerrainTexture(string module, string[] args)
|
||||
{
|
||||
@@ -201,7 +168,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
}
|
||||
}
|
||||
|
||||
protected void ShowEstatesCommand(Object[] args)
|
||||
protected void ShowEstatesCommand(string module, string[] cmd)
|
||||
{
|
||||
StringBuilder report = new StringBuilder();
|
||||
RegionInfo ri = m_module.Scene.RegionInfo;
|
||||
|
||||
@@ -26,8 +26,10 @@
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Security;
|
||||
using log4net;
|
||||
@@ -45,8 +47,6 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private delegate void LookupUUIDS(List<UUID> uuidLst);
|
||||
|
||||
public Scene Scene { get; private set; }
|
||||
public IUserManagement UserManager { get; private set; }
|
||||
|
||||
@@ -876,98 +876,77 @@ namespace OpenSim.Region.CoreModules.World.Estate
|
||||
if (!Scene.Permissions.CanIssueEstateCommand(remoteClient.AgentId, false))
|
||||
return;
|
||||
|
||||
Dictionary<uint, float> SceneData = new Dictionary<uint,float>();
|
||||
Dictionary<uint, float> sceneData = null;
|
||||
List<UUID> uuidNameLookupList = new List<UUID>();
|
||||
|
||||
if (reportType == 1)
|
||||
{
|
||||
SceneData = Scene.PhysicsScene.GetTopColliders();
|
||||
sceneData = Scene.PhysicsScene.GetTopColliders();
|
||||
}
|
||||
else if (reportType == 0)
|
||||
{
|
||||
SceneData = Scene.SceneGraph.GetTopScripts();
|
||||
IScriptModule scriptModule = Scene.RequestModuleInterface<IScriptModule>();
|
||||
|
||||
if (scriptModule != null)
|
||||
sceneData = scriptModule.GetObjectScriptsExecutionTimes();
|
||||
}
|
||||
|
||||
List<LandStatReportItem> SceneReport = new List<LandStatReportItem>();
|
||||
lock (SceneData)
|
||||
if (sceneData != null)
|
||||
{
|
||||
foreach (uint obj in SceneData.Keys)
|
||||
var sortedSceneData
|
||||
= sceneData.Select(
|
||||
item => new { Measurement = item.Value, Part = Scene.GetSceneObjectPart(item.Key) });
|
||||
|
||||
sortedSceneData.OrderBy(item => item.Measurement);
|
||||
|
||||
int items = 0;
|
||||
|
||||
foreach (var entry in sortedSceneData)
|
||||
{
|
||||
SceneObjectPart prt = Scene.GetSceneObjectPart(obj);
|
||||
if (prt != null)
|
||||
// The object may have been deleted since we received the data.
|
||||
if (entry.Part == null)
|
||||
continue;
|
||||
|
||||
// Don't show scripts that haven't executed or where execution time is below one microsecond in
|
||||
// order to produce a more readable report.
|
||||
if (entry.Measurement < 0.001)
|
||||
continue;
|
||||
|
||||
items++;
|
||||
SceneObjectGroup so = entry.Part.ParentGroup;
|
||||
|
||||
LandStatReportItem lsri = new LandStatReportItem();
|
||||
lsri.LocationX = so.AbsolutePosition.X;
|
||||
lsri.LocationY = so.AbsolutePosition.Y;
|
||||
lsri.LocationZ = so.AbsolutePosition.Z;
|
||||
lsri.Score = entry.Measurement;
|
||||
lsri.TaskID = so.UUID;
|
||||
lsri.TaskLocalID = so.LocalId;
|
||||
lsri.TaskName = entry.Part.Name;
|
||||
lsri.OwnerName = UserManager.GetUserName(so.OwnerID);
|
||||
|
||||
if (filter.Length != 0)
|
||||
{
|
||||
SceneObjectGroup sog = prt.ParentGroup;
|
||||
LandStatReportItem lsri = new LandStatReportItem();
|
||||
lsri.LocationX = sog.AbsolutePosition.X;
|
||||
lsri.LocationY = sog.AbsolutePosition.Y;
|
||||
lsri.LocationZ = sog.AbsolutePosition.Z;
|
||||
lsri.Score = SceneData[obj];
|
||||
lsri.TaskID = sog.UUID;
|
||||
lsri.TaskLocalID = sog.LocalId;
|
||||
lsri.TaskName = sog.GetPartName(obj);
|
||||
lsri.OwnerName = "waiting";
|
||||
lock (uuidNameLookupList)
|
||||
uuidNameLookupList.Add(sog.OwnerID);
|
||||
|
||||
if (filter.Length != 0)
|
||||
if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter)))
|
||||
{
|
||||
if ((lsri.OwnerName.Contains(filter) || lsri.TaskName.Contains(filter)))
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
SceneReport.Add(lsri);
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
SceneReport.Add(lsri);
|
||||
|
||||
if (items >= 100)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
remoteClient.SendLandStatReply(reportType, requestFlags, (uint)SceneReport.Count,SceneReport.ToArray());
|
||||
|
||||
if (uuidNameLookupList.Count > 0)
|
||||
LookupUUID(uuidNameLookupList);
|
||||
}
|
||||
|
||||
private static void LookupUUIDSCompleted(IAsyncResult iar)
|
||||
{
|
||||
LookupUUIDS icon = (LookupUUIDS)iar.AsyncState;
|
||||
icon.EndInvoke(iar);
|
||||
}
|
||||
|
||||
private void LookupUUID(List<UUID> uuidLst)
|
||||
{
|
||||
LookupUUIDS d = LookupUUIDsAsync;
|
||||
|
||||
d.BeginInvoke(uuidLst,
|
||||
LookupUUIDSCompleted,
|
||||
d);
|
||||
}
|
||||
|
||||
private void LookupUUIDsAsync(List<UUID> uuidLst)
|
||||
{
|
||||
UUID[] uuidarr;
|
||||
|
||||
lock (uuidLst)
|
||||
{
|
||||
uuidarr = uuidLst.ToArray();
|
||||
}
|
||||
|
||||
for (int i = 0; i < uuidarr.Length; i++)
|
||||
{
|
||||
// string lookupname = m_scene.CommsManager.UUIDNameRequestString(uuidarr[i]);
|
||||
|
||||
IUserManagement userManager = Scene.RequestModuleInterface<IUserManagement>();
|
||||
if (userManager != null)
|
||||
userManager.GetUserName(uuidarr[i]);
|
||||
|
||||
// we drop it. It gets cached though... so we're ready for the next request.
|
||||
// diva commnent 11/21/2010: uh?!? wft?
|
||||
// justincc comment 21/01/2011: A side effect of userManager.GetUserName() I presume.
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Outgoing Packets
|
||||
|
||||
@@ -94,8 +94,11 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
|
||||
// caches ExtendedLandData
|
||||
private Cache parcelInfoCache;
|
||||
private Dictionary<UUID, Vector3> forcedPosition =
|
||||
new Dictionary<UUID, Vector3>();
|
||||
|
||||
/// <summary>
|
||||
/// Record positions that avatar's are currently being forced to move to due to parcel entry restrictions.
|
||||
/// </summary>
|
||||
private Dictionary<UUID, Vector3> forcedPosition = new Dictionary<UUID, Vector3>();
|
||||
|
||||
#region INonSharedRegionModule Members
|
||||
|
||||
@@ -224,22 +227,34 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
//When the avatar walks into a ban line on the ground, it prevents getting stuck
|
||||
agentData.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
||||
|
||||
|
||||
//Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines
|
||||
if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) < .2)
|
||||
{
|
||||
Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition));
|
||||
// m_log.DebugFormat(
|
||||
// "[LAND MANAGEMENT MODULE]: Stopping force position of {0} because {1} is close enough to {2}",
|
||||
// clientAvatar.Name, clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]);
|
||||
|
||||
forcedPosition.Remove(remoteClient.AgentId);
|
||||
}
|
||||
//if we are far away, teleport
|
||||
else if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]) > 3)
|
||||
{
|
||||
Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}", forcedPosition[remoteClient.AgentId], clientAvatar.AbsolutePosition));
|
||||
clientAvatar.Teleport(forcedPosition[remoteClient.AgentId]);
|
||||
Vector3 forcePosition = forcedPosition[remoteClient.AgentId];
|
||||
// m_log.DebugFormat(
|
||||
// "[LAND MANAGEMENT MODULE]: Teleporting out {0} because {1} is too far from avatar position {2}",
|
||||
// clientAvatar.Name, clientAvatar.AbsolutePosition, forcePosition);
|
||||
|
||||
m_scene.RequestTeleportLocation(remoteClient, m_scene.RegionInfo.RegionHandle,
|
||||
forcePosition, clientAvatar.Lookat, (uint)Constants.TeleportFlags.ForceRedirect);
|
||||
|
||||
forcedPosition.Remove(remoteClient.AgentId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[LAND MANAGEMENT MODULE]: Forcing {0} from {1} to {2}",
|
||||
// clientAvatar.Name, clientAvatar.AbsolutePosition, forcedPosition[remoteClient.AgentId]);
|
||||
|
||||
//Forces them toward the forced position we want if they aren't there yet
|
||||
agentData.UseClientAgentPosition = true;
|
||||
agentData.ClientAgentPosition = forcedPosition[remoteClient.AgentId];
|
||||
|
||||
@@ -272,7 +272,8 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
ParcelFlags.AllowGroupScripts |
|
||||
ParcelFlags.CreateGroupObjects |
|
||||
ParcelFlags.AllowAPrimitiveEntry |
|
||||
ParcelFlags.AllowGroupObjectEntry);
|
||||
ParcelFlags.AllowGroupObjectEntry |
|
||||
ParcelFlags.AllowFly);
|
||||
}
|
||||
|
||||
if (m_scene.Permissions.CanEditParcelProperties(remote_client.AgentId, this, GroupPowers.LandSetSale))
|
||||
|
||||
@@ -78,45 +78,45 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
|
||||
m_scene = scene;
|
||||
m_console = MainConsole.Instance;
|
||||
|
||||
m_console.Commands.AddCommand("region", false, "delete object owner",
|
||||
m_console.Commands.AddCommand("Regions", false, "delete object owner",
|
||||
"delete object owner <UUID>",
|
||||
"Delete a scene object by owner", HandleDeleteObject);
|
||||
m_console.Commands.AddCommand("region", false, "delete object creator",
|
||||
m_console.Commands.AddCommand("Regions", false, "delete object creator",
|
||||
"delete object creator <UUID>",
|
||||
"Delete a scene object by creator", HandleDeleteObject);
|
||||
m_console.Commands.AddCommand("region", false, "delete object uuid",
|
||||
m_console.Commands.AddCommand("Regions", false, "delete object uuid",
|
||||
"delete object uuid <UUID>",
|
||||
"Delete a scene object by uuid", HandleDeleteObject);
|
||||
m_console.Commands.AddCommand("region", false, "delete object name",
|
||||
m_console.Commands.AddCommand("Regions", false, "delete object name",
|
||||
"delete object name <name>",
|
||||
"Delete a scene object by name", HandleDeleteObject);
|
||||
m_console.Commands.AddCommand("region", false, "delete object outside",
|
||||
m_console.Commands.AddCommand("Regions", false, "delete object outside",
|
||||
"delete object outside",
|
||||
"Delete all scene objects outside region boundaries", HandleDeleteObject);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"region",
|
||||
"Regions",
|
||||
false,
|
||||
"show object uuid",
|
||||
"show object uuid <UUID>",
|
||||
"Show details of a scene object with the given UUID", HandleShowObjectByUuid);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"region",
|
||||
"Regions",
|
||||
false,
|
||||
"show object name",
|
||||
"show object name <name>",
|
||||
"Show details of scene objects with the given name", HandleShowObjectByName);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"region",
|
||||
"Regions",
|
||||
false,
|
||||
"show part uuid",
|
||||
"show part uuid <UUID>",
|
||||
"Show details of a scene object parts with the given UUID", HandleShowPartByUuid);
|
||||
|
||||
m_console.Commands.AddCommand(
|
||||
"region",
|
||||
"Regions",
|
||||
false,
|
||||
"show part name",
|
||||
"show part name <name>",
|
||||
|
||||
@@ -206,17 +206,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia;
|
||||
m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia;
|
||||
|
||||
m_scene.AddCommand(this, "bypass permissions",
|
||||
m_scene.AddCommand("Users", this, "bypass permissions",
|
||||
"bypass permissions <true / false>",
|
||||
"Bypass permission checks",
|
||||
HandleBypassPermissions);
|
||||
|
||||
m_scene.AddCommand(this, "force permissions",
|
||||
m_scene.AddCommand("Users", this, "force permissions",
|
||||
"force permissions <true / false>",
|
||||
"Force permissions on or off",
|
||||
HandleForcePermissions);
|
||||
|
||||
m_scene.AddCommand(this, "debug permissions",
|
||||
m_scene.AddCommand("Users", this, "debug permissions",
|
||||
"debug permissions <true / false>",
|
||||
"Turn on permissions debugging",
|
||||
HandleDebugPermissions);
|
||||
@@ -677,18 +677,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
bool permission = false;
|
||||
bool locked = false;
|
||||
|
||||
if (!m_scene.Entities.ContainsKey(objId))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(objId);
|
||||
|
||||
// If it's not an object, we cant edit it.
|
||||
if ((!(m_scene.Entities[objId] is SceneObjectGroup)))
|
||||
{
|
||||
if (part == null)
|
||||
return false;
|
||||
}
|
||||
|
||||
SceneObjectGroup group = (SceneObjectGroup)m_scene.Entities[objId];
|
||||
SceneObjectGroup group = part.ParentGroup;
|
||||
|
||||
UUID objectOwner = group.OwnerID;
|
||||
locked = ((group.RootPart.OwnerMask & PERM_LOCKED) == 0);
|
||||
@@ -707,7 +701,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
// Object owners should be able to edit their own content
|
||||
if (currentUser == objectOwner)
|
||||
{
|
||||
permission = true;
|
||||
// there is no way that later code can change this back to false
|
||||
// so just return true immediately and short circuit the more
|
||||
// expensive group checks
|
||||
return true;
|
||||
|
||||
//permission = true;
|
||||
}
|
||||
else if (group.IsAttachment)
|
||||
{
|
||||
@@ -972,16 +971,6 @@ namespace OpenSim.Region.CoreModules.World.Permissions
|
||||
DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name);
|
||||
if (m_bypassPermissions) return m_bypassPermissionsValue;
|
||||
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(objectID);
|
||||
|
||||
// If we selected a sub-prim to edit, the objectID won't represent the object, but only a part.
|
||||
// We have to check the permissions of the group, though.
|
||||
if (part.ParentID != 0)
|
||||
{
|
||||
objectID = part.ParentUUID;
|
||||
part = m_scene.GetSceneObjectPart(objectID);
|
||||
}
|
||||
|
||||
return GenericObjectPermission(editorID, objectID, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -66,21 +66,21 @@ namespace OpenSim.Region.CoreModules.World.Region
|
||||
m_Scene = scene;
|
||||
|
||||
scene.RegisterModuleInterface<IRestartModule>(this);
|
||||
MainConsole.Instance.Commands.AddCommand("RestartModule",
|
||||
MainConsole.Instance.Commands.AddCommand("Regions",
|
||||
false, "region restart bluebox",
|
||||
"region restart bluebox <message> <delta seconds>+",
|
||||
"Schedule a region restart",
|
||||
"Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.",
|
||||
HandleRegionRestart);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("RestartModule",
|
||||
MainConsole.Instance.Commands.AddCommand("Regions",
|
||||
false, "region restart notice",
|
||||
"region restart notice <message> <delta seconds>+",
|
||||
"Schedule a region restart",
|
||||
"Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.",
|
||||
HandleRegionRestart);
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("RestartModule",
|
||||
MainConsole.Instance.Commands.AddCommand("Regions",
|
||||
false, "region restart abort",
|
||||
"region restart abort [<message>]",
|
||||
"Abort a region restart", HandleRegionRestart);
|
||||
|
||||
@@ -148,6 +148,113 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||
<OtherParts />
|
||||
</SceneObjectGroup>";
|
||||
|
||||
private string badFloatsXml = @"
|
||||
<SceneObjectGroup>
|
||||
<RootPart>
|
||||
<SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
|
||||
<AllowedDrop>false</AllowedDrop>
|
||||
<CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
|
||||
<FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID>
|
||||
<InventorySerial>1</InventorySerial>
|
||||
<TaskInventory />
|
||||
<ObjectFlags>0</ObjectFlags>
|
||||
<UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
|
||||
<LocalId>2698615125</LocalId>
|
||||
<Name>NaughtyPrim</Name>
|
||||
<Material>0</Material>
|
||||
<PassTouches>false</PassTouches>
|
||||
<RegionHandle>1099511628032000</RegionHandle>
|
||||
<ScriptAccessPin>0</ScriptAccessPin>
|
||||
<GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition>
|
||||
<OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
|
||||
<RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset>
|
||||
<Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
|
||||
<RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
|
||||
<AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
|
||||
<Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
|
||||
<Description />
|
||||
<Color />
|
||||
<Text />
|
||||
<SitName />
|
||||
<TouchName />
|
||||
<LinkNum>0</LinkNum>
|
||||
<ClickAction>0</ClickAction>
|
||||
<Shape>
|
||||
<ProfileCurve>1</ProfileCurve>
|
||||
<TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
|
||||
<ExtraParams>AA==</ExtraParams>
|
||||
<PathBegin>0</PathBegin>
|
||||
<PathCurve>16</PathCurve>
|
||||
<PathEnd>0</PathEnd>
|
||||
<PathRadiusOffset>0</PathRadiusOffset>
|
||||
<PathRevolutions>0</PathRevolutions>
|
||||
<PathScaleX>100</PathScaleX>
|
||||
<PathScaleY>100</PathScaleY>
|
||||
<PathShearX>0</PathShearX>
|
||||
<PathShearY>0</PathShearY>
|
||||
<PathSkew>0</PathSkew>
|
||||
<PathTaperX>0</PathTaperX>
|
||||
<PathTaperY>0</PathTaperY>
|
||||
<PathTwist>0</PathTwist>
|
||||
<PathTwistBegin>0</PathTwistBegin>
|
||||
<PCode>9</PCode>
|
||||
<ProfileBegin>0</ProfileBegin>
|
||||
<ProfileEnd>0</ProfileEnd>
|
||||
<ProfileHollow>0</ProfileHollow>
|
||||
<Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
|
||||
<State>0</State>
|
||||
<ProfileShape>Square</ProfileShape>
|
||||
<HollowShape>Same</HollowShape>
|
||||
<SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
|
||||
<SculptType>0</SculptType><SculptData />
|
||||
<FlexiSoftness>0</FlexiSoftness>
|
||||
<FlexiTension>0,5</FlexiTension>
|
||||
<FlexiDrag>yo mamma</FlexiDrag>
|
||||
<FlexiGravity>0</FlexiGravity>
|
||||
<FlexiWind>0</FlexiWind>
|
||||
<FlexiForceX>0</FlexiForceX>
|
||||
<FlexiForceY>0</FlexiForceY>
|
||||
<FlexiForceZ>0</FlexiForceZ>
|
||||
<LightColorR>0</LightColorR>
|
||||
<LightColorG>0</LightColorG>
|
||||
<LightColorB>0</LightColorB>
|
||||
<LightColorA>1</LightColorA>
|
||||
<LightRadius>0</LightRadius>
|
||||
<LightCutoff>0</LightCutoff>
|
||||
<LightFalloff>0</LightFalloff>
|
||||
<LightIntensity>1</LightIntensity>
|
||||
<FlexiEntry>false</FlexiEntry>
|
||||
<LightEntry>false</LightEntry>
|
||||
<SculptEntry>false</SculptEntry>
|
||||
</Shape>
|
||||
<Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
|
||||
<UpdateFlag>0</UpdateFlag>
|
||||
<SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
|
||||
<SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
|
||||
<SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
|
||||
<SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
|
||||
<ParentID>0</ParentID>
|
||||
<CreationDate>1211330445</CreationDate>
|
||||
<Category>0</Category>
|
||||
<SalePrice>0</SalePrice>
|
||||
<ObjectSaleType>0</ObjectSaleType>
|
||||
<OwnershipCost>0</OwnershipCost>
|
||||
<GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
|
||||
<OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID>
|
||||
<LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID>
|
||||
<BaseMask>2147483647</BaseMask>
|
||||
<OwnerMask>2147483647</OwnerMask>
|
||||
<GroupMask>0</GroupMask>
|
||||
<EveryoneMask>0</EveryoneMask>
|
||||
<NextOwnerMask>2147483647</NextOwnerMask>
|
||||
<Flags>None</Flags>
|
||||
<CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
|
||||
<CollisionSoundVolume>0</CollisionSoundVolume>
|
||||
</SceneObjectPart>
|
||||
</RootPart>
|
||||
<OtherParts />
|
||||
</SceneObjectGroup>";
|
||||
|
||||
private string xml2 = @"
|
||||
<SceneObjectGroup>
|
||||
<SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
|
||||
@@ -256,6 +363,32 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
|
||||
// TODO: Check other properties
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDeserializeBadFloatsXml()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
// log4net.Config.XmlConfigurator.Configure();
|
||||
|
||||
SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml);
|
||||
SceneObjectPart rootPart = so.RootPart;
|
||||
|
||||
Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
|
||||
Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
|
||||
Assert.That(rootPart.Name, Is.EqualTo("NaughtyPrim"));
|
||||
|
||||
// This terminates the deserialization earlier if couldn't be parsed.
|
||||
// TODO: Need to address this
|
||||
Assert.That(rootPart.GroupPosition.X, Is.EqualTo(147.23f));
|
||||
|
||||
Assert.That(rootPart.Shape.PathCurve, Is.EqualTo(16));
|
||||
|
||||
// Defaults for bad parses
|
||||
Assert.That(rootPart.Shape.FlexiTension, Is.EqualTo(0));
|
||||
Assert.That(rootPart.Shape.FlexiDrag, Is.EqualTo(0));
|
||||
|
||||
// TODO: Check other properties
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestSerializeXml()
|
||||
{
|
||||
|
||||
@@ -277,18 +277,19 @@ namespace OpenSim.Region.CoreModules
|
||||
m_frame = 0;
|
||||
|
||||
// This one puts an entry in the main help screen
|
||||
m_scene.AddCommand(this, String.Empty, "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null);
|
||||
// m_scene.AddCommand("Regions", this, "sun", "sun", "Usage: sun [param] [value] - Get or Update Sun module paramater", null);
|
||||
|
||||
// This one enables the ability to type just "sun" without any parameters
|
||||
m_scene.AddCommand(this, "sun", "", "", HandleSunConsoleCommand);
|
||||
// m_scene.AddCommand("Regions", this, "sun", "", "", HandleSunConsoleCommand);
|
||||
foreach (KeyValuePair<string, string> kvp in GetParamList())
|
||||
{
|
||||
m_scene.AddCommand(this, String.Format("sun {0}", kvp.Key), String.Format("{0} - {1}", kvp.Key, kvp.Value), "", HandleSunConsoleCommand);
|
||||
string sunCommand = string.Format("sun {0}", kvp.Key);
|
||||
m_scene.AddCommand("Regions", this, sunCommand, string.Format("{0} [<value>]", sunCommand), kvp.Value, "", HandleSunConsoleCommand);
|
||||
}
|
||||
|
||||
TimeZone local = TimeZone.CurrentTimeZone;
|
||||
TicksUTCOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks;
|
||||
m_log.Debug("[SUN]: localtime offset is " + TicksUTCOffset);
|
||||
m_log.DebugFormat("[SUN]: localtime offset is {0}", TicksUTCOffset);
|
||||
|
||||
// Align ticks with Second Life
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
private volatile bool m_tainted;
|
||||
private readonly Stack<LandUndoState> m_undo = new Stack<LandUndoState>(5);
|
||||
|
||||
private String m_InitialTerrain = "pinhead-island";
|
||||
|
||||
/// <summary>
|
||||
/// Human readable list of terrain file extensions that are supported.
|
||||
/// </summary>
|
||||
@@ -109,6 +111,9 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
/// <param name="config">Config for the region</param>
|
||||
public void Initialise(IConfigSource config)
|
||||
{
|
||||
IConfig terrainConfig = config.Configs["Terrain"];
|
||||
if (terrainConfig != null)
|
||||
m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain);
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
@@ -120,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain
|
||||
{
|
||||
if (m_scene.Heightmap == null)
|
||||
{
|
||||
m_channel = new TerrainChannel();
|
||||
m_channel = new TerrainChannel(m_InitialTerrain);
|
||||
m_scene.Heightmap = m_channel;
|
||||
m_revert = new TerrainChannel();
|
||||
UpdateRevertMap();
|
||||
|
||||
@@ -117,24 +117,31 @@ namespace OpenSim.Region.CoreModules
|
||||
}
|
||||
|
||||
// This one puts an entry in the main help screen
|
||||
m_scene.AddCommand(this, String.Empty, "wind", "Usage: wind <plugin> <param> [value] - Get or Update Wind paramaters", null);
|
||||
// m_scene.AddCommand("Regions", this, "wind", "wind", "Usage: wind <plugin> <param> [value] - Get or Update Wind paramaters", null);
|
||||
|
||||
// This one enables the ability to type just the base command without any parameters
|
||||
m_scene.AddCommand(this, "wind", "", "", HandleConsoleCommand);
|
||||
// m_scene.AddCommand("Regions", this, "wind", "", "", HandleConsoleCommand);
|
||||
|
||||
// Get a list of the parameters for each plugin
|
||||
foreach (IWindModelPlugin windPlugin in m_availableWindPlugins.Values)
|
||||
{
|
||||
m_scene.AddCommand(this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand);
|
||||
m_scene.AddCommand(this, String.Format("wind base wind_update_rate"), "Change the wind update rate.", "", HandleConsoleBaseCommand);
|
||||
// m_scene.AddCommand("Regions", this, String.Format("wind base wind_plugin {0}", windPlugin.Name), String.Format("{0} - {1}", windPlugin.Name, windPlugin.Description), "", HandleConsoleBaseCommand);
|
||||
m_scene.AddCommand(
|
||||
"Regions",
|
||||
this,
|
||||
"wind base wind_update_rate",
|
||||
"wind base wind_update_rate [<value>]",
|
||||
"Get or set the wind update rate.",
|
||||
"",
|
||||
HandleConsoleBaseCommand);
|
||||
|
||||
foreach (KeyValuePair<string, string> kvp in windPlugin.WindParams())
|
||||
{
|
||||
m_scene.AddCommand(this, String.Format("wind {0} {1}", windPlugin.Name, kvp.Key), String.Format("{0} : {1} - {2}", windPlugin.Name, kvp.Key, kvp.Value), "", HandleConsoleParamCommand);
|
||||
string windCommand = String.Format("wind {0} {1}", windPlugin.Name, kvp.Key);
|
||||
m_scene.AddCommand("Regions", this, windCommand, string.Format("{0} [<value>]", windCommand), kvp.Value, "", HandleConsoleParamCommand);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Register event handlers for when Avatars enter the region, and frame ticks
|
||||
m_scene.EventManager.OnFrame += WindUpdate;
|
||||
m_scene.EventManager.OnMakeRootAgent += OnAgentEnteredRegion;
|
||||
|
||||
@@ -92,7 +92,23 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
return;
|
||||
}
|
||||
|
||||
//m_log.DebugFormat("MAP NAME=({0})", mapName);
|
||||
//m_log.DebugFormat("MAP NAME=({0})", mapName);
|
||||
|
||||
// Hack to get around the fact that ll V3 now drops the port from the
|
||||
// map name. See https://jira.secondlife.com/browse/VWR-28570
|
||||
//
|
||||
// Caller, use this magic form instead:
|
||||
// secondlife://http|!!mygrid.com|8002|Region+Name/128/128
|
||||
// or url encode if possible.
|
||||
// the hacks we do with this viewer...
|
||||
//
|
||||
string mapNameOrig = mapName;
|
||||
if (mapName.Contains("|"))
|
||||
mapName = mapName.Replace('|', ':');
|
||||
if (mapName.Contains("+"))
|
||||
mapName = mapName.Replace('+', ' ');
|
||||
if (mapName.Contains("!"))
|
||||
mapName = mapName.Replace('!', '/');
|
||||
|
||||
// try to fetch from GridServer
|
||||
List<GridRegion> regionInfos = m_scene.GridService.GetRegionsByName(m_scene.RegionInfo.ScopeID, mapName, 20);
|
||||
@@ -114,7 +130,12 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
data.MapImageId = UUID.Zero;
|
||||
else
|
||||
data.MapImageId = info.TerrainImage;
|
||||
data.Name = info.RegionName;
|
||||
// ugh! V2-3 is very sensitive about the result being
|
||||
// exactly the same as the requested name
|
||||
if (regionInfos.Count == 1)
|
||||
data.Name = mapNameOrig;
|
||||
else
|
||||
data.Name = info.RegionName;
|
||||
data.RegionFlags = 0; // TODO not used?
|
||||
data.WaterHeight = 0; // not used
|
||||
data.X = (ushort)(info.RegionLocX / Constants.RegionSize);
|
||||
@@ -138,6 +159,17 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
// flags are agent flags sent from the viewer.
|
||||
// they have different values depending on different viewers, apparently
|
||||
remoteClient.SendMapBlock(blocks, flags);
|
||||
|
||||
// send extra user messages for V3
|
||||
// because the UI is very confusing
|
||||
// while we don't fix the hard-coded urls
|
||||
if (flags == 2)
|
||||
{
|
||||
if (regionInfos.Count == 0)
|
||||
remoteClient.SendAgentAlertMessage("No regions found with that name.", true);
|
||||
else if (regionInfos.Count == 1)
|
||||
remoteClient.SendAgentAlertMessage("Region found!", false);
|
||||
}
|
||||
}
|
||||
|
||||
// private Scene GetClientScene(IClientAPI client)
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
m_scene.RegisterModuleInterface<IWorldMapModule>(this);
|
||||
|
||||
m_scene.AddCommand(
|
||||
this, "export-map",
|
||||
"Regions", this, "export-map",
|
||||
"export-map [<path>]",
|
||||
"Save an image of the world map", HandleExportWorldMapConsoleCommand);
|
||||
|
||||
@@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
{
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
@@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
// There is a major hack going on in this method. The viewer doesn't request
|
||||
// map blocks (RequestMapBlocks) above 2048. That means that if we don't hack,
|
||||
// grids above that cell don't have a map at all. So, here's the hack: we wait
|
||||
// for this CAP request to come, and we inject the map blocks at this point.
|
||||
// for this CAP request to come, and we inject the map blocks at this point.
|
||||
// In a normal scenario, this request simply sends back the MapLayer (the blue color).
|
||||
// In the hacked scenario, it also sends the map blocks via UDP.
|
||||
//
|
||||
@@ -351,6 +351,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
process,
|
||||
string.Format("MapItemRequestThread ({0})", m_scene.RegionInfo.RegionName),
|
||||
ThreadPriority.BelowNormal,
|
||||
true,
|
||||
true);
|
||||
}
|
||||
|
||||
@@ -750,7 +751,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
{
|
||||
uint x = 0, y = 0;
|
||||
Utils.LongToUInts(regionhandle, out x, out y);
|
||||
GridRegion mreg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
|
||||
GridRegion mreg = m_scene.GridService.GetRegionByPosition(m_scene.RegionInfo.ScopeID, (int)x, (int)y);
|
||||
|
||||
if (mreg != null)
|
||||
{
|
||||
@@ -856,7 +857,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
finally
|
||||
{
|
||||
if (os != null)
|
||||
os.Close();
|
||||
os.Close();
|
||||
}
|
||||
|
||||
string response_mapItems_reply = null;
|
||||
@@ -959,16 +960,16 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
// on an unloaded square.
|
||||
// But make sure: Look whether the one we requested is in there
|
||||
List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
|
||||
minX * (int)Constants.RegionSize,
|
||||
maxX * (int)Constants.RegionSize,
|
||||
minY * (int)Constants.RegionSize,
|
||||
minX * (int)Constants.RegionSize,
|
||||
maxX * (int)Constants.RegionSize,
|
||||
minY * (int)Constants.RegionSize,
|
||||
maxY * (int)Constants.RegionSize);
|
||||
|
||||
if (regions != null)
|
||||
{
|
||||
foreach (GridRegion r in regions)
|
||||
{
|
||||
if ((r.RegionLocX == minX * (int)Constants.RegionSize) &&
|
||||
if ((r.RegionLocX == minX * (int)Constants.RegionSize) &&
|
||||
(r.RegionLocY == minY * (int)Constants.RegionSize))
|
||||
{
|
||||
// found it => add it to response
|
||||
@@ -1003,7 +1004,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
{
|
||||
List<MapBlockData> mapBlocks = new List<MapBlockData>();
|
||||
List<GridRegion> regions = m_scene.GridService.GetRegionRange(m_scene.RegionInfo.ScopeID,
|
||||
(minX - 4) * (int)Constants.RegionSize,
|
||||
(minX - 4) * (int)Constants.RegionSize,
|
||||
(maxX + 4) * (int)Constants.RegionSize,
|
||||
(minY - 4) * (int)Constants.RegionSize,
|
||||
(maxY + 4) * (int)Constants.RegionSize);
|
||||
@@ -1335,7 +1336,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
// Cannot create a map for a nonexistant heightmap
|
||||
if (m_scene.Heightmap == null)
|
||||
return;
|
||||
|
||||
|
||||
//create a texture asset of the terrain
|
||||
IMapImageGenerator terrain = m_scene.RequestModuleInterface<IMapImageGenerator>();
|
||||
if (terrain == null)
|
||||
@@ -1344,7 +1345,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
byte[] data = terrain.WriteJpeg2000Image();
|
||||
if (data == null)
|
||||
return;
|
||||
|
||||
|
||||
byte[] overlay = GenerateOverlay();
|
||||
|
||||
m_log.Debug("[WORLDMAP]: STORING MAPTILE IMAGE");
|
||||
@@ -1365,7 +1366,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
// Store the new one
|
||||
m_log.DebugFormat("[WORLDMAP]: Storing map tile {0}", asset.ID);
|
||||
m_scene.AssetService.Store(asset);
|
||||
|
||||
|
||||
if (overlay != null)
|
||||
{
|
||||
parcelImageID = UUID.Random();
|
||||
@@ -1389,7 +1390,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
m_scene.RegionInfo.RegionSettings.TerrainImageID = terrainImageID;
|
||||
m_scene.RegionInfo.RegionSettings.ParcelImageID = parcelImageID;
|
||||
m_scene.RegionInfo.RegionSettings.Save();
|
||||
|
||||
|
||||
// Delete the old one
|
||||
// m_log.DebugFormat("[WORLDMAP]: Deleting old map tile {0}", lastTerrainImageID);
|
||||
m_scene.AssetService.Delete(lastTerrainImageID.ToString());
|
||||
@@ -1468,18 +1469,18 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
|
||||
if ((land.LandData.Flags & (uint)ParcelFlags.ForSale) != 0)
|
||||
{
|
||||
landForSale = true;
|
||||
|
||||
|
||||
saleBitmap = land.MergeLandBitmaps(saleBitmap, land.GetLandBitmap());
|
||||
}
|
||||
}
|
||||
|
||||
if (!landForSale)
|
||||
{
|
||||
m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not geenrating overlay", m_scene.RegionInfo.RegionName);
|
||||
m_log.DebugFormat("[WORLD MAP]: Region {0} has no parcels for sale, not generating overlay", m_scene.RegionInfo.RegionName);
|
||||
return null;
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, genrating overlay", m_scene.RegionInfo.RegionName);
|
||||
m_log.DebugFormat("[WORLD MAP]: Region {0} has parcels for sale, generating overlay", m_scene.RegionInfo.RegionName);
|
||||
|
||||
for (int x = 0 ; x < 64 ; x++)
|
||||
{
|
||||
|
||||
@@ -46,8 +46,6 @@ namespace OpenSim.Region.DataSnapshot
|
||||
private DataSnapshotManager m_externalData = null;
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
private readonly string m_discoveryPath = "DS0001/";
|
||||
|
||||
public DataRequestHandler(Scene scene, DataSnapshotManager externalData)
|
||||
{
|
||||
m_scene = scene;
|
||||
@@ -58,37 +56,9 @@ namespace OpenSim.Region.DataSnapshot
|
||||
{
|
||||
m_log.Info("[DATASNAPSHOT]: Set up snapshot service");
|
||||
}
|
||||
// Register validation callback handler
|
||||
MainServer.Instance.AddHTTPHandler("validate", OnValidate);
|
||||
|
||||
//Register CAPS handler event
|
||||
m_scene.EventManager.OnRegisterCaps += OnRegisterCaps;
|
||||
|
||||
//harbl
|
||||
}
|
||||
|
||||
public void OnRegisterCaps(UUID agentID, Caps caps)
|
||||
{
|
||||
// m_log.InfoFormat("[DATASNAPSHOT]: Registering service discovery capability for {0}", agentID);
|
||||
string capsBase = "/CAPS/" + caps.CapsObjectPath;
|
||||
caps.RegisterHandler("PublicSnapshotDataInfo",
|
||||
new RestStreamHandler("POST", capsBase + m_discoveryPath, OnDiscoveryAttempt));
|
||||
}
|
||||
|
||||
public string OnDiscoveryAttempt(string request, string path, string param,
|
||||
IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
|
||||
{
|
||||
//Very static for now, flexible enough to add new formats
|
||||
LLSDDiscoveryResponse llsd_response = new LLSDDiscoveryResponse();
|
||||
llsd_response.snapshot_resources = new OSDArray();
|
||||
|
||||
LLSDDiscoveryDataURL llsd_dataurl = new LLSDDiscoveryDataURL();
|
||||
llsd_dataurl.snapshot_format = "os-datasnapshot-v1";
|
||||
llsd_dataurl.snapshot_url = "http://" + m_externalData.m_hostname + ":" + m_externalData.m_listener_port + "/?method=collector";
|
||||
|
||||
llsd_response.snapshot_resources.Array.Add(llsd_dataurl);
|
||||
|
||||
string response = LLSDHelpers.SerialiseLLSDReply(llsd_response);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
public Hashtable OnGetSnapshot(Hashtable keysvals)
|
||||
@@ -107,5 +77,23 @@ namespace OpenSim.Region.DataSnapshot
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
public Hashtable OnValidate(Hashtable keysvals)
|
||||
{
|
||||
m_log.Info("[DATASNAPSHOT] Received validation request");
|
||||
Hashtable reply = new Hashtable();
|
||||
int statuscode = 200;
|
||||
|
||||
string secret = (string)keysvals["secret"];
|
||||
if (secret == m_externalData.Secret.ToString())
|
||||
statuscode = 403;
|
||||
|
||||
reply["str_response_string"] = string.Empty;
|
||||
reply["int_response_code"] = statuscode;
|
||||
reply["content_type"] = "text/plain";
|
||||
|
||||
return reply;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ namespace OpenSim.Region.DataSnapshot
|
||||
private string m_dataServices = "noservices";
|
||||
public string m_listener_port = ConfigSettings.DefaultRegionHttpPort.ToString();
|
||||
public string m_hostname = "127.0.0.1";
|
||||
private UUID m_Secret = UUID.Random();
|
||||
|
||||
//Update timers
|
||||
private int m_period = 20; // in seconds
|
||||
@@ -85,6 +86,11 @@ namespace OpenSim.Region.DataSnapshot
|
||||
get { return m_exposure_level; }
|
||||
}
|
||||
|
||||
public UUID Secret
|
||||
{
|
||||
get { return m_Secret; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region IRegionModule
|
||||
@@ -103,10 +109,10 @@ namespace OpenSim.Region.DataSnapshot
|
||||
m_enabled = config.Configs["DataSnapshot"].GetBoolean("index_sims", m_enabled);
|
||||
IConfig conf = config.Configs["GridService"];
|
||||
if (conf != null)
|
||||
m_gridinfo.Add("gridserverURL", conf.GetString("GridServerURI", "http://127.0.0.1:8003"));
|
||||
m_gridinfo.Add("gatekeeperURL", conf.GetString("Gatekeeper", String.Empty));
|
||||
|
||||
m_gridinfo.Add(
|
||||
"Name", config.Configs["DataSnapshot"].GetString("gridname", "the lost continent of hippo"));
|
||||
"name", config.Configs["DataSnapshot"].GetString("gridname", "the lost continent of hippo"));
|
||||
m_exposure_level = config.Configs["DataSnapshot"].GetString("data_exposure", m_exposure_level);
|
||||
m_period = config.Configs["DataSnapshot"].GetInt("default_snapshot_period", m_period);
|
||||
m_maxStales = config.Configs["DataSnapshot"].GetInt("max_changes_before_update", m_maxStales);
|
||||
@@ -315,6 +321,7 @@ namespace OpenSim.Region.DataSnapshot
|
||||
cli.AddQueryParameter("service", serviceName);
|
||||
cli.AddQueryParameter("host", m_hostname);
|
||||
cli.AddQueryParameter("port", m_listener_port);
|
||||
cli.AddQueryParameter("secret", m_Secret.ToString());
|
||||
cli.RequestMethod = "GET";
|
||||
try
|
||||
{
|
||||
@@ -341,7 +348,7 @@ namespace OpenSim.Region.DataSnapshot
|
||||
}
|
||||
// This is not quite working, so...
|
||||
// string responseStr = Util.UTF8.GetString(response);
|
||||
m_log.Info("[DATASNAPSHOT]: data service notified: " + url);
|
||||
m_log.Info("[DATASNAPSHOT]: data service " + url + " notified. Secret: " + m_Secret);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,6 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
|
||||
public interface IAvatarFactoryModule
|
||||
{
|
||||
void SetAppearance(IScenePresence sp, AvatarAppearance appearance);
|
||||
void SetAppearance(IScenePresence sp, Primitive.TextureEntry textureEntry, byte[] visualParams);
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
@@ -74,5 +75,14 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// Starts the processing threads.
|
||||
/// </summary>
|
||||
void StartProcessing();
|
||||
|
||||
/// <summary>
|
||||
/// Get the execution times of all scripts in each object.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// A dictionary where the key is the root object ID of a linkset
|
||||
/// and the value is a representative execution time in milliseconds of all scripts in that linkset.
|
||||
/// </returns>
|
||||
Dictionary<uint, float> GetObjectScriptsExecutionTimes();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ using OpenMetaverse;
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
public delegate void ScriptCommand(UUID script, string id, string module, string command, string k);
|
||||
public delegate object ScriptInvocation(UUID script, object[] parms);
|
||||
|
||||
/// <summary>
|
||||
/// Interface for communication between OpenSim modules and in-world scripts
|
||||
@@ -45,6 +46,15 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
/// </summary>
|
||||
event ScriptCommand OnScriptCommand;
|
||||
|
||||
void RegisterScriptInvocation(string name, ScriptInvocation fn, Type[] csig, Type rsig);
|
||||
|
||||
ScriptInvocation LookupScriptInvocation(string fname);
|
||||
string LookupModInvocation(string fname);
|
||||
Type[] LookupTypeSignature(string fname);
|
||||
Type LookupReturnType(string fname);
|
||||
|
||||
object InvokeOperation(UUID scriptId, string fname, params object[] parms);
|
||||
|
||||
/// <summary>
|
||||
/// Send a link_message event to an in-world script
|
||||
/// </summary>
|
||||
|
||||
@@ -49,6 +49,11 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
|
||||
public interface IWorldComm
|
||||
{
|
||||
/// <summary>
|
||||
/// Total number of listeners
|
||||
/// </summary>
|
||||
int ListenerCount { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Create a listen event callback with the specified filters.
|
||||
/// The parameters localID,itemID are needed to uniquely identify
|
||||
|
||||
@@ -138,8 +138,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public event OnPermissionErrorDelegate OnPermissionError;
|
||||
|
||||
/// <summary>
|
||||
/// Fired when a new script is created.
|
||||
/// Fired when a script is run.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Occurs after OnNewScript.
|
||||
/// </remarks>
|
||||
public event NewRezScript OnRezScript;
|
||||
public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
|
||||
|
||||
@@ -173,6 +176,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public delegate void AvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID);
|
||||
public event AvatarEnteringNewParcel OnAvatarEnteringNewParcel;
|
||||
|
||||
public delegate void AvatarAppearanceChange(ScenePresence avatar);
|
||||
public event AvatarAppearanceChange OnAvatarAppearanceChange;
|
||||
|
||||
public event Action<ScenePresence> OnSignificantClientMovement;
|
||||
|
||||
public delegate void IncomingInstantMessage(GridInstantMessage message);
|
||||
@@ -184,10 +190,74 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public event ClientClosed OnClientClosed;
|
||||
|
||||
public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
|
||||
|
||||
/// <summary>
|
||||
/// This is fired when a scene object property that a script might be interested in (such as color, scale or
|
||||
/// inventory) changes. Only enough information is sent for the LSL changed event
|
||||
/// (see http://lslwiki.net/lslwiki/wakka.php?wakka=changed)
|
||||
/// Fired when a script is created.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Occurs before OnRezScript
|
||||
/// </remarks>
|
||||
public event NewScript OnNewScript;
|
||||
|
||||
public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
|
||||
{
|
||||
NewScript handlerNewScript = OnNewScript;
|
||||
if (handlerNewScript != null)
|
||||
{
|
||||
foreach (NewScript d in handlerNewScript.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(clientID, part, itemID);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerNewScript failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
|
||||
|
||||
/// <summary>
|
||||
/// An indication that the script has changed.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Triggered after the scene receives a client's upload of an updated script and has stored it in an asset.
|
||||
/// </remarks>
|
||||
public event UpdateScript OnUpdateScript;
|
||||
|
||||
public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
|
||||
{
|
||||
UpdateScript handlerUpdateScript = OnUpdateScript;
|
||||
if (handlerUpdateScript != null)
|
||||
{
|
||||
foreach (UpdateScript d in handlerUpdateScript.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(clientId, itemId, primId, isScriptRunning, newAssetID);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerUpdateScript failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ScriptChangedEvent is fired when a scene object property that a script might be interested
|
||||
/// in (such as color, scale or inventory) changes. Only enough information sent is for the LSL changed event.
|
||||
/// This is not an indication that the script has changed (see OnUpdateScript for that).
|
||||
/// This event is sent to a script to tell it that some property changed on
|
||||
/// the object the script is in. See http://lslwiki.net/lslwiki/wakka.php?wakka=changed .
|
||||
/// </summary>
|
||||
public event ScriptChangedEvent OnScriptChangedEvent;
|
||||
public delegate void ScriptChangedEvent(uint localID, uint change);
|
||||
@@ -1238,6 +1308,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerAvatarAppearanceChanged(ScenePresence avatar)
|
||||
{
|
||||
AvatarAppearanceChange handler = OnAvatarAppearanceChange;
|
||||
if (handler != null)
|
||||
{
|
||||
foreach (AvatarAppearanceChange d in handler.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(avatar);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerAvatarAppearanceChanged failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerIncomingInstantMessage(GridInstantMessage message)
|
||||
{
|
||||
IncomingInstantMessage handlerIncomingInstantMessage = OnIncomingInstantMessage;
|
||||
|
||||
@@ -283,6 +283,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
remoteClient.SendAgentAlertMessage("Script saved", false);
|
||||
}
|
||||
|
||||
// Tell anyone managing scripts that a script has been reloaded/changed
|
||||
EventManager.TriggerUpdateScript(remoteClient.AgentId, itemId, primId, isScriptRunning, item.AssetID);
|
||||
|
||||
part.ParentGroup.ResumeScripts();
|
||||
return errors;
|
||||
}
|
||||
@@ -629,7 +633,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
IInventoryAccessModule invAccess = RequestModuleInterface<IInventoryAccessModule>();
|
||||
if (invAccess != null)
|
||||
invAccess.TransferInventoryAssets(itemCopy, senderId, recipient);
|
||||
Util.FireAndForget(delegate { invAccess.TransferInventoryAssets(itemCopy, senderId, recipient); });
|
||||
}
|
||||
|
||||
if (!Permissions.BypassPermissions())
|
||||
@@ -1151,8 +1155,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return;
|
||||
}
|
||||
|
||||
TaskInventoryItem item = part.Inventory.GetInventoryItem(itemId);
|
||||
if ((item.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
if ((taskItem.CurrentPermissions & (uint)PermissionMask.Copy) == 0)
|
||||
{
|
||||
// If the item to be moved is no copy, we need to be able to
|
||||
// edit the prim.
|
||||
@@ -1624,9 +1627,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// have state in inventory
|
||||
part.Inventory.CreateScriptInstance(copyID, 0, false, DefaultScriptEngine, 0);
|
||||
|
||||
// tell anyone watching that there is a new script in town
|
||||
EventManager.TriggerNewScript(agentID, part, copyID);
|
||||
|
||||
// m_log.InfoFormat("[PRIMINVENTORY]: " +
|
||||
// "Rezzed script {0} into prim local ID {1} for user {2}",
|
||||
// item.inventoryName, localID, remoteClient.Name);
|
||||
|
||||
part.ParentGroup.ResumeScripts();
|
||||
|
||||
return part;
|
||||
@@ -1707,6 +1714,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
part.Inventory.AddInventoryItem(taskItem, false);
|
||||
part.Inventory.CreateScriptInstance(taskItem, 0, false, DefaultScriptEngine, 0);
|
||||
|
||||
// tell anyone managing scripts that a new script exists
|
||||
EventManager.TriggerNewScript(agentID, part, taskItem.ItemID);
|
||||
|
||||
part.ParentGroup.ResumeScripts();
|
||||
|
||||
return part;
|
||||
@@ -1926,7 +1937,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
foreach (SceneObjectGroup g in deleteGroups)
|
||||
{
|
||||
AddReturn(g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return");
|
||||
AddReturn(g.OwnerID == g.GroupID ? g.LastOwnerID : g.OwnerID, g.Name, g.AbsolutePosition, "parcel owner return");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,8 +219,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private int m_lastUpdate;
|
||||
private bool m_firstHeartbeat = true;
|
||||
|
||||
private object m_deleting_scene_object = new object();
|
||||
|
||||
private UpdatePrioritizationSchemes m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
||||
private bool m_reprioritizationEnabled = true;
|
||||
@@ -596,7 +594,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
#endregion Region Settings
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand("region", false, "reload estate",
|
||||
MainConsole.Instance.Commands.AddCommand("Estates", false, "reload estate",
|
||||
"reload estate",
|
||||
"Reload the estate data", HandleReloadEstate);
|
||||
|
||||
@@ -628,10 +626,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
#region Region Config
|
||||
|
||||
try
|
||||
// Region config overrides global config
|
||||
//
|
||||
if (m_config.Configs["Startup"] != null)
|
||||
{
|
||||
// Region config overrides global config
|
||||
//
|
||||
IConfig startupConfig = m_config.Configs["Startup"];
|
||||
|
||||
m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
|
||||
@@ -721,46 +719,39 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
|
||||
m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
|
||||
}
|
||||
catch
|
||||
{
|
||||
m_log.Warn("[SCENE]: Failed to load StartupConfig");
|
||||
}
|
||||
|
||||
#endregion Region Config
|
||||
|
||||
#region Interest Management
|
||||
|
||||
if (m_config != null)
|
||||
IConfig interestConfig = m_config.Configs["InterestManagement"];
|
||||
if (interestConfig != null)
|
||||
{
|
||||
IConfig interestConfig = m_config.Configs["InterestManagement"];
|
||||
if (interestConfig != null)
|
||||
string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
|
||||
|
||||
try
|
||||
{
|
||||
string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
|
||||
|
||||
try
|
||||
{
|
||||
m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
|
||||
m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
||||
}
|
||||
|
||||
m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
|
||||
m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
|
||||
m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
|
||||
m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
|
||||
m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
|
||||
m_priorityScheme = UpdatePrioritizationSchemes.Time;
|
||||
}
|
||||
|
||||
m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
|
||||
m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
|
||||
m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
|
||||
m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
|
||||
}
|
||||
|
||||
m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
|
||||
m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
|
||||
|
||||
#endregion Interest Management
|
||||
|
||||
StatsReporter = new SimStatsReporter(this);
|
||||
StatsReporter.OnSendStatsResult += SendSimStatsPackets;
|
||||
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
|
||||
StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -864,16 +855,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
try
|
||||
{
|
||||
ForEachRootScenePresence(delegate(ScenePresence agent)
|
||||
{
|
||||
//agent.ControllingClient.new
|
||||
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
|
||||
{
|
||||
//agent.ControllingClient.new
|
||||
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
|
||||
|
||||
List<ulong> old = new List<ulong>();
|
||||
old.Add(otherRegion.RegionHandle);
|
||||
agent.DropOldNeighbours(old);
|
||||
if (m_teleportModule != null)
|
||||
m_teleportModule.EnableChildAgent(agent, otherRegion);
|
||||
});
|
||||
List<ulong> old = new List<ulong>();
|
||||
old.Add(otherRegion.RegionHandle);
|
||||
agent.DropOldNeighbours(old);
|
||||
if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc)
|
||||
m_teleportModule.EnableChildAgent(agent, otherRegion);
|
||||
});
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
@@ -881,7 +872,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// This shouldn't happen too often anymore.
|
||||
m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception");
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1009,10 +999,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
try
|
||||
{
|
||||
ForEachRootScenePresence(delegate(ScenePresence agent)
|
||||
{
|
||||
if (m_teleportModule != null)
|
||||
m_teleportModule.EnableChildAgent(agent, r);
|
||||
});
|
||||
{
|
||||
if (m_teleportModule != null && agent.PresenceType != PresenceType.Npc)
|
||||
m_teleportModule.EnableChildAgent(agent, r);
|
||||
});
|
||||
}
|
||||
catch (NullReferenceException)
|
||||
{
|
||||
@@ -1077,6 +1067,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName);
|
||||
|
||||
StatsReporter.Close();
|
||||
|
||||
m_restartTimer.Stop();
|
||||
m_restartTimer.Close();
|
||||
|
||||
@@ -1141,7 +1133,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
HeartbeatThread
|
||||
= Watchdog.StartThread(
|
||||
Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false);
|
||||
Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -1179,6 +1171,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
try
|
||||
{
|
||||
m_eventManager.TriggerOnRegionStarted(this);
|
||||
|
||||
// The first frame can take a very long time due to physics actors being added on startup. Therefore,
|
||||
// don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false
|
||||
// alarms for scenes with many objects.
|
||||
Update();
|
||||
Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true;
|
||||
|
||||
while (!shuttingdown)
|
||||
Update();
|
||||
|
||||
@@ -1207,7 +1206,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
++Frame;
|
||||
|
||||
// m_log.DebugFormat("[SCENE]: Processing frame {0}", Frame);
|
||||
// m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName);
|
||||
|
||||
try
|
||||
{
|
||||
@@ -1362,26 +1361,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch (AccessViolationException e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[REGION]: Failed on region {0} with exception {1}{2}",
|
||||
RegionInfo.RegionName, e.Message, e.StackTrace);
|
||||
}
|
||||
//catch (NullReferenceException e)
|
||||
//{
|
||||
// m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
|
||||
//}
|
||||
catch (InvalidOperationException e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[REGION]: Failed on region {0} with exception {1}{2}",
|
||||
RegionInfo.RegionName, e.Message, e.StackTrace);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[REGION]: Failed on region {0} with exception {1}{2}",
|
||||
"[SCENE]: Failed on region {0} with exception {1}{2}",
|
||||
RegionInfo.RegionName, e.Message, e.StackTrace);
|
||||
}
|
||||
|
||||
@@ -1419,7 +1402,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
entry.checkAtTargets();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Send out simstats data to all clients
|
||||
/// </summary>
|
||||
@@ -1594,8 +1576,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
double[,] map = SimulationDataService.LoadTerrain(RegionInfo.RegionID);
|
||||
if (map == null)
|
||||
{
|
||||
m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain.");
|
||||
Heightmap = new TerrainChannel();
|
||||
// This should be in the Terrain module, but it isn't because
|
||||
// the heightmap is needed _way_ before the modules are initialized...
|
||||
IConfig terrainConfig = m_config.Configs["Terrain"];
|
||||
String m_InitialTerrain = "pinhead-island";
|
||||
if (terrainConfig != null)
|
||||
m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain);
|
||||
|
||||
m_log.InfoFormat("[TERRAIN]: No default terrain. Generating a new terrain {0}.", m_InitialTerrain);
|
||||
Heightmap = new TerrainChannel(m_InitialTerrain);
|
||||
|
||||
SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
|
||||
}
|
||||
@@ -2010,15 +1999,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public void DeleteSceneObject(SceneObjectGroup group, bool silent)
|
||||
{
|
||||
// m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID);
|
||||
|
||||
//SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||
|
||||
// Serialise calls to RemoveScriptInstances to avoid
|
||||
// deadlocking on m_parts inside SceneObjectGroup
|
||||
lock (m_deleting_scene_object)
|
||||
{
|
||||
group.RemoveScriptInstances(true);
|
||||
}
|
||||
group.RemoveScriptInstances(true);
|
||||
|
||||
SceneObjectPart[] partList = group.Parts;
|
||||
|
||||
@@ -2318,7 +2300,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
/// <param name="sog"></param>
|
||||
/// <returns></returns>
|
||||
public bool IncomingCreateObject(ISceneObject sog)
|
||||
public bool IncomingCreateObject(Vector3 newPosition, ISceneObject sog)
|
||||
{
|
||||
//m_log.DebugFormat(" >>> IncomingCreateObject(sog) <<< {0} deleted? {1} isAttach? {2}", ((SceneObjectGroup)sog).AbsolutePosition,
|
||||
// ((SceneObjectGroup)sog).IsDeleted, ((SceneObjectGroup)sog).RootPart.IsAttachment);
|
||||
@@ -2334,6 +2316,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return false;
|
||||
}
|
||||
|
||||
if (newPosition != Vector3.Zero)
|
||||
newObject.RootPart.GroupPosition = newPosition;
|
||||
|
||||
if (!AddSceneObject(newObject))
|
||||
{
|
||||
m_log.DebugFormat("[SCENE]: Problem adding scene object {0} in {1} ", sog.UUID, RegionInfo.RegionName);
|
||||
@@ -3259,8 +3244,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// also return a reason.</returns>
|
||||
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
|
||||
{
|
||||
bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
|
||||
(teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
|
||||
bool vialogin = ((teleportFlags & (uint)TPFlags.ViaLogin) != 0 ||
|
||||
(teleportFlags & (uint)TPFlags.ViaHGLogin) != 0);
|
||||
bool viahome = ((teleportFlags & (uint)TPFlags.ViaHome) != 0);
|
||||
bool godlike = ((teleportFlags & (uint)TPFlags.Godlike) != 0);
|
||||
|
||||
reason = String.Empty;
|
||||
|
||||
//Teleport flags:
|
||||
@@ -3272,9 +3260,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// Don't disable this log message - it's too helpful
|
||||
m_log.DebugFormat(
|
||||
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, teleportflags {6}, position {7})",
|
||||
RegionInfo.RegionName, (agent.child ? "child" : "root"), agent.firstname, agent.lastname,
|
||||
agent.AgentID, agent.circuitcode, teleportFlags, agent.startpos);
|
||||
"[SCENE]: Region {0} told of incoming {1} agent {2} {3} {4} (circuit code {5}, IP {6}, viewer {7}, teleportflags ({8}), position {9})",
|
||||
RegionInfo.RegionName, (agent.child ? "child" : "root"),agent.firstname, agent.lastname,
|
||||
agent.AgentID, agent.circuitcode, agent.IPAddress, agent.Viewer, ((TPFlags)teleportFlags).ToString(), agent.startpos);
|
||||
|
||||
if (LoginsDisabled)
|
||||
{
|
||||
@@ -3427,6 +3415,29 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
agent.startpos.Z = 720;
|
||||
}
|
||||
}
|
||||
|
||||
// Honor Estate teleport routing via Telehubs excluding ViaHome and GodLike TeleportFlags
|
||||
if (RegionInfo.RegionSettings.TelehubObject != UUID.Zero &&
|
||||
RegionInfo.EstateSettings.AllowDirectTeleport == false &&
|
||||
!viahome && !godlike)
|
||||
{
|
||||
SceneObjectGroup telehub = GetSceneObjectGroup(RegionInfo.RegionSettings.TelehubObject);
|
||||
// Can have multiple SpawnPoints
|
||||
List<SpawnPoint> spawnpoints = RegionInfo.RegionSettings.SpawnPoints();
|
||||
if ( spawnpoints.Count > 1)
|
||||
{
|
||||
// We have multiple SpawnPoints, Route the agent to a random one
|
||||
agent.startpos = spawnpoints[Util.RandomClass.Next(spawnpoints.Count)].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We have a single SpawnPoint and will route the agent to it
|
||||
agent.startpos = spawnpoints[0].GetLocation(telehub.AbsolutePosition, telehub.GroupRotation);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Honor parcel landing type and position.
|
||||
if (land != null)
|
||||
{
|
||||
@@ -3522,8 +3533,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (!AuthorizationService.IsAuthorizedForRegion(
|
||||
agent.AgentID.ToString(), agent.firstname, agent.lastname, RegionInfo.RegionID.ToString(), out reason))
|
||||
{
|
||||
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the region",
|
||||
agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName);
|
||||
m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because {4}",
|
||||
agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName, reason);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -4138,16 +4149,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public bool PipeEventsForScript(uint localID)
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(localID);
|
||||
|
||||
if (part != null)
|
||||
{
|
||||
// Changed so that child prims of attachments return ScriptDanger for their parent, so that
|
||||
// their scripts will actually run.
|
||||
// -- Leaf, Tue Aug 12 14:17:05 EDT 2008
|
||||
SceneObjectPart parent = part.ParentGroup.RootPart;
|
||||
if (part.ParentGroup.IsAttachment)
|
||||
return ScriptDanger(parent, parent.GetWorldPosition());
|
||||
else
|
||||
return ScriptDanger(part, part.GetWorldPosition());
|
||||
return ScriptDanger(parent, parent.GetWorldPosition());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4232,10 +4238,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="action"></param>
|
||||
public void ForEachRootScenePresence(Action<ScenePresence> action)
|
||||
{
|
||||
if (m_sceneGraph != null)
|
||||
{
|
||||
m_sceneGraph.ForEachAvatar(action);
|
||||
}
|
||||
m_sceneGraph.ForEachAvatar(action);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -4244,10 +4247,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="action"></param>
|
||||
public void ForEachScenePresence(Action<ScenePresence> action)
|
||||
{
|
||||
if (m_sceneGraph != null)
|
||||
{
|
||||
m_sceneGraph.ForEachScenePresence(action);
|
||||
}
|
||||
m_sceneGraph.ForEachScenePresence(action);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -4677,7 +4677,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
|
||||
if (nearestPoint != null)
|
||||
{
|
||||
Debug.WriteLine("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString());
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE]: Found a sane previous position based on velocity for {0}, sending them to {1} in {2}",
|
||||
// avatar.Name, nearestPoint, nearestParcel.LandData.Name);
|
||||
|
||||
return nearestPoint.Value;
|
||||
}
|
||||
|
||||
@@ -4687,12 +4690,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
|
||||
if (nearestPoint != null)
|
||||
{
|
||||
Debug.WriteLine("They had a zero velocity, sending them to: " + nearestPoint.ToString());
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE]: {0} had a zero velocity, sending them to {1}", avatar.Name, nearestPoint);
|
||||
|
||||
return nearestPoint.Value;
|
||||
}
|
||||
|
||||
//Ultimate backup if we have no idea where they are
|
||||
Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString());
|
||||
//Ultimate backup if we have no idea where they are
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE]: No idea where {0} is, sending them to {1}", avatar.Name, avatar.lastKnownAllowedPosition);
|
||||
|
||||
return avatar.lastKnownAllowedPosition;
|
||||
}
|
||||
|
||||
@@ -5098,7 +5105,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
|
||||
|
||||
Vector3 agent_control_v3 = new Vector3();
|
||||
presence.HandleMoveToTargetUpdate(ref agent_control_v3);
|
||||
presence.HandleMoveToTargetUpdate(1, ref agent_control_v3);
|
||||
presence.AddNewMovement(agent_control_v3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -472,6 +472,63 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <summary>
|
||||
/// Call this from a region module to add a command to the OpenSim console.
|
||||
/// </summary>
|
||||
/// <param name="mod">
|
||||
/// The use of IRegionModuleBase is a cheap trick to get a different method signature,
|
||||
/// though all new modules should be using interfaces descended from IRegionModuleBase anyway.
|
||||
/// </param>
|
||||
/// <param name="category">
|
||||
/// Category of the command. This is the section under which it will appear when the user asks for help
|
||||
/// </param>
|
||||
/// <param name="command"></param>
|
||||
/// <param name="shorthelp"></param>
|
||||
/// <param name="longhelp"></param>
|
||||
/// <param name="callback"></param>
|
||||
public void AddCommand(
|
||||
string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
|
||||
{
|
||||
AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this from a region module to add a command to the OpenSim console.
|
||||
/// </summary>
|
||||
/// <param name="mod"></param>
|
||||
/// <param name="command"></param>
|
||||
/// <param name="shorthelp"></param>
|
||||
/// <param name="longhelp"></param>
|
||||
/// <param name="descriptivehelp"></param>
|
||||
/// <param name="callback"></param>
|
||||
public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
|
||||
{
|
||||
string moduleName = "";
|
||||
|
||||
if (mod != null)
|
||||
{
|
||||
if (mod is IRegionModule)
|
||||
{
|
||||
IRegionModule module = (IRegionModule)mod;
|
||||
moduleName = module.Name;
|
||||
}
|
||||
else if (mod is IRegionModuleBase)
|
||||
{
|
||||
IRegionModuleBase module = (IRegionModuleBase)mod;
|
||||
moduleName = module.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
|
||||
}
|
||||
}
|
||||
|
||||
AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call this from a region module to add a command to the OpenSim console.
|
||||
/// </summary>
|
||||
/// <param name="category">
|
||||
/// Category of the command. This is the section under which it will appear when the user asks for help
|
||||
/// </param>
|
||||
/// <param name="mod"></param>
|
||||
/// <param name="command"></param>
|
||||
/// <param name="shorthelp"></param>
|
||||
@@ -479,12 +536,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="descriptivehelp"></param>
|
||||
/// <param name="callback"></param>
|
||||
public void AddCommand(
|
||||
object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
|
||||
string category, object mod, string command,
|
||||
string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
|
||||
{
|
||||
if (MainConsole.Instance == null)
|
||||
return;
|
||||
|
||||
string modulename = String.Empty;
|
||||
bool shared = false;
|
||||
|
||||
if (mod != null)
|
||||
@@ -492,20 +549,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (mod is IRegionModule)
|
||||
{
|
||||
IRegionModule module = (IRegionModule)mod;
|
||||
modulename = module.Name;
|
||||
shared = module.IsSharedModule;
|
||||
}
|
||||
else if (mod is IRegionModuleBase)
|
||||
{
|
||||
IRegionModuleBase module = (IRegionModuleBase)mod;
|
||||
modulename = module.Name;
|
||||
shared = mod is ISharedRegionModule;
|
||||
}
|
||||
else throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
|
||||
else
|
||||
{
|
||||
throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
|
||||
}
|
||||
}
|
||||
|
||||
MainConsole.Instance.Commands.AddCommand(
|
||||
modulename, shared, command, shorthelp, longhelp, descriptivehelp, callback);
|
||||
category, shared, command, shorthelp, longhelp, descriptivehelp, callback);
|
||||
}
|
||||
|
||||
public virtual ISceneObject DeserializeObject(string representation)
|
||||
|
||||
@@ -156,16 +156,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// that the region position is cached or performance will degrade
|
||||
Utils.LongToUInts(regionHandle, out x, out y);
|
||||
GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
|
||||
if (! simulatorList.Contains(dest.ServerURI))
|
||||
// bool v = true;
|
||||
if (!simulatorList.Contains(dest.ServerURI))
|
||||
{
|
||||
// we havent seen this simulator before, add it to the list
|
||||
// and send it an update
|
||||
simulatorList.Add(dest.ServerURI);
|
||||
// Let move this to sync. Mono definitely does not like async networking.
|
||||
m_scene.SimulationService.UpdateAgent(dest, cAgentData);
|
||||
|
||||
SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync;
|
||||
d.BeginInvoke(cAgentData, m_regionInfo.ScopeID, dest,
|
||||
SendChildAgentDataUpdateCompleted,
|
||||
d);
|
||||
// Leaving this here as a reminder that we tried, and it sucks.
|
||||
//SendChildAgentDataUpdateDelegate d = SendChildAgentDataUpdateAsync;
|
||||
//d.BeginInvoke(cAgentData, m_regionInfo.ScopeID, dest,
|
||||
// SendChildAgentDataUpdateCompleted,
|
||||
// d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,27 +215,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (sp.IsChildAgent)
|
||||
continue;
|
||||
|
||||
if (sp.ParentID != 0)
|
||||
{
|
||||
// sitting avatar
|
||||
SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
|
||||
if (sop != null)
|
||||
{
|
||||
coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition);
|
||||
avatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
else
|
||||
{
|
||||
// we can't find the parent.. ! arg!
|
||||
coarseLocations.Add(sp.AbsolutePosition);
|
||||
avatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
coarseLocations.Add(sp.AbsolutePosition);
|
||||
avatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
coarseLocations.Add(sp.AbsolutePosition);
|
||||
|
||||
avatarUUIDs.Add(sp.UUID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,7 +341,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.ErrorFormat(
|
||||
"[SCENEGRAPH]: Tried to add scene object {0} to {1} with illegal UUID of {2}",
|
||||
sceneObject.Name, m_parentScene.RegionInfo.RegionName, UUID.Zero);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -368,12 +350,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENEGRAPH]: Scene graph for {0} already contains object {1} in AddSceneObject()",
|
||||
// m_parentScene.RegionInfo.RegionName, sceneObject.UUID);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
|
||||
// "[SCENEGRAPH]: Adding scene object {0} {1}, with {2} parts on {3}",
|
||||
// sceneObject.Name, sceneObject.UUID, sceneObject.Parts.Length, m_parentScene.RegionInfo.RegionName);
|
||||
|
||||
SceneObjectPart[] parts = sceneObject.Parts;
|
||||
@@ -409,7 +391,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
lock (SceneObjectGroupsByFullID)
|
||||
SceneObjectGroupsByFullID[sceneObject.UUID] = sceneObject;
|
||||
|
||||
|
||||
lock (SceneObjectGroupsByFullPartID)
|
||||
{
|
||||
foreach (SceneObjectPart part in parts)
|
||||
@@ -751,6 +733,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
#endregion
|
||||
|
||||
#region Get Methods
|
||||
|
||||
/// <summary>
|
||||
/// Get the controlling client for the given avatar, if there is one.
|
||||
///
|
||||
@@ -1092,36 +1075,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
return Entities.GetEntities();
|
||||
}
|
||||
|
||||
public Dictionary<uint, float> GetTopScripts()
|
||||
{
|
||||
Dictionary<uint, float> topScripts = new Dictionary<uint, float>();
|
||||
|
||||
EntityBase[] EntityList = GetEntities();
|
||||
int limit = 0;
|
||||
foreach (EntityBase ent in EntityList)
|
||||
{
|
||||
if (ent is SceneObjectGroup)
|
||||
{
|
||||
SceneObjectGroup grp = (SceneObjectGroup)ent;
|
||||
if ((grp.RootPart.GetEffectiveObjectFlags() & (uint)PrimFlags.Scripted) != 0)
|
||||
{
|
||||
if (grp.scriptScore >= 0.01)
|
||||
{
|
||||
topScripts.Add(grp.LocalId, grp.scriptScore);
|
||||
limit++;
|
||||
if (limit >= 100)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
grp.scriptScore = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return topScripts;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Other Methods
|
||||
@@ -1592,7 +1545,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID,agentID))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
|
||||
{
|
||||
group.UpdateExtraParam(primLocalID, type, inUse, data);
|
||||
}
|
||||
@@ -1609,7 +1562,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
||||
if (group != null)
|
||||
{
|
||||
if (m_parentScene.Permissions.CanEditObject(group.GetPartsFullID(primLocalID), agentID))
|
||||
if (m_parentScene.Permissions.CanEditObject(group.UUID, agentID))
|
||||
{
|
||||
ObjectShapePacket.ObjectDataBlock shapeData = new ObjectShapePacket.ObjectDataBlock();
|
||||
shapeData.ObjectLocalID = shapeBlock.ObjectLocalID;
|
||||
|
||||
@@ -229,8 +229,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
get { return RootPart.VolumeDetectActive; }
|
||||
}
|
||||
|
||||
public float scriptScore;
|
||||
|
||||
private Vector3 lastPhysGroupPos;
|
||||
private Quaternion lastPhysGroupRot;
|
||||
|
||||
@@ -1184,12 +1182,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public void AddScriptLPS(int count)
|
||||
{
|
||||
if (scriptScore + count >= float.MaxValue - count)
|
||||
scriptScore = 0;
|
||||
|
||||
scriptScore += (float)count;
|
||||
SceneGraph d = m_scene.SceneGraph;
|
||||
d.AddToScriptLPS(count);
|
||||
m_scene.SceneGraph.AddToScriptLPS(count);
|
||||
}
|
||||
|
||||
public void AddActiveScriptCount(int count)
|
||||
@@ -1330,7 +1323,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_log.DebugFormat(
|
||||
"[SCENE OBJECT GROUP]: Returning object {0} due to parcel autoreturn",
|
||||
RootPart.UUID);
|
||||
m_scene.AddReturn(OwnerID, Name, AbsolutePosition, "parcel autoreturn");
|
||||
m_scene.AddReturn(OwnerID == GroupID ? LastOwnerID : OwnerID, Name, AbsolutePosition, "parcel autoreturn");
|
||||
m_scene.DeRezObjects(null, new List<uint>() { RootPart.LocalId }, UUID.Zero,
|
||||
DeRezAction.Return, UUID.Zero);
|
||||
|
||||
|
||||
@@ -303,6 +303,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
// ~SceneObjectPart()
|
||||
// {
|
||||
// Console.WriteLine(
|
||||
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
|
||||
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE OBJECT PART]: Destructor called for {0}, local id {1}, parent {2} {3}",
|
||||
// Name, LocalId, ParentGroup.Name, ParentGroup.LocalId);
|
||||
@@ -1543,19 +1546,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
if (userExposed)
|
||||
dupe.UUID = UUID.Random();
|
||||
|
||||
//memberwiseclone means it also clones the physics actor reference
|
||||
// This will make physical prim 'bounce' if not set to null.
|
||||
if (!userExposed)
|
||||
dupe.PhysActor = null;
|
||||
dupe.PhysActor = null;
|
||||
|
||||
dupe.OwnerID = AgentID;
|
||||
dupe.GroupID = GroupID;
|
||||
dupe.GroupPosition = GroupPosition;
|
||||
dupe.OffsetPosition = OffsetPosition;
|
||||
dupe.RotationOffset = RotationOffset;
|
||||
dupe.Velocity = new Vector3(0, 0, 0);
|
||||
dupe.Acceleration = new Vector3(0, 0, 0);
|
||||
dupe.AngularVelocity = new Vector3(0, 0, 0);
|
||||
dupe.Velocity = Velocity;
|
||||
dupe.Acceleration = Acceleration;
|
||||
dupe.AngularVelocity = AngularVelocity;
|
||||
dupe.Flags = Flags;
|
||||
|
||||
dupe.OwnershipCost = OwnershipCost;
|
||||
|
||||
@@ -291,13 +291,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
public PhysicsActor PhysicsActor { get; private set; }
|
||||
|
||||
private byte m_movementflag;
|
||||
|
||||
public byte MovementFlag
|
||||
{
|
||||
set { m_movementflag = value; }
|
||||
get { return m_movementflag; }
|
||||
}
|
||||
/// <summary>
|
||||
/// Record user movement inputs.
|
||||
/// </summary>
|
||||
public byte MovementFlag { get; private set; }
|
||||
|
||||
private bool m_updateflag;
|
||||
|
||||
@@ -346,13 +343,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </summary>
|
||||
protected Vector3 m_lastCameraPosition;
|
||||
|
||||
protected Vector3 m_CameraPosition;
|
||||
|
||||
public Vector3 CameraPosition
|
||||
{
|
||||
get { return m_CameraPosition; }
|
||||
private set { m_CameraPosition = value; }
|
||||
}
|
||||
public Vector3 CameraPosition { get; set; }
|
||||
|
||||
public Quaternion CameraRotation
|
||||
{
|
||||
@@ -362,28 +353,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Use these three vectors to figure out what the agent is looking at
|
||||
// Convert it to a Matrix and/or Quaternion
|
||||
//
|
||||
protected Vector3 m_CameraAtAxis;
|
||||
protected Vector3 m_CameraLeftAxis;
|
||||
protected Vector3 m_CameraUpAxis;
|
||||
|
||||
public Vector3 CameraAtAxis
|
||||
{
|
||||
get { return m_CameraAtAxis; }
|
||||
private set { m_CameraAtAxis = value; }
|
||||
}
|
||||
|
||||
|
||||
public Vector3 CameraLeftAxis
|
||||
{
|
||||
get { return m_CameraLeftAxis; }
|
||||
private set { m_CameraLeftAxis = value; }
|
||||
}
|
||||
|
||||
public Vector3 CameraUpAxis
|
||||
{
|
||||
get { return m_CameraUpAxis; }
|
||||
private set { m_CameraUpAxis = value; }
|
||||
}
|
||||
public Vector3 CameraAtAxis { get; set; }
|
||||
public Vector3 CameraLeftAxis { get; set; }
|
||||
public Vector3 CameraUpAxis { get; set; }
|
||||
|
||||
public Vector3 Lookat
|
||||
{
|
||||
@@ -399,33 +371,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
#endregion
|
||||
|
||||
public readonly string Firstname;
|
||||
public readonly string Lastname;
|
||||
public string Firstname { get; private set; }
|
||||
public string Lastname { get; private set; }
|
||||
|
||||
private string m_grouptitle;
|
||||
|
||||
public string Grouptitle
|
||||
{
|
||||
get { return m_grouptitle; }
|
||||
set { m_grouptitle = value; }
|
||||
}
|
||||
public string Grouptitle { get; set; }
|
||||
|
||||
// Agent's Draw distance.
|
||||
protected float m_DrawDistance;
|
||||
public float DrawDistance { get; set; }
|
||||
|
||||
public float DrawDistance
|
||||
{
|
||||
get { return m_DrawDistance; }
|
||||
private set { m_DrawDistance = value; }
|
||||
}
|
||||
|
||||
protected bool m_allowMovement = true;
|
||||
|
||||
public bool AllowMovement
|
||||
{
|
||||
get { return m_allowMovement; }
|
||||
set { m_allowMovement = value; }
|
||||
}
|
||||
public bool AllowMovement { get; set; }
|
||||
|
||||
private bool m_setAlwaysRun;
|
||||
|
||||
@@ -452,13 +406,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
private byte m_state;
|
||||
|
||||
public byte State
|
||||
{
|
||||
get { return m_state; }
|
||||
set { m_state = value; }
|
||||
}
|
||||
public byte State { get; set; }
|
||||
|
||||
private AgentManager.ControlFlags m_AgentControlFlags;
|
||||
|
||||
@@ -468,29 +416,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
set { m_AgentControlFlags = (AgentManager.ControlFlags)value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This works out to be the ClientView object associated with this avatar, or it's client connection manager
|
||||
/// </summary>
|
||||
private IClientAPI m_controllingClient;
|
||||
|
||||
public IClientAPI ControllingClient
|
||||
{
|
||||
get { return m_controllingClient; }
|
||||
private set { m_controllingClient = value; }
|
||||
}
|
||||
public IClientAPI ControllingClient { get; set; }
|
||||
|
||||
public IClientCore ClientView
|
||||
{
|
||||
get { return (IClientCore) m_controllingClient; }
|
||||
get { return (IClientCore)ControllingClient; }
|
||||
}
|
||||
|
||||
protected Vector3 m_parentPosition;
|
||||
|
||||
public Vector3 ParentPosition
|
||||
{
|
||||
get { return m_parentPosition; }
|
||||
set { m_parentPosition = value; }
|
||||
}
|
||||
public Vector3 ParentPosition { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Position of this avatar relative to the region the avatar is in
|
||||
@@ -499,7 +432,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
get
|
||||
{
|
||||
if (PhysicsActor != null && m_parentID == 0)
|
||||
if (PhysicsActor != null)
|
||||
{
|
||||
m_pos = PhysicsActor.Position;
|
||||
|
||||
@@ -522,19 +455,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// in the sim unless the avatar is on a sit target. While
|
||||
// on a sit target, m_pos will contain the desired offset
|
||||
// without the parent rotation applied.
|
||||
if (ParentID != 0)
|
||||
{
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID);
|
||||
if (part != null)
|
||||
{
|
||||
return part.AbsolutePosition + (m_pos * part.GetWorldRotation());
|
||||
}
|
||||
else
|
||||
{
|
||||
return ParentPosition + m_pos;
|
||||
}
|
||||
}
|
||||
SceneObjectPart sitPart = ParentPart;
|
||||
|
||||
if (sitPart != null)
|
||||
return sitPart.AbsolutePosition + (m_pos * sitPart.GetWorldRotation());
|
||||
}
|
||||
|
||||
return m_pos;
|
||||
}
|
||||
set
|
||||
@@ -551,7 +477,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
// Don't update while sitting
|
||||
// Don't update while sitting. The PhysicsActor above is null whilst sitting.
|
||||
if (ParentID == 0)
|
||||
{
|
||||
m_pos = value;
|
||||
@@ -578,6 +504,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// There is no offset position when not seated
|
||||
if (ParentID == 0)
|
||||
return;
|
||||
|
||||
m_pos = value;
|
||||
}
|
||||
}
|
||||
@@ -636,12 +563,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
public bool IsChildAgent { get; set; }
|
||||
|
||||
public uint ParentID
|
||||
{
|
||||
get { return m_parentID; }
|
||||
set { m_parentID = value; }
|
||||
}
|
||||
private uint m_parentID;
|
||||
/// <summary>
|
||||
/// If the avatar is sitting, the local ID of the prim that it's sitting on. If not sitting then zero.
|
||||
/// </summary>
|
||||
public uint ParentID { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// If the avatar is sitting, the prim that it's sitting on. If not sitting then null.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// If you use this property then you must take a reference since another thread could set it to null.
|
||||
/// </remarks>
|
||||
public SceneObjectPart ParentPart { get; set; }
|
||||
|
||||
public float Health
|
||||
{
|
||||
@@ -750,7 +683,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
|
||||
{
|
||||
AttachmentsSyncLock = new Object();
|
||||
|
||||
AllowMovement = true;
|
||||
IsChildAgent = true;
|
||||
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
|
||||
Animator = new ScenePresenceAnimator(this);
|
||||
@@ -829,17 +762,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
private Vector3[] GetWalkDirectionVectors()
|
||||
{
|
||||
Vector3[] vector = new Vector3[11];
|
||||
vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD
|
||||
vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK
|
||||
vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
|
||||
vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK
|
||||
vector[2] = Vector3.UnitY; //LEFT
|
||||
vector[3] = -Vector3.UnitY; //RIGHT
|
||||
vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP
|
||||
vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN
|
||||
vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE
|
||||
vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE
|
||||
vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
|
||||
vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
|
||||
vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
|
||||
vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE
|
||||
vector[8] = Vector3.UnitY; //LEFT_NUDGE
|
||||
vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
|
||||
vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE
|
||||
vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE
|
||||
return vector;
|
||||
}
|
||||
|
||||
@@ -1051,7 +984,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Do not call this directly. Call Scene.RequestTeleportLocation() instead.
|
||||
/// </summary>
|
||||
/// <param name="pos"></param>
|
||||
public void Teleport(Vector3 pos)
|
||||
@@ -1222,7 +1155,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
{
|
||||
IEntityTransferModule m_agentTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
|
||||
if (m_agentTransfer != null)
|
||||
m_agentTransfer.EnableChildAgents(this);
|
||||
Util.FireAndForget(delegate { m_agentTransfer.EnableChildAgents(this); });
|
||||
|
||||
IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||
if (friendsModule != null)
|
||||
@@ -1336,7 +1269,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Convert it to a Matrix and/or Quaternion
|
||||
CameraAtAxis = agentData.CameraAtAxis;
|
||||
CameraLeftAxis = agentData.CameraLeftAxis;
|
||||
m_CameraUpAxis = agentData.CameraUpAxis;
|
||||
CameraUpAxis = agentData.CameraUpAxis;
|
||||
|
||||
// The Agent's Draw distance setting
|
||||
// When we get to the point of re-computing neighbors everytime this
|
||||
@@ -1348,7 +1281,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Check if Client has camera in 'follow cam' or 'build' mode.
|
||||
Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
|
||||
|
||||
m_followCamAuto = ((m_CameraUpAxis.Z > 0.959f && m_CameraUpAxis.Z < 0.98f)
|
||||
m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f)
|
||||
&& (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false;
|
||||
|
||||
m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
|
||||
@@ -1525,7 +1458,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else if (bAllowUpdateMoveToPosition)
|
||||
{
|
||||
if (HandleMoveToTargetUpdate(ref agent_control_v3))
|
||||
// The UseClientAgentPosition is set if parcel ban is forcing the avatar to move to a
|
||||
// certain position. It's only check for tolerance on returning to that position is 0.2
|
||||
// rather than 1, at which point it removes its force target.
|
||||
if (HandleMoveToTargetUpdate(agentData.UseClientAgentPosition ? 0.2 : 1, ref agent_control_v3))
|
||||
update_movementflag = true;
|
||||
}
|
||||
}
|
||||
@@ -1587,7 +1523,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// </remarks>
|
||||
/// <param value="agent_control_v3">Cumulative agent movement that this method will update.</param>
|
||||
/// <returns>True if movement has been updated in some way. False otherwise.</returns>
|
||||
public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3)
|
||||
public bool HandleMoveToTargetUpdate(double tolerance, ref Vector3 agent_control_v3)
|
||||
{
|
||||
// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
|
||||
|
||||
@@ -1604,7 +1540,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
|
||||
|
||||
// Check the error term of the current position in relation to the target position
|
||||
if (distanceToTarget <= 1)
|
||||
if (distanceToTarget <= tolerance)
|
||||
{
|
||||
// We are close enough to the target
|
||||
AbsolutePosition = MoveToPositionTarget;
|
||||
@@ -1780,7 +1716,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation);
|
||||
|
||||
Vector3 agent_control_v3 = new Vector3();
|
||||
HandleMoveToTargetUpdate(ref agent_control_v3);
|
||||
HandleMoveToTargetUpdate(1, ref agent_control_v3);
|
||||
AddNewMovement(agent_control_v3);
|
||||
}
|
||||
|
||||
@@ -1815,36 +1751,34 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
if (ParentID != 0)
|
||||
{
|
||||
SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID);
|
||||
if (part != null)
|
||||
SceneObjectPart part = ParentPart;
|
||||
TaskInventoryDictionary taskIDict = part.TaskInventory;
|
||||
if (taskIDict != null)
|
||||
{
|
||||
TaskInventoryDictionary taskIDict = part.TaskInventory;
|
||||
if (taskIDict != null)
|
||||
lock (taskIDict)
|
||||
{
|
||||
lock (taskIDict)
|
||||
foreach (UUID taskID in taskIDict.Keys)
|
||||
{
|
||||
foreach (UUID taskID in taskIDict.Keys)
|
||||
{
|
||||
UnRegisterControlEventsToScript(LocalId, taskID);
|
||||
taskIDict[taskID].PermsMask &= ~(
|
||||
2048 | //PERMISSION_CONTROL_CAMERA
|
||||
4); // PERMISSION_TAKE_CONTROLS
|
||||
}
|
||||
UnRegisterControlEventsToScript(LocalId, taskID);
|
||||
taskIDict[taskID].PermsMask &= ~(
|
||||
2048 | //PERMISSION_CONTROL_CAMERA
|
||||
4); // PERMISSION_TAKE_CONTROLS
|
||||
}
|
||||
}
|
||||
|
||||
// Reset sit target.
|
||||
if (part.SitTargetAvatar == UUID)
|
||||
part.SitTargetAvatar = UUID.Zero;
|
||||
|
||||
ParentPosition = part.GetWorldPosition();
|
||||
ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
|
||||
}
|
||||
|
||||
// Reset sit target.
|
||||
if (part.SitTargetAvatar == UUID)
|
||||
part.SitTargetAvatar = UUID.Zero;
|
||||
|
||||
ParentPosition = part.GetWorldPosition();
|
||||
ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
|
||||
|
||||
m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight);
|
||||
ParentPosition = Vector3.Zero;
|
||||
|
||||
ParentID = 0;
|
||||
ParentPart = null;
|
||||
SendAvatarDataToAllAgents();
|
||||
m_requestedSitTargetID = 0;
|
||||
|
||||
@@ -2270,19 +2204,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target",
|
||||
// Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId);
|
||||
}
|
||||
|
||||
ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
|
||||
ParentID = m_requestedSitTargetID;
|
||||
|
||||
Velocity = Vector3.Zero;
|
||||
RemoveFromPhysicalScene();
|
||||
|
||||
Animator.TrySetMovementAnimation(sitAnimation);
|
||||
SendAvatarDataToAllAgents();
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ParentID = m_requestedSitTargetID;
|
||||
|
||||
Velocity = Vector3.Zero;
|
||||
RemoveFromPhysicalScene();
|
||||
|
||||
Animator.TrySetMovementAnimation(sitAnimation);
|
||||
SendAvatarDataToAllAgents();
|
||||
}
|
||||
|
||||
public void HandleAgentSitOnGround()
|
||||
@@ -2741,7 +2672,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
AgentPosition agentpos = new AgentPosition();
|
||||
agentpos.CopyFrom(cadu);
|
||||
|
||||
m_scene.SendOutChildAgentUpdates(agentpos, this);
|
||||
// Let's get this out of the update loop
|
||||
Util.FireAndForget(delegate { m_scene.SendOutChildAgentUpdates(agentpos, this); });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3077,7 +3009,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
cAgent.Center = CameraPosition;
|
||||
cAgent.AtAxis = CameraAtAxis;
|
||||
cAgent.LeftAxis = CameraLeftAxis;
|
||||
cAgent.UpAxis = m_CameraUpAxis;
|
||||
cAgent.UpAxis = CameraUpAxis;
|
||||
|
||||
cAgent.Far = DrawDistance;
|
||||
|
||||
@@ -3163,7 +3095,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
CameraPosition = cAgent.Center;
|
||||
CameraAtAxis = cAgent.AtAxis;
|
||||
CameraLeftAxis = cAgent.LeftAxis;
|
||||
m_CameraUpAxis = cAgent.UpAxis;
|
||||
CameraUpAxis = cAgent.UpAxis;
|
||||
|
||||
// When we get to the point of re-computing neighbors everytime this
|
||||
// changes, then start using the agent's drawdistance rather than the
|
||||
@@ -3225,7 +3157,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
((SceneObjectGroup)so).LocalId = 0;
|
||||
((SceneObjectGroup)so).RootPart.ClearUpdateSchedule();
|
||||
so.SetState(cAgent.AttachmentObjectStates[i++], m_scene);
|
||||
m_scene.IncomingCreateObject(so);
|
||||
m_scene.IncomingCreateObject(Vector3.Zero, so);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using log4net;
|
||||
@@ -570,13 +571,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
|
||||
private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
|
||||
{
|
||||
bool errors = false;
|
||||
obj.Shape = ReadShape(reader, "Shape", out errors);
|
||||
List<string> errorNodeNames;
|
||||
obj.Shape = ReadShape(reader, "Shape", out errorNodeNames);
|
||||
|
||||
if (errors)
|
||||
if (errorNodeNames != null)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.",
|
||||
obj.Name, obj.UUID);
|
||||
"[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.",
|
||||
obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray()));
|
||||
}
|
||||
}
|
||||
|
||||
private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
|
||||
@@ -1470,7 +1473,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
m_SOPXmlProcessors,
|
||||
reader,
|
||||
(o, nodeName, e)
|
||||
=> m_log.ErrorFormat(
|
||||
=> m_log.DebugFormat(
|
||||
"[SceneObjectSerializer]: Exception while parsing {0} in object {1} {2}: {3}{4}",
|
||||
((SceneObjectPart)o).Name, ((SceneObjectPart)o).UUID, nodeName, e.Message, e.StackTrace));
|
||||
|
||||
@@ -1519,17 +1522,18 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
/// </summary>
|
||||
/// <param name="reader"></param>
|
||||
/// <param name="name">The name of the xml element containing the shape</param>
|
||||
/// <param name="errors">true if any errors were encountered during parsing, false otherwise</param>
|
||||
/// <param name="errors">a list containing the failing node names. If no failures then null.</param>
|
||||
/// <returns>The shape parsed</returns>
|
||||
public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors)
|
||||
public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames)
|
||||
{
|
||||
errors = false;
|
||||
List<string> internalErrorNodeNames = null;
|
||||
|
||||
PrimitiveBaseShape shape = new PrimitiveBaseShape();
|
||||
|
||||
if (reader.IsEmptyElement)
|
||||
{
|
||||
reader.Read();
|
||||
errorNodeNames = null;
|
||||
return shape;
|
||||
}
|
||||
|
||||
@@ -1540,12 +1544,22 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||
m_ShapeXmlProcessors,
|
||||
reader,
|
||||
(o, nodeName, e)
|
||||
=> m_log.ErrorFormat(
|
||||
"[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
|
||||
nodeName, e.Message, e.StackTrace));
|
||||
=>
|
||||
{
|
||||
// m_log.DebugFormat(
|
||||
// "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
|
||||
// nodeName, e.Message, e.StackTrace);
|
||||
if (internalErrorNodeNames == null)
|
||||
internalErrorNodeNames = new List<string>();
|
||||
|
||||
internalErrorNodeNames.Add(nodeName);
|
||||
}
|
||||
);
|
||||
|
||||
reader.ReadEndElement(); // Shape
|
||||
|
||||
errorNodeNames = internalErrorNodeNames;
|
||||
|
||||
return shape;
|
||||
}
|
||||
|
||||
|
||||
@@ -178,13 +178,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_objectCapacity = scene.RegionInfo.ObjectCapacity;
|
||||
m_report.AutoReset = true;
|
||||
m_report.Interval = statsUpdatesEveryMS;
|
||||
m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat);
|
||||
m_report.Elapsed += statsHeartBeat;
|
||||
m_report.Enabled = true;
|
||||
|
||||
if (StatsManager.SimExtraStats != null)
|
||||
OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket;
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
m_report.Elapsed -= statsHeartBeat;
|
||||
m_report.Close();
|
||||
}
|
||||
|
||||
public void SetUpdateMS(int ms)
|
||||
{
|
||||
statsUpdatesEveryMS = ms;
|
||||
|
||||
@@ -46,23 +46,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public TerrainChannel()
|
||||
{
|
||||
map = new double[Constants.RegionSize, Constants.RegionSize];
|
||||
taint = new bool[Constants.RegionSize / 16,Constants.RegionSize / 16];
|
||||
taint = new bool[Constants.RegionSize / 16, Constants.RegionSize / 16];
|
||||
|
||||
int x;
|
||||
for (x = 0; x < Constants.RegionSize; x++)
|
||||
{
|
||||
int y;
|
||||
for (y = 0; y < Constants.RegionSize; y++)
|
||||
{
|
||||
map[x, y] = TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10;
|
||||
double spherFacA = TerrainUtil.SphericalFactor(x, y, Constants.RegionSize / 2.0, Constants.RegionSize / 2.0, 50) * 0.01;
|
||||
double spherFacB = TerrainUtil.SphericalFactor(x, y, Constants.RegionSize / 2.0, Constants.RegionSize / 2.0, 100) * 0.001;
|
||||
if (map[x, y] < spherFacA)
|
||||
map[x, y] = spherFacA;
|
||||
if (map[x, y] < spherFacB)
|
||||
map[x, y] = spherFacB;
|
||||
}
|
||||
}
|
||||
PinHeadIsland();
|
||||
}
|
||||
|
||||
public TerrainChannel(String type)
|
||||
{
|
||||
map = new double[Constants.RegionSize, Constants.RegionSize];
|
||||
taint = new bool[Constants.RegionSize / 16, Constants.RegionSize / 16];
|
||||
|
||||
if (type.Equals("flat"))
|
||||
FlatLand();
|
||||
else
|
||||
PinHeadIsland();
|
||||
}
|
||||
|
||||
public TerrainChannel(double[,] import)
|
||||
@@ -238,5 +235,36 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void PinHeadIsland()
|
||||
{
|
||||
int x;
|
||||
for (x = 0; x < Constants.RegionSize; x++)
|
||||
{
|
||||
int y;
|
||||
for (y = 0; y < Constants.RegionSize; y++)
|
||||
{
|
||||
map[x, y] = TerrainUtil.PerlinNoise2D(x, y, 2, 0.125) * 10;
|
||||
double spherFacA = TerrainUtil.SphericalFactor(x, y, Constants.RegionSize / 2.0, Constants.RegionSize / 2.0, 50) * 0.01;
|
||||
double spherFacB = TerrainUtil.SphericalFactor(x, y, Constants.RegionSize / 2.0, Constants.RegionSize / 2.0, 100) * 0.001;
|
||||
if (map[x, y] < spherFacA)
|
||||
map[x, y] = spherFacA;
|
||||
if (map[x, y] < spherFacB)
|
||||
map[x, y] = spherFacB;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void FlatLand()
|
||||
{
|
||||
int x;
|
||||
for (x = 0; x < Constants.RegionSize; x++)
|
||||
{
|
||||
int y;
|
||||
for (y = 0; y < Constants.RegionSize; y++)
|
||||
map[x, y] = 21;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using NUnit.Framework;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -43,6 +44,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
[TestFixture]
|
||||
public class SceneObjectBasicTests
|
||||
{
|
||||
// [TearDown]
|
||||
// public void TearDown()
|
||||
// {
|
||||
// Console.WriteLine("TearDown");
|
||||
// GC.Collect();
|
||||
// Thread.Sleep(3000);
|
||||
// }
|
||||
|
||||
// public class GcNotify
|
||||
// {
|
||||
// public static AutoResetEvent gcEvent = new AutoResetEvent(false);
|
||||
// private static bool _initialized = false;
|
||||
//
|
||||
// public static void Initialize()
|
||||
// {
|
||||
// if (!_initialized)
|
||||
// {
|
||||
// _initialized = true;
|
||||
// new GcNotify();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// private GcNotify(){}
|
||||
//
|
||||
// ~GcNotify()
|
||||
// {
|
||||
// if (!Environment.HasShutdownStarted &&
|
||||
// !AppDomain.CurrentDomain.IsFinalizingForUnload())
|
||||
// {
|
||||
// Console.WriteLine("GcNotify called");
|
||||
// gcEvent.Set();
|
||||
// new GcNotify();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// Test adding an object to a scene.
|
||||
/// </summary>
|
||||
@@ -147,11 +184,11 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
public void TestDeleteSceneObject()
|
||||
{
|
||||
TestHelpers.InMethod();
|
||||
|
||||
|
||||
TestScene scene = SceneHelpers.SetupScene();
|
||||
SceneObjectPart part = SceneHelpers.AddSceneObject(scene);
|
||||
scene.DeleteSceneObject(part.ParentGroup, false);
|
||||
|
||||
|
||||
SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
|
||||
Assert.That(retrievedPart, Is.Null);
|
||||
}
|
||||
|
||||
@@ -65,8 +65,7 @@ namespace OpenSim.Region.Framework.Tests
|
||||
|
||||
// Create an object embedded inside the first
|
||||
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
|
||||
TaskInventoryItem taskSceneObjectItem
|
||||
= TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
|
||||
TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
|
||||
|
||||
TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId);
|
||||
Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
m_client = client;
|
||||
m_scene = scene;
|
||||
|
||||
Watchdog.StartThread(InternalLoop, "IRCClientView", ThreadPriority.Normal, false);
|
||||
Watchdog.StartThread(InternalLoop, "IRCClientView", ThreadPriority.Normal, false, true);
|
||||
}
|
||||
|
||||
private void SendServerCommand(string command)
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||
|
||||
m_listener.Start(50);
|
||||
|
||||
Watchdog.StartThread(ListenLoop, "IRCServer", ThreadPriority.Normal, false);
|
||||
Watchdog.StartThread(ListenLoop, "IRCServer", ThreadPriority.Normal, false, true);
|
||||
m_baseScene = baseScene;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user