diff options
author | UbitUmarov | 2017-06-16 02:43:36 +0100 |
---|---|---|
committer | UbitUmarov | 2017-06-16 02:43:36 +0100 |
commit | 10d526f961b9dfea47019f9b9ff4e21df5693b53 (patch) | |
tree | d4832523e2b006f267f219d44b016545db9b7496 /OpenSim | |
parent | Merge branch 'master' into httptests (diff) | |
parent | change the clock source for EnvironmentTickCount so it does get a bit more r... (diff) | |
download | opensim-SC-10d526f961b9dfea47019f9b9ff4e21df5693b53.zip opensim-SC-10d526f961b9dfea47019f9b9ff4e21df5693b53.tar.gz opensim-SC-10d526f961b9dfea47019f9b9ff4e21df5693b53.tar.bz2 opensim-SC-10d526f961b9dfea47019f9b9ff4e21df5693b53.tar.xz |
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Capabilities/LLSDHelpers.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/ClientInfo.cs | 10 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 18 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 65 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 25 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | 110 |
8 files changed, 53 insertions, 189 deletions
diff --git a/OpenSim/Capabilities/LLSDHelpers.cs b/OpenSim/Capabilities/LLSDHelpers.cs index 8f1a40e..d582267 100644 --- a/OpenSim/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Capabilities/LLSDHelpers.cs | |||
@@ -157,6 +157,11 @@ namespace OpenSim.Framework.Capabilities | |||
157 | // the LLSD map/array types in the array need to be deserialised | 157 | // the LLSD map/array types in the array need to be deserialised |
158 | // but first we need to know the right class to deserialise them into. | 158 | // but first we need to know the right class to deserialise them into. |
159 | } | 159 | } |
160 | else if(enumerator.Value is Boolean && field.FieldType == typeof(int) ) | ||
161 | { | ||
162 | int i = (bool)enumerator.Value ? 1 : 0; | ||
163 | field.SetValue(obj, (object)i); | ||
164 | } | ||
160 | else | 165 | else |
161 | { | 166 | { |
162 | field.SetValue(obj, enumerator.Value); | 167 | field.SetValue(obj, enumerator.Value); |
diff --git a/OpenSim/Framework/ClientInfo.cs b/OpenSim/Framework/ClientInfo.cs index 98e4465..a1ca9bc 100644 --- a/OpenSim/Framework/ClientInfo.cs +++ b/OpenSim/Framework/ClientInfo.cs | |||
@@ -36,14 +36,8 @@ namespace OpenSim.Framework | |||
36 | public readonly DateTime StartedTime = DateTime.Now; | 36 | public readonly DateTime StartedTime = DateTime.Now; |
37 | public AgentCircuitData agentcircuit = null; | 37 | public AgentCircuitData agentcircuit = null; |
38 | 38 | ||
39 | public Dictionary<uint, byte[]> needAck; | ||
40 | |||
41 | public List<byte[]> out_packets = new List<byte[]>(); | ||
42 | public Dictionary<uint, uint> pendingAcks = new Dictionary<uint,uint>(); | ||
43 | public EndPoint proxyEP; | 39 | public EndPoint proxyEP; |
44 | 40 | ||
45 | public uint sequence; | ||
46 | public byte[] usecircuit; | ||
47 | public EndPoint userEP; | 41 | public EndPoint userEP; |
48 | 42 | ||
49 | public int resendThrottle; | 43 | public int resendThrottle; |
@@ -59,9 +53,5 @@ namespace OpenSim.Framework | |||
59 | public int targetThrottle; | 53 | public int targetThrottle; |
60 | 54 | ||
61 | public int maxThrottle; | 55 | public int maxThrottle; |
62 | |||
63 | public Dictionary<string, int> SyncRequests = new Dictionary<string,int>(); | ||
64 | public Dictionary<string, int> AsyncRequests = new Dictionary<string,int>(); | ||
65 | public Dictionary<string, int> GenericRequests = new Dictionary<string,int>(); | ||
66 | } | 56 | } |
67 | } | 57 | } |
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 9a1e348..a855767 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -2617,7 +2617,7 @@ namespace OpenSim.Framework | |||
2617 | public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context, bool dotimeout = true) | 2617 | public static void FireAndForget(System.Threading.WaitCallback callback, object obj, string context, bool dotimeout = true) |
2618 | { | 2618 | { |
2619 | Interlocked.Increment(ref numTotalThreadFuncsCalled); | 2619 | Interlocked.Increment(ref numTotalThreadFuncsCalled); |
2620 | 2620 | /* | |
2621 | if (context != null) | 2621 | if (context != null) |
2622 | { | 2622 | { |
2623 | if (!m_fireAndForgetCallsMade.ContainsKey(context)) | 2623 | if (!m_fireAndForgetCallsMade.ContainsKey(context)) |
@@ -2630,7 +2630,7 @@ namespace OpenSim.Framework | |||
2630 | else | 2630 | else |
2631 | m_fireAndForgetCallsInProgress[context]++; | 2631 | m_fireAndForgetCallsInProgress[context]++; |
2632 | } | 2632 | } |
2633 | 2633 | */ | |
2634 | WaitCallback realCallback; | 2634 | WaitCallback realCallback; |
2635 | 2635 | ||
2636 | bool loggingEnabled = LogThreadPool > 0; | 2636 | bool loggingEnabled = LogThreadPool > 0; |
@@ -2647,8 +2647,8 @@ namespace OpenSim.Framework | |||
2647 | Culture.SetCurrentCulture(); | 2647 | Culture.SetCurrentCulture(); |
2648 | callback(o); | 2648 | callback(o); |
2649 | 2649 | ||
2650 | if (context != null) | 2650 | // if (context != null) |
2651 | m_fireAndForgetCallsInProgress[context]--; | 2651 | // m_fireAndForgetCallsInProgress[context]--; |
2652 | }; | 2652 | }; |
2653 | } | 2653 | } |
2654 | else | 2654 | else |
@@ -2688,8 +2688,8 @@ namespace OpenSim.Framework | |||
2688 | if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread) | 2688 | if ((loggingEnabled || (threadFuncOverloadMode == 1)) && threadInfo.LogThread) |
2689 | m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed())); | 2689 | m_log.DebugFormat("Exit threadfunc {0} ({1})", threadFuncNum, FormatDuration(threadInfo.Elapsed())); |
2690 | 2690 | ||
2691 | if (context != null) | 2691 | // if (context != null) |
2692 | m_fireAndForgetCallsInProgress[context]--; | 2692 | // m_fireAndForgetCallsInProgress[context]--; |
2693 | } | 2693 | } |
2694 | }; | 2694 | }; |
2695 | } | 2695 | } |
@@ -2967,7 +2967,8 @@ namespace OpenSim.Framework | |||
2967 | /// <returns></returns> | 2967 | /// <returns></returns> |
2968 | public static Int32 EnvironmentTickCount() | 2968 | public static Int32 EnvironmentTickCount() |
2969 | { | 2969 | { |
2970 | return Environment.TickCount & EnvironmentTickCountMask; | 2970 | double now = GetTimeStampMS(); |
2971 | return (int)now; | ||
2971 | } | 2972 | } |
2972 | const Int32 EnvironmentTickCountMask = 0x3fffffff; | 2973 | const Int32 EnvironmentTickCountMask = 0x3fffffff; |
2973 | 2974 | ||
@@ -2993,7 +2994,8 @@ namespace OpenSim.Framework | |||
2993 | /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> | 2994 | /// <returns>subtraction of passed prevValue from current Environment.TickCount</returns> |
2994 | public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) | 2995 | public static Int32 EnvironmentTickCountSubtract(Int32 prevValue) |
2995 | { | 2996 | { |
2996 | return EnvironmentTickCountSubtract(EnvironmentTickCount(), prevValue); | 2997 | double now = GetTimeStampMS(); |
2998 | return EnvironmentTickCountSubtract((int)now, prevValue); | ||
2997 | } | 2999 | } |
2998 | 3000 | ||
2999 | // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount | 3001 | // Returns value of Tick Count A - TickCount B accounting for wrapping of TickCount |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 54359eb..01c1fb9 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -706,36 +706,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
706 | /// <returns>true if the handler was added. This is currently always the case.</returns> | 706 | /// <returns>true if the handler was added. This is currently always the case.</returns> |
707 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync) | 707 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync) |
708 | { | 708 | { |
709 | return AddLocalPacketHandler(packetType, handler, doAsync, false); | ||
710 | } | ||
711 | |||
712 | /// <summary> | ||
713 | /// Add a handler for the given packet type. | ||
714 | /// </summary> | ||
715 | /// <param name="packetType"></param> | ||
716 | /// <param name="handler"></param> | ||
717 | /// <param name="doAsync"> | ||
718 | /// If true, when the packet is received handle it on a different thread. Whether this is given direct to | ||
719 | /// a threadpool thread or placed in a queue depends on the inEngine parameter. | ||
720 | /// </param> | ||
721 | /// <param name="inEngine"> | ||
722 | /// If async is false then this parameter is ignored. | ||
723 | /// If async is true and inEngine is false, then the packet is sent directly to a | ||
724 | /// threadpool thread. | ||
725 | /// If async is true and inEngine is true, then the packet is sent to the IncomingPacketAsyncHandlingEngine. | ||
726 | /// This may result in slower handling but reduces the risk of overloading the simulator when there are many | ||
727 | /// simultaneous async requests. | ||
728 | /// </param> | ||
729 | /// <returns>true if the handler was added. This is currently always the case.</returns> | ||
730 | public bool AddLocalPacketHandler(PacketType packetType, PacketMethod handler, bool doAsync, bool inEngine) | ||
731 | { | ||
732 | bool result = false; | 709 | bool result = false; |
733 | lock (m_packetHandlers) | 710 | lock (m_packetHandlers) |
734 | { | 711 | { |
735 | if (!m_packetHandlers.ContainsKey(packetType)) | 712 | if (!m_packetHandlers.ContainsKey(packetType)) |
736 | { | 713 | { |
737 | m_packetHandlers.Add( | 714 | m_packetHandlers.Add( |
738 | packetType, new PacketProcessor() { method = handler, Async = doAsync, InEngine = inEngine }); | 715 | packetType, new PacketProcessor() { method = handler, Async = doAsync}); |
739 | result = true; | 716 | result = true; |
740 | } | 717 | } |
741 | } | 718 | } |
@@ -770,31 +747,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
770 | PacketProcessor pprocessor; | 747 | PacketProcessor pprocessor; |
771 | if (m_packetHandlers.TryGetValue(packet.Type, out pprocessor)) | 748 | if (m_packetHandlers.TryGetValue(packet.Type, out pprocessor)) |
772 | { | 749 | { |
773 | ClientInfo cinfo = UDPClient.GetClientInfo(); | ||
774 | 750 | ||
775 | //there is a local handler for this packet type | 751 | //there is a local handler for this packet type |
776 | if (pprocessor.Async) | 752 | if (pprocessor.Async) |
777 | { | 753 | { |
778 | if (!cinfo.AsyncRequests.ContainsKey(packet.Type.ToString())) | ||
779 | cinfo.AsyncRequests[packet.Type.ToString()] = 0; | ||
780 | cinfo.AsyncRequests[packet.Type.ToString()]++; | ||
781 | |||
782 | object obj = new AsyncPacketProcess(this, pprocessor.method, packet); | 754 | object obj = new AsyncPacketProcess(this, pprocessor.method, packet); |
783 | /* | ||
784 | if (pprocessor.InEngine) | ||
785 | m_udpServer.IpahEngine.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); | ||
786 | else | ||
787 | Util.FireAndForget(ProcessSpecificPacketAsync, obj, packet.Type.ToString()); | ||
788 | */ | ||
789 | m_asyncPacketProcess.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); | 755 | m_asyncPacketProcess.QueueJob(packet.Type.ToString(), () => ProcessSpecificPacketAsync(obj)); |
790 | result = true; | 756 | result = true; |
791 | } | 757 | } |
792 | else | 758 | else |
793 | { | 759 | { |
794 | if (!cinfo.SyncRequests.ContainsKey(packet.Type.ToString())) | ||
795 | cinfo.SyncRequests[packet.Type.ToString()] = 0; | ||
796 | cinfo.SyncRequests[packet.Type.ToString()]++; | ||
797 | |||
798 | result = pprocessor.method(this, packet); | 760 | result = pprocessor.method(this, packet); |
799 | } | 761 | } |
800 | } | 762 | } |
@@ -809,11 +771,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
809 | } | 771 | } |
810 | if (found) | 772 | if (found) |
811 | { | 773 | { |
812 | ClientInfo cinfo = UDPClient.GetClientInfo(); | ||
813 | if (!cinfo.GenericRequests.ContainsKey(packet.Type.ToString())) | ||
814 | cinfo.GenericRequests[packet.Type.ToString()] = 0; | ||
815 | cinfo.GenericRequests[packet.Type.ToString()]++; | ||
816 | |||
817 | result = method(this, packet); | 774 | result = method(this, packet); |
818 | } | 775 | } |
819 | } | 776 | } |
@@ -5995,10 +5952,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5995 | AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false); | 5952 | AddLocalPacketHandler(PacketType.ParcelBuy, HandleParcelBuyRequest, false); |
5996 | AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); | 5953 | AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest); |
5997 | AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); | 5954 | AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest); |
5998 | AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage, true, true); | 5955 | AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage); |
5999 | AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest, true, true); | 5956 | AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest); |
6000 | AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); | 5957 | AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer); |
6001 | AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate, true, true); | 5958 | AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate); |
6002 | AddLocalPacketHandler(PacketType.ScriptDialogReply, HandlerScriptDialogReply); | 5959 | AddLocalPacketHandler(PacketType.ScriptDialogReply, HandlerScriptDialogReply); |
6003 | AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage); | 5960 | AddLocalPacketHandler(PacketType.ImprovedInstantMessage, HandlerImprovedInstantMessage); |
6004 | AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship); | 5961 | AddLocalPacketHandler(PacketType.AcceptFriendship, HandlerAcceptFriendship); |
@@ -6040,8 +5997,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6040 | AddLocalPacketHandler(PacketType.ObjectExtraParams, HandleObjectExtraParams); | 5997 | AddLocalPacketHandler(PacketType.ObjectExtraParams, HandleObjectExtraParams); |
6041 | AddLocalPacketHandler(PacketType.ObjectDuplicate, HandleObjectDuplicate); | 5998 | AddLocalPacketHandler(PacketType.ObjectDuplicate, HandleObjectDuplicate); |
6042 | AddLocalPacketHandler(PacketType.RequestMultipleObjects, HandleRequestMultipleObjects); | 5999 | AddLocalPacketHandler(PacketType.RequestMultipleObjects, HandleRequestMultipleObjects); |
6043 | AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect, true, true); | 6000 | AddLocalPacketHandler(PacketType.ObjectSelect, HandleObjectSelect); |
6044 | AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect, true, true); | 6001 | AddLocalPacketHandler(PacketType.ObjectDeselect, HandleObjectDeselect); |
6045 | AddLocalPacketHandler(PacketType.ObjectPosition, HandleObjectPosition); | 6002 | AddLocalPacketHandler(PacketType.ObjectPosition, HandleObjectPosition); |
6046 | AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale); | 6003 | AddLocalPacketHandler(PacketType.ObjectScale, HandleObjectScale); |
6047 | AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation); | 6004 | AddLocalPacketHandler(PacketType.ObjectRotation, HandleObjectRotation); |
@@ -6185,8 +6142,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
6185 | AddLocalPacketHandler(PacketType.PickDelete, HandlePickDelete); | 6142 | AddLocalPacketHandler(PacketType.PickDelete, HandlePickDelete); |
6186 | AddLocalPacketHandler(PacketType.PickGodDelete, HandlePickGodDelete); | 6143 | AddLocalPacketHandler(PacketType.PickGodDelete, HandlePickGodDelete); |
6187 | AddLocalPacketHandler(PacketType.PickInfoUpdate, HandlePickInfoUpdate); | 6144 | AddLocalPacketHandler(PacketType.PickInfoUpdate, HandlePickInfoUpdate); |
6188 | AddLocalPacketHandler(PacketType.AvatarNotesUpdate, HandleAvatarNotesUpdate, true, true); | 6145 | AddLocalPacketHandler(PacketType.AvatarNotesUpdate, HandleAvatarNotesUpdate); |
6189 | AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate, true, true); | 6146 | AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate); |
6190 | AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); | 6147 | AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); |
6191 | AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); | 6148 | AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); |
6192 | AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry); | 6149 | AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry); |
@@ -13436,7 +13393,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
13436 | SendAssetNotFound(req); | 13393 | SendAssetNotFound(req); |
13437 | return; | 13394 | return; |
13438 | } | 13395 | } |
13439 | |||
13440 | } | 13396 | } |
13441 | 13397 | ||
13442 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) | 13398 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) |
@@ -13513,11 +13469,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
13513 | /// </summary> | 13469 | /// </summary> |
13514 | public bool Async { get; set; } | 13470 | public bool Async { get; set; } |
13515 | 13471 | ||
13516 | /// <summary> | ||
13517 | /// If async is true, should this packet be handled in the async engine or given directly to a threadpool | ||
13518 | /// thread? | ||
13519 | /// </summary> | ||
13520 | public bool InEngine { get; set; } | ||
13521 | } | 13472 | } |
13522 | 13473 | ||
13523 | public class AsyncPacketProcess | 13474 | public class AsyncPacketProcess |
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index cf188aa..5bca482 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -42,6 +42,7 @@ using OpenSim.Region.Framework.Interfaces; | |||
42 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
43 | using OpenSim.Region.Framework.Scenes.Serialization; | 43 | using OpenSim.Region.Framework.Scenes.Serialization; |
44 | using OpenSim.Services.Interfaces; | 44 | using OpenSim.Services.Interfaces; |
45 | using PermissionMask = OpenSim.Framework.PermissionMask; | ||
45 | 46 | ||
46 | namespace OpenSim.Region.CoreModules.Avatar.Attachments | 47 | namespace OpenSim.Region.CoreModules.Avatar.Attachments |
47 | { | 48 | { |
@@ -896,6 +897,30 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
896 | 897 | ||
897 | if (item != null) | 898 | if (item != null) |
898 | { | 899 | { |
900 | // attach is rez, need to update permissions | ||
901 | item.Flags &= ~(uint)(InventoryItemFlags.ObjectSlamPerm | InventoryItemFlags.ObjectOverwriteBase | | ||
902 | InventoryItemFlags.ObjectOverwriteOwner | InventoryItemFlags.ObjectOverwriteGroup | | ||
903 | InventoryItemFlags.ObjectOverwriteEveryone | InventoryItemFlags.ObjectOverwriteNextOwner); | ||
904 | |||
905 | uint permsBase = (uint)(PermissionMask.Copy | PermissionMask.Transfer | | ||
906 | PermissionMask.Modify | PermissionMask.Move | | ||
907 | PermissionMask.Export | PermissionMask.FoldedMask); | ||
908 | |||
909 | permsBase &= grp.CurrentAndFoldedNextPermissions(); | ||
910 | permsBase |= (uint)PermissionMask.Move; | ||
911 | item.BasePermissions = permsBase; | ||
912 | item.CurrentPermissions = permsBase; | ||
913 | item.NextPermissions = permsBase & grp.RootPart.NextOwnerMask | (uint)PermissionMask.Move; | ||
914 | item.EveryOnePermissions = permsBase & grp.RootPart.EveryoneMask; | ||
915 | item.GroupPermissions = permsBase & grp.RootPart.GroupMask; | ||
916 | item.CurrentPermissions &= | ||
917 | ((uint)PermissionMask.Copy | | ||
918 | (uint)PermissionMask.Transfer | | ||
919 | (uint)PermissionMask.Modify | | ||
920 | (uint)PermissionMask.Move | | ||
921 | (uint)PermissionMask.Export | | ||
922 | (uint)PermissionMask.FoldedMask); // Preserve folded permissions ?? | ||
923 | |||
899 | AssetBase asset = m_scene.CreateAsset( | 924 | AssetBase asset = m_scene.CreateAsset( |
900 | grp.GetPartName(grp.LocalId), | 925 | grp.GetPartName(grp.LocalId), |
901 | grp.GetPartDescription(grp.LocalId), | 926 | grp.GetPartDescription(grp.LocalId), |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 91f19e3..772485c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -247,11 +247,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
247 | { | 247 | { |
248 | FriendInfo[] friends = GetFriendsFromCache(principalID); | 248 | FriendInfo[] friends = GetFriendsFromCache(principalID); |
249 | FriendInfo finfo = GetFriend(friends, friendID); | 249 | FriendInfo finfo = GetFriend(friends, friendID); |
250 | if (finfo != null) | 250 | if (finfo != null && finfo.TheirFlags != -1) |
251 | { | 251 | { |
252 | return finfo.TheirFlags; | 252 | return finfo.TheirFlags; |
253 | } | 253 | } |
254 | |||
255 | return 0; | 254 | return 0; |
256 | } | 255 | } |
257 | 256 | ||
@@ -756,7 +755,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
756 | if (friend == null) | 755 | if (friend == null) |
757 | return; | 756 | return; |
758 | 757 | ||
759 | if((friend.TheirFlags & (int)FriendRights.CanSeeOnMap) == 0) | 758 | if(friend.TheirFlags == -1 || (friend.TheirFlags & (int)FriendRights.CanSeeOnMap) == 0) |
760 | return; | 759 | return; |
761 | 760 | ||
762 | Scene hunterScene = (Scene)remoteClient.Scene; | 761 | Scene hunterScene = (Scene)remoteClient.Scene; |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index 82154bc..fae1e05 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs | |||
@@ -214,7 +214,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
214 | FriendInfo[] friends = GetFriendsFromCache(client.AgentId); | 214 | FriendInfo[] friends = GetFriendsFromCache(client.AgentId); |
215 | foreach (FriendInfo f in friends) | 215 | foreach (FriendInfo f in friends) |
216 | { | 216 | { |
217 | client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, f.TheirFlags); | 217 | int rights = f.TheirFlags; |
218 | if(rights != -1 ) | ||
219 | client.SendChangeUserRights(new UUID(f.Friend), client.AgentId, rights); | ||
218 | } | 220 | } |
219 | } | 221 | } |
220 | } | 222 | } |
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs index 3be5a07..490809e 100644 --- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs | |||
@@ -124,15 +124,6 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden | |||
124 | "Without the 'full' option, only root agents are shown." | 124 | "Without the 'full' option, only root agents are shown." |
125 | + " With the 'full' option child agents are also shown.", | 125 | + " With the 'full' option child agents are also shown.", |
126 | (mod, cmd) => MainConsole.Instance.Output(GetThrottlesReport(cmd))); | 126 | (mod, cmd) => MainConsole.Instance.Output(GetThrottlesReport(cmd))); |
127 | |||
128 | scene.AddCommand( | ||
129 | "Comms", this, "show client stats", | ||
130 | "show client stats [first_name last_name]", | ||
131 | "Show client request stats", | ||
132 | "Without the 'first_name last_name' option, all clients are shown." | ||
133 | + " With the 'first_name last_name' option only a specific client is shown.", | ||
134 | (mod, cmd) => MainConsole.Instance.Output(HandleClientStatsReport(cmd))); | ||
135 | |||
136 | } | 127 | } |
137 | 128 | ||
138 | public void RemoveRegion(Scene scene) | 129 | public void RemoveRegion(Scene scene) |
@@ -540,107 +531,6 @@ namespace OpenSim.Region.OptionalModules.UDP.Linden | |||
540 | return report.ToString(); | 531 | return report.ToString(); |
541 | } | 532 | } |
542 | 533 | ||
543 | /// <summary> | ||
544 | /// Show client stats data | ||
545 | /// </summary> | ||
546 | /// <param name="showParams"></param> | ||
547 | /// <returns></returns> | ||
548 | protected string HandleClientStatsReport(string[] showParams) | ||
549 | { | ||
550 | // NOTE: This writes to m_log on purpose. We want to store this information | ||
551 | // in case we need to analyze it later. | ||
552 | // | ||
553 | if (showParams.Length <= 4) | ||
554 | { | ||
555 | m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", "Region", "Name", "Root", "Time", "Reqs/min", "AgentUpdates"); | ||
556 | foreach (Scene scene in m_scenes.Values) | ||
557 | { | ||
558 | scene.ForEachClient( | ||
559 | delegate(IClientAPI client) | ||
560 | { | ||
561 | if (client is LLClientView) | ||
562 | { | ||
563 | LLClientView llClient = client as LLClientView; | ||
564 | ClientInfo cinfo = llClient.UDPClient.GetClientInfo(); | ||
565 | int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); | ||
566 | avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); | ||
567 | |||
568 | string childAgentStatus; | ||
569 | |||
570 | if (llClient.SceneAgent != null) | ||
571 | childAgentStatus = llClient.SceneAgent.IsChildAgent ? "N" : "Y"; | ||
572 | else | ||
573 | childAgentStatus = "Off!"; | ||
574 | |||
575 | m_log.InfoFormat("[INFO]: {0,-12} {1,-20} {2,-6} {3,-11} {4,-11} {5,-16}", | ||
576 | scene.RegionInfo.RegionName, llClient.Name, | ||
577 | childAgentStatus, | ||
578 | (DateTime.Now - cinfo.StartedTime).Minutes, | ||
579 | avg_reqs, | ||
580 | string.Format( | ||
581 | "{0} ({1:0.00}%)", | ||
582 | llClient.TotalAgentUpdates, | ||
583 | cinfo.SyncRequests.ContainsKey("AgentUpdate") | ||
584 | ? (float)cinfo.SyncRequests["AgentUpdate"] / llClient.TotalAgentUpdates * 100 | ||
585 | : 0)); | ||
586 | } | ||
587 | }); | ||
588 | } | ||
589 | return string.Empty; | ||
590 | } | ||
591 | |||
592 | string fname = "", lname = ""; | ||
593 | |||
594 | if (showParams.Length > 3) | ||
595 | fname = showParams[3]; | ||
596 | if (showParams.Length > 4) | ||
597 | lname = showParams[4]; | ||
598 | |||
599 | foreach (Scene scene in m_scenes.Values) | ||
600 | { | ||
601 | scene.ForEachClient( | ||
602 | delegate(IClientAPI client) | ||
603 | { | ||
604 | if (client is LLClientView) | ||
605 | { | ||
606 | LLClientView llClient = client as LLClientView; | ||
607 | |||
608 | if (llClient.Name == fname + " " + lname) | ||
609 | { | ||
610 | |||
611 | ClientInfo cinfo = llClient.GetClientInfo(); | ||
612 | AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(llClient.CircuitCode); | ||
613 | if (aCircuit == null) // create a dummy one | ||
614 | aCircuit = new AgentCircuitData(); | ||
615 | |||
616 | if (!llClient.SceneAgent.IsChildAgent) | ||
617 | m_log.InfoFormat("[INFO]: {0} # {1} # {2}", llClient.Name, Util.GetViewerName(aCircuit), aCircuit.Id0); | ||
618 | |||
619 | int avg_reqs = cinfo.AsyncRequests.Values.Sum() + cinfo.GenericRequests.Values.Sum() + cinfo.SyncRequests.Values.Sum(); | ||
620 | avg_reqs = avg_reqs / ((DateTime.Now - cinfo.StartedTime).Minutes + 1); | ||
621 | |||
622 | m_log.InfoFormat("[INFO]:"); | ||
623 | m_log.InfoFormat("[INFO]: {0} # {1} # Time: {2}min # Avg Reqs/min: {3}", scene.RegionInfo.RegionName, | ||
624 | (llClient.SceneAgent.IsChildAgent ? "Child" : "Root"), (DateTime.Now - cinfo.StartedTime).Minutes, avg_reqs); | ||
625 | |||
626 | Dictionary<string, int> sortedDict = (from entry in cinfo.AsyncRequests orderby entry.Value descending select entry) | ||
627 | .ToDictionary(pair => pair.Key, pair => pair.Value); | ||
628 | PrintRequests("TOP ASYNC", sortedDict, cinfo.AsyncRequests.Values.Sum()); | ||
629 | |||
630 | sortedDict = (from entry in cinfo.SyncRequests orderby entry.Value descending select entry) | ||
631 | .ToDictionary(pair => pair.Key, pair => pair.Value); | ||
632 | PrintRequests("TOP SYNC", sortedDict, cinfo.SyncRequests.Values.Sum()); | ||
633 | |||
634 | sortedDict = (from entry in cinfo.GenericRequests orderby entry.Value descending select entry) | ||
635 | .ToDictionary(pair => pair.Key, pair => pair.Value); | ||
636 | PrintRequests("TOP GENERIC", sortedDict, cinfo.GenericRequests.Values.Sum()); | ||
637 | } | ||
638 | } | ||
639 | }); | ||
640 | } | ||
641 | return string.Empty; | ||
642 | } | ||
643 | |||
644 | private void PrintRequests(string type, Dictionary<string, int> sortedDict, int sum) | 534 | private void PrintRequests(string type, Dictionary<string, int> sortedDict, int sum) |
645 | { | 535 | { |
646 | m_log.InfoFormat("[INFO]:"); | 536 | m_log.InfoFormat("[INFO]:"); |