diff options
author | Justin Clark-Casey (justincc) | 2010-03-12 17:58:25 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-03-12 17:58:25 +0000 |
commit | db61d66e746df4b1919b031de72bee7cf3a796f3 (patch) | |
tree | 770a8101a52222f87f298de79fabbd4aad176333 /OpenSim | |
parent | minor: add some more documentation for IHttpServer.AddHTTPHandler() to tell t... (diff) | |
parent | Changed some properties and methods from private to protected in LLLoginRespo... (diff) | |
download | opensim-SC-db61d66e746df4b1919b031de72bee7cf3a796f3.zip opensim-SC-db61d66e746df4b1919b031de72bee7cf3a796f3.tar.gz opensim-SC-db61d66e746df4b1919b031de72bee7cf3a796f3.tar.bz2 opensim-SC-db61d66e746df4b1919b031de72bee7cf3a796f3.tar.xz |
Merge branch 'master' of ssh://justincc@opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
57 files changed, 773 insertions, 150 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs index 7b435f5..2dec72d 100644 --- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs +++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs | |||
@@ -598,6 +598,7 @@ namespace OpenSim.Client.MXP.ClientStack | |||
598 | public event Action<IClientAPI> OnRegionHandShakeReply; | 598 | public event Action<IClientAPI> OnRegionHandShakeReply; |
599 | public event GenericCall2 OnRequestWearables; | 599 | public event GenericCall2 OnRequestWearables; |
600 | public event GenericCall1 OnCompleteMovementToRegion; | 600 | public event GenericCall1 OnCompleteMovementToRegion; |
601 | public event UpdateAgent OnPreAgentUpdate; | ||
601 | public event UpdateAgent OnAgentUpdate; | 602 | public event UpdateAgent OnAgentUpdate; |
602 | public event AgentRequestSit OnAgentRequestSit; | 603 | public event AgentRequestSit OnAgentRequestSit; |
603 | public event AgentSit OnAgentSit; | 604 | public event AgentSit OnAgentSit; |
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs index e2986d9..9cb2172 100644 --- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs +++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs | |||
@@ -244,6 +244,7 @@ namespace OpenSim.Client.Sirikata.ClientStack | |||
244 | public event Action<IClientAPI> OnRegionHandShakeReply; | 244 | public event Action<IClientAPI> OnRegionHandShakeReply; |
245 | public event GenericCall2 OnRequestWearables; | 245 | public event GenericCall2 OnRequestWearables; |
246 | public event GenericCall1 OnCompleteMovementToRegion; | 246 | public event GenericCall1 OnCompleteMovementToRegion; |
247 | public event UpdateAgent OnPreAgentUpdate; | ||
247 | public event UpdateAgent OnAgentUpdate; | 248 | public event UpdateAgent OnAgentUpdate; |
248 | public event AgentRequestSit OnAgentRequestSit; | 249 | public event AgentRequestSit OnAgentRequestSit; |
249 | public event AgentSit OnAgentSit; | 250 | public event AgentSit OnAgentSit; |
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs index c4f2016..a427dd3 100644 --- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs +++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs | |||
@@ -247,6 +247,7 @@ namespace OpenSim.Client.VWoHTTP.ClientStack | |||
247 | public event Action<IClientAPI> OnRegionHandShakeReply = delegate { }; | 247 | public event Action<IClientAPI> OnRegionHandShakeReply = delegate { }; |
248 | public event GenericCall2 OnRequestWearables = delegate { }; | 248 | public event GenericCall2 OnRequestWearables = delegate { }; |
249 | public event GenericCall1 OnCompleteMovementToRegion = delegate { }; | 249 | public event GenericCall1 OnCompleteMovementToRegion = delegate { }; |
250 | public event UpdateAgent OnPreAgentUpdate; | ||
250 | public event UpdateAgent OnAgentUpdate = delegate { }; | 251 | public event UpdateAgent OnAgentUpdate = delegate { }; |
251 | public event AgentRequestSit OnAgentRequestSit = delegate { }; | 252 | public event AgentRequestSit OnAgentRequestSit = delegate { }; |
252 | public event AgentSit OnAgentSit = delegate { }; | 253 | public event AgentSit OnAgentSit = delegate { }; |
diff --git a/OpenSim/Data/IGridUserData.cs b/OpenSim/Data/IGridUserData.cs index abd2cef..bd7a435 100644 --- a/OpenSim/Data/IGridUserData.cs +++ b/OpenSim/Data/IGridUserData.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Data | |||
44 | /// </summary> | 44 | /// </summary> |
45 | public interface IGridUserData | 45 | public interface IGridUserData |
46 | { | 46 | { |
47 | GridUserData GetGridUserData(string userID); | 47 | GridUserData GetGridUserData(string userID); |
48 | bool StoreGridUserData(GridUserData data); | 48 | bool StoreGridUserData(GridUserData data); |
49 | } | 49 | } |
50 | } \ No newline at end of file | 50 | } \ No newline at end of file |
diff --git a/OpenSim/Data/MSSQL/MSSQLAvatarData.cs b/OpenSim/Data/MSSQL/MSSQLAvatarData.cs index 4992183..49a6b09 100644 --- a/OpenSim/Data/MSSQL/MSSQLAvatarData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAvatarData.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Data.MSSQL | |||
47 | 47 | ||
48 | public MSSQLAvatarData(string connectionString, string realm) : | 48 | public MSSQLAvatarData(string connectionString, string realm) : |
49 | base(connectionString, realm, "Avatar") | 49 | base(connectionString, realm, "Avatar") |
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | public bool Delete(UUID principalID, string name) | 53 | public bool Delete(UUID principalID, string name) |
diff --git a/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs b/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs index 506056d..904366e 100644 --- a/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs +++ b/OpenSim/Data/MSSQL/MSSQLGenericTableHandler.cs | |||
@@ -110,7 +110,7 @@ namespace OpenSim.Data.MSSQL | |||
110 | { | 110 | { |
111 | List<string> constraints = new List<string>(); | 111 | List<string> constraints = new List<string>(); |
112 | string query = string.Format(@"SELECT | 112 | string query = string.Format(@"SELECT |
113 | COL_NAME(ic.object_id,ic.column_id) AS column_name | 113 | COL_NAME(ic.object_id,ic.column_id) AS column_name |
114 | FROM sys.indexes AS i | 114 | FROM sys.indexes AS i |
115 | INNER JOIN sys.index_columns AS ic | 115 | INNER JOIN sys.index_columns AS ic |
116 | ON i.object_id = ic.object_id AND i.index_id = ic.index_id | 116 | ON i.object_id = ic.object_id AND i.index_id = ic.index_id |
@@ -157,7 +157,7 @@ namespace OpenSim.Data.MSSQL | |||
157 | string where = String.Join(" AND ", terms.ToArray()); | 157 | string where = String.Join(" AND ", terms.ToArray()); |
158 | 158 | ||
159 | string query = String.Format("SELECT * FROM {0} WHERE {1}", | 159 | string query = String.Format("SELECT * FROM {0} WHERE {1}", |
160 | m_Realm, where); | 160 | m_Realm, where); |
161 | 161 | ||
162 | cmd.Connection = conn; | 162 | cmd.Connection = conn; |
163 | cmd.CommandText = query; | 163 | cmd.CommandText = query; |
@@ -296,7 +296,7 @@ namespace OpenSim.Data.MSSQL | |||
296 | query.AppendFormat("[{0}] = {1} ", names[i], values[i]); | 296 | query.AppendFormat("[{0}] = {1} ", names[i], values[i]); |
297 | if (constraints.Count > 0) | 297 | if (constraints.Count > 0) |
298 | { | 298 | { |
299 | List<string> terms = new List<string>(); | 299 | List<string> terms = new List<string>(); |
300 | for (int j = 0; j < constraints.Count; j++) | 300 | for (int j = 0; j < constraints.Count; j++) |
301 | { | 301 | { |
302 | terms.Add(" [" + constraints[j].Key + "] = @" + constraints[j].Key); | 302 | terms.Add(" [" + constraints[j].Key + "] = @" + constraints[j].Key); |
diff --git a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs index b4a945c..9993720 100644 --- a/OpenSim/Data/MSSQL/MSSQLGridUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLGridUserData.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Data.MSSQL | |||
47 | 47 | ||
48 | public MSSQLGridUserData(string connectionString, string realm) : | 48 | public MSSQLGridUserData(string connectionString, string realm) : |
49 | base(connectionString, realm, "UserGrid") | 49 | base(connectionString, realm, "UserGrid") |
50 | { | 50 | { |
51 | } | 51 | } |
52 | 52 | ||
53 | public GridUserData GetGridUserData(string userID) | 53 | public GridUserData GetGridUserData(string userID) |
@@ -58,7 +58,7 @@ namespace OpenSim.Data.MSSQL | |||
58 | return null; | 58 | return null; |
59 | 59 | ||
60 | return ret[0]; | 60 | return ret[0]; |
61 | } | 61 | } |
62 | 62 | ||
63 | public bool StoreGridUserData(GridUserData data) | 63 | public bool StoreGridUserData(GridUserData data) |
64 | { | 64 | { |
diff --git a/OpenSim/Data/MSSQL/MSSQLManager.cs b/OpenSim/Data/MSSQL/MSSQLManager.cs index 4309b42..575fd21 100644 --- a/OpenSim/Data/MSSQL/MSSQLManager.cs +++ b/OpenSim/Data/MSSQL/MSSQLManager.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Data.MSSQL | |||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Connection string for ADO.net | 47 | /// Connection string for ADO.net |
48 | /// </summary> | 48 | /// </summary> |
49 | private readonly string connectionString; | 49 | private readonly string connectionString; |
50 | 50 | ||
51 | /// <summary> | 51 | /// <summary> |
52 | /// Initialize the manager and set the connectionstring | 52 | /// Initialize the manager and set the connectionstring |
@@ -196,7 +196,7 @@ namespace OpenSim.Data.MSSQL | |||
196 | 196 | ||
197 | migration.Update(); | 197 | migration.Update(); |
198 | } | 198 | } |
199 | } | 199 | } |
200 | 200 | ||
201 | /// <summary> | 201 | /// <summary> |
202 | /// Returns the version of this DB provider | 202 | /// Returns the version of this DB provider |
diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs index 9f18e5e..e7c8dc5 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Data.MSSQL | |||
43 | { | 43 | { |
44 | } | 44 | } |
45 | //private string m_Realm; | 45 | //private string m_Realm; |
46 | //private List<string> m_ColumnNames = null; | 46 | //private List<string> m_ColumnNames = null; |
47 | //private MSSQLManager m_database; | 47 | //private MSSQLManager m_database; |
48 | 48 | ||
49 | //public MSSQLUserAccountData(string connectionString, string realm) | 49 | //public MSSQLUserAccountData(string connectionString, string realm) |
diff --git a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs index 756b42d..1253e0b 100644 --- a/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs +++ b/OpenSim/Data/MySQL/MySQLGenericTableHandler.cs | |||
@@ -197,7 +197,7 @@ namespace OpenSim.Data.MySQL | |||
197 | public virtual T[] Get(string where) | 197 | public virtual T[] Get(string where) |
198 | { | 198 | { |
199 | using (MySqlCommand cmd = new MySqlCommand()) | 199 | using (MySqlCommand cmd = new MySqlCommand()) |
200 | { | 200 | { |
201 | string query = String.Format("select * from {0} where {1}", | 201 | string query = String.Format("select * from {0} where {1}", |
202 | m_Realm, where); | 202 | m_Realm, where); |
203 | 203 | ||
diff --git a/OpenSim/Data/MySQL/MySQLGridUserData.cs b/OpenSim/Data/MySQL/MySQLGridUserData.cs index 15834d2..df29ecd 100644 --- a/OpenSim/Data/MySQL/MySQLGridUserData.cs +++ b/OpenSim/Data/MySQL/MySQLGridUserData.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Data.MySQL | |||
54 | return null; | 54 | return null; |
55 | 55 | ||
56 | return ret[0]; | 56 | return ret[0]; |
57 | } | 57 | } |
58 | 58 | ||
59 | public bool StoreGridUserData(GridUserData data) | 59 | public bool StoreGridUserData(GridUserData data) |
60 | { | 60 | { |
diff --git a/OpenSim/Data/MySQL/MySQLPresenceData.cs b/OpenSim/Data/MySQL/MySQLPresenceData.cs index 68a68af..143dbe3 100644 --- a/OpenSim/Data/MySQL/MySQLPresenceData.cs +++ b/OpenSim/Data/MySQL/MySQLPresenceData.cs | |||
@@ -134,7 +134,7 @@ namespace OpenSim.Data.MySQL | |||
134 | List<UUID> deleteSessions = new List<UUID>(); | 134 | List<UUID> deleteSessions = new List<UUID>(); |
135 | int online = 0; | 135 | int online = 0; |
136 | 136 | ||
137 | while(reader.Read()) | 137 | while (reader.Read()) |
138 | { | 138 | { |
139 | if (bool.Parse(reader["Online"].ToString())) | 139 | if (bool.Parse(reader["Online"].ToString())) |
140 | online++; | 140 | online++; |
diff --git a/OpenSim/Data/Null/NullPresenceData.cs b/OpenSim/Data/Null/NullPresenceData.cs index 9fc4595..b98b5c9 100644 --- a/OpenSim/Data/Null/NullPresenceData.cs +++ b/OpenSim/Data/Null/NullPresenceData.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Data.Null | |||
55 | } | 55 | } |
56 | 56 | ||
57 | public bool Store(PresenceData data) | 57 | public bool Store(PresenceData data) |
58 | { | 58 | { |
59 | if (Instance != this) | 59 | if (Instance != this) |
60 | return Instance.Store(data); | 60 | return Instance.Store(data); |
61 | 61 | ||
@@ -113,7 +113,7 @@ namespace OpenSim.Data.Null | |||
113 | } | 113 | } |
114 | 114 | ||
115 | public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt) | 115 | public bool SetHomeLocation(string userID, UUID regionID, Vector3 position, Vector3 lookAt) |
116 | { | 116 | { |
117 | if (Instance != this) | 117 | if (Instance != this) |
118 | return Instance.SetHomeLocation(userID, regionID, position, lookAt); | 118 | return Instance.SetHomeLocation(userID, regionID, position, lookAt); |
119 | 119 | ||
@@ -130,28 +130,28 @@ namespace OpenSim.Data.Null | |||
130 | p.Data["HomePosition"] = position.ToString(); | 130 | p.Data["HomePosition"] = position.ToString(); |
131 | p.Data["HomeLookAt"] = lookAt.ToString(); | 131 | p.Data["HomeLookAt"] = lookAt.ToString(); |
132 | foundone = true; | 132 | foundone = true; |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | return foundone; | 136 | return foundone; |
137 | } | 137 | } |
138 | 138 | ||
139 | public PresenceData[] Get(string field, string data) | 139 | public PresenceData[] Get(string field, string data) |
140 | { | 140 | { |
141 | if (Instance != this) | 141 | if (Instance != this) |
142 | return Instance.Get(field, data); | 142 | return Instance.Get(field, data); |
143 | 143 | ||
144 | // m_log.DebugFormat( | 144 | // m_log.DebugFormat( |
145 | // "[NULL PRESENCE DATA]: Getting presence data for field {0} with parameter {1}", field, data); | 145 | // "[NULL PRESENCE DATA]: Getting presence data for field {0} with parameter {1}", field, data); |
146 | 146 | ||
147 | List<PresenceData> presences = new List<PresenceData>(); | 147 | List<PresenceData> presences = new List<PresenceData>(); |
148 | if (field == "UserID") | 148 | if (field == "UserID") |
149 | { | 149 | { |
150 | foreach (PresenceData p in m_presenceData.Values) | 150 | foreach (PresenceData p in m_presenceData.Values) |
151 | { | 151 | { |
152 | if (p.UserID == data) | 152 | if (p.UserID == data) |
153 | { | 153 | { |
154 | presences.Add(p); | 154 | presences.Add(p); |
155 | // Console.WriteLine("HOME for " + p.UserID + " is " + (p.Data.ContainsKey("HomeRegionID") ? p.Data["HomeRegionID"] : "Not found")); | 155 | // Console.WriteLine("HOME for " + p.UserID + " is " + (p.Data.ContainsKey("HomeRegionID") ? p.Data["HomeRegionID"] : "Not found")); |
156 | } | 156 | } |
157 | } | 157 | } |
@@ -194,7 +194,7 @@ namespace OpenSim.Data.Null | |||
194 | } | 194 | } |
195 | 195 | ||
196 | public void Prune(string userID) | 196 | public void Prune(string userID) |
197 | { | 197 | { |
198 | if (Instance != this) | 198 | if (Instance != this) |
199 | { | 199 | { |
200 | Instance.Prune(userID); | 200 | Instance.Prune(userID); |
diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs index 84ce775..2c28375 100644 --- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs +++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs | |||
@@ -120,7 +120,7 @@ namespace OpenSim.Data.SQLite | |||
120 | } | 120 | } |
121 | 121 | ||
122 | public bool Store(AuthenticationData data) | 122 | public bool Store(AuthenticationData data) |
123 | { | 123 | { |
124 | if (data.Data.ContainsKey("UUID")) | 124 | if (data.Data.ContainsKey("UUID")) |
125 | data.Data.Remove("UUID"); | 125 | data.Data.Remove("UUID"); |
126 | 126 | ||
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 0c268bf..4f6f709 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -881,6 +881,7 @@ namespace OpenSim.Framework | |||
881 | event Action<IClientAPI> OnRegionHandShakeReply; | 881 | event Action<IClientAPI> OnRegionHandShakeReply; |
882 | event GenericCall2 OnRequestWearables; | 882 | event GenericCall2 OnRequestWearables; |
883 | event GenericCall1 OnCompleteMovementToRegion; | 883 | event GenericCall1 OnCompleteMovementToRegion; |
884 | event UpdateAgent OnPreAgentUpdate; | ||
884 | event UpdateAgent OnAgentUpdate; | 885 | event UpdateAgent OnAgentUpdate; |
885 | event AgentRequestSit OnAgentRequestSit; | 886 | event AgentRequestSit OnAgentRequestSit; |
886 | event AgentSit OnAgentSit; | 887 | event AgentSit OnAgentSit; |
diff --git a/OpenSim/Framework/MultipartForm.cs b/OpenSim/Framework/MultipartForm.cs index 8ba6d22..90c4007 100644 --- a/OpenSim/Framework/MultipartForm.cs +++ b/OpenSim/Framework/MultipartForm.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Net; | 30 | using System.Net; |
4 | using System.IO; | 31 | using System.IO; |
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index 2fc5bdf..f6d6a7c 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Reflection; | 30 | using System.Reflection; |
4 | using log4net; | 31 | using log4net; |
@@ -219,7 +246,7 @@ namespace OpenSim.Framework | |||
219 | /// Parse a notecard in Linden format to a string of ordinary text. | 246 | /// Parse a notecard in Linden format to a string of ordinary text. |
220 | /// </summary> | 247 | /// </summary> |
221 | /// <param name="rawInput"></param> | 248 | /// <param name="rawInput"></param> |
222 | /// <returns></returns> | 249 | /// <returns></returns> |
223 | public static string ParseNotecardToString(string rawInput) | 250 | public static string ParseNotecardToString(string rawInput) |
224 | { | 251 | { |
225 | string[] output = ParseNotecardToList(rawInput).ToArray(); | 252 | string[] output = ParseNotecardToList(rawInput).ToArray(); |
@@ -237,7 +264,7 @@ namespace OpenSim.Framework | |||
237 | /// <returns></returns> | 264 | /// <returns></returns> |
238 | public static List<string> ParseNotecardToList(string rawInput) | 265 | public static List<string> ParseNotecardToList(string rawInput) |
239 | { | 266 | { |
240 | string[] input = rawInput.Replace("\r", "").Split('\n'); | 267 | string[] input = rawInput.Replace("\r", "").Split('\n'); |
241 | int idx = 0; | 268 | int idx = 0; |
242 | int level = 0; | 269 | int level = 0; |
243 | List<string> output = new List<string>(); | 270 | List<string> output = new List<string>(); |
diff --git a/OpenSim/Framework/UntrustedWebRequest.cs b/OpenSim/Framework/UntrustedWebRequest.cs index 1af7c41..e6411cc 100644 --- a/OpenSim/Framework/UntrustedWebRequest.cs +++ b/OpenSim/Framework/UntrustedWebRequest.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.IO; | 30 | using System.IO; |
4 | using System.Net; | 31 | using System.Net; |
@@ -118,7 +145,7 @@ namespace OpenSim.Framework | |||
118 | /// <param name="allowLoopback">True to allow loopback addresses to be used</param> | 145 | /// <param name="allowLoopback">True to allow loopback addresses to be used</param> |
119 | /// <param name="uri">The URI to test for whether it should be allowed.</param> | 146 | /// <param name="uri">The URI to test for whether it should be allowed.</param> |
120 | /// <returns> | 147 | /// <returns> |
121 | /// <c>true</c> if [is URI allowable] [the specified URI]; otherwise, <c>false</c>. | 148 | /// <c>true</c> if [is URI allowable] [the specified URI]; otherwise, <c>false</c>. |
122 | /// </returns> | 149 | /// </returns> |
123 | private static bool IsUriAllowable(Uri uri, bool allowLoopback) | 150 | private static bool IsUriAllowable(Uri uri, bool allowLoopback) |
124 | { | 151 | { |
@@ -180,7 +207,7 @@ namespace OpenSim.Framework | |||
180 | /// </summary> | 207 | /// </summary> |
181 | /// <param name="ip">The ip address to check.</param> | 208 | /// <param name="ip">The ip address to check.</param> |
182 | /// <returns> | 209 | /// <returns> |
183 | /// <c>true</c> if this is a loopback IP address; <c>false</c> otherwise. | 210 | /// <c>true</c> if this is a loopback IP address; <c>false</c> otherwise. |
184 | /// </returns> | 211 | /// </returns> |
185 | private static bool IsIPv6Loopback(IPAddress ip) | 212 | private static bool IsIPv6Loopback(IPAddress ip) |
186 | { | 213 | { |
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index d9782ff..16e44af 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Collections.Specialized; | 30 | using System.Collections.Specialized; |
4 | using System.IO; | 31 | using System.IO; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 2e59457..a9b5c2b 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -127,6 +127,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
127 | public event ObjectDeselect OnObjectDetach; | 127 | public event ObjectDeselect OnObjectDetach; |
128 | public event ObjectDrop OnObjectDrop; | 128 | public event ObjectDrop OnObjectDrop; |
129 | public event GenericCall1 OnCompleteMovementToRegion; | 129 | public event GenericCall1 OnCompleteMovementToRegion; |
130 | public event UpdateAgent OnPreAgentUpdate; | ||
130 | public event UpdateAgent OnAgentUpdate; | 131 | public event UpdateAgent OnAgentUpdate; |
131 | public event AgentRequestSit OnAgentRequestSit; | 132 | public event AgentRequestSit OnAgentRequestSit; |
132 | public event AgentSit OnAgentSit; | 133 | public event AgentSit OnAgentSit; |
@@ -4893,7 +4894,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4893 | UpdateAgent handlerAgentUpdate = OnAgentUpdate; | 4894 | UpdateAgent handlerAgentUpdate = OnAgentUpdate; |
4894 | lastarg = arg; // save this set of arguments for nexttime | 4895 | lastarg = arg; // save this set of arguments for nexttime |
4895 | if (handlerAgentUpdate != null) | 4896 | if (handlerAgentUpdate != null) |
4897 | { | ||
4898 | OnPreAgentUpdate(this, arg); | ||
4896 | OnAgentUpdate(this, arg); | 4899 | OnAgentUpdate(this, arg); |
4900 | } | ||
4897 | 4901 | ||
4898 | handlerAgentUpdate = null; | 4902 | handlerAgentUpdate = null; |
4899 | } | 4903 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index d458364..3b7fe88 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -36,7 +36,7 @@ using OpenSim.Region.Framework.Interfaces; | |||
36 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
37 | 37 | ||
38 | namespace OpenSim.Region.CoreModules.Avatar.Attachments | 38 | namespace OpenSim.Region.CoreModules.Avatar.Attachments |
39 | { | 39 | { |
40 | public class AttachmentsModule : IAttachmentsModule, IRegionModule | 40 | public class AttachmentsModule : IAttachmentsModule, IRegionModule |
41 | { | 41 | { |
42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 42 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -204,7 +204,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
204 | if (m_scene.AvatarFactory != null) | 204 | if (m_scene.AvatarFactory != null) |
205 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); | 205 | m_scene.AvatarFactory.UpdateDatabase(remoteClient.AgentId, presence.Appearance); |
206 | } | 206 | } |
207 | } | 207 | } |
208 | 208 | ||
209 | public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient) | 209 | public void ShowDetachInUserInventory(UUID itemID, IClientAPI remoteClient) |
210 | { | 210 | { |
@@ -222,7 +222,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
222 | } | 222 | } |
223 | 223 | ||
224 | DetachSingleAttachmentToInv(itemID, remoteClient); | 224 | DetachSingleAttachmentToInv(itemID, remoteClient); |
225 | } | 225 | } |
226 | 226 | ||
227 | // What makes this method odd and unique is it tries to detach using an UUID.... Yay for standards. | 227 | // What makes this method odd and unique is it tries to detach using an UUID.... Yay for standards. |
228 | // To LocalId or UUID, *THAT* is the question. How now Brown UUID?? | 228 | // To LocalId or UUID, *THAT* is the question. How now Brown UUID?? |
@@ -252,6 +252,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
252 | } | 252 | } |
253 | } | 253 | } |
254 | } | 254 | } |
255 | } | 255 | } |
256 | } | 256 | } |
257 | } \ No newline at end of file | 257 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index de324c0..312db38 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -394,11 +394,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
394 | public IClientAPI LocateClientObject(UUID agentID) | 394 | public IClientAPI LocateClientObject(UUID agentID) |
395 | { | 395 | { |
396 | Scene scene = GetClientScene(agentID); | 396 | Scene scene = GetClientScene(agentID); |
397 | if(scene == null) | 397 | if (scene == null) |
398 | return null; | 398 | return null; |
399 | 399 | ||
400 | ScenePresence presence = scene.GetScenePresence(agentID); | 400 | ScenePresence presence = scene.GetScenePresence(agentID); |
401 | if(presence == null) | 401 | if (presence == null) |
402 | return null; | 402 | return null; |
403 | 403 | ||
404 | return presence.ControllingClient; | 404 | return presence.ControllingClient; |
@@ -481,7 +481,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
481 | m_log.DebugFormat("[FRIENDS]: {0} offered friendship to {1}", principalID, friendID); | 481 | m_log.DebugFormat("[FRIENDS]: {0} offered friendship to {1}", principalID, friendID); |
482 | 482 | ||
483 | // This user wants to be friends with the other user. | 483 | // This user wants to be friends with the other user. |
484 | // Let's add both relations to the DB, but one of them is inactive (-1) | 484 | // Let's add the relation backwards, in case the other is not online |
485 | FriendsService.StoreFriend(friendID, principalID.ToString(), 0); | 485 | FriendsService.StoreFriend(friendID, principalID.ToString(), 0); |
486 | 486 | ||
487 | // Now let's ask the other user to be friends with this user | 487 | // Now let's ask the other user to be friends with this user |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs index c0d3f31..ad050a1 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/MessageTransferModule.cs | |||
@@ -108,7 +108,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
108 | if (!m_Enabled) | 108 | if (!m_Enabled) |
109 | return; | 109 | return; |
110 | 110 | ||
111 | lock(m_Scenes) | 111 | lock (m_Scenes) |
112 | { | 112 | { |
113 | m_Scenes.Remove(scene); | 113 | m_Scenes.Remove(scene); |
114 | } | 114 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 0fc467b..16e05b7 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -576,7 +576,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
576 | foreach (SceneObjectPart part in partList) | 576 | foreach (SceneObjectPart part in partList) |
577 | { | 577 | { |
578 | if (part.OwnerID != item.Owner) | 578 | if (part.OwnerID != item.Owner) |
579 | { | 579 | { |
580 | part.LastOwnerID = part.OwnerID; | 580 | part.LastOwnerID = part.OwnerID; |
581 | part.OwnerID = item.Owner; | 581 | part.OwnerID = item.Owner; |
582 | part.Inventory.ChangeInventoryOwner(item.Owner); | 582 | part.Inventory.ChangeInventoryOwner(item.Owner); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs index 292ff8e..63a28fc 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests | |||
61 | m_LocalConnector = new LocalPresenceServicesConnector(config); | 61 | m_LocalConnector = new LocalPresenceServicesConnector(config); |
62 | 62 | ||
63 | // Let's stick in a test presence | 63 | // Let's stick in a test presence |
64 | m_LocalConnector.m_PresenceService.LoginAgent(UUID.Zero.ToString(), UUID.Zero, UUID.Zero); | 64 | m_LocalConnector.m_PresenceService.LoginAgent(UUID.Zero.ToString(), UUID.Zero, UUID.Zero); |
65 | } | 65 | } |
66 | 66 | ||
67 | /// <summary> | 67 | /// <summary> |
@@ -80,7 +80,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests | |||
80 | p.Data = new Dictionary<string, string>(); | 80 | p.Data = new Dictionary<string, string>(); |
81 | p.Data["Online"] = true.ToString(); | 81 | p.Data["Online"] = true.ToString(); |
82 | m_presenceData.Add(UUID.Zero, p); | 82 | m_presenceData.Add(UUID.Zero, p); |
83 | */ | 83 | */ |
84 | 84 | ||
85 | string user1 = UUID.Zero.ToString(); | 85 | string user1 = UUID.Zero.ToString(); |
86 | UUID session1 = UUID.Zero; | 86 | UUID session1 = UUID.Zero; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index 07fee79..ce0ca40 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |||
@@ -142,26 +142,27 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
142 | 142 | ||
143 | public UserAccount GetUserAccount(UUID scopeID, UUID userID) | 143 | public UserAccount GetUserAccount(UUID scopeID, UUID userID) |
144 | { | 144 | { |
145 | UserAccount account = m_Cache.Get(userID); | 145 | bool inCache = false; |
146 | if (account != null) | 146 | UserAccount account = m_Cache.Get(userID, out inCache); |
147 | if (inCache) | ||
147 | return account; | 148 | return account; |
148 | 149 | ||
149 | account = m_UserService.GetUserAccount(scopeID, userID); | 150 | account = m_UserService.GetUserAccount(scopeID, userID); |
150 | if (account != null) | 151 | m_Cache.Cache(userID, account); |
151 | m_Cache.Cache(account); | ||
152 | 152 | ||
153 | return account; | 153 | return account; |
154 | } | 154 | } |
155 | 155 | ||
156 | public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) | 156 | public UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) |
157 | { | 157 | { |
158 | UserAccount account = m_Cache.Get(firstName + " " + lastName); | 158 | bool inCache = false; |
159 | if (account != null) | 159 | UserAccount account = m_Cache.Get(firstName + " " + lastName, out inCache); |
160 | if (inCache) | ||
160 | return account; | 161 | return account; |
161 | 162 | ||
162 | account = m_UserService.GetUserAccount(scopeID, firstName, lastName); | 163 | account = m_UserService.GetUserAccount(scopeID, firstName, lastName); |
163 | if (account != null) | 164 | if (account != null) |
164 | m_Cache.Cache(account); | 165 | m_Cache.Cache(account.PrincipalID, account); |
165 | 166 | ||
166 | return account; | 167 | return account; |
167 | } | 168 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs index 1140692..488dbd5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs | |||
@@ -119,26 +119,27 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
119 | 119 | ||
120 | public override UserAccount GetUserAccount(UUID scopeID, UUID userID) | 120 | public override UserAccount GetUserAccount(UUID scopeID, UUID userID) |
121 | { | 121 | { |
122 | UserAccount account = m_Cache.Get(userID); | 122 | bool inCache = false; |
123 | if (account != null) | 123 | UserAccount account = m_Cache.Get(userID, out inCache); |
124 | if (inCache) | ||
124 | return account; | 125 | return account; |
125 | 126 | ||
126 | account = base.GetUserAccount(scopeID, userID); | 127 | account = base.GetUserAccount(scopeID, userID); |
127 | if (account != null) | 128 | m_Cache.Cache(userID, account); |
128 | m_Cache.Cache(account); | ||
129 | 129 | ||
130 | return account; | 130 | return account; |
131 | } | 131 | } |
132 | 132 | ||
133 | public override UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) | 133 | public override UserAccount GetUserAccount(UUID scopeID, string firstName, string lastName) |
134 | { | 134 | { |
135 | UserAccount account = m_Cache.Get(firstName + " " + lastName); | 135 | bool inCache = false; |
136 | if (account != null) | 136 | UserAccount account = m_Cache.Get(firstName + " " + lastName, out inCache); |
137 | if (inCache) | ||
137 | return account; | 138 | return account; |
138 | 139 | ||
139 | account = base.GetUserAccount(scopeID, firstName, lastName); | 140 | account = base.GetUserAccount(scopeID, firstName, lastName); |
140 | if (account != null) | 141 | if (account != null) |
141 | m_Cache.Cache(account); | 142 | m_Cache.Cache(account.PrincipalID, account); |
142 | 143 | ||
143 | return account; | 144 | return account; |
144 | } | 145 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs index e430fc7..a355661 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/UserAccountCache.cs | |||
@@ -36,50 +36,58 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | |||
36 | { | 36 | { |
37 | public class UserAccountCache | 37 | public class UserAccountCache |
38 | { | 38 | { |
39 | //private static readonly ILog m_log = | 39 | private static readonly ILog m_log = |
40 | // LogManager.GetLogger( | 40 | LogManager.GetLogger( |
41 | // MethodBase.GetCurrentMethod().DeclaringType); | 41 | MethodBase.GetCurrentMethod().DeclaringType); |
42 | 42 | private ExpiringCache<UUID, UserAccount> m_UUIDCache; | |
43 | private ICnmCache<UUID, UserAccount> m_UUIDCache; | 43 | private ExpiringCache<string, UUID> m_NameCache; |
44 | private Dictionary<string, UUID> m_NameCache; | ||
45 | 44 | ||
46 | public UserAccountCache() | 45 | public UserAccountCache() |
47 | { | 46 | { |
48 | // Warning: the size values are a bit fuzzy. What matters | 47 | // Warning: the size values are a bit fuzzy. What matters |
49 | // most for this cache is the count value (128 entries). | 48 | // most for this cache is the count value (128 entries). |
50 | m_UUIDCache = CnmSynchronizedCache<UUID, UserAccount>.Synchronized(new CnmMemoryCache<UUID, UserAccount>( | 49 | m_UUIDCache = new ExpiringCache<UUID, UserAccount>(); |
51 | 128, 128*512, TimeSpan.FromMinutes(30.0))); | 50 | m_NameCache = new ExpiringCache<string, UUID>(); // this one is unbound |
52 | m_NameCache = new Dictionary<string, UUID>(); // this one is unbound | ||
53 | } | 51 | } |
54 | 52 | ||
55 | public void Cache(UserAccount account) | 53 | public void Cache(UUID userID, UserAccount account) |
56 | { | 54 | { |
57 | m_UUIDCache.Set(account.PrincipalID, account, 512); | 55 | // Cache even null accounts |
58 | m_NameCache[account.Name] = account.PrincipalID; | 56 | m_UUIDCache.AddOrUpdate(userID, account, DateTime.Now + TimeSpan.FromMinutes(2.0d)); |
57 | if (account != null) | ||
58 | m_NameCache.AddOrUpdate(account.Name, account.PrincipalID, DateTime.Now + TimeSpan.FromMinutes(2.0d)); | ||
59 | 59 | ||
60 | //m_log.DebugFormat("[USER CACHE]: cached user {0} {1}", account.FirstName, account.LastName); | 60 | m_log.DebugFormat("[USER CACHE]: cached user {0}", userID); |
61 | } | 61 | } |
62 | 62 | ||
63 | public UserAccount Get(UUID userID) | 63 | public UserAccount Get(UUID userID, out bool inCache) |
64 | { | 64 | { |
65 | UserAccount account = null; | 65 | UserAccount account = null; |
66 | inCache = false; | ||
66 | if (m_UUIDCache.TryGetValue(userID, out account)) | 67 | if (m_UUIDCache.TryGetValue(userID, out account)) |
67 | { | 68 | { |
68 | //m_log.DebugFormat("[USER CACHE]: Account {0} {1} found in cache", account.FirstName, account.LastName); | 69 | //m_log.DebugFormat("[USER CACHE]: Account {0} {1} found in cache", account.FirstName, account.LastName); |
70 | inCache = true; | ||
69 | return account; | 71 | return account; |
70 | } | 72 | } |
71 | 73 | ||
72 | return null; | 74 | return null; |
73 | } | 75 | } |
74 | 76 | ||
75 | public UserAccount Get(string name) | 77 | public UserAccount Get(string name, out bool inCache) |
76 | { | 78 | { |
77 | if (!m_NameCache.ContainsKey(name)) | 79 | inCache = false; |
80 | if (!m_NameCache.Contains(name)) | ||
78 | return null; | 81 | return null; |
79 | 82 | ||
80 | UserAccount account = null; | 83 | UserAccount account = null; |
81 | if (m_UUIDCache.TryGetValue(m_NameCache[name], out account)) | 84 | UUID uuid = UUID.Zero; |
82 | return account; | 85 | if (m_NameCache.TryGetValue(name, out uuid)) |
86 | if (m_UUIDCache.TryGetValue(uuid, out account)) | ||
87 | { | ||
88 | inCache = true; | ||
89 | return account; | ||
90 | } | ||
83 | 91 | ||
84 | return null; | 92 | return null; |
85 | } | 93 | } |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index f0c87f4..1279ac1 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Diagnostics; | ||
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | using log4net; | 33 | using log4net; |
33 | using Nini.Config; | 34 | using Nini.Config; |
@@ -84,6 +85,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
84 | 85 | ||
85 | // caches ExtendedLandData | 86 | // caches ExtendedLandData |
86 | private Cache parcelInfoCache; | 87 | private Cache parcelInfoCache; |
88 | private Vector3? forcedPosition = null; | ||
87 | 89 | ||
88 | #region INonSharedRegionModule Members | 90 | #region INonSharedRegionModule Members |
89 | 91 | ||
@@ -136,6 +138,13 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
136 | { | 138 | { |
137 | } | 139 | } |
138 | 140 | ||
141 | private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) | ||
142 | { | ||
143 | ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); | ||
144 | reason = "You are not allowed to enter this sim."; | ||
145 | return nearestParcel != null; | ||
146 | } | ||
147 | |||
139 | void EventManagerOnNewClient(IClientAPI client) | 148 | void EventManagerOnNewClient(IClientAPI client) |
140 | { | 149 | { |
141 | //Register some client events | 150 | //Register some client events |
@@ -153,6 +162,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
153 | client.OnParcelInfoRequest += ClientOnParcelInfoRequest; | 162 | client.OnParcelInfoRequest += ClientOnParcelInfoRequest; |
154 | client.OnParcelDwellRequest += ClientOnParcelDwellRequest; | 163 | client.OnParcelDwellRequest += ClientOnParcelDwellRequest; |
155 | client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; | 164 | client.OnParcelDeedToGroup += ClientOnParcelDeedToGroup; |
165 | client.OnPreAgentUpdate += ClientOnPreAgentUpdate; | ||
156 | 166 | ||
157 | EntityBase presenceEntity; | 167 | EntityBase presenceEntity; |
158 | if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) | 168 | if (m_scene.Entities.TryGetValue(client.AgentId, out presenceEntity) && presenceEntity is ScenePresence) |
@@ -162,6 +172,40 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
162 | } | 172 | } |
163 | } | 173 | } |
164 | 174 | ||
175 | void ClientOnPreAgentUpdate(IClientAPI remoteClient, AgentUpdateArgs agentData) | ||
176 | { | ||
177 | //If we are forcing a position for them to go | ||
178 | if (forcedPosition != null) | ||
179 | { | ||
180 | ScenePresence clientAvatar = m_scene.GetScenePresence(remoteClient.AgentId); | ||
181 | |||
182 | //Putting the user into flying, both keeps the avatar in fligth when it bumps into something and stopped from going another direction AND | ||
183 | //When the avatar walks into a ban line on the ground, it prevents getting stuck | ||
184 | agentData.ControlFlags = (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | ||
185 | |||
186 | |||
187 | //Make sure we stop if they get about to the right place to prevent yoyo and prevents getting stuck on banlines | ||
188 | if (Vector3.Distance(clientAvatar.AbsolutePosition, forcedPosition.Value) < .2) | ||
189 | { | ||
190 | Debug.WriteLine(string.Format("Stopping force position because {0} is close enough to position {1}", forcedPosition.Value, clientAvatar.AbsolutePosition)); | ||
191 | forcedPosition = null; | ||
192 | } | ||
193 | //if we are far away, teleport | ||
194 | else if (Vector3.Distance(clientAvatar.AbsolutePosition,forcedPosition.Value) > 3) | ||
195 | { | ||
196 | Debug.WriteLine(string.Format("Teleporting out because {0} is too far from avatar position {1}",forcedPosition.Value,clientAvatar.AbsolutePosition)); | ||
197 | clientAvatar.Teleport(forcedPosition.Value); | ||
198 | forcedPosition = null; | ||
199 | } | ||
200 | else | ||
201 | { | ||
202 | //Forces them toward the forced position we want if they aren't there yet | ||
203 | agentData.UseClientAgentPosition = true; | ||
204 | agentData.ClientAgentPosition = forcedPosition.Value; | ||
205 | } | ||
206 | } | ||
207 | } | ||
208 | |||
165 | 209 | ||
166 | public void PostInitialise() | 210 | public void PostInitialise() |
167 | { | 211 | { |
@@ -267,9 +311,6 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
267 | { | 311 | { |
268 | avatar.ControllingClient.SendAlertMessage( | 312 | avatar.ControllingClient.SendAlertMessage( |
269 | "You are not allowed on this parcel because you are banned. Please go away."); | 313 | "You are not allowed on this parcel because you are banned. Please go away."); |
270 | |||
271 | avatar.PhysicsActor.Position = avatar.lastKnownAllowedPosition; | ||
272 | avatar.PhysicsActor.Velocity = Vector3.Zero; | ||
273 | } | 314 | } |
274 | else | 315 | else |
275 | { | 316 | { |
@@ -278,6 +319,24 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
278 | } | 319 | } |
279 | } | 320 | } |
280 | 321 | ||
322 | |||
323 | |||
324 | private void ForceAvatarToPosition(ScenePresence avatar, Vector3? position) | ||
325 | { | ||
326 | if (m_scene.Permissions.IsGod(avatar.UUID)) return; | ||
327 | if (position.HasValue) | ||
328 | { | ||
329 | forcedPosition = position; | ||
330 | } | ||
331 | } | ||
332 | |||
333 | public void SendYouAreRestrictedNotice(ScenePresence avatar) | ||
334 | { | ||
335 | avatar.ControllingClient.SendAlertMessage( | ||
336 | "You are not allowed on this parcel because the land owner has restricted access."); | ||
337 | |||
338 | } | ||
339 | |||
281 | public void EventManagerOnAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) | 340 | public void EventManagerOnAvatarEnteringNewParcel(ScenePresence avatar, int localLandID, UUID regionID) |
282 | { | 341 | { |
283 | if (m_scene.RegionInfo.RegionID == regionID) | 342 | if (m_scene.RegionInfo.RegionID == regionID) |
@@ -295,11 +354,12 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
295 | if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) | 354 | if (parcelAvatarIsEntering.IsBannedFromLand(avatar.UUID)) |
296 | { | 355 | { |
297 | SendYouAreBannedNotice(avatar); | 356 | SendYouAreBannedNotice(avatar); |
357 | ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar)); | ||
298 | } | 358 | } |
299 | else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID)) | 359 | else if (parcelAvatarIsEntering.IsRestrictedFromLand(avatar.UUID)) |
300 | { | 360 | { |
301 | avatar.ControllingClient.SendAlertMessage( | 361 | SendYouAreRestrictedNotice(avatar); |
302 | "You are not allowed on this parcel because the land owner has restricted access. For now, you can enter, but please respect the land owner's decisions (or he can ban you!)."); | 362 | ForceAvatarToPosition(avatar, m_scene.GetNearestAllowedPosition(avatar)); |
303 | } | 363 | } |
304 | else | 364 | else |
305 | { | 365 | { |
@@ -400,7 +460,26 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
400 | else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && | 460 | else if (clientAvatar.AbsolutePosition.Z < LandChannel.BAN_LINE_SAFETY_HIEGHT && |
401 | parcel.IsBannedFromLand(clientAvatar.UUID)) | 461 | parcel.IsBannedFromLand(clientAvatar.UUID)) |
402 | { | 462 | { |
403 | SendYouAreBannedNotice(clientAvatar); | 463 | //once we've sent the message once, keep going toward the target until we are done |
464 | if (forcedPosition == null) | ||
465 | { | ||
466 | SendYouAreBannedNotice(clientAvatar); | ||
467 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); | ||
468 | } | ||
469 | } | ||
470 | else if (parcel.IsRestrictedFromLand(clientAvatar.UUID)) | ||
471 | { | ||
472 | //once we've sent the message once, keep going toward the target until we are done | ||
473 | if (forcedPosition == null) | ||
474 | { | ||
475 | SendYouAreRestrictedNotice(clientAvatar); | ||
476 | ForceAvatarToPosition(clientAvatar, m_scene.GetNearestAllowedPosition(clientAvatar)); | ||
477 | } | ||
478 | } | ||
479 | else | ||
480 | { | ||
481 | //when we are finally in a safe place, lets release the forced position lock | ||
482 | forcedPosition = null; | ||
404 | } | 483 | } |
405 | } | 484 | } |
406 | } | 485 | } |
@@ -412,7 +491,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
412 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | 491 | ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); |
413 | if (over != null) | 492 | if (over != null) |
414 | { | 493 | { |
415 | if (!over.IsBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT) | 494 | if (!over.IsRestrictedFromLand(avatar.UUID) && (!over.IsBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT)) |
416 | { | 495 | { |
417 | avatar.lastKnownAllowedPosition = | 496 | avatar.lastKnownAllowedPosition = |
418 | new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); | 497 | new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 1fa8630..e85136a 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
104 | /// <returns>Returns true if the piece of land contains the specified point</returns> | 104 | /// <returns>Returns true if the piece of land contains the specified point</returns> |
105 | public bool ContainsPoint(int x, int y) | 105 | public bool ContainsPoint(int x, int y) |
106 | { | 106 | { |
107 | if (x >= 0 && y >= 0 && x <= Constants.RegionSize && x <= Constants.RegionSize) | 107 | if (x >= 0 && y >= 0 && x <= Constants.RegionSize && y <= Constants.RegionSize) |
108 | { | 108 | { |
109 | return (LandBitmap[x / 4, y / 4] == true); | 109 | return (LandBitmap[x / 4, y / 4] == true); |
110 | } | 110 | } |
@@ -286,7 +286,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
286 | entry.AgentID = avatar; | 286 | entry.AgentID = avatar; |
287 | entry.Flags = AccessList.Ban; | 287 | entry.Flags = AccessList.Ban; |
288 | entry.Time = new DateTime(); | 288 | entry.Time = new DateTime(); |
289 | if (LandData.ParcelAccessList.Contains(entry)) | 289 | //See if they are on the list, but make sure the owner isn't banned |
290 | if (LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar) | ||
290 | { | 291 | { |
291 | //They are banned, so lets send them a notice about this parcel | 292 | //They are banned, so lets send them a notice about this parcel |
292 | return true; | 293 | return true; |
@@ -303,7 +304,9 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
303 | entry.AgentID = avatar; | 304 | entry.AgentID = avatar; |
304 | entry.Flags = AccessList.Access; | 305 | entry.Flags = AccessList.Access; |
305 | entry.Time = new DateTime(); | 306 | entry.Time = new DateTime(); |
306 | if (!LandData.ParcelAccessList.Contains(entry)) | 307 | |
308 | //If they are not on the access list and are not the owner | ||
309 | if (!LandData.ParcelAccessList.Contains(entry) && LandData.OwnerID != avatar) | ||
307 | { | 310 | { |
308 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel | 311 | //They are not allowed in this parcel, but not banned, so lets send them a notice about this parcel |
309 | return true; | 312 | return true; |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 2211f3e..5c7f3b7 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -490,6 +490,14 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
490 | 490 | ||
491 | if (m_allowGridGods) | 491 | if (m_allowGridGods) |
492 | { | 492 | { |
493 | ScenePresence sp = m_scene.GetScenePresence(user); | ||
494 | if (sp != null) | ||
495 | { | ||
496 | if (sp.UserLevel >= 200) | ||
497 | return true; | ||
498 | return false; | ||
499 | } | ||
500 | |||
493 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user); | 501 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, user); |
494 | if (account != null) | 502 | if (account != null) |
495 | { | 503 | { |
@@ -610,7 +618,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
610 | return objectOwnerMask; | 618 | return objectOwnerMask; |
611 | 619 | ||
612 | // Estate users should be able to edit anything in the sim if RegionOwnerIsGod is set | 620 | // Estate users should be able to edit anything in the sim if RegionOwnerIsGod is set |
613 | if (IsEstateManager(user) && m_RegionOwnerIsGod) | 621 | if (m_RegionOwnerIsGod && IsEstateManager(user) && !IsAdministrator(objectOwner)) |
614 | return objectOwnerMask; | 622 | return objectOwnerMask; |
615 | 623 | ||
616 | // Admin should be able to edit anything in the sim (including admin objects) | 624 | // Admin should be able to edit anything in the sim (including admin objects) |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 7fdddc3..d052f38 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -84,6 +84,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
84 | public event Action<IClientAPI> OnRegionHandShakeReply; | 84 | public event Action<IClientAPI> OnRegionHandShakeReply; |
85 | public event GenericCall2 OnRequestWearables; | 85 | public event GenericCall2 OnRequestWearables; |
86 | public event GenericCall1 OnCompleteMovementToRegion; | 86 | public event GenericCall1 OnCompleteMovementToRegion; |
87 | public event UpdateAgent OnPreAgentUpdate; | ||
87 | public event UpdateAgent OnAgentUpdate; | 88 | public event UpdateAgent OnAgentUpdate; |
88 | public event AgentRequestSit OnAgentRequestSit; | 89 | public event AgentRequestSit OnAgentRequestSit; |
89 | public event AgentSit OnAgentSit; | 90 | public event AgentSit OnAgentSit; |
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 367ff3d..6cf2a2e 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -31,7 +31,7 @@ using OpenSim.Framework; | |||
31 | using OpenSim.Region.Framework.Scenes; | 31 | using OpenSim.Region.Framework.Scenes; |
32 | 32 | ||
33 | namespace OpenSim.Region.Framework.Interfaces | 33 | namespace OpenSim.Region.Framework.Interfaces |
34 | { | 34 | { |
35 | public interface IAttachmentsModule | 35 | public interface IAttachmentsModule |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
@@ -43,7 +43,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
43 | /// <param name="rot"></param> | 43 | /// <param name="rot"></param> |
44 | /// <param name="pos"></param> | 44 | /// <param name="pos"></param> |
45 | /// <param name="silent"></param> | 45 | /// <param name="silent"></param> |
46 | /// <returns>true if the object was successfully attached, false otherwise</returns> | 46 | /// <returns>true if the object was successfully attached, false otherwise</returns> |
47 | bool AttachObject( | 47 | bool AttachObject( |
48 | IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent); | 48 | IClientAPI controllingClient, uint localID, uint attachPoint, Quaternion rot, Vector3 pos, bool silent); |
49 | 49 | ||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
54 | /// <param name="remoteClient"></param> | 54 | /// <param name="remoteClient"></param> |
55 | /// <param name="itemID"></param> | 55 | /// <param name="itemID"></param> |
56 | /// <param name="AttachmentPt"></param> | 56 | /// <param name="AttachmentPt"></param> |
57 | /// <returns></returns> | 57 | /// <returns></returns> |
58 | UUID SetAttachmentInventoryStatus( | 58 | UUID SetAttachmentInventoryStatus( |
59 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt); | 59 | SceneObjectGroup att, IClientAPI remoteClient, UUID itemID, uint AttachmentPt); |
60 | 60 | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs index 2401402..8185258 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | 30 | ||
4 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index f0d346f..dc9ae19 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -113,15 +113,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
113 | /// Fired when an object is touched/grabbed. | 113 | /// Fired when an object is touched/grabbed. |
114 | /// </summary> | 114 | /// </summary> |
115 | /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of | 115 | /// The originalID is the local ID of the part that was actually touched. The localID itself is always that of |
116 | /// the root part. | 116 | /// the root part. |
117 | public event ObjectGrabDelegate OnObjectGrab; | 117 | public event ObjectGrabDelegate OnObjectGrab; |
118 | public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); | 118 | public delegate void ObjectGrabDelegate(uint localID, uint originalID, Vector3 offsetPos, IClientAPI remoteClient, SurfaceTouchEventArgs surfaceArgs); |
119 | 119 | ||
120 | public event ObjectGrabDelegate OnObjectGrabbing; | 120 | public event ObjectGrabDelegate OnObjectGrabbing; |
121 | public event ObjectDeGrabDelegate OnObjectDeGrab; | 121 | public event ObjectDeGrabDelegate OnObjectDeGrab; |
122 | public event ScriptResetDelegate OnScriptReset; | 122 | public event ScriptResetDelegate OnScriptReset; |
123 | 123 | ||
124 | public event OnPermissionErrorDelegate OnPermissionError; | 124 | public event OnPermissionErrorDelegate OnPermissionError; |
125 | 125 | ||
126 | /// <summary> | 126 | /// <summary> |
127 | /// Fired when a new script is created. | 127 | /// Fired when a new script is created. |
@@ -169,7 +169,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
169 | 169 | ||
170 | public delegate void ClientClosed(UUID clientID, Scene scene); | 170 | public delegate void ClientClosed(UUID clientID, Scene scene); |
171 | 171 | ||
172 | public event ClientClosed OnClientClosed; | 172 | public event ClientClosed OnClientClosed; |
173 | 173 | ||
174 | /// <summary> | 174 | /// <summary> |
175 | /// This is fired when a scene object property that a script might be interested in (such as color, scale or | 175 | /// This is fired when a scene object property that a script might be interested in (such as color, scale or |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index dad0efd..7277527 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1102,18 +1102,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1102 | if (folder == null) | 1102 | if (folder == null) |
1103 | return; | 1103 | return; |
1104 | 1104 | ||
1105 | m_log.DebugFormat("[AGENT INVENTORY]: Send Inventory Folder {0} Update to {1} {2}", folder.Name, client.FirstName, client.LastName); | 1105 | // Fetch the folder contents |
1106 | InventoryCollection contents = InventoryService.GetFolderContent(client.AgentId, folder.ID); | 1106 | InventoryCollection contents = InventoryService.GetFolderContent(client.AgentId, folder.ID); |
1107 | InventoryFolderBase containingFolder = new InventoryFolderBase(); | 1107 | |
1108 | containingFolder.ID = folder.ID; | 1108 | // Fetch the folder itself to get its current version |
1109 | containingFolder.Owner = client.AgentId; | 1109 | InventoryFolderBase containingFolder = new InventoryFolderBase(folder.ID, client.AgentId); |
1110 | containingFolder = InventoryService.GetFolder(containingFolder); | 1110 | containingFolder = InventoryService.GetFolder(containingFolder); |
1111 | if (containingFolder != null) | ||
1112 | { | ||
1113 | int version = containingFolder.Version; | ||
1114 | 1111 | ||
1115 | client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, version, fetchFolders, fetchItems); | 1112 | //m_log.DebugFormat("[AGENT INVENTORY]: Sending inventory folder contents ({0} nodes) for \"{1}\" to {2} {3}", |
1116 | } | 1113 | // contents.Folders.Count + contents.Items.Count, containingFolder.Name, client.FirstName, client.LastName); |
1114 | |||
1115 | if (containingFolder != null) | ||
1116 | client.SendInventoryFolderDetails(client.AgentId, folder.ID, contents.Items, contents.Folders, containingFolder.Version, fetchFolders, fetchItems); | ||
1117 | } | 1117 | } |
1118 | 1118 | ||
1119 | /// <summary> | 1119 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 1eb3117..87a753e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Diagnostics; | ||
30 | using System.Drawing; | 31 | using System.Drawing; |
31 | using System.Drawing.Imaging; | 32 | using System.Drawing.Imaging; |
32 | using System.IO; | 33 | using System.IO; |
@@ -1975,7 +1976,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1975 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) | 1976 | public bool AddNewSceneObject(SceneObjectGroup sceneObject, bool attachToBackup, bool sendClientUpdates) |
1976 | { | 1977 | { |
1977 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); | 1978 | return m_sceneGraph.AddNewSceneObject(sceneObject, attachToBackup, sendClientUpdates); |
1978 | } | 1979 | } |
1979 | 1980 | ||
1980 | /// <summary> | 1981 | /// <summary> |
1981 | /// Delete every object from the scene | 1982 | /// Delete every object from the scene |
@@ -2643,7 +2644,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2643 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) | 2644 | public virtual void SubscribeToClientAttachmentEvents(IClientAPI client) |
2644 | { | 2645 | { |
2645 | client.OnRezSingleAttachmentFromInv += RezSingleAttachment; | 2646 | client.OnRezSingleAttachmentFromInv += RezSingleAttachment; |
2646 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments; | 2647 | client.OnRezMultipleAttachmentsFromInv += RezMultipleAttachments; |
2647 | client.OnObjectAttach += m_sceneGraph.AttachObject; | 2648 | client.OnObjectAttach += m_sceneGraph.AttachObject; |
2648 | client.OnObjectDetach += m_sceneGraph.DetachObject; | 2649 | client.OnObjectDetach += m_sceneGraph.DetachObject; |
2649 | 2650 | ||
@@ -2695,7 +2696,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2695 | } | 2696 | } |
2696 | 2697 | ||
2697 | protected virtual void UnsubscribeToClientEvents(IClientAPI client) | 2698 | protected virtual void UnsubscribeToClientEvents(IClientAPI client) |
2698 | { | 2699 | { |
2699 | } | 2700 | } |
2700 | 2701 | ||
2701 | /// <summary> | 2702 | /// <summary> |
@@ -2796,13 +2797,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2796 | } | 2797 | } |
2797 | 2798 | ||
2798 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) | 2799 | public virtual void UnSubscribeToClientAttachmentEvents(IClientAPI client) |
2799 | { | 2800 | { |
2800 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments; | 2801 | client.OnRezMultipleAttachmentsFromInv -= RezMultipleAttachments; |
2801 | client.OnRezSingleAttachmentFromInv -= RezSingleAttachment; | 2802 | client.OnRezSingleAttachmentFromInv -= RezSingleAttachment; |
2802 | client.OnObjectAttach -= m_sceneGraph.AttachObject; | 2803 | client.OnObjectAttach -= m_sceneGraph.AttachObject; |
2803 | client.OnObjectDetach -= m_sceneGraph.DetachObject; | 2804 | client.OnObjectDetach -= m_sceneGraph.DetachObject; |
2804 | 2805 | ||
2805 | if (AttachmentsModule != null) | 2806 | if (AttachmentsModule != null) |
2806 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; | 2807 | client.OnDetachAttachmentIntoInv -= AttachmentsModule.ShowDetachInUserInventory; |
2807 | } | 2808 | } |
2808 | 2809 | ||
@@ -3224,6 +3225,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3224 | /// also return a reason.</returns> | 3225 | /// also return a reason.</returns> |
3225 | public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) | 3226 | public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) |
3226 | { | 3227 | { |
3228 | TeleportFlags tp = (TeleportFlags)teleportFlags; | ||
3227 | //Teleport flags: | 3229 | //Teleport flags: |
3228 | // | 3230 | // |
3229 | // TeleportFlags.ViaGodlikeLure - Border Crossing | 3231 | // TeleportFlags.ViaGodlikeLure - Border Crossing |
@@ -3257,6 +3259,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
3257 | 3259 | ||
3258 | CapsModule.NewUserConnection(agent); | 3260 | CapsModule.NewUserConnection(agent); |
3259 | 3261 | ||
3262 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); | ||
3263 | |||
3264 | //On login or border crossing test land permisions | ||
3265 | if (tp != TeleportFlags.Default) | ||
3266 | { | ||
3267 | if (land != null && !TestLandRestrictions(agent, land, out reason)) | ||
3268 | { | ||
3269 | return false; | ||
3270 | } | ||
3271 | } | ||
3272 | |||
3260 | ScenePresence sp = m_sceneGraph.GetScenePresence(agent.AgentID); | 3273 | ScenePresence sp = m_sceneGraph.GetScenePresence(agent.AgentID); |
3261 | if (sp != null) | 3274 | if (sp != null) |
3262 | { | 3275 | { |
@@ -3329,7 +3342,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3329 | } | 3342 | } |
3330 | } | 3343 | } |
3331 | // Honor parcel landing type and position. | 3344 | // Honor parcel landing type and position. |
3332 | ILandObject land = LandChannel.GetLandObject(agent.startpos.X, agent.startpos.Y); | ||
3333 | if (land != null) | 3345 | if (land != null) |
3334 | { | 3346 | { |
3335 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) | 3347 | if (land.LandData.LandingType == (byte)1 && land.LandData.UserLocation != Vector3.Zero) |
@@ -3345,6 +3357,40 @@ namespace OpenSim.Region.Framework.Scenes | |||
3345 | return true; | 3357 | return true; |
3346 | } | 3358 | } |
3347 | 3359 | ||
3360 | private bool TestLandRestrictions(AgentCircuitData agent, ILandObject land, out string reason) | ||
3361 | { | ||
3362 | |||
3363 | bool banned = land.IsBannedFromLand(agent.AgentID); | ||
3364 | bool restricted = land.IsRestrictedFromLand(agent.AgentID); | ||
3365 | |||
3366 | if (banned || restricted) | ||
3367 | { | ||
3368 | ILandObject nearestParcel = GetNearestAllowedParcel(agent.AgentID, agent.startpos.X, agent.startpos.Y); | ||
3369 | if (nearestParcel != null) | ||
3370 | { | ||
3371 | //Move agent to nearest allowed | ||
3372 | Vector3 newPosition = GetParcelCenterAtGround(nearestParcel); | ||
3373 | agent.startpos.X = newPosition.X; | ||
3374 | agent.startpos.Y = newPosition.Y; | ||
3375 | } | ||
3376 | else | ||
3377 | { | ||
3378 | if (banned) | ||
3379 | { | ||
3380 | reason = "Cannot regioncross into banned parcel."; | ||
3381 | } | ||
3382 | else | ||
3383 | { | ||
3384 | reason = String.Format("Denied access to private region {0}: You are not on the access list for that region.", | ||
3385 | RegionInfo.RegionName); | ||
3386 | } | ||
3387 | return false; | ||
3388 | } | ||
3389 | } | ||
3390 | reason = ""; | ||
3391 | return true; | ||
3392 | } | ||
3393 | |||
3348 | /// <summary> | 3394 | /// <summary> |
3349 | /// Verifies that the user has a presence on the Grid | 3395 | /// Verifies that the user has a presence on the Grid |
3350 | /// </summary> | 3396 | /// </summary> |
@@ -3476,6 +3522,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
3476 | return true; | 3522 | return true; |
3477 | } | 3523 | } |
3478 | 3524 | ||
3525 | private ILandObject GetParcelAtPoint(float x, float y) | ||
3526 | { | ||
3527 | foreach (var parcel in AllParcels()) | ||
3528 | { | ||
3529 | if (parcel.ContainsPoint((int)x,(int)y)) | ||
3530 | { | ||
3531 | return parcel; | ||
3532 | } | ||
3533 | } | ||
3534 | return null; | ||
3535 | } | ||
3536 | |||
3479 | /// <summary> | 3537 | /// <summary> |
3480 | /// Update an AgentCircuitData object with new information | 3538 | /// Update an AgentCircuitData object with new information |
3481 | /// </summary> | 3539 | /// </summary> |
@@ -4748,5 +4806,175 @@ namespace OpenSim.Region.Framework.Scenes | |||
4748 | { | 4806 | { |
4749 | get { return m_allowScriptCrossings; } | 4807 | get { return m_allowScriptCrossings; } |
4750 | } | 4808 | } |
4809 | |||
4810 | public Vector3? GetNearestAllowedPosition(ScenePresence avatar) | ||
4811 | { | ||
4812 | //simulate to make sure we have pretty up to date positions | ||
4813 | PhysicsScene.Simulate(0); | ||
4814 | |||
4815 | ILandObject nearestParcel = GetNearestAllowedParcel(avatar.UUID, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); | ||
4816 | |||
4817 | if (nearestParcel != null) | ||
4818 | { | ||
4819 | Vector3 dir = Vector3.Normalize(Vector3.Multiply(avatar.Velocity, -1)); | ||
4820 | //Try to get a location that feels like where they came from | ||
4821 | Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); | ||
4822 | if (nearestPoint != null) | ||
4823 | { | ||
4824 | Debug.WriteLine("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString()); | ||
4825 | return nearestPoint.Value; | ||
4826 | } | ||
4827 | |||
4828 | //Sometimes velocity might be zero (local teleport), so try finding point along path from avatar to center of nearest parcel | ||
4829 | Vector3 directionToParcelCenter = Vector3.Subtract(GetParcelCenterAtGround(nearestParcel), avatar.AbsolutePosition); | ||
4830 | dir = Vector3.Normalize(directionToParcelCenter); | ||
4831 | nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel); | ||
4832 | if (nearestPoint != null) | ||
4833 | { | ||
4834 | Debug.WriteLine("They had a zero velocity, sending them to: " + nearestPoint.ToString()); | ||
4835 | return nearestPoint.Value; | ||
4836 | } | ||
4837 | |||
4838 | //Ultimate backup if we have no idea where they are | ||
4839 | Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString()); | ||
4840 | return avatar.lastKnownAllowedPosition; | ||
4841 | |||
4842 | } | ||
4843 | |||
4844 | //Go to the edge, this happens in teleporting to a region with no available parcels | ||
4845 | Vector3 nearestRegionEdgePoint = GetNearestRegionEdgePosition(avatar); | ||
4846 | //Debug.WriteLine("They are really in a place they don't belong, sending them to: " + nearestRegionEdgePoint.ToString()); | ||
4847 | return nearestRegionEdgePoint; | ||
4848 | return null; | ||
4849 | } | ||
4850 | |||
4851 | private Vector3 GetParcelCenterAtGround(ILandObject parcel) | ||
4852 | { | ||
4853 | Vector2 center = GetParcelCenter(parcel); | ||
4854 | return GetPositionAtGround(center.X, center.Y); | ||
4855 | } | ||
4856 | |||
4857 | private Vector3? GetNearestPointInParcelAlongDirectionFromPoint(Vector3 pos, Vector3 direction, ILandObject parcel) | ||
4858 | { | ||
4859 | Vector3 unitDirection = Vector3.Normalize(direction); | ||
4860 | //Making distance to search go through some sane limit of distance | ||
4861 | for (float distance = 0; distance < Constants.RegionSize * 2; distance += .5f) | ||
4862 | { | ||
4863 | Vector3 testPos = Vector3.Add(pos, Vector3.Multiply(unitDirection, distance)); | ||
4864 | if (parcel.ContainsPoint((int)testPos.X, (int)testPos.Y)) | ||
4865 | { | ||
4866 | return testPos; | ||
4867 | } | ||
4868 | } | ||
4869 | return null; | ||
4870 | } | ||
4871 | |||
4872 | public ILandObject GetNearestAllowedParcel(UUID avatarId, float x, float y) | ||
4873 | { | ||
4874 | List<ILandObject> all = AllParcels(); | ||
4875 | float minParcelDistance = float.MaxValue; | ||
4876 | ILandObject nearestParcel = null; | ||
4877 | |||
4878 | foreach (var parcel in all) | ||
4879 | { | ||
4880 | if (!parcel.IsEitherBannedOrRestricted(avatarId)) | ||
4881 | { | ||
4882 | float parcelDistance = GetParcelDistancefromPoint(parcel, x, y); | ||
4883 | if (parcelDistance < minParcelDistance) | ||
4884 | { | ||
4885 | minParcelDistance = parcelDistance; | ||
4886 | nearestParcel = parcel; | ||
4887 | } | ||
4888 | } | ||
4889 | } | ||
4890 | |||
4891 | return nearestParcel; | ||
4892 | } | ||
4893 | |||
4894 | private List<ILandObject> AllParcels() | ||
4895 | { | ||
4896 | return LandChannel.AllParcels(); | ||
4897 | } | ||
4898 | |||
4899 | private float GetParcelDistancefromPoint(ILandObject parcel, float x, float y) | ||
4900 | { | ||
4901 | return Vector2.Distance(new Vector2(x, y), GetParcelCenter(parcel)); | ||
4902 | } | ||
4903 | |||
4904 | //calculate the average center point of a parcel | ||
4905 | private Vector2 GetParcelCenter(ILandObject parcel) | ||
4906 | { | ||
4907 | int count = 0; | ||
4908 | int avgx = 0; | ||
4909 | int avgy = 0; | ||
4910 | for (int x = 0; x < Constants.RegionSize; x++) | ||
4911 | { | ||
4912 | for (int y = 0; y < Constants.RegionSize; y++) | ||
4913 | { | ||
4914 | //Just keep a running average as we check if all the points are inside or not | ||
4915 | if (parcel.ContainsPoint(x, y)) | ||
4916 | { | ||
4917 | if (count == 0) | ||
4918 | { | ||
4919 | avgx = x; | ||
4920 | avgy = y; | ||
4921 | } | ||
4922 | else | ||
4923 | { | ||
4924 | avgx = (avgx * count + x) / (count + 1); | ||
4925 | avgy = (avgy * count + y) / (count + 1); | ||
4926 | } | ||
4927 | count += 1; | ||
4928 | } | ||
4929 | } | ||
4930 | } | ||
4931 | return new Vector2(avgx, avgy); | ||
4932 | } | ||
4933 | |||
4934 | private Vector3 GetNearestRegionEdgePosition(ScenePresence avatar) | ||
4935 | { | ||
4936 | float xdistance = avatar.AbsolutePosition.X < Constants.RegionSize / 2 ? avatar.AbsolutePosition.X : Constants.RegionSize - avatar.AbsolutePosition.X; | ||
4937 | float ydistance = avatar.AbsolutePosition.Y < Constants.RegionSize / 2 ? avatar.AbsolutePosition.Y : Constants.RegionSize - avatar.AbsolutePosition.Y; | ||
4938 | |||
4939 | //find out what vertical edge to go to | ||
4940 | if (xdistance < ydistance) | ||
4941 | { | ||
4942 | if (avatar.AbsolutePosition.X < Constants.RegionSize / 2) | ||
4943 | { | ||
4944 | return GetPositionAtAvatarHeightOrGroundHeight(avatar, 0.0f, avatar.AbsolutePosition.Y); | ||
4945 | } | ||
4946 | else | ||
4947 | { | ||
4948 | return GetPositionAtAvatarHeightOrGroundHeight(avatar, Constants.RegionSize, avatar.AbsolutePosition.Y); | ||
4949 | } | ||
4950 | } | ||
4951 | //find out what horizontal edge to go to | ||
4952 | else | ||
4953 | { | ||
4954 | if (avatar.AbsolutePosition.Y < Constants.RegionSize / 2) | ||
4955 | { | ||
4956 | return GetPositionAtAvatarHeightOrGroundHeight(avatar, avatar.AbsolutePosition.X, 0.0f); | ||
4957 | } | ||
4958 | else | ||
4959 | { | ||
4960 | return GetPositionAtAvatarHeightOrGroundHeight(avatar, avatar.AbsolutePosition.X, Constants.RegionSize); | ||
4961 | } | ||
4962 | } | ||
4963 | } | ||
4964 | |||
4965 | private Vector3 GetPositionAtAvatarHeightOrGroundHeight(ScenePresence avatar, float x, float y) | ||
4966 | { | ||
4967 | Vector3 ground = GetPositionAtGround(x, y); | ||
4968 | if (avatar.AbsolutePosition.Z > ground.Z) | ||
4969 | { | ||
4970 | ground.Z = avatar.AbsolutePosition.Z; | ||
4971 | } | ||
4972 | return ground; | ||
4973 | } | ||
4974 | |||
4975 | private Vector3 GetPositionAtGround(float x, float y) | ||
4976 | { | ||
4977 | return new Vector3(x, y, GetGroundHeight(x, y)); | ||
4978 | } | ||
4751 | } | 4979 | } |
4752 | } | 4980 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 37b4fd6..88deedf 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -569,7 +569,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
569 | ApplyPhysics(m_scene.m_physicalPrim); | 569 | ApplyPhysics(m_scene.m_physicalPrim); |
570 | 570 | ||
571 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled | 571 | // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled |
572 | // for the same object with very different properties. The caller must schedule the update. | 572 | // for the same object with very different properties. The caller must schedule the update. |
573 | //ScheduleGroupForFullUpdate(); | 573 | //ScheduleGroupForFullUpdate(); |
574 | } | 574 | } |
575 | 575 | ||
@@ -2032,11 +2032,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2032 | /// Immediately send a full update for this scene object. | 2032 | /// Immediately send a full update for this scene object. |
2033 | /// </summary> | 2033 | /// </summary> |
2034 | public void SendGroupFullUpdate() | 2034 | public void SendGroupFullUpdate() |
2035 | { | 2035 | { |
2036 | if (IsDeleted) | 2036 | if (IsDeleted) |
2037 | return; | 2037 | return; |
2038 | 2038 | ||
2039 | // m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID); | 2039 | // m_log.DebugFormat("[SOG]: Sending immediate full group update for {0} {1}", Name, UUID); |
2040 | 2040 | ||
2041 | RootPart.SendFullUpdateToAllClients(); | 2041 | RootPart.SendFullUpdateToAllClients(); |
2042 | 2042 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4729382..8967252 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2869,7 +2869,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2869 | { | 2869 | { |
2870 | SendFullUpdateToClient(remoteClient, clientFlags); | 2870 | SendFullUpdateToClient(remoteClient, clientFlags); |
2871 | } | 2871 | } |
2872 | } | 2872 | } |
2873 | 2873 | ||
2874 | /// <summary> | 2874 | /// <summary> |
2875 | /// Send a full update for this part to all clients. | 2875 | /// Send a full update for this part to all clients. |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4256be9..7661f1e 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -146,7 +146,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
146 | 146 | ||
147 | private float m_sitAvatarHeight = 2.0f; | 147 | private float m_sitAvatarHeight = 2.0f; |
148 | 148 | ||
149 | private float m_godlevel; | 149 | private int m_godLevel; |
150 | private int m_userLevel; | ||
150 | 151 | ||
151 | private bool m_invulnerable = true; | 152 | private bool m_invulnerable = true; |
152 | 153 | ||
@@ -294,9 +295,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
294 | get { return m_invulnerable; } | 295 | get { return m_invulnerable; } |
295 | } | 296 | } |
296 | 297 | ||
297 | public float GodLevel | 298 | public int UserLevel |
298 | { | 299 | { |
299 | get { return m_godlevel; } | 300 | get { return m_userLevel; } |
301 | } | ||
302 | |||
303 | public int GodLevel | ||
304 | { | ||
305 | get { return m_godLevel; } | ||
300 | } | 306 | } |
301 | 307 | ||
302 | public ulong RegionHandle | 308 | public ulong RegionHandle |
@@ -668,6 +674,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
668 | m_regionInfo = reginfo; | 674 | m_regionInfo = reginfo; |
669 | m_localId = m_scene.AllocateLocalId(); | 675 | m_localId = m_scene.AllocateLocalId(); |
670 | 676 | ||
677 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); | ||
678 | |||
679 | m_userLevel = account.UserLevel; | ||
680 | |||
671 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); | 681 | IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>(); |
672 | if (gm != null) | 682 | if (gm != null) |
673 | m_grouptitle = gm.GetGroupTitle(m_uuid); | 683 | m_grouptitle = gm.GetGroupTitle(m_uuid); |
@@ -2967,17 +2977,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
2967 | if (account != null) | 2977 | if (account != null) |
2968 | { | 2978 | { |
2969 | if (account.UserLevel > 0) | 2979 | if (account.UserLevel > 0) |
2970 | m_godlevel = account.UserLevel; | 2980 | m_godLevel = account.UserLevel; |
2971 | else | 2981 | else |
2972 | m_godlevel = 200; | 2982 | m_godLevel = 200; |
2973 | } | 2983 | } |
2974 | } | 2984 | } |
2975 | else | 2985 | else |
2976 | { | 2986 | { |
2977 | m_godlevel = 0; | 2987 | m_godLevel = 0; |
2978 | } | 2988 | } |
2979 | 2989 | ||
2980 | ControllingClient.SendAdminResponse(token, (uint)m_godlevel); | 2990 | ControllingClient.SendAdminResponse(token, (uint)m_godLevel); |
2981 | } | 2991 | } |
2982 | 2992 | ||
2983 | #region Child Agent Updates | 2993 | #region Child Agent Updates |
@@ -3068,7 +3078,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3068 | cAgent.ControlFlags = (uint)m_AgentControlFlags; | 3078 | cAgent.ControlFlags = (uint)m_AgentControlFlags; |
3069 | 3079 | ||
3070 | if (m_scene.Permissions.IsGod(new UUID(cAgent.AgentID))) | 3080 | if (m_scene.Permissions.IsGod(new UUID(cAgent.AgentID))) |
3071 | cAgent.GodLevel = (byte)m_godlevel; | 3081 | cAgent.GodLevel = (byte)m_godLevel; |
3072 | else | 3082 | else |
3073 | cAgent.GodLevel = (byte) 0; | 3083 | cAgent.GodLevel = (byte) 0; |
3074 | 3084 | ||
@@ -3157,7 +3167,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3157 | m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; | 3167 | m_AgentControlFlags = (AgentManager.ControlFlags)cAgent.ControlFlags; |
3158 | 3168 | ||
3159 | if (m_scene.Permissions.IsGod(new UUID(cAgent.AgentID))) | 3169 | if (m_scene.Permissions.IsGod(new UUID(cAgent.AgentID))) |
3160 | m_godlevel = cAgent.GodLevel; | 3170 | m_godLevel = cAgent.GodLevel; |
3161 | m_setAlwaysRun = cAgent.AlwaysRun; | 3171 | m_setAlwaysRun = cAgent.AlwaysRun; |
3162 | 3172 | ||
3163 | uint i = 0; | 3173 | uint i = 0; |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index f2253f2..1885946 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -680,6 +680,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
680 | public event Action<IClientAPI> OnRegionHandShakeReply; | 680 | public event Action<IClientAPI> OnRegionHandShakeReply; |
681 | public event GenericCall2 OnRequestWearables; | 681 | public event GenericCall2 OnRequestWearables; |
682 | public event GenericCall1 OnCompleteMovementToRegion; | 682 | public event GenericCall1 OnCompleteMovementToRegion; |
683 | public event UpdateAgent OnPreAgentUpdate; | ||
683 | public event UpdateAgent OnAgentUpdate; | 684 | public event UpdateAgent OnAgentUpdate; |
684 | public event AgentRequestSit OnAgentRequestSit; | 685 | public event AgentRequestSit OnAgentRequestSit; |
685 | public event AgentSit OnAgentSit; | 686 | public event AgentSit OnAgentSit; |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 65445d9..77958eb 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -190,6 +190,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
190 | public event Action<IClientAPI> OnRegionHandShakeReply; | 190 | public event Action<IClientAPI> OnRegionHandShakeReply; |
191 | public event GenericCall2 OnRequestWearables; | 191 | public event GenericCall2 OnRequestWearables; |
192 | public event GenericCall1 OnCompleteMovementToRegion; | 192 | public event GenericCall1 OnCompleteMovementToRegion; |
193 | public event UpdateAgent OnPreAgentUpdate; | ||
193 | public event UpdateAgent OnAgentUpdate; | 194 | public event UpdateAgent OnAgentUpdate; |
194 | public event AgentRequestSit OnAgentRequestSit; | 195 | public event AgentRequestSit OnAgentRequestSit; |
195 | public event AgentSit OnAgentSit; | 196 | public event AgentSit OnAgentSit; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 59db81e..b040ca77 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4024,7 +4024,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4024 | return; | 4024 | return; |
4025 | } | 4025 | } |
4026 | 4026 | ||
4027 | if( message == string.Empty) | 4027 | if (message == string.Empty) |
4028 | { | 4028 | { |
4029 | ShoutError("Trying to use llTextBox with empty message."); | 4029 | ShoutError("Trying to use llTextBox with empty message."); |
4030 | } | 4030 | } |
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index 79c6b2a..6b1152b 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections; | 29 | using System.Collections; |
3 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
4 | using System.Net; | 31 | using System.Net; |
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index f9db859..34f7dcc 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -289,7 +289,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
289 | foreach (InventoryItemBase i in icoll.Items) | 289 | foreach (InventoryItemBase i in icoll.Items) |
290 | items[i.ID.ToString()] = EncodeItem(i); | 290 | items[i.ID.ToString()] = EncodeItem(i); |
291 | result["ITEMS"] = items; | 291 | result["ITEMS"] = items; |
292 | } | 292 | } |
293 | 293 | ||
294 | string xmlString = ServerUtils.BuildXmlResponse(result); | 294 | string xmlString = ServerUtils.BuildXmlResponse(result); |
295 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); | 295 | m_log.DebugFormat("[XXX]: resp string: {0}", xmlString); |
diff --git a/OpenSim/Services/Base/ServiceBase.cs b/OpenSim/Services/Base/ServiceBase.cs index 91d5c56..ef30cba 100644 --- a/OpenSim/Services/Base/ServiceBase.cs +++ b/OpenSim/Services/Base/ServiceBase.cs | |||
@@ -72,7 +72,7 @@ namespace OpenSim.Services.Base | |||
72 | // m_log.DebugFormat("[SERVICE BASE]: Found type {0}", pluginType); | 72 | // m_log.DebugFormat("[SERVICE BASE]: Found type {0}", pluginType); |
73 | 73 | ||
74 | if (pluginType.IsPublic) | 74 | if (pluginType.IsPublic) |
75 | { | 75 | { |
76 | if (className != String.Empty && | 76 | if (className != String.Empty && |
77 | pluginType.ToString() != | 77 | pluginType.ToString() != |
78 | pluginType.Namespace + "." + className) | 78 | pluginType.Namespace + "." + className) |
diff --git a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs index ce88236..0e85067 100644 --- a/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs +++ b/OpenSim/Services/Connectors/GridUser/GridUserServiceConnector.cs | |||
@@ -28,9 +28,9 @@ | |||
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Services.Connectors | 30 | namespace OpenSim.Services.Connectors |
31 | { | 31 | { |
32 | public class GridUserServiceConnector | 32 | public class GridUserServiceConnector |
33 | { | 33 | { |
34 | public GridUserServiceConnector() | 34 | public GridUserServiceConnector() |
35 | { | 35 | { |
36 | } | 36 | } |
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 9f73b38..c426bba 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections; | 29 | using System.Collections; |
3 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
4 | using System.Drawing; | 31 | using System.Drawing; |
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index 83d3449..3e91e3a 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections; | 29 | using System.Collections; |
3 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
4 | using System.IO; | 31 | using System.IO; |
@@ -334,7 +361,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
334 | } | 361 | } |
335 | catch (Exception e) | 362 | catch (Exception e) |
336 | { | 363 | { |
337 | m_log.Debug("[HGrid]: Exception " + e.Message); | 364 | m_log.Debug("[USER AGENT CONNECTOR]: Unable to contact remote server "); |
338 | reason = "Exception: " + e.Message; | 365 | reason = "Exception: " + e.Message; |
339 | return false; | 366 | return false; |
340 | } | 367 | } |
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs index 9821dd4..0cc1978 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryConnector.cs | |||
@@ -126,7 +126,7 @@ namespace OpenSim.Services.Connectors | |||
126 | }); | 126 | }); |
127 | 127 | ||
128 | if (ret == null) | 128 | if (ret == null) |
129 | return null; | 129 | return null; |
130 | if (ret.Count == 0) | 130 | if (ret.Count == 0) |
131 | return null; | 131 | return null; |
132 | 132 | ||
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 8e7c92b..2f9b520 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs | |||
@@ -113,6 +113,7 @@ namespace OpenSim.Services.Connectors | |||
113 | 113 | ||
114 | public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID) | 114 | public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID) |
115 | { | 115 | { |
116 | m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUSerAccount {0}", userID); | ||
116 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | 117 | Dictionary<string, object> sendData = new Dictionary<string, object>(); |
117 | //sendData["SCOPEID"] = scopeID.ToString(); | 118 | //sendData["SCOPEID"] = scopeID.ToString(); |
118 | sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); | 119 | sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 15379b5..26f211b 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Net; | 30 | using System.Net; |
4 | using System.Reflection; | 31 | using System.Reflection; |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index 05f5b4c..ee30fa3 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -47,9 +47,9 @@ namespace OpenSim.Services.LLLoginService | |||
47 | { | 47 | { |
48 | public class LLFailedLoginResponse : OpenSim.Services.Interfaces.FailedLoginResponse | 48 | public class LLFailedLoginResponse : OpenSim.Services.Interfaces.FailedLoginResponse |
49 | { | 49 | { |
50 | string m_key; | 50 | protected string m_key; |
51 | string m_value; | 51 | protected string m_value; |
52 | string m_login; | 52 | protected string m_login; |
53 | 53 | ||
54 | public static LLFailedLoginResponse UserProblem; | 54 | public static LLFailedLoginResponse UserProblem; |
55 | public static LLFailedLoginResponse AuthorizationProblem; | 55 | public static LLFailedLoginResponse AuthorizationProblem; |
@@ -623,7 +623,7 @@ namespace OpenSim.Services.LLLoginService | |||
623 | } | 623 | } |
624 | 624 | ||
625 | private InventoryData GetInventorySkeleton(List<InventoryFolderBase> folders) | 625 | private InventoryData GetInventorySkeleton(List<InventoryFolderBase> folders) |
626 | { | 626 | { |
627 | UUID rootID = UUID.Zero; | 627 | UUID rootID = UUID.Zero; |
628 | ArrayList AgentInventoryArray = new ArrayList(); | 628 | ArrayList AgentInventoryArray = new ArrayList(); |
629 | Hashtable TempHash; | 629 | Hashtable TempHash; |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index ae729f8..1eaf4d4 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -1,4 +1,31 @@ | |||
1 | using System; | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
2 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
3 | using System.Net; | 30 | using System.Net; |
4 | using System.Reflection; | 31 | using System.Reflection; |
@@ -24,24 +51,24 @@ namespace OpenSim.Services.LLLoginService | |||
24 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
25 | private static bool Initialized = false; | 52 | private static bool Initialized = false; |
26 | 53 | ||
27 | private IUserAccountService m_UserAccountService; | 54 | protected IUserAccountService m_UserAccountService; |
28 | private IAuthenticationService m_AuthenticationService; | 55 | protected IAuthenticationService m_AuthenticationService; |
29 | private IInventoryService m_InventoryService; | 56 | protected IInventoryService m_InventoryService; |
30 | private IGridService m_GridService; | 57 | protected IGridService m_GridService; |
31 | private IPresenceService m_PresenceService; | 58 | protected IPresenceService m_PresenceService; |
32 | private ISimulationService m_LocalSimulationService; | 59 | private ISimulationService m_LocalSimulationService; |
33 | private ISimulationService m_RemoteSimulationService; | 60 | private ISimulationService m_RemoteSimulationService; |
34 | private ILibraryService m_LibraryService; | 61 | protected ILibraryService m_LibraryService; |
35 | private IFriendsService m_FriendsService; | 62 | protected IFriendsService m_FriendsService; |
36 | private IAvatarService m_AvatarService; | 63 | protected IAvatarService m_AvatarService; |
37 | private IUserAgentService m_UserAgentService; | 64 | private IUserAgentService m_UserAgentService; |
38 | 65 | ||
39 | private GatekeeperServiceConnector m_GatekeeperConnector; | 66 | private GatekeeperServiceConnector m_GatekeeperConnector; |
40 | 67 | ||
41 | private string m_DefaultRegionName; | 68 | private string m_DefaultRegionName; |
42 | private string m_WelcomeMessage; | 69 | protected string m_WelcomeMessage; |
43 | private bool m_RequireInventory; | 70 | private bool m_RequireInventory; |
44 | private int m_MinLoginLevel; | 71 | protected int m_MinLoginLevel; |
45 | private string m_GatekeeperURL; | 72 | private string m_GatekeeperURL; |
46 | 73 | ||
47 | IConfig m_LoginServerConfig; | 74 | IConfig m_LoginServerConfig; |
@@ -259,7 +286,7 @@ namespace OpenSim.Services.LLLoginService | |||
259 | } | 286 | } |
260 | } | 287 | } |
261 | 288 | ||
262 | private GridRegion FindDestination(UserAccount account, PresenceInfo pinfo, UUID sessionID, string startLocation, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt) | 289 | protected GridRegion FindDestination(UserAccount account, PresenceInfo pinfo, UUID sessionID, string startLocation, out GridRegion gatekeeper, out string where, out Vector3 position, out Vector3 lookAt) |
263 | { | 290 | { |
264 | m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); | 291 | m_log.DebugFormat("[LLOGIN SERVICE]: FindDestination for start location {0}", startLocation); |
265 | 292 | ||
@@ -470,7 +497,7 @@ namespace OpenSim.Services.LLLoginService | |||
470 | } | 497 | } |
471 | } | 498 | } |
472 | 499 | ||
473 | private AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, | 500 | protected AgentCircuitData LaunchAgentAtGrid(GridRegion gatekeeper, GridRegion destination, UserAccount account, AvatarData avatar, |
474 | UUID session, UUID secureSession, Vector3 position, string currentWhere, out string where, out string reason) | 501 | UUID session, UUID secureSession, Vector3 position, string currentWhere, out string where, out string reason) |
475 | { | 502 | { |
476 | where = currentWhere; | 503 | where = currentWhere; |
diff --git a/OpenSim/Services/UserAccountService/GridUserService.cs b/OpenSim/Services/UserAccountService/GridUserService.cs index 36cce75..c6e33bb 100644 --- a/OpenSim/Services/UserAccountService/GridUserService.cs +++ b/OpenSim/Services/UserAccountService/GridUserService.cs | |||
@@ -58,7 +58,7 @@ namespace OpenSim.Services.UserAccountService | |||
58 | info.HomePosition = Vector3.Parse(d.Data["HomePosition"]); | 58 | info.HomePosition = Vector3.Parse(d.Data["HomePosition"]); |
59 | info.HomeLookAt = Vector3.Parse(d.Data["HomeLookAt"]); | 59 | info.HomeLookAt = Vector3.Parse(d.Data["HomeLookAt"]); |
60 | 60 | ||
61 | return info; | 61 | return info; |
62 | } | 62 | } |
63 | 63 | ||
64 | public bool StoreGridUserInfo(GridUserInfo info) | 64 | public bool StoreGridUserInfo(GridUserInfo info) |
diff --git a/OpenSim/Services/UserAccountService/UserAccountService.cs b/OpenSim/Services/UserAccountService/UserAccountService.cs index 82c34e7..38caf74 100644 --- a/OpenSim/Services/UserAccountService/UserAccountService.cs +++ b/OpenSim/Services/UserAccountService/UserAccountService.cs | |||
@@ -200,7 +200,9 @@ namespace OpenSim.Services.UserAccountService | |||
200 | } | 200 | } |
201 | 201 | ||
202 | if (d.Length < 1) | 202 | if (d.Length < 1) |
203 | { | ||
203 | return null; | 204 | return null; |
205 | } | ||
204 | 206 | ||
205 | return MakeUserAccount(d[0]); | 207 | return MakeUserAccount(d[0]); |
206 | } | 208 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 7b46e95..5fff279 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -96,6 +96,7 @@ namespace OpenSim.Tests.Common.Mock | |||
96 | public event Action<IClientAPI> OnRegionHandShakeReply; | 96 | public event Action<IClientAPI> OnRegionHandShakeReply; |
97 | public event GenericCall2 OnRequestWearables; | 97 | public event GenericCall2 OnRequestWearables; |
98 | public event GenericCall1 OnCompleteMovementToRegion; | 98 | public event GenericCall1 OnCompleteMovementToRegion; |
99 | public event UpdateAgent OnPreAgentUpdate; | ||
99 | public event UpdateAgent OnAgentUpdate; | 100 | public event UpdateAgent OnAgentUpdate; |
100 | public event AgentRequestSit OnAgentRequestSit; | 101 | public event AgentRequestSit OnAgentRequestSit; |
101 | public event AgentSit OnAgentSit; | 102 | public event AgentSit OnAgentSit; |