diff options
Diffstat (limited to 'OpenSim/Region/OptionalModules')
14 files changed, 699 insertions, 135 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 0ac56fa..dd72cfb 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -670,6 +670,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
670 | public event ObjectDrop OnObjectDrop; | 670 | public event ObjectDrop OnObjectDrop; |
671 | public event StartAnim OnStartAnim; | 671 | public event StartAnim OnStartAnim; |
672 | public event StopAnim OnStopAnim; | 672 | public event StopAnim OnStopAnim; |
673 | public event ChangeAnim OnChangeAnim; | ||
673 | public event LinkObjects OnLinkObjects; | 674 | public event LinkObjects OnLinkObjects; |
674 | public event DelinkObjects OnDelinkObjects; | 675 | public event DelinkObjects OnDelinkObjects; |
675 | public event RequestMapBlocks OnRequestMapBlocks; | 676 | public event RequestMapBlocks OnRequestMapBlocks; |
@@ -715,6 +716,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
715 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; | 716 | public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; |
716 | public event UpdatePrimFlags OnUpdatePrimFlags; | 717 | public event UpdatePrimFlags OnUpdatePrimFlags; |
717 | public event UpdatePrimTexture OnUpdatePrimTexture; | 718 | public event UpdatePrimTexture OnUpdatePrimTexture; |
719 | public event ClientChangeObject onClientChangeObject; | ||
718 | public event UpdateVector OnUpdatePrimGroupPosition; | 720 | public event UpdateVector OnUpdatePrimGroupPosition; |
719 | public event UpdateVector OnUpdatePrimSinglePosition; | 721 | public event UpdateVector OnUpdatePrimSinglePosition; |
720 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; | 722 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; |
@@ -819,6 +821,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
819 | public event ObjectOwner OnObjectOwner; | 821 | public event ObjectOwner OnObjectOwner; |
820 | public event DirPlacesQuery OnDirPlacesQuery; | 822 | public event DirPlacesQuery OnDirPlacesQuery; |
821 | public event DirFindQuery OnDirFindQuery; | 823 | public event DirFindQuery OnDirFindQuery; |
824 | public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; | ||
822 | public event DirLandQuery OnDirLandQuery; | 825 | public event DirLandQuery OnDirLandQuery; |
823 | public event DirPopularQuery OnDirPopularQuery; | 826 | public event DirPopularQuery OnDirPopularQuery; |
824 | public event DirClassifiedQuery OnDirClassifiedQuery; | 827 | public event DirClassifiedQuery OnDirClassifiedQuery; |
@@ -835,7 +838,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
835 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; | 838 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; |
836 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; | 839 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; |
837 | public event ClassifiedDelete OnClassifiedDelete; | 840 | public event ClassifiedDelete OnClassifiedDelete; |
838 | public event ClassifiedDelete OnClassifiedGodDelete; | 841 | public event ClassifiedGodDelete OnClassifiedGodDelete; |
839 | public event EventNotificationAddRequest OnEventNotificationAddRequest; | 842 | public event EventNotificationAddRequest OnEventNotificationAddRequest; |
840 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; | 843 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; |
841 | public event EventGodDelete OnEventGodDelete; | 844 | public event EventGodDelete OnEventGodDelete; |
@@ -865,10 +868,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
865 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 868 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
866 | public event SimWideDeletesDelegate OnSimWideDeletes; | 869 | public event SimWideDeletesDelegate OnSimWideDeletes; |
867 | public event SendPostcard OnSendPostcard; | 870 | public event SendPostcard OnSendPostcard; |
871 | public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; | ||
868 | public event MuteListEntryUpdate OnUpdateMuteListEntry; | 872 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
869 | public event MuteListEntryRemove OnRemoveMuteListEntry; | 873 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
870 | public event GodlikeMessage onGodlikeMessage; | 874 | public event GodlikeMessage onGodlikeMessage; |
871 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; | 875 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
876 | public event GenericCall2 OnUpdateThrottles; | ||
872 | 877 | ||
873 | #pragma warning restore 67 | 878 | #pragma warning restore 67 |
874 | 879 | ||
@@ -886,10 +891,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
886 | 891 | ||
887 | public void Close() | 892 | public void Close() |
888 | { | 893 | { |
889 | Close(false); | 894 | Close(true, false); |
890 | } | 895 | } |
891 | 896 | ||
892 | public void Close(bool force) | 897 | public void Close(bool sendStop, bool force) |
893 | { | 898 | { |
894 | Disconnect(); | 899 | Disconnect(); |
895 | } | 900 | } |
@@ -906,7 +911,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
906 | // Mimicking LLClientView which gets always set appearance from client. | 911 | // Mimicking LLClientView which gets always set appearance from client. |
907 | AvatarAppearance appearance; | 912 | AvatarAppearance appearance; |
908 | m_scene.GetAvatarAppearance(this, out appearance); | 913 | m_scene.GetAvatarAppearance(this, out appearance); |
909 | OnSetAppearance(this, appearance.Texture, (byte[])appearance.VisualParams.Clone()); | 914 | OnSetAppearance(this, appearance.Texture, (byte[])appearance.VisualParams.Clone(),appearance.AvatarSize, new WearableCacheItem[0]); |
910 | } | 915 | } |
911 | 916 | ||
912 | public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) | 917 | public void SendRegionHandshake(RegionInfo regionInfo, RegionHandshakeArgs args) |
@@ -971,12 +976,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
971 | // TODO | 976 | // TODO |
972 | } | 977 | } |
973 | 978 | ||
974 | public void SendGenericMessage(string method, List<string> message) | 979 | public void SendGenericMessage(string method, UUID invoice, List<string> message) |
975 | { | 980 | { |
976 | 981 | ||
977 | } | 982 | } |
978 | 983 | ||
979 | public void SendGenericMessage(string method, List<byte[]> message) | 984 | public void SendGenericMessage(string method, UUID invoice, List<byte[]> message) |
980 | { | 985 | { |
981 | 986 | ||
982 | } | 987 | } |
@@ -1050,7 +1055,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1050 | { | 1055 | { |
1051 | } | 1056 | } |
1052 | 1057 | ||
1053 | public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) | 1058 | public void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) |
1054 | { | 1059 | { |
1055 | 1060 | ||
1056 | } | 1061 | } |
@@ -1097,7 +1102,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1097 | 1102 | ||
1098 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId) | 1103 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId) |
1099 | { | 1104 | { |
1100 | 1105 | ||
1106 | } | ||
1107 | |||
1108 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId) | ||
1109 | { | ||
1110 | |||
1101 | } | 1111 | } |
1102 | 1112 | ||
1103 | public void SendRemoveInventoryItem(UUID itemID) | 1113 | public void SendRemoveInventoryItem(UUID itemID) |
@@ -1120,7 +1130,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1120 | 1130 | ||
1121 | } | 1131 | } |
1122 | 1132 | ||
1123 | public void SendXferPacket(ulong xferID, uint packet, byte[] data) | 1133 | public void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) |
1124 | { | 1134 | { |
1125 | 1135 | ||
1126 | } | 1136 | } |
@@ -1190,11 +1200,6 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1190 | 1200 | ||
1191 | } | 1201 | } |
1192 | 1202 | ||
1193 | public bool AddMoney(int debit) | ||
1194 | { | ||
1195 | return true; | ||
1196 | } | ||
1197 | |||
1198 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) | 1203 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition) |
1199 | { | 1204 | { |
1200 | 1205 | ||
@@ -1419,6 +1424,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1419 | 1424 | ||
1420 | } | 1425 | } |
1421 | 1426 | ||
1427 | public void SetAgentThrottleSilent(int throttle, int setting) | ||
1428 | { | ||
1429 | |||
1430 | |||
1431 | } | ||
1422 | public byte[] GetThrottlesPacked(float multiplier) | 1432 | public byte[] GetThrottlesPacked(float multiplier) |
1423 | { | 1433 | { |
1424 | return new byte[0]; | 1434 | return new byte[0]; |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs index 535bf67..d56e39d 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs | |||
@@ -184,7 +184,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments | |||
184 | hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); | 184 | hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); |
185 | } | 185 | } |
186 | 186 | ||
187 | return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, true) ? 1 : 0; | 187 | return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, true, true) ? 1 : 0; |
188 | } | 188 | } |
189 | } | 189 | } |
190 | } | 190 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs index 4e84364..026ceca 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs | |||
@@ -107,7 +107,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends | |||
107 | m_scene.AddCommand( | 107 | m_scene.AddCommand( |
108 | "Friends", this, "friends show", | 108 | "Friends", this, "friends show", |
109 | "friends show [--cache] <first-name> <last-name>", | 109 | "friends show [--cache] <first-name> <last-name>", |
110 | "Show the friends for the given user if they exist.\n", | 110 | "Show the friends for the given user if they exist.", |
111 | "The --cache option will show locally cached information for that user.", | 111 | "The --cache option will show locally cached information for that user.", |
112 | HandleFriendsShowCommand); | 112 | HandleFriendsShowCommand); |
113 | } | 113 | } |
@@ -197,4 +197,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends | |||
197 | } | 197 | } |
198 | } | 198 | } |
199 | } | 199 | } |
200 | } \ No newline at end of file | 200 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index ef1b92e..0cec959 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | |||
@@ -575,7 +575,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
575 | 575 | ||
576 | public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request) | 576 | public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request) |
577 | { | 577 | { |
578 | m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceGetPreloginHTTPHandler called"); | 578 | // m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called"); |
579 | 579 | ||
580 | Hashtable response = new Hashtable(); | 580 | Hashtable response = new Hashtable(); |
581 | response["content_type"] = "text/xml"; | 581 | response["content_type"] = "text/xml"; |
@@ -726,7 +726,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice | |||
726 | 726 | ||
727 | public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request) | 727 | public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request) |
728 | { | 728 | { |
729 | m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceSigninHTTPHandler called"); | 729 | //m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceSigninHTTPHandler called"); |
730 | // string requestbody = (string)request["body"]; | 730 | // string requestbody = (string)request["body"]; |
731 | // string uri = (string)request["uri"]; | 731 | // string uri = (string)request["uri"]; |
732 | // string contenttype = (string)request["content-type"]; | 732 | // string contenttype = (string)request["content-type"]; |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index cb69411..9e6cc1a 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | |||
@@ -192,7 +192,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
192 | break; | 192 | break; |
193 | } | 193 | } |
194 | 194 | ||
195 | m_vivoxVoiceAccountApi = String.Format("http://{0}/api2", m_vivoxServer); | 195 | m_vivoxVoiceAccountApi = String.Format("https://{0}/api2", m_vivoxServer); |
196 | 196 | ||
197 | // Admin interface required values | 197 | // Admin interface required values |
198 | if (String.IsNullOrEmpty(m_vivoxServer) || | 198 | if (String.IsNullOrEmpty(m_vivoxServer) || |
@@ -471,8 +471,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
471 | avatarName = avatar.Name; | 471 | avatarName = avatar.Name; |
472 | 472 | ||
473 | m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: scene = {0}, agentID = {1}", scene, agentID); | 473 | m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: scene = {0}, agentID = {1}", scene, agentID); |
474 | m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", | 474 | // m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", |
475 | request, path, param); | 475 | // request, path, param); |
476 | 476 | ||
477 | XmlElement resp; | 477 | XmlElement resp; |
478 | bool retry = false; | 478 | bool retry = false; |
@@ -579,7 +579,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
579 | 579 | ||
580 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); | 580 | string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); |
581 | 581 | ||
582 | m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: avatar \"{0}\": {1}", avatarName, r); | 582 | // m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: avatar \"{0}\": {1}", avatarName, r); |
583 | 583 | ||
584 | return r; | 584 | return r; |
585 | } | 585 | } |
@@ -627,23 +627,23 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
627 | // voice channel | 627 | // voice channel |
628 | LandData land = scene.GetLandData(avatar.AbsolutePosition); | 628 | LandData land = scene.GetLandData(avatar.AbsolutePosition); |
629 | 629 | ||
630 | m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", | 630 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", |
631 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); | 631 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); |
632 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: avatar \"{0}\": location: {1} {2} {3}", | 632 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: avatar \"{0}\": location: {1} {2} {3}", |
633 | // avatarName, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); | 633 | // avatarName, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); |
634 | 634 | ||
635 | // TODO: EstateSettings don't seem to get propagated... | 635 | // TODO: EstateSettings don't seem to get propagated... |
636 | if (!scene.RegionInfo.EstateSettings.AllowVoice) | 636 | if (!scene.RegionInfo.EstateSettings.AllowVoice) |
637 | { | 637 | { |
638 | m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": voice not enabled in estate settings", | 638 | //m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": voice not enabled in estate settings", |
639 | scene.RegionInfo.RegionName); | 639 | // scene.RegionInfo.RegionName); |
640 | channel_uri = String.Empty; | 640 | channel_uri = String.Empty; |
641 | } | 641 | } |
642 | 642 | ||
643 | if ((land.Flags & (uint)ParcelFlags.AllowVoiceChat) == 0) | 643 | if ((land.Flags & (uint)ParcelFlags.AllowVoiceChat) == 0) |
644 | { | 644 | { |
645 | m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": voice not enabled for parcel", | 645 | //m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": voice not enabled for parcel", |
646 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName); | 646 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName); |
647 | channel_uri = String.Empty; | 647 | channel_uri = String.Empty; |
648 | } | 648 | } |
649 | else | 649 | else |
@@ -658,8 +658,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
658 | parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); | 658 | parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); |
659 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); | 659 | string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); |
660 | 660 | ||
661 | m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", | 661 | // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", |
662 | scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); | 662 | // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); |
663 | return r; | 663 | return r; |
664 | } | 664 | } |
665 | catch (Exception e) | 665 | catch (Exception e) |
@@ -686,11 +686,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
686 | public string ChatSessionRequest(Scene scene, string request, string path, string param, | 686 | public string ChatSessionRequest(Scene scene, string request, string path, string param, |
687 | UUID agentID, Caps caps) | 687 | UUID agentID, Caps caps) |
688 | { | 688 | { |
689 | ScenePresence avatar = scene.GetScenePresence(agentID); | 689 | // ScenePresence avatar = scene.GetScenePresence(agentID); |
690 | string avatarName = avatar.Name; | 690 | // string avatarName = avatar.Name; |
691 | 691 | ||
692 | m_log.DebugFormat("[VivoxVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", | 692 | // m_log.DebugFormat("[VivoxVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", |
693 | avatarName, request, path, param); | 693 | // avatarName, request, path, param); |
694 | return "<llsd>true</llsd>"; | 694 | return "<llsd>true</llsd>"; |
695 | } | 695 | } |
696 | 696 | ||
@@ -740,7 +740,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
740 | return channelUri; | 740 | return channelUri; |
741 | } | 741 | } |
742 | 742 | ||
743 | private static readonly string m_vivoxLoginPath = "http://{0}/api2/viv_signin.php?userid={1}&pwd={2}"; | 743 | |
744 | private static readonly string m_vivoxLoginPath = "https://{0}/api2/viv_signin.php?userid={1}&pwd={2}"; | ||
744 | 745 | ||
745 | /// <summary> | 746 | /// <summary> |
746 | /// Perform administrative login for Vivox. | 747 | /// Perform administrative login for Vivox. |
@@ -752,7 +753,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
752 | return VivoxCall(requrl, false); | 753 | return VivoxCall(requrl, false); |
753 | } | 754 | } |
754 | 755 | ||
755 | private static readonly string m_vivoxLogoutPath = "http://{0}/api2/viv_signout.php?auth_token={1}"; | 756 | private static readonly string m_vivoxLogoutPath = "https://{0}/api2/viv_signout.php?auth_token={1}"; |
756 | 757 | ||
757 | /// <summary> | 758 | /// <summary> |
758 | /// Perform administrative logout for Vivox. | 759 | /// Perform administrative logout for Vivox. |
@@ -763,7 +764,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
763 | return VivoxCall(requrl, false); | 764 | return VivoxCall(requrl, false); |
764 | } | 765 | } |
765 | 766 | ||
766 | private static readonly string m_vivoxGetAccountPath = "http://{0}/api2/viv_get_acct.php?auth_token={1}&user_name={2}"; | 767 | |
768 | private static readonly string m_vivoxGetAccountPath = "https://{0}/api2/viv_get_acct.php?auth_token={1}&user_name={2}"; | ||
767 | 769 | ||
768 | /// <summary> | 770 | /// <summary> |
769 | /// Retrieve account information for the specified user. | 771 | /// Retrieve account information for the specified user. |
@@ -775,7 +777,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
775 | return VivoxCall(requrl, true); | 777 | return VivoxCall(requrl, true); |
776 | } | 778 | } |
777 | 779 | ||
778 | private static readonly string m_vivoxNewAccountPath = "http://{0}/api2/viv_adm_acct_new.php?username={1}&pwd={2}&auth_token={3}"; | 780 | |
781 | private static readonly string m_vivoxNewAccountPath = "https://{0}/api2/viv_adm_acct_new.php?username={1}&pwd={2}&auth_token={3}"; | ||
779 | 782 | ||
780 | /// <summary> | 783 | /// <summary> |
781 | /// Creates a new account. | 784 | /// Creates a new account. |
@@ -789,7 +792,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
789 | return VivoxCall(requrl, true); | 792 | return VivoxCall(requrl, true); |
790 | } | 793 | } |
791 | 794 | ||
792 | private static readonly string m_vivoxPasswordPath = "http://{0}/api2/viv_adm_password.php?user_name={1}&new_pwd={2}&auth_token={3}"; | 795 | |
796 | private static readonly string m_vivoxPasswordPath = "https://{0}/api2/viv_adm_password.php?user_name={1}&new_pwd={2}&auth_token={3}"; | ||
793 | 797 | ||
794 | /// <summary> | 798 | /// <summary> |
795 | /// Change the user's password. | 799 | /// Change the user's password. |
@@ -800,7 +804,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
800 | return VivoxCall(requrl, true); | 804 | return VivoxCall(requrl, true); |
801 | } | 805 | } |
802 | 806 | ||
803 | private static readonly string m_vivoxChannelPath = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_name={2}&auth_token={3}"; | 807 | |
808 | private static readonly string m_vivoxChannelPath = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_name={2}&auth_token={3}"; | ||
804 | 809 | ||
805 | /// <summary> | 810 | /// <summary> |
806 | /// Create a channel. | 811 | /// Create a channel. |
@@ -872,7 +877,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
872 | return false; | 877 | return false; |
873 | } | 878 | } |
874 | 879 | ||
875 | private static readonly string m_vivoxChannelSearchPath = "http://{0}/api2/viv_chan_search.php?cond_channame={1}&auth_token={2}"; | 880 | private static readonly string m_vivoxChannelSearchPath = "https://{0}/api2/viv_chan_search.php?cond_channame={1}&auth_token={2}"; |
876 | 881 | ||
877 | /// <summary> | 882 | /// <summary> |
878 | /// Retrieve a channel. | 883 | /// Retrieve a channel. |
@@ -1015,7 +1020,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1015 | return false; | 1020 | return false; |
1016 | } | 1021 | } |
1017 | 1022 | ||
1018 | // private static readonly string m_vivoxChannelById = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; | 1023 | // private static readonly string m_vivoxChannelById = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; |
1019 | 1024 | ||
1020 | // private XmlElement VivoxGetChannelById(string parent, string channelid) | 1025 | // private XmlElement VivoxGetChannelById(string parent, string channelid) |
1021 | // { | 1026 | // { |
@@ -1027,7 +1032,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1027 | // return VivoxCall(requrl, true); | 1032 | // return VivoxCall(requrl, true); |
1028 | // } | 1033 | // } |
1029 | 1034 | ||
1030 | private static readonly string m_vivoxChannelDel = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; | 1035 | private static readonly string m_vivoxChannelDel = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; |
1031 | 1036 | ||
1032 | /// <summary> | 1037 | /// <summary> |
1033 | /// Delete a channel. | 1038 | /// Delete a channel. |
@@ -1040,6 +1045,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1040 | /// are required in a later phase. | 1045 | /// are required in a later phase. |
1041 | /// In this case the call handles parent and description as optional values. | 1046 | /// In this case the call handles parent and description as optional values. |
1042 | /// </summary> | 1047 | /// </summary> |
1048 | |||
1043 | private XmlElement VivoxDeleteChannel(string parent, string channelid) | 1049 | private XmlElement VivoxDeleteChannel(string parent, string channelid) |
1044 | { | 1050 | { |
1045 | string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); | 1051 | string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); |
@@ -1050,11 +1056,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1050 | return VivoxCall(requrl, true); | 1056 | return VivoxCall(requrl, true); |
1051 | } | 1057 | } |
1052 | 1058 | ||
1053 | private static readonly string m_vivoxChannelSearch = "http://{0}/api2/viv_chan_search.php?&cond_chanparent={1}&auth_token={2}"; | 1059 | private static readonly string m_vivoxChannelSearch = "https://{0}/api2/viv_chan_search.php?&cond_chanparent={1}&auth_token={2}"; |
1054 | 1060 | ||
1055 | /// <summary> | 1061 | /// <summary> |
1056 | /// Return information on channels in the given directory | 1062 | /// Return information on channels in the given directory |
1057 | /// </summary> | 1063 | /// </summary> |
1064 | |||
1058 | private XmlElement VivoxListChildren(string channelid) | 1065 | private XmlElement VivoxListChildren(string channelid) |
1059 | { | 1066 | { |
1060 | string requrl = String.Format(m_vivoxChannelSearch, m_vivoxServer, channelid, m_authToken); | 1067 | string requrl = String.Format(m_vivoxChannelSearch, m_vivoxServer, channelid, m_authToken); |
@@ -1114,7 +1121,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1114 | try | 1121 | try |
1115 | { | 1122 | { |
1116 | // Otherwise prepare the request | 1123 | // Otherwise prepare the request |
1117 | m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); | 1124 | // m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); |
1118 | 1125 | ||
1119 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); | 1126 | HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); |
1120 | 1127 | ||
@@ -1314,4 +1321,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice | |||
1314 | return false; | 1321 | return false; |
1315 | } | 1322 | } |
1316 | } | 1323 | } |
1317 | } \ No newline at end of file | 1324 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 29f9591..d0a5989 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs | |||
@@ -764,7 +764,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
764 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient funds to create a group."); | 764 | remoteClient.SendCreateGroupReply(UUID.Zero, false, "You have got insufficient funds to create a group."); |
765 | return UUID.Zero; | 765 | return UUID.Zero; |
766 | } | 766 | } |
767 | money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, "Group Creation"); | 767 | money.ApplyCharge(GetRequestingAgentID(remoteClient), money.GroupCreationCharge, MoneyTransactionType.GroupCreate); |
768 | } | 768 | } |
769 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); | 769 | UUID groupID = m_groupData.CreateGroup(GetRequestingAgentID(remoteClient), name, charter, showInList, insigniaID, membershipFee, openEnrollment, allowPublish, maturePublish, GetRequestingAgentID(remoteClient)); |
770 | 770 | ||
@@ -921,7 +921,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups | |||
921 | msg.dialog = dialog; | 921 | msg.dialog = dialog; |
922 | // msg.dialog = (byte)OpenMetaverse.InstantMessageDialog.GroupNotice; | 922 | // msg.dialog = (byte)OpenMetaverse.InstantMessageDialog.GroupNotice; |
923 | msg.fromGroup = true; | 923 | msg.fromGroup = true; |
924 | msg.offline = (byte)0; | 924 | msg.offline = (byte)1; // Allow this message to be stored for offline use |
925 | msg.ParentEstateID = 0; | 925 | msg.ParentEstateID = 0; |
926 | msg.Position = Vector3.Zero; | 926 | msg.Position = Vector3.Zero; |
927 | msg.RegionID = UUID.Zero.Guid; | 927 | msg.RegionID = UUID.Zero.Guid; |
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs index a6d43f1..a375da9 100644 --- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs +++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs | |||
@@ -122,28 +122,40 @@ namespace OpenSim.Region.OptionalModules | |||
122 | 122 | ||
123 | private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) | 123 | private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) |
124 | { | 124 | { |
125 | if (newPoint.X < -1f || newPoint.X > (float)(Constants.RegionSize + 1) || | ||
126 | newPoint.Y < -1f || newPoint.Y > (float)(Constants.RegionSize + 1)) | ||
127 | return true; | ||
128 | |||
125 | SceneObjectPart obj = scene.GetSceneObjectPart(objectID); | 129 | SceneObjectPart obj = scene.GetSceneObjectPart(objectID); |
126 | Vector3 oldPoint = obj.GroupPosition; | 130 | |
127 | int objectCount = obj.ParentGroup.PrimCount; | 131 | if (obj == null) |
128 | ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); | 132 | return false; |
133 | |||
134 | // Prim counts are determined by the location of the root prim. if we're | ||
135 | // moving a child prim, just let it pass | ||
136 | if (!obj.IsRoot) | ||
137 | { | ||
138 | return true; | ||
139 | } | ||
140 | |||
129 | ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); | 141 | ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); |
130 | 142 | ||
131 | int usedPrims = newParcel.PrimCounts.Total; | 143 | if (newParcel == null) |
132 | int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); | 144 | return true; |
145 | |||
146 | Vector3 oldPoint = obj.GroupPosition; | ||
147 | ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); | ||
133 | 148 | ||
134 | // The prim hasn't crossed a region boundry so we don't need to worry | 149 | // The prim hasn't crossed a region boundry so we don't need to worry |
135 | // about prim counts here | 150 | // about prim counts here |
136 | if(oldParcel.Equals(newParcel)) | 151 | if(oldParcel != null && oldParcel.Equals(newParcel)) |
137 | { | 152 | { |
138 | return true; | 153 | return true; |
139 | } | 154 | } |
140 | 155 | ||
141 | // Prim counts are determined by the location of the root prim. if we're | 156 | int objectCount = obj.ParentGroup.PrimCount; |
142 | // moving a child prim, just let it pass | 157 | int usedPrims = newParcel.PrimCounts.Total; |
143 | if(!obj.IsRoot) | 158 | int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount(); |
144 | { | ||
145 | return true; | ||
146 | } | ||
147 | 159 | ||
148 | // TODO: Add Special Case here for temporary prims | 160 | // TODO: Add Special Case here for temporary prims |
149 | 161 | ||
@@ -172,4 +184,4 @@ namespace OpenSim.Region.OptionalModules | |||
172 | return true; | 184 | return true; |
173 | } | 185 | } |
174 | } | 186 | } |
175 | } \ No newline at end of file | 187 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs index 943675e..32549d6 100644 --- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs | |||
@@ -98,7 +98,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule | |||
98 | 98 | ||
99 | public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) | 99 | public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) |
100 | { | 100 | { |
101 | scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri}); | 101 | if (m_Enabled) |
102 | { | ||
103 | scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] { uri }); | ||
104 | } | ||
102 | } | 105 | } |
103 | 106 | ||
104 | public void UnRegisterReceiver(string channelID, UUID itemID) | 107 | public void UnRegisterReceiver(string channelID, UUID itemID) |
diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs new file mode 100644 index 0000000..e76e8f2 --- /dev/null +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicFloaterModule.cs | |||
@@ -0,0 +1,238 @@ | |||
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.IO; | ||
30 | using System.Reflection; | ||
31 | using System.Text; | ||
32 | using System.Collections.Generic; | ||
33 | using OpenMetaverse; | ||
34 | using OpenMetaverse.StructuredData; | ||
35 | using OpenSim; | ||
36 | using OpenSim.Region; | ||
37 | using OpenSim.Region.Framework; | ||
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | using OpenSim.Region.Framework.Interfaces; | ||
40 | using OpenSim.Framework; | ||
41 | using OpenSim.Framework.Servers; | ||
42 | using OpenSim.Framework.Servers.HttpServer; | ||
43 | using Nini.Config; | ||
44 | using log4net; | ||
45 | using Mono.Addins; | ||
46 | using Caps = OpenSim.Framework.Capabilities.Caps; | ||
47 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | ||
48 | |||
49 | namespace OpenSim.Region.OptionalModules.ViewerSupport | ||
50 | { | ||
51 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DynamicFloater")] | ||
52 | public class DynamicFloaterModule : INonSharedRegionModule, IDynamicFloaterModule | ||
53 | { | ||
54 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
55 | |||
56 | private Scene m_scene; | ||
57 | |||
58 | private Dictionary<UUID, Dictionary<int, FloaterData>> m_floaters = new Dictionary<UUID, Dictionary<int, FloaterData>>(); | ||
59 | |||
60 | public string Name | ||
61 | { | ||
62 | get { return "DynamicFloaterModule"; } | ||
63 | } | ||
64 | |||
65 | public Type ReplaceableInterface | ||
66 | { | ||
67 | get { return null; } | ||
68 | } | ||
69 | |||
70 | public void Initialise(IConfigSource config) | ||
71 | { | ||
72 | } | ||
73 | |||
74 | public void Close() | ||
75 | { | ||
76 | } | ||
77 | |||
78 | public void AddRegion(Scene scene) | ||
79 | { | ||
80 | m_scene = scene; | ||
81 | scene.EventManager.OnNewClient += OnNewClient; | ||
82 | scene.EventManager.OnClientClosed += OnClientClosed; | ||
83 | m_scene.RegisterModuleInterface<IDynamicFloaterModule>(this); | ||
84 | } | ||
85 | |||
86 | public void RegionLoaded(Scene scene) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | public void RemoveRegion(Scene scene) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | private void OnNewClient(IClientAPI client) | ||
95 | { | ||
96 | client.OnChatFromClient += OnChatFromClient; | ||
97 | } | ||
98 | |||
99 | private void OnClientClosed(UUID agentID, Scene scene) | ||
100 | { | ||
101 | m_floaters.Remove(agentID); | ||
102 | } | ||
103 | |||
104 | private void SendToClient(ScenePresence sp, string msg) | ||
105 | { | ||
106 | sp.ControllingClient.SendChatMessage(msg, | ||
107 | (byte)ChatTypeEnum.Owner, | ||
108 | sp.AbsolutePosition, | ||
109 | "Server", | ||
110 | UUID.Zero, | ||
111 | UUID.Zero, | ||
112 | (byte)ChatSourceType.Object, | ||
113 | (byte)ChatAudibleLevel.Fully); | ||
114 | } | ||
115 | |||
116 | public void DoUserFloater(UUID agentID, FloaterData dialogData, string configuration) | ||
117 | { | ||
118 | ScenePresence sp = m_scene.GetScenePresence(agentID); | ||
119 | if (sp == null || sp.IsChildAgent) | ||
120 | return; | ||
121 | |||
122 | if (!m_floaters.ContainsKey(agentID)) | ||
123 | m_floaters[agentID] = new Dictionary<int, FloaterData>(); | ||
124 | |||
125 | if (m_floaters[agentID].ContainsKey(dialogData.Channel)) | ||
126 | return; | ||
127 | |||
128 | m_floaters[agentID].Add(dialogData.Channel, dialogData); | ||
129 | |||
130 | string xml; | ||
131 | if (dialogData.XmlText != null && dialogData.XmlText != String.Empty) | ||
132 | { | ||
133 | xml = dialogData.XmlText; | ||
134 | } | ||
135 | else | ||
136 | { | ||
137 | using (FileStream fs = File.Open(dialogData.XmlName + ".xml", FileMode.Open)) | ||
138 | { | ||
139 | using (StreamReader sr = new StreamReader(fs)) | ||
140 | xml = sr.ReadToEnd().Replace("\n", ""); | ||
141 | } | ||
142 | } | ||
143 | |||
144 | List<string> xparts = new List<string>(); | ||
145 | |||
146 | while (xml.Length > 0) | ||
147 | { | ||
148 | string x = xml; | ||
149 | if (x.Length > 600) | ||
150 | { | ||
151 | x = x.Substring(0, 600); | ||
152 | xml = xml.Substring(600); | ||
153 | } | ||
154 | else | ||
155 | { | ||
156 | xml = String.Empty; | ||
157 | } | ||
158 | |||
159 | xparts.Add(x); | ||
160 | } | ||
161 | |||
162 | for (int i = 0 ; i < xparts.Count ; i++) | ||
163 | SendToClient(sp, String.Format("># floater {2} create {0}/{1} " + xparts[i], i + 1, xparts.Count, dialogData.FloaterName)); | ||
164 | |||
165 | SendToClient(sp, String.Format("># floater {0} {{notify:1}} {{channel: {1}}} {{node:cancel {{notify:1}}}} {{node:ok {{notify:1}}}} {2}", dialogData.FloaterName, (uint)dialogData.Channel, configuration)); | ||
166 | } | ||
167 | |||
168 | private void OnChatFromClient(object sender, OSChatMessage msg) | ||
169 | { | ||
170 | if (msg.Sender == null) | ||
171 | return; | ||
172 | |||
173 | //m_log.DebugFormat("chan {0} msg {1}", msg.Channel, msg.Message); | ||
174 | |||
175 | IClientAPI client = msg.Sender; | ||
176 | |||
177 | if (!m_floaters.ContainsKey(client.AgentId)) | ||
178 | return; | ||
179 | |||
180 | string[] parts = msg.Message.Split(new char[] {':'}); | ||
181 | if (parts.Length == 0) | ||
182 | return; | ||
183 | |||
184 | ScenePresence sp = m_scene.GetScenePresence(client.AgentId); | ||
185 | if (sp == null || sp.IsChildAgent) | ||
186 | return; | ||
187 | |||
188 | Dictionary<int, FloaterData> d = m_floaters[client.AgentId]; | ||
189 | |||
190 | // Work around a viewer bug - VALUE from any | ||
191 | // dialog can appear on this channel and needs to | ||
192 | // be dispatched to ALL open dialogs for the user | ||
193 | if (msg.Channel == 427169570) | ||
194 | { | ||
195 | if (parts[0] == "VALUE") | ||
196 | { | ||
197 | foreach (FloaterData dd in d.Values) | ||
198 | { | ||
199 | if(dd.Handler(client, dd, parts)) | ||
200 | { | ||
201 | m_floaters[client.AgentId].Remove(dd.Channel); | ||
202 | SendToClient(sp, String.Format("># floater {0} destroy", dd.FloaterName)); | ||
203 | break; | ||
204 | } | ||
205 | } | ||
206 | } | ||
207 | return; | ||
208 | } | ||
209 | |||
210 | if (!d.ContainsKey(msg.Channel)) | ||
211 | return; | ||
212 | |||
213 | FloaterData data = d[msg.Channel]; | ||
214 | |||
215 | if (parts[0] == "NOTIFY") | ||
216 | { | ||
217 | if (parts[1] == "cancel" || parts[1] == data.FloaterName) | ||
218 | { | ||
219 | m_floaters[client.AgentId].Remove(data.Channel); | ||
220 | SendToClient(sp, String.Format("># floater {0} destroy", data.FloaterName)); | ||
221 | } | ||
222 | } | ||
223 | |||
224 | if (data.Handler != null && data.Handler(client, data, parts)) | ||
225 | { | ||
226 | m_floaters[client.AgentId].Remove(data.Channel); | ||
227 | SendToClient(sp, String.Format("># floater {0} destroy", data.FloaterName)); | ||
228 | } | ||
229 | } | ||
230 | |||
231 | public void FloaterControl(ScenePresence sp, FloaterData d, string msg) | ||
232 | { | ||
233 | string sendData = String.Format("># floater {0} {1}", d.FloaterName, msg); | ||
234 | SendToClient(sp, sendData); | ||
235 | |||
236 | } | ||
237 | } | ||
238 | } | ||
diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs new file mode 100644 index 0000000..c68fe99 --- /dev/null +++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs | |||
@@ -0,0 +1,285 @@ | |||
1 | // ****************************************************************** | ||
2 | // Copyright (c) 2008, 2009 Melanie Thielker | ||
3 | // | ||
4 | // All rights reserved | ||
5 | // | ||
6 | |||
7 | using System; | ||
8 | using System.IO; | ||
9 | using System.Reflection; | ||
10 | using System.Text; | ||
11 | using System.Collections.Generic; | ||
12 | using OpenMetaverse; | ||
13 | using OpenMetaverse.StructuredData; | ||
14 | using OpenSim; | ||
15 | using OpenSim.Region; | ||
16 | using OpenSim.Region.Framework; | ||
17 | using OpenSim.Region.Framework.Scenes; | ||
18 | using OpenSim.Region.Framework.Interfaces; | ||
19 | using OpenSim.Framework; | ||
20 | //using OpenSim.Framework.Capabilities; | ||
21 | using OpenSim.Framework.Servers; | ||
22 | using OpenSim.Framework.Servers.HttpServer; | ||
23 | using Nini.Config; | ||
24 | using log4net; | ||
25 | using Mono.Addins; | ||
26 | using Caps = OpenSim.Framework.Capabilities.Caps; | ||
27 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | ||
28 | |||
29 | namespace OpenSim.Region.OptionalModules.ViewerSupport | ||
30 | { | ||
31 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DynamicMenu")] | ||
32 | public class DynamicMenuModule : INonSharedRegionModule, IDynamicMenuModule | ||
33 | { | ||
34 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
35 | |||
36 | private class MenuItemData | ||
37 | { | ||
38 | public string Title; | ||
39 | public UUID AgentID; | ||
40 | public InsertLocation Location; | ||
41 | public UserMode Mode; | ||
42 | public CustomMenuHandler Handler; | ||
43 | } | ||
44 | |||
45 | private Dictionary<UUID, List<MenuItemData>> m_menuItems = | ||
46 | new Dictionary<UUID, List<MenuItemData>>(); | ||
47 | |||
48 | private Scene m_scene; | ||
49 | |||
50 | public string Name | ||
51 | { | ||
52 | get { return "DynamicMenuModule"; } | ||
53 | } | ||
54 | |||
55 | public Type ReplaceableInterface | ||
56 | { | ||
57 | get { return null; } | ||
58 | } | ||
59 | |||
60 | public void Initialise(IConfigSource config) | ||
61 | { | ||
62 | } | ||
63 | |||
64 | public void Close() | ||
65 | { | ||
66 | } | ||
67 | |||
68 | public void AddRegion(Scene scene) | ||
69 | { | ||
70 | m_scene = scene; | ||
71 | scene.EventManager.OnRegisterCaps += OnRegisterCaps; | ||
72 | m_scene.RegisterModuleInterface<IDynamicMenuModule>(this); | ||
73 | } | ||
74 | |||
75 | public void RegionLoaded(Scene scene) | ||
76 | { | ||
77 | ISimulatorFeaturesModule featuresModule = m_scene.RequestModuleInterface<ISimulatorFeaturesModule>(); | ||
78 | |||
79 | if (featuresModule != null) | ||
80 | featuresModule.OnSimulatorFeaturesRequest += OnSimulatorFeaturesRequest; | ||
81 | } | ||
82 | |||
83 | public void RemoveRegion(Scene scene) | ||
84 | { | ||
85 | } | ||
86 | |||
87 | private void OnSimulatorFeaturesRequest(UUID agentID, ref OSDMap features) | ||
88 | { | ||
89 | OSD menus = new OSDMap(); | ||
90 | if (features.ContainsKey("menus")) | ||
91 | menus = features["menus"]; | ||
92 | |||
93 | OSDMap agent = new OSDMap(); | ||
94 | OSDMap world = new OSDMap(); | ||
95 | OSDMap tools = new OSDMap(); | ||
96 | OSDMap advanced = new OSDMap(); | ||
97 | OSDMap admin = new OSDMap(); | ||
98 | if (((OSDMap)menus).ContainsKey("agent")) | ||
99 | agent = (OSDMap)((OSDMap)menus)["agent"]; | ||
100 | if (((OSDMap)menus).ContainsKey("world")) | ||
101 | world = (OSDMap)((OSDMap)menus)["world"]; | ||
102 | if (((OSDMap)menus).ContainsKey("tools")) | ||
103 | tools = (OSDMap)((OSDMap)menus)["tools"]; | ||
104 | if (((OSDMap)menus).ContainsKey("advanced")) | ||
105 | advanced = (OSDMap)((OSDMap)menus)["advanced"]; | ||
106 | if (((OSDMap)menus).ContainsKey("admin")) | ||
107 | admin = (OSDMap)((OSDMap)menus)["admin"]; | ||
108 | |||
109 | if (m_menuItems.ContainsKey(UUID.Zero)) | ||
110 | { | ||
111 | foreach (MenuItemData d in m_menuItems[UUID.Zero]) | ||
112 | { | ||
113 | if (!m_scene.Permissions.IsGod(agentID)) | ||
114 | { | ||
115 | if (d.Mode == UserMode.RegionManager && (!m_scene.Permissions.IsAdministrator(agentID))) | ||
116 | continue; | ||
117 | } | ||
118 | |||
119 | OSDMap loc = null; | ||
120 | switch (d.Location) | ||
121 | { | ||
122 | case InsertLocation.Agent: | ||
123 | loc = agent; | ||
124 | break; | ||
125 | case InsertLocation.World: | ||
126 | loc = world; | ||
127 | break; | ||
128 | case InsertLocation.Tools: | ||
129 | loc = tools; | ||
130 | break; | ||
131 | case InsertLocation.Advanced: | ||
132 | loc = advanced; | ||
133 | break; | ||
134 | case InsertLocation.Admin: | ||
135 | loc = admin; | ||
136 | break; | ||
137 | } | ||
138 | |||
139 | if (loc == null) | ||
140 | continue; | ||
141 | |||
142 | loc[d.Title] = OSD.FromString(d.Title); | ||
143 | } | ||
144 | } | ||
145 | |||
146 | if (m_menuItems.ContainsKey(agentID)) | ||
147 | { | ||
148 | foreach (MenuItemData d in m_menuItems[agentID]) | ||
149 | { | ||
150 | if (d.Mode == UserMode.God && (!m_scene.Permissions.IsGod(agentID))) | ||
151 | continue; | ||
152 | |||
153 | OSDMap loc = null; | ||
154 | switch (d.Location) | ||
155 | { | ||
156 | case InsertLocation.Agent: | ||
157 | loc = agent; | ||
158 | break; | ||
159 | case InsertLocation.World: | ||
160 | loc = world; | ||
161 | break; | ||
162 | case InsertLocation.Tools: | ||
163 | loc = tools; | ||
164 | break; | ||
165 | case InsertLocation.Advanced: | ||
166 | loc = advanced; | ||
167 | break; | ||
168 | case InsertLocation.Admin: | ||
169 | loc = admin; | ||
170 | break; | ||
171 | } | ||
172 | |||
173 | if (loc == null) | ||
174 | continue; | ||
175 | |||
176 | loc[d.Title] = OSD.FromString(d.Title); | ||
177 | } | ||
178 | } | ||
179 | |||
180 | |||
181 | ((OSDMap)menus)["agent"] = agent; | ||
182 | ((OSDMap)menus)["world"] = world; | ||
183 | ((OSDMap)menus)["tools"] = tools; | ||
184 | ((OSDMap)menus)["advanced"] = advanced; | ||
185 | ((OSDMap)menus)["admin"] = admin; | ||
186 | |||
187 | features["menus"] = menus; | ||
188 | } | ||
189 | |||
190 | private void OnRegisterCaps(UUID agentID, Caps caps) | ||
191 | { | ||
192 | string capUrl = "/CAPS/" + UUID.Random() + "/"; | ||
193 | |||
194 | capUrl = "/CAPS/" + UUID.Random() + "/"; | ||
195 | caps.RegisterHandler("CustomMenuAction", new MenuActionHandler(capUrl, "CustomMenuAction", agentID, this, m_scene)); | ||
196 | } | ||
197 | |||
198 | internal void HandleMenuSelection(string action, UUID agentID, List<uint> selection) | ||
199 | { | ||
200 | if (m_menuItems.ContainsKey(agentID)) | ||
201 | { | ||
202 | foreach (MenuItemData d in m_menuItems[agentID]) | ||
203 | { | ||
204 | if (d.Title == action) | ||
205 | d.Handler(action, agentID, selection); | ||
206 | } | ||
207 | } | ||
208 | |||
209 | if (m_menuItems.ContainsKey(UUID.Zero)) | ||
210 | { | ||
211 | foreach (MenuItemData d in m_menuItems[UUID.Zero]) | ||
212 | { | ||
213 | if (d.Title == action) | ||
214 | d.Handler(action, agentID, selection); | ||
215 | } | ||
216 | } | ||
217 | } | ||
218 | |||
219 | public void AddMenuItem(string title, InsertLocation location, UserMode mode, CustomMenuHandler handler) | ||
220 | { | ||
221 | AddMenuItem(UUID.Zero, title, location, mode, handler); | ||
222 | } | ||
223 | |||
224 | public void AddMenuItem(UUID agentID, string title, InsertLocation location, UserMode mode, CustomMenuHandler handler) | ||
225 | { | ||
226 | if (!m_menuItems.ContainsKey(agentID)) | ||
227 | m_menuItems[agentID] = new List<MenuItemData>(); | ||
228 | |||
229 | m_menuItems[agentID].Add(new MenuItemData() { Title = title, AgentID = agentID, Location = location, Mode = mode, Handler = handler }); | ||
230 | } | ||
231 | |||
232 | public void RemoveMenuItem(string action) | ||
233 | { | ||
234 | foreach (KeyValuePair<UUID,List< MenuItemData>> kvp in m_menuItems) | ||
235 | { | ||
236 | List<MenuItemData> pendingDeletes = new List<MenuItemData>(); | ||
237 | foreach (MenuItemData d in kvp.Value) | ||
238 | { | ||
239 | if (d.Title == action) | ||
240 | pendingDeletes.Add(d); | ||
241 | } | ||
242 | |||
243 | foreach (MenuItemData d in pendingDeletes) | ||
244 | kvp.Value.Remove(d); | ||
245 | } | ||
246 | } | ||
247 | } | ||
248 | |||
249 | public class MenuActionHandler : BaseStreamHandler | ||
250 | { | ||
251 | private static readonly ILog m_log = | ||
252 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
253 | |||
254 | private UUID m_agentID; | ||
255 | private Scene m_scene; | ||
256 | private DynamicMenuModule m_module; | ||
257 | |||
258 | public MenuActionHandler(string path, string name, UUID agentID, DynamicMenuModule module, Scene scene) | ||
259 | :base("POST", path, name, agentID.ToString()) | ||
260 | { | ||
261 | m_agentID = agentID; | ||
262 | m_scene = scene; | ||
263 | m_module = module; | ||
264 | } | ||
265 | |||
266 | public override byte[] Handle(string path, Stream request, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) | ||
267 | { | ||
268 | StreamReader reader = new StreamReader(request); | ||
269 | string requestBody = reader.ReadToEnd(); | ||
270 | |||
271 | OSD osd = OSDParser.DeserializeLLSDXml(requestBody); | ||
272 | |||
273 | string action = ((OSDMap)osd)["action"].AsString(); | ||
274 | OSDArray selection = (OSDArray)((OSDMap)osd)["selection"]; | ||
275 | List<uint> sel = new List<uint>(); | ||
276 | for (int i = 0 ; i < selection.Count ; i++) | ||
277 | sel.Add(selection[i].AsUInteger()); | ||
278 | |||
279 | Util.FireAndForget(x => { m_module.HandleMenuSelection(action, m_agentID, sel); }); | ||
280 | |||
281 | Encoding encoding = Encoding.UTF8; | ||
282 | return encoding.GetBytes(OSDParser.SerializeLLSDXmlString(new OSD())); | ||
283 | } | ||
284 | } | ||
285 | } | ||
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs index 7bbf500..5d10e93 100644 --- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs +++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs | |||
@@ -191,15 +191,21 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
191 | // Please do not refactor these to be just one method | 191 | // Please do not refactor these to be just one method |
192 | // Existing implementations need the distinction | 192 | // Existing implementations need the distinction |
193 | // | 193 | // |
194 | public void ApplyCharge(UUID agentID, int amount, string text) | 194 | public void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type, string extraData) |
195 | { | 195 | { |
196 | } | 196 | } |
197 | |||
198 | public void ApplyCharge(UUID agentID, int amount, MoneyTransactionType type) | ||
199 | { | ||
200 | } | ||
201 | |||
197 | public void ApplyUploadCharge(UUID agentID, int amount, string text) | 202 | public void ApplyUploadCharge(UUID agentID, int amount, string text) |
198 | { | 203 | { |
199 | } | 204 | } |
200 | 205 | ||
201 | public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount) | 206 | public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount, UUID txn, out string result) |
202 | { | 207 | { |
208 | result = String.Empty; | ||
203 | string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); | 209 | string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); |
204 | 210 | ||
205 | bool give_result = doMoneyTransfer(fromID, toID, amount, 2, description); | 211 | bool give_result = doMoneyTransfer(fromID, toID, amount, 2, description); |
@@ -322,7 +328,7 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
322 | client.SendAlertMessage(e.Message + " "); | 328 | client.SendAlertMessage(e.Message + " "); |
323 | } | 329 | } |
324 | 330 | ||
325 | client.SendMoneyBalance(TransactionID, true, new byte[0], returnfunds); | 331 | client.SendMoneyBalance(TransactionID, true, new byte[0], returnfunds, 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); |
326 | } | 332 | } |
327 | else | 333 | else |
328 | { | 334 | { |
@@ -385,12 +391,12 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
385 | { | 391 | { |
386 | if (sender != null) | 392 | if (sender != null) |
387 | { | 393 | { |
388 | sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID)); | 394 | sender.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(senderID), 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); |
389 | } | 395 | } |
390 | 396 | ||
391 | if (receiver != null) | 397 | if (receiver != null) |
392 | { | 398 | { |
393 | receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID)); | 399 | receiver.SendMoneyBalance(UUID.Random(), transactionresult, Utils.StringToBytes(description), GetFundsForAgentID(receiverID), 0, UUID.Zero, false, UUID.Zero, false, 0, String.Empty); |
394 | } | 400 | } |
395 | } | 401 | } |
396 | } | 402 | } |
@@ -688,19 +694,14 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
688 | /// Event called Economy Data Request handler. | 694 | /// Event called Economy Data Request handler. |
689 | /// </summary> | 695 | /// </summary> |
690 | /// <param name="agentId"></param> | 696 | /// <param name="agentId"></param> |
691 | public void EconomyDataRequestHandler(UUID agentId) | 697 | public void EconomyDataRequestHandler(IClientAPI user) |
692 | { | 698 | { |
693 | IClientAPI user = LocateClientObject(agentId); | 699 | Scene s = LocateSceneClientIn(user.AgentId); |
694 | |||
695 | if (user != null) | ||
696 | { | ||
697 | Scene s = LocateSceneClientIn(user.AgentId); | ||
698 | 700 | ||
699 | user.SendEconomyData(EnergyEfficiency, s.RegionInfo.ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate, | 701 | user.SendEconomyData(EnergyEfficiency, s.RegionInfo.ObjectCapacity, ObjectCount, PriceEnergyUnit, PriceGroupCreate, |
700 | PriceObjectClaim, PriceObjectRent, PriceObjectScaleFactor, PriceParcelClaim, PriceParcelClaimFactor, | 702 | PriceObjectClaim, PriceObjectRent, PriceObjectScaleFactor, PriceParcelClaim, PriceParcelClaimFactor, |
701 | PriceParcelRent, PricePublicObjectDecay, PricePublicObjectDelete, PriceRentLight, PriceUpload, | 703 | PriceParcelRent, PricePublicObjectDecay, PricePublicObjectDelete, PriceRentLight, PriceUpload, |
702 | TeleportMinPrice, TeleportPriceExponent); | 704 | TeleportMinPrice, TeleportPriceExponent); |
703 | } | ||
704 | } | 705 | } |
705 | 706 | ||
706 | private void ValidateLandBuy(Object osender, EventManager.LandBuyArgs e) | 707 | private void ValidateLandBuy(Object osender, EventManager.LandBuyArgs e) |
@@ -840,6 +841,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule | |||
840 | if (module != null) | 841 | if (module != null) |
841 | module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); | 842 | module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); |
842 | } | 843 | } |
844 | |||
845 | public void MoveMoney(UUID fromAgentID, UUID toAgentID, int amount, string text) | ||
846 | { | ||
847 | } | ||
843 | } | 848 | } |
844 | 849 | ||
845 | public enum TransactionType : int | 850 | public enum TransactionType : int |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 6bd27f0..4674489 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
47 | private readonly string m_firstname; | 47 | private readonly string m_firstname; |
48 | private readonly string m_lastname; | 48 | private readonly string m_lastname; |
49 | private readonly Vector3 m_startPos; | 49 | private readonly Vector3 m_startPos; |
50 | private readonly UUID m_uuid = UUID.Random(); | 50 | private UUID m_uuid = UUID.Random(); |
51 | private readonly Scene m_scene; | 51 | private readonly Scene m_scene; |
52 | private readonly UUID m_ownerID; | 52 | private readonly UUID m_ownerID; |
53 | 53 | ||
@@ -221,7 +221,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
221 | #pragma warning disable 67 | 221 | #pragma warning disable 67 |
222 | public event Action<IClientAPI> OnLogout; | 222 | public event Action<IClientAPI> OnLogout; |
223 | public event ObjectPermissions OnObjectPermissions; | 223 | public event ObjectPermissions OnObjectPermissions; |
224 | 224 | public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy; | |
225 | public event MoneyTransferRequest OnMoneyTransferRequest; | 225 | public event MoneyTransferRequest OnMoneyTransferRequest; |
226 | public event ParcelBuy OnParcelBuy; | 226 | public event ParcelBuy OnParcelBuy; |
227 | public event Action<IClientAPI> OnConnectionClosed; | 227 | public event Action<IClientAPI> OnConnectionClosed; |
@@ -241,6 +241,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
241 | public event ObjectDrop OnObjectDrop; | 241 | public event ObjectDrop OnObjectDrop; |
242 | public event StartAnim OnStartAnim; | 242 | public event StartAnim OnStartAnim; |
243 | public event StopAnim OnStopAnim; | 243 | public event StopAnim OnStopAnim; |
244 | public event ChangeAnim OnChangeAnim; | ||
244 | public event LinkObjects OnLinkObjects; | 245 | public event LinkObjects OnLinkObjects; |
245 | public event DelinkObjects OnDelinkObjects; | 246 | public event DelinkObjects OnDelinkObjects; |
246 | public event RequestMapBlocks OnRequestMapBlocks; | 247 | public event RequestMapBlocks OnRequestMapBlocks; |
@@ -290,6 +291,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
290 | public event UpdatePrimTexture OnUpdatePrimTexture; | 291 | public event UpdatePrimTexture OnUpdatePrimTexture; |
291 | public event UpdateVector OnUpdatePrimGroupPosition; | 292 | public event UpdateVector OnUpdatePrimGroupPosition; |
292 | public event UpdateVector OnUpdatePrimSinglePosition; | 293 | public event UpdateVector OnUpdatePrimSinglePosition; |
294 | public event ClientChangeObject onClientChangeObject; | ||
293 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; | 295 | public event UpdatePrimRotation OnUpdatePrimGroupRotation; |
294 | public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; | 296 | public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; |
295 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; | 297 | public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; |
@@ -427,7 +429,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
427 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; | 429 | public event ClassifiedInfoRequest OnClassifiedInfoRequest; |
428 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; | 430 | public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; |
429 | public event ClassifiedDelete OnClassifiedDelete; | 431 | public event ClassifiedDelete OnClassifiedDelete; |
430 | public event ClassifiedDelete OnClassifiedGodDelete; | 432 | public event ClassifiedGodDelete OnClassifiedGodDelete; |
431 | 433 | ||
432 | public event EventNotificationAddRequest OnEventNotificationAddRequest; | 434 | public event EventNotificationAddRequest OnEventNotificationAddRequest; |
433 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; | 435 | public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; |
@@ -466,11 +468,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
466 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 468 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
467 | public event SimWideDeletesDelegate OnSimWideDeletes; | 469 | public event SimWideDeletesDelegate OnSimWideDeletes; |
468 | public event SendPostcard OnSendPostcard; | 470 | public event SendPostcard OnSendPostcard; |
471 | public event ChangeInventoryItemFlags OnChangeInventoryItemFlags; | ||
469 | public event MuteListEntryUpdate OnUpdateMuteListEntry; | 472 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
470 | public event MuteListEntryRemove OnRemoveMuteListEntry; | 473 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
471 | public event GodlikeMessage onGodlikeMessage; | 474 | public event GodlikeMessage onGodlikeMessage; |
472 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; | 475 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
473 | 476 | public event GenericCall2 OnUpdateThrottles; | |
474 | #pragma warning restore 67 | 477 | #pragma warning restore 67 |
475 | 478 | ||
476 | #endregion | 479 | #endregion |
@@ -493,6 +496,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
493 | public virtual UUID AgentId | 496 | public virtual UUID AgentId |
494 | { | 497 | { |
495 | get { return m_uuid; } | 498 | get { return m_uuid; } |
499 | set { m_uuid = value; } | ||
496 | } | 500 | } |
497 | 501 | ||
498 | public UUID SessionId | 502 | public UUID SessionId |
@@ -593,6 +597,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
593 | public virtual void SetChildAgentThrottle(byte[] throttle) | 597 | public virtual void SetChildAgentThrottle(byte[] throttle) |
594 | { | 598 | { |
595 | } | 599 | } |
600 | |||
601 | public void SetAgentThrottleSilent(int throttle, int setting) | ||
602 | { | ||
603 | |||
604 | |||
605 | } | ||
596 | public byte[] GetThrottlesPacked(float multiplier) | 606 | public byte[] GetThrottlesPacked(float multiplier) |
597 | { | 607 | { |
598 | return new byte[0]; | 608 | return new byte[0]; |
@@ -620,12 +630,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
620 | 630 | ||
621 | } | 631 | } |
622 | 632 | ||
623 | public void SendGenericMessage(string method, List<string> message) | 633 | public void SendGenericMessage(string method, UUID invoice, List<string> message) |
624 | { | 634 | { |
625 | 635 | ||
626 | } | 636 | } |
627 | 637 | ||
628 | public void SendGenericMessage(string method, List<byte[]> message) | 638 | public void SendGenericMessage(string method, UUID invoice, List<byte[]> message) |
629 | { | 639 | { |
630 | 640 | ||
631 | } | 641 | } |
@@ -688,7 +698,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
688 | { | 698 | { |
689 | } | 699 | } |
690 | 700 | ||
691 | public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance) | 701 | public virtual void SendMoneyBalance(UUID transaction, bool success, byte[] description, int balance, int transactionType, UUID sourceID, bool sourceIsGroup, UUID destID, bool destIsGroup, int amount, string item) |
692 | { | 702 | { |
693 | } | 703 | } |
694 | 704 | ||
@@ -737,6 +747,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
737 | { | 747 | { |
738 | } | 748 | } |
739 | 749 | ||
750 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId) | ||
751 | { | ||
752 | } | ||
753 | |||
740 | public virtual void SendRemoveInventoryItem(UUID itemID) | 754 | public virtual void SendRemoveInventoryItem(UUID itemID) |
741 | { | 755 | { |
742 | } | 756 | } |
@@ -753,7 +767,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
753 | { | 767 | { |
754 | } | 768 | } |
755 | 769 | ||
756 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) | 770 | public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory) |
757 | { | 771 | { |
758 | } | 772 | } |
759 | public virtual void SendAbortXferPacket(ulong xferID) | 773 | public virtual void SendAbortXferPacket(ulong xferID) |
@@ -860,11 +874,6 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
860 | { | 874 | { |
861 | } | 875 | } |
862 | 876 | ||
863 | public bool AddMoney(int debit) | ||
864 | { | ||
865 | return false; | ||
866 | } | ||
867 | |||
868 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) | 877 | public void SendSunPos(Vector3 sunPos, Vector3 sunVel, ulong time, uint dlen, uint ylen, float phase) |
869 | { | 878 | { |
870 | } | 879 | } |
@@ -903,10 +912,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
903 | 912 | ||
904 | public void Close() | 913 | public void Close() |
905 | { | 914 | { |
906 | Close(false); | 915 | Close(true, false); |
907 | } | 916 | } |
908 | 917 | ||
909 | public void Close(bool force) | 918 | public void Close(bool sendStop, bool force) |
910 | { | 919 | { |
911 | // Remove ourselves from the scene | 920 | // Remove ourselves from the scene |
912 | m_scene.RemoveClient(AgentId, false); | 921 | m_scene.RemoveClient(AgentId, false); |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index 7d46d92..8c9c006 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | |||
@@ -143,10 +143,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
143 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, | 143 | npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, |
144 | int.MaxValue); | 144 | int.MaxValue); |
145 | 145 | ||
146 | m_log.DebugFormat( | 146 | // m_log.DebugFormat( |
147 | "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}", | 147 | // "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}", |
148 | firstname, lastname, npcAvatar.AgentId, owner, | 148 | // firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName); |
149 | senseAsAgent, position, scene.RegionInfo.RegionName); | ||
150 | 149 | ||
151 | AgentCircuitData acd = new AgentCircuitData(); | 150 | AgentCircuitData acd = new AgentCircuitData(); |
152 | acd.AgentID = npcAvatar.AgentId; | 151 | acd.AgentID = npcAvatar.AgentId; |
@@ -169,36 +168,30 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
169 | } | 168 | } |
170 | */ | 169 | */ |
171 | 170 | ||
172 | lock (m_avatars) | 171 | ManualResetEvent ev = new ManualResetEvent(false); |
173 | { | ||
174 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, | ||
175 | acd); | ||
176 | scene.AddNewClient(npcAvatar, PresenceType.Npc); | ||
177 | 172 | ||
178 | ScenePresence sp; | 173 | Util.FireAndForget(delegate(object x) { |
179 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) | 174 | lock (m_avatars) |
180 | { | 175 | { |
181 | /* | 176 | scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd); |
182 | m_log.DebugFormat( | 177 | scene.AddNewClient(npcAvatar, PresenceType.Npc); |
183 | "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}", | ||
184 | sp.Name, sp.UUID); | ||
185 | */ | ||
186 | |||
187 | sp.CompleteMovement(npcAvatar, false); | ||
188 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); | ||
189 | m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", | ||
190 | npcAvatar.AgentId, sp.Name); | ||
191 | 178 | ||
192 | return npcAvatar.AgentId; | 179 | ScenePresence sp; |
193 | } | 180 | if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) |
194 | else | 181 | { |
195 | { | 182 | sp.CompleteMovement(npcAvatar, false); |
196 | m_log.WarnFormat( | 183 | m_avatars.Add(npcAvatar.AgentId, npcAvatar); |
197 | "[NPC MODULE]: Could not find scene presence for NPC {0} {1}", | 184 | // m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name); |
198 | sp.Name, sp.UUID); | 185 | } |
199 | return UUID.Zero; | ||
200 | } | 186 | } |
201 | } | 187 | ev.Set(); |
188 | }); | ||
189 | |||
190 | ev.WaitOne(); | ||
191 | |||
192 | // m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId); | ||
193 | |||
194 | return npcAvatar.AgentId; | ||
202 | } | 195 | } |
203 | 196 | ||
204 | public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, | 197 | public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, |
@@ -211,10 +204,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
211 | ScenePresence sp; | 204 | ScenePresence sp; |
212 | if (scene.TryGetScenePresence(agentID, out sp)) | 205 | if (scene.TryGetScenePresence(agentID, out sp)) |
213 | { | 206 | { |
214 | m_log.DebugFormat( | 207 | // m_log.DebugFormat( |
215 | "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", | 208 | // "[NPC MODULE]: Moving {0} to {1} in {2}, noFly {3}, landAtTarget {4}", |
216 | sp.Name, pos, scene.RegionInfo.RegionName, | 209 | // sp.Name, pos, scene.RegionInfo.RegionName, noFly, landAtTarget); |
217 | noFly, landAtTarget); | ||
218 | 210 | ||
219 | sp.MoveToTarget(pos, noFly, landAtTarget); | 211 | sp.MoveToTarget(pos, noFly, landAtTarget); |
220 | sp.SetAlwaysRun = running; | 212 | sp.SetAlwaysRun = running; |
@@ -385,10 +377,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
385 | */ | 377 | */ |
386 | scene.RemoveClient(agentID, false); | 378 | scene.RemoveClient(agentID, false); |
387 | m_avatars.Remove(agentID); | 379 | m_avatars.Remove(agentID); |
388 | /* | 380 | |
389 | m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", | 381 | // m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name); |
390 | agentID, av.Name); | ||
391 | */ | ||
392 | return true; | 382 | return true; |
393 | } | 383 | } |
394 | } | 384 | } |
@@ -405,9 +395,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
405 | { | 395 | { |
406 | NPCAvatar av; | 396 | NPCAvatar av; |
407 | if (m_avatars.TryGetValue(npcID, out av)) | 397 | if (m_avatars.TryGetValue(npcID, out av)) |
398 | { | ||
399 | if (npcID == callerID) | ||
400 | return true; | ||
408 | return CheckPermissions(av, callerID); | 401 | return CheckPermissions(av, callerID); |
402 | } | ||
409 | else | 403 | else |
404 | { | ||
410 | return false; | 405 | return false; |
406 | } | ||
411 | } | 407 | } |
412 | } | 408 | } |
413 | 409 | ||
@@ -419,8 +415,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
419 | /// <returns>true if they do, false if they don't.</returns> | 415 | /// <returns>true if they do, false if they don't.</returns> |
420 | private bool CheckPermissions(NPCAvatar av, UUID callerID) | 416 | private bool CheckPermissions(NPCAvatar av, UUID callerID) |
421 | { | 417 | { |
422 | return callerID == UUID.Zero || av.OwnerID == UUID.Zero || | 418 | return callerID == UUID.Zero || av.OwnerID == UUID.Zero || av.OwnerID == callerID || av.AgentId == callerID; |
423 | av.OwnerID == callerID; | ||
424 | } | 419 | } |
425 | } | 420 | } |
426 | } | 421 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs index bf23040..34362af 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | |||
@@ -110,7 +110,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests | |||
110 | // ScenePresence.SendInitialData() to reset our entire appearance. | 110 | // ScenePresence.SendInitialData() to reset our entire appearance. |
111 | m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); | 111 | m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); |
112 | 112 | ||
113 | m_afMod.SetAppearance(sp, originalTe, null); | 113 | m_afMod.SetAppearance(sp, originalTe, null, new WearableCacheItem[0] ); |
114 | 114 | ||
115 | UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance); | 115 | UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance); |
116 | 116 | ||