diff options
author | UbitUmarov | 2012-03-23 03:41:48 +0000 |
---|---|---|
committer | UbitUmarov | 2012-03-23 03:41:48 +0000 |
commit | 4db05a98c2c1678b612e0a3d2f95c24e34ac5f13 (patch) | |
tree | 3929bd993c504a3de7697f449e36535aeeddf737 /OpenSim | |
parent | Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC_OLD-4db05a98c2c1678b612e0a3d2f95c24e34ac5f13.zip opensim-SC_OLD-4db05a98c2c1678b612e0a3d2f95c24e34ac5f13.tar.gz opensim-SC_OLD-4db05a98c2c1678b612e0a3d2f95c24e34ac5f13.tar.bz2 opensim-SC_OLD-4db05a98c2c1678b612e0a3d2f95c24e34ac5f13.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to '')
38 files changed, 858 insertions, 265 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs b/OpenSim/Framework/GcNotify.cs index 659c3a5..14a22a6 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AvatarAnimations.cs +++ b/OpenSim/Framework/GcNotify.cs | |||
@@ -25,39 +25,38 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections.Generic; | 28 | using System; |
29 | using System.Xml; | 29 | using System.Reflection; |
30 | using OpenMetaverse; | 30 | using log4net; |
31 | 31 | ||
32 | namespace OpenSim.Region.Framework.Scenes.Animation | 32 | public class GcNotify |
33 | { | 33 | { |
34 | public class AvatarAnimations | 34 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
35 | |||
36 | public static bool Enabled | ||
35 | { | 37 | { |
36 | public Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>(); | 38 | get { return s_initialized; } |
37 | public Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>(); | 39 | set |
38 | public Dictionary<UUID, string> AnimStateNames = new Dictionary<UUID, string>(); | 40 | { |
41 | if (!s_initialized && value) | ||
42 | new GcNotify(); | ||
43 | |||
44 | s_initialized = value; | ||
45 | } | ||
46 | } | ||
39 | 47 | ||
40 | public AvatarAnimations() | 48 | private static bool s_initialized = false; |
49 | |||
50 | private GcNotify() {} | ||
51 | |||
52 | ~GcNotify() | ||
53 | { | ||
54 | if (!Environment.HasShutdownStarted && !AppDomain.CurrentDomain.IsFinalizingForUnload()) | ||
41 | { | 55 | { |
42 | using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml")) | 56 | m_log.DebugFormat("[GC NOTIFY]: Garbage collection triggered."); |
43 | { | 57 | |
44 | XmlDocument doc = new XmlDocument(); | 58 | if (Enabled) |
45 | doc.Load(reader); | 59 | new GcNotify(); |
46 | foreach (XmlNode nod in doc.DocumentElement.ChildNodes) | ||
47 | { | ||
48 | if (nod.Attributes["name"] != null) | ||
49 | { | ||
50 | string name = (string)nod.Attributes["name"].Value; | ||
51 | UUID id = (UUID)nod.InnerText; | ||
52 | string animState = (string)nod.Attributes["state"].Value; | ||
53 | |||
54 | AnimsUUID.Add(name, id); | ||
55 | AnimsNames.Add(id, name); | ||
56 | if (animState != "") | ||
57 | AnimStateNames.Add(id, animState); | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | } | 60 | } |
62 | } | 61 | } |
63 | } | 62 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 94acdba..004b1a6 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs | |||
@@ -1226,10 +1226,9 @@ namespace OpenSim.Framework | |||
1226 | /// <param name="OrbitalPosition">The orbital position is given in radians, and must be "adjusted" for the linden client, see LLClientView</param> | 1226 | /// <param name="OrbitalPosition">The orbital position is given in radians, and must be "adjusted" for the linden client, see LLClientView</param> |
1227 | void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, | 1227 | void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, |
1228 | float OrbitalPosition); | 1228 | float OrbitalPosition); |
1229 | 1229 | ||
1230 | void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks); | 1230 | void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks); |
1231 | void SendViewerTime(int phase); | 1231 | void SendViewerTime(int phase); |
1232 | UUID GetDefaultAnimation(string name); | ||
1233 | 1232 | ||
1234 | void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, string flAbout, | 1233 | void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, Byte[] charterMember, string flAbout, |
1235 | uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID); | 1234 | uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID); |
diff --git a/OpenSim/Framework/ILandObject.cs b/OpenSim/Framework/ILandObject.cs index dd73b3f..4f98d7b 100644 --- a/OpenSim/Framework/ILandObject.cs +++ b/OpenSim/Framework/ILandObject.cs | |||
@@ -71,6 +71,7 @@ namespace OpenSim.Framework | |||
71 | bool IsEitherBannedOrRestricted(UUID avatar); | 71 | bool IsEitherBannedOrRestricted(UUID avatar); |
72 | bool IsBannedFromLand(UUID avatar); | 72 | bool IsBannedFromLand(UUID avatar); |
73 | bool IsRestrictedFromLand(UUID avatar); | 73 | bool IsRestrictedFromLand(UUID avatar); |
74 | bool IsInLandAccessList(UUID avatar); | ||
74 | void SendLandUpdateToClient(IClientAPI remote_client); | 75 | void SendLandUpdateToClient(IClientAPI remote_client); |
75 | void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); | 76 | void SendLandUpdateToClient(bool snap_selection, IClientAPI remote_client); |
76 | List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag); | 77 | List<LandAccessEntry> CreateAccessListArrayByFlag(AccessList flag); |
diff --git a/OpenSim/Framework/SLUtil.cs b/OpenSim/Framework/SLUtil.cs index f9cb851..db4541e 100644 --- a/OpenSim/Framework/SLUtil.cs +++ b/OpenSim/Framework/SLUtil.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.IO; | ||
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using System.Xml; | 32 | using System.Xml; |
32 | using log4net; | 33 | using log4net; |
@@ -40,13 +41,6 @@ namespace OpenSim.Framework | |||
40 | 41 | ||
41 | #region SL / file extension / content-type conversions | 42 | #region SL / file extension / content-type conversions |
42 | 43 | ||
43 | public static Dictionary<string, UUID> DefaultAvatarAnimations = new Dictionary<string, UUID>(); | ||
44 | |||
45 | static SLUtil() | ||
46 | { | ||
47 | DefaultAvatarAnimations = LoadDefaultAvatarAnimations("data/avataranimations.xml"); | ||
48 | } | ||
49 | |||
50 | public static string SLAssetTypeToContentType(int assetType) | 44 | public static string SLAssetTypeToContentType(int assetType) |
51 | { | 45 | { |
52 | switch ((AssetType)assetType) | 46 | switch ((AssetType)assetType) |
@@ -382,47 +376,5 @@ namespace OpenSim.Framework | |||
382 | 376 | ||
383 | return output; | 377 | return output; |
384 | } | 378 | } |
385 | |||
386 | /// <summary> | ||
387 | /// Load the default SL avatar animations. | ||
388 | /// </summary> | ||
389 | /// <returns></returns> | ||
390 | public static Dictionary<string, UUID> LoadDefaultAvatarAnimations(string path) | ||
391 | { | ||
392 | Dictionary<string, UUID> animations = new Dictionary<string, UUID>(); | ||
393 | |||
394 | using (XmlTextReader reader = new XmlTextReader(path)) | ||
395 | { | ||
396 | XmlDocument doc = new XmlDocument(); | ||
397 | doc.Load(reader); | ||
398 | if (doc.DocumentElement != null) | ||
399 | { | ||
400 | foreach (XmlNode nod in doc.DocumentElement.ChildNodes) | ||
401 | { | ||
402 | if (nod.Attributes["name"] != null) | ||
403 | { | ||
404 | string name = nod.Attributes["name"].Value.ToLower(); | ||
405 | string id = nod.InnerText; | ||
406 | animations.Add(name, (UUID)id); | ||
407 | } | ||
408 | } | ||
409 | } | ||
410 | } | ||
411 | |||
412 | return animations; | ||
413 | } | ||
414 | |||
415 | /// <summary> | ||
416 | /// Get the default SL avatar animation with the given name. | ||
417 | /// </summary> | ||
418 | /// <param name="name"></param> | ||
419 | /// <returns></returns> | ||
420 | public static UUID GetDefaultAvatarAnimation(string name) | ||
421 | { | ||
422 | if (DefaultAvatarAnimations.ContainsKey(name)) | ||
423 | return DefaultAvatarAnimations[name]; | ||
424 | |||
425 | return UUID.Zero; | ||
426 | } | ||
427 | } | 379 | } |
428 | } \ No newline at end of file | 380 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 9fcd99c..fb1e831 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -919,7 +919,7 @@ namespace OpenSim | |||
919 | break; | 919 | break; |
920 | 920 | ||
921 | case "scene": | 921 | case "scene": |
922 | if (args.Length == 5) | 922 | if (args.Length == 4) |
923 | { | 923 | { |
924 | if (m_sceneManager.CurrentScene == null) | 924 | if (m_sceneManager.CurrentScene == null) |
925 | { | 925 | { |
@@ -927,39 +927,21 @@ namespace OpenSim | |||
927 | } | 927 | } |
928 | else | 928 | else |
929 | { | 929 | { |
930 | bool scriptingOn = !Convert.ToBoolean(args[2]); | 930 | string key = args[2]; |
931 | bool collisionsOn = !Convert.ToBoolean(args[3]); | 931 | string value = args[3]; |
932 | bool physicsOn = !Convert.ToBoolean(args[4]); | 932 | m_sceneManager.CurrentScene.SetSceneCoreDebug( |
933 | m_sceneManager.CurrentScene.SetSceneCoreDebug(scriptingOn, collisionsOn, physicsOn); | 933 | new Dictionary<string, string>() { { key, value } }); |
934 | 934 | ||
935 | MainConsole.Instance.Output( | 935 | MainConsole.Instance.OutputFormat("Set debug scene {0} = {1}", key, value); |
936 | String.Format( | ||
937 | "Set debug scene scripting = {0}, collisions = {1}, physics = {2}", | ||
938 | !scriptingOn, !collisionsOn, !physicsOn)); | ||
939 | } | 936 | } |
940 | } | 937 | } |
941 | else | 938 | else |
942 | { | 939 | { |
943 | MainConsole.Instance.Output("Usage: debug scene <scripting> <collisions> <physics> (where inside <> is true/false)"); | 940 | MainConsole.Instance.Output("Usage: debug scene scripting|collisions|physics|teleport true|false"); |
944 | } | 941 | } |
945 | 942 | ||
946 | break; | 943 | break; |
947 | 944 | ||
948 | case "teleport": | ||
949 | foreach(Scene s in m_sceneManager.Scenes) | ||
950 | { | ||
951 | if (s.DEBUG) | ||
952 | { | ||
953 | s.DEBUG = false; | ||
954 | MainConsole.Instance.Output("Teleport debugging is disabled!"); | ||
955 | } | ||
956 | else{ | ||
957 | s.DEBUG = true; | ||
958 | MainConsole.Instance.Output("Teleport debugging is enabled!"); | ||
959 | } | ||
960 | } | ||
961 | break; | ||
962 | |||
963 | default: | 945 | default: |
964 | MainConsole.Instance.Output("Unknown debug command"); | 946 | MainConsole.Instance.Output("Unknown debug command"); |
965 | break; | 947 | break; |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index ba5f4d5..c40c0ec 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -11418,15 +11418,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11418 | scriptQuestion.Data.Questions = question; | 11418 | scriptQuestion.Data.Questions = question; |
11419 | scriptQuestion.Data.ObjectName = Util.StringToBytes256(taskName); | 11419 | scriptQuestion.Data.ObjectName = Util.StringToBytes256(taskName); |
11420 | scriptQuestion.Data.ObjectOwner = Util.StringToBytes256(ownerName); | 11420 | scriptQuestion.Data.ObjectOwner = Util.StringToBytes256(ownerName); |
11421 | 11421 | ||
11422 | OutPacket(scriptQuestion, ThrottleOutPacketType.Task); | 11422 | OutPacket(scriptQuestion, ThrottleOutPacketType.Task); |
11423 | } | 11423 | } |
11424 | 11424 | ||
11425 | public UUID GetDefaultAnimation(string name) | ||
11426 | { | ||
11427 | return SLUtil.GetDefaultAvatarAnimation(name); | ||
11428 | } | ||
11429 | |||
11430 | /// <summary> | 11425 | /// <summary> |
11431 | /// Handler called when we receive a logout packet. | 11426 | /// Handler called when we receive a logout packet. |
11432 | /// </summary> | 11427 | /// </summary> |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index ca8d8e6..0590716 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -212,7 +212,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
212 | scene.EventManager.OnClientLogin += OnClientLogin; | 212 | scene.EventManager.OnClientLogin += OnClientLogin; |
213 | } | 213 | } |
214 | 214 | ||
215 | public void RegionLoaded(Scene scene) | 215 | public virtual void RegionLoaded(Scene scene) |
216 | { | 216 | { |
217 | } | 217 | } |
218 | 218 | ||
@@ -582,10 +582,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
582 | 582 | ||
583 | // Try the local sim | 583 | // Try the local sim |
584 | if (LocalFriendshipOffered(friendID, im)) | 584 | if (LocalFriendshipOffered(friendID, im)) |
585 | { | ||
586 | m_log.DebugFormat("[XXX]: LocalFriendshipOffered successes"); | ||
587 | return true; | 585 | return true; |
588 | } | ||
589 | 586 | ||
590 | // The prospective friend is not here [as root]. Let's forward. | 587 | // The prospective friend is not here [as root]. Let's forward. |
591 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); | 588 | PresenceInfo[] friendSessions = PresenceService.GetAgents(new string[] { friendID.ToString() }); |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 0fe1134..e50a84a 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 51 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
52 | 52 | ||
53 | IUserManagement m_uMan; | 53 | IUserManagement m_uMan; |
54 | IUserManagement UserManagementModule | 54 | public IUserManagement UserManagementModule |
55 | { | 55 | { |
56 | get | 56 | get |
57 | { | 57 | { |
@@ -62,6 +62,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
62 | } | 62 | } |
63 | 63 | ||
64 | protected HGFriendsServicesConnector m_HGFriendsConnector = new HGFriendsServicesConnector(); | 64 | protected HGFriendsServicesConnector m_HGFriendsConnector = new HGFriendsServicesConnector(); |
65 | protected HGStatusNotifier m_StatusNotifier; | ||
65 | 66 | ||
66 | #region ISharedRegionModule | 67 | #region ISharedRegionModule |
67 | public override string Name | 68 | public override string Name |
@@ -78,6 +79,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
78 | scene.RegisterModuleInterface<IFriendsSimConnector>(this); | 79 | scene.RegisterModuleInterface<IFriendsSimConnector>(this); |
79 | } | 80 | } |
80 | 81 | ||
82 | public override void RegionLoaded(Scene scene) | ||
83 | { | ||
84 | if (!m_Enabled) | ||
85 | return; | ||
86 | if (m_StatusNotifier == null) | ||
87 | m_StatusNotifier = new HGStatusNotifier(this); | ||
88 | } | ||
89 | |||
81 | #endregion | 90 | #endregion |
82 | 91 | ||
83 | #region IFriendsSimConnector | 92 | #region IFriendsSimConnector |
@@ -230,25 +239,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
230 | if (friendsPerDomain.ContainsKey("local")) | 239 | if (friendsPerDomain.ContainsKey("local")) |
231 | base.StatusNotify(friendsPerDomain["local"], userID, online); | 240 | base.StatusNotify(friendsPerDomain["local"], userID, online); |
232 | 241 | ||
233 | foreach (KeyValuePair<string, List<FriendInfo>> kvp in friendsPerDomain) | 242 | m_StatusNotifier.Notify(userID, friendsPerDomain, online); |
234 | { | ||
235 | if (kvp.Key != "local") | ||
236 | { | ||
237 | // For the others, call the user agent service | ||
238 | List<string> ids = new List<string>(); | ||
239 | foreach (FriendInfo f in kvp.Value) | ||
240 | ids.Add(f.Friend); | ||
241 | UserAgentServiceConnector uConn = new UserAgentServiceConnector(kvp.Key); | ||
242 | List<UUID> friendsOnline = uConn.StatusNotification(ids, userID, online); | ||
243 | |||
244 | if (online && friendsOnline.Count > 0) | ||
245 | { | ||
246 | IClientAPI client = LocateClientObject(userID); | ||
247 | if (client != null) | ||
248 | client.SendAgentOnline(friendsOnline.ToArray()); | ||
249 | } | ||
250 | } | ||
251 | } | ||
252 | 243 | ||
253 | // m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting StatusNotify for {0}", userID); | 244 | // m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting StatusNotify for {0}", userID); |
254 | } | 245 | } |
@@ -261,25 +252,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
261 | 252 | ||
262 | // fid is not a UUID... | 253 | // fid is not a UUID... |
263 | string url = string.Empty, tmp = string.Empty, f = string.Empty, l = string.Empty; | 254 | string url = string.Empty, tmp = string.Empty, f = string.Empty, l = string.Empty; |
264 | m_log.DebugFormat("[YYY]: FID {0}", fid); | ||
265 | if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out f, out l, out tmp)) | 255 | if (Util.ParseUniversalUserIdentifier(fid, out agentID, out url, out f, out l, out tmp)) |
266 | { | 256 | { |
267 | m_log.DebugFormat("[YYY]: Adding user {0} {1} {2}", f, l, url); | 257 | if (!agentID.Equals(UUID.Zero)) |
268 | m_uMan.AddUser(agentID, f, l, url); | ||
269 | |||
270 | string name = m_uMan.GetUserName(agentID); | ||
271 | string[] parts = name.Trim().Split(new char[] {' '}); | ||
272 | if (parts.Length == 2) | ||
273 | { | 258 | { |
274 | first = parts[0]; | 259 | m_uMan.AddUser(agentID, f, l, url); |
275 | last = parts[1]; | 260 | |
276 | } | 261 | string name = m_uMan.GetUserName(agentID); |
277 | else | 262 | string[] parts = name.Trim().Split(new char[] { ' ' }); |
278 | { | 263 | if (parts.Length == 2) |
279 | first = f; | 264 | { |
280 | last = l; | 265 | first = parts[0]; |
266 | last = parts[1]; | ||
267 | } | ||
268 | else | ||
269 | { | ||
270 | first = f; | ||
271 | last = l; | ||
272 | } | ||
273 | return true; | ||
281 | } | 274 | } |
282 | return true; | ||
283 | } | 275 | } |
284 | return false; | 276 | return false; |
285 | } | 277 | } |
@@ -744,7 +736,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
744 | { | 736 | { |
745 | string[] parts = im.fromAgentName.Split(new char[] { '@' }); | 737 | string[] parts = im.fromAgentName.Split(new char[] { '@' }); |
746 | if (parts.Length == 2) | 738 | if (parts.Length == 2) |
747 | m_uMan.AddUser(new UUID(im.fromAgentID), parts[0], "http://" + parts[1]); | 739 | { |
740 | string[] fl = parts[0].Trim().Split(new char[] { '.' }); | ||
741 | if (fl.Length == 2) | ||
742 | m_uMan.AddUser(new UUID(im.fromAgentID), fl[0], fl[1], "http://" + parts[1]); | ||
743 | else | ||
744 | m_uMan.AddUser(new UUID(im.fromAgentID), fl[0], "", "http://" + parts[1]); | ||
745 | } | ||
748 | } | 746 | } |
749 | return true; | 747 | return true; |
750 | } | 748 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs new file mode 100644 index 0000000..1fa4dd6 --- /dev/null +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGStatusNotifier.cs | |||
@@ -0,0 +1,69 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Linq; | ||
4 | using System.Reflection; | ||
5 | using System.Text; | ||
6 | using OpenSim.Framework; | ||
7 | using OpenSim.Region.Framework.Interfaces; | ||
8 | using OpenSim.Services.Interfaces; | ||
9 | using OpenSim.Services.Connectors.Hypergrid; | ||
10 | using FriendInfo = OpenSim.Services.Interfaces.FriendInfo; | ||
11 | |||
12 | using OpenMetaverse; | ||
13 | |||
14 | using log4net; | ||
15 | |||
16 | namespace OpenSim.Region.CoreModules.Avatar.Friends | ||
17 | { | ||
18 | public class HGStatusNotifier | ||
19 | { | ||
20 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
21 | |||
22 | private HGFriendsModule m_FriendsModule; | ||
23 | |||
24 | public HGStatusNotifier(HGFriendsModule friendsModule) | ||
25 | { | ||
26 | m_FriendsModule = friendsModule; | ||
27 | } | ||
28 | |||
29 | public void Notify(UUID userID, Dictionary<string, List<FriendInfo>> friendsPerDomain, bool online) | ||
30 | { | ||
31 | foreach (KeyValuePair<string, List<FriendInfo>> kvp in friendsPerDomain) | ||
32 | { | ||
33 | if (kvp.Key != "local") | ||
34 | { | ||
35 | // For the others, call the user agent service | ||
36 | List<string> ids = new List<string>(); | ||
37 | foreach (FriendInfo f in kvp.Value) | ||
38 | ids.Add(f.Friend); | ||
39 | |||
40 | if (ids.Count == 0) | ||
41 | continue; // no one to notify. caller don't do this | ||
42 | |||
43 | m_log.DebugFormat("[HG STATUS NOTIFIER]: Notifying {0} friends in {1}", ids.Count, kvp.Key); | ||
44 | // ASSUMPTION: we assume that all users for one home domain | ||
45 | // have exactly the same set of service URLs. | ||
46 | // If this is ever not true, we need to change this. | ||
47 | UUID friendID = UUID.Zero; String tmp = String.Empty; | ||
48 | if (Util.ParseUniversalUserIdentifier(ids[0], out friendID, out tmp, out tmp, out tmp, out tmp)) | ||
49 | { | ||
50 | string friendsServerURI = m_FriendsModule.UserManagementModule.GetUserServerURL(friendID, "FriendsServerURI"); | ||
51 | if (friendsServerURI != string.Empty) | ||
52 | { | ||
53 | HGFriendsServicesConnector fConn = new HGFriendsServicesConnector(friendsServerURI); | ||
54 | |||
55 | List<UUID> friendsOnline = fConn.StatusNotification(ids, userID, online); | ||
56 | |||
57 | if (online && friendsOnline.Count > 0) | ||
58 | { | ||
59 | IClientAPI client = m_FriendsModule.LocateClientObject(userID); | ||
60 | if (client != null) | ||
61 | client.SendAgentOnline(friendsOnline.ToArray()); | ||
62 | } | ||
63 | } | ||
64 | } | ||
65 | } | ||
66 | } | ||
67 | } | ||
68 | } | ||
69 | } | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 8b13b01..1e743c3 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -691,7 +691,13 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
691 | Scene.RegionInfo.RegionSettings.Save(); | 691 | Scene.RegionInfo.RegionSettings.Save(); |
692 | TriggerRegionInfoChange(); | 692 | TriggerRegionInfoChange(); |
693 | 693 | ||
694 | Scene.SetSceneCoreDebug(disableScripts, disableCollisions, disablePhysics); | 694 | Scene.SetSceneCoreDebug( |
695 | new Dictionary<string, string>() { | ||
696 | { "scripting", (!disableScripts).ToString() }, | ||
697 | { "collisions", (!disableCollisions).ToString() }, | ||
698 | { "physics", (!disablePhysics).ToString() } | ||
699 | } | ||
700 | ); | ||
695 | } | 701 | } |
696 | 702 | ||
697 | private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) | 703 | private void handleEstateTeleportOneUserHomeRequest(IClientAPI remover_client, UUID invoice, UUID senderID, UUID prey) |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 02a163f..e86887d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs | |||
@@ -497,7 +497,8 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
497 | 497 | ||
498 | public bool IsRestrictedFromLand(UUID avatar) | 498 | public bool IsRestrictedFromLand(UUID avatar) |
499 | { | 499 | { |
500 | ExpireAccessList(); | 500 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) == 0) |
501 | return false; | ||
501 | 502 | ||
502 | if (m_scene.Permissions.IsAdministrator(avatar)) | 503 | if (m_scene.Permissions.IsAdministrator(avatar)) |
503 | return false; | 504 | return false; |
@@ -508,24 +509,27 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
508 | if (avatar == LandData.OwnerID) | 509 | if (avatar == LandData.OwnerID) |
509 | return false; | 510 | return false; |
510 | 511 | ||
511 | if ((LandData.Flags & (uint) ParcelFlags.UseAccessList) > 0) | 512 | if (HasGroupAccess(avatar)) |
512 | { | 513 | return false; |
513 | if (LandData.ParcelAccessList.FindIndex( | 514 | |
514 | delegate(LandAccessEntry e) | 515 | return (!IsInLandAccessList(avatar)); |
515 | { | 516 | } |
516 | if (e.AgentID == avatar && e.Flags == AccessList.Access) | 517 | |
517 | return true; | 518 | public bool IsInLandAccessList(UUID avatar) |
518 | return false; | 519 | { |
519 | }) == -1) | 520 | ExpireAccessList(); |
520 | { | 521 | |
521 | if (!HasGroupAccess(avatar)) | 522 | if (LandData.ParcelAccessList.FindIndex( |
523 | delegate(LandAccessEntry e) | ||
522 | { | 524 | { |
523 | return true; | 525 | if (e.AgentID == avatar && e.Flags == AccessList.Access) |
524 | } | 526 | return true; |
525 | } | 527 | return false; |
528 | }) == -1) | ||
529 | { | ||
530 | return false; | ||
526 | } | 531 | } |
527 | 532 | return true; | |
528 | return false; | ||
529 | } | 533 | } |
530 | 534 | ||
531 | public void SendLandUpdateToClient(IClientAPI remote_client) | 535 | public void SendLandUpdateToClient(IClientAPI remote_client) |
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index e4ecc64..4a654a3 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -94,7 +94,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
94 | private bool m_RegionOwnerIsGod = false; | 94 | private bool m_RegionOwnerIsGod = false; |
95 | private bool m_RegionManagerIsGod = false; | 95 | private bool m_RegionManagerIsGod = false; |
96 | private bool m_ParcelOwnerIsGod = false; | 96 | private bool m_ParcelOwnerIsGod = false; |
97 | 97 | ||
98 | private bool m_SimpleBuildPermissions = false; | ||
99 | |||
98 | /// <value> | 100 | /// <value> |
99 | /// The set of users that are allowed to create scripts. This is only active if permissions are not being | 101 | /// The set of users that are allowed to create scripts. This is only active if permissions are not being |
100 | /// bypassed. This overrides normal permissions. | 102 | /// bypassed. This overrides normal permissions. |
@@ -139,7 +141,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
139 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); | 141 | m_RegionOwnerIsGod = myConfig.GetBoolean("region_owner_is_god", true); |
140 | m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); | 142 | m_RegionManagerIsGod = myConfig.GetBoolean("region_manager_is_god", false); |
141 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); | 143 | m_ParcelOwnerIsGod = myConfig.GetBoolean("parcel_owner_is_god", true); |
142 | 144 | ||
145 | m_SimpleBuildPermissions = myConfig.GetBoolean("simple_build_permissions", false); | ||
146 | |||
143 | m_allowedScriptCreators | 147 | m_allowedScriptCreators |
144 | = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); | 148 | = ParseUserSetConfigSetting(myConfig, "allowed_script_creators", m_allowedScriptCreators); |
145 | m_allowedScriptEditors | 149 | m_allowedScriptEditors |
@@ -824,6 +828,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
824 | permission = true; | 828 | permission = true; |
825 | } | 829 | } |
826 | 830 | ||
831 | if (m_SimpleBuildPermissions && | ||
832 | (parcel.LandData.Flags & (uint)ParcelFlags.UseAccessList) == 0 && parcel.IsInLandAccessList(user)) | ||
833 | permission = true; | ||
834 | |||
827 | return permission; | 835 | return permission; |
828 | } | 836 | } |
829 | 837 | ||
diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index c51e140..b5e79b8 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs | |||
@@ -598,6 +598,12 @@ namespace OpenSim.Region.CoreModules.World.Terrain | |||
598 | "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}", | 598 | "[TERRAIN]: Could not save terrain from {0} to {1}. Valid file extensions are {2}", |
599 | m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions); | 599 | m_scene.RegionInfo.RegionName, filename, m_supportedFileExtensions); |
600 | } | 600 | } |
601 | else | ||
602 | { | ||
603 | m_log.ErrorFormat( | ||
604 | "[TERRAIN]: Could not save terrain from {0} to {1}. {2} {3} {4} {5} {6} {7}", | ||
605 | m_scene.RegionInfo.RegionName, filename, fileWidth, fileHeight, fileStartX, fileStartY, offsetX, offsetY); | ||
606 | } | ||
601 | } | 607 | } |
602 | 608 | ||
603 | /// <summary> | 609 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs index 4b17b9a..32f4eea 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityInventory.cs | |||
@@ -157,6 +157,15 @@ namespace OpenSim.Region.Framework.Interfaces | |||
157 | TaskInventoryItem GetInventoryItem(UUID itemId); | 157 | TaskInventoryItem GetInventoryItem(UUID itemId); |
158 | 158 | ||
159 | /// <summary> | 159 | /// <summary> |
160 | /// Get all inventory items. | ||
161 | /// </summary> | ||
162 | /// <param name="name"></param> | ||
163 | /// <returns> | ||
164 | /// If there are no inventory items then an empty list is returned. | ||
165 | /// </returns> | ||
166 | List<TaskInventoryItem> GetInventoryItems(); | ||
167 | |||
168 | /// <summary> | ||
160 | /// Get inventory items by name. | 169 | /// Get inventory items by name. |
161 | /// </summary> | 170 | /// </summary> |
162 | /// <param name="name"></param> | 171 | /// <param name="name"></param> |
@@ -164,7 +173,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
164 | /// A list of inventory items with that name. | 173 | /// A list of inventory items with that name. |
165 | /// If no inventory item has that name then an empty list is returned. | 174 | /// If no inventory item has that name then an empty list is returned. |
166 | /// </returns> | 175 | /// </returns> |
167 | IList<TaskInventoryItem> GetInventoryItems(string name); | 176 | List<TaskInventoryItem> GetInventoryItems(string name); |
168 | 177 | ||
169 | /// <summary> | 178 | /// <summary> |
170 | /// Get the scene object referenced by an inventory item. | 179 | /// Get the scene object referenced by an inventory item. |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs index 9176d3d..33041e9 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/AnimationSet.cs | |||
@@ -27,8 +27,10 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using OpenSim.Framework; | 30 | using System.Reflection; |
31 | using log4net; | ||
31 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Framework; | ||
32 | 34 | ||
33 | using Animation = OpenSim.Framework.Animation; | 35 | using Animation = OpenSim.Framework.Animation; |
34 | 36 | ||
@@ -37,7 +39,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
37 | [Serializable] | 39 | [Serializable] |
38 | public class AnimationSet | 40 | public class AnimationSet |
39 | { | 41 | { |
40 | public static AvatarAnimations Animations = new AvatarAnimations(); | 42 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
41 | 43 | ||
42 | private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation(); | 44 | private OpenSim.Framework.Animation m_defaultAnimation = new OpenSim.Framework.Animation(); |
43 | private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>(); | 45 | private List<OpenSim.Framework.Animation> m_animations = new List<OpenSim.Framework.Animation>(); |
@@ -132,9 +134,13 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
132 | /// </summary> | 134 | /// </summary> |
133 | public bool TrySetDefaultAnimation(string anim, int sequenceNum, UUID objectID) | 135 | public bool TrySetDefaultAnimation(string anim, int sequenceNum, UUID objectID) |
134 | { | 136 | { |
135 | if (Animations.AnimsUUID.ContainsKey(anim)) | 137 | // m_log.DebugFormat( |
138 | // "[ANIMATION SET]: Setting default animation {0}, sequence number {1}, object id {2}", | ||
139 | // anim, sequenceNum, objectID); | ||
140 | |||
141 | if (DefaultAvatarAnimations.AnimsUUID.ContainsKey(anim)) | ||
136 | { | 142 | { |
137 | return SetDefaultAnimation(Animations.AnimsUUID[anim], sequenceNum, objectID); | 143 | return SetDefaultAnimation(DefaultAvatarAnimations.AnimsUUID[anim], sequenceNum, objectID); |
138 | } | 144 | } |
139 | return false; | 145 | return false; |
140 | } | 146 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs new file mode 100644 index 0000000..c2b0468 --- /dev/null +++ b/OpenSim/Region/Framework/Scenes/Animation/DefaultAvatarAnimations.cs | |||
@@ -0,0 +1,108 @@ | |||
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.Collections.Generic; | ||
29 | using System.Reflection; | ||
30 | using System.Xml; | ||
31 | using log4net; | ||
32 | using OpenMetaverse; | ||
33 | |||
34 | namespace OpenSim.Region.Framework.Scenes.Animation | ||
35 | { | ||
36 | public class DefaultAvatarAnimations | ||
37 | { | ||
38 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
39 | |||
40 | public static readonly string DefaultAnimationsPath = "data/avataranimations.xml"; | ||
41 | |||
42 | public static Dictionary<string, UUID> AnimsUUID = new Dictionary<string, UUID>(); | ||
43 | public static Dictionary<UUID, string> AnimsNames = new Dictionary<UUID, string>(); | ||
44 | public static Dictionary<UUID, string> AnimStateNames = new Dictionary<UUID, string>(); | ||
45 | |||
46 | static DefaultAvatarAnimations() | ||
47 | { | ||
48 | LoadAnimations(DefaultAnimationsPath); | ||
49 | } | ||
50 | |||
51 | /// <summary> | ||
52 | /// Load the default SL avatar animations. | ||
53 | /// </summary> | ||
54 | /// <returns></returns> | ||
55 | private static void LoadAnimations(string path) | ||
56 | { | ||
57 | // Dictionary<string, UUID> animations = new Dictionary<string, UUID>(); | ||
58 | |||
59 | using (XmlTextReader reader = new XmlTextReader(path)) | ||
60 | { | ||
61 | XmlDocument doc = new XmlDocument(); | ||
62 | doc.Load(reader); | ||
63 | // if (doc.DocumentElement != null) | ||
64 | // { | ||
65 | foreach (XmlNode nod in doc.DocumentElement.ChildNodes) | ||
66 | { | ||
67 | if (nod.Attributes["name"] != null) | ||
68 | { | ||
69 | string name = nod.Attributes["name"].Value; | ||
70 | UUID id = (UUID)nod.InnerText; | ||
71 | string animState = (string)nod.Attributes["state"].Value; | ||
72 | |||
73 | AnimsUUID.Add(name, id); | ||
74 | AnimsNames.Add(id, name); | ||
75 | if (animState != "") | ||
76 | AnimStateNames.Add(id, animState); | ||
77 | |||
78 | // m_log.DebugFormat("[AVATAR ANIMATIONS]: Loaded {0} {1} {2}", id, name, animState); | ||
79 | } | ||
80 | } | ||
81 | // } | ||
82 | } | ||
83 | |||
84 | // return animations; | ||
85 | } | ||
86 | |||
87 | /// <summary> | ||
88 | /// Get the default avatar animation with the given name. | ||
89 | /// </summary> | ||
90 | /// <param name="name"></param> | ||
91 | /// <returns></returns> | ||
92 | public static UUID GetDefaultAnimation(string name) | ||
93 | { | ||
94 | // m_log.DebugFormat( | ||
95 | // "[AVATAR ANIMATIONS]: Looking for default avatar animation with name {0}", name); | ||
96 | |||
97 | if (AnimsUUID.ContainsKey(name)) | ||
98 | { | ||
99 | // m_log.DebugFormat( | ||
100 | // "[AVATAR ANIMATIONS]: Found {0} {1} in GetDefaultAvatarAnimation()", AnimsUUID[name], name); | ||
101 | |||
102 | return AnimsUUID[name]; | ||
103 | } | ||
104 | |||
105 | return UUID.Zero; | ||
106 | } | ||
107 | } | ||
108 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 3584cda..cded9be 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -97,7 +97,9 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
97 | if (m_scenePresence.IsChildAgent) | 97 | if (m_scenePresence.IsChildAgent) |
98 | return; | 98 | return; |
99 | 99 | ||
100 | UUID animID = m_scenePresence.ControllingClient.GetDefaultAnimation(name); | 100 | // XXX: For some reason, we store all animations and use them with upper case names, but in LSL animations |
101 | // are referenced with lower case names! | ||
102 | UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name.ToUpper()); | ||
101 | if (animID == UUID.Zero) | 103 | if (animID == UUID.Zero) |
102 | return; | 104 | return; |
103 | 105 | ||
@@ -121,7 +123,9 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
121 | if (m_scenePresence.IsChildAgent) | 123 | if (m_scenePresence.IsChildAgent) |
122 | return; | 124 | return; |
123 | 125 | ||
124 | UUID animID = m_scenePresence.ControllingClient.GetDefaultAnimation(name); | 126 | // XXX: For some reason, we store all animations and use them with upper case names, but in LSL animations |
127 | // are referenced with lower case names! | ||
128 | UUID animID = DefaultAvatarAnimations.GetDefaultAnimation(name); | ||
125 | if (animID == UUID.Zero) | 129 | if (animID == UUID.Zero) |
126 | return; | 130 | return; |
127 | 131 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index d1739de..6cf1067 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1217,9 +1217,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1217 | /// <summary> | 1217 | /// <summary> |
1218 | /// Copy a task (prim) inventory item to another task (prim) | 1218 | /// Copy a task (prim) inventory item to another task (prim) |
1219 | /// </summary> | 1219 | /// </summary> |
1220 | /// <param name="destId"></param> | 1220 | /// <param name="destId">ID of destination part</param> |
1221 | /// <param name="part"></param> | 1221 | /// <param name="part">Source part</param> |
1222 | /// <param name="itemId"></param> | 1222 | /// <param name="itemId">Source item id to transfer</param> |
1223 | public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId) | 1223 | public void MoveTaskInventoryItem(UUID destId, SceneObjectPart part, UUID itemId) |
1224 | { | 1224 | { |
1225 | TaskInventoryItem srcTaskItem = part.Inventory.GetInventoryItem(itemId); | 1225 | TaskInventoryItem srcTaskItem = part.Inventory.GetInventoryItem(itemId); |
@@ -1247,14 +1247,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1247 | 1247 | ||
1248 | // Can't transfer this | 1248 | // Can't transfer this |
1249 | // | 1249 | // |
1250 | if ((part.OwnerID != destPart.OwnerID) && ((srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0)) | 1250 | if (part.OwnerID != destPart.OwnerID && (srcTaskItem.CurrentPermissions & (uint)PermissionMask.Transfer) == 0) |
1251 | return; | 1251 | return; |
1252 | 1252 | ||
1253 | bool overrideNoMod = false; | 1253 | bool overrideNoMod = false; |
1254 | if ((part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0) | 1254 | if ((part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) != 0) |
1255 | overrideNoMod = true; | 1255 | overrideNoMod = true; |
1256 | 1256 | ||
1257 | if (part.OwnerID != destPart.OwnerID && (part.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0) | 1257 | if (part.OwnerID != destPart.OwnerID && (destPart.GetEffectiveObjectFlags() & (uint)PrimFlags.AllowInventoryDrop) == 0) |
1258 | { | 1258 | { |
1259 | // object cannot copy items to an object owned by a different owner | 1259 | // object cannot copy items to an object owned by a different owner |
1260 | // unless llAllowInventoryDrop has been called | 1260 | // unless llAllowInventoryDrop has been called |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 44ee453..44a738e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -65,7 +65,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
65 | #region Fields | 65 | #region Fields |
66 | 66 | ||
67 | public bool EmergencyMonitoring = false; | 67 | public bool EmergencyMonitoring = false; |
68 | public bool DEBUG = false; | 68 | |
69 | /// <summary> | ||
70 | /// Show debug information about teleports. | ||
71 | /// </summary> | ||
72 | public bool DebugTeleporting { get; private set; } | ||
73 | |||
74 | /// <summary> | ||
75 | /// Show debug information about the scene loop. | ||
76 | /// </summary> | ||
77 | public bool DebugUpdates { get; private set; } | ||
69 | 78 | ||
70 | public SynchronizeSceneHandler SynchronizeScene; | 79 | public SynchronizeSceneHandler SynchronizeScene; |
71 | public SimStatsReporter StatsReporter; | 80 | public SimStatsReporter StatsReporter; |
@@ -1053,44 +1062,66 @@ namespace OpenSim.Region.Framework.Scenes | |||
1053 | } | 1062 | } |
1054 | } | 1063 | } |
1055 | 1064 | ||
1056 | public void SetSceneCoreDebug(bool ScriptEngine, bool CollisionEvents, bool PhysicsEngine) | 1065 | public void SetSceneCoreDebug(Dictionary<string, string> options) |
1057 | { | 1066 | { |
1058 | if (m_scripts_enabled != !ScriptEngine) | 1067 | if (options.ContainsKey("scripting")) |
1059 | { | 1068 | { |
1060 | if (ScriptEngine) | 1069 | bool enableScripts = true; |
1070 | if (bool.TryParse(options["scripting"], out enableScripts) && m_scripts_enabled != enableScripts) | ||
1061 | { | 1071 | { |
1062 | m_log.Info("Stopping all Scripts in Scene"); | 1072 | if (!enableScripts) |
1063 | |||
1064 | EntityBase[] entities = Entities.GetEntities(); | ||
1065 | foreach (EntityBase ent in entities) | ||
1066 | { | 1073 | { |
1067 | if (ent is SceneObjectGroup) | 1074 | m_log.Info("Stopping all Scripts in Scene"); |
1068 | ((SceneObjectGroup)ent).RemoveScriptInstances(false); | 1075 | |
1076 | EntityBase[] entities = Entities.GetEntities(); | ||
1077 | foreach (EntityBase ent in entities) | ||
1078 | { | ||
1079 | if (ent is SceneObjectGroup) | ||
1080 | ((SceneObjectGroup)ent).RemoveScriptInstances(false); | ||
1081 | } | ||
1069 | } | 1082 | } |
1070 | } | 1083 | else |
1071 | else | ||
1072 | { | ||
1073 | m_log.Info("Starting all Scripts in Scene"); | ||
1074 | |||
1075 | EntityBase[] entities = Entities.GetEntities(); | ||
1076 | foreach (EntityBase ent in entities) | ||
1077 | { | 1084 | { |
1078 | if (ent is SceneObjectGroup) | 1085 | m_log.Info("Starting all Scripts in Scene"); |
1086 | |||
1087 | EntityBase[] entities = Entities.GetEntities(); | ||
1088 | foreach (EntityBase ent in entities) | ||
1079 | { | 1089 | { |
1080 | SceneObjectGroup sog = (SceneObjectGroup)ent; | 1090 | if (ent is SceneObjectGroup) |
1081 | sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0); | 1091 | { |
1082 | sog.ResumeScripts(); | 1092 | SceneObjectGroup sog = (SceneObjectGroup)ent; |
1093 | sog.CreateScriptInstances(0, false, DefaultScriptEngine, 0); | ||
1094 | sog.ResumeScripts(); | ||
1095 | } | ||
1083 | } | 1096 | } |
1084 | } | 1097 | } |
1098 | |||
1099 | m_scripts_enabled = enableScripts; | ||
1085 | } | 1100 | } |
1101 | } | ||
1086 | 1102 | ||
1087 | m_scripts_enabled = !ScriptEngine; | 1103 | if (options.ContainsKey("physics")) |
1088 | m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine"); | 1104 | { |
1105 | bool enablePhysics; | ||
1106 | if (bool.TryParse(options["physics"], out enablePhysics)) | ||
1107 | m_physics_enabled = enablePhysics; | ||
1108 | } | ||
1109 | |||
1110 | if (options.ContainsKey("teleport")) | ||
1111 | { | ||
1112 | bool enableTeleportDebugging; | ||
1113 | if (bool.TryParse(options["teleport"], out enableTeleportDebugging)) | ||
1114 | DebugTeleporting = enableTeleportDebugging; | ||
1089 | } | 1115 | } |
1090 | 1116 | ||
1091 | if (m_physics_enabled != !PhysicsEngine) | 1117 | if (options.ContainsKey("updates")) |
1092 | { | 1118 | { |
1093 | m_physics_enabled = !PhysicsEngine; | 1119 | bool enableUpdateDebugging; |
1120 | if (bool.TryParse(options["updates"], out enableUpdateDebugging)) | ||
1121 | { | ||
1122 | DebugUpdates = enableUpdateDebugging; | ||
1123 | GcNotify.Enabled = DebugUpdates; | ||
1124 | } | ||
1094 | } | 1125 | } |
1095 | } | 1126 | } |
1096 | 1127 | ||
@@ -1427,7 +1458,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1427 | // Tell the watchdog that this thread is still alive | 1458 | // Tell the watchdog that this thread is still alive |
1428 | Watchdog.UpdateThread(); | 1459 | Watchdog.UpdateThread(); |
1429 | 1460 | ||
1430 | // previousFrameTick = m_lastFrameTick; | 1461 | previousFrameTick = m_lastFrameTick; |
1431 | m_lastFrameTick = Util.EnvironmentTickCount(); | 1462 | m_lastFrameTick = Util.EnvironmentTickCount(); |
1432 | maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc); | 1463 | maintc = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc); |
1433 | maintc = (int)(MinFrameTime * 1000) - maintc; | 1464 | maintc = (int)(MinFrameTime * 1000) - maintc; |
@@ -1442,12 +1473,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1442 | m_firstHeartbeat = false; | 1473 | m_firstHeartbeat = false; |
1443 | 1474 | ||
1444 | // Optionally warn if a frame takes double the amount of time that it should. | 1475 | // Optionally warn if a frame takes double the amount of time that it should. |
1445 | // if (Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) | 1476 | if (DebugUpdates |
1446 | // m_log.WarnFormat( | 1477 | && Util.EnvironmentTickCountSubtract( |
1447 | // "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", | 1478 | m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) |
1448 | // Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), | 1479 | m_log.WarnFormat( |
1449 | // MinFrameTime * 1000, | 1480 | "[SCENE]: Frame took {0} ms (desired max {1} ms) in {2}", |
1450 | // RegionInfo.RegionName); | 1481 | Util.EnvironmentTickCountSubtract(m_lastFrameTick, previousFrameTick), |
1482 | MinFrameTime * 1000, | ||
1483 | RegionInfo.RegionName); | ||
1451 | } | 1484 | } |
1452 | } | 1485 | } |
1453 | 1486 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index ca85d10..ac44ce9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -778,9 +778,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
778 | /// A list of inventory items with that name. | 778 | /// A list of inventory items with that name. |
779 | /// If no inventory item has that name then an empty list is returned. | 779 | /// If no inventory item has that name then an empty list is returned. |
780 | /// </returns> | 780 | /// </returns> |
781 | public IList<TaskInventoryItem> GetInventoryItems(string name) | 781 | public List<TaskInventoryItem> GetInventoryItems(string name) |
782 | { | 782 | { |
783 | IList<TaskInventoryItem> items = new List<TaskInventoryItem>(); | 783 | List<TaskInventoryItem> items = new List<TaskInventoryItem>(); |
784 | 784 | ||
785 | m_items.LockItemsForRead(true); | 785 | m_items.LockItemsForRead(true); |
786 | 786 | ||
@@ -1295,7 +1295,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1295 | 1295 | ||
1296 | public List<TaskInventoryItem> GetInventoryItems() | 1296 | public List<TaskInventoryItem> GetInventoryItems() |
1297 | { | 1297 | { |
1298 | List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); | 1298 | List<TaskInventoryItem> ret = new List<TaskInventoryItem>(); |
1299 | 1299 | ||
1300 | lock (m_items) | 1300 | lock (m_items) |
1301 | ret = new List<TaskInventoryItem>(m_items.Values); | 1301 | ret = new List<TaskInventoryItem>(m_items.Values); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 0847994..2346c60 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -3920,7 +3920,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3920 | ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); | 3920 | ILandObject land = m_scene.LandChannel.GetLandObject(pos.X, pos.Y); |
3921 | if (land != null) | 3921 | if (land != null) |
3922 | { | 3922 | { |
3923 | if (Scene.DEBUG) | 3923 | if (Scene.DebugTeleporting) |
3924 | TeleportFlagsDebug(); | 3924 | TeleportFlagsDebug(); |
3925 | 3925 | ||
3926 | // If we come in via login, landmark or map, we want to | 3926 | // If we come in via login, landmark or map, we want to |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs index e16903c..55c80f5 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | |||
@@ -113,7 +113,7 @@ namespace OpenSim.Region.Framework.Tests | |||
113 | } | 113 | } |
114 | 114 | ||
115 | /// <summary> | 115 | /// <summary> |
116 | /// Test MoveTaskInventoryItem where the item has no parent folder assigned. | 116 | /// Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent folder assigned. |
117 | /// </summary> | 117 | /// </summary> |
118 | /// <remarks> | 118 | /// <remarks> |
119 | /// This should place it in the most suitable user folder. | 119 | /// This should place it in the most suitable user folder. |
@@ -142,9 +142,11 @@ namespace OpenSim.Region.Framework.Tests | |||
142 | } | 142 | } |
143 | 143 | ||
144 | /// <summary> | 144 | /// <summary> |
145 | /// Test MoveTaskInventoryItem where the item has no parent folder assigned. | 145 | /// Test MoveTaskInventoryItem from a part inventory to a user inventory where the item has no parent folder assigned. |
146 | /// </summary> | 146 | /// </summary> |
147 | /// <remarks> | ||
147 | /// This should place it in the most suitable user folder. | 148 | /// This should place it in the most suitable user folder. |
149 | /// </remarks> | ||
148 | [Test] | 150 | [Test] |
149 | public void TestMoveTaskInventoryItemNoParent() | 151 | public void TestMoveTaskInventoryItemNoParent() |
150 | { | 152 | { |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 1e87eed..655f3a5 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -1211,11 +1211,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1211 | 1211 | ||
1212 | } | 1212 | } |
1213 | 1213 | ||
1214 | public UUID GetDefaultAnimation(string name) | ||
1215 | { | ||
1216 | return UUID.Zero; | ||
1217 | } | ||
1218 | |||
1219 | public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] charterMember, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) | 1214 | public void SendAvatarProperties(UUID avatarID, string aboutText, string bornOn, byte[] charterMember, string flAbout, uint flags, UUID flImageID, UUID imageID, string profileURL, UUID partnerID) |
1220 | { | 1215 | { |
1221 | 1216 | ||
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 7bd5590..a2375fe 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -133,11 +133,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
133 | 133 | ||
134 | } | 134 | } |
135 | 135 | ||
136 | public UUID GetDefaultAnimation(string name) | ||
137 | { | ||
138 | return SLUtil.GetDefaultAvatarAnimation(name); | ||
139 | } | ||
140 | |||
141 | public Vector3 Position | 136 | public Vector3 Position |
142 | { | 137 | { |
143 | get { return m_scene.Entities[m_uuid].AbsolutePosition; } | 138 | get { return m_scene.Entities[m_uuid].AbsolutePosition; } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index df4c7f8..4d7c40e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4764,7 +4764,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4764 | 4764 | ||
4765 | if (m_host.RegionHandle == presence.RegionHandle) | 4765 | if (m_host.RegionHandle == presence.RegionHandle) |
4766 | { | 4766 | { |
4767 | Dictionary<UUID, string> animationstateNames = AnimationSet.Animations.AnimStateNames; | 4767 | Dictionary<UUID, string> animationstateNames = DefaultAvatarAnimations.AnimStateNames; |
4768 | 4768 | ||
4769 | if (presence != null) | 4769 | if (presence != null) |
4770 | { | 4770 | { |
@@ -6064,7 +6064,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6064 | } | 6064 | } |
6065 | 6065 | ||
6066 | if (agent.Animator.Animations.DefaultAnimation.AnimID | 6066 | if (agent.Animator.Animations.DefaultAnimation.AnimID |
6067 | == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) | 6067 | == DefaultAvatarAnimations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) |
6068 | { | 6068 | { |
6069 | flags |= ScriptBaseClass.AGENT_SITTING; | 6069 | flags |= ScriptBaseClass.AGENT_SITTING; |
6070 | } | 6070 | } |
@@ -8408,7 +8408,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8408 | LSL_Vector lower; | 8408 | LSL_Vector lower; |
8409 | LSL_Vector upper; | 8409 | LSL_Vector upper; |
8410 | if (presence.Animator.Animations.DefaultAnimation.AnimID | 8410 | if (presence.Animator.Animations.DefaultAnimation.AnimID |
8411 | == AnimationSet.Animations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) | 8411 | == DefaultAvatarAnimations.AnimsUUID["SIT_GROUND_CONSTRAINED"]) |
8412 | { | 8412 | { |
8413 | // This is for ground sitting avatars | 8413 | // This is for ground sitting avatars |
8414 | float height = presence.Appearance.AvatarHeight / 2.66666667f; | 8414 | float height = presence.Appearance.AvatarHeight / 2.66666667f; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs new file mode 100644 index 0000000..e2d0db2 --- /dev/null +++ b/OpenSim/Region/ScriptEngine/Shared/Tests/LSL_ApiInventoryTests.cs | |||
@@ -0,0 +1,168 @@ | |||
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; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using System.Text; | ||
32 | using log4net; | ||
33 | using Nini.Config; | ||
34 | using NUnit.Framework; | ||
35 | using OpenMetaverse; | ||
36 | using OpenMetaverse.Assets; | ||
37 | using OpenMetaverse.StructuredData; | ||
38 | using OpenSim.Framework; | ||
39 | using OpenSim.Region.CoreModules.Avatar.AvatarFactory; | ||
40 | using OpenSim.Region.OptionalModules.World.NPC; | ||
41 | using OpenSim.Region.Framework.Scenes; | ||
42 | using OpenSim.Region.ScriptEngine.Shared; | ||
43 | using OpenSim.Region.ScriptEngine.Shared.Api; | ||
44 | using OpenSim.Services.Interfaces; | ||
45 | using OpenSim.Tests.Common; | ||
46 | using OpenSim.Tests.Common.Mock; | ||
47 | |||
48 | namespace OpenSim.Region.ScriptEngine.Shared.Tests | ||
49 | { | ||
50 | /// <summary> | ||
51 | /// Tests for inventory functions in LSL | ||
52 | /// </summary> | ||
53 | [TestFixture] | ||
54 | public class LSL_ApiInventoryTests | ||
55 | { | ||
56 | protected Scene m_scene; | ||
57 | protected XEngine.XEngine m_engine; | ||
58 | |||
59 | [SetUp] | ||
60 | public void SetUp() | ||
61 | { | ||
62 | IConfigSource initConfigSource = new IniConfigSource(); | ||
63 | IConfig config = initConfigSource.AddConfig("XEngine"); | ||
64 | config.Set("Enabled", "true"); | ||
65 | |||
66 | m_scene = SceneHelpers.SetupScene(); | ||
67 | SceneHelpers.SetupSceneModules(m_scene, initConfigSource); | ||
68 | |||
69 | m_engine = new XEngine.XEngine(); | ||
70 | m_engine.Initialise(initConfigSource); | ||
71 | m_engine.AddRegion(m_scene); | ||
72 | } | ||
73 | |||
74 | /// <summary> | ||
75 | /// Test giving inventory from an object to an object where both are owned by the same user. | ||
76 | /// </summary> | ||
77 | [Test] | ||
78 | public void TestLlGiveInventoryO2OSameOwner() | ||
79 | { | ||
80 | TestHelpers.InMethod(); | ||
81 | // log4net.Config.XmlConfigurator.Configure(); | ||
82 | |||
83 | UUID userId = TestHelpers.ParseTail(0x1); | ||
84 | string inventoryItemName = "item1"; | ||
85 | |||
86 | SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, userId, "so1", 0x10); | ||
87 | m_scene.AddSceneObject(so1); | ||
88 | |||
89 | // Create an object embedded inside the first | ||
90 | UUID itemId = TestHelpers.ParseTail(0x20); | ||
91 | TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, userId); | ||
92 | |||
93 | LSL_Api api = new LSL_Api(); | ||
94 | api.Initialize(m_engine, so1.RootPart, so1.RootPart.LocalId, so1.RootPart.UUID); | ||
95 | |||
96 | // Create a second object | ||
97 | SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, userId, "so2", 0x100); | ||
98 | m_scene.AddSceneObject(so2); | ||
99 | |||
100 | api.llGiveInventory(so2.UUID.ToString(), inventoryItemName); | ||
101 | |||
102 | // Item has copy permissions so original should stay intact. | ||
103 | List<TaskInventoryItem> originalItems = so1.RootPart.Inventory.GetInventoryItems(); | ||
104 | Assert.That(originalItems.Count, Is.EqualTo(1)); | ||
105 | |||
106 | List<TaskInventoryItem> copiedItems = so2.RootPart.Inventory.GetInventoryItems(inventoryItemName); | ||
107 | Assert.That(copiedItems.Count, Is.EqualTo(1)); | ||
108 | Assert.That(copiedItems[0].Name, Is.EqualTo(inventoryItemName)); | ||
109 | } | ||
110 | |||
111 | /// <summary> | ||
112 | /// Test giving inventory from an object to an object where they have different owners | ||
113 | /// </summary> | ||
114 | [Test] | ||
115 | public void TestLlGiveInventoryO2ODifferentOwners() | ||
116 | { | ||
117 | TestHelpers.InMethod(); | ||
118 | // log4net.Config.XmlConfigurator.Configure(); | ||
119 | |||
120 | UUID user1Id = TestHelpers.ParseTail(0x1); | ||
121 | UUID user2Id = TestHelpers.ParseTail(0x2); | ||
122 | string inventoryItemName = "item1"; | ||
123 | |||
124 | SceneObjectGroup so1 = SceneHelpers.CreateSceneObject(1, user1Id, "so1", 0x10); | ||
125 | m_scene.AddSceneObject(so1); | ||
126 | LSL_Api api = new LSL_Api(); | ||
127 | api.Initialize(m_engine, so1.RootPart, so1.RootPart.LocalId, so1.RootPart.UUID); | ||
128 | |||
129 | // Create an object embedded inside the first | ||
130 | UUID itemId = TestHelpers.ParseTail(0x20); | ||
131 | TaskInventoryHelpers.AddSceneObject(m_scene, so1.RootPart, inventoryItemName, itemId, user1Id); | ||
132 | |||
133 | // Create a second object | ||
134 | SceneObjectGroup so2 = SceneHelpers.CreateSceneObject(1, user2Id, "so2", 0x100); | ||
135 | m_scene.AddSceneObject(so2); | ||
136 | LSL_Api api2 = new LSL_Api(); | ||
137 | api2.Initialize(m_engine, so2.RootPart, so2.RootPart.LocalId, so2.RootPart.UUID); | ||
138 | |||
139 | // *** Firstly, we test where llAllowInventoryDrop() has not been called. *** | ||
140 | api.llGiveInventory(so2.UUID.ToString(), inventoryItemName); | ||
141 | |||
142 | { | ||
143 | // Item has copy permissions so original should stay intact. | ||
144 | List<TaskInventoryItem> originalItems = so1.RootPart.Inventory.GetInventoryItems(); | ||
145 | Assert.That(originalItems.Count, Is.EqualTo(1)); | ||
146 | |||
147 | // Should have not copied | ||
148 | List<TaskInventoryItem> copiedItems = so2.RootPart.Inventory.GetInventoryItems(inventoryItemName); | ||
149 | Assert.That(copiedItems.Count, Is.EqualTo(0)); | ||
150 | } | ||
151 | |||
152 | // *** Secondly, we turn on allow inventory drop in the target and retest. *** | ||
153 | api2.llAllowInventoryDrop(1); | ||
154 | api.llGiveInventory(so2.UUID.ToString(), inventoryItemName); | ||
155 | |||
156 | { | ||
157 | // Item has copy permissions so original should stay intact. | ||
158 | List<TaskInventoryItem> originalItems = so1.RootPart.Inventory.GetInventoryItems(); | ||
159 | Assert.That(originalItems.Count, Is.EqualTo(1)); | ||
160 | |||
161 | // Should now have copied. | ||
162 | List<TaskInventoryItem> copiedItems = so2.RootPart.Inventory.GetInventoryItems(inventoryItemName); | ||
163 | Assert.That(copiedItems.Count, Is.EqualTo(1)); | ||
164 | Assert.That(copiedItems[0].Name, Is.EqualTo(inventoryItemName)); | ||
165 | } | ||
166 | } | ||
167 | } | ||
168 | } \ No newline at end of file | ||
diff --git a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs index ca566f2..8ef03e7 100644 --- a/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs +++ b/OpenSim/Server/Handlers/Hypergrid/HGFriendsServerPostHandler.cs | |||
@@ -105,6 +105,9 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
105 | 105 | ||
106 | case "validate_friendship_offered": | 106 | case "validate_friendship_offered": |
107 | return ValidateFriendshipOffered(request); | 107 | return ValidateFriendshipOffered(request); |
108 | |||
109 | case "statusnotification": | ||
110 | return StatusNotification(request); | ||
108 | /* | 111 | /* |
109 | case "friendship_approved": | 112 | case "friendship_approved": |
110 | return FriendshipApproved(request); | 113 | return FriendshipApproved(request); |
@@ -197,7 +200,6 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
197 | string message = string.Empty; | 200 | string message = string.Empty; |
198 | string name = string.Empty; | 201 | string name = string.Empty; |
199 | 202 | ||
200 | m_log.DebugFormat("[HGFRIENDS HANDLER]: Friendship offered"); | ||
201 | if (!request.ContainsKey("FromID") || !request.ContainsKey("ToID")) | 203 | if (!request.ContainsKey("FromID") || !request.ContainsKey("ToID")) |
202 | return BoolResult(false); | 204 | return BoolResult(false); |
203 | 205 | ||
@@ -229,6 +231,59 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
229 | return BoolResult(success); | 231 | return BoolResult(success); |
230 | } | 232 | } |
231 | 233 | ||
234 | byte[] StatusNotification(Dictionary<string, object> request) | ||
235 | { | ||
236 | UUID principalID = UUID.Zero; | ||
237 | if (request.ContainsKey("userID")) | ||
238 | UUID.TryParse(request["userID"].ToString(), out principalID); | ||
239 | else | ||
240 | { | ||
241 | m_log.WarnFormat("[HGFRIENDS HANDLER]: no userID in request to notify"); | ||
242 | return FailureResult(); | ||
243 | } | ||
244 | |||
245 | bool online = true; | ||
246 | if (request.ContainsKey("online")) | ||
247 | Boolean.TryParse(request["online"].ToString(), out online); | ||
248 | else | ||
249 | { | ||
250 | m_log.WarnFormat("[HGFRIENDS HANDLER]: no online in request to notify"); | ||
251 | return FailureResult(); | ||
252 | } | ||
253 | |||
254 | List<string> friends = new List<string>(); | ||
255 | int i = 0; | ||
256 | foreach (KeyValuePair<string, object> kvp in request) | ||
257 | { | ||
258 | if (kvp.Key.Equals("friend_" + i.ToString())) | ||
259 | { | ||
260 | friends.Add(kvp.Value.ToString()); | ||
261 | i++; | ||
262 | } | ||
263 | } | ||
264 | |||
265 | List<UUID> onlineFriends = m_TheService.StatusNotification(friends, principalID, online); | ||
266 | |||
267 | Dictionary<string, object> result = new Dictionary<string, object>(); | ||
268 | if ((onlineFriends == null) || ((onlineFriends != null) && (onlineFriends.Count == 0))) | ||
269 | result["RESULT"] = "NULL"; | ||
270 | else | ||
271 | { | ||
272 | i = 0; | ||
273 | foreach (UUID f in onlineFriends) | ||
274 | { | ||
275 | result["friend_" + i] = f.ToString(); | ||
276 | i++; | ||
277 | } | ||
278 | } | ||
279 | |||
280 | string xmlString = ServerUtils.BuildXmlResponse(result); | ||
281 | //m_log.DebugFormat("[GRID HANDLER]: resp string: {0}", xmlString); | ||
282 | UTF8Encoding encoding = new UTF8Encoding(); | ||
283 | return encoding.GetBytes(xmlString); | ||
284 | |||
285 | } | ||
286 | |||
232 | 287 | ||
233 | #endregion | 288 | #endregion |
234 | 289 | ||
diff --git a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs index 9a0e27e..db62aaa 100644 --- a/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs +++ b/OpenSim/Server/Handlers/Hypergrid/UserAgentServerConnector.cs | |||
@@ -222,6 +222,7 @@ namespace OpenSim.Server.Handlers.Hypergrid | |||
222 | 222 | ||
223 | } | 223 | } |
224 | 224 | ||
225 | [Obsolete] | ||
225 | public XmlRpcResponse StatusNotification(XmlRpcRequest request, IPEndPoint remoteClient) | 226 | public XmlRpcResponse StatusNotification(XmlRpcRequest request, IPEndPoint remoteClient) |
226 | { | 227 | { |
227 | Hashtable hash = new Hashtable(); | 228 | Hashtable hash = new Hashtable(); |
diff --git a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs index 8048f86..ed62f95 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginHandlers.cs | |||
@@ -73,6 +73,18 @@ namespace OpenSim.Server.Handlers.Login | |||
73 | 73 | ||
74 | if (requestData != null) | 74 | if (requestData != null) |
75 | { | 75 | { |
76 | foreach (string key in requestData.Keys) | ||
77 | { | ||
78 | object value = requestData[key]; | ||
79 | Console.WriteLine("{0}:{1}", key, value); | ||
80 | if (value is ArrayList) | ||
81 | { | ||
82 | ICollection col = value as ICollection; | ||
83 | foreach (object item in col) | ||
84 | Console.WriteLine(" {0}", item); | ||
85 | } | ||
86 | } | ||
87 | |||
76 | if (requestData.ContainsKey("first") && requestData["first"] != null && | 88 | if (requestData.ContainsKey("first") && requestData["first"] != null && |
77 | requestData.ContainsKey("last") && requestData["last"] != null && ( | 89 | requestData.ContainsKey("last") && requestData["last"] != null && ( |
78 | (requestData.ContainsKey("passwd") && requestData["passwd"] != null) || | 90 | (requestData.ContainsKey("passwd") && requestData["passwd"] != null) || |
diff --git a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs index 16c93c8..9a7ad34 100644 --- a/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs +++ b/OpenSim/Server/Handlers/Login/LLLoginServiceInConnector.cs | |||
@@ -94,6 +94,5 @@ namespace OpenSim.Server.Handlers.Login | |||
94 | server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false); | 94 | server.AddXmlRPCHandler("set_login_level", loginHandlers.HandleXMLRPCSetLoginLevel, false); |
95 | server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin); | 95 | server.SetDefaultLLSDHandler(loginHandlers.HandleLLSDLogin); |
96 | } | 96 | } |
97 | |||
98 | } | 97 | } |
99 | } | 98 | } |
diff --git a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs index e3f3260..e984a54 100644 --- a/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/HGFriendsServiceConnector.cs | |||
@@ -255,6 +255,58 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
255 | return false; | 255 | return false; |
256 | 256 | ||
257 | } | 257 | } |
258 | |||
259 | public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online) | ||
260 | { | ||
261 | Dictionary<string, object> sendData = new Dictionary<string, object>(); | ||
262 | List<UUID> friendsOnline = new List<UUID>(); | ||
263 | |||
264 | sendData["METHOD"] = "statusnotification"; | ||
265 | sendData["userID"] = userID.ToString(); | ||
266 | sendData["online"] = online.ToString(); | ||
267 | int i = 0; | ||
268 | foreach (string s in friends) | ||
269 | { | ||
270 | sendData["friend_" + i.ToString()] = s; | ||
271 | i++; | ||
272 | } | ||
273 | |||
274 | string reply = string.Empty; | ||
275 | string uri = m_ServerURI + "/hgfriends"; | ||
276 | try | ||
277 | { | ||
278 | reply = SynchronousRestFormsRequester.MakeRequest("POST", | ||
279 | uri, | ||
280 | ServerUtils.BuildQueryString(sendData)); | ||
281 | } | ||
282 | catch (Exception e) | ||
283 | { | ||
284 | m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Exception when contacting friends server at {0}: {1}", uri, e.Message); | ||
285 | return friendsOnline; | ||
286 | } | ||
287 | |||
288 | if (reply != string.Empty) | ||
289 | { | ||
290 | Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply); | ||
291 | |||
292 | // Here is the actual response | ||
293 | foreach (string key in replyData.Keys) | ||
294 | { | ||
295 | if (key.StartsWith("friend_") && replyData[key] != null) | ||
296 | { | ||
297 | UUID uuid; | ||
298 | if (UUID.TryParse(replyData[key].ToString(), out uuid)) | ||
299 | friendsOnline.Add(uuid); | ||
300 | } | ||
301 | } | ||
302 | } | ||
303 | else | ||
304 | m_log.DebugFormat("[HGFRIENDS CONNECTOR]: Received empty reply from remote StatusNotify"); | ||
305 | |||
306 | return friendsOnline; | ||
307 | |||
308 | } | ||
309 | |||
258 | #endregion | 310 | #endregion |
259 | } | 311 | } |
260 | } \ No newline at end of file | 312 | } \ No newline at end of file |
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs index c07c6a6..c542c29 100644 --- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs | |||
@@ -415,6 +415,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
415 | GetBoolResponse(request, out reason); | 415 | GetBoolResponse(request, out reason); |
416 | } | 416 | } |
417 | 417 | ||
418 | [Obsolete] | ||
418 | public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online) | 419 | public List<UUID> StatusNotification(List<string> friends, UUID userID, bool online) |
419 | { | 420 | { |
420 | Hashtable hash = new Hashtable(); | 421 | Hashtable hash = new Hashtable(); |
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs index 7815d7d..5731e2f 100644 --- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs | |||
@@ -202,8 +202,15 @@ namespace OpenSim.Services.Connectors | |||
202 | 202 | ||
203 | Dictionary<string, object> structData = data.ToKeyValuePairs(); | 203 | Dictionary<string, object> structData = data.ToKeyValuePairs(); |
204 | 204 | ||
205 | foreach (KeyValuePair<string,object> kvp in structData) | 205 | foreach (KeyValuePair<string, object> kvp in structData) |
206 | { | ||
207 | if (kvp.Value == null) | ||
208 | { | ||
209 | m_log.DebugFormat("[ACCOUNTS CONNECTOR]: Null value for {0}", kvp.Key); | ||
210 | continue; | ||
211 | } | ||
206 | sendData[kvp.Key] = kvp.Value.ToString(); | 212 | sendData[kvp.Key] = kvp.Value.ToString(); |
213 | } | ||
207 | 214 | ||
208 | return SendAndGetBoolReply(sendData); | 215 | return SendAndGetBoolReply(sendData); |
209 | } | 216 | } |
diff --git a/OpenSim/Services/HypergridService/HGFriendsService.cs b/OpenSim/Services/HypergridService/HGFriendsService.cs index 19ee3e2..39524ab 100644 --- a/OpenSim/Services/HypergridService/HGFriendsService.cs +++ b/OpenSim/Services/HypergridService/HGFriendsService.cs | |||
@@ -214,6 +214,91 @@ namespace OpenSim.Services.HypergridService | |||
214 | return false; | 214 | return false; |
215 | } | 215 | } |
216 | 216 | ||
217 | public List<UUID> StatusNotification(List<string> friends, UUID foreignUserID, bool online) | ||
218 | { | ||
219 | if (m_FriendsService == null || m_PresenceService == null) | ||
220 | { | ||
221 | m_log.WarnFormat("[HGFRIENDS SERVICE]: Unable to perform status notifications because friends or presence services are missing"); | ||
222 | return new List<UUID>(); | ||
223 | } | ||
224 | |||
225 | // Let's unblock the caller right now, and take it from here async | ||
226 | |||
227 | List<UUID> localFriendsOnline = new List<UUID>(); | ||
228 | |||
229 | m_log.DebugFormat("[HGFRIENDS SERVICE]: Status notification: foreign user {0} wants to notify {1} local friends of {2} status", | ||
230 | foreignUserID, friends.Count, (online ? "online" : "offline")); | ||
231 | |||
232 | // First, let's double check that the reported friends are, indeed, friends of that user | ||
233 | // And let's check that the secret matches | ||
234 | List<string> usersToBeNotified = new List<string>(); | ||
235 | foreach (string uui in friends) | ||
236 | { | ||
237 | UUID localUserID; | ||
238 | string secret = string.Empty, tmp = string.Empty; | ||
239 | if (Util.ParseUniversalUserIdentifier(uui, out localUserID, out tmp, out tmp, out tmp, out secret)) | ||
240 | { | ||
241 | FriendInfo[] friendInfos = m_FriendsService.GetFriends(localUserID); | ||
242 | foreach (FriendInfo finfo in friendInfos) | ||
243 | { | ||
244 | if (finfo.Friend.StartsWith(foreignUserID.ToString()) && finfo.Friend.EndsWith(secret)) | ||
245 | { | ||
246 | // great! | ||
247 | usersToBeNotified.Add(localUserID.ToString()); | ||
248 | } | ||
249 | } | ||
250 | } | ||
251 | } | ||
252 | |||
253 | // Now, let's send the notifications | ||
254 | //m_log.DebugFormat("[HGFRIENDS SERVICE]: Status notification: user has {0} local friends", usersToBeNotified.Count); | ||
255 | |||
256 | // First, let's send notifications to local users who are online in the home grid | ||
257 | PresenceInfo[] friendSessions = m_PresenceService.GetAgents(usersToBeNotified.ToArray()); | ||
258 | if (friendSessions != null && friendSessions.Length > 0) | ||
259 | { | ||
260 | PresenceInfo friendSession = null; | ||
261 | foreach (PresenceInfo pinfo in friendSessions) | ||
262 | if (pinfo.RegionID != UUID.Zero) // let's guard against traveling agents | ||
263 | { | ||
264 | friendSession = pinfo; | ||
265 | break; | ||
266 | } | ||
267 | |||
268 | if (friendSession != null) | ||
269 | { | ||
270 | ForwardStatusNotificationToSim(friendSession.RegionID, foreignUserID, friendSession.UserID, online); | ||
271 | usersToBeNotified.Remove(friendSession.UserID.ToString()); | ||
272 | UUID id; | ||
273 | if (UUID.TryParse(friendSession.UserID, out id)) | ||
274 | localFriendsOnline.Add(id); | ||
275 | |||
276 | } | ||
277 | } | ||
278 | |||
279 | // Lastly, let's notify the rest who may be online somewhere else | ||
280 | foreach (string user in usersToBeNotified) | ||
281 | { | ||
282 | UUID id = new UUID(user); | ||
283 | //m_UserAgentService.LocateUser(id); | ||
284 | //etc... | ||
285 | //if (m_TravelingAgents.ContainsKey(id) && m_TravelingAgents[id].GridExternalName != m_GridName) | ||
286 | //{ | ||
287 | // string url = m_TravelingAgents[id].GridExternalName; | ||
288 | // // forward | ||
289 | //} | ||
290 | //m_log.WarnFormat("[HGFRIENDS SERVICE]: User {0} is visiting another grid. HG Status notifications still not implemented.", user); | ||
291 | } | ||
292 | |||
293 | // and finally, let's send the online friends | ||
294 | if (online) | ||
295 | { | ||
296 | return localFriendsOnline; | ||
297 | } | ||
298 | else | ||
299 | return new List<UUID>(); | ||
300 | } | ||
301 | |||
217 | #endregion IHGFriendsService | 302 | #endregion IHGFriendsService |
218 | 303 | ||
219 | #region Aux | 304 | #region Aux |
@@ -296,6 +381,28 @@ namespace OpenSim.Services.HypergridService | |||
296 | return false; | 381 | return false; |
297 | } | 382 | } |
298 | 383 | ||
384 | protected void ForwardStatusNotificationToSim(UUID regionID, UUID foreignUserID, string user, bool online) | ||
385 | { | ||
386 | UUID userID; | ||
387 | if (UUID.TryParse(user, out userID)) | ||
388 | { | ||
389 | if (m_FriendsLocalSimConnector != null) | ||
390 | { | ||
391 | m_log.DebugFormat("[HGFRIENDS SERVICE]: Local Notify, user {0} is {1}", foreignUserID, (online ? "online" : "offline")); | ||
392 | m_FriendsLocalSimConnector.StatusNotify(foreignUserID, userID, online); | ||
393 | } | ||
394 | else | ||
395 | { | ||
396 | GridRegion region = m_GridService.GetRegionByUUID(UUID.Zero /* !!! */, regionID); | ||
397 | if (region != null) | ||
398 | { | ||
399 | m_log.DebugFormat("[HGFRIENDS SERVICE]: Remote Notify to region {0}, user {1} is {2}", region.RegionName, foreignUserID, (online ? "online" : "offline")); | ||
400 | m_FriendsSimConnector.StatusNotify(region, foreignUserID, userID, online); | ||
401 | } | ||
402 | } | ||
403 | } | ||
404 | } | ||
405 | |||
299 | #endregion Aux | 406 | #endregion Aux |
300 | } | 407 | } |
301 | } | 408 | } |
diff --git a/OpenSim/Services/HypergridService/UserAgentService.cs b/OpenSim/Services/HypergridService/UserAgentService.cs index 65963d9..842ca58 100644 --- a/OpenSim/Services/HypergridService/UserAgentService.cs +++ b/OpenSim/Services/HypergridService/UserAgentService.cs | |||
@@ -332,6 +332,7 @@ namespace OpenSim.Services.HypergridService | |||
332 | return false; | 332 | return false; |
333 | } | 333 | } |
334 | 334 | ||
335 | [Obsolete] | ||
335 | public List<UUID> StatusNotification(List<string> friends, UUID foreignUserID, bool online) | 336 | public List<UUID> StatusNotification(List<string> friends, UUID foreignUserID, bool online) |
336 | { | 337 | { |
337 | if (m_FriendsService == null || m_PresenceService == null) | 338 | if (m_FriendsService == null || m_PresenceService == null) |
@@ -412,6 +413,7 @@ namespace OpenSim.Services.HypergridService | |||
412 | return new List<UUID>(); | 413 | return new List<UUID>(); |
413 | } | 414 | } |
414 | 415 | ||
416 | [Obsolete] | ||
415 | protected void ForwardStatusNotificationToSim(UUID regionID, UUID foreignUserID, string user, bool online) | 417 | protected void ForwardStatusNotificationToSim(UUID regionID, UUID foreignUserID, string user, bool online) |
416 | { | 418 | { |
417 | UUID userID; | 419 | UUID userID; |
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index f48b8a9..3dc877a 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs | |||
@@ -65,8 +65,8 @@ namespace OpenSim.Services.Interfaces | |||
65 | UUID GetUUID(String first, String last); | 65 | UUID GetUUID(String first, String last); |
66 | 66 | ||
67 | // Returns the local friends online | 67 | // Returns the local friends online |
68 | [Obsolete] | ||
68 | List<UUID> StatusNotification(List<string> friends, UUID userID, bool online); | 69 | List<UUID> StatusNotification(List<string> friends, UUID userID, bool online); |
69 | //List<UUID> GetOnlineFriends(UUID userID, List<string> friends); | ||
70 | 70 | ||
71 | bool IsAgentComingHome(UUID sessionID, string thisGridExternalName); | 71 | bool IsAgentComingHome(UUID sessionID, string thisGridExternalName); |
72 | bool VerifyAgent(UUID sessionID, string token); | 72 | bool VerifyAgent(UUID sessionID, string token); |
@@ -92,6 +92,8 @@ namespace OpenSim.Services.Interfaces | |||
92 | bool DeleteFriendship(FriendInfo finfo, string secret); | 92 | bool DeleteFriendship(FriendInfo finfo, string secret); |
93 | bool FriendshipOffered(UUID from, string fromName, UUID to, string message); | 93 | bool FriendshipOffered(UUID from, string fromName, UUID to, string message); |
94 | bool ValidateFriendshipOffered(UUID fromID, UUID toID); | 94 | bool ValidateFriendshipOffered(UUID fromID, UUID toID); |
95 | // Returns the local friends online | ||
96 | List<UUID> StatusNotification(List<string> friends, UUID userID, bool online); | ||
95 | } | 97 | } |
96 | 98 | ||
97 | public interface IInstantMessageSimConnector | 99 | public interface IInstantMessageSimConnector |
diff --git a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs b/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs index 56195b1..1e0a35b 100644 --- a/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs +++ b/OpenSim/Tests/Clients/UserAccounts/UserAccountsClient.cs | |||
@@ -62,25 +62,39 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
62 | string last = "Clueless"; | 62 | string last = "Clueless"; |
63 | string email = "foo@bar.com"; | 63 | string email = "foo@bar.com"; |
64 | 64 | ||
65 | UserAccount account = new UserAccount(user1); | 65 | //UserAccount account = new UserAccount(user1); |
66 | account.FirstName = first; | 66 | //account.ScopeID = UUID.Zero; |
67 | account.LastName = last; | 67 | //account.FirstName = first; |
68 | account.Email = email; | 68 | //account.LastName = last; |
69 | account.ServiceURLs = new Dictionary<string, object>(); | 69 | //account.Email = email; |
70 | account.ServiceURLs.Add("InventoryServerURI", "http://cnn.com"); | 70 | //account.ServiceURLs = new Dictionary<string, object>(); |
71 | account.ServiceURLs.Add("AssetServerURI", "http://cnn.com"); | 71 | //account.ServiceURLs.Add("InventoryServerURI", "http://cnn.com"); |
72 | 72 | //account.ServiceURLs.Add("AssetServerURI", "http://cnn.com"); | |
73 | bool success = m_Connector.StoreUserAccount(account); | ||
74 | if (success) | ||
75 | m_log.InfoFormat("[USER CLIENT]: Successfully created account for user {0} {1}", account.FirstName, account.LastName); | ||
76 | else | ||
77 | m_log.InfoFormat("[USER CLIENT]: failed to create user {0} {1}", account.FirstName, account.LastName); | ||
78 | 73 | ||
79 | System.Console.WriteLine("\n"); | 74 | //bool success = m_Connector.StoreUserAccount(account); |
75 | //if (success) | ||
76 | // m_log.InfoFormat("[USER CLIENT]: Successfully created account for user {0} {1}", account.FirstName, account.LastName); | ||
77 | //else | ||
78 | // m_log.InfoFormat("[USER CLIENT]: failed to create user {0} {1}", account.FirstName, account.LastName); | ||
80 | 79 | ||
81 | account = m_Connector.GetUserAccount(UUID.Zero, user1); | 80 | //System.Console.WriteLine("\n"); |
81 | |||
82 | //account = m_Connector.GetUserAccount(UUID.Zero, user1); | ||
83 | //if (account == null) | ||
84 | // m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); | ||
85 | //else | ||
86 | //{ | ||
87 | // m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
88 | // account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
89 | // foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
90 | // m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
91 | //} | ||
92 | |||
93 | //System.Console.WriteLine("\n"); | ||
94 | |||
95 | UserAccount account = m_Connector.GetUserAccount(UUID.Zero, first, last); | ||
82 | if (account == null) | 96 | if (account == null) |
83 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); | 97 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by name "); |
84 | else | 98 | else |
85 | { | 99 | { |
86 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | 100 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", |
@@ -90,10 +104,9 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
90 | } | 104 | } |
91 | 105 | ||
92 | System.Console.WriteLine("\n"); | 106 | System.Console.WriteLine("\n"); |
93 | 107 | account = m_Connector.GetUserAccount(UUID.Zero, email); | |
94 | account = m_Connector.GetUserAccount(UUID.Zero, first, last); | ||
95 | if (account == null) | 108 | if (account == null) |
96 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by name for {0}", user1); | 109 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by email"); |
97 | else | 110 | else |
98 | { | 111 | { |
99 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | 112 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", |
@@ -103,9 +116,9 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
103 | } | 116 | } |
104 | 117 | ||
105 | System.Console.WriteLine("\n"); | 118 | System.Console.WriteLine("\n"); |
106 | account = m_Connector.GetUserAccount(UUID.Zero, email); | 119 | account = m_Connector.GetUserAccount(UUID.Zero, user1); |
107 | if (account == null) | 120 | if (account == null) |
108 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by email for {0}", user1); | 121 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve accouny by UUID for {0}", user1); |
109 | else | 122 | else |
110 | { | 123 | { |
111 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", | 124 | m_log.InfoFormat("[USER CLIENT]: Account retrieved correctly: userID={0}; FirstName={1}; LastName={2}; Email={3}", |
@@ -114,6 +127,17 @@ namespace OpenSim.Tests.Clients.PresenceClient | |||
114 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | 127 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); |
115 | } | 128 | } |
116 | 129 | ||
130 | System.Console.WriteLine("\n"); | ||
131 | account = m_Connector.GetUserAccount(UUID.Zero, "DoesNot", "Exist"); | ||
132 | if (account == null) | ||
133 | m_log.InfoFormat("[USER CLIENT]: Unable to retrieve account 'DoesNot Exist'"); | ||
134 | else | ||
135 | { | ||
136 | m_log.InfoFormat("[USER CLIENT]: Account 'DoesNot Exist' retrieved correctly. REALLY??? userID={0}; FirstName={1}; LastName={2}; Email={3}", | ||
137 | account.PrincipalID, account.FirstName, account.LastName, account.Email); | ||
138 | foreach (KeyValuePair<string, object> kvp in account.ServiceURLs) | ||
139 | m_log.DebugFormat("\t {0} -> {1}", kvp.Key, kvp.Value); | ||
140 | } | ||
117 | } | 141 | } |
118 | 142 | ||
119 | } | 143 | } |
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 2fe22a5..81a5cf7 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs | |||
@@ -702,11 +702,6 @@ namespace OpenSim.Tests.Common.Mock | |||
702 | { | 702 | { |
703 | } | 703 | } |
704 | 704 | ||
705 | public UUID GetDefaultAnimation(string name) | ||
706 | { | ||
707 | return UUID.Zero; | ||
708 | } | ||
709 | |||
710 | public void SendTakeControls(int controls, bool passToAgent, bool TakeControls) | 705 | public void SendTakeControls(int controls, bool passToAgent, bool TakeControls) |
711 | { | 706 | { |
712 | } | 707 | } |