diff options
author | Diva Canto | 2010-01-15 17:24:41 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-15 17:24:41 -0800 |
commit | 32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f (patch) | |
tree | e20c1afa3edc76101eea15765a447b13b3c4946e /OpenSim/Region | |
parent | Comment (diff) | |
parent | Merge branch 'master' into presence-refactor (diff) | |
download | opensim-SC-32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f.zip opensim-SC-32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f.tar.gz opensim-SC-32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f.tar.bz2 opensim-SC-32bfbdab6f6bbbfaae0df0ab410af7b9c42a3a4f.tar.xz |
Merge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/opensim into presence-refactor
Diffstat (limited to 'OpenSim/Region')
25 files changed, 996 insertions, 370 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 546a1d1..299f519 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -53,6 +53,7 @@ namespace OpenSim | |||
53 | protected string m_shutdownCommandsFile; | 53 | protected string m_shutdownCommandsFile; |
54 | protected bool m_gui = false; | 54 | protected bool m_gui = false; |
55 | protected string m_consoleType = "local"; | 55 | protected string m_consoleType = "local"; |
56 | protected uint m_consolePort = 0; | ||
56 | 57 | ||
57 | private string m_timedScript = "disabled"; | 58 | private string m_timedScript = "disabled"; |
58 | private Timer m_scriptTimer; | 59 | private Timer m_scriptTimer; |
@@ -66,6 +67,7 @@ namespace OpenSim | |||
66 | base.ReadExtraConfigSettings(); | 67 | base.ReadExtraConfigSettings(); |
67 | 68 | ||
68 | IConfig startupConfig = m_config.Source.Configs["Startup"]; | 69 | IConfig startupConfig = m_config.Source.Configs["Startup"]; |
70 | IConfig networkConfig = m_config.Source.Configs["Network"]; | ||
69 | 71 | ||
70 | int stpMaxThreads = 15; | 72 | int stpMaxThreads = 15; |
71 | 73 | ||
@@ -79,6 +81,8 @@ namespace OpenSim | |||
79 | else | 81 | else |
80 | m_consoleType= startupConfig.GetString("console", String.Empty); | 82 | m_consoleType= startupConfig.GetString("console", String.Empty); |
81 | 83 | ||
84 | if (networkConfig != null) | ||
85 | m_consolePort = (uint)networkConfig.GetInt("console_port", 0); | ||
82 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); | 86 | m_timedScript = startupConfig.GetString("timer_Script", "disabled"); |
83 | if (m_logFileAppender != null) | 87 | if (m_logFileAppender != null) |
84 | { | 88 | { |
@@ -156,7 +160,16 @@ namespace OpenSim | |||
156 | MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this)); | 160 | MainServer.Instance.AddStreamHandler(new OpenSim.UXSimStatusHandler(this)); |
157 | 161 | ||
158 | if (m_console is RemoteConsole) | 162 | if (m_console is RemoteConsole) |
159 | ((RemoteConsole)m_console).SetServer(m_httpServer); | 163 | { |
164 | if (m_consolePort == 0) | ||
165 | { | ||
166 | ((RemoteConsole)m_console).SetServer(m_httpServer); | ||
167 | } | ||
168 | else | ||
169 | { | ||
170 | ((RemoteConsole)m_console).SetServer(MainServer.GetHttpServer(m_consolePort)); | ||
171 | } | ||
172 | } | ||
160 | 173 | ||
161 | //Run Startup Commands | 174 | //Run Startup Commands |
162 | if (String.IsNullOrEmpty(m_startupCommandsFile)) | 175 | if (String.IsNullOrEmpty(m_startupCommandsFile)) |
@@ -292,18 +305,6 @@ namespace OpenSim | |||
292 | "create region", | 305 | "create region", |
293 | "Create a new region", HandleCreateRegion); | 306 | "Create a new region", HandleCreateRegion); |
294 | 307 | ||
295 | m_console.Commands.AddCommand("region", false, "login enable", | ||
296 | "login enable", | ||
297 | "Enable logins to the simulator", HandleLoginEnable); | ||
298 | |||
299 | m_console.Commands.AddCommand("region", false, "login disable", | ||
300 | "login disable", | ||
301 | "Disable logins to the simulator", HandleLoginDisable); | ||
302 | |||
303 | m_console.Commands.AddCommand("region", false, "login status", | ||
304 | "login status", | ||
305 | "Display status of logins", HandleLoginStatus); | ||
306 | |||
307 | m_console.Commands.AddCommand("region", false, "restart", | 308 | m_console.Commands.AddCommand("region", false, "restart", |
308 | "restart", | 309 | "restart", |
309 | "Restart all sims in this instance", RunCommand); | 310 | "Restart all sims in this instance", RunCommand); |
@@ -554,42 +555,6 @@ namespace OpenSim | |||
554 | } | 555 | } |
555 | 556 | ||
556 | /// <summary> | 557 | /// <summary> |
557 | /// Enable logins | ||
558 | /// </summary> | ||
559 | /// <param name="module"></param> | ||
560 | /// <param name="cmd"></param> | ||
561 | private void HandleLoginEnable(string module, string[] cmd) | ||
562 | { | ||
563 | ProcessLogin(true); | ||
564 | } | ||
565 | |||
566 | |||
567 | /// <summary> | ||
568 | /// Disable logins | ||
569 | /// </summary> | ||
570 | /// <param name="module"></param> | ||
571 | /// <param name="cmd"></param> | ||
572 | private void HandleLoginDisable(string module, string[] cmd) | ||
573 | { | ||
574 | ProcessLogin(false); | ||
575 | } | ||
576 | |||
577 | /// <summary> | ||
578 | /// Log login status to the console | ||
579 | /// </summary> | ||
580 | /// <param name="module"></param> | ||
581 | /// <param name="cmd"></param> | ||
582 | private void HandleLoginStatus(string module, string[] cmd) | ||
583 | { | ||
584 | if (m_sceneManager.CurrentOrFirstScene.SceneGridService.RegionLoginsEnabled == false) | ||
585 | |||
586 | m_log.Info("[ Login ] Login are disabled "); | ||
587 | else | ||
588 | m_log.Info("[ Login ] Login are enabled"); | ||
589 | } | ||
590 | |||
591 | |||
592 | /// <summary> | ||
593 | /// Change and load configuration file data. | 558 | /// Change and load configuration file data. |
594 | /// </summary> | 559 | /// </summary> |
595 | /// <param name="module"></param> | 560 | /// <param name="module"></param> |
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f3f715a..f265769 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -200,12 +200,6 @@ namespace OpenSim | |||
200 | plugin.PostInitialise(); | 200 | plugin.PostInitialise(); |
201 | } | 201 | } |
202 | 202 | ||
203 | // Only enable logins to the regions once we have completely finished starting up (apart from scripts) | ||
204 | if ((SceneManager.CurrentOrFirstScene != null) && (SceneManager.CurrentOrFirstScene.SceneGridService != null)) | ||
205 | { | ||
206 | SceneManager.CurrentOrFirstScene.SceneGridService.RegionLoginsEnabled = true; | ||
207 | } | ||
208 | |||
209 | AddPluginCommands(); | 203 | AddPluginCommands(); |
210 | } | 204 | } |
211 | 205 | ||
@@ -276,31 +270,6 @@ namespace OpenSim | |||
276 | } | 270 | } |
277 | 271 | ||
278 | /// <summary> | 272 | /// <summary> |
279 | /// Initialises the asset cache. This supports legacy configuration values | ||
280 | /// to ensure consistent operation, but values outside of that namespace | ||
281 | /// are handled by the more generic resolution mechanism provided by | ||
282 | /// the ResolveAssetServer virtual method. If extended resolution fails, | ||
283 | /// then the normal default action is taken. | ||
284 | /// Creation of the AssetCache is handled by ResolveAssetCache. This | ||
285 | /// function accepts a reference to the instantiated AssetServer and | ||
286 | /// returns an IAssetCache implementation, if possible. This is a virtual | ||
287 | /// method. | ||
288 | /// </summary> | ||
289 | public void ProcessLogin(bool LoginEnabled) | ||
290 | { | ||
291 | if (LoginEnabled) | ||
292 | { | ||
293 | m_log.Info("[LOGIN]: Login is now enabled."); | ||
294 | SceneManager.CurrentOrFirstScene.SceneGridService.RegionLoginsEnabled = true; | ||
295 | } | ||
296 | else | ||
297 | { | ||
298 | m_log.Info("[LOGIN]: Login is now disabled."); | ||
299 | SceneManager.CurrentOrFirstScene.SceneGridService.RegionLoginsEnabled = false; | ||
300 | } | ||
301 | } | ||
302 | |||
303 | /// <summary> | ||
304 | /// Execute the region creation process. This includes setting up scene infrastructure. | 273 | /// Execute the region creation process. This includes setting up scene infrastructure. |
305 | /// </summary> | 274 | /// </summary> |
306 | /// <param name="regionInfo"></param> | 275 | /// <param name="regionInfo"></param> |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index b937226..ae0bd79 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -298,25 +298,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
298 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 298 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
299 | public event PlacesQuery OnPlacesQuery; | 299 | public event PlacesQuery OnPlacesQuery; |
300 | public event AgentFOV OnAgentFOV; | 300 | public event AgentFOV OnAgentFOV; |
301 | public event FindAgentUpdate OnFindAgentEvent; | 301 | public event FindAgentUpdate OnFindAgent; |
302 | public event TrackAgentUpdate OnTrackAgentEvent; | 302 | public event TrackAgentUpdate OnTrackAgent; |
303 | public event NewUserReport OnUserReportEvent; | 303 | public event NewUserReport OnUserReport; |
304 | public event SaveStateHandler OnSaveStateEvent; | 304 | public event SaveStateHandler OnSaveState; |
305 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 305 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
306 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 306 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
307 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 307 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
308 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 308 | public event FreezeUserUpdate OnParcelFreezeUser; |
309 | public event EjectUserUpdate OnParcelEjectUserEvent; | 309 | public event EjectUserUpdate OnParcelEjectUser; |
310 | public event ParcelBuyPass OnParcelBuyPass; | 310 | public event ParcelBuyPass OnParcelBuyPass; |
311 | public event ParcelGodMark OnParcelGodMark; | 311 | public event ParcelGodMark OnParcelGodMark; |
312 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 312 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
313 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 313 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
314 | public event SimWideDeletesDelegate OnSimWideDeletes; | 314 | public event SimWideDeletesDelegate OnSimWideDeletes; |
315 | public event SendPostcard OnSendPostcard; | 315 | public event SendPostcard OnSendPostcard; |
316 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 316 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
317 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 317 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
318 | public event GodlikeMessage onGodlikeMessageEvent; | 318 | public event GodlikeMessage onGodlikeMessage; |
319 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 319 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
320 | 320 | ||
321 | 321 | ||
322 | #endregion Events | 322 | #endregion Events |
@@ -825,37 +825,39 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
825 | } | 825 | } |
826 | OutPacket(gmp, ThrottleOutPacketType.Task); | 826 | OutPacket(gmp, ThrottleOutPacketType.Task); |
827 | } | 827 | } |
828 | 828 | ||
829 | public void SendGroupActiveProposals(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary<int, string> VoteID, Dictionary<int, string> VoteInitiator, Dictionary<int, string> Majority, Dictionary<int, string> Quorum, Dictionary<int, string> TerseDateID, Dictionary<int, string> StartDateTime, Dictionary<int, string> EndDateTime, Dictionary<int, string> ProposalText) | 829 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) |
830 | { | 830 | { |
831 | foreach (KeyValuePair<int, string> Blank in VoteID) | 831 | int i = 0; |
832 | foreach (GroupActiveProposals Proposal in Proposals) | ||
832 | { | 833 | { |
833 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); | 834 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); |
834 | 835 | ||
835 | GAPIRP.AgentData.AgentID = agentID; | 836 | GAPIRP.AgentData.AgentID = AgentId; |
836 | GAPIRP.AgentData.GroupID = groupID; | 837 | GAPIRP.AgentData.GroupID = groupID; |
837 | GAPIRP.TransactionData.TransactionID = transactionID; | 838 | GAPIRP.TransactionData.TransactionID = transactionID; |
838 | GAPIRP.TransactionData.TotalNumItems = 1; | 839 | GAPIRP.TransactionData.TotalNumItems = ((uint)i+1); |
839 | GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); | 840 | GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); |
840 | GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; | 841 | GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; |
841 | ProposalData.VoteCast = Utils.StringToBytes("false"); | 842 | ProposalData.VoteCast = Utils.StringToBytes("false"); |
842 | ProposalData.VoteID = new UUID(VoteID[Blank.Key]); | 843 | ProposalData.VoteID = new UUID(Proposal.VoteID); |
843 | ProposalData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); | 844 | ProposalData.VoteInitiator = new UUID(Proposal.VoteInitiator); |
844 | ProposalData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); | 845 | ProposalData.Majority = (float)Convert.ToInt32(Proposal.Majority); |
845 | ProposalData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); | 846 | ProposalData.Quorum = Convert.ToInt32(Proposal.Quorum); |
846 | ProposalData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); | 847 | ProposalData.TerseDateID = Utils.StringToBytes(Proposal.TerseDateID); |
847 | ProposalData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); | 848 | ProposalData.StartDateTime = Utils.StringToBytes(Proposal.StartDateTime); |
848 | ProposalData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); | 849 | ProposalData.EndDateTime = Utils.StringToBytes(Proposal.EndDateTime); |
849 | ProposalData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); | 850 | ProposalData.ProposalText = Utils.StringToBytes(Proposal.ProposalText); |
850 | ProposalData.AlreadyVoted = false; | 851 | ProposalData.AlreadyVoted = false; |
851 | GAPIRP.ProposalData[0] = ProposalData; | 852 | GAPIRP.ProposalData[i] = ProposalData; |
852 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); | 853 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); |
854 | i++; | ||
853 | } | 855 | } |
854 | if (VoteID.Count == 0) | 856 | if (Proposals.Length == 0) |
855 | { | 857 | { |
856 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); | 858 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); |
857 | 859 | ||
858 | GAPIRP.AgentData.AgentID = agentID; | 860 | GAPIRP.AgentData.AgentID = AgentId; |
859 | GAPIRP.AgentData.GroupID = groupID; | 861 | GAPIRP.AgentData.GroupID = groupID; |
860 | GAPIRP.TransactionData.TransactionID = transactionID; | 862 | GAPIRP.TransactionData.TransactionID = transactionID; |
861 | GAPIRP.TransactionData.TotalNumItems = 1; | 863 | GAPIRP.TransactionData.TotalNumItems = 1; |
@@ -875,40 +877,42 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
875 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); | 877 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); |
876 | } | 878 | } |
877 | } | 879 | } |
878 | 880 | ||
879 | public void SendGroupVoteHistory(IClientAPI sender,UUID agentID, UUID sessionID, UUID groupID, UUID transactionID, Dictionary<int, string> VoteID, Dictionary<int, string> VoteInitiator, Dictionary<int, string> Majority, Dictionary<int, string> Quorum, Dictionary<int, string> TerseDateID, Dictionary<int, string> StartDateTime, Dictionary<int, string> EndDateTime, Dictionary<int, string> VoteType, Dictionary<int, string> VoteResult, Dictionary<int, string> ProposalText) | 881 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) |
880 | { | 882 | { |
881 | foreach (KeyValuePair<int, string> Blank in VoteID) | 883 | int i = 0; |
884 | foreach (GroupVoteHistory Vote in Votes) | ||
882 | { | 885 | { |
883 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); | 886 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); |
884 | 887 | ||
885 | GVHIRP.AgentData.AgentID = agentID; | 888 | GVHIRP.AgentData.AgentID = AgentId; |
886 | GVHIRP.AgentData.GroupID = groupID; | 889 | GVHIRP.AgentData.GroupID = groupID; |
887 | GVHIRP.TransactionData.TransactionID = transactionID; | 890 | GVHIRP.TransactionData.TransactionID = transactionID; |
888 | GVHIRP.TransactionData.TotalNumItems = 1; | 891 | GVHIRP.TransactionData.TotalNumItems = ((uint)i+1); |
889 | GVHIRP.HistoryItemData.VoteID = new UUID(VoteID[Blank.Key]); | 892 | GVHIRP.HistoryItemData.VoteID = new UUID(Vote.VoteID); |
890 | GVHIRP.HistoryItemData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); | 893 | GVHIRP.HistoryItemData.VoteInitiator = new UUID(Vote.VoteInitiator); |
891 | GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); | 894 | GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Vote.Majority); |
892 | GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); | 895 | GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Vote.Quorum); |
893 | GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); | 896 | GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(Vote.TerseDateID); |
894 | GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); | 897 | GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(Vote.StartDateTime); |
895 | GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); | 898 | GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(Vote.EndDateTime); |
896 | GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(VoteType[Blank.Key]); | 899 | GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(Vote.VoteType); |
897 | GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(VoteResult[Blank.Key]); | 900 | GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(Vote.VoteResult); |
898 | GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); | 901 | GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(Vote.ProposalText); |
899 | GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); | 902 | GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); |
900 | GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; | 903 | GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; |
901 | VoteItem.CandidateID = UUID.Zero; | 904 | VoteItem.CandidateID = UUID.Zero; |
902 | VoteItem.NumVotes = 0; //TODO: FIX THIS!!! | 905 | VoteItem.NumVotes = 0; //TODO: FIX THIS!!! |
903 | VoteItem.VoteCast = Utils.StringToBytes("Yes"); | 906 | VoteItem.VoteCast = Utils.StringToBytes("Yes"); |
904 | GVHIRP.VoteItem[0] = VoteItem; | 907 | GVHIRP.VoteItem[i] = VoteItem; |
905 | OutPacket(GVHIRP, ThrottleOutPacketType.Task); | 908 | OutPacket(GVHIRP, ThrottleOutPacketType.Task); |
906 | } | 909 | i++; |
907 | if (VoteID.Count == 0) | 910 | } |
911 | if (Votes.Length == 0) | ||
908 | { | 912 | { |
909 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); | 913 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); |
910 | 914 | ||
911 | GVHIRP.AgentData.AgentID = agentID; | 915 | GVHIRP.AgentData.AgentID = AgentId; |
912 | GVHIRP.AgentData.GroupID = groupID; | 916 | GVHIRP.AgentData.GroupID = groupID; |
913 | GVHIRP.TransactionData.TransactionID = transactionID; | 917 | GVHIRP.TransactionData.TransactionID = transactionID; |
914 | GVHIRP.TransactionData.TotalNumItems = 0; | 918 | GVHIRP.TransactionData.TotalNumItems = 0; |
@@ -3908,7 +3912,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3908 | return false; | 3912 | return false; |
3909 | } | 3913 | } |
3910 | 3914 | ||
3911 | public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID) | 3915 | public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID) |
3916 | |||
3912 | { | 3917 | { |
3913 | EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); | 3918 | EstateOwnerMessagePacket packet = new EstateOwnerMessagePacket(); |
3914 | packet.AgentData.TransactionID = UUID.Random(); | 3919 | packet.AgentData.TransactionID = UUID.Random(); |
@@ -3917,26 +3922,36 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3917 | packet.MethodData.Invoice = invoice; | 3922 | packet.MethodData.Invoice = invoice; |
3918 | packet.MethodData.Method = Utils.StringToBytes("setaccess"); | 3923 | packet.MethodData.Method = Utils.StringToBytes("setaccess"); |
3919 | 3924 | ||
3920 | EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + EstateManagers.Length]; | 3925 | EstateOwnerMessagePacket.ParamListBlock[] returnblock = new EstateOwnerMessagePacket.ParamListBlock[6 + Data.Length]; |
3921 | 3926 | ||
3922 | for (int i = 0; i < (6 + EstateManagers.Length); i++) | 3927 | for (int i = 0; i < (6 + Data.Length); i++) |
3923 | { | 3928 | { |
3924 | returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock(); | 3929 | returnblock[i] = new EstateOwnerMessagePacket.ParamListBlock(); |
3925 | } | 3930 | } |
3926 | int j = 0; | 3931 | int j = 0; |
3927 | 3932 | ||
3928 | returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++; | 3933 | returnblock[j].Parameter = Utils.StringToBytes(estateID.ToString()); j++; |
3929 | returnblock[j].Parameter = Utils.StringToBytes(((int)Constants.EstateAccessCodex.EstateManagers).ToString()); j++; | 3934 | returnblock[j].Parameter = Utils.StringToBytes(code.ToString()); j++; |
3935 | returnblock[j].Parameter = Utils.StringToBytes("0"); j++; | ||
3930 | returnblock[j].Parameter = Utils.StringToBytes("0"); j++; | 3936 | returnblock[j].Parameter = Utils.StringToBytes("0"); j++; |
3931 | returnblock[j].Parameter = Utils.StringToBytes("0"); j++; | 3937 | returnblock[j].Parameter = Utils.StringToBytes("0"); j++; |
3932 | returnblock[j].Parameter = Utils.StringToBytes("0"); j++; | 3938 | returnblock[j].Parameter = Utils.StringToBytes("0"); j++; |
3933 | returnblock[j].Parameter = Utils.StringToBytes(EstateManagers.Length.ToString()); j++; | 3939 | |
3934 | for (int i = 0; i < EstateManagers.Length; i++) | 3940 | j = 2; // Agents |
3941 | if ((code & 2) != 0) | ||
3942 | j = 3; // Groups | ||
3943 | if ((code & 8) != 0) | ||
3944 | j = 5; // Managers | ||
3945 | |||
3946 | returnblock[j].Parameter = Utils.StringToBytes(Data.Length.ToString()); | ||
3947 | j = 6; | ||
3948 | |||
3949 | for (int i = 0; i < Data.Length; i++) | ||
3935 | { | 3950 | { |
3936 | returnblock[j].Parameter = EstateManagers[i].GetBytes(); j++; | 3951 | returnblock[j].Parameter = Data[i].GetBytes(); j++; |
3937 | } | 3952 | } |
3938 | packet.ParamList = returnblock; | 3953 | packet.ParamList = returnblock; |
3939 | packet.Header.Reliable = false; | 3954 | packet.Header.Reliable = true; |
3940 | OutPacket(packet, ThrottleOutPacketType.Task); | 3955 | OutPacket(packet, ThrottleOutPacketType.Task); |
3941 | } | 3956 | } |
3942 | 3957 | ||
@@ -4887,7 +4902,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4887 | { | 4902 | { |
4888 | FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; | 4903 | FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; |
4889 | 4904 | ||
4890 | FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUserEvent; | 4905 | FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUser; |
4891 | if (FreezeUserHandler != null) | 4906 | if (FreezeUserHandler != null) |
4892 | { | 4907 | { |
4893 | FreezeUserHandler(this, | 4908 | FreezeUserHandler(this, |
@@ -4904,7 +4919,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4904 | EjectUserPacket EjectUser = | 4919 | EjectUserPacket EjectUser = |
4905 | (EjectUserPacket)Packet; | 4920 | (EjectUserPacket)Packet; |
4906 | 4921 | ||
4907 | EjectUserUpdate EjectUserHandler = OnParcelEjectUserEvent; | 4922 | EjectUserUpdate EjectUserHandler = OnParcelEjectUser; |
4908 | if (EjectUserHandler != null) | 4923 | if (EjectUserHandler != null) |
4909 | { | 4924 | { |
4910 | EjectUserHandler(this, | 4925 | EjectUserHandler(this, |
@@ -5303,7 +5318,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5303 | FindAgentPacket FindAgent = | 5318 | FindAgentPacket FindAgent = |
5304 | (FindAgentPacket)Packet; | 5319 | (FindAgentPacket)Packet; |
5305 | 5320 | ||
5306 | FindAgentUpdate FindAgentHandler = OnFindAgentEvent; | 5321 | FindAgentUpdate FindAgentHandler = OnFindAgent; |
5307 | if (FindAgentHandler != null) | 5322 | if (FindAgentHandler != null) |
5308 | { | 5323 | { |
5309 | FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); | 5324 | FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); |
@@ -5317,7 +5332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5317 | TrackAgentPacket TrackAgent = | 5332 | TrackAgentPacket TrackAgent = |
5318 | (TrackAgentPacket)Packet; | 5333 | (TrackAgentPacket)Packet; |
5319 | 5334 | ||
5320 | TrackAgentUpdate TrackAgentHandler = OnTrackAgentEvent; | 5335 | TrackAgentUpdate TrackAgentHandler = OnTrackAgent; |
5321 | if (TrackAgentHandler != null) | 5336 | if (TrackAgentHandler != null) |
5322 | { | 5337 | { |
5323 | TrackAgentHandler(this, | 5338 | TrackAgentHandler(this, |
@@ -8606,7 +8621,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8606 | GodUpdateRegionInfoPacket GodUpdateRegionInfo = | 8621 | GodUpdateRegionInfoPacket GodUpdateRegionInfo = |
8607 | (GodUpdateRegionInfoPacket)Packet; | 8622 | (GodUpdateRegionInfoPacket)Packet; |
8608 | 8623 | ||
8609 | GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdateEvent; | 8624 | GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdate; |
8610 | if (handlerGodUpdateRegionInfo != null) | 8625 | if (handlerGodUpdateRegionInfo != null) |
8611 | { | 8626 | { |
8612 | handlerGodUpdateRegionInfo(this, | 8627 | handlerGodUpdateRegionInfo(this, |
@@ -8639,7 +8654,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8639 | GodlikeMessagePacket GodlikeMessage = | 8654 | GodlikeMessagePacket GodlikeMessage = |
8640 | (GodlikeMessagePacket)Packet; | 8655 | (GodlikeMessagePacket)Packet; |
8641 | 8656 | ||
8642 | GodlikeMessage handlerGodlikeMessage = onGodlikeMessageEvent; | 8657 | GodlikeMessage handlerGodlikeMessage = onGodlikeMessage; |
8643 | if (handlerGodlikeMessage != null) | 8658 | if (handlerGodlikeMessage != null) |
8644 | { | 8659 | { |
8645 | handlerGodlikeMessage(this, | 8660 | handlerGodlikeMessage(this, |
@@ -8655,7 +8670,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8655 | { | 8670 | { |
8656 | StateSavePacket SaveStateMessage = | 8671 | StateSavePacket SaveStateMessage = |
8657 | (StateSavePacket)Packet; | 8672 | (StateSavePacket)Packet; |
8658 | SaveStateHandler handlerSaveStatePacket = OnSaveStateEvent; | 8673 | SaveStateHandler handlerSaveStatePacket = OnSaveState; |
8659 | if (handlerSaveStatePacket != null) | 8674 | if (handlerSaveStatePacket != null) |
8660 | { | 8675 | { |
8661 | handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); | 8676 | handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); |
@@ -9019,7 +9034,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9019 | { | 9034 | { |
9020 | UpdateMuteListEntryPacket UpdateMuteListEntry = | 9035 | UpdateMuteListEntryPacket UpdateMuteListEntry = |
9021 | (UpdateMuteListEntryPacket)Packet; | 9036 | (UpdateMuteListEntryPacket)Packet; |
9022 | MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntryEvent; | 9037 | MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntry; |
9023 | if (handlerUpdateMuteListEntry != null) | 9038 | if (handlerUpdateMuteListEntry != null) |
9024 | { | 9039 | { |
9025 | handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, | 9040 | handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, |
@@ -9035,7 +9050,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9035 | { | 9050 | { |
9036 | RemoveMuteListEntryPacket RemoveMuteListEntry = | 9051 | RemoveMuteListEntryPacket RemoveMuteListEntry = |
9037 | (RemoveMuteListEntryPacket)Packet; | 9052 | (RemoveMuteListEntryPacket)Packet; |
9038 | MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntryEvent; | 9053 | MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntry; |
9039 | if (handlerRemoveMuteListEntry != null) | 9054 | if (handlerRemoveMuteListEntry != null) |
9040 | { | 9055 | { |
9041 | handlerRemoveMuteListEntry(this, | 9056 | handlerRemoveMuteListEntry(this, |
@@ -9052,7 +9067,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
9052 | UserReportPacket UserReport = | 9067 | UserReportPacket UserReport = |
9053 | (UserReportPacket)Packet; | 9068 | (UserReportPacket)Packet; |
9054 | 9069 | ||
9055 | NewUserReport handlerUserReport = OnUserReportEvent; | 9070 | NewUserReport handlerUserReport = OnUserReport; |
9056 | if (handlerUserReport != null) | 9071 | if (handlerUserReport != null) |
9057 | { | 9072 | { |
9058 | handlerUserReport(this, | 9073 | handlerUserReport(this, |
diff --git a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs index a835c52..e48b078 100644 --- a/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/InstantMessage/OfflineMessageModule.cs | |||
@@ -48,6 +48,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
48 | private List<Scene> m_SceneList = new List<Scene>(); | 48 | private List<Scene> m_SceneList = new List<Scene>(); |
49 | private string m_RestURL = String.Empty; | 49 | private string m_RestURL = String.Empty; |
50 | IMessageTransferModule m_TransferModule = null; | 50 | IMessageTransferModule m_TransferModule = null; |
51 | private bool m_ForwardOfflineGroupMessages = true; | ||
51 | 52 | ||
52 | public void Initialise(IConfigSource config) | 53 | public void Initialise(IConfigSource config) |
53 | { | 54 | { |
@@ -71,6 +72,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
71 | enabled = false; | 72 | enabled = false; |
72 | return; | 73 | return; |
73 | } | 74 | } |
75 | |||
76 | m_ForwardOfflineGroupMessages = cnf.GetBoolean("ForwardOfflineGroupMessages", m_ForwardOfflineGroupMessages); | ||
74 | } | 77 | } |
75 | 78 | ||
76 | public void AddRegion(Scene scene) | 79 | public void AddRegion(Scene scene) |
@@ -192,7 +195,8 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage | |||
192 | 195 | ||
193 | private void UndeliveredMessage(GridInstantMessage im) | 196 | private void UndeliveredMessage(GridInstantMessage im) |
194 | { | 197 | { |
195 | if (im.offline != 0) | 198 | if ((im.offline != 0) |
199 | && (!im.fromGroup || (im.fromGroup && m_ForwardOfflineGroupMessages))) | ||
196 | { | 200 | { |
197 | bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( | 201 | bool success = SynchronousRestObjectPoster.BeginPostObject<GridInstantMessage, bool>( |
198 | "POST", m_RestURL+"/SaveMessage/", im); | 202 | "POST", m_RestURL+"/SaveMessage/", im); |
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index f980c24..106e87c 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml | |||
@@ -65,6 +65,7 @@ | |||
65 | <RegionModule id="LLLoginServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Login.LLLoginServiceInConnectorModule" /> \ | 65 | <RegionModule id="LLLoginServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Login.LLLoginServiceInConnectorModule" /> \ |
66 | <RegionModule id="SimulationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation.SimulationServiceInConnectorModule" /> \ | 66 | <RegionModule id="SimulationServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Simulation.SimulationServiceInConnectorModule" /> \ |
67 | <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \ | 67 | <RegionModule id="GridInfoServiceInConnectorModule" type="OpenSim.Region.CoreModules.ServiceConnectorsIn.Grid.GridInfoServiceInConnectorModule" /> \ |
68 | <RegionModule id="AccessModule" type="OpenSim.Region.CoreModules.World.AccessModule" /> \ | ||
68 | 69 | ||
69 | </Extension> | 70 | </Extension> |
70 | 71 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs index 8ec20eb..de71b56 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs | |||
@@ -195,7 +195,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
195 | 195 | ||
196 | #region IGridService | 196 | #region IGridService |
197 | 197 | ||
198 | public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) | 198 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
199 | { | 199 | { |
200 | // Region doesn't exist here. Trying to link remote region | 200 | // Region doesn't exist here. Trying to link remote region |
201 | if (regionInfo.RegionID.Equals(UUID.Zero)) | 201 | if (regionInfo.RegionID.Equals(UUID.Zero)) |
@@ -210,12 +210,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
210 | 210 | ||
211 | // Try get the map image | 211 | // Try get the map image |
212 | m_HypergridServiceConnector.GetMapImage(regionInfo); | 212 | m_HypergridServiceConnector.GetMapImage(regionInfo); |
213 | return true; | 213 | return String.Empty; |
214 | } | 214 | } |
215 | else | 215 | else |
216 | { | 216 | { |
217 | m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")"); | 217 | m_log.Info("[HGrid]: No such region " + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "(" + regionInfo.InternalEndPoint.Port + ")"); |
218 | return false; | 218 | return "No such region"; |
219 | } | 219 | } |
220 | // Note that these remote regions aren't registered in localBackend, so return null, no local listeners | 220 | // Note that these remote regions aren't registered in localBackend, so return null, no local listeners |
221 | } | 221 | } |
@@ -465,7 +465,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
465 | } | 465 | } |
466 | 466 | ||
467 | // Finally, link it | 467 | // Finally, link it |
468 | if (!RegisterRegion(UUID.Zero, regInfo)) | 468 | if (RegisterRegion(UUID.Zero, regInfo) != String.Empty) |
469 | { | 469 | { |
470 | m_log.Warn("[HGrid]: Unable to link region"); | 470 | m_log.Warn("[HGrid]: Unable to link region"); |
471 | return false; | 471 | return false; |
@@ -706,8 +706,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
706 | public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome) | 706 | public bool CheckUserAtEntry(UUID userID, UUID sessionID, out bool comingHome) |
707 | { | 707 | { |
708 | comingHome = false; | 708 | comingHome = false; |
709 | if (!m_aScene.SceneGridService.RegionLoginsEnabled) | ||
710 | return false; | ||
711 | 709 | ||
712 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); | 710 | UserAccount account = m_aScene.UserAccountService.GetUserAccount(m_aScene.RegionInfo.ScopeID, userID); |
713 | if (account != null) | 711 | if (account != null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index f0081fc..86a8c13 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
169 | 169 | ||
170 | #region IGridService | 170 | #region IGridService |
171 | 171 | ||
172 | public bool RegisterRegion(UUID scopeID, GridRegion regionInfo) | 172 | public string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
173 | { | 173 | { |
174 | return m_GridService.RegisterRegion(scopeID, regionInfo); | 174 | return m_GridService.RegisterRegion(scopeID, regionInfo); |
175 | } | 175 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index 72c00fc..391e7c8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -135,12 +135,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | |||
135 | 135 | ||
136 | #region IGridService | 136 | #region IGridService |
137 | 137 | ||
138 | public override bool RegisterRegion(UUID scopeID, GridRegion regionInfo) | 138 | public override string RegisterRegion(UUID scopeID, GridRegion regionInfo) |
139 | { | 139 | { |
140 | if (m_LocalGridService.RegisterRegion(scopeID, regionInfo)) | 140 | string msg = m_LocalGridService.RegisterRegion(scopeID, regionInfo); |
141 | |||
142 | if (msg == String.Empty) | ||
141 | return base.RegisterRegion(scopeID, regionInfo); | 143 | return base.RegisterRegion(scopeID, regionInfo); |
142 | 144 | ||
143 | return false; | 145 | return msg; |
144 | } | 146 | } |
145 | 147 | ||
146 | public override bool DeregisterRegion(UUID regionID) | 148 | public override bool DeregisterRegion(UUID regionID) |
diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs new file mode 100644 index 0000000..8b5a413 --- /dev/null +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs | |||
@@ -0,0 +1,157 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using Nini.Config; | ||
33 | using OpenMetaverse; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Console; | ||
36 | using OpenSim.Region.Framework.Interfaces; | ||
37 | using OpenSim.Region.Framework.Scenes; | ||
38 | using OpenSim.Services.Interfaces; | ||
39 | |||
40 | namespace OpenSim.Region.CoreModules.World | ||
41 | { | ||
42 | public class AccessModule : ISharedRegionModule | ||
43 | { | ||
44 | private static readonly ILog m_log = | ||
45 | LogManager.GetLogger( | ||
46 | MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
48 | private List<Scene> m_SceneList = new List<Scene>(); | ||
49 | |||
50 | public void Initialise(IConfigSource config) | ||
51 | { | ||
52 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
53 | "login enable", | ||
54 | "login enable", | ||
55 | "Enable simulator logins", | ||
56 | String.Empty, | ||
57 | HandleLoginCommand); | ||
58 | |||
59 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
60 | "login disable", | ||
61 | "login disable", | ||
62 | "Disable simulator logins", | ||
63 | String.Empty, | ||
64 | HandleLoginCommand); | ||
65 | |||
66 | MainConsole.Instance.Commands.AddCommand("access", true, | ||
67 | "login status", | ||
68 | "login status", | ||
69 | "Show login status", | ||
70 | String.Empty, | ||
71 | HandleLoginCommand); | ||
72 | } | ||
73 | |||
74 | public void PostInitialise() | ||
75 | { | ||
76 | } | ||
77 | |||
78 | public void Close() | ||
79 | { | ||
80 | } | ||
81 | |||
82 | public string Name | ||
83 | { | ||
84 | get { return "AccessModule"; } | ||
85 | } | ||
86 | |||
87 | public Type ReplaceableInterface | ||
88 | { | ||
89 | get { return null; } | ||
90 | } | ||
91 | |||
92 | public void AddRegion(Scene scene) | ||
93 | { | ||
94 | if (!m_SceneList.Contains(scene)) | ||
95 | m_SceneList.Add(scene); | ||
96 | } | ||
97 | |||
98 | public void RemoveRegion(Scene scene) | ||
99 | { | ||
100 | m_SceneList.Remove(scene); | ||
101 | } | ||
102 | |||
103 | public void RegionLoaded(Scene scene) | ||
104 | { | ||
105 | } | ||
106 | |||
107 | public void HandleLoginCommand(string module, string[] cmd) | ||
108 | { | ||
109 | if ((Scene)MainConsole.Instance.ConsoleScene == null) | ||
110 | { | ||
111 | foreach (Scene s in m_SceneList) | ||
112 | { | ||
113 | if(!ProcessCommand(s, cmd)) | ||
114 | break; | ||
115 | } | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | ProcessCommand((Scene)MainConsole.Instance.ConsoleScene, cmd); | ||
120 | } | ||
121 | } | ||
122 | |||
123 | bool ProcessCommand(Scene scene, string[] cmd) | ||
124 | { | ||
125 | if (cmd.Length < 2) | ||
126 | { | ||
127 | MainConsole.Instance.Output("Syntax: login enable|disable|status"); | ||
128 | return false; | ||
129 | } | ||
130 | |||
131 | switch (cmd[1]) | ||
132 | { | ||
133 | case "enable": | ||
134 | if (scene.LoginsDisabled) | ||
135 | MainConsole.Instance.Output(String.Format("Enabling logins for region {0}", scene.RegionInfo.RegionName)); | ||
136 | scene.LoginsDisabled = false; | ||
137 | break; | ||
138 | case "disable": | ||
139 | if (!scene.LoginsDisabled) | ||
140 | MainConsole.Instance.Output(String.Format("Disabling logins for region {0}", scene.RegionInfo.RegionName)); | ||
141 | scene.LoginsDisabled = true; | ||
142 | break; | ||
143 | case "status": | ||
144 | if (scene.LoginsDisabled) | ||
145 | MainConsole.Instance.Output(String.Format("Login in {0} are disabled", scene.RegionInfo.RegionName)); | ||
146 | else | ||
147 | MainConsole.Instance.Output(String.Format("Login in {0} are enabled", scene.RegionInfo.RegionName)); | ||
148 | break; | ||
149 | default: | ||
150 | MainConsole.Instance.Output("Syntax: login enable|disable|status"); | ||
151 | return false; | ||
152 | } | ||
153 | |||
154 | return true; | ||
155 | } | ||
156 | } | ||
157 | } | ||
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index 2109336..189efdc 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs | |||
@@ -72,10 +72,21 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
72 | m_scene.RegionInfo.EstateSettings.AbuseEmail, | 72 | m_scene.RegionInfo.EstateSettings.AbuseEmail, |
73 | estateOwner); | 73 | estateOwner); |
74 | 74 | ||
75 | remote_client.SendEstateManagersList(invoice, | 75 | remote_client.SendEstateList(invoice, |
76 | (int)Constants.EstateAccessCodex.EstateManagers, | ||
76 | m_scene.RegionInfo.EstateSettings.EstateManagers, | 77 | m_scene.RegionInfo.EstateSettings.EstateManagers, |
77 | m_scene.RegionInfo.EstateSettings.EstateID); | 78 | m_scene.RegionInfo.EstateSettings.EstateID); |
78 | 79 | ||
80 | remote_client.SendEstateList(invoice, | ||
81 | (int)Constants.EstateAccessCodex.AccessOptions, | ||
82 | m_scene.RegionInfo.EstateSettings.EstateAccess, | ||
83 | m_scene.RegionInfo.EstateSettings.EstateID); | ||
84 | |||
85 | remote_client.SendEstateList(invoice, | ||
86 | (int)Constants.EstateAccessCodex.AllowedGroups, | ||
87 | m_scene.RegionInfo.EstateSettings.EstateGroups, | ||
88 | m_scene.RegionInfo.EstateSettings.EstateID); | ||
89 | |||
79 | remote_client.SendBannedUserList(invoice, | 90 | remote_client.SendBannedUserList(invoice, |
80 | m_scene.RegionInfo.EstateSettings.EstateBans, | 91 | m_scene.RegionInfo.EstateSettings.EstateBans, |
81 | m_scene.RegionInfo.EstateSettings.EstateID); | 92 | m_scene.RegionInfo.EstateSettings.EstateID); |
@@ -228,127 +239,176 @@ namespace OpenSim.Region.CoreModules.World.Estate | |||
228 | if (user == m_scene.RegionInfo.EstateSettings.EstateOwner) | 239 | if (user == m_scene.RegionInfo.EstateSettings.EstateOwner) |
229 | return; // never process EO | 240 | return; // never process EO |
230 | 241 | ||
231 | switch (estateAccessType) | 242 | if ((estateAccessType & 4) != 0) // User add |
232 | { | 243 | { |
233 | case 64: | 244 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) |
234 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | 245 | { |
235 | { | 246 | m_scene.RegionInfo.EstateSettings.AddEstateUser(user); |
236 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | 247 | m_scene.RegionInfo.EstateSettings.Save(); |
237 | 248 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); | |
238 | bool alreadyInList = false; | 249 | } |
239 | 250 | else | |
240 | for (int i = 0; i < banlistcheck.Length; i++) | 251 | { |
241 | { | 252 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); |
242 | if (user == banlistcheck[i].BannedUserID) | 253 | } |
243 | { | ||
244 | alreadyInList = true; | ||
245 | break; | ||
246 | } | ||
247 | |||
248 | } | ||
249 | if (!alreadyInList) | ||
250 | { | ||
251 | 254 | ||
252 | EstateBan item = new EstateBan(); | 255 | } |
256 | if ((estateAccessType & 8) != 0) // User remove | ||
257 | { | ||
258 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
259 | { | ||
260 | m_scene.RegionInfo.EstateSettings.RemoveEstateUser(user); | ||
261 | m_scene.RegionInfo.EstateSettings.Save(); | ||
253 | 262 | ||
254 | item.BannedUserID = user; | 263 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AccessOptions, m_scene.RegionInfo.EstateSettings.EstateAccess, m_scene.RegionInfo.EstateSettings.EstateID); |
255 | item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID; | 264 | } |
256 | item.BannedHostAddress = "0.0.0.0"; | 265 | else |
257 | item.BannedHostIPMask = "0.0.0.0"; | 266 | { |
267 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
268 | } | ||
269 | } | ||
270 | if ((estateAccessType & 16) != 0) // Group add | ||
271 | { | ||
272 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
273 | { | ||
274 | m_scene.RegionInfo.EstateSettings.AddEstateGroup(user); | ||
275 | m_scene.RegionInfo.EstateSettings.Save(); | ||
276 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); | ||
277 | } | ||
278 | else | ||
279 | { | ||
280 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
281 | } | ||
282 | } | ||
283 | if ((estateAccessType & 32) != 0) // Group remove | ||
284 | { | ||
285 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
286 | { | ||
287 | m_scene.RegionInfo.EstateSettings.RemoveEstateGroup(user); | ||
288 | m_scene.RegionInfo.EstateSettings.Save(); | ||
258 | 289 | ||
259 | m_scene.RegionInfo.EstateSettings.AddBan(item); | 290 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.AllowedGroups, m_scene.RegionInfo.EstateSettings.EstateGroups, m_scene.RegionInfo.EstateSettings.EstateID); |
260 | m_scene.RegionInfo.EstateSettings.Save(); | 291 | } |
292 | else | ||
293 | { | ||
294 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
295 | } | ||
296 | } | ||
297 | if ((estateAccessType & 64) != 0) // Ban add | ||
298 | { | ||
299 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
300 | { | ||
301 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
261 | 302 | ||
262 | ScenePresence s = m_scene.GetScenePresence(user); | 303 | bool alreadyInList = false; |
263 | if (s != null) | ||
264 | { | ||
265 | if (!s.IsChildAgent) | ||
266 | { | ||
267 | s.ControllingClient.SendTeleportLocationStart(); | ||
268 | m_scene.TeleportClientHome(user, s.ControllingClient); | ||
269 | } | ||
270 | } | ||
271 | 304 | ||
272 | } | 305 | for (int i = 0; i < banlistcheck.Length; i++) |
273 | else | 306 | { |
307 | if (user == banlistcheck[i].BannedUserID) | ||
274 | { | 308 | { |
275 | remote_client.SendAlertMessage("User is already on the region ban list"); | 309 | alreadyInList = true; |
310 | break; | ||
276 | } | 311 | } |
277 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | 312 | |
278 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | ||
279 | } | ||
280 | else | ||
281 | { | ||
282 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
283 | } | 313 | } |
284 | break; | 314 | if (!alreadyInList) |
285 | case 128: | ||
286 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
287 | { | 315 | { |
288 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
289 | 316 | ||
290 | bool alreadyInList = false; | 317 | EstateBan item = new EstateBan(); |
291 | EstateBan listitem = null; | 318 | |
319 | item.BannedUserID = user; | ||
320 | item.EstateID = m_scene.RegionInfo.EstateSettings.EstateID; | ||
321 | item.BannedHostAddress = "0.0.0.0"; | ||
322 | item.BannedHostIPMask = "0.0.0.0"; | ||
292 | 323 | ||
293 | for (int i = 0; i < banlistcheck.Length; i++) | 324 | m_scene.RegionInfo.EstateSettings.AddBan(item); |
325 | m_scene.RegionInfo.EstateSettings.Save(); | ||
326 | |||
327 | ScenePresence s = m_scene.GetScenePresence(user); | ||
328 | if (s != null) | ||
294 | { | 329 | { |
295 | if (user == banlistcheck[i].BannedUserID) | 330 | if (!s.IsChildAgent) |
296 | { | 331 | { |
297 | alreadyInList = true; | 332 | s.ControllingClient.SendTeleportLocationStart(); |
298 | listitem = banlistcheck[i]; | 333 | m_scene.TeleportClientHome(user, s.ControllingClient); |
299 | break; | ||
300 | } | 334 | } |
301 | |||
302 | } | 335 | } |
303 | if (alreadyInList && listitem != null) | 336 | |
304 | { | ||
305 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); | ||
306 | m_scene.RegionInfo.EstateSettings.Save(); | ||
307 | } | ||
308 | else | ||
309 | { | ||
310 | remote_client.SendAlertMessage("User is not on the region ban list"); | ||
311 | } | ||
312 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); | ||
313 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | ||
314 | } | 337 | } |
315 | else | 338 | else |
316 | { | 339 | { |
317 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 340 | remote_client.SendAlertMessage("User is already on the region ban list"); |
318 | } | 341 | } |
319 | break; | 342 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); |
320 | case 256: | 343 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); |
344 | } | ||
345 | else | ||
346 | { | ||
347 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
348 | } | ||
349 | } | ||
350 | if ((estateAccessType & 128) != 0) // Ban remove | ||
351 | { | ||
352 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, false) || m_scene.Permissions.BypassPermissions()) | ||
353 | { | ||
354 | EstateBan[] banlistcheck = m_scene.RegionInfo.EstateSettings.EstateBans; | ||
321 | 355 | ||
322 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | 356 | bool alreadyInList = false; |
323 | { | 357 | EstateBan listitem = null; |
324 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | 358 | |
325 | m_scene.RegionInfo.EstateSettings.Save(); | 359 | for (int i = 0; i < banlistcheck.Length; i++) |
326 | remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
327 | } | ||
328 | else | ||
329 | { | 360 | { |
330 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 361 | if (user == banlistcheck[i].BannedUserID) |
331 | } | 362 | { |
363 | alreadyInList = true; | ||
364 | listitem = banlistcheck[i]; | ||
365 | break; | ||
366 | } | ||
332 | 367 | ||
333 | break; | 368 | } |
334 | case 512: | 369 | if (alreadyInList && listitem != null) |
335 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
336 | { | 370 | { |
337 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | 371 | m_scene.RegionInfo.EstateSettings.RemoveBan(listitem.BannedUserID); |
338 | m_scene.RegionInfo.EstateSettings.Save(); | 372 | m_scene.RegionInfo.EstateSettings.Save(); |
339 | |||
340 | remote_client.SendEstateManagersList(invoice, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
341 | } | 373 | } |
342 | else | 374 | else |
343 | { | 375 | { |
344 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | 376 | remote_client.SendAlertMessage("User is not on the region ban list"); |
345 | } | 377 | } |
346 | break; | 378 | //m_scene.RegionInfo.regionBanlist.Add(Manager(user); |
347 | 379 | remote_client.SendBannedUserList(invoice, m_scene.RegionInfo.EstateSettings.EstateBans, m_scene.RegionInfo.EstateSettings.EstateID); | |
348 | default: | 380 | } |
381 | else | ||
382 | { | ||
383 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
384 | } | ||
385 | } | ||
386 | if ((estateAccessType & 256) != 0) // Manager add | ||
387 | { | ||
388 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
389 | { | ||
390 | m_scene.RegionInfo.EstateSettings.AddEstateManager(user); | ||
391 | m_scene.RegionInfo.EstateSettings.Save(); | ||
392 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); | ||
393 | } | ||
394 | else | ||
395 | { | ||
396 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
397 | } | ||
398 | } | ||
399 | if ((estateAccessType & 512) != 0) // Manager remove | ||
400 | { | ||
401 | if (m_scene.Permissions.CanIssueEstateCommand(remote_client.AgentId, true) || m_scene.Permissions.BypassPermissions()) | ||
402 | { | ||
403 | m_scene.RegionInfo.EstateSettings.RemoveEstateManager(user); | ||
404 | m_scene.RegionInfo.EstateSettings.Save(); | ||
349 | 405 | ||
350 | m_log.ErrorFormat("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta: {0}", estateAccessType.ToString()); | 406 | remote_client.SendEstateList(invoice, (int)Constants.EstateAccessCodex.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateManagers, m_scene.RegionInfo.EstateSettings.EstateID); |
351 | break; | 407 | } |
408 | else | ||
409 | { | ||
410 | remote_client.SendAlertMessage("Method EstateAccessDelta Failed, you don't have permissions"); | ||
411 | } | ||
352 | } | 412 | } |
353 | } | 413 | } |
354 | 414 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 3d7516d..8fa0c65 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
607 | return objectOwnerMask; | 607 | return objectOwnerMask; |
608 | 608 | ||
609 | // Estate users should be able to edit anything in the sim | 609 | // Estate users should be able to edit anything in the sim |
610 | if (IsEstateManager(user) && m_RegionOwnerIsGod && !IsAdministrator(objectOwner)) | 610 | if (IsEstateManager(user) && m_RegionOwnerIsGod && (!IsAdministrator(objectOwner)) || objectOwner == user) |
611 | return objectOwnerMask; | 611 | return objectOwnerMask; |
612 | 612 | ||
613 | // Admin should be able to edit anything in the sim (including admin objects) | 613 | // Admin should be able to edit anything in the sim (including admin objects) |
@@ -899,6 +899,9 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
899 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); | 899 | DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); |
900 | if (m_bypassPermissions) return m_bypassPermissionsValue; | 900 | if (m_bypassPermissions) return m_bypassPermissionsValue; |
901 | 901 | ||
902 | if (IsEstateManager(user) && m_RegionOwnerIsGod) | ||
903 | return true; | ||
904 | |||
902 | return IsAdministrator(user); | 905 | return IsAdministrator(user); |
903 | } | 906 | } |
904 | 907 | ||
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 27fad61..1dfa1b1 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -274,25 +274,25 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
274 | 274 | ||
275 | public event PlacesQuery OnPlacesQuery; | 275 | public event PlacesQuery OnPlacesQuery; |
276 | 276 | ||
277 | public event FindAgentUpdate OnFindAgentEvent; | 277 | public event FindAgentUpdate OnFindAgent; |
278 | public event TrackAgentUpdate OnTrackAgentEvent; | 278 | public event TrackAgentUpdate OnTrackAgent; |
279 | public event NewUserReport OnUserReportEvent; | 279 | public event NewUserReport OnUserReport; |
280 | public event SaveStateHandler OnSaveStateEvent; | 280 | public event SaveStateHandler OnSaveState; |
281 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 281 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
282 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 282 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
283 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 283 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
284 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 284 | public event FreezeUserUpdate OnParcelFreezeUser; |
285 | public event EjectUserUpdate OnParcelEjectUserEvent; | 285 | public event EjectUserUpdate OnParcelEjectUser; |
286 | public event ParcelBuyPass OnParcelBuyPass; | 286 | public event ParcelBuyPass OnParcelBuyPass; |
287 | public event ParcelGodMark OnParcelGodMark; | 287 | public event ParcelGodMark OnParcelGodMark; |
288 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 288 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
289 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 289 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
290 | public event SimWideDeletesDelegate OnSimWideDeletes; | 290 | public event SimWideDeletesDelegate OnSimWideDeletes; |
291 | public event SendPostcard OnSendPostcard; | 291 | public event SendPostcard OnSendPostcard; |
292 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 292 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
293 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 293 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
294 | public event GodlikeMessage onGodlikeMessageEvent; | 294 | public event GodlikeMessage onGodlikeMessage; |
295 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 295 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
296 | 296 | ||
297 | #pragma warning restore 67 | 297 | #pragma warning restore 67 |
298 | 298 | ||
@@ -879,7 +879,7 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
879 | { | 879 | { |
880 | } | 880 | } |
881 | 881 | ||
882 | public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID) | 882 | public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID) |
883 | { | 883 | { |
884 | } | 884 | } |
885 | 885 | ||
@@ -1133,7 +1133,15 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
1133 | } | 1133 | } |
1134 | 1134 | ||
1135 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1135 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1136 | { | 1136 | { |
1137 | } | ||
1138 | |||
1139 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1140 | { | ||
1141 | } | ||
1142 | |||
1143 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1144 | { | ||
1137 | } | 1145 | } |
1138 | } | 1146 | } |
1139 | } | 1147 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs index 5cdf191..d7fa316 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | |||
@@ -32,13 +32,29 @@ namespace OpenSim.Region.Framework.Interfaces | |||
32 | { | 32 | { |
33 | public delegate void ScriptCommand(UUID script, string id, string module, string command, string k); | 33 | public delegate void ScriptCommand(UUID script, string id, string module, string command, string k); |
34 | 34 | ||
35 | /// <summary> | ||
36 | /// Interface for communication between OpenSim modules and in-world scripts | ||
37 | /// </summary> | ||
38 | /// | ||
39 | /// See OpenSim.Region.ScriptEngine.Shared.Api.MOD_Api.modSendCommand() for information on receiving messages | ||
40 | /// from scripts in OpenSim modules. | ||
35 | public interface IScriptModuleComms | 41 | public interface IScriptModuleComms |
36 | { | 42 | { |
43 | /// <summary> | ||
44 | /// Modules can subscribe to this event to receive command invocations from in-world scripts | ||
45 | /// </summary> | ||
37 | event ScriptCommand OnScriptCommand; | 46 | event ScriptCommand OnScriptCommand; |
38 | 47 | ||
39 | void DispatchReply(UUID script, int code, string text, string k); | 48 | /// <summary> |
49 | /// Send a link_message event to an in-world script | ||
50 | /// </summary> | ||
51 | /// <param name="scriptId"></param> | ||
52 | /// <param name="code"></param> | ||
53 | /// <param name="text"></param> | ||
54 | /// <param name="key"></param> | ||
55 | void DispatchReply(UUID scriptId, int code, string text, string key); | ||
40 | 56 | ||
41 | // For use ONLY by the script API | 57 | // For use ONLY by the script API |
42 | void RaiseEvent(UUID script, string id, string module, string command, string k); | 58 | void RaiseEvent(UUID script, string id, string module, string command, string key); |
43 | } | 59 | } |
44 | } | 60 | } |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 753344d..399379e 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -183,12 +183,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
183 | 183 | ||
184 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; | 184 | public event ScriptNotAtTargetEvent OnScriptNotAtTargetEvent; |
185 | 185 | ||
186 | public delegate void ScriptAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion atrot); | ||
187 | |||
188 | public event ScriptAtRotTargetEvent OnScriptAtRotTargetEvent; | ||
189 | |||
190 | public delegate void ScriptNotAtRotTargetEvent(uint localID); | ||
191 | |||
192 | public event ScriptNotAtRotTargetEvent OnScriptNotAtRotTargetEvent; | ||
193 | |||
186 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); | 194 | public delegate void ScriptColliding(uint localID, ColliderArgs colliders); |
187 | 195 | ||
188 | public event ScriptColliding OnScriptColliderStart; | 196 | public event ScriptColliding OnScriptColliderStart; |
189 | public event ScriptColliding OnScriptColliding; | 197 | public event ScriptColliding OnScriptColliding; |
190 | public event ScriptColliding OnScriptCollidingEnd; | 198 | public event ScriptColliding OnScriptCollidingEnd; |
191 | 199 | ||
200 | public event ScriptColliding OnScriptLandColliderStart; | ||
201 | public event ScriptColliding OnScriptLandColliding; | ||
202 | public event ScriptColliding OnScriptLandColliderEnd; | ||
203 | |||
192 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); | 204 | public delegate void OnMakeChildAgentDelegate(ScenePresence presence); |
193 | public event OnMakeChildAgentDelegate OnMakeChildAgent; | 205 | public event OnMakeChildAgentDelegate OnMakeChildAgent; |
194 | 206 | ||
@@ -380,6 +392,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
380 | private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent; | 392 | private ScriptChangedEvent handlerScriptChangedEvent = null; //OnScriptChangedEvent; |
381 | private ScriptAtTargetEvent handlerScriptAtTargetEvent = null; | 393 | private ScriptAtTargetEvent handlerScriptAtTargetEvent = null; |
382 | private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null; | 394 | private ScriptNotAtTargetEvent handlerScriptNotAtTargetEvent = null; |
395 | private ScriptAtRotTargetEvent handlerScriptAtRotTargetEvent = null; | ||
396 | private ScriptNotAtRotTargetEvent handlerScriptNotAtRotTargetEvent = null; | ||
383 | private ClientMovement handlerClientMovement = null; //OnClientMovement; | 397 | private ClientMovement handlerClientMovement = null; //OnClientMovement; |
384 | private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError; | 398 | private OnPermissionErrorDelegate handlerPermissionError = null; //OnPermissionError; |
385 | private OnPluginConsoleDelegate handlerPluginConsole = null; //OnPluginConsole; | 399 | private OnPluginConsoleDelegate handlerPluginConsole = null; //OnPluginConsole; |
@@ -439,6 +453,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
439 | private ScriptColliding handlerCollidingStart = null; | 453 | private ScriptColliding handlerCollidingStart = null; |
440 | private ScriptColliding handlerColliding = null; | 454 | private ScriptColliding handlerColliding = null; |
441 | private ScriptColliding handlerCollidingEnd = null; | 455 | private ScriptColliding handlerCollidingEnd = null; |
456 | private ScriptColliding handlerLandCollidingStart = null; | ||
457 | private ScriptColliding handlerLandColliding = null; | ||
458 | private ScriptColliding handlerLandCollidingEnd = null; | ||
442 | private GetScriptRunning handlerGetScriptRunning = null; | 459 | private GetScriptRunning handlerGetScriptRunning = null; |
443 | 460 | ||
444 | private SunLindenHour handlerCurrentTimeAsLindenSunHour = null; | 461 | private SunLindenHour handlerCurrentTimeAsLindenSunHour = null; |
@@ -844,6 +861,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
844 | } | 861 | } |
845 | } | 862 | } |
846 | 863 | ||
864 | public void TriggerAtRotTargetEvent(uint localID, uint handle, Quaternion targetrot, Quaternion currentrot) | ||
865 | { | ||
866 | handlerScriptAtRotTargetEvent = OnScriptAtRotTargetEvent; | ||
867 | if (handlerScriptAtRotTargetEvent != null) | ||
868 | { | ||
869 | handlerScriptAtRotTargetEvent(localID, handle, targetrot, currentrot); | ||
870 | } | ||
871 | } | ||
872 | |||
873 | public void TriggerNotAtRotTargetEvent(uint localID) | ||
874 | { | ||
875 | handlerScriptNotAtRotTargetEvent = OnScriptNotAtRotTargetEvent; | ||
876 | if (handlerScriptNotAtRotTargetEvent != null) | ||
877 | { | ||
878 | handlerScriptNotAtRotTargetEvent(localID); | ||
879 | } | ||
880 | } | ||
881 | |||
847 | public void TriggerRequestChangeWaterHeight(float height) | 882 | public void TriggerRequestChangeWaterHeight(float height) |
848 | { | 883 | { |
849 | handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; | 884 | handlerRequestChangeWaterHeight = OnRequestChangeWaterHeight; |
@@ -1034,6 +1069,27 @@ namespace OpenSim.Region.Framework.Scenes | |||
1034 | handlerCollidingEnd(localId, colliders); | 1069 | handlerCollidingEnd(localId, colliders); |
1035 | } | 1070 | } |
1036 | 1071 | ||
1072 | public void TriggerScriptLandCollidingStart(uint localId, ColliderArgs colliders) | ||
1073 | { | ||
1074 | handlerLandCollidingStart = OnScriptLandColliderStart; | ||
1075 | if (handlerLandCollidingStart != null) | ||
1076 | handlerLandCollidingStart(localId, colliders); | ||
1077 | } | ||
1078 | |||
1079 | public void TriggerScriptLandColliding(uint localId, ColliderArgs colliders) | ||
1080 | { | ||
1081 | handlerLandColliding = OnScriptLandColliding; | ||
1082 | if (handlerLandColliding != null) | ||
1083 | handlerLandColliding(localId, colliders); | ||
1084 | } | ||
1085 | |||
1086 | public void TriggerScriptLandCollidingEnd(uint localId, ColliderArgs colliders) | ||
1087 | { | ||
1088 | handlerLandCollidingEnd = OnScriptLandColliderEnd; | ||
1089 | if (handlerLandCollidingEnd != null) | ||
1090 | handlerLandCollidingEnd(localId, colliders); | ||
1091 | } | ||
1092 | |||
1037 | public void TriggerSetRootAgentScene(UUID agentID, Scene scene) | 1093 | public void TriggerSetRootAgentScene(UUID agentID, Scene scene) |
1038 | { | 1094 | { |
1039 | handlerSetRootAgentScene = OnSetRootAgentScene; | 1095 | handlerSetRootAgentScene = OnSetRootAgentScene; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 62734ff..7b582a9 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -142,7 +142,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
142 | protected AgentCircuitManager m_authenticateHandler; | 142 | protected AgentCircuitManager m_authenticateHandler; |
143 | 143 | ||
144 | protected SceneCommunicationService m_sceneGridService; | 144 | protected SceneCommunicationService m_sceneGridService; |
145 | public bool loginsdisabled = true; | 145 | public bool LoginsDisabled = true; |
146 | 146 | ||
147 | public new float TimeDilation | 147 | public new float TimeDilation |
148 | { | 148 | { |
@@ -1366,15 +1366,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1366 | StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); | 1366 | StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); |
1367 | } | 1367 | } |
1368 | 1368 | ||
1369 | if (loginsdisabled && m_frame > 20) | 1369 | if (LoginsDisabled && m_frame == 20) |
1370 | { | 1370 | { |
1371 | // In 99.9% of cases it is a bad idea to manually force garbage collection. However, | 1371 | // In 99.9% of cases it is a bad idea to manually force garbage collection. However, |
1372 | // this is a rare case where we know we have just went through a long cycle of heap | 1372 | // this is a rare case where we know we have just went through a long cycle of heap |
1373 | // allocations, and there is no more work to be done until someone logs in | 1373 | // allocations, and there is no more work to be done until someone logs in |
1374 | GC.Collect(); | 1374 | GC.Collect(); |
1375 | 1375 | ||
1376 | m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); | 1376 | IConfig startupConfig = m_config.Configs["Startup"]; |
1377 | loginsdisabled = false; | 1377 | if (startupConfig == null || !startupConfig.GetBoolean("StartDisabled", false)) |
1378 | { | ||
1379 | m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); | ||
1380 | LoginsDisabled = false; | ||
1381 | } | ||
1378 | } | 1382 | } |
1379 | } | 1383 | } |
1380 | catch (NotImplementedException) | 1384 | catch (NotImplementedException) |
@@ -1649,9 +1653,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1649 | //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); | 1653 | //m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); |
1650 | 1654 | ||
1651 | GridRegion region = new GridRegion(RegionInfo); | 1655 | GridRegion region = new GridRegion(RegionInfo); |
1652 | bool success = GridService.RegisterRegion(RegionInfo.ScopeID, region); | 1656 | string error = GridService.RegisterRegion(RegionInfo.ScopeID, region); |
1653 | if (!success) | 1657 | if (error != String.Empty) |
1654 | throw new Exception("Can't register with grid"); | 1658 | throw new Exception(error); |
1655 | 1659 | ||
1656 | m_sceneGridService.SetScene(this); | 1660 | m_sceneGridService.SetScene(this); |
1657 | m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); | 1661 | m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo); |
@@ -3404,7 +3408,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3404 | // TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport | 3408 | // TeleportFlags.ViaLandmark | TeleportFlags.ViaLocation | TeleportFlags.ViaLandmark | TeleportFlags.Default - Regular Teleport |
3405 | 3409 | ||
3406 | 3410 | ||
3407 | if (loginsdisabled) | 3411 | if (LoginsDisabled) |
3408 | { | 3412 | { |
3409 | reason = "Logins Disabled"; | 3413 | reason = "Logins Disabled"; |
3410 | return false; | 3414 | return false; |
@@ -3577,8 +3581,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
3577 | return false; | 3581 | return false; |
3578 | } | 3582 | } |
3579 | 3583 | ||
3584 | IGroupsModule groupsModule = | ||
3585 | RequestModuleInterface<IGroupsModule>(); | ||
3586 | |||
3587 | List<UUID> agentGroups = new List<UUID>(); | ||
3588 | |||
3589 | if (groupsModule != null) | ||
3590 | { | ||
3591 | GroupMembershipData[] GroupMembership = | ||
3592 | groupsModule.GetMembershipData(agent.AgentID); | ||
3593 | |||
3594 | for (int i = 0; i < GroupMembership.Length; i++) | ||
3595 | agentGroups.Add(GroupMembership[i].GroupID); | ||
3596 | } | ||
3597 | |||
3598 | bool groupAccess = false; | ||
3599 | UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; | ||
3600 | |||
3601 | foreach (UUID group in estateGroups) | ||
3602 | { | ||
3603 | if (agentGroups.Contains(group)) | ||
3604 | { | ||
3605 | groupAccess = true; | ||
3606 | break; | ||
3607 | } | ||
3608 | } | ||
3609 | |||
3580 | if (!m_regInfo.EstateSettings.PublicAccess && | 3610 | if (!m_regInfo.EstateSettings.PublicAccess && |
3581 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID)) | 3611 | !m_regInfo.EstateSettings.HasAccess(agent.AgentID) && |
3612 | !groupAccess) | ||
3582 | { | 3613 | { |
3583 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", | 3614 | m_log.WarnFormat("[CONNECTION BEGIN]: Denied access to: {0} ({1} {2}) at {3} because the user does not have access to the estate", |
3584 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); | 3615 | agent.AgentID, agent.firstname, agent.lastname, RegionInfo.RegionName); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index a67b42a..f1813a5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -60,12 +60,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
60 | 60 | ||
61 | protected RegionCommsListener regionCommsHost; | 61 | protected RegionCommsListener regionCommsHost; |
62 | 62 | ||
63 | public bool RegionLoginsEnabled | 63 | protected List<UUID> m_agentsInTransit; |
64 | { | ||
65 | get { return m_regionLoginsEnabled; } | ||
66 | set { m_regionLoginsEnabled = value; } | ||
67 | } | ||
68 | private bool m_regionLoginsEnabled = false; | ||
69 | 64 | ||
70 | /// <summary> | 65 | /// <summary> |
71 | /// An agent is crossing into this region | 66 | /// An agent is crossing into this region |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 34d8b49..ec41ac7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -57,6 +57,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
57 | land_collision_end = 4096, | 57 | land_collision_end = 4096, |
58 | land_collision_start = 8192, | 58 | land_collision_start = 8192, |
59 | at_target = 16384, | 59 | at_target = 16384, |
60 | at_rot_target = 16777216, | ||
60 | listen = 32768, | 61 | listen = 32768, |
61 | money = 65536, | 62 | money = 65536, |
62 | moving_end = 131072, | 63 | moving_end = 131072, |
@@ -81,6 +82,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
81 | public uint handle; | 82 | public uint handle; |
82 | } | 83 | } |
83 | 84 | ||
85 | struct scriptRotTarget | ||
86 | { | ||
87 | public Quaternion targetRot; | ||
88 | public float tolerance; | ||
89 | public uint handle; | ||
90 | } | ||
91 | |||
84 | public delegate void PrimCountTaintedDelegate(); | 92 | public delegate void PrimCountTaintedDelegate(); |
85 | 93 | ||
86 | /// <summary> | 94 | /// <summary> |
@@ -166,10 +174,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
166 | // private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); | 174 | // private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); |
167 | 175 | ||
168 | private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>(); | 176 | private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>(); |
177 | private Dictionary<uint, scriptRotTarget> m_rotTargets = new Dictionary<uint, scriptRotTarget>(); | ||
169 | 178 | ||
170 | private bool m_scriptListens_atTarget = false; | 179 | private bool m_scriptListens_atTarget = false; |
171 | private bool m_scriptListens_notAtTarget = false; | 180 | private bool m_scriptListens_notAtTarget = false; |
172 | 181 | ||
182 | private bool m_scriptListens_atRotTarget = false; | ||
183 | private bool m_scriptListens_notAtRotTarget = false; | ||
184 | |||
173 | internal Dictionary<UUID, string> m_savedScriptState = null; | 185 | internal Dictionary<UUID, string> m_savedScriptState = null; |
174 | 186 | ||
175 | #region Properties | 187 | #region Properties |
@@ -1262,6 +1274,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1262 | m_targets.Clear(); | 1274 | m_targets.Clear(); |
1263 | m_scene.RemoveGroupTarget(this); | 1275 | m_scene.RemoveGroupTarget(this); |
1264 | } | 1276 | } |
1277 | m_scriptListens_atRotTarget = ((aggregateScriptEvents & scriptEvents.at_rot_target) != 0); | ||
1278 | m_scriptListens_notAtRotTarget = ((aggregateScriptEvents & scriptEvents.not_at_rot_target) != 0); | ||
1279 | |||
1280 | if (!m_scriptListens_atRotTarget && !m_scriptListens_notAtRotTarget) | ||
1281 | { | ||
1282 | lock (m_rotTargets) | ||
1283 | m_rotTargets.Clear(); | ||
1284 | m_scene.RemoveGroupTarget(this); | ||
1285 | } | ||
1265 | 1286 | ||
1266 | ScheduleGroupForFullUpdate(); | 1287 | ScheduleGroupForFullUpdate(); |
1267 | } | 1288 | } |
@@ -3158,6 +3179,30 @@ namespace OpenSim.Region.Framework.Scenes | |||
3158 | 3179 | ||
3159 | } | 3180 | } |
3160 | } | 3181 | } |
3182 | public int registerRotTargetWaypoint(Quaternion target, float tolerance) | ||
3183 | { | ||
3184 | scriptRotTarget waypoint = new scriptRotTarget(); | ||
3185 | waypoint.targetRot = target; | ||
3186 | waypoint.tolerance = tolerance; | ||
3187 | uint handle = m_scene.AllocateLocalId(); | ||
3188 | waypoint.handle = handle; | ||
3189 | lock (m_rotTargets) | ||
3190 | { | ||
3191 | m_rotTargets.Add(handle, waypoint); | ||
3192 | } | ||
3193 | m_scene.AddGroupTarget(this); | ||
3194 | return (int)handle; | ||
3195 | } | ||
3196 | |||
3197 | public void unregisterRotTargetWaypoint(int handle) | ||
3198 | { | ||
3199 | lock (m_targets) | ||
3200 | { | ||
3201 | m_rotTargets.Remove((uint)handle); | ||
3202 | if (m_targets.Count == 0) | ||
3203 | m_scene.RemoveGroupTarget(this); | ||
3204 | } | ||
3205 | } | ||
3161 | 3206 | ||
3162 | public int registerTargetWaypoint(Vector3 target, float tolerance) | 3207 | public int registerTargetWaypoint(Vector3 target, float tolerance) |
3163 | { | 3208 | { |
@@ -3264,6 +3309,85 @@ namespace OpenSim.Region.Framework.Scenes | |||
3264 | } | 3309 | } |
3265 | } | 3310 | } |
3266 | } | 3311 | } |
3312 | if (m_scriptListens_atRotTarget || m_scriptListens_notAtRotTarget) | ||
3313 | { | ||
3314 | if (m_rotTargets.Count > 0) | ||
3315 | { | ||
3316 | bool at_Rottarget = false; | ||
3317 | Dictionary<uint, scriptRotTarget> atRotTargets = new Dictionary<uint, scriptRotTarget>(); | ||
3318 | lock (m_rotTargets) | ||
3319 | { | ||
3320 | foreach (uint idx in m_rotTargets.Keys) | ||
3321 | { | ||
3322 | scriptRotTarget target = m_rotTargets[idx]; | ||
3323 | double angle = Math.Acos(target.targetRot.X * m_rootPart.RotationOffset.X + target.targetRot.Y * m_rootPart.RotationOffset.Y + target.targetRot.Z * m_rootPart.RotationOffset.Z + target.targetRot.W * m_rootPart.RotationOffset.W) * 2; | ||
3324 | if (angle < 0) angle = -angle; | ||
3325 | if (angle > Math.PI) angle = (Math.PI * 2 - angle); | ||
3326 | if (angle <= target.tolerance) | ||
3327 | { | ||
3328 | // trigger at_rot_target | ||
3329 | if (m_scriptListens_atRotTarget) | ||
3330 | { | ||
3331 | at_Rottarget = true; | ||
3332 | scriptRotTarget att = new scriptRotTarget(); | ||
3333 | att.targetRot = target.targetRot; | ||
3334 | att.tolerance = target.tolerance; | ||
3335 | att.handle = target.handle; | ||
3336 | atRotTargets.Add(idx, att); | ||
3337 | } | ||
3338 | } | ||
3339 | } | ||
3340 | } | ||
3341 | |||
3342 | if (atRotTargets.Count > 0) | ||
3343 | { | ||
3344 | uint[] localids = new uint[0]; | ||
3345 | lock (m_parts) | ||
3346 | { | ||
3347 | localids = new uint[m_parts.Count]; | ||
3348 | int cntr = 0; | ||
3349 | foreach (SceneObjectPart part in m_parts.Values) | ||
3350 | { | ||
3351 | localids[cntr] = part.LocalId; | ||
3352 | cntr++; | ||
3353 | } | ||
3354 | } | ||
3355 | |||
3356 | for (int ctr = 0; ctr < localids.Length; ctr++) | ||
3357 | { | ||
3358 | foreach (uint target in atRotTargets.Keys) | ||
3359 | { | ||
3360 | scriptRotTarget att = atRotTargets[target]; | ||
3361 | m_scene.EventManager.TriggerAtRotTargetEvent( | ||
3362 | localids[ctr], att.handle, att.targetRot, m_rootPart.RotationOffset); | ||
3363 | } | ||
3364 | } | ||
3365 | |||
3366 | return; | ||
3367 | } | ||
3368 | |||
3369 | if (m_scriptListens_notAtRotTarget && !at_Rottarget) | ||
3370 | { | ||
3371 | //trigger not_at_target | ||
3372 | uint[] localids = new uint[0]; | ||
3373 | lock (m_parts) | ||
3374 | { | ||
3375 | localids = new uint[m_parts.Count]; | ||
3376 | int cntr = 0; | ||
3377 | foreach (SceneObjectPart part in m_parts.Values) | ||
3378 | { | ||
3379 | localids[cntr] = part.LocalId; | ||
3380 | cntr++; | ||
3381 | } | ||
3382 | } | ||
3383 | |||
3384 | for (int ctr = 0; ctr < localids.Length; ctr++) | ||
3385 | { | ||
3386 | m_scene.EventManager.TriggerNotAtRotTargetEvent(localids[ctr]); | ||
3387 | } | ||
3388 | } | ||
3389 | } | ||
3390 | } | ||
3267 | } | 3391 | } |
3268 | 3392 | ||
3269 | public float GetMass() | 3393 | public float GetMass() |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 22a8ca1..56b2f13 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -140,6 +140,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | 140 | ||
141 | [XmlIgnore] | 141 | [XmlIgnore] |
142 | public UUID FromItemID; | 142 | public UUID FromItemID; |
143 | |||
144 | [XmlIgnore] | ||
145 | public int STATUS_ROTATE_X; | ||
146 | |||
147 | [XmlIgnore] | ||
148 | public int STATUS_ROTATE_Y; | ||
149 | |||
150 | [XmlIgnore] | ||
151 | public int STATUS_ROTATE_Z; | ||
143 | 152 | ||
144 | [XmlIgnore] | 153 | [XmlIgnore] |
145 | private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); | 154 | private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); |
@@ -1673,6 +1682,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
1673 | return m_parentGroup.RootPart.DIE_AT_EDGE; | 1682 | return m_parentGroup.RootPart.DIE_AT_EDGE; |
1674 | } | 1683 | } |
1675 | 1684 | ||
1685 | public int GetAxisRotation(int axis) | ||
1686 | { | ||
1687 | //Cannot use ScriptBaseClass constants as no referance to it currently. | ||
1688 | if (axis == 2)//STATUS_ROTATE_X | ||
1689 | return STATUS_ROTATE_X; | ||
1690 | if (axis == 4)//STATUS_ROTATE_Y | ||
1691 | return STATUS_ROTATE_Y; | ||
1692 | if (axis == 8)//STATUS_ROTATE_Z | ||
1693 | return STATUS_ROTATE_Z; | ||
1694 | |||
1695 | return 0; | ||
1696 | } | ||
1697 | |||
1676 | public double GetDistanceTo(Vector3 a, Vector3 b) | 1698 | public double GetDistanceTo(Vector3 a, Vector3 b) |
1677 | { | 1699 | { |
1678 | float dx = a.X - b.X; | 1700 | float dx = a.X - b.X; |
@@ -1831,16 +1853,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1831 | // and build up list of colliders this time | 1853 | // and build up list of colliders this time |
1832 | foreach (uint localid in collissionswith.Keys) | 1854 | foreach (uint localid in collissionswith.Keys) |
1833 | { | 1855 | { |
1834 | if (localid != 0) | 1856 | thisHitColliders.Add(localid); |
1857 | if (!m_lastColliders.Contains(localid)) | ||
1835 | { | 1858 | { |
1836 | thisHitColliders.Add(localid); | 1859 | startedColliders.Add(localid); |
1837 | if (!m_lastColliders.Contains(localid)) | ||
1838 | { | ||
1839 | startedColliders.Add(localid); | ||
1840 | } | ||
1841 | |||
1842 | //m_log.Debug("[OBJECT]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString()); | ||
1843 | } | 1860 | } |
1861 | //m_log.Debug("[OBJECT]: Collided with:" + localid.ToString() + " at depth of: " + collissionswith[localid].ToString()); | ||
1844 | } | 1862 | } |
1845 | 1863 | ||
1846 | // calculate things that ended colliding | 1864 | // calculate things that ended colliding |
@@ -1882,6 +1900,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1882 | List<DetectedObject> colliding = new List<DetectedObject>(); | 1900 | List<DetectedObject> colliding = new List<DetectedObject>(); |
1883 | foreach (uint localId in startedColliders) | 1901 | foreach (uint localId in startedColliders) |
1884 | { | 1902 | { |
1903 | if (localId == 0) | ||
1904 | return; | ||
1885 | // always running this check because if the user deletes the object it would return a null reference. | 1905 | // always running this check because if the user deletes the object it would return a null reference. |
1886 | if (m_parentGroup == null) | 1906 | if (m_parentGroup == null) |
1887 | return; | 1907 | return; |
@@ -1919,7 +1939,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1919 | { | 1939 | { |
1920 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1940 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1921 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | 1941 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work |
1922 | if (found) | 1942 | if (!found) |
1923 | { | 1943 | { |
1924 | DetectedObject detobj = new DetectedObject(); | 1944 | DetectedObject detobj = new DetectedObject(); |
1925 | detobj.keyUUID = obj.UUID; | 1945 | detobj.keyUUID = obj.UUID; |
@@ -1944,7 +1964,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1944 | 1964 | ||
1945 | if (av.LocalId == localId) | 1965 | if (av.LocalId == localId) |
1946 | { | 1966 | { |
1947 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 1967 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
1948 | { | 1968 | { |
1949 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1969 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1950 | //If it is 1, it is to accept ONLY collisions from this avatar | 1970 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -1970,7 +1990,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1970 | { | 1990 | { |
1971 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 1991 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1972 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 1992 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
1973 | if (found) | 1993 | if (!found) |
1974 | { | 1994 | { |
1975 | DetectedObject detobj = new DetectedObject(); | 1995 | DetectedObject detobj = new DetectedObject(); |
1976 | detobj.keyUUID = av.UUID; | 1996 | detobj.keyUUID = av.UUID; |
@@ -2017,7 +2037,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2017 | { | 2037 | { |
2018 | // always running this check because if the user deletes the object it would return a null reference. | 2038 | // always running this check because if the user deletes the object it would return a null reference. |
2019 | if (localId == 0) | 2039 | if (localId == 0) |
2020 | continue; | 2040 | return; |
2021 | 2041 | ||
2022 | if (m_parentGroup == null) | 2042 | if (m_parentGroup == null) |
2023 | return; | 2043 | return; |
@@ -2055,7 +2075,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2055 | { | 2075 | { |
2056 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2076 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2057 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | 2077 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work |
2058 | if (found) | 2078 | if (!found) |
2059 | { | 2079 | { |
2060 | DetectedObject detobj = new DetectedObject(); | 2080 | DetectedObject detobj = new DetectedObject(); |
2061 | detobj.keyUUID = obj.UUID; | 2081 | detobj.keyUUID = obj.UUID; |
@@ -2080,7 +2100,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2080 | 2100 | ||
2081 | if (av.LocalId == localId) | 2101 | if (av.LocalId == localId) |
2082 | { | 2102 | { |
2083 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2103 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2084 | { | 2104 | { |
2085 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2105 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2086 | //If it is 1, it is to accept ONLY collisions from this avatar | 2106 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -2106,7 +2126,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2106 | { | 2126 | { |
2107 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2127 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2108 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2128 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2109 | if (found) | 2129 | if (!found) |
2110 | { | 2130 | { |
2111 | DetectedObject detobj = new DetectedObject(); | 2131 | DetectedObject detobj = new DetectedObject(); |
2112 | detobj.keyUUID = av.UUID; | 2132 | detobj.keyUUID = av.UUID; |
@@ -2149,7 +2169,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2149 | foreach (uint localId in endedColliders) | 2169 | foreach (uint localId in endedColliders) |
2150 | { | 2170 | { |
2151 | if (localId == 0) | 2171 | if (localId == 0) |
2152 | continue; | 2172 | return; |
2153 | 2173 | ||
2154 | // always running this check because if the user deletes the object it would return a null reference. | 2174 | // always running this check because if the user deletes the object it would return a null reference. |
2155 | if (m_parentGroup == null) | 2175 | if (m_parentGroup == null) |
@@ -2186,7 +2206,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2186 | { | 2206 | { |
2187 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2207 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2188 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | 2208 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work |
2189 | if (found) | 2209 | if (!found) |
2190 | { | 2210 | { |
2191 | DetectedObject detobj = new DetectedObject(); | 2211 | DetectedObject detobj = new DetectedObject(); |
2192 | detobj.keyUUID = obj.UUID; | 2212 | detobj.keyUUID = obj.UUID; |
@@ -2211,7 +2231,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2211 | 2231 | ||
2212 | if (av.LocalId == localId) | 2232 | if (av.LocalId == localId) |
2213 | { | 2233 | { |
2214 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) | 2234 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(av.Name)) |
2215 | { | 2235 | { |
2216 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2236 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2217 | //If it is 1, it is to accept ONLY collisions from this avatar | 2237 | //If it is 1, it is to accept ONLY collisions from this avatar |
@@ -2237,7 +2257,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2237 | { | 2257 | { |
2238 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | 2258 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2239 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | 2259 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work |
2240 | if (found) | 2260 | if (!found) |
2241 | { | 2261 | { |
2242 | DetectedObject detobj = new DetectedObject(); | 2262 | DetectedObject detobj = new DetectedObject(); |
2243 | detobj.keyUUID = av.UUID; | 2263 | detobj.keyUUID = av.UUID; |
@@ -2271,6 +2291,120 @@ namespace OpenSim.Region.Framework.Scenes | |||
2271 | } | 2291 | } |
2272 | } | 2292 | } |
2273 | } | 2293 | } |
2294 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision_start) != 0) | ||
2295 | { | ||
2296 | if (startedColliders.Count > 0) | ||
2297 | { | ||
2298 | ColliderArgs LandStartCollidingMessage = new ColliderArgs(); | ||
2299 | List<DetectedObject> colliding = new List<DetectedObject>(); | ||
2300 | foreach (uint localId in startedColliders) | ||
2301 | { | ||
2302 | if (localId == 0) | ||
2303 | { | ||
2304 | //Hope that all is left is ground! | ||
2305 | DetectedObject detobj = new DetectedObject(); | ||
2306 | detobj.keyUUID = UUID.Zero; | ||
2307 | detobj.nameStr = ""; | ||
2308 | detobj.ownerUUID = UUID.Zero; | ||
2309 | detobj.posVector = m_parentGroup.RootPart.AbsolutePosition; | ||
2310 | detobj.rotQuat = Quaternion.Identity; | ||
2311 | detobj.velVector = Vector3.Zero; | ||
2312 | detobj.colliderType = 0; | ||
2313 | detobj.groupUUID = UUID.Zero; | ||
2314 | colliding.Add(detobj); | ||
2315 | } | ||
2316 | } | ||
2317 | |||
2318 | if (colliding.Count > 0) | ||
2319 | { | ||
2320 | LandStartCollidingMessage.Colliders = colliding; | ||
2321 | // always running this check because if the user deletes the object it would return a null reference. | ||
2322 | if (m_parentGroup == null) | ||
2323 | return; | ||
2324 | |||
2325 | if (m_parentGroup.Scene == null) | ||
2326 | return; | ||
2327 | |||
2328 | m_parentGroup.Scene.EventManager.TriggerScriptLandCollidingStart(LocalId, LandStartCollidingMessage); | ||
2329 | } | ||
2330 | } | ||
2331 | } | ||
2332 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision) != 0) | ||
2333 | { | ||
2334 | if (m_lastColliders.Count > 0) | ||
2335 | { | ||
2336 | ColliderArgs LandCollidingMessage = new ColliderArgs(); | ||
2337 | List<DetectedObject> colliding = new List<DetectedObject>(); | ||
2338 | foreach (uint localId in startedColliders) | ||
2339 | { | ||
2340 | if (localId == 0) | ||
2341 | { | ||
2342 | //Hope that all is left is ground! | ||
2343 | DetectedObject detobj = new DetectedObject(); | ||
2344 | detobj.keyUUID = UUID.Zero; | ||
2345 | detobj.nameStr = ""; | ||
2346 | detobj.ownerUUID = UUID.Zero; | ||
2347 | detobj.posVector = m_parentGroup.RootPart.AbsolutePosition; | ||
2348 | detobj.rotQuat = Quaternion.Identity; | ||
2349 | detobj.velVector = Vector3.Zero; | ||
2350 | detobj.colliderType = 0; | ||
2351 | detobj.groupUUID = UUID.Zero; | ||
2352 | colliding.Add(detobj); | ||
2353 | } | ||
2354 | } | ||
2355 | |||
2356 | if (colliding.Count > 0) | ||
2357 | { | ||
2358 | LandCollidingMessage.Colliders = colliding; | ||
2359 | // always running this check because if the user deletes the object it would return a null reference. | ||
2360 | if (m_parentGroup == null) | ||
2361 | return; | ||
2362 | |||
2363 | if (m_parentGroup.Scene == null) | ||
2364 | return; | ||
2365 | |||
2366 | m_parentGroup.Scene.EventManager.TriggerScriptLandColliding(LocalId, LandCollidingMessage); | ||
2367 | } | ||
2368 | } | ||
2369 | } | ||
2370 | if ((m_parentGroup.RootPart.ScriptEvents & scriptEvents.land_collision_end) != 0) | ||
2371 | { | ||
2372 | if (endedColliders.Count > 0) | ||
2373 | { | ||
2374 | ColliderArgs LandEndCollidingMessage = new ColliderArgs(); | ||
2375 | List<DetectedObject> colliding = new List<DetectedObject>(); | ||
2376 | foreach (uint localId in startedColliders) | ||
2377 | { | ||
2378 | if (localId == 0) | ||
2379 | { | ||
2380 | //Hope that all is left is ground! | ||
2381 | DetectedObject detobj = new DetectedObject(); | ||
2382 | detobj.keyUUID = UUID.Zero; | ||
2383 | detobj.nameStr = ""; | ||
2384 | detobj.ownerUUID = UUID.Zero; | ||
2385 | detobj.posVector = m_parentGroup.RootPart.AbsolutePosition; | ||
2386 | detobj.rotQuat = Quaternion.Identity; | ||
2387 | detobj.velVector = Vector3.Zero; | ||
2388 | detobj.colliderType = 0; | ||
2389 | detobj.groupUUID = UUID.Zero; | ||
2390 | colliding.Add(detobj); | ||
2391 | } | ||
2392 | } | ||
2393 | |||
2394 | if (colliding.Count > 0) | ||
2395 | { | ||
2396 | LandEndCollidingMessage.Colliders = colliding; | ||
2397 | // always running this check because if the user deletes the object it would return a null reference. | ||
2398 | if (m_parentGroup == null) | ||
2399 | return; | ||
2400 | |||
2401 | if (m_parentGroup.Scene == null) | ||
2402 | return; | ||
2403 | |||
2404 | m_parentGroup.Scene.EventManager.TriggerScriptLandCollidingEnd(LocalId, LandEndCollidingMessage); | ||
2405 | } | ||
2406 | } | ||
2407 | } | ||
2274 | } | 2408 | } |
2275 | 2409 | ||
2276 | public void PhysicsOutOfBounds(Vector3 pos) | 2410 | public void PhysicsOutOfBounds(Vector3 pos) |
@@ -2737,6 +2871,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2737 | { | 2871 | { |
2738 | m_parentGroup.SetAxisRotation(axis, rotate); | 2872 | m_parentGroup.SetAxisRotation(axis, rotate); |
2739 | } | 2873 | } |
2874 | //Cannot use ScriptBaseClass constants as no referance to it currently. | ||
2875 | if (axis == 2)//STATUS_ROTATE_X | ||
2876 | STATUS_ROTATE_X = rotate; | ||
2877 | if (axis == 4)//STATUS_ROTATE_Y | ||
2878 | STATUS_ROTATE_Y = rotate; | ||
2879 | if (axis == 8)//STATUS_ROTATE_Z | ||
2880 | STATUS_ROTATE_Z = rotate; | ||
2740 | } | 2881 | } |
2741 | 2882 | ||
2742 | public void SetBuoyancy(float fvalue) | 2883 | public void SetBuoyancy(float fvalue) |
@@ -3669,6 +3810,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3669 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || | 3810 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || |
3670 | ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || | 3811 | ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || |
3671 | ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || | 3812 | ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || |
3813 | ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || | ||
3814 | ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || | ||
3815 | ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || | ||
3672 | (CollisionSound != UUID.Zero) | 3816 | (CollisionSound != UUID.Zero) |
3673 | ) | 3817 | ) |
3674 | { | 3818 | { |
@@ -3873,6 +4017,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
3873 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || | 4017 | ((AggregateScriptEvents & scriptEvents.collision) != 0) || |
3874 | ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || | 4018 | ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || |
3875 | ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || | 4019 | ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || |
4020 | ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || | ||
4021 | ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || | ||
4022 | ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || | ||
3876 | (CollisionSound != UUID.Zero) | 4023 | (CollisionSound != UUID.Zero) |
3877 | ) | 4024 | ) |
3878 | { | 4025 | { |
@@ -3933,6 +4080,23 @@ namespace OpenSim.Region.Framework.Scenes | |||
3933 | } | 4080 | } |
3934 | } | 4081 | } |
3935 | 4082 | ||
4083 | public int registerRotTargetWaypoint(Quaternion target, float tolerance) | ||
4084 | { | ||
4085 | if (m_parentGroup != null) | ||
4086 | { | ||
4087 | return m_parentGroup.registerRotTargetWaypoint(target, tolerance); | ||
4088 | } | ||
4089 | return 0; | ||
4090 | } | ||
4091 | |||
4092 | public void unregisterRotTargetWaypoint(int handle) | ||
4093 | { | ||
4094 | if (m_parentGroup != null) | ||
4095 | { | ||
4096 | m_parentGroup.unregisterRotTargetWaypoint(handle); | ||
4097 | } | ||
4098 | } | ||
4099 | |||
3936 | public void SetCameraAtOffset(Vector3 v) | 4100 | public void SetCameraAtOffset(Vector3 v) |
3937 | { | 4101 | { |
3938 | m_cameraAtOffset = v; | 4102 | m_cameraAtOffset = v; |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 5d97a12..6785c08 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -836,25 +836,25 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
836 | public event MuteListRequest OnMuteListRequest; | 836 | public event MuteListRequest OnMuteListRequest; |
837 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 837 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
838 | public event PlacesQuery OnPlacesQuery; | 838 | public event PlacesQuery OnPlacesQuery; |
839 | public event FindAgentUpdate OnFindAgentEvent; | 839 | public event FindAgentUpdate OnFindAgent; |
840 | public event TrackAgentUpdate OnTrackAgentEvent; | 840 | public event TrackAgentUpdate OnTrackAgent; |
841 | public event NewUserReport OnUserReportEvent; | 841 | public event NewUserReport OnUserReport; |
842 | public event SaveStateHandler OnSaveStateEvent; | 842 | public event SaveStateHandler OnSaveState; |
843 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 843 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
844 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 844 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
845 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 845 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
846 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 846 | public event FreezeUserUpdate OnParcelFreezeUser; |
847 | public event EjectUserUpdate OnParcelEjectUserEvent; | 847 | public event EjectUserUpdate OnParcelEjectUser; |
848 | public event ParcelBuyPass OnParcelBuyPass; | 848 | public event ParcelBuyPass OnParcelBuyPass; |
849 | public event ParcelGodMark OnParcelGodMark; | 849 | public event ParcelGodMark OnParcelGodMark; |
850 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 850 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
851 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 851 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
852 | public event SimWideDeletesDelegate OnSimWideDeletes; | 852 | public event SimWideDeletesDelegate OnSimWideDeletes; |
853 | public event SendPostcard OnSendPostcard; | 853 | public event SendPostcard OnSendPostcard; |
854 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 854 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
855 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 855 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
856 | public event GodlikeMessage onGodlikeMessageEvent; | 856 | public event GodlikeMessage onGodlikeMessage; |
857 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 857 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
858 | 858 | ||
859 | #pragma warning restore 67 | 859 | #pragma warning restore 67 |
860 | 860 | ||
@@ -1220,7 +1220,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1220 | 1220 | ||
1221 | } | 1221 | } |
1222 | 1222 | ||
1223 | public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID) | 1223 | public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID) |
1224 | { | 1224 | { |
1225 | 1225 | ||
1226 | } | 1226 | } |
@@ -1657,7 +1657,15 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1657 | } | 1657 | } |
1658 | 1658 | ||
1659 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1659 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1660 | { | 1660 | { |
1661 | } | ||
1662 | |||
1663 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1664 | { | ||
1665 | } | ||
1666 | |||
1667 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1668 | { | ||
1661 | } | 1669 | } |
1662 | } | 1670 | } |
1663 | } | 1671 | } |
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs index e11cbd7..66265d8 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs | |||
@@ -220,8 +220,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat | |||
220 | 220 | ||
221 | // Fail if fundamental information is still missing | 221 | // Fail if fundamental information is still missing |
222 | 222 | ||
223 | if (cs.Server == null || cs.IrcChannel == null || cs.BaseNickname == null || cs.User == null) | 223 | if (cs.Server == null) |
224 | throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}", cs.idn, rs.Region)); | 224 | throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: server missing", cs.idn, rs.Region)); |
225 | else if (cs.IrcChannel == null) | ||
226 | throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: channel missing", cs.idn, rs.Region)); | ||
227 | else if (cs.BaseNickname == null) | ||
228 | throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: nick missing", cs.idn, rs.Region)); | ||
229 | else if (cs.User == null) | ||
230 | throw new Exception(String.Format("[IRC-Channel-{0}] Invalid configuration for region {1}: user missing", cs.idn, rs.Region)); | ||
225 | 231 | ||
226 | m_log.InfoFormat("[IRC-Channel-{0}] Configuration for Region {1} is valid", cs.idn, rs.Region); | 232 | m_log.InfoFormat("[IRC-Channel-{0}] Configuration for Region {1} is valid", cs.idn, rs.Region); |
227 | m_log.InfoFormat("[IRC-Channel-{0}] Server = {1}", cs.idn, cs.Server); | 233 | m_log.InfoFormat("[IRC-Channel-{0}] Server = {1}", cs.idn, cs.Server); |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index e3392c8..4a4c515 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -380,25 +380,25 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
380 | 380 | ||
381 | public event PlacesQuery OnPlacesQuery; | 381 | public event PlacesQuery OnPlacesQuery; |
382 | 382 | ||
383 | public event FindAgentUpdate OnFindAgentEvent; | 383 | public event FindAgentUpdate OnFindAgent; |
384 | public event TrackAgentUpdate OnTrackAgentEvent; | 384 | public event TrackAgentUpdate OnTrackAgent; |
385 | public event NewUserReport OnUserReportEvent; | 385 | public event NewUserReport OnUserReport; |
386 | public event SaveStateHandler OnSaveStateEvent; | 386 | public event SaveStateHandler OnSaveState; |
387 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | 387 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; |
388 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | 388 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; |
389 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | 389 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; |
390 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | 390 | public event FreezeUserUpdate OnParcelFreezeUser; |
391 | public event EjectUserUpdate OnParcelEjectUserEvent; | 391 | public event EjectUserUpdate OnParcelEjectUser; |
392 | public event ParcelBuyPass OnParcelBuyPass; | 392 | public event ParcelBuyPass OnParcelBuyPass; |
393 | public event ParcelGodMark OnParcelGodMark; | 393 | public event ParcelGodMark OnParcelGodMark; |
394 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | 394 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; |
395 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | 395 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; |
396 | public event SimWideDeletesDelegate OnSimWideDeletes; | 396 | public event SimWideDeletesDelegate OnSimWideDeletes; |
397 | public event SendPostcard OnSendPostcard; | 397 | public event SendPostcard OnSendPostcard; |
398 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | 398 | public event MuteListEntryUpdate OnUpdateMuteListEntry; |
399 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | 399 | public event MuteListEntryRemove OnRemoveMuteListEntry; |
400 | public event GodlikeMessage onGodlikeMessageEvent; | 400 | public event GodlikeMessage onGodlikeMessage; |
401 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | 401 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; |
402 | 402 | ||
403 | #pragma warning restore 67 | 403 | #pragma warning restore 67 |
404 | 404 | ||
@@ -897,7 +897,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
897 | { | 897 | { |
898 | } | 898 | } |
899 | 899 | ||
900 | public void SendEstateManagersList(UUID invoice, UUID[] EstateManagers, uint estateID) | 900 | public void SendEstateList(UUID invoice, int code, UUID[] Data, uint estateID) |
901 | { | 901 | { |
902 | } | 902 | } |
903 | 903 | ||
@@ -1138,7 +1138,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | 1140 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) |
1141 | { | 1141 | { |
1142 | } | ||
1143 | |||
1144 | public void SendGroupVoteHistory(UUID groupID, UUID transactionID, GroupVoteHistory[] Votes) | ||
1145 | { | ||
1146 | } | ||
1147 | |||
1148 | public void SendGroupActiveProposals(UUID groupID, UUID transactionID, GroupActiveProposals[] Proposals) | ||
1149 | { | ||
1142 | } | 1150 | } |
1143 | } | 1151 | } |
1144 | } | 1152 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d5562f2..ee2a94c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2110,14 +2110,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2110 | public LSL_Integer llRotTarget(LSL_Rotation rot, double error) | 2110 | public LSL_Integer llRotTarget(LSL_Rotation rot, double error) |
2111 | { | 2111 | { |
2112 | m_host.AddScriptLPS(1); | 2112 | m_host.AddScriptLPS(1); |
2113 | NotImplemented("llRotTarget"); | 2113 | return m_host.registerRotTargetWaypoint(new Quaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s), (float)error); |
2114 | return 0; | ||
2115 | } | 2114 | } |
2116 | 2115 | ||
2117 | public void llRotTargetRemove(int number) | 2116 | public void llRotTargetRemove(int number) |
2118 | { | 2117 | { |
2119 | m_host.AddScriptLPS(1); | 2118 | m_host.AddScriptLPS(1); |
2120 | NotImplemented("llRotTargetRemove"); | 2119 | m_host.unregisterRotTargetWaypoint(number); |
2121 | } | 2120 | } |
2122 | 2121 | ||
2123 | public void llMoveToTarget(LSL_Vector target, double tau) | 2122 | public void llMoveToTarget(LSL_Vector target, double tau) |
@@ -7286,23 +7285,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7286 | public LSL_Integer llGetNumberOfPrims() | 7285 | public LSL_Integer llGetNumberOfPrims() |
7287 | { | 7286 | { |
7288 | m_host.AddScriptLPS(1); | 7287 | m_host.AddScriptLPS(1); |
7289 | ScenePresence[] presences = World.GetScenePresences(); | ||
7290 | if (presences.Length == 0) | ||
7291 | return 0; | ||
7292 | |||
7293 | int avatarCount = 0; | 7288 | int avatarCount = 0; |
7294 | for (int i = 0; i < presences.Length; i++) | 7289 | World.ForEachScenePresence(delegate(ScenePresence presence) |
7295 | { | 7290 | { |
7296 | ScenePresence presence = presences[i]; | 7291 | if (!presence.IsChildAgent && presence.ParentID != 0 && m_host.ParentGroup.HasChildPrim(presence.ParentID)) |
7297 | |||
7298 | if (!presence.IsChildAgent && presence.ParentID != 0) | ||
7299 | { | ||
7300 | if (m_host.ParentGroup.HasChildPrim(presence.ParentID)) | ||
7301 | { | ||
7302 | avatarCount++; | 7292 | avatarCount++; |
7303 | } | 7293 | }); |
7304 | } | ||
7305 | } | ||
7306 | 7294 | ||
7307 | return m_host.ParentGroup.PrimCount + avatarCount; | 7295 | return m_host.ParentGroup.PrimCount + avatarCount; |
7308 | } | 7296 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 0ed7f51..7462ba0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1981,6 +1981,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1981 | 1981 | ||
1982 | return (int)pws; | 1982 | return (int)pws; |
1983 | } | 1983 | } |
1984 | |||
1984 | public void osSetSpeed(string UUID, float SpeedModifier) | 1985 | public void osSetSpeed(string UUID, float SpeedModifier) |
1985 | { | 1986 | { |
1986 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); | 1987 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); |
@@ -1988,6 +1989,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1988 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); | 1989 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); |
1989 | avatar.SpeedModifier = SpeedModifier; | 1990 | avatar.SpeedModifier = SpeedModifier; |
1990 | } | 1991 | } |
1992 | |||
1991 | public void osKickAvatar(string FirstName,string SurName,string alert) | 1993 | public void osKickAvatar(string FirstName,string SurName,string alert) |
1992 | { | 1994 | { |
1993 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 1995 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
@@ -2008,6 +2010,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2008 | } | 2010 | } |
2009 | } | 2011 | } |
2010 | } | 2012 | } |
2013 | |||
2011 | public void osCauseDamage(string avatar, double damage) | 2014 | public void osCauseDamage(string avatar, double damage) |
2012 | { | 2015 | { |
2013 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); | 2016 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); |
@@ -2035,6 +2038,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2035 | } | 2038 | } |
2036 | } | 2039 | } |
2037 | } | 2040 | } |
2041 | |||
2038 | public void osCauseHealing(string avatar, double healing) | 2042 | public void osCauseHealing(string avatar, double healing) |
2039 | { | 2043 | { |
2040 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); | 2044 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); |
@@ -2059,4 +2063,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2059 | } | 2063 | } |
2060 | } | 2064 | } |
2061 | } | 2065 | } |
2062 | } | 2066 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs index 7f67599..9615315 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/Executor.cs | |||
@@ -62,6 +62,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
62 | land_collision_end = 4096, | 62 | land_collision_end = 4096, |
63 | land_collision_start = 8192, | 63 | land_collision_start = 8192, |
64 | at_target = 16384, | 64 | at_target = 16384, |
65 | at_rot_target = 16777216, | ||
65 | listen = 32768, | 66 | listen = 32768, |
66 | money = 65536, | 67 | money = 65536, |
67 | moving_end = 131072, | 68 | moving_end = 131072, |
@@ -203,7 +204,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
203 | } | 204 | } |
204 | 205 | ||
205 | m_eventFlagsMap.Add("attach", scriptEvents.attach); | 206 | m_eventFlagsMap.Add("attach", scriptEvents.attach); |
206 | // m_eventFlagsMap.Add("at_rot_target",(long)scriptEvents.at_rot_target); | 207 | m_eventFlagsMap.Add("at_rot_target", scriptEvents.at_rot_target); |
207 | m_eventFlagsMap.Add("at_target", scriptEvents.at_target); | 208 | m_eventFlagsMap.Add("at_target", scriptEvents.at_target); |
208 | // m_eventFlagsMap.Add("changed",(long)scriptEvents.changed); | 209 | // m_eventFlagsMap.Add("changed",(long)scriptEvents.changed); |
209 | m_eventFlagsMap.Add("collision", scriptEvents.collision); | 210 | m_eventFlagsMap.Add("collision", scriptEvents.collision); |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index 8195f33..16309ef 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs | |||
@@ -59,10 +59,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
59 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; | 59 | myScriptEngine.World.EventManager.OnScriptChangedEvent += changed; |
60 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; | 60 | myScriptEngine.World.EventManager.OnScriptAtTargetEvent += at_target; |
61 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; | 61 | myScriptEngine.World.EventManager.OnScriptNotAtTargetEvent += not_at_target; |
62 | myScriptEngine.World.EventManager.OnScriptAtRotTargetEvent += at_rot_target; | ||
63 | myScriptEngine.World.EventManager.OnScriptNotAtRotTargetEvent += not_at_rot_target; | ||
62 | myScriptEngine.World.EventManager.OnScriptControlEvent += control; | 64 | myScriptEngine.World.EventManager.OnScriptControlEvent += control; |
63 | myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; | 65 | myScriptEngine.World.EventManager.OnScriptColliderStart += collision_start; |
64 | myScriptEngine.World.EventManager.OnScriptColliding += collision; | 66 | myScriptEngine.World.EventManager.OnScriptColliding += collision; |
65 | myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; | 67 | myScriptEngine.World.EventManager.OnScriptCollidingEnd += collision_end; |
68 | myScriptEngine.World.EventManager.OnScriptLandColliderStart += land_collision_start; | ||
69 | myScriptEngine.World.EventManager.OnScriptLandColliding += land_collision; | ||
70 | myScriptEngine.World.EventManager.OnScriptLandColliderEnd += land_collision_end; | ||
66 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); | 71 | IMoneyModule money=myScriptEngine.World.RequestModuleInterface<IMoneyModule>(); |
67 | if (money != null) | 72 | if (money != null) |
68 | { | 73 | { |
@@ -285,29 +290,63 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
285 | det.ToArray())); | 290 | det.ToArray())); |
286 | } | 291 | } |
287 | 292 | ||
288 | public void land_collision_start(uint localID, UUID itemID) | 293 | public void land_collision_start(uint localID, ColliderArgs col) |
289 | { | 294 | { |
290 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 295 | List<DetectParams> det = new List<DetectParams>(); |
291 | "land_collision_start", | 296 | |
292 | new object[0], | 297 | foreach (DetectedObject detobj in col.Colliders) |
293 | new DetectParams[0])); | 298 | { |
299 | DetectParams d = new DetectParams(); | ||
300 | d.Position = new LSL_Types.Vector3(detobj.posVector.X, | ||
301 | detobj.posVector.Y, | ||
302 | detobj.posVector.Z); | ||
303 | d.Populate(myScriptEngine.World); | ||
304 | det.Add(d); | ||
305 | myScriptEngine.PostObjectEvent(localID, new EventParams( | ||
306 | "land_collision_start", | ||
307 | new Object[] { new LSL_Types.Vector3(d.Position) }, | ||
308 | det.ToArray())); | ||
309 | } | ||
310 | |||
294 | } | 311 | } |
295 | 312 | ||
296 | public void land_collision(uint localID, UUID itemID) | 313 | public void land_collision(uint localID, ColliderArgs col) |
297 | { | 314 | { |
298 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 315 | List<DetectParams> det = new List<DetectParams>(); |
299 | "land_collision", | 316 | |
300 | new object[0], | 317 | foreach (DetectedObject detobj in col.Colliders) |
301 | new DetectParams[0])); | 318 | { |
319 | DetectParams d = new DetectParams(); | ||
320 | d.Position = new LSL_Types.Vector3(detobj.posVector.X, | ||
321 | detobj.posVector.Y, | ||
322 | detobj.posVector.Z); | ||
323 | d.Populate(myScriptEngine.World); | ||
324 | det.Add(d); | ||
325 | myScriptEngine.PostObjectEvent(localID, new EventParams( | ||
326 | "land_collision", | ||
327 | new Object[] { new LSL_Types.Vector3(d.Position) }, | ||
328 | det.ToArray())); | ||
329 | } | ||
302 | } | 330 | } |
303 | 331 | ||
304 | public void land_collision_end(uint localID, UUID itemID) | 332 | public void land_collision_end(uint localID, ColliderArgs col) |
305 | { | 333 | { |
306 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 334 | List<DetectParams> det = new List<DetectParams>(); |
307 | "land_collision_end", | 335 | |
308 | new object[0], | 336 | foreach (DetectedObject detobj in col.Colliders) |
309 | new DetectParams[0])); | 337 | { |
310 | } | 338 | DetectParams d = new DetectParams(); |
339 | d.Position = new LSL_Types.Vector3(detobj.posVector.X, | ||
340 | detobj.posVector.Y, | ||
341 | detobj.posVector.Z); | ||
342 | d.Populate(myScriptEngine.World); | ||
343 | det.Add(d); | ||
344 | myScriptEngine.PostObjectEvent(localID, new EventParams( | ||
345 | "land_collision_end", | ||
346 | new Object[] { new LSL_Types.Vector3(d.Position) }, | ||
347 | det.ToArray())); | ||
348 | } | ||
349 | } | ||
311 | 350 | ||
312 | // timer: not handled here | 351 | // timer: not handled here |
313 | // listen: not handled here | 352 | // listen: not handled here |
@@ -353,14 +392,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
353 | new DetectParams[0])); | 392 | new DetectParams[0])); |
354 | } | 393 | } |
355 | 394 | ||
356 | public void at_rot_target(uint localID, UUID itemID) | 395 | public void at_rot_target(uint localID, uint handle, Quaternion targetrot, |
396 | Quaternion atrot) | ||
357 | { | 397 | { |
358 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 398 | myScriptEngine.PostObjectEvent(localID, new EventParams( |
359 | "at_rot_target",new object[0], | 399 | "at_rot_target", new object[] { |
400 | new LSL_Types.LSLInteger(handle), | ||
401 | new LSL_Types.Quaternion(targetrot.X,targetrot.Y,targetrot.Z,targetrot.W), | ||
402 | new LSL_Types.Quaternion(atrot.X,atrot.Y,atrot.Z,atrot.W) }, | ||
360 | new DetectParams[0])); | 403 | new DetectParams[0])); |
361 | } | 404 | } |
362 | 405 | ||
363 | public void not_at_rot_target(uint localID, UUID itemID) | 406 | public void not_at_rot_target(uint localID) |
364 | { | 407 | { |
365 | myScriptEngine.PostObjectEvent(localID, new EventParams( | 408 | myScriptEngine.PostObjectEvent(localID, new EventParams( |
366 | "not_at_rot_target",new object[0], | 409 | "not_at_rot_target",new object[0], |