diff options
author | Kitto Flora | 2010-01-03 23:10:01 -0500 |
---|---|---|
committer | Kitto Flora | 2010-01-03 23:10:01 -0500 |
commit | 253e2ed699a899b74451ac51ed7875b3f98ffdd7 (patch) | |
tree | 8760330fd19b8ae367b79dd63408b33618c4eff2 /OpenSim/Region | |
parent | Vehicle Linear parameter adjustments (diff) | |
parent | Solve conflict (diff) | |
download | opensim-SC_OLD-253e2ed699a899b74451ac51ed7875b3f98ffdd7.zip opensim-SC_OLD-253e2ed699a899b74451ac51ed7875b3f98ffdd7.tar.gz opensim-SC_OLD-253e2ed699a899b74451ac51ed7875b3f98ffdd7.tar.bz2 opensim-SC_OLD-253e2ed699a899b74451ac51ed7875b3f98ffdd7.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Diffstat (limited to 'OpenSim/Region')
40 files changed, 1661 insertions, 752 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index ba81d05..afd5f86 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -298,6 +298,26 @@ 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; | ||
302 | public event TrackAgentUpdate OnTrackAgentEvent; | ||
303 | public event NewUserReport OnUserReportEvent; | ||
304 | public event SaveStateHandler OnSaveStateEvent; | ||
305 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | ||
306 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | ||
307 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | ||
308 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | ||
309 | public event EjectUserUpdate OnParcelEjectUserEvent; | ||
310 | public event ParcelBuyPass OnParcelBuyPass; | ||
311 | public event ParcelGodMark OnParcelGodMark; | ||
312 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | ||
313 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | ||
314 | public event SimWideDeletesDelegate OnSimWideDeletes; | ||
315 | public event SendPostcard OnSendPostcard; | ||
316 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | ||
317 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | ||
318 | public event GodlikeMessage onGodlikeMessageEvent; | ||
319 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | ||
320 | |||
301 | 321 | ||
302 | #endregion Events | 322 | #endregion Events |
303 | 323 | ||
@@ -805,6 +825,189 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
805 | } | 825 | } |
806 | OutPacket(gmp, ThrottleOutPacketType.Task); | 826 | OutPacket(gmp, ThrottleOutPacketType.Task); |
807 | } | 827 | } |
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) | ||
830 | { | ||
831 | foreach (KeyValuePair<int, string> Blank in VoteID) | ||
832 | { | ||
833 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); | ||
834 | |||
835 | GAPIRP.AgentData.AgentID = agentID; | ||
836 | GAPIRP.AgentData.GroupID = groupID; | ||
837 | GAPIRP.TransactionData.TransactionID = transactionID; | ||
838 | GAPIRP.TransactionData.TotalNumItems = 1; | ||
839 | GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); | ||
840 | GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; | ||
841 | ProposalData.VoteCast = Utils.StringToBytes("false"); | ||
842 | ProposalData.VoteID = new UUID(VoteID[Blank.Key]); | ||
843 | ProposalData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); | ||
844 | ProposalData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); | ||
845 | ProposalData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); | ||
846 | ProposalData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); | ||
847 | ProposalData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); | ||
848 | ProposalData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); | ||
849 | ProposalData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); | ||
850 | ProposalData.AlreadyVoted = false; | ||
851 | GAPIRP.ProposalData[0] = ProposalData; | ||
852 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); | ||
853 | } | ||
854 | if (VoteID.Count == 0) | ||
855 | { | ||
856 | GroupActiveProposalItemReplyPacket GAPIRP = new GroupActiveProposalItemReplyPacket(); | ||
857 | |||
858 | GAPIRP.AgentData.AgentID = agentID; | ||
859 | GAPIRP.AgentData.GroupID = groupID; | ||
860 | GAPIRP.TransactionData.TransactionID = transactionID; | ||
861 | GAPIRP.TransactionData.TotalNumItems = 1; | ||
862 | GroupActiveProposalItemReplyPacket.ProposalDataBlock ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock(); | ||
863 | GAPIRP.ProposalData = new GroupActiveProposalItemReplyPacket.ProposalDataBlock[1]; | ||
864 | ProposalData.VoteCast = Utils.StringToBytes("false"); | ||
865 | ProposalData.VoteID = UUID.Zero; | ||
866 | ProposalData.VoteInitiator = UUID.Zero; | ||
867 | ProposalData.Majority = 0; | ||
868 | ProposalData.Quorum = 0; | ||
869 | ProposalData.TerseDateID = Utils.StringToBytes(""); | ||
870 | ProposalData.StartDateTime = Utils.StringToBytes(""); | ||
871 | ProposalData.EndDateTime = Utils.StringToBytes(""); | ||
872 | ProposalData.ProposalText = Utils.StringToBytes(""); | ||
873 | ProposalData.AlreadyVoted = false; | ||
874 | GAPIRP.ProposalData[0] = ProposalData; | ||
875 | OutPacket(GAPIRP, ThrottleOutPacketType.Task); | ||
876 | } | ||
877 | } | ||
878 | |||
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) | ||
880 | { | ||
881 | foreach (KeyValuePair<int, string> Blank in VoteID) | ||
882 | { | ||
883 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); | ||
884 | |||
885 | GVHIRP.AgentData.AgentID = agentID; | ||
886 | GVHIRP.AgentData.GroupID = groupID; | ||
887 | GVHIRP.TransactionData.TransactionID = transactionID; | ||
888 | GVHIRP.TransactionData.TotalNumItems = 1; | ||
889 | GVHIRP.HistoryItemData.VoteID = new UUID(VoteID[Blank.Key]); | ||
890 | GVHIRP.HistoryItemData.VoteInitiator = new UUID(VoteInitiator[Blank.Key]); | ||
891 | GVHIRP.HistoryItemData.Majority = (float)Convert.ToInt32(Majority[Blank.Key]); | ||
892 | GVHIRP.HistoryItemData.Quorum = Convert.ToInt32(Quorum[Blank.Key]); | ||
893 | GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(TerseDateID[Blank.Key]); | ||
894 | GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(StartDateTime[Blank.Key]); | ||
895 | GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(EndDateTime[Blank.Key]); | ||
896 | GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(VoteType[Blank.Key]); | ||
897 | GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(VoteResult[Blank.Key]); | ||
898 | GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(ProposalText[Blank.Key]); | ||
899 | GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); | ||
900 | GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; | ||
901 | VoteItem.CandidateID = UUID.Zero; | ||
902 | VoteItem.NumVotes = 0; //TODO: FIX THIS!!! | ||
903 | VoteItem.VoteCast = Utils.StringToBytes("Yes"); | ||
904 | GVHIRP.VoteItem[0] = VoteItem; | ||
905 | OutPacket(GVHIRP, ThrottleOutPacketType.Task); | ||
906 | } | ||
907 | if (VoteID.Count == 0) | ||
908 | { | ||
909 | GroupVoteHistoryItemReplyPacket GVHIRP = new GroupVoteHistoryItemReplyPacket(); | ||
910 | |||
911 | GVHIRP.AgentData.AgentID = agentID; | ||
912 | GVHIRP.AgentData.GroupID = groupID; | ||
913 | GVHIRP.TransactionData.TransactionID = transactionID; | ||
914 | GVHIRP.TransactionData.TotalNumItems = 0; | ||
915 | GVHIRP.HistoryItemData.VoteID = UUID.Zero; | ||
916 | GVHIRP.HistoryItemData.VoteInitiator = UUID.Zero; | ||
917 | GVHIRP.HistoryItemData.Majority = 0; | ||
918 | GVHIRP.HistoryItemData.Quorum = 0; | ||
919 | GVHIRP.HistoryItemData.TerseDateID = Utils.StringToBytes(""); | ||
920 | GVHIRP.HistoryItemData.StartDateTime = Utils.StringToBytes(""); | ||
921 | GVHIRP.HistoryItemData.EndDateTime = Utils.StringToBytes(""); | ||
922 | GVHIRP.HistoryItemData.VoteType = Utils.StringToBytes(""); | ||
923 | GVHIRP.HistoryItemData.VoteResult = Utils.StringToBytes(""); | ||
924 | GVHIRP.HistoryItemData.ProposalText = Utils.StringToBytes(""); | ||
925 | GroupVoteHistoryItemReplyPacket.VoteItemBlock VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock(); | ||
926 | GVHIRP.VoteItem = new GroupVoteHistoryItemReplyPacket.VoteItemBlock[1]; | ||
927 | VoteItem.CandidateID = UUID.Zero; | ||
928 | VoteItem.NumVotes = 0; //TODO: FIX THIS!!! | ||
929 | VoteItem.VoteCast = Utils.StringToBytes("No"); | ||
930 | GVHIRP.VoteItem[0] = VoteItem; | ||
931 | OutPacket(GVHIRP, ThrottleOutPacketType.Task); | ||
932 | } | ||
933 | } | ||
934 | |||
935 | public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) | ||
936 | { | ||
937 | GroupAccountDetailsReplyPacket GADRP = new GroupAccountDetailsReplyPacket(); | ||
938 | GADRP.AgentData = new GroupAccountDetailsReplyPacket.AgentDataBlock(); | ||
939 | GADRP.AgentData.AgentID = sender.AgentId; | ||
940 | GADRP.AgentData.GroupID = groupID; | ||
941 | GADRP.HistoryData = new GroupAccountDetailsReplyPacket.HistoryDataBlock[1]; | ||
942 | GroupAccountDetailsReplyPacket.HistoryDataBlock History = new GroupAccountDetailsReplyPacket.HistoryDataBlock(); | ||
943 | GADRP.MoneyData = new GroupAccountDetailsReplyPacket.MoneyDataBlock(); | ||
944 | GADRP.MoneyData.CurrentInterval = 0; | ||
945 | GADRP.MoneyData.IntervalDays = 7; | ||
946 | GADRP.MoneyData.RequestID = transactionID; | ||
947 | GADRP.MoneyData.StartDate = Utils.StringToBytes(DateTime.Today.ToString()); | ||
948 | History.Amount = amt; | ||
949 | History.Description = Utils.StringToBytes(""); | ||
950 | GADRP.HistoryData[0] = History; | ||
951 | OutPacket(GADRP, ThrottleOutPacketType.Task); | ||
952 | } | ||
953 | |||
954 | public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) | ||
955 | { | ||
956 | GroupAccountSummaryReplyPacket GASRP = | ||
957 | (GroupAccountSummaryReplyPacket)PacketPool.Instance.GetPacket( | ||
958 | PacketType.GroupAccountSummaryReply); | ||
959 | |||
960 | GASRP.AgentData = new GroupAccountSummaryReplyPacket.AgentDataBlock(); | ||
961 | GASRP.AgentData.AgentID = sender.AgentId; | ||
962 | GASRP.AgentData.GroupID = groupID; | ||
963 | GASRP.MoneyData = new GroupAccountSummaryReplyPacket.MoneyDataBlock(); | ||
964 | GASRP.MoneyData.Balance = (int)moneyAmt; | ||
965 | GASRP.MoneyData.TotalCredits = totalTier; | ||
966 | GASRP.MoneyData.TotalDebits = usedTier; | ||
967 | GASRP.MoneyData.StartDate = new byte[1]; | ||
968 | GASRP.MoneyData.CurrentInterval = 1; | ||
969 | GASRP.MoneyData.GroupTaxCurrent = 0; | ||
970 | GASRP.MoneyData.GroupTaxEstimate = 0; | ||
971 | GASRP.MoneyData.IntervalDays = 0; | ||
972 | GASRP.MoneyData.LandTaxCurrent = 0; | ||
973 | GASRP.MoneyData.LandTaxEstimate = 0; | ||
974 | GASRP.MoneyData.LastTaxDate = new byte[1]; | ||
975 | GASRP.MoneyData.LightTaxCurrent = 0; | ||
976 | GASRP.MoneyData.TaxDate = new byte[1]; | ||
977 | GASRP.MoneyData.RequestID = sender.AgentId; | ||
978 | GASRP.MoneyData.ParcelDirFeeEstimate = 0; | ||
979 | GASRP.MoneyData.ParcelDirFeeCurrent = 0; | ||
980 | GASRP.MoneyData.ObjectTaxEstimate = 0; | ||
981 | GASRP.MoneyData.NonExemptMembers = 0; | ||
982 | GASRP.MoneyData.ObjectTaxCurrent = 0; | ||
983 | GASRP.MoneyData.LightTaxEstimate = 0; | ||
984 | OutPacket(GASRP, ThrottleOutPacketType.Task); | ||
985 | } | ||
986 | |||
987 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) | ||
988 | { | ||
989 | GroupAccountTransactionsReplyPacket GATRP = | ||
990 | (GroupAccountTransactionsReplyPacket)PacketPool.Instance.GetPacket( | ||
991 | PacketType.GroupAccountTransactionsReply); | ||
992 | |||
993 | GATRP.AgentData = new GroupAccountTransactionsReplyPacket.AgentDataBlock(); | ||
994 | GATRP.AgentData.AgentID = sender.AgentId; | ||
995 | GATRP.AgentData.GroupID = groupID; | ||
996 | GATRP.MoneyData = new GroupAccountTransactionsReplyPacket.MoneyDataBlock(); | ||
997 | GATRP.MoneyData.CurrentInterval = 0; | ||
998 | GATRP.MoneyData.IntervalDays = 7; | ||
999 | GATRP.MoneyData.RequestID = transactionID; | ||
1000 | GATRP.MoneyData.StartDate = Utils.StringToBytes(DateTime.Today.ToString()); | ||
1001 | GATRP.HistoryData = new GroupAccountTransactionsReplyPacket.HistoryDataBlock[1]; | ||
1002 | GroupAccountTransactionsReplyPacket.HistoryDataBlock History = new GroupAccountTransactionsReplyPacket.HistoryDataBlock(); | ||
1003 | History.Amount = 0; | ||
1004 | History.Item = Utils.StringToBytes(""); | ||
1005 | History.Time = Utils.StringToBytes(""); | ||
1006 | History.Type = 0; | ||
1007 | History.User = Utils.StringToBytes(""); | ||
1008 | GATRP.HistoryData[0] = History; | ||
1009 | OutPacket(GATRP, ThrottleOutPacketType.Task); | ||
1010 | } | ||
808 | 1011 | ||
809 | /// <summary> | 1012 | /// <summary> |
810 | /// Send the region heightmap to the client | 1013 | /// Send the region heightmap to the client |
@@ -4537,6 +4740,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4537 | AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate); | 4740 | AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate); |
4538 | AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); | 4741 | AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); |
4539 | AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); | 4742 | AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); |
4743 | AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry); | ||
4744 | AddLocalPacketHandler(PacketType.RemoveMuteListEntry, HandleRemoveMuteListEntry); | ||
4745 | AddLocalPacketHandler(PacketType.UserReport, HandleUserReport); | ||
4746 | AddLocalPacketHandler(PacketType.FindAgent, HandleFindAgent); | ||
4747 | AddLocalPacketHandler(PacketType.TrackAgent, HandleTrackAgent); | ||
4748 | AddLocalPacketHandler(PacketType.GodUpdateRegionInfo, HandleGodUpdateRegionInfoUpdate); | ||
4749 | AddLocalPacketHandler(PacketType.GodlikeMessage, HandleGodlikeMessage); | ||
4750 | AddLocalPacketHandler(PacketType.StateSave, HandleSaveStatePacket); | ||
4751 | AddLocalPacketHandler(PacketType.GroupAccountDetailsRequest, HandleGroupAccountDetailsRequest); | ||
4752 | AddLocalPacketHandler(PacketType.GroupAccountSummaryRequest, HandleGroupAccountSummaryRequest); | ||
4753 | AddLocalPacketHandler(PacketType.GroupAccountTransactionsRequest, HandleGroupTransactionsDetailsRequest); | ||
4754 | AddLocalPacketHandler(PacketType.FreezeUser, HandleFreezeUser); | ||
4755 | AddLocalPacketHandler(PacketType.EjectUser, HandleEjectUser); | ||
4756 | AddLocalPacketHandler(PacketType.ParcelBuyPass, HandleParcelBuyPass); | ||
4757 | AddLocalPacketHandler(PacketType.ParcelGodMarkAsContent, HandleParcelGodMarkAsContent); | ||
4758 | AddLocalPacketHandler(PacketType.GroupActiveProposalsRequest, HandleGroupActiveProposalsRequest); | ||
4759 | AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest); | ||
4760 | AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes); | ||
4761 | AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard); | ||
4540 | } | 4762 | } |
4541 | 4763 | ||
4542 | #region Packet Handlers | 4764 | #region Packet Handlers |
@@ -4632,7 +4854,72 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4632 | 4854 | ||
4633 | return false; | 4855 | return false; |
4634 | } | 4856 | } |
4635 | 4857 | ||
4858 | private bool HandleParcelGodMarkAsContent(IClientAPI client, Packet Packet) | ||
4859 | { | ||
4860 | ParcelGodMarkAsContentPacket ParcelGodMarkAsContent = | ||
4861 | (ParcelGodMarkAsContentPacket)Packet; | ||
4862 | |||
4863 | ParcelGodMark ParcelGodMarkAsContentHandler = OnParcelGodMark; | ||
4864 | if (ParcelGodMarkAsContentHandler != null) | ||
4865 | { | ||
4866 | ParcelGodMarkAsContentHandler(this, | ||
4867 | ParcelGodMarkAsContent.AgentData.AgentID, | ||
4868 | ParcelGodMarkAsContent.ParcelData.LocalID); | ||
4869 | return true; | ||
4870 | } | ||
4871 | return false; | ||
4872 | } | ||
4873 | |||
4874 | private bool HandleFreezeUser(IClientAPI client, Packet Packet) | ||
4875 | { | ||
4876 | FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet; | ||
4877 | |||
4878 | FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUserEvent; | ||
4879 | if (FreezeUserHandler != null) | ||
4880 | { | ||
4881 | FreezeUserHandler(this, | ||
4882 | FreezeUser.AgentData.AgentID, | ||
4883 | FreezeUser.Data.Flags, | ||
4884 | FreezeUser.Data.TargetID); | ||
4885 | return true; | ||
4886 | } | ||
4887 | return false; | ||
4888 | } | ||
4889 | |||
4890 | private bool HandleEjectUser(IClientAPI client, Packet Packet) | ||
4891 | { | ||
4892 | EjectUserPacket EjectUser = | ||
4893 | (EjectUserPacket)Packet; | ||
4894 | |||
4895 | EjectUserUpdate EjectUserHandler = OnParcelEjectUserEvent; | ||
4896 | if (EjectUserHandler != null) | ||
4897 | { | ||
4898 | EjectUserHandler(this, | ||
4899 | EjectUser.AgentData.AgentID, | ||
4900 | EjectUser.Data.Flags, | ||
4901 | EjectUser.Data.TargetID); | ||
4902 | return true; | ||
4903 | } | ||
4904 | return false; | ||
4905 | } | ||
4906 | |||
4907 | private bool HandleParcelBuyPass(IClientAPI client, Packet Packet) | ||
4908 | { | ||
4909 | ParcelBuyPassPacket ParcelBuyPass = | ||
4910 | (ParcelBuyPassPacket)Packet; | ||
4911 | |||
4912 | ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass; | ||
4913 | if (ParcelBuyPassHandler != null) | ||
4914 | { | ||
4915 | ParcelBuyPassHandler(this, | ||
4916 | ParcelBuyPass.AgentData.AgentID, | ||
4917 | ParcelBuyPass.ParcelData.LocalID); | ||
4918 | return true; | ||
4919 | } | ||
4920 | return false; | ||
4921 | } | ||
4922 | |||
4636 | private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack) | 4923 | private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack) |
4637 | { | 4924 | { |
4638 | ParcelBuyPacket parcel = (ParcelBuyPacket)Pack; | 4925 | ParcelBuyPacket parcel = (ParcelBuyPacket)Pack; |
@@ -4998,7 +5285,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4998 | } | 5285 | } |
4999 | return true; | 5286 | return true; |
5000 | } | 5287 | } |
5001 | 5288 | ||
5289 | private bool HandleFindAgent(IClientAPI client, Packet Packet) | ||
5290 | { | ||
5291 | FindAgentPacket FindAgent = | ||
5292 | (FindAgentPacket)Packet; | ||
5293 | |||
5294 | FindAgentUpdate FindAgentHandler = OnFindAgentEvent; | ||
5295 | if (FindAgentHandler != null) | ||
5296 | { | ||
5297 | FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey); | ||
5298 | return true; | ||
5299 | } | ||
5300 | return false; | ||
5301 | } | ||
5302 | |||
5303 | private bool HandleTrackAgent(IClientAPI client, Packet Packet) | ||
5304 | { | ||
5305 | TrackAgentPacket TrackAgent = | ||
5306 | (TrackAgentPacket)Packet; | ||
5307 | |||
5308 | TrackAgentUpdate TrackAgentHandler = OnTrackAgentEvent; | ||
5309 | if (TrackAgentHandler != null) | ||
5310 | { | ||
5311 | TrackAgentHandler(this, | ||
5312 | TrackAgent.AgentData.AgentID, | ||
5313 | TrackAgent.TargetData.PreyID); | ||
5314 | return true; | ||
5315 | } | ||
5316 | return false; | ||
5317 | } | ||
5318 | |||
5002 | private bool HandlerRezObject(IClientAPI sender, Packet Pack) | 5319 | private bool HandlerRezObject(IClientAPI sender, Packet Pack) |
5003 | { | 5320 | { |
5004 | RezObjectPacket rezPacket = (RezObjectPacket)Pack; | 5321 | RezObjectPacket rezPacket = (RezObjectPacket)Pack; |
@@ -5581,7 +5898,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5581 | 5898 | ||
5582 | if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) | 5899 | if (avSetStartLocationRequestPacket.AgentData.AgentID == AgentId && avSetStartLocationRequestPacket.AgentData.SessionID == SessionId) |
5583 | { | 5900 | { |
5584 | // Linden Client limitation.. | 5901 | // Linden Client limitation.. |
5585 | if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f | 5902 | if (avSetStartLocationRequestPacket.StartLocationData.LocationPos.X == 255.5f |
5586 | || avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f) | 5903 | || avSetStartLocationRequestPacket.StartLocationData.LocationPos.Y == 255.5f) |
5587 | { | 5904 | { |
@@ -8268,6 +8585,70 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8268 | 8585 | ||
8269 | return true; | 8586 | return true; |
8270 | } | 8587 | } |
8588 | |||
8589 | private bool HandleGodUpdateRegionInfoUpdate(IClientAPI client, Packet Packet) | ||
8590 | { | ||
8591 | GodUpdateRegionInfoPacket GodUpdateRegionInfo = | ||
8592 | (GodUpdateRegionInfoPacket)Packet; | ||
8593 | |||
8594 | GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdateEvent; | ||
8595 | if (handlerGodUpdateRegionInfo != null) | ||
8596 | { | ||
8597 | handlerGodUpdateRegionInfo(this, | ||
8598 | GodUpdateRegionInfo.RegionInfo.BillableFactor, | ||
8599 | GodUpdateRegionInfo.RegionInfo.EstateID, | ||
8600 | GodUpdateRegionInfo.RegionInfo.RegionFlags, | ||
8601 | GodUpdateRegionInfo.RegionInfo.SimName, | ||
8602 | GodUpdateRegionInfo.RegionInfo.RedirectGridX, | ||
8603 | GodUpdateRegionInfo.RegionInfo.RedirectGridY); | ||
8604 | return true; | ||
8605 | } | ||
8606 | return false; | ||
8607 | } | ||
8608 | |||
8609 | private bool HandleSimWideDeletes(IClientAPI client, Packet Packet) | ||
8610 | { | ||
8611 | SimWideDeletesPacket SimWideDeletesRequest = | ||
8612 | (SimWideDeletesPacket)Packet; | ||
8613 | SimWideDeletesDelegate handlerSimWideDeletesRequest = OnSimWideDeletes; | ||
8614 | if (handlerSimWideDeletesRequest != null) | ||
8615 | { | ||
8616 | handlerSimWideDeletesRequest(this, SimWideDeletesRequest.AgentData.AgentID,(int)SimWideDeletesRequest.DataBlock.Flags,SimWideDeletesRequest.DataBlock.TargetID); | ||
8617 | return true; | ||
8618 | } | ||
8619 | return false; | ||
8620 | } | ||
8621 | |||
8622 | private bool HandleGodlikeMessage(IClientAPI client, Packet Packet) | ||
8623 | { | ||
8624 | GodlikeMessagePacket GodlikeMessage = | ||
8625 | (GodlikeMessagePacket)Packet; | ||
8626 | |||
8627 | GodlikeMessage handlerGodlikeMessage = onGodlikeMessageEvent; | ||
8628 | if (handlerGodlikeMessage != null) | ||
8629 | { | ||
8630 | handlerGodlikeMessage(this, | ||
8631 | GodlikeMessage.MethodData.Invoice, | ||
8632 | GodlikeMessage.MethodData.Method, | ||
8633 | GodlikeMessage.ParamList[0].Parameter); | ||
8634 | return true; | ||
8635 | } | ||
8636 | return false; | ||
8637 | } | ||
8638 | |||
8639 | private bool HandleSaveStatePacket(IClientAPI client, Packet Packet) | ||
8640 | { | ||
8641 | StateSavePacket SaveStateMessage = | ||
8642 | (StateSavePacket)Packet; | ||
8643 | SaveStateHandler handlerSaveStatePacket = OnSaveStateEvent; | ||
8644 | if (handlerSaveStatePacket != null) | ||
8645 | { | ||
8646 | handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID); | ||
8647 | return true; | ||
8648 | } | ||
8649 | return false; | ||
8650 | } | ||
8651 | |||
8271 | private bool HandleGodKickUser(IClientAPI sender, Packet Pack) | 8652 | private bool HandleGodKickUser(IClientAPI sender, Packet Pack) |
8272 | { | 8653 | { |
8273 | GodKickUserPacket gkupack = (GodKickUserPacket)Pack; | 8654 | GodKickUserPacket gkupack = (GodKickUserPacket)Pack; |
@@ -8618,6 +8999,76 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8618 | } | 8999 | } |
8619 | return true; | 9000 | return true; |
8620 | } | 9001 | } |
9002 | |||
9003 | private bool HandleUpdateMuteListEntry(IClientAPI client, Packet Packet) | ||
9004 | { | ||
9005 | UpdateMuteListEntryPacket UpdateMuteListEntry = | ||
9006 | (UpdateMuteListEntryPacket)Packet; | ||
9007 | MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntryEvent; | ||
9008 | if (handlerUpdateMuteListEntry != null) | ||
9009 | { | ||
9010 | handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID, | ||
9011 | Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName), | ||
9012 | UpdateMuteListEntry.MuteData.MuteType, | ||
9013 | UpdateMuteListEntry.AgentData.AgentID); | ||
9014 | return true; | ||
9015 | } | ||
9016 | return false; | ||
9017 | } | ||
9018 | |||
9019 | private bool HandleRemoveMuteListEntry(IClientAPI client, Packet Packet) | ||
9020 | { | ||
9021 | RemoveMuteListEntryPacket RemoveMuteListEntry = | ||
9022 | (RemoveMuteListEntryPacket)Packet; | ||
9023 | MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntryEvent; | ||
9024 | if (handlerRemoveMuteListEntry != null) | ||
9025 | { | ||
9026 | handlerRemoveMuteListEntry(this, | ||
9027 | RemoveMuteListEntry.MuteData.MuteID, | ||
9028 | Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName), | ||
9029 | RemoveMuteListEntry.AgentData.AgentID); | ||
9030 | return true; | ||
9031 | } | ||
9032 | return false; | ||
9033 | } | ||
9034 | |||
9035 | private bool HandleUserReport(IClientAPI client, Packet Packet) | ||
9036 | { | ||
9037 | UserReportPacket UserReport = | ||
9038 | (UserReportPacket)Packet; | ||
9039 | |||
9040 | NewUserReport handlerUserReport = OnUserReportEvent; | ||
9041 | if (handlerUserReport != null) | ||
9042 | { | ||
9043 | handlerUserReport(this, | ||
9044 | Utils.BytesToString(UserReport.ReportData.AbuseRegionName), | ||
9045 | UserReport.ReportData.AbuserID, | ||
9046 | UserReport.ReportData.Category, | ||
9047 | UserReport.ReportData.CheckFlags, | ||
9048 | Utils.BytesToString(UserReport.ReportData.Details), | ||
9049 | UserReport.ReportData.ObjectID, | ||
9050 | UserReport.ReportData.Position, | ||
9051 | UserReport.ReportData.ReportType, | ||
9052 | UserReport.ReportData.ScreenshotID, | ||
9053 | Utils.BytesToString(UserReport.ReportData.Summary), | ||
9054 | UserReport.AgentData.AgentID); | ||
9055 | return true; | ||
9056 | } | ||
9057 | return false; | ||
9058 | } | ||
9059 | |||
9060 | private bool HandleSendPostcard(IClientAPI client, Packet packet) | ||
9061 | { | ||
9062 | SendPostcardPacket SendPostcard = | ||
9063 | (SendPostcardPacket)packet; | ||
9064 | SendPostcard handlerSendPostcard = OnSendPostcard; | ||
9065 | if (handlerSendPostcard != null) | ||
9066 | { | ||
9067 | handlerSendPostcard(this); | ||
9068 | return true; | ||
9069 | } | ||
9070 | return false; | ||
9071 | } | ||
8621 | 9072 | ||
8622 | private bool HandleUseCircuitCode(IClientAPI sender, Packet Pack) | 9073 | private bool HandleUseCircuitCode(IClientAPI sender, Packet Pack) |
8623 | { | 9074 | { |
@@ -8887,7 +9338,72 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
8887 | return true; | 9338 | return true; |
8888 | 9339 | ||
8889 | } | 9340 | } |
8890 | 9341 | ||
9342 | private bool HandleGroupVoteHistoryRequest(IClientAPI client, Packet Packet) | ||
9343 | { | ||
9344 | GroupVoteHistoryRequestPacket GroupVoteHistoryRequest = | ||
9345 | (GroupVoteHistoryRequestPacket)Packet; | ||
9346 | GroupVoteHistoryRequest handlerGroupVoteHistoryRequest = OnGroupVoteHistoryRequest; | ||
9347 | if (handlerGroupVoteHistoryRequest != null) | ||
9348 | { | ||
9349 | handlerGroupVoteHistoryRequest(this, GroupVoteHistoryRequest.AgentData.AgentID,GroupVoteHistoryRequest.AgentData.SessionID,GroupVoteHistoryRequest.GroupData.GroupID,GroupVoteHistoryRequest.TransactionData.TransactionID); | ||
9350 | return true; | ||
9351 | } | ||
9352 | return false; | ||
9353 | } | ||
9354 | |||
9355 | private bool HandleGroupActiveProposalsRequest(IClientAPI client, Packet Packet) | ||
9356 | { | ||
9357 | GroupActiveProposalsRequestPacket GroupActiveProposalsRequest = | ||
9358 | (GroupActiveProposalsRequestPacket)Packet; | ||
9359 | GroupActiveProposalsRequest handlerGroupActiveProposalsRequest = OnGroupActiveProposalsRequest; | ||
9360 | if (handlerGroupActiveProposalsRequest != null) | ||
9361 | { | ||
9362 | handlerGroupActiveProposalsRequest(this, GroupActiveProposalsRequest.AgentData.AgentID,GroupActiveProposalsRequest.AgentData.SessionID,GroupActiveProposalsRequest.GroupData.GroupID,GroupActiveProposalsRequest.TransactionData.TransactionID); | ||
9363 | return true; | ||
9364 | } | ||
9365 | return false; | ||
9366 | } | ||
9367 | |||
9368 | private bool HandleGroupAccountDetailsRequest(IClientAPI client, Packet Packet) | ||
9369 | { | ||
9370 | GroupAccountDetailsRequestPacket GroupAccountDetailsRequest = | ||
9371 | (GroupAccountDetailsRequestPacket)Packet; | ||
9372 | GroupAccountDetailsRequest handlerGroupAccountDetailsRequest = OnGroupAccountDetailsRequest; | ||
9373 | if (handlerGroupAccountDetailsRequest != null) | ||
9374 | { | ||
9375 | handlerGroupAccountDetailsRequest(this, GroupAccountDetailsRequest.AgentData.AgentID,GroupAccountDetailsRequest.AgentData.GroupID,GroupAccountDetailsRequest.MoneyData.RequestID,GroupAccountDetailsRequest.AgentData.SessionID); | ||
9376 | return true; | ||
9377 | } | ||
9378 | return false; | ||
9379 | } | ||
9380 | |||
9381 | private bool HandleGroupAccountSummaryRequest(IClientAPI client, Packet Packet) | ||
9382 | { | ||
9383 | GroupAccountSummaryRequestPacket GroupAccountSummaryRequest = | ||
9384 | (GroupAccountSummaryRequestPacket)Packet; | ||
9385 | GroupAccountSummaryRequest handlerGroupAccountSummaryRequest = OnGroupAccountSummaryRequest; | ||
9386 | if (handlerGroupAccountSummaryRequest != null) | ||
9387 | { | ||
9388 | handlerGroupAccountSummaryRequest(this, GroupAccountSummaryRequest.AgentData.AgentID,GroupAccountSummaryRequest.AgentData.GroupID); | ||
9389 | return true; | ||
9390 | } | ||
9391 | return false; | ||
9392 | } | ||
9393 | |||
9394 | private bool HandleGroupTransactionsDetailsRequest(IClientAPI client, Packet Packet) | ||
9395 | { | ||
9396 | GroupAccountTransactionsRequestPacket GroupAccountTransactionsRequest = | ||
9397 | (GroupAccountTransactionsRequestPacket)Packet; | ||
9398 | GroupAccountTransactionsRequest handlerGroupAccountTransactionsRequest = OnGroupAccountTransactionsRequest; | ||
9399 | if (handlerGroupAccountTransactionsRequest != null) | ||
9400 | { | ||
9401 | handlerGroupAccountTransactionsRequest(this, GroupAccountTransactionsRequest.AgentData.AgentID,GroupAccountTransactionsRequest.AgentData.GroupID,GroupAccountTransactionsRequest.MoneyData.RequestID,GroupAccountTransactionsRequest.AgentData.SessionID); | ||
9402 | return true; | ||
9403 | } | ||
9404 | return false; | ||
9405 | } | ||
9406 | |||
8891 | private bool HandleGroupTitlesRequest(IClientAPI sender, Packet Pack) | 9407 | private bool HandleGroupTitlesRequest(IClientAPI sender, Packet Pack) |
8892 | { | 9408 | { |
8893 | GroupTitlesRequestPacket groupTitlesRequest = | 9409 | GroupTitlesRequestPacket groupTitlesRequest = |
@@ -13688,7 +14204,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
13688 | if (handlerGodKickUser != null) | 14204 | if (handlerGodKickUser != null) |
13689 | { | 14205 | { |
13690 | handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, | 14206 | handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, |
13691 | gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo); | 14207 | gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo); |
13692 | } | 14208 | } |
13693 | } | 14209 | } |
13694 | else | 14210 | else |
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index d6a82ef..a4a649c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | |||
@@ -395,7 +395,10 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
395 | 395 | ||
396 | // if it leaves, we want to know, too | 396 | // if it leaves, we want to know, too |
397 | client.OnLogout += OnLogout; | 397 | client.OnLogout += OnLogout; |
398 | |||
398 | client.OnGrantUserRights += GrantUserFriendRights; | 399 | client.OnGrantUserRights += GrantUserFriendRights; |
400 | client.OnTrackAgentEvent += FindAgent; | ||
401 | client.OnFindAgentEvent += FindAgent; | ||
399 | 402 | ||
400 | } | 403 | } |
401 | 404 | ||
@@ -1114,6 +1117,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends | |||
1114 | { | 1117 | { |
1115 | ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights); | 1118 | ((Scene)remoteClient.Scene).CommsManager.UpdateUserFriendPerms(requester, target, (uint)rights); |
1116 | } | 1119 | } |
1120 | public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target) | ||
1121 | { | ||
1122 | List<FriendListItem> friendList = GetUserFriends(hunter); | ||
1123 | foreach (FriendListItem item in friendList) | ||
1124 | { | ||
1125 | if (item.onlinestatus == true) | ||
1126 | { | ||
1127 | if (item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0) | ||
1128 | { | ||
1129 | ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target); | ||
1130 | string regionname = SPTarget.Scene.RegionInfo.RegionName; | ||
1131 | remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat)); | ||
1132 | } | ||
1133 | } | ||
1134 | else | ||
1135 | { | ||
1136 | remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false); | ||
1137 | } | ||
1138 | } | ||
1139 | } | ||
1117 | 1140 | ||
1118 | public List<FriendListItem> GetUserFriends(UUID agentID) | 1141 | public List<FriendListItem> GetUserFriends(UUID agentID) |
1119 | { | 1142 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs index 7e1bed5..50171a3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Gods/GodsModule.cs | |||
@@ -118,7 +118,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Gods | |||
118 | 118 | ||
119 | m_scene.ForEachClient( | 119 | m_scene.ForEachClient( |
120 | delegate(IClientAPI controller) | 120 | delegate(IClientAPI controller) |
121 | { | 121 | { |
122 | if (controller.AgentId != godID) | 122 | if (controller.AgentId != godID) |
123 | controller.Kick(reasonStr); | 123 | controller.Kick(reasonStr); |
124 | } | 124 | } |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs index 0ced2f9..160a9bd 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | |||
@@ -359,12 +359,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
359 | 359 | ||
360 | UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager); | 360 | UUID ospResolvedId = OspResolver.ResolveOspa(item.CreatorId, m_scene.CommsManager); |
361 | if (UUID.Zero != ospResolvedId) | 361 | if (UUID.Zero != ospResolvedId) |
362 | { | 362 | { |
363 | item.CreatorIdAsUuid = ospResolvedId; | 363 | item.CreatorIdAsUuid = ospResolvedId; |
364 | 364 | ||
365 | // XXX: For now, don't preserve the OSPA in the creator id (which actually gets persisted to the | 365 | // XXX: For now, don't preserve the OSPA in the creator id (which actually gets persisted to the |
366 | // database). Instead, replace with the UUID that we found. | 366 | // database). Instead, replace with the UUID that we found. |
367 | item.CreatorId = ospResolvedId.ToString(); | 367 | item.CreatorId = ospResolvedId.ToString(); |
368 | } | 368 | } |
369 | else | 369 | else |
370 | { | 370 | { |
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index c85d974..98b686e 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs | |||
@@ -117,12 +117,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
117 | } | 117 | } |
118 | 118 | ||
119 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) | 119 | protected void ReceivedAllAssets(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) |
120 | { | 120 | { |
121 | Exception reportedException = null; | 121 | Exception reportedException = null; |
122 | bool succeeded = true; | 122 | bool succeeded = true; |
123 | 123 | ||
124 | try | 124 | try |
125 | { | 125 | { |
126 | // We're almost done. Just need to write out the control file now | 126 | // We're almost done. Just need to write out the control file now |
127 | m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); | 127 | m_archiveWriter.WriteFile(ArchiveConstants.CONTROL_FILE_PATH, Create0p1ControlFile()); |
128 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); | 128 | m_log.InfoFormat("[ARCHIVER]: Added control file to archive."); |
@@ -269,7 +269,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver | |||
269 | m_module.TriggerInventoryArchiveSaved( | 269 | m_module.TriggerInventoryArchiveSaved( |
270 | m_id, false, m_userInfo, m_invPath, m_saveStream, | 270 | m_id, false, m_userInfo, m_invPath, m_saveStream, |
271 | new Exception(errorMessage)); | 271 | new Exception(errorMessage)); |
272 | return; | 272 | return; |
273 | } | 273 | } |
274 | 274 | ||
275 | m_archiveWriter = new TarArchiveWriter(m_saveStream); | 275 | m_archiveWriter = new TarArchiveWriter(m_saveStream); |
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs index 1b23d92..0c6cb1b 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs | |||
@@ -708,5 +708,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
708 | OSD item = EventQueueHelper.GroupMembership(groupUpdate); | 708 | OSD item = EventQueueHelper.GroupMembership(groupUpdate); |
709 | Enqueue(item, avatarID); | 709 | Enqueue(item, avatarID); |
710 | } | 710 | } |
711 | public void QueryReply(PlacesReplyPacket groupUpdate, UUID avatarID) | ||
712 | { | ||
713 | OSD item = EventQueueHelper.PlacesQuery(groupUpdate); | ||
714 | Enqueue(item, avatarID); | ||
715 | } | ||
711 | } | 716 | } |
712 | } | 717 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs index c50318d..efa60bb 100644 --- a/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs | |||
@@ -454,6 +454,48 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue | |||
454 | 454 | ||
455 | return groupUpdate; | 455 | return groupUpdate; |
456 | } | 456 | } |
457 | |||
458 | public static OSD PlacesQuery(PlacesReplyPacket PlacesReply) | ||
459 | { | ||
460 | OSDMap placesReply = new OSDMap(); | ||
461 | placesReply.Add("message", OSD.FromString("PlacesReplyMessage")); | ||
462 | |||
463 | OSDMap body = new OSDMap(); | ||
464 | OSDArray agentData = new OSDArray(); | ||
465 | OSDMap agentDataMap = new OSDMap(); | ||
466 | agentDataMap.Add("AgentID", OSD.FromUUID(PlacesReply.AgentData.AgentID)); | ||
467 | agentDataMap.Add("QueryID", OSD.FromUUID(PlacesReply.AgentData.QueryID)); | ||
468 | agentDataMap.Add("TransactionID", OSD.FromUUID(PlacesReply.TransactionData.TransactionID)); | ||
469 | agentData.Add(agentDataMap); | ||
470 | body.Add("AgentData", agentData); | ||
471 | |||
472 | OSDArray QueryData = new OSDArray(); | ||
473 | |||
474 | foreach (PlacesReplyPacket.QueryDataBlock groupDataBlock in PlacesReply.QueryData) | ||
475 | { | ||
476 | OSDMap QueryDataMap = new OSDMap(); | ||
477 | QueryDataMap.Add("ActualArea", OSD.FromInteger(groupDataBlock.ActualArea)); | ||
478 | QueryDataMap.Add("BillableArea", OSD.FromInteger(groupDataBlock.BillableArea)); | ||
479 | QueryDataMap.Add("Description", OSD.FromBinary(groupDataBlock.Desc)); | ||
480 | QueryDataMap.Add("Dwell", OSD.FromInteger((int)groupDataBlock.Dwell)); | ||
481 | QueryDataMap.Add("Flags", OSD.FromString(Convert.ToString(groupDataBlock.Flags))); | ||
482 | QueryDataMap.Add("GlobalX", OSD.FromInteger((int)groupDataBlock.GlobalX)); | ||
483 | QueryDataMap.Add("GlobalY", OSD.FromInteger((int)groupDataBlock.GlobalY)); | ||
484 | QueryDataMap.Add("GlobalZ", OSD.FromInteger((int)groupDataBlock.GlobalZ)); | ||
485 | QueryDataMap.Add("Name", OSD.FromBinary(groupDataBlock.Name)); | ||
486 | QueryDataMap.Add("OwnerID", OSD.FromUUID(groupDataBlock.OwnerID)); | ||
487 | QueryDataMap.Add("SimName", OSD.FromBinary(groupDataBlock.SimName)); | ||
488 | QueryDataMap.Add("SnapShotID", OSD.FromUUID(groupDataBlock.SnapshotID)); | ||
489 | QueryDataMap.Add("ProductSku", OSD.FromInteger(0)); | ||
490 | QueryDataMap.Add("Price", OSD.FromInteger(groupDataBlock.Price)); | ||
491 | |||
492 | QueryData.Add(QueryDataMap); | ||
493 | } | ||
494 | body.Add("QueryData", QueryData); | ||
495 | placesReply.Add("QueryData[]", body); | ||
496 | |||
497 | return placesReply; | ||
498 | } | ||
457 | 499 | ||
458 | } | 500 | } |
459 | } | 501 | } |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index 3c0997c..68d13b7 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | |||
@@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
104 | List<string> serialisedParcels = new List<string>(); | 104 | List<string> serialisedParcels = new List<string>(); |
105 | string filePath = "NONE"; | 105 | string filePath = "NONE"; |
106 | 106 | ||
107 | TarArchiveReader archive = new TarArchiveReader(m_loadStream); | 107 | TarArchiveReader archive = new TarArchiveReader(m_loadStream); |
108 | byte[] data; | 108 | byte[] data; |
109 | TarArchiveReader.TarEntryType entryType; | 109 | TarArchiveReader.TarEntryType entryType; |
110 | 110 | ||
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs index 75c4557..9fc6ec4 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestExecution.cs | |||
@@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
91 | 91 | ||
92 | m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_scene.RegionInfo.RegionName); | 92 | m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_scene.RegionInfo.RegionName); |
93 | 93 | ||
94 | m_scene.EventManager.TriggerOarFileSaved(m_requestId, String.Empty); | 94 | m_scene.EventManager.TriggerOarFileSaved(m_requestId, String.Empty); |
95 | } | 95 | } |
96 | 96 | ||
97 | protected internal void Save(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) | 97 | protected internal void Save(ICollection<UUID> assetsFoundUuids, ICollection<UUID> assetsNotFoundUuids) |
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 27763bb..fc8d4e1 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs | |||
@@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
50 | /// <value> | 50 | /// <value> |
51 | /// The file used to load and save an opensimulator archive if no filename has been specified | 51 | /// The file used to load and save an opensimulator archive if no filename has been specified |
52 | /// </value> | 52 | /// </value> |
53 | protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar"; | 53 | protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar"; |
54 | 54 | ||
55 | public string Name | 55 | public string Name |
56 | { | 56 | { |
@@ -111,7 +111,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver | |||
111 | { | 111 | { |
112 | DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, Guid.Empty); | 112 | DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, Guid.Empty); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | /// <summary> | 116 | /// <summary> |
117 | /// Save a region to a file, including all the assets needed to restore it. | 117 | /// Save a region to a file, including all the assets needed to restore it. |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 81024db..1fbc733 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs | |||
@@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
105 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); | 105 | ILandObject obj = new LandObject(UUID.Zero, false, m_scene); |
106 | obj.LandData.Name = "NO LAND"; | 106 | obj.LandData.Name = "NO LAND"; |
107 | return obj; | 107 | return obj; |
108 | } | 108 | } |
109 | 109 | ||
110 | public List<ILandObject> AllParcels() | 110 | public List<ILandObject> AllParcels() |
111 | { | 111 | { |
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 9a2ef50..9b39b09 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs | |||
@@ -627,7 +627,7 @@ namespace OpenSim.Region.CoreModules.World.Land | |||
627 | return null; | 627 | return null; |
628 | } | 628 | } |
629 | } | 629 | } |
630 | } | 630 | } |
631 | 631 | ||
632 | #endregion | 632 | #endregion |
633 | 633 | ||
diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index c9b3071..e837e9a 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs | |||
@@ -800,7 +800,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions | |||
800 | } | 800 | } |
801 | 801 | ||
802 | protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers) | 802 | protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers) |
803 | { | 803 | { |
804 | if (parcel.LandData.OwnerID == user) | 804 | if (parcel.LandData.OwnerID == user) |
805 | { | 805 | { |
806 | // Returning immediately so that group deeded objects on group deeded land don't trigger a NRE on | 806 | // Returning immediately so that group deeded objects on group deeded land don't trigger a NRE on |
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index fed8f64..4cdc33d 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs | |||
@@ -273,6 +273,26 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
273 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 273 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
274 | 274 | ||
275 | public event PlacesQuery OnPlacesQuery; | 275 | public event PlacesQuery OnPlacesQuery; |
276 | |||
277 | public event FindAgentUpdate OnFindAgentEvent; | ||
278 | public event TrackAgentUpdate OnTrackAgentEvent; | ||
279 | public event NewUserReport OnUserReportEvent; | ||
280 | public event SaveStateHandler OnSaveStateEvent; | ||
281 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | ||
282 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | ||
283 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | ||
284 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | ||
285 | public event EjectUserUpdate OnParcelEjectUserEvent; | ||
286 | public event ParcelBuyPass OnParcelBuyPass; | ||
287 | public event ParcelGodMark OnParcelGodMark; | ||
288 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | ||
289 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | ||
290 | public event SimWideDeletesDelegate OnSimWideDeletes; | ||
291 | public event SendPostcard OnSendPostcard; | ||
292 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | ||
293 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | ||
294 | public event GodlikeMessage onGodlikeMessageEvent; | ||
295 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | ||
276 | 296 | ||
277 | #pragma warning restore 67 | 297 | #pragma warning restore 67 |
278 | 298 | ||
@@ -1103,5 +1123,17 @@ namespace OpenSim.Region.Examples.SimpleModule | |||
1103 | public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) | 1123 | public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) |
1104 | { | 1124 | { |
1105 | } | 1125 | } |
1126 | |||
1127 | public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) | ||
1128 | { | ||
1129 | } | ||
1130 | |||
1131 | public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) | ||
1132 | { | ||
1133 | } | ||
1134 | |||
1135 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | ||
1136 | { | ||
1137 | } | ||
1106 | } | 1138 | } |
1107 | } | 1139 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs index 6fe6118..f71e31d 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs | |||
@@ -60,7 +60,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
60 | /// </summary> | 60 | /// </summary> |
61 | /// <param name="position"></param> | 61 | /// <param name="position"></param> |
62 | /// <returns></returns> | 62 | /// <returns></returns> |
63 | List<ILandObject> ParcelsNearPoint(Vector3 position); | 63 | List<ILandObject> ParcelsNearPoint(Vector3 position); |
64 | 64 | ||
65 | /// <summary> | 65 | /// <summary> |
66 | /// Get the parcel given the land's local id. | 66 | /// Get the parcel given the land's local id. |
diff --git a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs index 1a8babc..991d60c 100644 --- a/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IRegionArchiverModule.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
34 | /// Interface to region archive functionality | 34 | /// Interface to region archive functionality |
35 | /// </summary> | 35 | /// </summary> |
36 | public interface IRegionArchiverModule | 36 | public interface IRegionArchiverModule |
37 | { | 37 | { |
38 | void HandleLoadOarConsoleCommand(string module, string[] cmdparams); | 38 | void HandleLoadOarConsoleCommand(string module, string[] cmdparams); |
39 | void HandleSaveOarConsoleCommand(string module, string[] cmdparams); | 39 | void HandleSaveOarConsoleCommand(string module, string[] cmdparams); |
40 | 40 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2e34d1c..adf5f02 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -387,11 +387,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
387 | { | 387 | { |
388 | get { return StatsReporter.getLastReportedSimFPS(); } | 388 | get { return StatsReporter.getLastReportedSimFPS(); } |
389 | } | 389 | } |
390 | 390 | ||
391 | public float[] SimulatorStats | 391 | public float[] SimulatorStats |
392 | { | 392 | { |
393 | get { return StatsReporter.getLastReportedSimStats(); } | 393 | get { return StatsReporter.getLastReportedSimStats(); } |
394 | } | 394 | } |
395 | 395 | ||
396 | public string DefaultScriptEngine | 396 | public string DefaultScriptEngine |
397 | { | 397 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index f8498c6..e63e8d9 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -412,6 +412,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
412 | { | 412 | { |
413 | get { return true; } | 413 | get { return true; } |
414 | } | 414 | } |
415 | |||
416 | private bool m_passCollision; | ||
417 | public bool PassCollision | ||
418 | { | ||
419 | get { return m_passCollision; } | ||
420 | set | ||
421 | { | ||
422 | m_passCollision = value; | ||
423 | HasGroupChanged = true; | ||
424 | } | ||
425 | } | ||
415 | 426 | ||
416 | public bool IsSelected | 427 | public bool IsSelected |
417 | { | 428 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 6b562e5..a14e3ad 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -140,6 +140,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
140 | 140 | ||
141 | [XmlIgnore] | 141 | [XmlIgnore] |
142 | public UUID FromItemID; | 142 | public UUID FromItemID; |
143 | |||
144 | [XmlIgnore] | ||
145 | private Dictionary<int, string> m_CollisionFilter = new Dictionary<int, string>(); | ||
143 | 146 | ||
144 | /// <value> | 147 | /// <value> |
145 | /// The UUID of the user inventory item from which this object was rezzed if this is a root part. | 148 | /// The UUID of the user inventory item from which this object was rezzed if this is a root part. |
@@ -457,6 +460,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
457 | } | 460 | } |
458 | } | 461 | } |
459 | 462 | ||
463 | |||
464 | [XmlIgnore] | ||
465 | public Dictionary<int, string> CollisionFilter | ||
466 | { | ||
467 | get { return m_CollisionFilter; } | ||
468 | set | ||
469 | { | ||
470 | m_CollisionFilter = value; | ||
471 | } | ||
472 | } | ||
473 | |||
460 | public ulong RegionHandle | 474 | public ulong RegionHandle |
461 | { | 475 | { |
462 | get { return m_regionHandle; } | 476 | get { return m_regionHandle; } |
@@ -1885,18 +1899,49 @@ namespace OpenSim.Region.Framework.Scenes | |||
1885 | return; | 1899 | return; |
1886 | 1900 | ||
1887 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 1901 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
1902 | string data = ""; | ||
1888 | if (obj != null) | 1903 | if (obj != null) |
1889 | { | 1904 | { |
1890 | DetectedObject detobj = new DetectedObject(); | 1905 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
1891 | detobj.keyUUID = obj.UUID; | 1906 | { |
1892 | detobj.nameStr = obj.Name; | 1907 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1893 | detobj.ownerUUID = obj._ownerID; | 1908 | //If it is 1, it is to accept ONLY collisions from this object |
1894 | detobj.posVector = obj.AbsolutePosition; | 1909 | if (found) |
1895 | detobj.rotQuat = obj.GetWorldRotation(); | 1910 | { |
1896 | detobj.velVector = obj.Velocity; | 1911 | DetectedObject detobj = new DetectedObject(); |
1897 | detobj.colliderType = 0; | 1912 | detobj.keyUUID = obj.UUID; |
1898 | detobj.groupUUID = obj._groupID; | 1913 | detobj.nameStr = obj.Name; |
1899 | colliding.Add(detobj); | 1914 | detobj.ownerUUID = obj._ownerID; |
1915 | detobj.posVector = obj.AbsolutePosition; | ||
1916 | detobj.rotQuat = obj.GetWorldRotation(); | ||
1917 | detobj.velVector = obj.Velocity; | ||
1918 | detobj.colliderType = 0; | ||
1919 | detobj.groupUUID = obj._groupID; | ||
1920 | colliding.Add(detobj); | ||
1921 | } | ||
1922 | //If it is 0, it is to not accept collisions from this object | ||
1923 | else | ||
1924 | { | ||
1925 | } | ||
1926 | } | ||
1927 | else | ||
1928 | { | ||
1929 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
1930 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
1931 | if (found) | ||
1932 | { | ||
1933 | DetectedObject detobj = new DetectedObject(); | ||
1934 | detobj.keyUUID = obj.UUID; | ||
1935 | detobj.nameStr = obj.Name; | ||
1936 | detobj.ownerUUID = obj._ownerID; | ||
1937 | detobj.posVector = obj.AbsolutePosition; | ||
1938 | detobj.rotQuat = obj.GetWorldRotation(); | ||
1939 | detobj.velVector = obj.Velocity; | ||
1940 | detobj.colliderType = 0; | ||
1941 | detobj.groupUUID = obj._groupID; | ||
1942 | colliding.Add(detobj); | ||
1943 | } | ||
1944 | } | ||
1900 | } | 1945 | } |
1901 | else | 1946 | else |
1902 | { | 1947 | { |
@@ -1908,16 +1953,47 @@ namespace OpenSim.Region.Framework.Scenes | |||
1908 | 1953 | ||
1909 | if (av.LocalId == localId) | 1954 | if (av.LocalId == localId) |
1910 | { | 1955 | { |
1911 | DetectedObject detobj = new DetectedObject(); | 1956 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
1912 | detobj.keyUUID = av.UUID; | 1957 | { |
1913 | detobj.nameStr = av.ControllingClient.Name; | 1958 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1914 | detobj.ownerUUID = av.UUID; | 1959 | //If it is 1, it is to accept ONLY collisions from this avatar |
1915 | detobj.posVector = av.AbsolutePosition; | 1960 | if (found) |
1916 | detobj.rotQuat = av.Rotation; | 1961 | { |
1917 | detobj.velVector = av.Velocity; | 1962 | DetectedObject detobj = new DetectedObject(); |
1918 | detobj.colliderType = 0; | 1963 | detobj.keyUUID = av.UUID; |
1919 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | 1964 | detobj.nameStr = av.ControllingClient.Name; |
1920 | colliding.Add(detobj); | 1965 | detobj.ownerUUID = av.UUID; |
1966 | detobj.posVector = av.AbsolutePosition; | ||
1967 | detobj.rotQuat = av.Rotation; | ||
1968 | detobj.velVector = av.Velocity; | ||
1969 | detobj.colliderType = 0; | ||
1970 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
1971 | colliding.Add(detobj); | ||
1972 | } | ||
1973 | //If it is 0, it is to not accept collisions from this avatar | ||
1974 | else | ||
1975 | { | ||
1976 | } | ||
1977 | } | ||
1978 | else | ||
1979 | { | ||
1980 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
1981 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
1982 | if (found) | ||
1983 | { | ||
1984 | DetectedObject detobj = new DetectedObject(); | ||
1985 | detobj.keyUUID = av.UUID; | ||
1986 | detobj.nameStr = av.ControllingClient.Name; | ||
1987 | detobj.ownerUUID = av.UUID; | ||
1988 | detobj.posVector = av.AbsolutePosition; | ||
1989 | detobj.rotQuat = av.Rotation; | ||
1990 | detobj.velVector = av.Velocity; | ||
1991 | detobj.colliderType = 0; | ||
1992 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
1993 | colliding.Add(detobj); | ||
1994 | } | ||
1995 | } | ||
1996 | |||
1921 | } | 1997 | } |
1922 | } | 1998 | } |
1923 | } | 1999 | } |
@@ -1931,7 +2007,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1931 | 2007 | ||
1932 | if (m_parentGroup.Scene == null) | 2008 | if (m_parentGroup.Scene == null) |
1933 | return; | 2009 | return; |
1934 | 2010 | if (m_parentGroup.PassCollision == true) | |
2011 | { | ||
2012 | //TODO: Add pass to root prim! | ||
2013 | } | ||
1935 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); | 2014 | m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); |
1936 | } | 2015 | } |
1937 | } | 2016 | } |
@@ -1956,39 +2035,101 @@ namespace OpenSim.Region.Framework.Scenes | |||
1956 | return; | 2035 | return; |
1957 | 2036 | ||
1958 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 2037 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
2038 | string data = ""; | ||
1959 | if (obj != null) | 2039 | if (obj != null) |
1960 | { | 2040 | { |
1961 | DetectedObject detobj = new DetectedObject(); | 2041 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
1962 | detobj.keyUUID = obj.UUID; | 2042 | { |
1963 | detobj.nameStr = obj.Name; | 2043 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1964 | detobj.ownerUUID = obj._ownerID; | 2044 | //If it is 1, it is to accept ONLY collisions from this object |
1965 | detobj.posVector = obj.AbsolutePosition; | 2045 | if (found) |
1966 | detobj.rotQuat = obj.GetWorldRotation(); | 2046 | { |
1967 | detobj.velVector = obj.Velocity; | 2047 | DetectedObject detobj = new DetectedObject(); |
1968 | detobj.colliderType = 0; | 2048 | detobj.keyUUID = obj.UUID; |
1969 | detobj.groupUUID = obj._groupID; | 2049 | detobj.nameStr = obj.Name; |
1970 | colliding.Add(detobj); | 2050 | detobj.ownerUUID = obj._ownerID; |
2051 | detobj.posVector = obj.AbsolutePosition; | ||
2052 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2053 | detobj.velVector = obj.Velocity; | ||
2054 | detobj.colliderType = 0; | ||
2055 | detobj.groupUUID = obj._groupID; | ||
2056 | colliding.Add(detobj); | ||
2057 | } | ||
2058 | //If it is 0, it is to not accept collisions from this object | ||
2059 | else | ||
2060 | { | ||
2061 | } | ||
2062 | } | ||
2063 | else | ||
2064 | { | ||
2065 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2066 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
2067 | if (found) | ||
2068 | { | ||
2069 | DetectedObject detobj = new DetectedObject(); | ||
2070 | detobj.keyUUID = obj.UUID; | ||
2071 | detobj.nameStr = obj.Name; | ||
2072 | detobj.ownerUUID = obj._ownerID; | ||
2073 | detobj.posVector = obj.AbsolutePosition; | ||
2074 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2075 | detobj.velVector = obj.Velocity; | ||
2076 | detobj.colliderType = 0; | ||
2077 | detobj.groupUUID = obj._groupID; | ||
2078 | colliding.Add(detobj); | ||
2079 | } | ||
2080 | } | ||
1971 | } | 2081 | } |
1972 | else | 2082 | else |
1973 | { | 2083 | { |
1974 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); | 2084 | ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); |
1975 | 2085 | ||
1976 | for (int i = 0; i < avlist.Length; i++) | 2086 | for (int i = 0; i < avlist.Length; i++) |
1977 | { | 2087 | { |
1978 | ScenePresence av = avlist[i]; | 2088 | ScenePresence av = avlist[i]; |
1979 | 2089 | ||
1980 | if (av.LocalId == localId) | 2090 | if (av.LocalId == localId) |
1981 | { | 2091 | { |
1982 | DetectedObject detobj = new DetectedObject(); | 2092 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
1983 | detobj.keyUUID = av.UUID; | 2093 | { |
1984 | detobj.nameStr = av.Name; | 2094 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
1985 | detobj.ownerUUID = av.UUID; | 2095 | //If it is 1, it is to accept ONLY collisions from this avatar |
1986 | detobj.posVector = av.AbsolutePosition; | 2096 | if (found) |
1987 | detobj.rotQuat = av.Rotation; | 2097 | { |
1988 | detobj.velVector = av.Velocity; | 2098 | DetectedObject detobj = new DetectedObject(); |
1989 | detobj.colliderType = 0; | 2099 | detobj.keyUUID = av.UUID; |
1990 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | 2100 | detobj.nameStr = av.ControllingClient.Name; |
1991 | colliding.Add(detobj); | 2101 | detobj.ownerUUID = av.UUID; |
2102 | detobj.posVector = av.AbsolutePosition; | ||
2103 | detobj.rotQuat = av.Rotation; | ||
2104 | detobj.velVector = av.Velocity; | ||
2105 | detobj.colliderType = 0; | ||
2106 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2107 | colliding.Add(detobj); | ||
2108 | } | ||
2109 | //If it is 0, it is to not accept collisions from this avatar | ||
2110 | else | ||
2111 | { | ||
2112 | } | ||
2113 | } | ||
2114 | else | ||
2115 | { | ||
2116 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2117 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
2118 | if (found) | ||
2119 | { | ||
2120 | DetectedObject detobj = new DetectedObject(); | ||
2121 | detobj.keyUUID = av.UUID; | ||
2122 | detobj.nameStr = av.ControllingClient.Name; | ||
2123 | detobj.ownerUUID = av.UUID; | ||
2124 | detobj.posVector = av.AbsolutePosition; | ||
2125 | detobj.rotQuat = av.Rotation; | ||
2126 | detobj.velVector = av.Velocity; | ||
2127 | detobj.colliderType = 0; | ||
2128 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2129 | colliding.Add(detobj); | ||
2130 | } | ||
2131 | } | ||
2132 | |||
1992 | } | 2133 | } |
1993 | } | 2134 | } |
1994 | } | 2135 | } |
@@ -2025,18 +2166,49 @@ namespace OpenSim.Region.Framework.Scenes | |||
2025 | if (m_parentGroup.Scene == null) | 2166 | if (m_parentGroup.Scene == null) |
2026 | return; | 2167 | return; |
2027 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); | 2168 | SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); |
2169 | string data = ""; | ||
2028 | if (obj != null) | 2170 | if (obj != null) |
2029 | { | 2171 | { |
2030 | DetectedObject detobj = new DetectedObject(); | 2172 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
2031 | detobj.keyUUID = obj.UUID; | 2173 | { |
2032 | detobj.nameStr = obj.Name; | 2174 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2033 | detobj.ownerUUID = obj._ownerID; | 2175 | //If it is 1, it is to accept ONLY collisions from this object |
2034 | detobj.posVector = obj.AbsolutePosition; | 2176 | if (found) |
2035 | detobj.rotQuat = obj.GetWorldRotation(); | 2177 | { |
2036 | detobj.velVector = obj.Velocity; | 2178 | DetectedObject detobj = new DetectedObject(); |
2037 | detobj.colliderType = 0; | 2179 | detobj.keyUUID = obj.UUID; |
2038 | detobj.groupUUID = obj._groupID; | 2180 | detobj.nameStr = obj.Name; |
2039 | colliding.Add(detobj); | 2181 | detobj.ownerUUID = obj._ownerID; |
2182 | detobj.posVector = obj.AbsolutePosition; | ||
2183 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2184 | detobj.velVector = obj.Velocity; | ||
2185 | detobj.colliderType = 0; | ||
2186 | detobj.groupUUID = obj._groupID; | ||
2187 | colliding.Add(detobj); | ||
2188 | } | ||
2189 | //If it is 0, it is to not accept collisions from this object | ||
2190 | else | ||
2191 | { | ||
2192 | } | ||
2193 | } | ||
2194 | else | ||
2195 | { | ||
2196 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2197 | //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work | ||
2198 | if (found) | ||
2199 | { | ||
2200 | DetectedObject detobj = new DetectedObject(); | ||
2201 | detobj.keyUUID = obj.UUID; | ||
2202 | detobj.nameStr = obj.Name; | ||
2203 | detobj.ownerUUID = obj._ownerID; | ||
2204 | detobj.posVector = obj.AbsolutePosition; | ||
2205 | detobj.rotQuat = obj.GetWorldRotation(); | ||
2206 | detobj.velVector = obj.Velocity; | ||
2207 | detobj.colliderType = 0; | ||
2208 | detobj.groupUUID = obj._groupID; | ||
2209 | colliding.Add(detobj); | ||
2210 | } | ||
2211 | } | ||
2040 | } | 2212 | } |
2041 | else | 2213 | else |
2042 | { | 2214 | { |
@@ -2048,16 +2220,47 @@ namespace OpenSim.Region.Framework.Scenes | |||
2048 | 2220 | ||
2049 | if (av.LocalId == localId) | 2221 | if (av.LocalId == localId) |
2050 | { | 2222 | { |
2051 | DetectedObject detobj = new DetectedObject(); | 2223 | if (m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name)) |
2052 | detobj.keyUUID = av.UUID; | 2224 | { |
2053 | detobj.nameStr = av.Name; | 2225 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); |
2054 | detobj.ownerUUID = av.UUID; | 2226 | //If it is 1, it is to accept ONLY collisions from this avatar |
2055 | detobj.posVector = av.AbsolutePosition; | 2227 | if (found) |
2056 | detobj.rotQuat = av.Rotation; | 2228 | { |
2057 | detobj.velVector = av.Velocity; | 2229 | DetectedObject detobj = new DetectedObject(); |
2058 | detobj.colliderType = 0; | 2230 | detobj.keyUUID = av.UUID; |
2059 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | 2231 | detobj.nameStr = av.ControllingClient.Name; |
2060 | colliding.Add(detobj); | 2232 | detobj.ownerUUID = av.UUID; |
2233 | detobj.posVector = av.AbsolutePosition; | ||
2234 | detobj.rotQuat = av.Rotation; | ||
2235 | detobj.velVector = av.Velocity; | ||
2236 | detobj.colliderType = 0; | ||
2237 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2238 | colliding.Add(detobj); | ||
2239 | } | ||
2240 | //If it is 0, it is to not accept collisions from this avatar | ||
2241 | else | ||
2242 | { | ||
2243 | } | ||
2244 | } | ||
2245 | else | ||
2246 | { | ||
2247 | bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data); | ||
2248 | //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work | ||
2249 | if (found) | ||
2250 | { | ||
2251 | DetectedObject detobj = new DetectedObject(); | ||
2252 | detobj.keyUUID = av.UUID; | ||
2253 | detobj.nameStr = av.ControllingClient.Name; | ||
2254 | detobj.ownerUUID = av.UUID; | ||
2255 | detobj.posVector = av.AbsolutePosition; | ||
2256 | detobj.rotQuat = av.Rotation; | ||
2257 | detobj.velVector = av.Velocity; | ||
2258 | detobj.colliderType = 0; | ||
2259 | detobj.groupUUID = av.ControllingClient.ActiveGroupId; | ||
2260 | colliding.Add(detobj); | ||
2261 | } | ||
2262 | } | ||
2263 | |||
2061 | } | 2264 | } |
2062 | } | 2265 | } |
2063 | } | 2266 | } |
@@ -2685,6 +2888,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
2685 | ScheduleFullUpdate(); | 2888 | ScheduleFullUpdate(); |
2686 | } | 2889 | } |
2687 | 2890 | ||
2891 | public void StopLookAt() | ||
2892 | { | ||
2893 | m_parentGroup.stopLookAt(); | ||
2894 | |||
2895 | m_parentGroup.ScheduleGroupForTerseUpdate(); | ||
2896 | } | ||
2897 | |||
2688 | /// <summary> | 2898 | /// <summary> |
2689 | /// Set the text displayed for this part. | 2899 | /// Set the text displayed for this part. |
2690 | /// </summary> | 2900 | /// </summary> |
@@ -2700,13 +2910,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2700 | SetText(text); | 2910 | SetText(text); |
2701 | } | 2911 | } |
2702 | 2912 | ||
2703 | public void StopLookAt() | ||
2704 | { | ||
2705 | m_parentGroup.stopLookAt(); | ||
2706 | |||
2707 | m_parentGroup.ScheduleGroupForTerseUpdate(); | ||
2708 | } | ||
2709 | |||
2710 | public void StopMoveToTarget() | 2913 | public void StopMoveToTarget() |
2711 | { | 2914 | { |
2712 | m_parentGroup.stopMoveToTarget(); | 2915 | m_parentGroup.stopMoveToTarget(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index c3bc96a..f36c1a9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1985,7 +1985,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1985 | if (collisionPoint.ApproxEquals(m_requestedSitOffset + part.AbsolutePosition, 0.2f)) | 1985 | if (collisionPoint.ApproxEquals(m_requestedSitOffset + part.AbsolutePosition, 0.2f)) |
1986 | { | 1986 | { |
1987 | SitRaycastFindEdge(collisionPoint, normal); | 1987 | SitRaycastFindEdge(collisionPoint, normal); |
1988 | m_log.DebugFormat("[SIT]: Raycast Avatar Position succeeded at point: {0}, normal:{1}", collisionPoint, normal ); | 1988 | m_log.DebugFormat("[SIT]: Raycast Avatar Position succeeded at point: {0}, normal:{1}", collisionPoint, normal); |
1989 | } | 1989 | } |
1990 | else | 1990 | else |
1991 | { | 1991 | { |
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index e368c2a..fd23294 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | |||
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
82 | private int m_fps = 0; | 82 | private int m_fps = 0; |
83 | // saved last reported value so there is something available for llGetRegionFPS | 83 | // saved last reported value so there is something available for llGetRegionFPS |
84 | private float lastReportedSimFPS = 0; | 84 | private float lastReportedSimFPS = 0; |
85 | private float[] lastReportedSimStats = new float[21]; | 85 | private float[] lastReportedSimStats = new float[21]; |
86 | private float m_pfps = 0; | 86 | private float m_pfps = 0; |
87 | private int m_agentUpdates = 0; | 87 | private int m_agentUpdates = 0; |
88 | 88 | ||
@@ -263,11 +263,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
263 | 263 | ||
264 | sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; | 264 | sb[20].StatID = (uint)Stats.ScriptLinesPerSecond; |
265 | sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; | 265 | sb[20].StatValue = m_scriptLinesPerSecond / statsUpdateFactor; |
266 | 266 | ||
267 | for (int i = 0; i < 21; i++) | 267 | for (int i = 0; i < 21; i++) |
268 | { | 268 | { |
269 | lastReportedSimStats[i] = sb[i].StatValue; | 269 | lastReportedSimStats[i] = sb[i].StatValue; |
270 | } | 270 | } |
271 | 271 | ||
272 | SimStats simStats | 272 | SimStats simStats |
273 | = new SimStats( | 273 | = new SimStats( |
@@ -447,11 +447,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
447 | { | 447 | { |
448 | return lastReportedSimFPS; | 448 | return lastReportedSimFPS; |
449 | } | 449 | } |
450 | 450 | ||
451 | public float[] getLastReportedSimStats() | 451 | public float[] getLastReportedSimStats() |
452 | { | 452 | { |
453 | return lastReportedSimStats; | 453 | return lastReportedSimStats; |
454 | } | 454 | } |
455 | 455 | ||
456 | public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes) | 456 | public void AddPacketsStats(int inPackets, int outPackets, int unAckedBytes) |
457 | { | 457 | { |
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index c333413..7907570 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs | |||
@@ -836,6 +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; | ||
840 | public event TrackAgentUpdate OnTrackAgentEvent; | ||
841 | public event NewUserReport OnUserReportEvent; | ||
842 | public event SaveStateHandler OnSaveStateEvent; | ||
843 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | ||
844 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | ||
845 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | ||
846 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | ||
847 | public event EjectUserUpdate OnParcelEjectUserEvent; | ||
848 | public event ParcelBuyPass OnParcelBuyPass; | ||
849 | public event ParcelGodMark OnParcelGodMark; | ||
850 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | ||
851 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | ||
852 | public event SimWideDeletesDelegate OnSimWideDeletes; | ||
853 | public event SendPostcard OnSendPostcard; | ||
854 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | ||
855 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | ||
856 | public event GodlikeMessage onGodlikeMessageEvent; | ||
857 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | ||
839 | 858 | ||
840 | #pragma warning restore 67 | 859 | #pragma warning restore 67 |
841 | 860 | ||
@@ -1628,5 +1647,17 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server | |||
1628 | public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) | 1647 | public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) |
1629 | { | 1648 | { |
1630 | } | 1649 | } |
1650 | |||
1651 | public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) | ||
1652 | { | ||
1653 | } | ||
1654 | |||
1655 | public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) | ||
1656 | { | ||
1657 | } | ||
1658 | |||
1659 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | ||
1660 | { | ||
1661 | } | ||
1631 | } | 1662 | } |
1632 | } | 1663 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs index 9d64667..30580e7 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/Interfaces/IObject.cs | |||
@@ -179,8 +179,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
179 | /// </summary> | 179 | /// </summary> |
180 | /// <param name="msg">The message to send to the user</param> | 180 | /// <param name="msg">The message to send to the user</param> |
181 | void Say(string msg); | 181 | void Say(string msg); |
182 | 182 | ||
183 | void Say(string msg,int channel); | 183 | void Say(string msg,int channel); |
184 | 184 | ||
185 | //// <value> | 185 | //// <value> |
186 | /// Grants access to the objects inventory | 186 | /// Grants access to the objects inventory |
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs index 9596d13..31f28e0 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/SOPObject.cs | |||
@@ -264,7 +264,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
264 | if (CanEdit()) | 264 | if (CanEdit()) |
265 | { | 265 | { |
266 | GetSOP().SitTargetPosition = value; | 266 | GetSOP().SitTargetPosition = value; |
267 | } | 267 | } |
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
@@ -276,7 +276,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
276 | if (CanEdit()) | 276 | if (CanEdit()) |
277 | { | 277 | { |
278 | GetSOP().SitName = value; | 278 | GetSOP().SitName = value; |
279 | } | 279 | } |
280 | } | 280 | } |
281 | } | 281 | } |
282 | 282 | ||
@@ -288,7 +288,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
288 | if (CanEdit()) | 288 | if (CanEdit()) |
289 | { | 289 | { |
290 | GetSOP().TouchName = value; | 290 | GetSOP().TouchName = value; |
291 | } | 291 | } |
292 | } | 292 | } |
293 | } | 293 | } |
294 | 294 | ||
@@ -384,7 +384,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
384 | m_rootScene.SimChat(msg, ChatTypeEnum.Say, sop.AbsolutePosition, sop.Name, sop.UUID, false); | 384 | m_rootScene.SimChat(msg, ChatTypeEnum.Say, sop.AbsolutePosition, sop.Name, sop.UUID, false); |
385 | } | 385 | } |
386 | 386 | ||
387 | public void Say(string msg,int channel) | 387 | public void Say(string msg,int channel) |
388 | { | 388 | { |
389 | if (!CanEdit()) | 389 | if (!CanEdit()) |
390 | return; | 390 | return; |
@@ -392,7 +392,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
392 | SceneObjectPart sop = GetSOP(); | 392 | SceneObjectPart sop = GetSOP(); |
393 | m_rootScene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say,channel, sop.AbsolutePosition, sop.Name, sop.UUID, false); | 393 | m_rootScene.SimChat(Utils.StringToBytes(msg), ChatTypeEnum.Say,channel, sop.AbsolutePosition, sop.Name, sop.UUID, false); |
394 | } | 394 | } |
395 | 395 | ||
396 | #endregion | 396 | #endregion |
397 | 397 | ||
398 | 398 | ||
diff --git a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs index 82020cb..c7cd37b 100644 --- a/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs +++ b/OpenSim/Region/OptionalModules/Scripting/Minimodule/World.cs | |||
@@ -149,7 +149,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
149 | e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId, m_security); | 149 | e.Sender = new SOPObject(m_internalScene, ((SceneObjectPart) chat.SenderObject).LocalId, m_security); |
150 | e.Text = chat.Message; | 150 | e.Text = chat.Message; |
151 | e.Channel = chat.Channel; | 151 | e.Channel = chat.Channel; |
152 | 152 | ||
153 | _OnChat(this, e); | 153 | _OnChat(this, e); |
154 | return; | 154 | return; |
155 | } | 155 | } |
@@ -160,7 +160,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule | |||
160 | e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID, m_security); | 160 | e.Sender = new SPAvatar(m_internalScene, chat.SenderUUID, m_security); |
161 | e.Text = chat.Message; | 161 | e.Text = chat.Message; |
162 | e.Channel = chat.Channel; | 162 | e.Channel = chat.Channel; |
163 | 163 | ||
164 | _OnChat(this, e); | 164 | _OnChat(this, e); |
165 | return; | 165 | return; |
166 | } | 166 | } |
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index 9ca5a0a..c862821 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | |||
@@ -379,6 +379,26 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
379 | public event AvatarInterestUpdate OnAvatarInterestUpdate; | 379 | public event AvatarInterestUpdate OnAvatarInterestUpdate; |
380 | 380 | ||
381 | public event PlacesQuery OnPlacesQuery; | 381 | public event PlacesQuery OnPlacesQuery; |
382 | |||
383 | public event FindAgentUpdate OnFindAgentEvent; | ||
384 | public event TrackAgentUpdate OnTrackAgentEvent; | ||
385 | public event NewUserReport OnUserReportEvent; | ||
386 | public event SaveStateHandler OnSaveStateEvent; | ||
387 | public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest; | ||
388 | public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest; | ||
389 | public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest; | ||
390 | public event FreezeUserUpdate OnParcelFreezeUserEvent; | ||
391 | public event EjectUserUpdate OnParcelEjectUserEvent; | ||
392 | public event ParcelBuyPass OnParcelBuyPass; | ||
393 | public event ParcelGodMark OnParcelGodMark; | ||
394 | public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest; | ||
395 | public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; | ||
396 | public event SimWideDeletesDelegate OnSimWideDeletes; | ||
397 | public event SendPostcard OnSendPostcard; | ||
398 | public event MuteListEntryUpdate OnUpdateMuteListEntryEvent; | ||
399 | public event MuteListEntryRemove OnRemoveMuteListEntryEvent; | ||
400 | public event GodlikeMessage onGodlikeMessageEvent; | ||
401 | public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent; | ||
382 | 402 | ||
383 | #pragma warning restore 67 | 403 | #pragma warning restore 67 |
384 | 404 | ||
@@ -1108,5 +1128,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC | |||
1108 | public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) | 1128 | public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) |
1109 | { | 1129 | { |
1110 | } | 1130 | } |
1131 | |||
1132 | public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt) | ||
1133 | { | ||
1134 | } | ||
1135 | |||
1136 | public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier) | ||
1137 | { | ||
1138 | } | ||
1139 | |||
1140 | public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt) | ||
1141 | { | ||
1142 | } | ||
1111 | } | 1143 | } |
1112 | } | 1144 | } |
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs index f411dd7..31366db 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsActor.cs | |||
@@ -305,22 +305,22 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
305 | 305 | ||
306 | public override Quaternion APIDTarget | 306 | public override Quaternion APIDTarget |
307 | { | 307 | { |
308 | set { return; } | 308 | set { return; } |
309 | } | 309 | } |
310 | 310 | ||
311 | public override bool APIDActive | 311 | public override bool APIDActive |
312 | { | 312 | { |
313 | set { return; } | 313 | set { return; } |
314 | } | 314 | } |
315 | 315 | ||
316 | public override float APIDStrength | 316 | public override float APIDStrength |
317 | { | 317 | { |
318 | set { return; } | 318 | set { return; } |
319 | } | 319 | } |
320 | 320 | ||
321 | public override float APIDDamping | 321 | public override float APIDDamping |
322 | { | 322 | { |
323 | set { return; } | 323 | set { return; } |
324 | } | 324 | } |
325 | 325 | ||
326 | public override void SubscribeEvents(int ms) | 326 | public override void SubscribeEvents(int ms) |
diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs index 88f5d3e..a3344dd 100644 --- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs +++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs | |||
@@ -622,22 +622,22 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin | |||
622 | 622 | ||
623 | public override Quaternion APIDTarget | 623 | public override Quaternion APIDTarget |
624 | { | 624 | { |
625 | set { return; } | 625 | set { return; } |
626 | } | 626 | } |
627 | 627 | ||
628 | public override bool APIDActive | 628 | public override bool APIDActive |
629 | { | 629 | { |
630 | set { return; } | 630 | set { return; } |
631 | } | 631 | } |
632 | 632 | ||
633 | public override float APIDStrength | 633 | public override float APIDStrength |
634 | { | 634 | { |
635 | set { return; } | 635 | set { return; } |
636 | } | 636 | } |
637 | 637 | ||
638 | public override float APIDDamping | 638 | public override float APIDDamping |
639 | { | 639 | { |
640 | set { return; } | 640 | set { return; } |
641 | } | 641 | } |
642 | 642 | ||
643 | /// <summary> | 643 | /// <summary> |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 10b153d..9c192ed 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Physics.Manager | |||
243 | public abstract PIDHoverType PIDHoverType { set;} | 243 | public abstract PIDHoverType PIDHoverType { set;} |
244 | public abstract float PIDHoverTau { set;} | 244 | public abstract float PIDHoverTau { set;} |
245 | 245 | ||
246 | // For RotLookAt | 246 | // For RotLookAt |
247 | public abstract Quaternion APIDTarget { set;} | 247 | public abstract Quaternion APIDTarget { set;} |
248 | public abstract bool APIDActive { set;} | 248 | public abstract bool APIDActive { set;} |
249 | public abstract float APIDStrength { set;} | 249 | public abstract float APIDStrength { set;} |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs index 39cdc0f..008070b 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEDynamics.cs | |||
@@ -32,11 +32,11 @@ | |||
32 | * ODEDynamics.cs contains methods dealing with Prim Physical motion | 32 | * ODEDynamics.cs contains methods dealing with Prim Physical motion |
33 | * (dynamics) and the associated settings. Old Linear and angular | 33 | * (dynamics) and the associated settings. Old Linear and angular |
34 | * motors for dynamic motion have been replace with MoveLinear() | 34 | * motors for dynamic motion have been replace with MoveLinear() |
35 | * and MoveAngular(); 'Physical' is used only to switch ODE dynamic | 35 | * and MoveAngular(); 'Physical' is used only to switch ODE dynamic |
36 | * simualtion on/off; VEHICAL_TYPE_NONE/VEHICAL_TYPE_<other> is to | 36 | * simualtion on/off; VEHICAL_TYPE_NONE/VEHICAL_TYPE_<other> is to |
37 | * switch between 'VEHICLE' parameter use and general dynamics | 37 | * switch between 'VEHICLE' parameter use and general dynamics |
38 | * settings use. | 38 | * settings use. |
39 | */ | 39 | */ |
40 | 40 | ||
41 | using System; | 41 | using System; |
42 | using System.Collections.Generic; | 42 | using System.Collections.Generic; |
@@ -53,7 +53,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
53 | public class ODEDynamics | 53 | public class ODEDynamics |
54 | { | 54 | { |
55 | public Vehicle Type | 55 | public Vehicle Type |
56 | { | 56 | { |
57 | get { return m_type; } | 57 | get { return m_type; } |
58 | } | 58 | } |
59 | 59 | ||
@@ -62,14 +62,14 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
62 | get { return m_body; } | 62 | get { return m_body; } |
63 | } | 63 | } |
64 | 64 | ||
65 | private int frcount = 0; // Used to limit dynamics debug output to | 65 | private int frcount = 0; // Used to limit dynamics debug output to |
66 | // every 100th frame | 66 | // every 100th frame |
67 | 67 | ||
68 | // private OdeScene m_parentScene = null; | 68 | // private OdeScene m_parentScene = null; |
69 | private IntPtr m_body = IntPtr.Zero; | 69 | private IntPtr m_body = IntPtr.Zero; |
70 | // private IntPtr m_jointGroup = IntPtr.Zero; | 70 | // private IntPtr m_jointGroup = IntPtr.Zero; |
71 | // private IntPtr m_aMotor = IntPtr.Zero; | 71 | // private IntPtr m_aMotor = IntPtr.Zero; |
72 | 72 | ||
73 | 73 | ||
74 | // Vehicle properties | 74 | // Vehicle properties |
75 | private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind | 75 | private Vehicle m_type = Vehicle.TYPE_NONE; // If a 'VEHICLE', and what kind |
@@ -82,7 +82,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
82 | // HOVER_UP_ONLY | 82 | // HOVER_UP_ONLY |
83 | // LIMIT_MOTOR_UP | 83 | // LIMIT_MOTOR_UP |
84 | // LIMIT_ROLL_ONLY | 84 | // LIMIT_ROLL_ONLY |
85 | 85 | ||
86 | // Linear properties | 86 | // Linear properties |
87 | private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time | 87 | private Vector3 m_linearMotorDirection = Vector3.Zero; // velocity requested by LSL, decayed by time |
88 | private Vector3 m_linearMotorDirectionLASTSET = Vector3.Zero; // velocity requested by LSL | 88 | private Vector3 m_linearMotorDirectionLASTSET = Vector3.Zero; // velocity requested by LSL |
@@ -91,47 +91,43 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
91 | private float m_linearMotorDecayTimescale = 0; | 91 | private float m_linearMotorDecayTimescale = 0; |
92 | private float m_linearMotorTimescale = 0; | 92 | private float m_linearMotorTimescale = 0; |
93 | private Vector3 m_lastLinearVelocityVector = Vector3.Zero; | 93 | private Vector3 m_lastLinearVelocityVector = Vector3.Zero; |
94 | // private bool m_LinearMotorSetLastFrame = false; | 94 | // private bool m_LinearMotorSetLastFrame = false; |
95 | // private Vector3 m_linearMotorOffset = Vector3.Zero; | 95 | // private Vector3 m_linearMotorOffset = Vector3.Zero; |
96 | 96 | ||
97 | //Angular properties | 97 | //Angular properties |
98 | private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor | 98 | private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor |
99 | private int m_angularMotorApply = 0; // application frame counter | 99 | private int m_angularMotorApply = 0; // application frame counter |
100 | private Vector3 m_angularMotorVelocity = Vector3.Zero; // current angular motor velocity | 100 | private Vector3 m_angularMotorVelocity = Vector3.Zero; // current angular motor velocity |
101 | private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate | 101 | private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate |
102 | private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate | 102 | private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate |
103 | private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate | 103 | private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate |
104 | private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body | 104 | private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body |
105 | // private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body | 105 | // private Vector3 m_lastVertAttractor = Vector3.Zero; // what VA was last applied to body |
106 | 106 | ||
107 | //Deflection properties | 107 | //Deflection properties |
108 | // private float m_angularDeflectionEfficiency = 0; | 108 | // private float m_angularDeflectionEfficiency = 0; |
109 | // private float m_angularDeflectionTimescale = 0; | 109 | // private float m_angularDeflectionTimescale = 0; |
110 | // private float m_linearDeflectionEfficiency = 0; | 110 | // private float m_linearDeflectionEfficiency = 0; |
111 | // private float m_linearDeflectionTimescale = 0; | 111 | // private float m_linearDeflectionTimescale = 0; |
112 | 112 | ||
113 | //Banking properties | 113 | //Banking properties |
114 | // private float m_bankingEfficiency = 0; | 114 | // private float m_bankingEfficiency = 0; |
115 | // private float m_bankingMix = 0; | 115 | // private float m_bankingMix = 0; |
116 | // private float m_bankingTimescale = 0; | 116 | // private float m_bankingTimescale = 0; |
117 | 117 | ||
118 | //Hover and Buoyancy properties | 118 | //Hover and Buoyancy properties |
119 | private float m_VhoverHeight = 0f; | 119 | private float m_VhoverHeight = 0f; |
120 | // private float m_VhoverEfficiency = 0f; | 120 | // private float m_VhoverEfficiency = 0f; |
121 | private float m_VhoverTimescale = 0f; | 121 | private float m_VhoverTimescale = 0f; |
122 | private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height | 122 | private float m_VhoverTargetHeight = -1.0f; // if <0 then no hover, else its the current target height |
123 | private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle. | 123 | private float m_VehicleBuoyancy = 0f; //KF: m_VehicleBuoyancy is set by VEHICLE_BUOYANCY for a vehicle. |
124 | // Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity) | 124 | // Modifies gravity. Slider between -1 (double-gravity) and 1 (full anti-gravity) |
125 | // KF: So far I have found no good method to combine a script-requested .Z velocity and gravity. | 125 | // KF: So far I have found no good method to combine a script-requested .Z velocity and gravity. |
126 | // Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity. | 126 | // Therefore only m_VehicleBuoyancy=1 (0g) will use the script-requested .Z velocity. |
127 | 127 | ||
128 | //Attractor properties | 128 | //Attractor properties |
129 | private float m_verticalAttractionEfficiency = 1.0f; // damped | 129 | private float m_verticalAttractionEfficiency = 1.0f; // damped |
130 | private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor. | 130 | private float m_verticalAttractionTimescale = 500f; // Timescale > 300 means no vert attractor. |
131 | |||
132 | |||
133 | |||
134 | |||
135 | 131 | ||
136 | internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) | 132 | internal void ProcessFloatVehicleParam(Vehicle pParam, float pValue) |
137 | { | 133 | { |
@@ -166,13 +162,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
166 | // m_bankingTimescale = pValue; | 162 | // m_bankingTimescale = pValue; |
167 | break; | 163 | break; |
168 | case Vehicle.BUOYANCY: | 164 | case Vehicle.BUOYANCY: |
169 | if (pValue < -1f) pValue = -1f; | 165 | if (pValue < -1f) pValue = -1f; |
170 | if (pValue > 1f) pValue = 1f; | 166 | if (pValue > 1f) pValue = 1f; |
171 | m_VehicleBuoyancy = pValue; | 167 | m_VehicleBuoyancy = pValue; |
172 | break; | 168 | break; |
173 | // case Vehicle.HOVER_EFFICIENCY: | 169 | // case Vehicle.HOVER_EFFICIENCY: |
174 | // if (pValue < 0f) pValue = 0f; | 170 | // if (pValue < 0f) pValue = 0f; |
175 | // if (pValue > 1f) pValue = 1f; | 171 | // if (pValue > 1f) pValue = 1f; |
176 | // m_VhoverEfficiency = pValue; | 172 | // m_VhoverEfficiency = pValue; |
177 | // break; | 173 | // break; |
178 | case Vehicle.HOVER_HEIGHT: | 174 | case Vehicle.HOVER_HEIGHT: |
@@ -199,7 +195,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
199 | m_linearMotorTimescale = pValue; | 195 | m_linearMotorTimescale = pValue; |
200 | break; | 196 | break; |
201 | case Vehicle.VERTICAL_ATTRACTION_EFFICIENCY: | 197 | case Vehicle.VERTICAL_ATTRACTION_EFFICIENCY: |
202 | if (pValue < 0.1f) pValue = 0.1f; // Less goes unstable | 198 | if (pValue < 0.1f) pValue = 0.1f; // Less goes unstable |
203 | if (pValue > 1.0f) pValue = 1.0f; | 199 | if (pValue > 1.0f) pValue = 1.0f; |
204 | m_verticalAttractionEfficiency = pValue; | 200 | m_verticalAttractionEfficiency = pValue; |
205 | break; | 201 | break; |
@@ -207,8 +203,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
207 | if (pValue < 0.01f) pValue = 0.01f; | 203 | if (pValue < 0.01f) pValue = 0.01f; |
208 | m_verticalAttractionTimescale = pValue; | 204 | m_verticalAttractionTimescale = pValue; |
209 | break; | 205 | break; |
210 | 206 | ||
211 | // These are vector properties but the engine lets you use a single float value to | 207 | // These are vector properties but the engine lets you use a single float value to |
212 | // set all of the components to the same value | 208 | // set all of the components to the same value |
213 | case Vehicle.ANGULAR_FRICTION_TIMESCALE: | 209 | case Vehicle.ANGULAR_FRICTION_TIMESCALE: |
214 | m_angularFrictionTimescale = new Vector3(pValue, pValue, pValue); | 210 | m_angularFrictionTimescale = new Vector3(pValue, pValue, pValue); |
@@ -229,7 +225,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
229 | break; | 225 | break; |
230 | 226 | ||
231 | } | 227 | } |
232 | |||
233 | }//end ProcessFloatVehicleParam | 228 | }//end ProcessFloatVehicleParam |
234 | 229 | ||
235 | internal void ProcessVectorVehicleParam(Vehicle pParam, Vector3 pValue) | 230 | internal void ProcessVectorVehicleParam(Vehicle pParam, Vector3 pValue) |
@@ -242,12 +237,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
242 | case Vehicle.ANGULAR_MOTOR_DIRECTION: | 237 | case Vehicle.ANGULAR_MOTOR_DIRECTION: |
243 | m_angularMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z); | 238 | m_angularMotorDirection = new Vector3(pValue.X, pValue.Y, pValue.Z); |
244 | // Limit requested angular speed to 2 rps= 4 pi rads/sec | 239 | // Limit requested angular speed to 2 rps= 4 pi rads/sec |
245 | if(m_angularMotorDirection.X > 12.56f) m_angularMotorDirection.X = 12.56f; | 240 | if (m_angularMotorDirection.X > 12.56f) m_angularMotorDirection.X = 12.56f; |
246 | if(m_angularMotorDirection.X < - 12.56f) m_angularMotorDirection.X = - 12.56f; | 241 | if (m_angularMotorDirection.X < - 12.56f) m_angularMotorDirection.X = - 12.56f; |
247 | if(m_angularMotorDirection.Y > 12.56f) m_angularMotorDirection.Y = 12.56f; | 242 | if (m_angularMotorDirection.Y > 12.56f) m_angularMotorDirection.Y = 12.56f; |
248 | if(m_angularMotorDirection.Y < - 12.56f) m_angularMotorDirection.Y = - 12.56f; | 243 | if (m_angularMotorDirection.Y < - 12.56f) m_angularMotorDirection.Y = - 12.56f; |
249 | if(m_angularMotorDirection.Z > 12.56f) m_angularMotorDirection.Z = 12.56f; | 244 | if (m_angularMotorDirection.Z > 12.56f) m_angularMotorDirection.Z = 12.56f; |
250 | if(m_angularMotorDirection.Z < - 12.56f) m_angularMotorDirection.Z = - 12.56f; | 245 | if (m_angularMotorDirection.Z < - 12.56f) m_angularMotorDirection.Z = - 12.56f; |
251 | m_angularMotorApply = 10; | 246 | m_angularMotorApply = 10; |
252 | break; | 247 | break; |
253 | case Vehicle.LINEAR_FRICTION_TIMESCALE: | 248 | case Vehicle.LINEAR_FRICTION_TIMESCALE: |
@@ -261,7 +256,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
261 | // m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z); | 256 | // m_linearMotorOffset = new Vector3(pValue.X, pValue.Y, pValue.Z); |
262 | break; | 257 | break; |
263 | } | 258 | } |
264 | |||
265 | }//end ProcessVectorVehicleParam | 259 | }//end ProcessVectorVehicleParam |
266 | 260 | ||
267 | internal void ProcessRotationVehicleParam(Vehicle pParam, Quaternion pValue) | 261 | internal void ProcessRotationVehicleParam(Vehicle pParam, Quaternion pValue) |
@@ -272,12 +266,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
272 | // m_referenceFrame = pValue; | 266 | // m_referenceFrame = pValue; |
273 | break; | 267 | break; |
274 | } | 268 | } |
275 | |||
276 | }//end ProcessRotationVehicleParam | 269 | }//end ProcessRotationVehicleParam |
277 | 270 | ||
278 | internal void ProcessTypeChange(Vehicle pType) | 271 | internal void ProcessTypeChange(Vehicle pType) |
279 | { | 272 | { |
280 | // Set Defaults For Type | 273 | // Set Defaults For Type |
281 | m_type = pType; | 274 | m_type = pType; |
282 | switch (pType) | 275 | switch (pType) |
283 | { | 276 | { |
@@ -357,8 +350,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
357 | // m_bankingMix = 0.8f; | 350 | // m_bankingMix = 0.8f; |
358 | // m_bankingTimescale = 1; | 351 | // m_bankingTimescale = 1; |
359 | // m_referenceFrame = Quaternion.Identity; | 352 | // m_referenceFrame = Quaternion.Identity; |
360 | m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.LIMIT_ROLL_ONLY | | 353 | m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.LIMIT_ROLL_ONLY | |
361 | VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY); | 354 | VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY); |
362 | m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY | | 355 | m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.HOVER_WATER_ONLY | |
363 | VehicleFlag.LIMIT_MOTOR_UP); | 356 | VehicleFlag.LIMIT_MOTOR_UP); |
364 | break; | 357 | break; |
@@ -432,24 +425,25 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
432 | { | 425 | { |
433 | if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE) | 426 | if (m_body == IntPtr.Zero || m_type == Vehicle.TYPE_NONE) |
434 | return; | 427 | return; |
435 | frcount++; // used to limit debug comment output | 428 | frcount++; // used to limit debug comment output |
436 | if (frcount > 100) | 429 | if (frcount > 100) |
437 | frcount = 0; | 430 | frcount = 0; |
438 | 431 | ||
439 | MoveLinear(pTimestep, pParentScene); | 432 | MoveLinear(pTimestep, pParentScene); |
440 | MoveAngular(pTimestep); | 433 | MoveAngular(pTimestep); |
441 | }// end Step | 434 | }// end Step |
442 | 435 | ||
443 | private void MoveLinear(float pTimestep, OdeScene _pParentScene) | 436 | private void MoveLinear(float pTimestep, OdeScene _pParentScene) |
444 | { | 437 | { |
445 | if (!m_linearMotorDirection.ApproxEquals(Vector3.Zero, 0.01f)) // requested m_linearMotorDirection is significant | 438 | if (!m_linearMotorDirection.ApproxEquals(Vector3.Zero, 0.01f)) // requested m_linearMotorDirection is significant |
446 | { | 439 | { |
447 | if(!d.BodyIsEnabled (Body)) d.BodyEnable (Body); | 440 | if (!d.BodyIsEnabled(Body)) |
441 | d.BodyEnable(Body); | ||
448 | 442 | ||
449 | // add drive to body | 443 | // add drive to body |
450 | Vector3 addAmount = m_linearMotorDirection/(m_linearMotorTimescale/pTimestep); | 444 | Vector3 addAmount = m_linearMotorDirection/(m_linearMotorTimescale/pTimestep); |
451 | m_lastLinearVelocityVector += (addAmount*10); // lastLinearVelocityVector is the current body velocity vector? | 445 | m_lastLinearVelocityVector += (addAmount*10); // lastLinearVelocityVector is the current body velocity vector? |
452 | 446 | ||
453 | // This will work temporarily, but we really need to compare speed on an axis | 447 | // This will work temporarily, but we really need to compare speed on an axis |
454 | // KF: Limit body velocity to applied velocity? | 448 | // KF: Limit body velocity to applied velocity? |
455 | if (Math.Abs(m_lastLinearVelocityVector.X) > Math.Abs(m_linearMotorDirectionLASTSET.X)) | 449 | if (Math.Abs(m_lastLinearVelocityVector.X) > Math.Abs(m_linearMotorDirectionLASTSET.X)) |
@@ -458,7 +452,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
458 | m_lastLinearVelocityVector.Y = m_linearMotorDirectionLASTSET.Y; | 452 | m_lastLinearVelocityVector.Y = m_linearMotorDirectionLASTSET.Y; |
459 | if (Math.Abs(m_lastLinearVelocityVector.Z) > Math.Abs(m_linearMotorDirectionLASTSET.Z)) | 453 | if (Math.Abs(m_lastLinearVelocityVector.Z) > Math.Abs(m_linearMotorDirectionLASTSET.Z)) |
460 | m_lastLinearVelocityVector.Z = m_linearMotorDirectionLASTSET.Z; | 454 | m_lastLinearVelocityVector.Z = m_linearMotorDirectionLASTSET.Z; |
461 | 455 | ||
462 | // decay applied velocity | 456 | // decay applied velocity |
463 | Vector3 decayfraction = ((Vector3.One/(m_linearMotorDecayTimescale/pTimestep))); | 457 | Vector3 decayfraction = ((Vector3.One/(m_linearMotorDecayTimescale/pTimestep))); |
464 | //Console.WriteLine("decay: " + decayfraction); | 458 | //Console.WriteLine("decay: " + decayfraction); |
@@ -466,194 +460,192 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
466 | //Console.WriteLine("actual: " + m_linearMotorDirection); | 460 | //Console.WriteLine("actual: " + m_linearMotorDirection); |
467 | } | 461 | } |
468 | else | 462 | else |
469 | { // requested is not significant | 463 | { // requested is not significant |
470 | // if what remains of applied is small, zero it. | 464 | // if what remains of applied is small, zero it. |
471 | if (m_lastLinearVelocityVector.ApproxEquals(Vector3.Zero, 0.01f)) | 465 | if (m_lastLinearVelocityVector.ApproxEquals(Vector3.Zero, 0.01f)) |
472 | m_lastLinearVelocityVector = Vector3.Zero; | 466 | m_lastLinearVelocityVector = Vector3.Zero; |
473 | } | 467 | } |
474 | 468 | ||
475 | 469 | // convert requested object velocity to world-referenced vector | |
476 | // convert requested object velocity to world-referenced vector | ||
477 | m_dir = m_lastLinearVelocityVector; | 470 | m_dir = m_lastLinearVelocityVector; |
478 | d.Quaternion rot = d.BodyGetQuaternion(Body); | 471 | d.Quaternion rot = d.BodyGetQuaternion(Body); |
479 | Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object | 472 | Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); // rotq = rotation of object |
480 | m_dir *= rotq; // apply obj rotation to velocity vector | 473 | m_dir *= rotq; // apply obj rotation to velocity vector |
481 | 474 | ||
482 | // add Gravity andBuoyancy | 475 | // add Gravity andBuoyancy |
483 | // KF: So far I have found no good method to combine a script-requested | 476 | // KF: So far I have found no good method to combine a script-requested |
484 | // .Z velocity and gravity. Therefore only 0g will used script-requested | 477 | // .Z velocity and gravity. Therefore only 0g will used script-requested |
485 | // .Z velocity. >0g (m_VehicleBuoyancy < 1) will used modified gravity only. | 478 | // .Z velocity. >0g (m_VehicleBuoyancy < 1) will used modified gravity only. |
486 | Vector3 grav = Vector3.Zero; | 479 | Vector3 grav = Vector3.Zero; |
487 | if(m_VehicleBuoyancy < 1.0f) | 480 | if (m_VehicleBuoyancy < 1.0f) |
488 | { | 481 | { |
489 | // There is some gravity, make a gravity force vector | 482 | // There is some gravity, make a gravity force vector |
490 | // that is applied after object velocity. | 483 | // that is applied after object velocity. |
491 | d.Mass objMass; | 484 | d.Mass objMass; |
492 | d.BodyGetMass(Body, out objMass); | 485 | d.BodyGetMass(Body, out objMass); |
493 | // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g; | 486 | // m_VehicleBuoyancy: -1=2g; 0=1g; 1=0g; |
494 | grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy); | 487 | grav.Z = _pParentScene.gravityz * objMass.mass * (1f - m_VehicleBuoyancy); |
495 | // Preserve the current Z velocity | 488 | // Preserve the current Z velocity |
496 | d.Vector3 vel_now = d.BodyGetLinearVel(Body); | 489 | d.Vector3 vel_now = d.BodyGetLinearVel(Body); |
497 | m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity | 490 | m_dir.Z = vel_now.Z; // Preserve the accumulated falling velocity |
498 | } // else its 1.0, no gravity. | 491 | } // else its 1.0, no gravity. |
499 | 492 | ||
500 | // Check if hovering | 493 | // Check if hovering |
501 | if( (m_flags & (VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT)) != 0) | 494 | if ((m_flags & (VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT)) != 0) |
502 | { | 495 | { |
503 | // We should hover, get the target height | 496 | // We should hover, get the target height |
504 | d.Vector3 pos = d.BodyGetPosition(Body); | 497 | d.Vector3 pos = d.BodyGetPosition(Body); |
505 | if((m_flags & VehicleFlag.HOVER_WATER_ONLY) == VehicleFlag.HOVER_WATER_ONLY) | 498 | if ((m_flags & VehicleFlag.HOVER_WATER_ONLY) == VehicleFlag.HOVER_WATER_ONLY) |
506 | { | 499 | { |
507 | m_VhoverTargetHeight = _pParentScene.GetWaterLevel() + m_VhoverHeight; | 500 | m_VhoverTargetHeight = _pParentScene.GetWaterLevel() + m_VhoverHeight; |
508 | } | 501 | } |
509 | else if((m_flags & VehicleFlag.HOVER_TERRAIN_ONLY) == VehicleFlag.HOVER_TERRAIN_ONLY) | 502 | else if ((m_flags & VehicleFlag.HOVER_TERRAIN_ONLY) == VehicleFlag.HOVER_TERRAIN_ONLY) |
510 | { | 503 | { |
511 | m_VhoverTargetHeight = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + m_VhoverHeight; | 504 | m_VhoverTargetHeight = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y) + m_VhoverHeight; |
512 | } | 505 | } |
513 | else if((m_flags & VehicleFlag.HOVER_GLOBAL_HEIGHT) == VehicleFlag.HOVER_GLOBAL_HEIGHT) | 506 | else if ((m_flags & VehicleFlag.HOVER_GLOBAL_HEIGHT) == VehicleFlag.HOVER_GLOBAL_HEIGHT) |
514 | { | 507 | { |
515 | m_VhoverTargetHeight = m_VhoverHeight; | 508 | m_VhoverTargetHeight = m_VhoverHeight; |
516 | } | 509 | } |
517 | 510 | ||
518 | if((m_flags & VehicleFlag.HOVER_UP_ONLY) == VehicleFlag.HOVER_UP_ONLY) | 511 | if ((m_flags & VehicleFlag.HOVER_UP_ONLY) == VehicleFlag.HOVER_UP_ONLY) |
519 | { | 512 | { |
520 | // If body is aready heigher, use its height as target height | 513 | // If body is aready heigher, use its height as target height |
521 | if(pos.Z > m_VhoverTargetHeight) m_VhoverTargetHeight = pos.Z; | 514 | if (pos.Z > m_VhoverTargetHeight) m_VhoverTargetHeight = pos.Z; |
522 | } | 515 | } |
523 | 516 | ||
524 | // m_VhoverEfficiency = 0f; // 0=boucy, 1=Crit.damped | 517 | // m_VhoverEfficiency = 0f; // 0=boucy, 1=Crit.damped |
525 | // m_VhoverTimescale = 0f; // time to acheive height | 518 | // m_VhoverTimescale = 0f; // time to acheive height |
526 | // pTimestep is time since last frame,in secs | 519 | // pTimestep is time since last frame,in secs |
527 | float herr0 = pos.Z - m_VhoverTargetHeight; | 520 | float herr0 = pos.Z - m_VhoverTargetHeight; |
528 | // Replace Vertical speed with correction figure if significant | 521 | // Replace Vertical speed with correction figure if significant |
529 | if(Math.Abs(herr0) > 0.01f ) | 522 | if (Math.Abs(herr0) > 0.01f) |
530 | { | 523 | { |
531 | d.Mass objMass; | 524 | d.Mass objMass; |
532 | d.BodyGetMass(Body, out objMass); | 525 | d.BodyGetMass(Body, out objMass); |
533 | m_dir.Z = - ( (herr0 * pTimestep * 50.0f) / m_VhoverTimescale); | 526 | m_dir.Z = - ((herr0 * pTimestep * 50.0f) / m_VhoverTimescale); |
534 | //KF: m_VhoverEfficiency is not yet implemented | 527 | //KF: m_VhoverEfficiency is not yet implemented |
535 | } | 528 | } |
536 | else | 529 | else |
537 | { | 530 | { |
538 | m_dir.Z = 0f; | 531 | m_dir.Z = 0f; |
539 | } | 532 | } |
540 | } | 533 | } |
541 | 534 | ||
542 | // Apply velocity | 535 | // Apply velocity |
543 | d.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z); | 536 | d.BodySetLinearVel(Body, m_dir.X, m_dir.Y, m_dir.Z); |
544 | // apply gravity force | 537 | // apply gravity force |
545 | d.BodyAddForce(Body, grav.X, grav.Y, grav.Z); | 538 | d.BodyAddForce(Body, grav.X, grav.Y, grav.Z); |
546 | 539 | ||
547 | 540 | ||
548 | // apply friction | 541 | // apply friction |
549 | Vector3 decayamount = Vector3.One / (m_linearFrictionTimescale / pTimestep); | 542 | Vector3 decayamount = Vector3.One / (m_linearFrictionTimescale / pTimestep); |
550 | m_lastLinearVelocityVector -= m_lastLinearVelocityVector * decayamount; | 543 | m_lastLinearVelocityVector -= m_lastLinearVelocityVector * decayamount; |
551 | } // end MoveLinear() | 544 | } // end MoveLinear() |
552 | 545 | ||
553 | private void MoveAngular(float pTimestep) | 546 | private void MoveAngular(float pTimestep) |
554 | { | 547 | { |
555 | /* | 548 | /* |
556 | private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor | 549 | private Vector3 m_angularMotorDirection = Vector3.Zero; // angular velocity requested by LSL motor |
557 | private int m_angularMotorApply = 0; // application frame counter | 550 | private int m_angularMotorApply = 0; // application frame counter |
558 | private float m_angularMotorVelocity = 0; // current angular motor velocity (ramps up and down) | 551 | private float m_angularMotorVelocity = 0; // current angular motor velocity (ramps up and down) |
559 | private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate | 552 | private float m_angularMotorTimescale = 0; // motor angular velocity ramp up rate |
560 | private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate | 553 | private float m_angularMotorDecayTimescale = 0; // motor angular velocity decay rate |
561 | private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate | 554 | private Vector3 m_angularFrictionTimescale = Vector3.Zero; // body angular velocity decay rate |
562 | private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body | 555 | private Vector3 m_lastAngularVelocity = Vector3.Zero; // what was last applied to body |
563 | */ | 556 | */ |
564 | 557 | ||
565 | // Get what the body is doing, this includes 'external' influences | 558 | // Get what the body is doing, this includes 'external' influences |
566 | d.Vector3 angularVelocity = d.BodyGetAngularVel(Body); | 559 | d.Vector3 angularVelocity = d.BodyGetAngularVel(Body); |
567 | // Vector3 angularVelocity = Vector3.Zero; | 560 | // Vector3 angularVelocity = Vector3.Zero; |
568 | 561 | ||
569 | if (m_angularMotorApply > 0) | 562 | if (m_angularMotorApply > 0) |
570 | { | 563 | { |
571 | // ramp up to new value | 564 | // ramp up to new value |
572 | // current velocity += error / ( time to get there / step interval ) | 565 | // current velocity += error / (time to get there / step interval) |
573 | // requested speed - last motor speed | 566 | // requested speed - last motor speed |
574 | m_angularMotorVelocity.X += (m_angularMotorDirection.X - m_angularMotorVelocity.X) / (m_angularMotorTimescale / pTimestep); | 567 | m_angularMotorVelocity.X += (m_angularMotorDirection.X - m_angularMotorVelocity.X) / (m_angularMotorTimescale / pTimestep); |
575 | m_angularMotorVelocity.Y += (m_angularMotorDirection.Y - m_angularMotorVelocity.Y) / (m_angularMotorTimescale / pTimestep); | 568 | m_angularMotorVelocity.Y += (m_angularMotorDirection.Y - m_angularMotorVelocity.Y) / (m_angularMotorTimescale / pTimestep); |
576 | m_angularMotorVelocity.Z += (m_angularMotorDirection.Z - m_angularMotorVelocity.Z) / (m_angularMotorTimescale / pTimestep); | 569 | m_angularMotorVelocity.Z += (m_angularMotorDirection.Z - m_angularMotorVelocity.Z) / (m_angularMotorTimescale / pTimestep); |
577 | 570 | ||
578 | m_angularMotorApply--; // This is done so that if script request rate is less than phys frame rate the expected | 571 | m_angularMotorApply--; // This is done so that if script request rate is less than phys frame rate the expected |
579 | // velocity may still be acheived. | 572 | // velocity may still be acheived. |
580 | } | 573 | } |
581 | else | 574 | else |
582 | { | 575 | { |
583 | // no motor recently applied, keep the body velocity | 576 | // no motor recently applied, keep the body velocity |
584 | /* m_angularMotorVelocity.X = angularVelocity.X; | 577 | /* m_angularMotorVelocity.X = angularVelocity.X; |
585 | m_angularMotorVelocity.Y = angularVelocity.Y; | 578 | m_angularMotorVelocity.Y = angularVelocity.Y; |
586 | m_angularMotorVelocity.Z = angularVelocity.Z; */ | 579 | m_angularMotorVelocity.Z = angularVelocity.Z; */ |
587 | 580 | ||
588 | // and decay the velocity | 581 | // and decay the velocity |
589 | m_angularMotorVelocity -= m_angularMotorVelocity / (m_angularMotorDecayTimescale / pTimestep); | 582 | m_angularMotorVelocity -= m_angularMotorVelocity / (m_angularMotorDecayTimescale / pTimestep); |
590 | } // end motor section | 583 | } // end motor section |
591 | |||
592 | 584 | ||
593 | // Vertical attractor section | 585 | // Vertical attractor section |
594 | Vector3 vertattr = Vector3.Zero; | 586 | Vector3 vertattr = Vector3.Zero; |
595 | 587 | ||
596 | if(m_verticalAttractionTimescale < 300) | 588 | if (m_verticalAttractionTimescale < 300) |
597 | { | ||
598 | float VAservo = 0.2f / (m_verticalAttractionTimescale * pTimestep); | ||
599 | // get present body rotation | ||
600 | d.Quaternion rot = d.BodyGetQuaternion(Body); | ||
601 | Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); | ||
602 | // make a vector pointing up | ||
603 | Vector3 verterr = Vector3.Zero; | ||
604 | verterr.Z = 1.0f; | ||
605 | // rotate it to Body Angle | ||
606 | verterr = verterr * rotq; | ||
607 | // verterr.X and .Y are the World error ammounts. They are 0 when there is no error (Vehicle Body is 'vertical'), and .Z will be 1. | ||
608 | // As the body leans to its side |.X| will increase to 1 and .Z fall to 0. As body inverts |.X| will fall and .Z will go | ||
609 | // negative. Similar for tilt and |.Y|. .X and .Y must be modulated to prevent a stable inverted body. | ||
610 | if (verterr.Z < 0.0f) | ||
611 | { | ||
612 | verterr.X = 2.0f - verterr.X; | ||
613 | verterr.Y = 2.0f - verterr.Y; | ||
614 | } | ||
615 | // Error is 0 (no error) to +/- 2 (max error) | ||
616 | // scale it by VAservo | ||
617 | verterr = verterr * VAservo; | ||
618 | //if(frcount == 0) Console.WriteLine("VAerr=" + verterr); | ||
619 | |||
620 | // As the body rotates around the X axis, then verterr.Y increases; Rotated around Y then .X increases, so | ||
621 | // Change Body angular velocity X based on Y, and Y based on X. Z is not changed. | ||
622 | vertattr.X = verterr.Y; | ||
623 | vertattr.Y = - verterr.X; | ||
624 | vertattr.Z = 0f; | ||
625 | |||
626 | // scaling appears better usingsquare-law | ||
627 | float bounce = 1.0f - (m_verticalAttractionEfficiency * m_verticalAttractionEfficiency); | ||
628 | vertattr.X += bounce * angularVelocity.X; | ||
629 | vertattr.Y += bounce * angularVelocity.Y; | ||
630 | |||
631 | } // else vertical attractor is off | ||
632 | |||
633 | // m_lastVertAttractor = vertattr; | ||
634 | |||
635 | // Bank section tba | ||
636 | // Deflection section tba | ||
637 | |||
638 | // Sum velocities | ||
639 | m_lastAngularVelocity = m_angularMotorVelocity + vertattr; // + bank + deflection | ||
640 | |||
641 | if (!m_lastAngularVelocity.ApproxEquals(Vector3.Zero, 0.01f)) | ||
642 | { | 589 | { |
643 | if(!d.BodyIsEnabled (Body)) d.BodyEnable (Body); | 590 | float VAservo = 0.2f / (m_verticalAttractionTimescale * pTimestep); |
644 | } | 591 | // get present body rotation |
645 | else | 592 | d.Quaternion rot = d.BodyGetQuaternion(Body); |
646 | { | 593 | Quaternion rotq = new Quaternion(rot.X, rot.Y, rot.Z, rot.W); |
647 | m_lastAngularVelocity = Vector3.Zero; // Reduce small value to zero. | 594 | // make a vector pointing up |
648 | } | 595 | Vector3 verterr = Vector3.Zero; |
649 | 596 | verterr.Z = 1.0f; | |
650 | // apply friction | 597 | // rotate it to Body Angle |
598 | verterr = verterr * rotq; | ||
599 | // verterr.X and .Y are the World error ammounts. They are 0 when there is no error (Vehicle Body is 'vertical'), and .Z will be 1. | ||
600 | // As the body leans to its side |.X| will increase to 1 and .Z fall to 0. As body inverts |.X| will fall and .Z will go | ||
601 | // negative. Similar for tilt and |.Y|. .X and .Y must be modulated to prevent a stable inverted body. | ||
602 | if (verterr.Z < 0.0f) | ||
603 | { | ||
604 | verterr.X = 2.0f - verterr.X; | ||
605 | verterr.Y = 2.0f - verterr.Y; | ||
606 | } | ||
607 | // Error is 0 (no error) to +/- 2 (max error) | ||
608 | // scale it by VAservo | ||
609 | verterr = verterr * VAservo; | ||
610 | //if (frcount == 0) Console.WriteLine("VAerr=" + verterr); | ||
611 | |||
612 | // As the body rotates around the X axis, then verterr.Y increases; Rotated around Y then .X increases, so | ||
613 | // Change Body angular velocity X based on Y, and Y based on X. Z is not changed. | ||
614 | vertattr.X = verterr.Y; | ||
615 | vertattr.Y = - verterr.X; | ||
616 | vertattr.Z = 0f; | ||
617 | |||
618 | // scaling appears better usingsquare-law | ||
619 | float bounce = 1.0f - (m_verticalAttractionEfficiency * m_verticalAttractionEfficiency); | ||
620 | vertattr.X += bounce * angularVelocity.X; | ||
621 | vertattr.Y += bounce * angularVelocity.Y; | ||
622 | |||
623 | } // else vertical attractor is off | ||
624 | |||
625 | // m_lastVertAttractor = vertattr; | ||
626 | |||
627 | // Bank section tba | ||
628 | // Deflection section tba | ||
629 | |||
630 | // Sum velocities | ||
631 | m_lastAngularVelocity = m_angularMotorVelocity + vertattr; // + bank + deflection | ||
632 | |||
633 | if (!m_lastAngularVelocity.ApproxEquals(Vector3.Zero, 0.01f)) | ||
634 | { | ||
635 | if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); | ||
636 | } | ||
637 | else | ||
638 | { | ||
639 | m_lastAngularVelocity = Vector3.Zero; // Reduce small value to zero. | ||
640 | } | ||
641 | |||
642 | // apply friction | ||
651 | Vector3 decayamount = Vector3.One / (m_angularFrictionTimescale / pTimestep); | 643 | Vector3 decayamount = Vector3.One / (m_angularFrictionTimescale / pTimestep); |
652 | m_lastAngularVelocity -= m_lastAngularVelocity * decayamount; | 644 | m_lastAngularVelocity -= m_lastAngularVelocity * decayamount; |
653 | 645 | ||
654 | // Apply to the body | 646 | // Apply to the body |
655 | d.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z); | 647 | d.BodySetAngularVel (Body, m_lastAngularVelocity.X, m_lastAngularVelocity.Y, m_lastAngularVelocity.Z); |
656 | 648 | ||
657 | } //end MoveAngular | 649 | } //end MoveAngular |
658 | } | 650 | } |
659 | } | 651 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index dd7902a..567fd0e 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -1,5 +1,7 @@ | |||
1 | /* Copyright (c) Contributors, http://opensimulator.org/ | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
2 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | ||
3 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
4 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
5 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
@@ -93,7 +95,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
93 | private float m_targetHoverHeight; | 95 | private float m_targetHoverHeight; |
94 | private float m_groundHeight; | 96 | private float m_groundHeight; |
95 | private float m_waterHeight; | 97 | private float m_waterHeight; |
96 | private float m_buoyancy; //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle. | 98 | private float m_buoyancy; //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle. |
97 | 99 | ||
98 | // private float m_tensor = 5f; | 100 | // private float m_tensor = 5f; |
99 | private int body_autodisable_frames = 20; | 101 | private int body_autodisable_frames = 20; |
@@ -294,7 +296,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
294 | m_taintselected = value; | 296 | m_taintselected = value; |
295 | m_isSelected = value; | 297 | m_isSelected = value; |
296 | } | 298 | } |
297 | if(m_isSelected) disableBodySoft(); | 299 | if (m_isSelected) disableBodySoft(); |
298 | } | 300 | } |
299 | } | 301 | } |
300 | 302 | ||
@@ -302,7 +304,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
302 | { | 304 | { |
303 | prev_geom = prim_geom; | 305 | prev_geom = prim_geom; |
304 | prim_geom = geom; | 306 | prim_geom = geom; |
305 | //Console.WriteLine("SetGeom to " + prim_geom + " for " + m_primName); | 307 | //Console.WriteLine("SetGeom to " + prim_geom + " for " + m_primName); |
306 | if (prim_geom != IntPtr.Zero) | 308 | if (prim_geom != IntPtr.Zero) |
307 | { | 309 | { |
308 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); | 310 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); |
@@ -314,7 +316,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
314 | if (_parent != null && _parent is OdePrim) | 316 | if (_parent != null && _parent is OdePrim) |
315 | { | 317 | { |
316 | OdePrim parent = (OdePrim)_parent; | 318 | OdePrim parent = (OdePrim)_parent; |
317 | //Console.WriteLine("SetGeom calls ChildSetGeom"); | 319 | //Console.WriteLine("SetGeom calls ChildSetGeom"); |
318 | parent.ChildSetGeom(this); | 320 | parent.ChildSetGeom(this); |
319 | } | 321 | } |
320 | } | 322 | } |
@@ -331,7 +333,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
331 | { | 333 | { |
332 | d.BodyEnable(Body); | 334 | d.BodyEnable(Body); |
333 | if (m_vehicle.Type != Vehicle.TYPE_NONE) | 335 | if (m_vehicle.Type != Vehicle.TYPE_NONE) |
334 | m_vehicle.Enable(Body, _parent_scene); | 336 | m_vehicle.Enable(Body, _parent_scene); |
335 | } | 337 | } |
336 | 338 | ||
337 | m_disabled = false; | 339 | m_disabled = false; |
@@ -376,7 +378,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
376 | d.BodySetAutoDisableSteps(Body, body_autodisable_frames); | 378 | d.BodySetAutoDisableSteps(Body, body_autodisable_frames); |
377 | 379 | ||
378 | // disconnect from world gravity so we can apply buoyancy | 380 | // disconnect from world gravity so we can apply buoyancy |
379 | d.BodySetGravityMode (Body, false); | 381 | d.BodySetGravityMode (Body, false); |
380 | 382 | ||
381 | m_interpenetrationcount = 0; | 383 | m_interpenetrationcount = 0; |
382 | m_collisionscore = 0; | 384 | m_collisionscore = 0; |
@@ -872,7 +874,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
872 | 874 | ||
873 | public void ProcessTaints(float timestep) | 875 | public void ProcessTaints(float timestep) |
874 | { | 876 | { |
875 | //Console.WriteLine("ProcessTaints for " + m_primName ); | 877 | //Console.WriteLine("ProcessTaints for " + m_primName); |
876 | if (m_taintadd) | 878 | if (m_taintadd) |
877 | { | 879 | { |
878 | changeadd(timestep); | 880 | changeadd(timestep); |
@@ -880,24 +882,24 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
880 | 882 | ||
881 | if (prim_geom != IntPtr.Zero) | 883 | if (prim_geom != IntPtr.Zero) |
882 | { | 884 | { |
883 | if (!_position.ApproxEquals(m_taintposition, 0f)) | 885 | if (!_position.ApproxEquals(m_taintposition, 0f)) |
884 | changemove(timestep); | 886 | changemove(timestep); |
885 | 887 | ||
886 | if (m_taintrot != _orientation) | 888 | if (m_taintrot != _orientation) |
887 | { | 889 | { |
888 | if(childPrim && IsPhysical) // For physical child prim... | 890 | if (childPrim && IsPhysical) // For physical child prim... |
889 | { | 891 | { |
890 | rotate(timestep); | 892 | rotate(timestep); |
891 | // KF: ODE will also rotate the parent prim! | 893 | // KF: ODE will also rotate the parent prim! |
892 | // so rotate the root back to where it was | 894 | // so rotate the root back to where it was |
893 | OdePrim parent = (OdePrim)_parent; | 895 | OdePrim parent = (OdePrim)_parent; |
894 | parent.rotate(timestep); | 896 | parent.rotate(timestep); |
895 | } | 897 | } |
896 | else | 898 | else |
897 | { | 899 | { |
898 | //Just rotate the prim | 900 | //Just rotate the prim |
899 | rotate(timestep); | 901 | rotate(timestep); |
900 | } | 902 | } |
901 | } | 903 | } |
902 | // | 904 | // |
903 | 905 | ||
@@ -1006,7 +1008,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1006 | // destroy link | 1008 | // destroy link |
1007 | else if (_parent != null && m_taintparent == null) | 1009 | else if (_parent != null && m_taintparent == null) |
1008 | { | 1010 | { |
1009 | //Console.WriteLine(" changelink B"); | 1011 | //Console.WriteLine(" changelink B"); |
1010 | 1012 | ||
1011 | if (_parent is OdePrim) | 1013 | if (_parent is OdePrim) |
1012 | { | 1014 | { |
@@ -1033,7 +1035,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1033 | // prim is the child | 1035 | // prim is the child |
1034 | public void ParentPrim(OdePrim prim) | 1036 | public void ParentPrim(OdePrim prim) |
1035 | { | 1037 | { |
1036 | //Console.WriteLine("ParentPrim " + m_primName); | 1038 | //Console.WriteLine("ParentPrim " + m_primName); |
1037 | if (this.m_localID != prim.m_localID) | 1039 | if (this.m_localID != prim.m_localID) |
1038 | { | 1040 | { |
1039 | if (Body == IntPtr.Zero) | 1041 | if (Body == IntPtr.Zero) |
@@ -1047,7 +1049,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1047 | { | 1049 | { |
1048 | if (!childrenPrim.Contains(prim)) | 1050 | if (!childrenPrim.Contains(prim)) |
1049 | { | 1051 | { |
1050 | //Console.WriteLine("childrenPrim.Add " + prim); | 1052 | //Console.WriteLine("childrenPrim.Add " + prim); |
1051 | childrenPrim.Add(prim); | 1053 | childrenPrim.Add(prim); |
1052 | 1054 | ||
1053 | foreach (OdePrim prm in childrenPrim) | 1055 | foreach (OdePrim prm in childrenPrim) |
@@ -1080,7 +1082,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1080 | m_log.Warn("[PHYSICS]: Unable to link one of the linkset elements. No geom yet"); | 1082 | m_log.Warn("[PHYSICS]: Unable to link one of the linkset elements. No geom yet"); |
1081 | continue; | 1083 | continue; |
1082 | } | 1084 | } |
1083 | //Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + m_primName); | 1085 | //Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + m_primName); |
1084 | d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); | 1086 | d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); |
1085 | d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); | 1087 | d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); |
1086 | 1088 | ||
@@ -1128,7 +1130,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1128 | m_collisionCategories |= CollisionCategories.Body; | 1130 | m_collisionCategories |= CollisionCategories.Body; |
1129 | m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); | 1131 | m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); |
1130 | 1132 | ||
1131 | //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + m_primName); | 1133 | //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + m_primName); |
1132 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); | 1134 | d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); |
1133 | //Console.WriteLine(" Post GeomSetCategoryBits 2"); | 1135 | //Console.WriteLine(" Post GeomSetCategoryBits 2"); |
1134 | d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); | 1136 | d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); |
@@ -1203,7 +1205,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1203 | { | 1205 | { |
1204 | foreach (OdePrim prm in childrenPrim) | 1206 | foreach (OdePrim prm in childrenPrim) |
1205 | { | 1207 | { |
1206 | //Console.WriteLine("ChildSetGeom calls ParentPrim"); | 1208 | //Console.WriteLine("ChildSetGeom calls ParentPrim"); |
1207 | ParentPrim(prm); | 1209 | ParentPrim(prm); |
1208 | } | 1210 | } |
1209 | } | 1211 | } |
@@ -1230,7 +1232,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1230 | 1232 | ||
1231 | lock (childrenPrim) | 1233 | lock (childrenPrim) |
1232 | { | 1234 | { |
1233 | //Console.WriteLine("childrenPrim.Remove " + odePrim); | 1235 | //Console.WriteLine("childrenPrim.Remove " + odePrim); |
1234 | childrenPrim.Remove(odePrim); | 1236 | childrenPrim.Remove(odePrim); |
1235 | } | 1237 | } |
1236 | 1238 | ||
@@ -1248,7 +1250,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1248 | { | 1250 | { |
1249 | foreach (OdePrim prm in childrenPrim) | 1251 | foreach (OdePrim prm in childrenPrim) |
1250 | { | 1252 | { |
1251 | //Console.WriteLine("ChildDelink calls ParentPrim"); | 1253 | //Console.WriteLine("ChildDelink calls ParentPrim"); |
1252 | ParentPrim(prm); | 1254 | ParentPrim(prm); |
1253 | } | 1255 | } |
1254 | } | 1256 | } |
@@ -1350,7 +1352,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1350 | 1352 | ||
1351 | public void CreateGeom(IntPtr m_targetSpace, IMesh _mesh) | 1353 | public void CreateGeom(IntPtr m_targetSpace, IMesh _mesh) |
1352 | { | 1354 | { |
1353 | //Console.WriteLine("CreateGeom:"); | 1355 | //Console.WriteLine("CreateGeom:"); |
1354 | if (_mesh != null) | 1356 | if (_mesh != null) |
1355 | { | 1357 | { |
1356 | setMesh(_parent_scene, _mesh); | 1358 | setMesh(_parent_scene, _mesh); |
@@ -1381,7 +1383,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1381 | _parent_scene.waitForSpaceUnlock(m_targetSpace); | 1383 | _parent_scene.waitForSpaceUnlock(m_targetSpace); |
1382 | try | 1384 | try |
1383 | { | 1385 | { |
1384 | //Console.WriteLine(" CreateGeom 2"); | 1386 | //Console.WriteLine(" CreateGeom 2"); |
1385 | SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); | 1387 | SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); |
1386 | } | 1388 | } |
1387 | catch (AccessViolationException) | 1389 | catch (AccessViolationException) |
@@ -1397,7 +1399,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1397 | _parent_scene.waitForSpaceUnlock(m_targetSpace); | 1399 | _parent_scene.waitForSpaceUnlock(m_targetSpace); |
1398 | try | 1400 | try |
1399 | { | 1401 | { |
1400 | //Console.WriteLine(" CreateGeom 3"); | 1402 | //Console.WriteLine(" CreateGeom 3"); |
1401 | SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); | 1403 | SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); |
1402 | } | 1404 | } |
1403 | catch (AccessViolationException) | 1405 | catch (AccessViolationException) |
@@ -1414,7 +1416,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1414 | _parent_scene.waitForSpaceUnlock(m_targetSpace); | 1416 | _parent_scene.waitForSpaceUnlock(m_targetSpace); |
1415 | try | 1417 | try |
1416 | { | 1418 | { |
1417 | //Console.WriteLine(" CreateGeom 4"); | 1419 | //Console.WriteLine(" CreateGeom 4"); |
1418 | SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); | 1420 | SetGeom(d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z)); |
1419 | } | 1421 | } |
1420 | catch (AccessViolationException) | 1422 | catch (AccessViolationException) |
@@ -1451,7 +1453,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1451 | 1453 | ||
1452 | lock (_parent_scene.OdeLock) | 1454 | lock (_parent_scene.OdeLock) |
1453 | { | 1455 | { |
1454 | //Console.WriteLine("changeadd 1"); | 1456 | //Console.WriteLine("changeadd 1"); |
1455 | CreateGeom(m_targetSpace, _mesh); | 1457 | CreateGeom(m_targetSpace, _mesh); |
1456 | 1458 | ||
1457 | if (prim_geom != IntPtr.Zero) | 1459 | if (prim_geom != IntPtr.Zero) |
@@ -1508,7 +1510,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1508 | if (Body != (IntPtr)0 && odParent.Body != (IntPtr)0 && Body != odParent.Body) | 1510 | if (Body != (IntPtr)0 && odParent.Body != (IntPtr)0 && Body != odParent.Body) |
1509 | { | 1511 | { |
1510 | // KF: Fixed Joints were removed? Anyway - this Console.WriteLine does not show up, so routine is not used?? | 1512 | // KF: Fixed Joints were removed? Anyway - this Console.WriteLine does not show up, so routine is not used?? |
1511 | Console.WriteLine(" JointCreateFixed"); | 1513 | Console.WriteLine(" JointCreateFixed"); |
1512 | m_linkJoint = d.JointCreateFixed(_parent_scene.world, _linkJointGroup); | 1514 | m_linkJoint = d.JointCreateFixed(_parent_scene.world, _linkJointGroup); |
1513 | d.JointAttach(m_linkJoint, Body, odParent.Body); | 1515 | d.JointAttach(m_linkJoint, Body, odParent.Body); |
1514 | d.JointSetFixed(m_linkJoint); | 1516 | d.JointSetFixed(m_linkJoint); |
@@ -1562,244 +1564,244 @@ Console.WriteLine(" JointCreateFixed"); | |||
1562 | float fz = 0; | 1564 | float fz = 0; |
1563 | 1565 | ||
1564 | 1566 | ||
1565 | if (IsPhysical && (Body != IntPtr.Zero) && !m_isSelected && !childPrim) // KF: Only move root prims. | 1567 | if (IsPhysical && (Body != IntPtr.Zero) && !m_isSelected && !childPrim) // KF: Only move root prims. |
1566 | { | 1568 | { |
1567 | if (m_vehicle.Type != Vehicle.TYPE_NONE) | 1569 | if (m_vehicle.Type != Vehicle.TYPE_NONE) |
1568 | { | 1570 | { |
1569 | // 'VEHICLES' are dealt with in ODEDynamics.cs | 1571 | // 'VEHICLES' are dealt with in ODEDynamics.cs |
1570 | m_vehicle.Step(timestep, _parent_scene); | 1572 | m_vehicle.Step(timestep, _parent_scene); |
1571 | } | 1573 | } |
1572 | else | 1574 | else |
1573 | { | 1575 | { |
1574 | //Console.WriteLine("Move " + m_primName); | 1576 | //Console.WriteLine("Move " + m_primName); |
1575 | if(!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 | 1577 | if (!d.BodyIsEnabled (Body)) d.BodyEnable (Body); // KF add 161009 |
1576 | // NON-'VEHICLES' are dealt with here | 1578 | // NON-'VEHICLES' are dealt with here |
1577 | if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) | 1579 | if (d.BodyIsEnabled(Body) && !m_angularlock.ApproxEquals(Vector3.Zero, 0.003f)) |
1578 | { | 1580 | { |
1579 | d.Vector3 avel2 = d.BodyGetAngularVel(Body); | 1581 | d.Vector3 avel2 = d.BodyGetAngularVel(Body); |
1580 | if (m_angularlock.X == 1) | 1582 | if (m_angularlock.X == 1) |
1581 | avel2.X = 0; | 1583 | avel2.X = 0; |
1582 | if (m_angularlock.Y == 1) | 1584 | if (m_angularlock.Y == 1) |
1583 | avel2.Y = 0; | 1585 | avel2.Y = 0; |
1584 | if (m_angularlock.Z == 1) | 1586 | if (m_angularlock.Z == 1) |
1585 | avel2.Z = 0; | 1587 | avel2.Z = 0; |
1586 | d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z); | 1588 | d.BodySetAngularVel(Body, avel2.X, avel2.Y, avel2.Z); |
1587 | } | 1589 | } |
1588 | //float PID_P = 900.0f; | 1590 | //float PID_P = 900.0f; |
1589 | 1591 | ||
1590 | float m_mass = CalculateMass(); | 1592 | float m_mass = CalculateMass(); |
1591 | 1593 | ||
1592 | // fz = 0f; | 1594 | // fz = 0f; |
1593 | //m_log.Info(m_collisionFlags.ToString()); | 1595 | //m_log.Info(m_collisionFlags.ToString()); |
1594 | 1596 | ||
1595 | 1597 | ||
1596 | //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle. | 1598 | //KF: m_buoyancy should be set by llSetBuoyancy() for non-vehicle. |
1597 | // would come from SceneObjectPart.cs, public void SetBuoyancy(float fvalue) , PhysActor.Buoyancy = fvalue; ?? | 1599 | // would come from SceneObjectPart.cs, public void SetBuoyancy(float fvalue) , PhysActor.Buoyancy = fvalue; ?? |
1598 | // m_buoyancy: (unlimited value) <0=Falls fast; 0=1g; 1=0g; >1 = floats up | 1600 | // m_buoyancy: (unlimited value) <0=Falls fast; 0=1g; 1=0g; >1 = floats up |
1599 | // gravityz multiplier = 1 - m_buoyancy | 1601 | // gravityz multiplier = 1 - m_buoyancy |
1600 | fz = _parent_scene.gravityz * (1.0f - m_buoyancy) * m_mass; | 1602 | fz = _parent_scene.gravityz * (1.0f - m_buoyancy) * m_mass; |
1601 | 1603 | ||
1602 | if (m_usePID) | 1604 | if (m_usePID) |
1603 | { | 1605 | { |
1604 | //Console.WriteLine("PID " + m_primName); | 1606 | //Console.WriteLine("PID " + m_primName); |
1605 | // KF - this is for object move? eg. llSetPos() ? | 1607 | // KF - this is for object move? eg. llSetPos() ? |
1606 | //if (!d.BodyIsEnabled(Body)) | 1608 | //if (!d.BodyIsEnabled(Body)) |
1607 | //d.BodySetForce(Body, 0f, 0f, 0f); | 1609 | //d.BodySetForce(Body, 0f, 0f, 0f); |
1608 | // If we're using the PID controller, then we have no gravity | 1610 | // If we're using the PID controller, then we have no gravity |
1609 | //fz = (-1 * _parent_scene.gravityz) * m_mass; //KF: ?? Prims have no global gravity,so simply... | 1611 | //fz = (-1 * _parent_scene.gravityz) * m_mass; //KF: ?? Prims have no global gravity,so simply... |
1610 | fz = 0f; | 1612 | fz = 0f; |
1611 | 1613 | ||
1612 | // no lock; for now it's only called from within Simulate() | 1614 | // no lock; for now it's only called from within Simulate() |
1613 | 1615 | ||
1614 | // If the PID Controller isn't active then we set our force | 1616 | // If the PID Controller isn't active then we set our force |
1615 | // calculating base velocity to the current position | 1617 | // calculating base velocity to the current position |
1616 | 1618 | ||
1617 | if ((m_PIDTau < 1) && (m_PIDTau != 0)) | 1619 | if ((m_PIDTau < 1) && (m_PIDTau != 0)) |
1618 | { | 1620 | { |
1619 | //PID_G = PID_G / m_PIDTau; | 1621 | //PID_G = PID_G / m_PIDTau; |
1620 | m_PIDTau = 1; | 1622 | m_PIDTau = 1; |
1621 | } | 1623 | } |
1622 | 1624 | ||
1623 | if ((PID_G - m_PIDTau) <= 0) | 1625 | if ((PID_G - m_PIDTau) <= 0) |
1624 | { | 1626 | { |
1625 | PID_G = m_PIDTau + 1; | 1627 | PID_G = m_PIDTau + 1; |
1626 | } | 1628 | } |
1627 | //PidStatus = true; | 1629 | //PidStatus = true; |
1628 | 1630 | ||
1629 | // PhysicsVector vec = new PhysicsVector(); | 1631 | // PhysicsVector vec = new PhysicsVector(); |
1630 | d.Vector3 vel = d.BodyGetLinearVel(Body); | 1632 | d.Vector3 vel = d.BodyGetLinearVel(Body); |
1631 | 1633 | ||
1632 | d.Vector3 pos = d.BodyGetPosition(Body); | 1634 | d.Vector3 pos = d.BodyGetPosition(Body); |
1633 | _target_velocity = | 1635 | _target_velocity = |
1634 | new Vector3( | 1636 | new Vector3( |
1635 | (m_PIDTarget.X - pos.X) * ((PID_G - m_PIDTau) * timestep), | 1637 | (m_PIDTarget.X - pos.X) * ((PID_G - m_PIDTau) * timestep), |
1636 | (m_PIDTarget.Y - pos.Y) * ((PID_G - m_PIDTau) * timestep), | 1638 | (m_PIDTarget.Y - pos.Y) * ((PID_G - m_PIDTau) * timestep), |
1637 | (m_PIDTarget.Z - pos.Z) * ((PID_G - m_PIDTau) * timestep) | 1639 | (m_PIDTarget.Z - pos.Z) * ((PID_G - m_PIDTau) * timestep) |
1638 | ); | 1640 | ); |
1639 | 1641 | ||
1640 | // if velocity is zero, use position control; otherwise, velocity control | 1642 | // if velocity is zero, use position control; otherwise, velocity control |
1641 | 1643 | ||
1642 | if (_target_velocity.ApproxEquals(Vector3.Zero,0.1f)) | 1644 | if (_target_velocity.ApproxEquals(Vector3.Zero,0.1f)) |
1643 | { | 1645 | { |
1644 | // keep track of where we stopped. No more slippin' & slidin' | 1646 | // keep track of where we stopped. No more slippin' & slidin' |
1645 | 1647 | ||
1646 | // We only want to deactivate the PID Controller if we think we want to have our surrogate | 1648 | // We only want to deactivate the PID Controller if we think we want to have our surrogate |
1647 | // react to the physics scene by moving it's position. | 1649 | // react to the physics scene by moving it's position. |
1648 | // Avatar to Avatar collisions | 1650 | // Avatar to Avatar collisions |
1649 | // Prim to avatar collisions | 1651 | // Prim to avatar collisions |
1650 | 1652 | ||
1651 | //fx = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); | 1653 | //fx = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); |
1652 | //fy = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y) * (PID_P * 2); | 1654 | //fy = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y) * (PID_P * 2); |
1653 | //fz = fz + (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; | 1655 | //fz = fz + (_target_velocity.Z - vel.Z) * (PID_D) + (_zeroPosition.Z - pos.Z) * PID_P; |
1654 | d.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); | 1656 | d.BodySetPosition(Body, m_PIDTarget.X, m_PIDTarget.Y, m_PIDTarget.Z); |
1655 | d.BodySetLinearVel(Body, 0, 0, 0); | 1657 | d.BodySetLinearVel(Body, 0, 0, 0); |
1656 | d.BodyAddForce(Body, 0, 0, fz); | 1658 | d.BodyAddForce(Body, 0, 0, fz); |
1657 | return; | 1659 | return; |
1658 | } | 1660 | } |
1659 | else | 1661 | else |
1660 | { | 1662 | { |
1661 | _zeroFlag = false; | 1663 | _zeroFlag = false; |
1662 | 1664 | ||
1663 | // We're flying and colliding with something | 1665 | // We're flying and colliding with something |
1664 | fx = ((_target_velocity.X) - vel.X) * (PID_D); | 1666 | fx = ((_target_velocity.X) - vel.X) * (PID_D); |
1665 | fy = ((_target_velocity.Y) - vel.Y) * (PID_D); | 1667 | fy = ((_target_velocity.Y) - vel.Y) * (PID_D); |
1666 | 1668 | ||
1667 | // vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P; | 1669 | // vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P; |
1668 | 1670 | ||
1669 | fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); | 1671 | fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); |
1670 | } | 1672 | } |
1671 | } // end if (m_usePID) | 1673 | } // end if (m_usePID) |
1672 | 1674 | ||
1673 | // Hover PID Controller needs to be mutually exlusive to MoveTo PID controller | 1675 | // Hover PID Controller needs to be mutually exlusive to MoveTo PID controller |
1674 | if (m_useHoverPID && !m_usePID) | 1676 | if (m_useHoverPID && !m_usePID) |
1675 | { | 1677 | { |
1676 | //Console.WriteLine("Hover " + m_primName); | 1678 | //Console.WriteLine("Hover " + m_primName); |
1677 | |||
1678 | // If we're using the PID controller, then we have no gravity | ||
1679 | fz = (-1 * _parent_scene.gravityz) * m_mass; | ||
1680 | |||
1681 | // no lock; for now it's only called from within Simulate() | ||
1682 | |||
1683 | // If the PID Controller isn't active then we set our force | ||
1684 | // calculating base velocity to the current position | ||
1685 | |||
1686 | if ((m_PIDTau < 1)) | ||
1687 | { | ||
1688 | PID_G = PID_G / m_PIDTau; | ||
1689 | } | ||
1690 | |||
1691 | if ((PID_G - m_PIDTau) <= 0) | ||
1692 | { | ||
1693 | PID_G = m_PIDTau + 1; | ||
1694 | } | ||
1695 | 1679 | ||
1680 | // If we're using the PID controller, then we have no gravity | ||
1681 | fz = (-1 * _parent_scene.gravityz) * m_mass; | ||
1682 | |||
1683 | // no lock; for now it's only called from within Simulate() | ||
1696 | 1684 | ||
1697 | // Where are we, and where are we headed? | 1685 | // If the PID Controller isn't active then we set our force |
1698 | d.Vector3 pos = d.BodyGetPosition(Body); | 1686 | // calculating base velocity to the current position |
1699 | d.Vector3 vel = d.BodyGetLinearVel(Body); | 1687 | |
1700 | 1688 | if ((m_PIDTau < 1)) | |
1701 | 1689 | { | |
1702 | // Non-Vehicles have a limited set of Hover options. | 1690 | PID_G = PID_G / m_PIDTau; |
1703 | // determine what our target height really is based on HoverType | 1691 | } |
1704 | switch (m_PIDHoverType) | 1692 | |
1705 | { | 1693 | if ((PID_G - m_PIDTau) <= 0) |
1706 | case PIDHoverType.Ground: | 1694 | { |
1707 | m_groundHeight = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); | 1695 | PID_G = m_PIDTau + 1; |
1708 | m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight; | 1696 | } |
1709 | break; | 1697 | |
1710 | case PIDHoverType.GroundAndWater: | 1698 | |
1711 | m_groundHeight = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); | 1699 | // Where are we, and where are we headed? |
1712 | m_waterHeight = _parent_scene.GetWaterLevel(); | 1700 | d.Vector3 pos = d.BodyGetPosition(Body); |
1713 | if (m_groundHeight > m_waterHeight) | 1701 | d.Vector3 vel = d.BodyGetLinearVel(Body); |
1714 | { | 1702 | |
1715 | m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight; | 1703 | |
1716 | } | 1704 | // Non-Vehicles have a limited set of Hover options. |
1717 | else | 1705 | // determine what our target height really is based on HoverType |
1718 | { | 1706 | switch (m_PIDHoverType) |
1719 | m_targetHoverHeight = m_waterHeight + m_PIDHoverHeight; | 1707 | { |
1720 | } | 1708 | case PIDHoverType.Ground: |
1721 | break; | 1709 | m_groundHeight = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); |
1722 | 1710 | m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight; | |
1723 | } // end switch (m_PIDHoverType) | 1711 | break; |
1724 | 1712 | case PIDHoverType.GroundAndWater: | |
1725 | 1713 | m_groundHeight = _parent_scene.GetTerrainHeightAtXY(pos.X, pos.Y); | |
1726 | _target_velocity = | 1714 | m_waterHeight = _parent_scene.GetWaterLevel(); |
1715 | if (m_groundHeight > m_waterHeight) | ||
1716 | { | ||
1717 | m_targetHoverHeight = m_groundHeight + m_PIDHoverHeight; | ||
1718 | } | ||
1719 | else | ||
1720 | { | ||
1721 | m_targetHoverHeight = m_waterHeight + m_PIDHoverHeight; | ||
1722 | } | ||
1723 | break; | ||
1724 | |||
1725 | } // end switch (m_PIDHoverType) | ||
1726 | |||
1727 | |||
1728 | _target_velocity = | ||
1727 | new Vector3(0.0f, 0.0f, | 1729 | new Vector3(0.0f, 0.0f, |
1728 | (m_targetHoverHeight - pos.Z) * ((PID_G - m_PIDHoverTau) * timestep) | 1730 | (m_targetHoverHeight - pos.Z) * ((PID_G - m_PIDHoverTau) * timestep) |
1729 | ); | 1731 | ); |
1730 | 1732 | ||
1731 | // if velocity is zero, use position control; otherwise, velocity control | 1733 | // if velocity is zero, use position control; otherwise, velocity control |
1732 | 1734 | ||
1733 | if (_target_velocity.ApproxEquals(Vector3.Zero, 0.1f)) | 1735 | if (_target_velocity.ApproxEquals(Vector3.Zero, 0.1f)) |
1734 | { | 1736 | { |
1735 | // keep track of where we stopped. No more slippin' & slidin' | 1737 | // keep track of where we stopped. No more slippin' & slidin' |
1736 | 1738 | ||
1737 | // We only want to deactivate the PID Controller if we think we want to have our surrogate | 1739 | // We only want to deactivate the PID Controller if we think we want to have our surrogate |
1738 | // react to the physics scene by moving it's position. | 1740 | // react to the physics scene by moving it's position. |
1739 | // Avatar to Avatar collisions | 1741 | // Avatar to Avatar collisions |
1740 | // Prim to avatar collisions | 1742 | // Prim to avatar collisions |
1741 | 1743 | ||
1742 | d.BodySetPosition(Body, pos.X, pos.Y, m_targetHoverHeight); | 1744 | d.BodySetPosition(Body, pos.X, pos.Y, m_targetHoverHeight); |
1743 | d.BodySetLinearVel(Body, vel.X, vel.Y, 0); | 1745 | d.BodySetLinearVel(Body, vel.X, vel.Y, 0); |
1744 | d.BodyAddForce(Body, 0, 0, fz); | 1746 | d.BodyAddForce(Body, 0, 0, fz); |
1745 | return; | 1747 | return; |
1746 | } | 1748 | } |
1747 | else | 1749 | else |
1748 | { | 1750 | { |
1749 | _zeroFlag = false; | 1751 | _zeroFlag = false; |
1750 | 1752 | ||
1751 | // We're flying and colliding with something | 1753 | // We're flying and colliding with something |
1752 | fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); | 1754 | fz = fz + ((_target_velocity.Z - vel.Z) * (PID_D) * m_mass); |
1753 | } | 1755 | } |
1754 | } | 1756 | } |
1755 | 1757 | ||
1756 | fx *= m_mass; | 1758 | fx *= m_mass; |
1757 | fy *= m_mass; | 1759 | fy *= m_mass; |
1758 | //fz *= m_mass; | 1760 | //fz *= m_mass; |
1759 | 1761 | ||
1760 | fx += m_force.X; | 1762 | fx += m_force.X; |
1761 | fy += m_force.Y; | 1763 | fy += m_force.Y; |
1762 | fz += m_force.Z; | 1764 | fz += m_force.Z; |
1763 | 1765 | ||
1764 | //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString()); | 1766 | //m_log.Info("[OBJPID]: X:" + fx.ToString() + " Y:" + fy.ToString() + " Z:" + fz.ToString()); |
1765 | if (fx != 0 || fy != 0 || fz != 0) | 1767 | if (fx != 0 || fy != 0 || fz != 0) |
1766 | { | 1768 | { |
1767 | //m_taintdisable = true; | 1769 | //m_taintdisable = true; |
1768 | //base.RaiseOutOfBounds(Position); | 1770 | //base.RaiseOutOfBounds(Position); |
1769 | //d.BodySetLinearVel(Body, fx, fy, 0f); | 1771 | //d.BodySetLinearVel(Body, fx, fy, 0f); |
1770 | if (!d.BodyIsEnabled(Body)) | 1772 | if (!d.BodyIsEnabled(Body)) |
1771 | { | 1773 | { |
1772 | // A physical body at rest on a surface will auto-disable after a while, | 1774 | // A physical body at rest on a surface will auto-disable after a while, |
1773 | // this appears to re-enable it incase the surface it is upon vanishes, | 1775 | // this appears to re-enable it incase the surface it is upon vanishes, |
1774 | // and the body should fall again. | 1776 | // and the body should fall again. |
1775 | d.BodySetLinearVel(Body, 0f, 0f, 0f); | 1777 | d.BodySetLinearVel(Body, 0f, 0f, 0f); |
1776 | d.BodySetForce(Body, 0, 0, 0); | 1778 | d.BodySetForce(Body, 0, 0, 0); |
1777 | enableBodySoft(); | 1779 | enableBodySoft(); |
1778 | } | 1780 | } |
1779 | 1781 | ||
1780 | // 35x10 = 350n times the mass per second applied maximum. | 1782 | // 35x10 = 350n times the mass per second applied maximum. |
1781 | float nmax = 35f * m_mass; | 1783 | float nmax = 35f * m_mass; |
1782 | float nmin = -35f * m_mass; | 1784 | float nmin = -35f * m_mass; |
1783 | 1785 | ||
1784 | 1786 | ||
1785 | if (fx > nmax) | 1787 | if (fx > nmax) |
1786 | fx = nmax; | 1788 | fx = nmax; |
1787 | if (fx < nmin) | 1789 | if (fx < nmin) |
1788 | fx = nmin; | 1790 | fx = nmin; |
1789 | if (fy > nmax) | 1791 | if (fy > nmax) |
1790 | fy = nmax; | 1792 | fy = nmax; |
1791 | if (fy < nmin) | 1793 | if (fy < nmin) |
1792 | fy = nmin; | 1794 | fy = nmin; |
1793 | d.BodyAddForce(Body, fx, fy, fz); | 1795 | d.BodyAddForce(Body, fx, fy, fz); |
1794 | //Console.WriteLine("AddForce " + fx + "," + fy + "," + fz); | 1796 | //Console.WriteLine("AddForce " + fx + "," + fy + "," + fz); |
1795 | } | 1797 | } |
1796 | } | 1798 | } |
1797 | } | 1799 | } |
1798 | else | 1800 | else |
1799 | { // is not physical, or is not a body or is selected | 1801 | { // is not physical, or is not a body or is selected |
1800 | // _zeroPosition = d.BodyGetPosition(Body); | 1802 | // _zeroPosition = d.BodyGetPosition(Body); |
1801 | return; | 1803 | return; |
1802 | //Console.WriteLine("Nothing " + m_primName); | 1804 | //Console.WriteLine("Nothing " + m_primName); |
1803 | 1805 | ||
1804 | } | 1806 | } |
1805 | } | 1807 | } |
@@ -1815,18 +1817,18 @@ Console.WriteLine(" JointCreateFixed"); | |||
1815 | myrot.W = _orientation.W; | 1817 | myrot.W = _orientation.W; |
1816 | if (Body != IntPtr.Zero) | 1818 | if (Body != IntPtr.Zero) |
1817 | { | 1819 | { |
1818 | // KF: If this is a root prim do BodySet | 1820 | // KF: If this is a root prim do BodySet |
1819 | d.BodySetQuaternion(Body, ref myrot); | 1821 | d.BodySetQuaternion(Body, ref myrot); |
1820 | if (m_isphysical) | 1822 | if (m_isphysical) |
1821 | { | 1823 | { |
1822 | if (!m_angularlock.ApproxEquals(Vector3.One, 0f)) | 1824 | if (!m_angularlock.ApproxEquals(Vector3.One, 0f)) |
1823 | createAMotor(m_angularlock); | 1825 | createAMotor(m_angularlock); |
1824 | } | 1826 | } |
1825 | } | 1827 | } |
1826 | else | 1828 | else |
1827 | { | 1829 | { |
1828 | // daughter prim, do Geom set | 1830 | // daughter prim, do Geom set |
1829 | d.GeomSetQuaternion(prim_geom, ref myrot); | 1831 | d.GeomSetQuaternion(prim_geom, ref myrot); |
1830 | } | 1832 | } |
1831 | 1833 | ||
1832 | resetCollisionAccounting(); | 1834 | resetCollisionAccounting(); |
@@ -1890,7 +1892,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
1890 | m_log.Error("[PHYSICS]: PrimGeom dead"); | 1892 | m_log.Error("[PHYSICS]: PrimGeom dead"); |
1891 | } | 1893 | } |
1892 | } | 1894 | } |
1893 | //Console.WriteLine("changePhysicsStatus for " + m_primName ); | 1895 | //Console.WriteLine("changePhysicsStatus for " + m_primName); |
1894 | changeadd(2f); | 1896 | changeadd(2f); |
1895 | } | 1897 | } |
1896 | if (childPrim) | 1898 | if (childPrim) |
@@ -1976,7 +1978,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
1976 | else | 1978 | else |
1977 | { | 1979 | { |
1978 | _mesh = null; | 1980 | _mesh = null; |
1979 | //Console.WriteLine("changesize 2"); | 1981 | //Console.WriteLine("changesize 2"); |
1980 | CreateGeom(m_targetSpace, _mesh); | 1982 | CreateGeom(m_targetSpace, _mesh); |
1981 | } | 1983 | } |
1982 | 1984 | ||
@@ -2083,7 +2085,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2083 | else | 2085 | else |
2084 | { | 2086 | { |
2085 | _mesh = null; | 2087 | _mesh = null; |
2086 | //Console.WriteLine("changeshape"); | 2088 | //Console.WriteLine("changeshape"); |
2087 | CreateGeom(m_targetSpace, null); | 2089 | CreateGeom(m_targetSpace, null); |
2088 | } | 2090 | } |
2089 | 2091 | ||
@@ -2454,7 +2456,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2454 | if (QuaternionIsFinite(value)) | 2456 | if (QuaternionIsFinite(value)) |
2455 | { | 2457 | { |
2456 | _orientation = value; | 2458 | _orientation = value; |
2457 | } | 2459 | } |
2458 | else | 2460 | else |
2459 | m_log.Warn("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object"); | 2461 | m_log.Warn("[PHYSICS]: Got NaN quaternion Orientation from Scene in Object"); |
2460 | 2462 | ||
@@ -2675,8 +2677,8 @@ Console.WriteLine(" JointCreateFixed"); | |||
2675 | //outofBounds = true; | 2677 | //outofBounds = true; |
2676 | } | 2678 | } |
2677 | 2679 | ||
2678 | //float Adiff = 1.0f - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation)); | 2680 | //float Adiff = 1.0f - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation)); |
2679 | //Console.WriteLine("Adiff " + m_primName + " = " + Adiff); | 2681 | //Console.WriteLine("Adiff " + m_primName + " = " + Adiff); |
2680 | if ((Math.Abs(m_lastposition.X - l_position.X) < 0.02) | 2682 | if ((Math.Abs(m_lastposition.X - l_position.X) < 0.02) |
2681 | && (Math.Abs(m_lastposition.Y - l_position.Y) < 0.02) | 2683 | && (Math.Abs(m_lastposition.Y - l_position.Y) < 0.02) |
2682 | && (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02) | 2684 | && (Math.Abs(m_lastposition.Z - l_position.Z) < 0.02) |
@@ -2684,7 +2686,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2684 | && (1.0 - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation)) < 0.0001)) // KF 0.01 is far to large | 2686 | && (1.0 - Math.Abs(Quaternion.Dot(m_lastorientation, l_orientation)) < 0.0001)) // KF 0.01 is far to large |
2685 | { | 2687 | { |
2686 | _zeroFlag = true; | 2688 | _zeroFlag = true; |
2687 | //Console.WriteLine("ZFT 2"); | 2689 | //Console.WriteLine("ZFT 2"); |
2688 | m_throttleUpdates = false; | 2690 | m_throttleUpdates = false; |
2689 | } | 2691 | } |
2690 | else | 2692 | else |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs index 7314107..ba77dae 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs | |||
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
110 | for (int i = 0; i < reqs.Length; i++) | 110 | for (int i = 0; i < reqs.Length; i++) |
111 | { | 111 | { |
112 | if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast | 112 | if (reqs[i].callbackMethod != null) // quick optimization here, don't raycast |
113 | RayCast(reqs[i]); // if there isn't anyone to send results | 113 | RayCast(reqs[i]); // if there isn't anyone to send results |
114 | } | 114 | } |
115 | /* | 115 | /* |
116 | foreach (ODERayCastRequest req in m_PendingRequests) | 116 | foreach (ODERayCastRequest req in m_PendingRequests) |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 0384d6e..7984bd9 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -2152,7 +2152,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2152 | /// <param name="prim"></param> | 2152 | /// <param name="prim"></param> |
2153 | public void RemovePrimThreadLocked(OdePrim prim) | 2153 | public void RemovePrimThreadLocked(OdePrim prim) |
2154 | { | 2154 | { |
2155 | //Console.WriteLine("RemovePrimThreadLocked " + prim.m_primName); | 2155 | //Console.WriteLine("RemovePrimThreadLocked " + prim.m_primName); |
2156 | lock (prim) | 2156 | lock (prim) |
2157 | { | 2157 | { |
2158 | remCollisionEventReporting(prim); | 2158 | remCollisionEventReporting(prim); |
@@ -2603,12 +2603,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2603 | lock (_taintedPrimLock) | 2603 | lock (_taintedPrimLock) |
2604 | { | 2604 | { |
2605 | if (!(_taintedPrimH.Contains(taintedprim))) | 2605 | if (!(_taintedPrimH.Contains(taintedprim))) |
2606 | { | 2606 | { |
2607 | //Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.m_primName); | 2607 | //Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.m_primName); |
2608 | _taintedPrimH.Add(taintedprim); // HashSet for searching | 2608 | _taintedPrimH.Add(taintedprim); // HashSet for searching |
2609 | _taintedPrimL.Add(taintedprim); // List for ordered readout | 2609 | _taintedPrimL.Add(taintedprim); // List for ordered readout |
2610 | } | 2610 | } |
2611 | } | 2611 | } |
2612 | return; | 2612 | return; |
2613 | } | 2613 | } |
2614 | else if (prim is OdeCharacter) | 2614 | else if (prim is OdeCharacter) |
@@ -2736,12 +2736,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2736 | { | 2736 | { |
2737 | if (prim.m_taintremove) | 2737 | if (prim.m_taintremove) |
2738 | { | 2738 | { |
2739 | //Console.WriteLine("Simulate calls RemovePrimThreadLocked"); | 2739 | //Console.WriteLine("Simulate calls RemovePrimThreadLocked"); |
2740 | RemovePrimThreadLocked(prim); | 2740 | RemovePrimThreadLocked(prim); |
2741 | } | 2741 | } |
2742 | else | 2742 | else |
2743 | { | 2743 | { |
2744 | //Console.WriteLine("Simulate calls ProcessTaints"); | 2744 | //Console.WriteLine("Simulate calls ProcessTaints"); |
2745 | prim.ProcessTaints(timeStep); | 2745 | prim.ProcessTaints(timeStep); |
2746 | } | 2746 | } |
2747 | processedtaints = true; | 2747 | processedtaints = true; |
@@ -2937,7 +2937,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2937 | } | 2937 | } |
2938 | 2938 | ||
2939 | if (processedtaints) | 2939 | if (processedtaints) |
2940 | //Console.WriteLine("Simulate calls Clear of _taintedPrim list"); | 2940 | //Console.WriteLine("Simulate calls Clear of _taintedPrim list"); |
2941 | _taintedPrimH.Clear(); | 2941 | _taintedPrimH.Clear(); |
2942 | _taintedPrimL.Clear(); | 2942 | _taintedPrimL.Clear(); |
2943 | } | 2943 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 3a229c2..76c79da 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -2812,7 +2812,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2812 | public void llCollisionFilter(string name, string id, int accept) | 2812 | public void llCollisionFilter(string name, string id, int accept) |
2813 | { | 2813 | { |
2814 | m_host.AddScriptLPS(1); | 2814 | m_host.AddScriptLPS(1); |
2815 | NotImplemented("llCollisionFilter"); | 2815 | m_host.CollisionFilter.Clear(); |
2816 | if (id != null) | ||
2817 | { | ||
2818 | m_host.CollisionFilter.Add(accept,id); | ||
2819 | } | ||
2820 | else | ||
2821 | { | ||
2822 | m_host.CollisionFilter.Add(accept,name); | ||
2823 | } | ||
2816 | } | 2824 | } |
2817 | 2825 | ||
2818 | public void llTakeControls(int controls, int accept, int pass_on) | 2826 | public void llTakeControls(int controls, int accept, int pass_on) |
@@ -3910,6 +3918,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3910 | Util.Clip((float)color.z, 0.0f, 1.0f)); | 3918 | Util.Clip((float)color.z, 0.0f, 1.0f)); |
3911 | m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); | 3919 | m_host.SetText(text, av3, Util.Clip((float)alpha, 0.0f, 1.0f)); |
3912 | m_host.ParentGroup.HasGroupChanged = true; | 3920 | m_host.ParentGroup.HasGroupChanged = true; |
3921 | m_host.ParentGroup.ScheduleGroupForFullUpdate(); | ||
3913 | } | 3922 | } |
3914 | 3923 | ||
3915 | public LSL_Float llWater(LSL_Vector offset) | 3924 | public LSL_Float llWater(LSL_Vector offset) |
@@ -4333,7 +4342,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4333 | public void llPassCollisions(int pass) | 4342 | public void llPassCollisions(int pass) |
4334 | { | 4343 | { |
4335 | m_host.AddScriptLPS(1); | 4344 | m_host.AddScriptLPS(1); |
4336 | NotImplemented("llPassCollisions"); | 4345 | if (pass == 0) |
4346 | { | ||
4347 | m_host.ParentGroup.PassCollision = false; | ||
4348 | } | ||
4349 | else | ||
4350 | { | ||
4351 | m_host.ParentGroup.PassCollision = true; | ||
4352 | } | ||
4337 | } | 4353 | } |
4338 | 4354 | ||
4339 | public LSL_String llGetScriptName() | 4355 | public LSL_String llGetScriptName() |
@@ -7541,7 +7557,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
7541 | // makes it more difficult to determine a child prim's actual inworld position). | 7557 | // makes it more difficult to determine a child prim's actual inworld position). |
7542 | if (part.ParentID != 0) | 7558 | if (part.ParentID != 0) |
7543 | v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition(); | 7559 | v = ((v - llGetRootPosition()) * llGetRootRotation()) + llGetRootPosition(); |
7544 | res.Add( v ); | 7560 | res.Add(v); |
7545 | break; | 7561 | break; |
7546 | 7562 | ||
7547 | case (int)ScriptBaseClass.PRIM_SIZE: | 7563 | case (int)ScriptBaseClass.PRIM_SIZE: |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index b6fc0a4..a5be251 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -1952,7 +1952,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1952 | 1952 | ||
1953 | return key.ToString(); | 1953 | return key.ToString(); |
1954 | } | 1954 | } |
1955 | 1955 | ||
1956 | /// <summary> | 1956 | /// <summary> |
1957 | /// Return information regarding various simulator statistics (sim fps, physics fps, time | 1957 | /// Return information regarding various simulator statistics (sim fps, physics fps, time |
1958 | /// dilation, total number of prims, total number of active scripts, script lps, various | 1958 | /// dilation, total number of prims, total number of active scripts, script lps, various |
@@ -1960,19 +1960,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1960 | /// client's Statistics Bar (Ctrl-Shift-1) | 1960 | /// client's Statistics Bar (Ctrl-Shift-1) |
1961 | /// </summary> | 1961 | /// </summary> |
1962 | /// <returns>List of floats</returns> | 1962 | /// <returns>List of floats</returns> |
1963 | public LSL_List osGetRegionStats() | 1963 | public LSL_List osGetRegionStats() |
1964 | { | 1964 | { |
1965 | CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); | 1965 | CheckThreatLevel(ThreatLevel.Moderate, "osGetRegionStats"); |
1966 | m_host.AddScriptLPS(1); | 1966 | m_host.AddScriptLPS(1); |
1967 | LSL_List ret = new LSL_List(); | 1967 | LSL_List ret = new LSL_List(); |
1968 | float[] stats = World.SimulatorStats; | 1968 | float[] stats = World.SimulatorStats; |
1969 | 1969 | ||
1970 | for (int i = 0; i < 21; i++) | 1970 | for (int i = 0; i < 21; i++) |
1971 | { | 1971 | { |
1972 | ret.Add(new LSL_Float( stats[i] )); | 1972 | ret.Add(new LSL_Float(stats[i])); |
1973 | } | 1973 | } |
1974 | return ret; | 1974 | return ret; |
1975 | } | 1975 | } |
1976 | 1976 | ||
1977 | public int osGetSimulatorMemory() | 1977 | public int osGetSimulatorMemory() |
1978 | { | 1978 | { |
@@ -1988,81 +1988,81 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
1988 | return (int)pws; | 1988 | return (int)pws; |
1989 | } | 1989 | } |
1990 | public void osSetSpeed(string UUID, float SpeedModifier) | 1990 | public void osSetSpeed(string UUID, float SpeedModifier) |
1991 | { | 1991 | { |
1992 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); | 1992 | CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed"); |
1993 | m_host.AddScriptLPS(1); | 1993 | m_host.AddScriptLPS(1); |
1994 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); | 1994 | ScenePresence avatar = World.GetScenePresence(new UUID(UUID)); |
1995 | avatar.SpeedModifier = SpeedModifier; | 1995 | avatar.SpeedModifier = SpeedModifier; |
1996 | } | 1996 | } |
1997 | public void osKickAvatar(string FirstName,string SurName,string alert) | 1997 | public void osKickAvatar(string FirstName,string SurName,string alert) |
1998 | { | 1998 | { |
1999 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); | 1999 | CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar"); |
2000 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) | 2000 | if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID)) |
2001 | { | 2001 | { |
2002 | foreach (ScenePresence presence in World.GetAvatars()) | 2002 | foreach (ScenePresence presence in World.GetAvatars()) |
2003 | { | 2003 | { |
2004 | if ((presence.Firstname == FirstName) && | 2004 | if ((presence.Firstname == FirstName) && |
2005 | presence.Lastname == SurName) | 2005 | presence.Lastname == SurName) |
2006 | { | 2006 | { |
2007 | // kick client... | 2007 | // kick client... |
2008 | if (alert != null) | 2008 | if (alert != null) |
2009 | presence.ControllingClient.Kick(alert); | 2009 | presence.ControllingClient.Kick(alert); |
2010 | 2010 | ||
2011 | // ...and close on our side | 2011 | // ...and close on our side |
2012 | presence.Scene.IncomingCloseAgent(presence.UUID); | 2012 | presence.Scene.IncomingCloseAgent(presence.UUID); |
2013 | } | 2013 | } |
2014 | } | 2014 | } |
2015 | } | 2015 | } |
2016 | } | 2016 | } |
2017 | public void osCauseDamage(string avatar, double damage) | 2017 | public void osCauseDamage(string avatar, double damage) |
2018 | { | 2018 | { |
2019 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); | 2019 | CheckThreatLevel(ThreatLevel.High, "osCauseDamage"); |
2020 | m_host.AddScriptLPS(1); | 2020 | m_host.AddScriptLPS(1); |
2021 | 2021 | ||
2022 | UUID avatarId = new UUID(avatar); | 2022 | UUID avatarId = new UUID(avatar); |
2023 | Vector3 pos = m_host.GetWorldPosition(); | 2023 | Vector3 pos = m_host.GetWorldPosition(); |
2024 | 2024 | ||
2025 | ScenePresence presence = World.GetScenePresence(avatarId); | 2025 | ScenePresence presence = World.GetScenePresence(avatarId); |
2026 | if (presence != null) | 2026 | if (presence != null) |
2027 | { | 2027 | { |
2028 | LandData land = World.GetLandData((float)pos.X, (float)pos.Y); | 2028 | LandData land = World.GetLandData((float)pos.X, (float)pos.Y); |
2029 | if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) | 2029 | if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage) |
2030 | { | 2030 | { |
2031 | float health = presence.Health; | 2031 | float health = presence.Health; |
2032 | health -= (float)damage; | 2032 | health -= (float)damage; |
2033 | presence.setHealthWithUpdate(health); | 2033 | presence.setHealthWithUpdate(health); |
2034 | if (health <= 0) | 2034 | if (health <= 0) |
2035 | { | 2035 | { |
2036 | float healthliveagain = 100; | 2036 | float healthliveagain = 100; |
2037 | presence.ControllingClient.SendAgentAlertMessage("You died!", true); | 2037 | presence.ControllingClient.SendAgentAlertMessage("You died!", true); |
2038 | presence.setHealthWithUpdate(healthliveagain); | 2038 | presence.setHealthWithUpdate(healthliveagain); |
2039 | presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient); | 2039 | presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient); |
2040 | } | 2040 | } |
2041 | } | 2041 | } |
2042 | } | 2042 | } |
2043 | } | 2043 | } |
2044 | public void osCauseHealing(string avatar, double healing) | 2044 | public void osCauseHealing(string avatar, double healing) |
2045 | { | 2045 | { |
2046 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); | 2046 | CheckThreatLevel(ThreatLevel.High, "osCauseHealing"); |
2047 | m_host.AddScriptLPS(1); | 2047 | m_host.AddScriptLPS(1); |
2048 | 2048 | ||
2049 | UUID avatarId = new UUID(avatar); | 2049 | UUID avatarId = new UUID(avatar); |
2050 | ScenePresence presence = World.GetScenePresence(avatarId); | 2050 | ScenePresence presence = World.GetScenePresence(avatarId); |
2051 | Vector3 pos = m_host.GetWorldPosition(); | 2051 | Vector3 pos = m_host.GetWorldPosition(); |
2052 | bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); | 2052 | bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z)); |
2053 | if (result) | 2053 | if (result) |
2054 | { | 2054 | { |
2055 | if (presence != null) | 2055 | if (presence != null) |
2056 | { | 2056 | { |
2057 | float health = presence.Health; | 2057 | float health = presence.Health; |
2058 | health += (float)healing; | 2058 | health += (float)healing; |
2059 | if (health >= 100) | 2059 | if (health >= 100) |
2060 | { | 2060 | { |
2061 | health = 100; | 2061 | health = 100; |
2062 | } | 2062 | } |
2063 | presence.setHealthWithUpdate(health); | 2063 | presence.setHealthWithUpdate(health); |
2064 | } | 2064 | } |
2065 | } | 2065 | } |
2066 | } | 2066 | } |
2067 | } | 2067 | } |
2068 | } | 2068 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs index 5e20f7d..f5921e1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs | |||
@@ -162,7 +162,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
162 | 162 | ||
163 | key osGetMapTexture(); | 163 | key osGetMapTexture(); |
164 | key osGetRegionMapTexture(string regionName); | 164 | key osGetRegionMapTexture(string regionName); |
165 | LSL_List osGetRegionStats(); | 165 | LSL_List osGetRegionStats(); |
166 | 166 | ||
167 | int osGetSimulatorMemory(); | 167 | int osGetSimulatorMemory(); |
168 | void osKickAvatar(string FirstName,string SurName,string alert); | 168 | void osKickAvatar(string FirstName,string SurName,string alert); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs index acff8fb..13b855f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs | |||
@@ -515,29 +515,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
515 | public const string TEXTURE_PLYWOOD = "89556747-24cb-43ed-920b-47caed15465f"; | 515 | public const string TEXTURE_PLYWOOD = "89556747-24cb-43ed-920b-47caed15465f"; |
516 | public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"; | 516 | public const string TEXTURE_TRANSPARENT = "8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"; |
517 | public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"; | 517 | public const string TEXTURE_MEDIA = "8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"; |
518 | 518 | ||
519 | // Constants for osGetRegionStats | 519 | // Constants for osGetRegionStats |
520 | public const int STATS_TIME_DILATION = 0; | 520 | public const int STATS_TIME_DILATION = 0; |
521 | public const int STATS_SIM_FPS = 1; | 521 | public const int STATS_SIM_FPS = 1; |
522 | public const int STATS_PHYSICS_FPS = 2; | 522 | public const int STATS_PHYSICS_FPS = 2; |
523 | public const int STATS_AGENT_UPDATES = 3; | 523 | public const int STATS_AGENT_UPDATES = 3; |
524 | public const int STATS_ROOT_AGENTS = 4; | 524 | public const int STATS_ROOT_AGENTS = 4; |
525 | public const int STATS_CHILD_AGENTS = 5; | 525 | public const int STATS_CHILD_AGENTS = 5; |
526 | public const int STATS_TOTAL_PRIMS = 6; | 526 | public const int STATS_TOTAL_PRIMS = 6; |
527 | public const int STATS_ACTIVE_PRIMS = 7; | 527 | public const int STATS_ACTIVE_PRIMS = 7; |
528 | public const int STATS_FRAME_MS = 8; | 528 | public const int STATS_FRAME_MS = 8; |
529 | public const int STATS_NET_MS = 9; | 529 | public const int STATS_NET_MS = 9; |
530 | public const int STATS_PHYSICS_MS = 10; | 530 | public const int STATS_PHYSICS_MS = 10; |
531 | public const int STATS_IMAGE_MS = 11; | 531 | public const int STATS_IMAGE_MS = 11; |
532 | public const int STATS_OTHER_MS = 12; | 532 | public const int STATS_OTHER_MS = 12; |
533 | public const int STATS_IN_PACKETS_PER_SECOND = 13; | 533 | public const int STATS_IN_PACKETS_PER_SECOND = 13; |
534 | public const int STATS_OUT_PACKETS_PER_SECOND = 14; | 534 | public const int STATS_OUT_PACKETS_PER_SECOND = 14; |
535 | public const int STATS_UNACKED_BYTES = 15; | 535 | public const int STATS_UNACKED_BYTES = 15; |
536 | public const int STATS_AGENT_MS = 16; | 536 | public const int STATS_AGENT_MS = 16; |
537 | public const int STATS_PENDING_DOWNLOADS = 17; | 537 | public const int STATS_PENDING_DOWNLOADS = 17; |
538 | public const int STATS_PENDING_UPLOADS = 18; | 538 | public const int STATS_PENDING_UPLOADS = 18; |
539 | public const int STATS_ACTIVE_SCRIPTS = 19; | 539 | public const int STATS_ACTIVE_SCRIPTS = 19; |
540 | public const int STATS_SCRIPT_LPS = 20; | 540 | public const int STATS_SCRIPT_LPS = 20; |
541 | 541 | ||
542 | } | 542 | } |
543 | } | 543 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs index 2ec6226..3870af3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs | |||
@@ -632,11 +632,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
632 | { | 632 | { |
633 | return m_OSSL_Functions.osGetRegionMapTexture(regionName); | 633 | return m_OSSL_Functions.osGetRegionMapTexture(regionName); |
634 | } | 634 | } |
635 | 635 | ||
636 | public LSL_List osGetRegionStats() | 636 | public LSL_List osGetRegionStats() |
637 | { | 637 | { |
638 | return m_OSSL_Functions.osGetRegionStats(); | 638 | return m_OSSL_Functions.osGetRegionStats(); |
639 | } | 639 | } |
640 | 640 | ||
641 | /// <summary> | 641 | /// <summary> |
642 | /// Returns the amount of memory in use by the Simulator Daemon. | 642 | /// Returns the amount of memory in use by the Simulator Daemon. |
@@ -649,7 +649,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
649 | } | 649 | } |
650 | public void osKickAvatar(string FirstName,string SurName,string alert) | 650 | public void osKickAvatar(string FirstName,string SurName,string alert) |
651 | { | 651 | { |
652 | m_OSSL_Functions.osKickAvatar( FirstName, SurName, alert); | 652 | m_OSSL_Functions.osKickAvatar(FirstName, SurName, alert); |
653 | } | 653 | } |
654 | public void osSetSpeed(string UUID, float SpeedModifier) | 654 | public void osSetSpeed(string UUID, float SpeedModifier) |
655 | { | 655 | { |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs index a44abb0..b138da3 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs | |||
@@ -128,6 +128,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
128 | m_InitialValues = GetVars(); | 128 | m_InitialValues = GetVars(); |
129 | } | 129 | } |
130 | 130 | ||
131 | public virtual void StateChange(string newState) | ||
132 | { | ||
133 | } | ||
134 | |||
131 | public void Close() | 135 | public void Close() |
132 | { | 136 | { |
133 | // m_sponser.Close(); | 137 | // m_sponser.Close(); |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index c831c69..d65107e 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -659,7 +659,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
659 | 659 | ||
660 | Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> linemap; | 660 | Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> linemap; |
661 | 661 | ||
662 | lock(m_ScriptErrors) | 662 | lock (m_ScriptErrors) |
663 | { | 663 | { |
664 | try | 664 | try |
665 | { | 665 | { |