aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2009-12-31 17:19:22 -0800
committerDiva Canto2009-12-31 17:19:22 -0800
commit1427572294ca1318647a68447fb2cc8ac17dd261 (patch)
tree7751d7428ef184af8c781a6436ba5693c6ff2a33 /OpenSim
parentA lot more beef on the login service. The LLLoginResponse is a MONSTER! Almos... (diff)
parentMerge branch 'master' into presence-refactor (diff)
downloadopensim-SC-1427572294ca1318647a68447fb2cc8ac17dd261.zip
opensim-SC-1427572294ca1318647a68447fb2cc8ac17dd261.tar.gz
opensim-SC-1427572294ca1318647a68447fb2cc8ac17dd261.tar.bz2
opensim-SC-1427572294ca1318647a68447fb2cc8ac17dd261.tar.xz
Merge branch 'presence-refactor' of ssh://diva@opensimulator.org/var/git/opensim into presence-refactor
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs31
-rw-r--r--OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs31
-rw-r--r--OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs31
-rw-r--r--OpenSim/Framework/IClientAPI.cs68
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs524
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs548
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueGetModule.cs5
-rw-r--r--OpenSim/Region/CoreModules/Framework/EventQueue/EventQueueHelper.cs42
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs32
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs327
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs31
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs32
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs19
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs77
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs16
-rw-r--r--OpenSim/Tests/Common/Mock/TestClient.cs32
18 files changed, 1793 insertions, 68 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index 0141718..b3582e9 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -756,6 +756,25 @@ namespace OpenSim.Client.MXP.ClientStack
756 public event AvatarNotesUpdate OnAvatarNotesUpdate; 756 public event AvatarNotesUpdate OnAvatarNotesUpdate;
757 public event MuteListRequest OnMuteListRequest; 757 public event MuteListRequest OnMuteListRequest;
758 public event AvatarInterestUpdate OnAvatarInterestUpdate; 758 public event AvatarInterestUpdate OnAvatarInterestUpdate;
759 public event FindAgentUpdate OnFindAgentEvent;
760 public event TrackAgentUpdate OnTrackAgentEvent;
761 public event NewUserReport OnUserReportEvent;
762 public event SaveStateHandler OnSaveStateEvent;
763 public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
764 public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
765 public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
766 public event FreezeUserUpdate OnParcelFreezeUserEvent;
767 public event EjectUserUpdate OnParcelEjectUserEvent;
768 public event ParcelBuyPass OnParcelBuyPass;
769 public event ParcelGodMark OnParcelGodMark;
770 public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
771 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
772 public event SimWideDeletesDelegate OnSimWideDeletes;
773 public event SendPostcard OnSendPostcard;
774 public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
775 public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
776 public event GodlikeMessage onGodlikeMessageEvent;
777 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
759 778
760 public event PlacesQuery OnPlacesQuery; 779 public event PlacesQuery OnPlacesQuery;
761 780
@@ -1659,5 +1678,17 @@ namespace OpenSim.Client.MXP.ClientStack
1659 public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) 1678 public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages)
1660 { 1679 {
1661 } 1680 }
1681
1682 public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt)
1683 {
1684 }
1685
1686 public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier)
1687 {
1688 }
1689
1690 public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
1691 {
1692 }
1662 } 1693 }
1663} 1694}
diff --git a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
index e8d1889..75b2347 100644
--- a/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
+++ b/OpenSim/Client/Sirikata/ClientStack/SirikataClientView.cs
@@ -374,6 +374,25 @@ namespace OpenSim.Client.Sirikata.ClientStack
374 public event GrantUserFriendRights OnGrantUserRights; 374 public event GrantUserFriendRights OnGrantUserRights;
375 public event MuteListRequest OnMuteListRequest; 375 public event MuteListRequest OnMuteListRequest;
376 public event PlacesQuery OnPlacesQuery; 376 public event PlacesQuery OnPlacesQuery;
377 public event FindAgentUpdate OnFindAgentEvent;
378 public event TrackAgentUpdate OnTrackAgentEvent;
379 public event NewUserReport OnUserReportEvent;
380 public event SaveStateHandler OnSaveStateEvent;
381 public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
382 public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
383 public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
384 public event FreezeUserUpdate OnParcelFreezeUserEvent;
385 public event EjectUserUpdate OnParcelEjectUserEvent;
386 public event ParcelBuyPass OnParcelBuyPass;
387 public event ParcelGodMark OnParcelGodMark;
388 public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
389 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
390 public event SimWideDeletesDelegate OnSimWideDeletes;
391 public event SendPostcard OnSendPostcard;
392 public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
393 public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
394 public event GodlikeMessage onGodlikeMessageEvent;
395 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
377 public void SetDebugPacketLevel(int newDebug) 396 public void SetDebugPacketLevel(int newDebug)
378 { 397 {
379 throw new System.NotImplementedException(); 398 throw new System.NotImplementedException();
@@ -1121,6 +1140,18 @@ namespace OpenSim.Client.Sirikata.ClientStack
1121 { 1140 {
1122 throw new System.NotImplementedException(); 1141 throw new System.NotImplementedException();
1123 } 1142 }
1143
1144 public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt)
1145 {
1146 }
1147
1148 public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier)
1149 {
1150 }
1151
1152 public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
1153 {
1154 }
1124 1155
1125 #endregion 1156 #endregion
1126 } 1157 }
diff --git a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
index 74cecea..029e23f 100644
--- a/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
+++ b/OpenSim/Client/VWoHTTP/ClientStack/VWHClientView.cs
@@ -405,6 +405,25 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
405 public event MuteListRequest OnMuteListRequest = delegate { }; 405 public event MuteListRequest OnMuteListRequest = delegate { };
406 public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { }; 406 public event AvatarInterestUpdate OnAvatarInterestUpdate = delegate { };
407 public event PlacesQuery OnPlacesQuery = delegate { }; 407 public event PlacesQuery OnPlacesQuery = delegate { };
408 public event FindAgentUpdate OnFindAgentEvent = delegate { };
409 public event TrackAgentUpdate OnTrackAgentEvent = delegate { };
410 public event NewUserReport OnUserReportEvent = delegate { };
411 public event SaveStateHandler OnSaveStateEvent = delegate { };
412 public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest = delegate { };
413 public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest = delegate { };
414 public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest = delegate { };
415 public event FreezeUserUpdate OnParcelFreezeUserEvent = delegate { };
416 public event EjectUserUpdate OnParcelEjectUserEvent = delegate { };
417 public event ParcelBuyPass OnParcelBuyPass = delegate { };
418 public event ParcelGodMark OnParcelGodMark = delegate { };
419 public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest = delegate { };
420 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest = delegate { };
421 public event SimWideDeletesDelegate OnSimWideDeletes = delegate { };
422 public event SendPostcard OnSendPostcard = delegate { };
423 public event MuteListEntryUpdate OnUpdateMuteListEntryEvent = delegate { };
424 public event MuteListEntryRemove OnRemoveMuteListEntryEvent = delegate { };
425 public event GodlikeMessage onGodlikeMessageEvent = delegate { };
426 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent = delegate { };
408 427
409 428
410 429
@@ -1165,5 +1184,17 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
1165 public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) 1184 public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages)
1166 { 1185 {
1167 } 1186 }
1187
1188 public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt)
1189 {
1190 }
1191
1192 public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier)
1193 {
1194 }
1195
1196 public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
1197 {
1198 }
1168 } 1199 }
1169} 1200}
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index f83fea2..9f2a0ae 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -452,6 +452,47 @@ namespace OpenSim.Framework
452 public delegate void AgentFOV(IClientAPI client, float verticalAngle); 452 public delegate void AgentFOV(IClientAPI client, float verticalAngle);
453 453
454 public delegate double UpdatePriorityHandler(UpdatePriorityData data); 454 public delegate double UpdatePriorityHandler(UpdatePriorityData data);
455
456 public delegate void MuteListEntryUpdate(IClientAPI client, UUID MuteID, string Name, int Flags,UUID AgentID);
457
458 public delegate void MuteListEntryRemove(IClientAPI client, UUID MuteID, string Name, UUID AgentID);
459
460 public delegate void AvatarInterestReply(IClientAPI client,UUID target, uint wantmask, string wanttext, uint skillsmask, string skillstext, string languages);
461
462 public delegate void FindAgentUpdate(IClientAPI client, UUID hunter, UUID target);
463
464 public delegate void TrackAgentUpdate(IClientAPI client, UUID hunter, UUID target);
465
466 public delegate void FreezeUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target);
467
468 public delegate void EjectUserUpdate(IClientAPI client, UUID parcelowner,uint flags, UUID target);
469
470 public delegate void NewUserReport(IClientAPI client, string regionName,UUID abuserID, byte catagory, byte checkflags, string details, UUID objectID, Vector3 postion, byte reportType ,UUID screenshotID, string summery, UUID reporter);
471
472 public delegate void GodUpdateRegionInfoUpdate(IClientAPI client, float BillableFactor, ulong EstateID, ulong RegionFlags, byte[] SimName,int RedirectX, int RedirectY);
473
474 public delegate void GodlikeMessage(IClientAPI client, UUID requester, byte[] Method, byte[] Parameter);
475
476 public delegate void SaveStateHandler(IClientAPI client,UUID agentID);
477
478 public delegate void GroupAccountSummaryRequest(IClientAPI client,UUID agentID, UUID groupID);
479
480 public delegate void GroupAccountDetailsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID);
481
482 public delegate void GroupAccountTransactionsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID);
483
484 public delegate void ParcelBuyPass(IClientAPI client, UUID agentID, int ParcelLocalID);
485
486 public delegate void ParcelGodMark(IClientAPI client, UUID agentID, int ParcelLocalID);
487
488 public delegate void GroupActiveProposalsRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID);
489
490 public delegate void GroupVoteHistoryRequest(IClientAPI client,UUID agentID, UUID groupID, UUID transactionID, UUID sessionID);
491
492
493 public delegate void SimWideDeletesDelegate(IClientAPI client,UUID agentID, int flags, UUID targetID);
494
495 public delegate void SendPostcard(IClientAPI client);
455 496
456 #endregion 497 #endregion
457 498
@@ -1028,6 +1069,26 @@ namespace OpenSim.Framework
1028 1069
1029 event PlacesQuery OnPlacesQuery; 1070 event PlacesQuery OnPlacesQuery;
1030 1071
1072 event FindAgentUpdate OnFindAgentEvent;
1073 event TrackAgentUpdate OnTrackAgentEvent;
1074 event NewUserReport OnUserReportEvent;
1075 event SaveStateHandler OnSaveStateEvent;
1076 event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
1077 event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
1078 event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
1079 event FreezeUserUpdate OnParcelFreezeUserEvent;
1080 event EjectUserUpdate OnParcelEjectUserEvent;
1081 event ParcelBuyPass OnParcelBuyPass;
1082 event ParcelGodMark OnParcelGodMark;
1083 event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
1084 event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
1085 event SimWideDeletesDelegate OnSimWideDeletes;
1086 event SendPostcard OnSendPostcard;
1087 event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
1088 event MuteListEntryRemove OnRemoveMuteListEntryEvent;
1089 event GodlikeMessage onGodlikeMessageEvent;
1090 event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
1091
1031 /// <summary> 1092 /// <summary>
1032 /// Set the debug level at which packet output should be printed to console. 1093 /// Set the debug level at which packet output should be printed to console.
1033 /// </summary> 1094 /// </summary>
@@ -1394,5 +1455,12 @@ namespace OpenSim.Framework
1394 void SendRebakeAvatarTextures(UUID textureID); 1455 void SendRebakeAvatarTextures(UUID textureID);
1395 1456
1396 void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages); 1457 void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages);
1458
1459 void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt);
1460
1461 void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier);
1462
1463 void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt);
1464
1397 } 1465 }
1398} 1466}
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index f02c28b..0ec2ed5 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
@@ -4554,6 +4757,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4554 AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate); 4757 AddLocalPacketHandler(PacketType.AvatarInterestsUpdate, HandleAvatarInterestsUpdate);
4555 AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights); 4758 AddLocalPacketHandler(PacketType.GrantUserRights, HandleGrantUserRights);
4556 AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery); 4759 AddLocalPacketHandler(PacketType.PlacesQuery, HandlePlacesQuery);
4760 AddLocalPacketHandler(PacketType.UpdateMuteListEntry, HandleUpdateMuteListEntry);
4761 AddLocalPacketHandler(PacketType.RemoveMuteListEntry, HandleRemoveMuteListEntry);
4762 AddLocalPacketHandler(PacketType.UserReport, HandleUserReport);
4763 AddLocalPacketHandler(PacketType.FindAgent, HandleFindAgent);
4764 AddLocalPacketHandler(PacketType.TrackAgent, HandleTrackAgent);
4765 AddLocalPacketHandler(PacketType.GodUpdateRegionInfo, HandleGodUpdateRegionInfoUpdate);
4766 AddLocalPacketHandler(PacketType.GodlikeMessage, HandleGodlikeMessage);
4767 AddLocalPacketHandler(PacketType.StateSave, HandleSaveStatePacket);
4768 AddLocalPacketHandler(PacketType.GroupAccountDetailsRequest, HandleGroupAccountDetailsRequest);
4769 AddLocalPacketHandler(PacketType.GroupAccountSummaryRequest, HandleGroupAccountSummaryRequest);
4770 AddLocalPacketHandler(PacketType.GroupAccountTransactionsRequest, HandleGroupTransactionsDetailsRequest);
4771 AddLocalPacketHandler(PacketType.FreezeUser, HandleFreezeUser);
4772 AddLocalPacketHandler(PacketType.EjectUser, HandleEjectUser);
4773 AddLocalPacketHandler(PacketType.ParcelBuyPass, HandleParcelBuyPass);
4774 AddLocalPacketHandler(PacketType.ParcelGodMarkAsContent, HandleParcelGodMarkAsContent);
4775 AddLocalPacketHandler(PacketType.GroupActiveProposalsRequest, HandleGroupActiveProposalsRequest);
4776 AddLocalPacketHandler(PacketType.GroupVoteHistoryRequest, HandleGroupVoteHistoryRequest);
4777 AddLocalPacketHandler(PacketType.SimWideDeletes, HandleSimWideDeletes);
4778 AddLocalPacketHandler(PacketType.SendPostcard, HandleSendPostcard);
4557 } 4779 }
4558 4780
4559 #region Packet Handlers 4781 #region Packet Handlers
@@ -4649,7 +4871,72 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4649 4871
4650 return false; 4872 return false;
4651 } 4873 }
4652 4874
4875 private bool HandleParcelGodMarkAsContent(IClientAPI client, Packet Packet)
4876 {
4877 ParcelGodMarkAsContentPacket ParcelGodMarkAsContent =
4878 (ParcelGodMarkAsContentPacket)Packet;
4879
4880 ParcelGodMark ParcelGodMarkAsContentHandler = OnParcelGodMark;
4881 if (ParcelGodMarkAsContentHandler != null)
4882 {
4883 ParcelGodMarkAsContentHandler(this,
4884 ParcelGodMarkAsContent.AgentData.AgentID,
4885 ParcelGodMarkAsContent.ParcelData.LocalID);
4886 return true;
4887 }
4888 return false;
4889 }
4890
4891 private bool HandleFreezeUser(IClientAPI client, Packet Packet)
4892 {
4893 FreezeUserPacket FreezeUser = (FreezeUserPacket)Packet;
4894
4895 FreezeUserUpdate FreezeUserHandler = OnParcelFreezeUserEvent;
4896 if (FreezeUserHandler != null)
4897 {
4898 FreezeUserHandler(this,
4899 FreezeUser.AgentData.AgentID,
4900 FreezeUser.Data.Flags,
4901 FreezeUser.Data.TargetID);
4902 return true;
4903 }
4904 return false;
4905 }
4906
4907 private bool HandleEjectUser(IClientAPI client, Packet Packet)
4908 {
4909 EjectUserPacket EjectUser =
4910 (EjectUserPacket)Packet;
4911
4912 EjectUserUpdate EjectUserHandler = OnParcelEjectUserEvent;
4913 if (EjectUserHandler != null)
4914 {
4915 EjectUserHandler(this,
4916 EjectUser.AgentData.AgentID,
4917 EjectUser.Data.Flags,
4918 EjectUser.Data.TargetID);
4919 return true;
4920 }
4921 return false;
4922 }
4923
4924 private bool HandleParcelBuyPass(IClientAPI client, Packet Packet)
4925 {
4926 ParcelBuyPassPacket ParcelBuyPass =
4927 (ParcelBuyPassPacket)Packet;
4928
4929 ParcelBuyPass ParcelBuyPassHandler = OnParcelBuyPass;
4930 if (ParcelBuyPassHandler != null)
4931 {
4932 ParcelBuyPassHandler(this,
4933 ParcelBuyPass.AgentData.AgentID,
4934 ParcelBuyPass.ParcelData.LocalID);
4935 return true;
4936 }
4937 return false;
4938 }
4939
4653 private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack) 4940 private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack)
4654 { 4941 {
4655 ParcelBuyPacket parcel = (ParcelBuyPacket)Pack; 4942 ParcelBuyPacket parcel = (ParcelBuyPacket)Pack;
@@ -5015,7 +5302,37 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5015 } 5302 }
5016 return true; 5303 return true;
5017 } 5304 }
5018 5305
5306 private bool HandleFindAgent(IClientAPI client, Packet Packet)
5307 {
5308 FindAgentPacket FindAgent =
5309 (FindAgentPacket)Packet;
5310
5311 FindAgentUpdate FindAgentHandler = OnFindAgentEvent;
5312 if (FindAgentHandler != null)
5313 {
5314 FindAgentHandler(this,FindAgent.AgentBlock.Hunter,FindAgent.AgentBlock.Prey);
5315 return true;
5316 }
5317 return false;
5318 }
5319
5320 private bool HandleTrackAgent(IClientAPI client, Packet Packet)
5321 {
5322 TrackAgentPacket TrackAgent =
5323 (TrackAgentPacket)Packet;
5324
5325 TrackAgentUpdate TrackAgentHandler = OnTrackAgentEvent;
5326 if (TrackAgentHandler != null)
5327 {
5328 TrackAgentHandler(this,
5329 TrackAgent.AgentData.AgentID,
5330 TrackAgent.TargetData.PreyID);
5331 return true;
5332 }
5333 return false;
5334 }
5335
5019 private bool HandlerRezObject(IClientAPI sender, Packet Pack) 5336 private bool HandlerRezObject(IClientAPI sender, Packet Pack)
5020 { 5337 {
5021 RezObjectPacket rezPacket = (RezObjectPacket)Pack; 5338 RezObjectPacket rezPacket = (RezObjectPacket)Pack;
@@ -8285,6 +8602,70 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8285 8602
8286 return true; 8603 return true;
8287 } 8604 }
8605
8606 private bool HandleGodUpdateRegionInfoUpdate(IClientAPI client, Packet Packet)
8607 {
8608 GodUpdateRegionInfoPacket GodUpdateRegionInfo =
8609 (GodUpdateRegionInfoPacket)Packet;
8610
8611 GodUpdateRegionInfoUpdate handlerGodUpdateRegionInfo = OnGodUpdateRegionInfoUpdateEvent;
8612 if (handlerGodUpdateRegionInfo != null)
8613 {
8614 handlerGodUpdateRegionInfo(this,
8615 GodUpdateRegionInfo.RegionInfo.BillableFactor,
8616 GodUpdateRegionInfo.RegionInfo.EstateID,
8617 GodUpdateRegionInfo.RegionInfo.RegionFlags,
8618 GodUpdateRegionInfo.RegionInfo.SimName,
8619 GodUpdateRegionInfo.RegionInfo.RedirectGridX,
8620 GodUpdateRegionInfo.RegionInfo.RedirectGridY);
8621 return true;
8622 }
8623 return false;
8624 }
8625
8626 private bool HandleSimWideDeletes(IClientAPI client, Packet Packet)
8627 {
8628 SimWideDeletesPacket SimWideDeletesRequest =
8629 (SimWideDeletesPacket)Packet;
8630 SimWideDeletesDelegate handlerSimWideDeletesRequest = OnSimWideDeletes;
8631 if (handlerSimWideDeletesRequest != null)
8632 {
8633 handlerSimWideDeletesRequest(this, SimWideDeletesRequest.AgentData.AgentID,(int)SimWideDeletesRequest.DataBlock.Flags,SimWideDeletesRequest.DataBlock.TargetID);
8634 return true;
8635 }
8636 return false;
8637 }
8638
8639 private bool HandleGodlikeMessage(IClientAPI client, Packet Packet)
8640 {
8641 GodlikeMessagePacket GodlikeMessage =
8642 (GodlikeMessagePacket)Packet;
8643
8644 GodlikeMessage handlerGodlikeMessage = onGodlikeMessageEvent;
8645 if (handlerGodlikeMessage != null)
8646 {
8647 handlerGodlikeMessage(this,
8648 GodlikeMessage.MethodData.Invoice,
8649 GodlikeMessage.MethodData.Method,
8650 GodlikeMessage.ParamList[0].Parameter);
8651 return true;
8652 }
8653 return false;
8654 }
8655
8656 private bool HandleSaveStatePacket(IClientAPI client, Packet Packet)
8657 {
8658 StateSavePacket SaveStateMessage =
8659 (StateSavePacket)Packet;
8660 SaveStateHandler handlerSaveStatePacket = OnSaveStateEvent;
8661 if (handlerSaveStatePacket != null)
8662 {
8663 handlerSaveStatePacket(this,SaveStateMessage.AgentData.AgentID);
8664 return true;
8665 }
8666 return false;
8667 }
8668
8288 private bool HandleGodKickUser(IClientAPI sender, Packet Pack) 8669 private bool HandleGodKickUser(IClientAPI sender, Packet Pack)
8289 { 8670 {
8290 GodKickUserPacket gkupack = (GodKickUserPacket)Pack; 8671 GodKickUserPacket gkupack = (GodKickUserPacket)Pack;
@@ -8635,6 +9016,76 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8635 } 9016 }
8636 return true; 9017 return true;
8637 } 9018 }
9019
9020 private bool HandleUpdateMuteListEntry(IClientAPI client, Packet Packet)
9021 {
9022 UpdateMuteListEntryPacket UpdateMuteListEntry =
9023 (UpdateMuteListEntryPacket)Packet;
9024 MuteListEntryUpdate handlerUpdateMuteListEntry = OnUpdateMuteListEntryEvent;
9025 if (handlerUpdateMuteListEntry != null)
9026 {
9027 handlerUpdateMuteListEntry(this, UpdateMuteListEntry.MuteData.MuteID,
9028 Utils.BytesToString(UpdateMuteListEntry.MuteData.MuteName),
9029 UpdateMuteListEntry.MuteData.MuteType,
9030 UpdateMuteListEntry.AgentData.AgentID);
9031 return true;
9032 }
9033 return false;
9034 }
9035
9036 private bool HandleRemoveMuteListEntry(IClientAPI client, Packet Packet)
9037 {
9038 RemoveMuteListEntryPacket RemoveMuteListEntry =
9039 (RemoveMuteListEntryPacket)Packet;
9040 MuteListEntryRemove handlerRemoveMuteListEntry = OnRemoveMuteListEntryEvent;
9041 if (handlerRemoveMuteListEntry != null)
9042 {
9043 handlerRemoveMuteListEntry(this,
9044 RemoveMuteListEntry.MuteData.MuteID,
9045 Utils.BytesToString(RemoveMuteListEntry.MuteData.MuteName),
9046 RemoveMuteListEntry.AgentData.AgentID);
9047 return true;
9048 }
9049 return false;
9050 }
9051
9052 private bool HandleUserReport(IClientAPI client, Packet Packet)
9053 {
9054 UserReportPacket UserReport =
9055 (UserReportPacket)Packet;
9056
9057 NewUserReport handlerUserReport = OnUserReportEvent;
9058 if (handlerUserReport != null)
9059 {
9060 handlerUserReport(this,
9061 Utils.BytesToString(UserReport.ReportData.AbuseRegionName),
9062 UserReport.ReportData.AbuserID,
9063 UserReport.ReportData.Category,
9064 UserReport.ReportData.CheckFlags,
9065 Utils.BytesToString(UserReport.ReportData.Details),
9066 UserReport.ReportData.ObjectID,
9067 UserReport.ReportData.Position,
9068 UserReport.ReportData.ReportType,
9069 UserReport.ReportData.ScreenshotID,
9070 Utils.BytesToString(UserReport.ReportData.Summary),
9071 UserReport.AgentData.AgentID);
9072 return true;
9073 }
9074 return false;
9075 }
9076
9077 private bool HandleSendPostcard(IClientAPI client, Packet packet)
9078 {
9079 SendPostcardPacket SendPostcard =
9080 (SendPostcardPacket)packet;
9081 SendPostcard handlerSendPostcard = OnSendPostcard;
9082 if (handlerSendPostcard != null)
9083 {
9084 handlerSendPostcard(this);
9085 return true;
9086 }
9087 return false;
9088 }
8638 9089
8639 private bool HandleUseCircuitCode(IClientAPI sender, Packet Pack) 9090 private bool HandleUseCircuitCode(IClientAPI sender, Packet Pack)
8640 { 9091 {
@@ -8904,7 +9355,72 @@ namespace OpenSim.Region.ClientStack.LindenUDP
8904 return true; 9355 return true;
8905 9356
8906 } 9357 }
8907 9358
9359 private bool HandleGroupVoteHistoryRequest(IClientAPI client, Packet Packet)
9360 {
9361 GroupVoteHistoryRequestPacket GroupVoteHistoryRequest =
9362 (GroupVoteHistoryRequestPacket)Packet;
9363 GroupVoteHistoryRequest handlerGroupVoteHistoryRequest = OnGroupVoteHistoryRequest;
9364 if (handlerGroupVoteHistoryRequest != null)
9365 {
9366 handlerGroupVoteHistoryRequest(this, GroupVoteHistoryRequest.AgentData.AgentID,GroupVoteHistoryRequest.AgentData.SessionID,GroupVoteHistoryRequest.GroupData.GroupID,GroupVoteHistoryRequest.TransactionData.TransactionID);
9367 return true;
9368 }
9369 return false;
9370 }
9371
9372 private bool HandleGroupActiveProposalsRequest(IClientAPI client, Packet Packet)
9373 {
9374 GroupActiveProposalsRequestPacket GroupActiveProposalsRequest =
9375 (GroupActiveProposalsRequestPacket)Packet;
9376 GroupActiveProposalsRequest handlerGroupActiveProposalsRequest = OnGroupActiveProposalsRequest;
9377 if (handlerGroupActiveProposalsRequest != null)
9378 {
9379 handlerGroupActiveProposalsRequest(this, GroupActiveProposalsRequest.AgentData.AgentID,GroupActiveProposalsRequest.AgentData.SessionID,GroupActiveProposalsRequest.GroupData.GroupID,GroupActiveProposalsRequest.TransactionData.TransactionID);
9380 return true;
9381 }
9382 return false;
9383 }
9384
9385 private bool HandleGroupAccountDetailsRequest(IClientAPI client, Packet Packet)
9386 {
9387 GroupAccountDetailsRequestPacket GroupAccountDetailsRequest =
9388 (GroupAccountDetailsRequestPacket)Packet;
9389 GroupAccountDetailsRequest handlerGroupAccountDetailsRequest = OnGroupAccountDetailsRequest;
9390 if (handlerGroupAccountDetailsRequest != null)
9391 {
9392 handlerGroupAccountDetailsRequest(this, GroupAccountDetailsRequest.AgentData.AgentID,GroupAccountDetailsRequest.AgentData.GroupID,GroupAccountDetailsRequest.MoneyData.RequestID,GroupAccountDetailsRequest.AgentData.SessionID);
9393 return true;
9394 }
9395 return false;
9396 }
9397
9398 private bool HandleGroupAccountSummaryRequest(IClientAPI client, Packet Packet)
9399 {
9400 GroupAccountSummaryRequestPacket GroupAccountSummaryRequest =
9401 (GroupAccountSummaryRequestPacket)Packet;
9402 GroupAccountSummaryRequest handlerGroupAccountSummaryRequest = OnGroupAccountSummaryRequest;
9403 if (handlerGroupAccountSummaryRequest != null)
9404 {
9405 handlerGroupAccountSummaryRequest(this, GroupAccountSummaryRequest.AgentData.AgentID,GroupAccountSummaryRequest.AgentData.GroupID);
9406 return true;
9407 }
9408 return false;
9409 }
9410
9411 private bool HandleGroupTransactionsDetailsRequest(IClientAPI client, Packet Packet)
9412 {
9413 GroupAccountTransactionsRequestPacket GroupAccountTransactionsRequest =
9414 (GroupAccountTransactionsRequestPacket)Packet;
9415 GroupAccountTransactionsRequest handlerGroupAccountTransactionsRequest = OnGroupAccountTransactionsRequest;
9416 if (handlerGroupAccountTransactionsRequest != null)
9417 {
9418 handlerGroupAccountTransactionsRequest(this, GroupAccountTransactionsRequest.AgentData.AgentID,GroupAccountTransactionsRequest.AgentData.GroupID,GroupAccountTransactionsRequest.MoneyData.RequestID,GroupAccountTransactionsRequest.AgentData.SessionID);
9419 return true;
9420 }
9421 return false;
9422 }
9423
8908 private bool HandleGroupTitlesRequest(IClientAPI sender, Packet Pack) 9424 private bool HandleGroupTitlesRequest(IClientAPI sender, Packet Pack)
8909 { 9425 {
8910 GroupTitlesRequestPacket groupTitlesRequest = 9426 GroupTitlesRequestPacket groupTitlesRequest =
@@ -13705,7 +14221,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
13705 if (handlerGodKickUser != null) 14221 if (handlerGodKickUser != null)
13706 { 14222 {
13707 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, 14223 handlerGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID,
13708 gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo); 14224 gkupack.UserInfo.AgentID, gkupack.UserInfo.KickFlags, gkupack.UserInfo.Reason,gkupack.UserInfo);
13709 } 14225 }
13710 } 14226 }
13711 else 14227 else
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index f5d30b7..fceca8e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -54,6 +54,534 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
54 { 54 {
55 } 55 }
56 56
57 public void Close()
58 {
59 }
60
61 public string Name
62 {
63 get { return "FriendsModule"; }
64 }
65
66 public bool IsSharedModule
67 {
68 get { return true; }
69 }
70
71 #endregion
72
73 #region IInterregionFriendsComms
74
75 public List<UUID> InformFriendsInOtherRegion(UUID agentId, ulong destRegionHandle, List<UUID> friends, bool online)
76 {
77 List<UUID> tpdAway = new List<UUID>();
78
79 // destRegionHandle is a region on another server
80 uint x = 0, y = 0;
81 Utils.LongToUInts(destRegionHandle, out x, out y);
82 GridRegion info = m_gridServices.GetRegionByPosition(m_initialScene.RegionInfo.ScopeID, (int)x, (int)y);
83 if (info != null)
84 {
85 string httpServer = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/presence_update_bulk";
86
87 Hashtable reqParams = new Hashtable();
88 reqParams["agentID"] = agentId.ToString();
89 reqParams["agentOnline"] = online;
90 int count = 0;
91 foreach (UUID uuid in friends)
92 {
93 reqParams["friendID_" + count++] = uuid.ToString();
94 }
95 reqParams["friendCount"] = count;
96
97 IList parameters = new ArrayList();
98 parameters.Add(reqParams);
99 try
100 {
101 XmlRpcRequest request = new XmlRpcRequest("presence_update_bulk", parameters);
102 XmlRpcResponse response = request.Send(httpServer, 5000);
103 Hashtable respData = (Hashtable)response.Value;
104
105 count = (int)respData["friendCount"];
106 for (int i = 0; i < count; ++i)
107 {
108 UUID uuid;
109 if (UUID.TryParse((string)respData["friendID_" + i], out uuid)) tpdAway.Add(uuid);
110 }
111 }
112 catch (WebException e)
113 {
114 // Ignore connect failures, simulators come and go
115 //
116 if (!e.Message.Contains("ConnectFailure"))
117 {
118 m_log.Error("[OGS1 GRID SERVICES]: InformFriendsInOtherRegion XMLRPC failure: ", e);
119 }
120 }
121 catch (Exception e)
122 {
123 m_log.Error("[OGS1 GRID SERVICES]: InformFriendsInOtherRegion XMLRPC failure: ", e);
124 }
125 }
126 else m_log.WarnFormat("[OGS1 GRID SERVICES]: Couldn't find region {0}???", destRegionHandle);
127
128 return tpdAway;
129 }
130
131 public bool TriggerTerminateFriend(ulong destRegionHandle, UUID agentID, UUID exFriendID)
132 {
133 // destRegionHandle is a region on another server
134 uint x = 0, y = 0;
135 Utils.LongToUInts(destRegionHandle, out x, out y);
136 GridRegion info = m_gridServices.GetRegionByPosition(m_initialScene.RegionInfo.ScopeID, (int)x, (int)y);
137 if (info == null)
138 {
139 m_log.WarnFormat("[OGS1 GRID SERVICES]: Couldn't find region {0}", destRegionHandle);
140 return false; // region not found???
141 }
142
143 string httpServer = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/presence_update_bulk";
144
145 Hashtable reqParams = new Hashtable();
146 reqParams["agentID"] = agentID.ToString();
147 reqParams["friendID"] = exFriendID.ToString();
148
149 IList parameters = new ArrayList();
150 parameters.Add(reqParams);
151 try
152 {
153 XmlRpcRequest request = new XmlRpcRequest("terminate_friend", parameters);
154 XmlRpcResponse response = request.Send(httpServer, 5000);
155 Hashtable respData = (Hashtable)response.Value;
156
157 return (bool)respData["success"];
158 }
159 catch (Exception e)
160 {
161 m_log.Error("[OGS1 GRID SERVICES]: InformFriendsInOtherRegion XMLRPC failure: ", e);
162 return false;
163 }
164 }
165
166 #endregion
167
168 #region Incoming XMLRPC messages
169 /// <summary>
170 /// Receive presence information changes about clients in other regions.
171 /// </summary>
172 /// <param name="req"></param>
173 /// <returns></returns>
174 public XmlRpcResponse processPresenceUpdateBulk(XmlRpcRequest req, IPEndPoint remoteClient)
175 {
176 Hashtable requestData = (Hashtable)req.Params[0];
177
178 List<UUID> friendsNotHere = new List<UUID>();
179
180 // this is called with the expectation that all the friends in the request are on this region-server.
181 // But as some time passed since we checked (on the other region-server, via the MessagingServer),
182 // some of the friends might have teleported away.
183 // Actually, even now, between this line and the sending below, some people could TP away. So,
184 // we'll have to lock the m_rootAgents list for the duration to prevent/delay that.
185 lock (m_rootAgents)
186 {
187 List<ScenePresence> friendsHere = new List<ScenePresence>();
188
189 try
190 {
191 UUID agentID = new UUID((string)requestData["agentID"]);
192 bool agentOnline = (bool)requestData["agentOnline"];
193 int count = (int)requestData["friendCount"];
194 for (int i = 0; i < count; ++i)
195 {
196 UUID uuid;
197 if (UUID.TryParse((string)requestData["friendID_" + i], out uuid))
198 {
199 if (m_rootAgents.ContainsKey(uuid)) friendsHere.Add(GetRootPresenceFromAgentID(uuid));
200 else friendsNotHere.Add(uuid);
201 }
202 }
203
204 // now send, as long as they are still here...
205 UUID[] agentUUID = new UUID[] { agentID };
206 if (agentOnline)
207 {
208 foreach (ScenePresence agent in friendsHere)
209 {
210 agent.ControllingClient.SendAgentOnline(agentUUID);
211 }
212 }
213 else
214 {
215 foreach (ScenePresence agent in friendsHere)
216 {
217 agent.ControllingClient.SendAgentOffline(agentUUID);
218 }
219 }
220 }
221 catch(Exception e)
222 {
223 m_log.Warn("[FRIENDS]: Got exception while parsing presence_update_bulk request:", e);
224 }
225 }
226
227 // no need to lock anymore; if TPs happen now, worst case is that we have an additional agent in this region,
228 // which should be caught on the next iteration...
229 Hashtable result = new Hashtable();
230 int idx = 0;
231 foreach (UUID uuid in friendsNotHere)
232 {
233 result["friendID_" + idx++] = uuid.ToString();
234 }
235 result["friendCount"] = idx;
236
237 XmlRpcResponse response = new XmlRpcResponse();
238 response.Value = result;
239
240 return response;
241 }
242
243 public XmlRpcResponse processTerminateFriend(XmlRpcRequest req, IPEndPoint remoteClient)
244 {
245 Hashtable requestData = (Hashtable)req.Params[0];
246
247 bool success = false;
248
249 UUID agentID;
250 UUID friendID;
251 if (requestData.ContainsKey("agentID") && UUID.TryParse((string)requestData["agentID"], out agentID) &&
252 requestData.ContainsKey("friendID") && UUID.TryParse((string)requestData["friendID"], out friendID))
253 {
254 // try to find it and if it is there, prevent it to vanish before we sent the message
255 lock (m_rootAgents)
256 {
257 if (m_rootAgents.ContainsKey(agentID))
258 {
259 m_log.DebugFormat("[FRIEND]: Sending terminate friend {0} to agent {1}", friendID, agentID);
260 GetRootPresenceFromAgentID(agentID).ControllingClient.SendTerminateFriend(friendID);
261 success = true;
262 }
263 }
264 }
265
266 // return whether we were successful
267 Hashtable result = new Hashtable();
268 result["success"] = success;
269
270 XmlRpcResponse response = new XmlRpcResponse();
271 response.Value = result;
272 return response;
273 }
274
275 #endregion
276
277 #region Scene events
278
279 private void OnNewClient(IClientAPI client)
280 {
281 // All friends establishment protocol goes over instant message
282 // There's no way to send a message from the sim
283 // to a user to 'add a friend' without causing dialog box spam
284
285 // Subscribe to instant messages
286 client.OnInstantMessage += OnInstantMessage;
287
288 // Friend list management
289 client.OnApproveFriendRequest += OnApproveFriendRequest;
290 client.OnDenyFriendRequest += OnDenyFriendRequest;
291 client.OnTerminateFriendship += OnTerminateFriendship;
292
293 // ... calling card handling...
294 client.OnOfferCallingCard += OnOfferCallingCard;
295 client.OnAcceptCallingCard += OnAcceptCallingCard;
296 client.OnDeclineCallingCard += OnDeclineCallingCard;
297
298 // we need this one exactly once per agent session (see comments in the handler below)
299 client.OnEconomyDataRequest += OnEconomyDataRequest;
300
301 // if it leaves, we want to know, too
302 client.OnLogout += OnLogout;
303
304 client.OnGrantUserRights += GrantUserFriendRights;
305 client.OnTrackAgentEvent += FindAgent;
306 client.OnFindAgentEvent += FindAgent;
307
308 }
309
310 private void ClientClosed(UUID AgentId, Scene scene)
311 {
312 // agent's client was closed. As we handle logout in OnLogout, this here has only to handle
313 // TPing away (root agent is closed) or TPing/crossing in a region far enough away (client
314 // agent is closed).
315 // NOTE: In general, this doesn't mean that the agent logged out, just that it isn't around
316 // in one of the regions here anymore.
317 lock (m_rootAgents)
318 {
319 if (m_rootAgents.ContainsKey(AgentId))
320 {
321 m_rootAgents.Remove(AgentId);
322 }
323 }
324 }
325
326 private void AvatarEnteringParcel(ScenePresence avatar, int localLandID, UUID regionID)
327 {
328 lock (m_rootAgents)
329 {
330 m_rootAgents[avatar.UUID] = avatar.RegionHandle;
331 // Claim User! my user! Mine mine mine!
332 }
333 }
334
335 private void MakeChildAgent(ScenePresence avatar)
336 {
337 lock (m_rootAgents)
338 {
339 if (m_rootAgents.ContainsKey(avatar.UUID))
340 {
341 // only delete if the region matches. As this is a shared module, the avatar could be
342 // root agent in another region on this server.
343 if (m_rootAgents[avatar.UUID] == avatar.RegionHandle)
344 {
345 m_rootAgents.Remove(avatar.UUID);
346// m_log.Debug("[FRIEND]: Removing " + avatar.Firstname + " " + avatar.Lastname + " as a root agent");
347 }
348 }
349 }
350 }
351 #endregion
352
353 private ScenePresence GetRootPresenceFromAgentID(UUID AgentID)
354 {
355 ScenePresence returnAgent = null;
356 lock (m_scenes)
357 {
358 ScenePresence queryagent = null;
359 foreach (Scene scene in m_scenes.Values)
360 {
361 queryagent = scene.GetScenePresence(AgentID);
362 if (queryagent != null)
363 {
364 if (!queryagent.IsChildAgent)
365 {
366 returnAgent = queryagent;
367 break;
368 }
369 }
370 }
371 }
372 return returnAgent;
373 }
374
375 private ScenePresence GetAnyPresenceFromAgentID(UUID AgentID)
376 {
377 ScenePresence returnAgent = null;
378 lock (m_scenes)
379 {
380 ScenePresence queryagent = null;
381 foreach (Scene scene in m_scenes.Values)
382 {
383 queryagent = scene.GetScenePresence(AgentID);
384 if (queryagent != null)
385 {
386 returnAgent = queryagent;
387 break;
388 }
389 }
390 }
391 return returnAgent;
392 }
393
394 public void OfferFriendship(UUID fromUserId, IClientAPI toUserClient, string offerMessage)
395 {
396 CachedUserInfo userInfo = m_initialScene.CommsManager.UserProfileCacheService.GetUserDetails(fromUserId);
397
398 if (userInfo != null)
399 {
400 GridInstantMessage msg = new GridInstantMessage(
401 toUserClient.Scene, fromUserId, userInfo.UserProfile.Name, toUserClient.AgentId,
402 (byte)InstantMessageDialog.FriendshipOffered, offerMessage, false, Vector3.Zero);
403
404 FriendshipOffered(msg);
405 }
406 else
407 {
408 m_log.ErrorFormat("[FRIENDS]: No user found for id {0} in OfferFriendship()", fromUserId);
409 }
410 }
411
412 #region FriendRequestHandling
413
414 private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
415 {
416 // Friend Requests go by Instant Message.. using the dialog param
417 // https://wiki.secondlife.com/wiki/ImprovedInstantMessage
418
419 if (im.dialog == (byte)InstantMessageDialog.FriendshipOffered) // 38
420 {
421 // fromAgentName is the *destination* name (the friend we offer friendship to)
422 ScenePresence initiator = GetAnyPresenceFromAgentID(new UUID(im.fromAgentID));
423 im.fromAgentName = initiator != null ? initiator.Name : "(hippo)";
424
425 FriendshipOffered(im);
426 }
427 else if (im.dialog == (byte)InstantMessageDialog.FriendshipAccepted) // 39
428 {
429 FriendshipAccepted(client, im);
430 }
431 else if (im.dialog == (byte)InstantMessageDialog.FriendshipDeclined) // 40
432 {
433 FriendshipDeclined(client, im);
434 }
435 }
436
437 /// <summary>
438 /// Invoked when a user offers a friendship.
439 /// </summary>
440 ///
441 /// <param name="im"></param>
442 /// <param name="client"></param>
443 private void FriendshipOffered(GridInstantMessage im)
444 {
445 // this is triggered by the initiating agent:
446 // A local agent offers friendship to some possibly remote friend.
447 // A IM is triggered, processed here and sent to the friend (possibly in a remote region).
448
449 m_log.DebugFormat("[FRIEND]: Offer(38) - From: {0}, FromName: {1} To: {2}, Session: {3}, Message: {4}, Offline {5}",
450 im.fromAgentID, im.fromAgentName, im.toAgentID, im.imSessionID, im.message, im.offline);
451
452 // 1.20 protocol sends an UUID in the message field, instead of the friendship offer text.
453 // For interoperability, we have to clear that
454 if (Util.isUUID(im.message)) im.message = "";
455
456 // be sneeky and use the initiator-UUID as transactionID. This means we can be stateless.
457 // we have to look up the agent name on friendship-approval, though.
458 im.imSessionID = im.fromAgentID;
459
460 if (m_TransferModule != null)
461 {
462 // Send it to whoever is the destination.
463 // If new friend is local, it will send an IM to the viewer.
464 // If new friend is remote, it will cause a OnGridInstantMessage on the remote server
465 m_TransferModule.SendInstantMessage(
466 im,
467 delegate(bool success)
468 {
469 m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success);
470 }
471 );
472 }
473 }
474
475 /// <summary>
476 /// Invoked when a user accepts a friendship offer.
477 /// </summary>
478 /// <param name="im"></param>
479 /// <param name="client"></param>
480 private void FriendshipAccepted(IClientAPI client, GridInstantMessage im)
481 {
482 m_log.DebugFormat("[FRIEND]: 39 - from client {0}, agent {2} {3}, imsession {4} to {5}: {6} (dialog {7})",
483 client.AgentId, im.fromAgentID, im.fromAgentName, im.imSessionID, im.toAgentID, im.message, im.dialog);
484 }
485
486 /// <summary>
487 /// Invoked when a user declines a friendship offer.
488 /// </summary>
489 /// May not currently be used - see OnDenyFriendRequest() instead
490 /// <param name="im"></param>
491 /// <param name="client"></param>
492 private void FriendshipDeclined(IClientAPI client, GridInstantMessage im)
493 {
494 UUID fromAgentID = new UUID(im.fromAgentID);
495 UUID toAgentID = new UUID(im.toAgentID);
496
497 // declining the friendship offer causes a type 40 IM being sent to the (possibly remote) initiator
498 // toAgentID is initiator, fromAgentID declined friendship
499 m_log.DebugFormat("[FRIEND]: 40 - from client {0}, agent {1} {2}, imsession {3} to {4}: {5} (dialog {6})",
500 client != null ? client.AgentId.ToString() : "<null>",
501 fromAgentID, im.fromAgentName, im.imSessionID, im.toAgentID, im.message, im.dialog);
502
503 // Send the decline to whoever is the destination.
504 GridInstantMessage msg
505 = new GridInstantMessage(
506 client.Scene, fromAgentID, client.Name, toAgentID,
507 im.dialog, im.message, im.offline != 0, im.Position);
508
509 // If new friend is local, it will send an IM to the viewer.
510 // If new friend is remote, it will cause a OnGridInstantMessage on the remote server
511 m_TransferModule.SendInstantMessage(msg,
512 delegate(bool success) {
513 m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success);
514 }
515 );
516 }
517
518 private void OnGridInstantMessage(GridInstantMessage msg)
519 {
520 // This event won't be raised unless we have that agent,
521 // so we can depend on the above not trying to send
522 // via grid again
523 //m_log.DebugFormat("[FRIEND]: Got GridIM from {0}, to {1}, imSession {2}, message {3}, dialog {4}",
524 // msg.fromAgentID, msg.toAgentID, msg.imSessionID, msg.message, msg.dialog);
525
526 if (msg.dialog == (byte)InstantMessageDialog.FriendshipOffered ||
527 msg.dialog == (byte)InstantMessageDialog.FriendshipAccepted ||
528 msg.dialog == (byte)InstantMessageDialog.FriendshipDeclined)
529 {
530 // this should succeed as we *know* the root agent is here.
531 m_TransferModule.SendInstantMessage(msg,
532 delegate(bool success) {
533 //m_log.DebugFormat("[FRIEND]: sending IM success = {0}", success);
534 }
535 );
536 }
537
538 if (msg.dialog == (byte)InstantMessageDialog.FriendshipAccepted)
539 {
540 // for accept friendship, we have to do a bit more
541 ApproveFriendship(new UUID(msg.fromAgentID), new UUID(msg.toAgentID), msg.fromAgentName);
542 }
543 }
544
545 private void ApproveFriendship(UUID fromAgentID, UUID toAgentID, string fromName)
546 {
547 m_log.DebugFormat("[FRIEND]: Approve friendship from {0} (ID: {1}) to {2}",
548 fromAgentID, fromName, toAgentID);
549
550 // a new friend was added in the initiator's and friend's data, so the cache entries are wrong now.
551 lock (m_friendLists)
552 {
553 m_friendLists.Invalidate(fromAgentID.ToString());
554 m_friendLists.Invalidate(toAgentID.ToString());
555 }
556
557 // now send presence update and add a calling card for the new friend
558
559 ScenePresence initiator = GetAnyPresenceFromAgentID(toAgentID);
560 if (initiator == null)
561 {
562 // quite wrong. Shouldn't happen.
563 m_log.WarnFormat("[FRIEND]: Coudn't find initiator of friend request {0}", toAgentID);
564 return;
565 }
566
567 m_log.DebugFormat("[FRIEND]: Tell {0} that {1} is online",
568 initiator.Name, fromName);
569 // tell initiator that friend is online
570 initiator.ControllingClient.SendAgentOnline(new UUID[] { fromAgentID });
571
572 // find the folder for the friend...
573 //InventoryFolderImpl folder =
574 // initiator.Scene.CommsManager.UserProfileCacheService.GetUserDetails(toAgentID).FindFolderForType((int)InventoryType.CallingCard);
575 IInventoryService invService = initiator.Scene.InventoryService;
576 InventoryFolderBase folder = invService.GetFolderForType(toAgentID, AssetType.CallingCard);
577 if (folder != null)
578 {
579 // ... and add the calling card
580 CreateCallingCard(initiator.ControllingClient, fromAgentID, folder.ID, fromName);
581 }
582>>>>>>> master:OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
583 }
584
57 public void AddRegion(Scene scene) 585 public void AddRegion(Scene scene)
58 { 586 {
59 } 587 }
@@ -84,6 +612,26 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
84 string offerMessage) 612 string offerMessage)
85 { 613 {
86 } 614 }
615 public void FindAgent(IClientAPI remoteClient, UUID hunter, UUID target)
616 {
617 List<FriendListItem> friendList = GetUserFriends(hunter);
618 foreach (FriendListItem item in friendList)
619 {
620 if(item.onlinestatus == true)
621 {
622 if(item.Friend == target && (item.FriendPerms & (uint)FriendRights.CanSeeOnMap) != 0)
623 {
624 ScenePresence SPTarget = ((Scene)remoteClient.Scene).GetScenePresence(target);
625 string regionname = SPTarget.Scene.RegionInfo.RegionName;
626 remoteClient.SendScriptTeleportRequest("FindAgent", regionname,new Vector3(SPTarget.AbsolutePosition),new Vector3(SPTarget.Lookat));
627 }
628 }
629 else
630 {
631 remoteClient.SendAgentAlertMessage("The agent you are looking for is not online.", false);
632 }
633 }
634 }
87 635
88 public List<FriendListItem> GetUserFriends(UUID agentID) 636 public List<FriendListItem> GetUserFriends(UUID agentID)
89 { 637 {
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..67fc8e6 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/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 89e7747..086103b 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/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index e9ed066..34d8b49 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -340,6 +340,17 @@ namespace OpenSim.Region.Framework.Scenes
340 { 340 {
341 get { return true; } 341 get { return true; }
342 } 342 }
343
344 private bool m_passCollision;
345 public bool PassCollision
346 {
347 get { return m_passCollision; }
348 set
349 {
350 m_passCollision = value;
351 HasGroupChanged = true;
352 }
353 }
343 354
344 public bool IsSelected 355 public bool IsSelected
345 { 356 {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index c0243a5..b50def3 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.
@@ -452,6 +455,17 @@ namespace OpenSim.Region.Framework.Scenes
452 } 455 }
453 } 456 }
454 457
458
459 [XmlIgnore]
460 public Dictionary<int, string> CollisionFilter
461 {
462 get { return m_CollisionFilter; }
463 set
464 {
465 m_CollisionFilter = value;
466 }
467 }
468
455 public ulong RegionHandle 469 public ulong RegionHandle
456 { 470 {
457 get { return m_regionHandle; } 471 get { return m_regionHandle; }
@@ -1876,18 +1890,49 @@ namespace OpenSim.Region.Framework.Scenes
1876 return; 1890 return;
1877 1891
1878 SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); 1892 SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
1893 string data = "";
1879 if (obj != null) 1894 if (obj != null)
1880 { 1895 {
1881 DetectedObject detobj = new DetectedObject(); 1896 if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
1882 detobj.keyUUID = obj.UUID; 1897 {
1883 detobj.nameStr = obj.Name; 1898 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
1884 detobj.ownerUUID = obj._ownerID; 1899 //If it is 1, it is to accept ONLY collisions from this object
1885 detobj.posVector = obj.AbsolutePosition; 1900 if(found)
1886 detobj.rotQuat = obj.GetWorldRotation(); 1901 {
1887 detobj.velVector = obj.Velocity; 1902 DetectedObject detobj = new DetectedObject();
1888 detobj.colliderType = 0; 1903 detobj.keyUUID = obj.UUID;
1889 detobj.groupUUID = obj._groupID; 1904 detobj.nameStr = obj.Name;
1890 colliding.Add(detobj); 1905 detobj.ownerUUID = obj._ownerID;
1906 detobj.posVector = obj.AbsolutePosition;
1907 detobj.rotQuat = obj.GetWorldRotation();
1908 detobj.velVector = obj.Velocity;
1909 detobj.colliderType = 0;
1910 detobj.groupUUID = obj._groupID;
1911 colliding.Add(detobj);
1912 }
1913 //If it is 0, it is to not accept collisions from this object
1914 else
1915 {
1916 }
1917 }
1918 else
1919 {
1920 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
1921 //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
1922 if(found)
1923 {
1924 DetectedObject detobj = new DetectedObject();
1925 detobj.keyUUID = obj.UUID;
1926 detobj.nameStr = obj.Name;
1927 detobj.ownerUUID = obj._ownerID;
1928 detobj.posVector = obj.AbsolutePosition;
1929 detobj.rotQuat = obj.GetWorldRotation();
1930 detobj.velVector = obj.Velocity;
1931 detobj.colliderType = 0;
1932 detobj.groupUUID = obj._groupID;
1933 colliding.Add(detobj);
1934 }
1935 }
1891 } 1936 }
1892 else 1937 else
1893 { 1938 {
@@ -1899,16 +1944,47 @@ namespace OpenSim.Region.Framework.Scenes
1899 1944
1900 if (av.LocalId == localId) 1945 if (av.LocalId == localId)
1901 { 1946 {
1902 DetectedObject detobj = new DetectedObject(); 1947 if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
1903 detobj.keyUUID = av.UUID; 1948 {
1904 detobj.nameStr = av.ControllingClient.Name; 1949 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
1905 detobj.ownerUUID = av.UUID; 1950 //If it is 1, it is to accept ONLY collisions from this avatar
1906 detobj.posVector = av.AbsolutePosition; 1951 if(found)
1907 detobj.rotQuat = av.Rotation; 1952 {
1908 detobj.velVector = av.Velocity; 1953 DetectedObject detobj = new DetectedObject();
1909 detobj.colliderType = 0; 1954 detobj.keyUUID = av.UUID;
1910 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 1955 detobj.nameStr = av.ControllingClient.Name;
1911 colliding.Add(detobj); 1956 detobj.ownerUUID = av.UUID;
1957 detobj.posVector = av.AbsolutePosition;
1958 detobj.rotQuat = av.Rotation;
1959 detobj.velVector = av.Velocity;
1960 detobj.colliderType = 0;
1961 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
1962 colliding.Add(detobj);
1963 }
1964 //If it is 0, it is to not accept collisions from this avatar
1965 else
1966 {
1967 }
1968 }
1969 else
1970 {
1971 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
1972 //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
1973 if(found)
1974 {
1975 DetectedObject detobj = new DetectedObject();
1976 detobj.keyUUID = av.UUID;
1977 detobj.nameStr = av.ControllingClient.Name;
1978 detobj.ownerUUID = av.UUID;
1979 detobj.posVector = av.AbsolutePosition;
1980 detobj.rotQuat = av.Rotation;
1981 detobj.velVector = av.Velocity;
1982 detobj.colliderType = 0;
1983 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
1984 colliding.Add(detobj);
1985 }
1986 }
1987
1912 } 1988 }
1913 } 1989 }
1914 } 1990 }
@@ -1922,7 +1998,10 @@ namespace OpenSim.Region.Framework.Scenes
1922 1998
1923 if (m_parentGroup.Scene == null) 1999 if (m_parentGroup.Scene == null)
1924 return; 2000 return;
1925 2001 if(m_parentGroup.PassCollision == true)
2002 {
2003 //TODO: Add pass to root prim!
2004 }
1926 m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage); 2005 m_parentGroup.Scene.EventManager.TriggerScriptCollidingStart(LocalId, StartCollidingMessage);
1927 } 2006 }
1928 } 2007 }
@@ -1947,39 +2026,101 @@ namespace OpenSim.Region.Framework.Scenes
1947 return; 2026 return;
1948 2027
1949 SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); 2028 SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
2029 string data = "";
1950 if (obj != null) 2030 if (obj != null)
1951 { 2031 {
1952 DetectedObject detobj = new DetectedObject(); 2032 if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
1953 detobj.keyUUID = obj.UUID; 2033 {
1954 detobj.nameStr = obj.Name; 2034 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
1955 detobj.ownerUUID = obj._ownerID; 2035 //If it is 1, it is to accept ONLY collisions from this object
1956 detobj.posVector = obj.AbsolutePosition; 2036 if(found)
1957 detobj.rotQuat = obj.GetWorldRotation(); 2037 {
1958 detobj.velVector = obj.Velocity; 2038 DetectedObject detobj = new DetectedObject();
1959 detobj.colliderType = 0; 2039 detobj.keyUUID = obj.UUID;
1960 detobj.groupUUID = obj._groupID; 2040 detobj.nameStr = obj.Name;
1961 colliding.Add(detobj); 2041 detobj.ownerUUID = obj._ownerID;
2042 detobj.posVector = obj.AbsolutePosition;
2043 detobj.rotQuat = obj.GetWorldRotation();
2044 detobj.velVector = obj.Velocity;
2045 detobj.colliderType = 0;
2046 detobj.groupUUID = obj._groupID;
2047 colliding.Add(detobj);
2048 }
2049 //If it is 0, it is to not accept collisions from this object
2050 else
2051 {
2052 }
2053 }
2054 else
2055 {
2056 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
2057 //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
2058 if(found)
2059 {
2060 DetectedObject detobj = new DetectedObject();
2061 detobj.keyUUID = obj.UUID;
2062 detobj.nameStr = obj.Name;
2063 detobj.ownerUUID = obj._ownerID;
2064 detobj.posVector = obj.AbsolutePosition;
2065 detobj.rotQuat = obj.GetWorldRotation();
2066 detobj.velVector = obj.Velocity;
2067 detobj.colliderType = 0;
2068 detobj.groupUUID = obj._groupID;
2069 colliding.Add(detobj);
2070 }
2071 }
1962 } 2072 }
1963 else 2073 else
1964 { 2074 {
1965 ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences(); 2075 ScenePresence[] avlist = m_parentGroup.Scene.GetScenePresences();
1966 2076
1967 for (int i = 0; i < avlist.Length; i++) 2077 for (int i = 0; i < avlist.Length; i++)
1968 { 2078 {
1969 ScenePresence av = avlist[i]; 2079 ScenePresence av = avlist[i];
1970 2080
1971 if (av.LocalId == localId) 2081 if (av.LocalId == localId)
1972 { 2082 {
1973 DetectedObject detobj = new DetectedObject(); 2083 if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
1974 detobj.keyUUID = av.UUID; 2084 {
1975 detobj.nameStr = av.Name; 2085 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
1976 detobj.ownerUUID = av.UUID; 2086 //If it is 1, it is to accept ONLY collisions from this avatar
1977 detobj.posVector = av.AbsolutePosition; 2087 if(found)
1978 detobj.rotQuat = av.Rotation; 2088 {
1979 detobj.velVector = av.Velocity; 2089 DetectedObject detobj = new DetectedObject();
1980 detobj.colliderType = 0; 2090 detobj.keyUUID = av.UUID;
1981 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 2091 detobj.nameStr = av.ControllingClient.Name;
1982 colliding.Add(detobj); 2092 detobj.ownerUUID = av.UUID;
2093 detobj.posVector = av.AbsolutePosition;
2094 detobj.rotQuat = av.Rotation;
2095 detobj.velVector = av.Velocity;
2096 detobj.colliderType = 0;
2097 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
2098 colliding.Add(detobj);
2099 }
2100 //If it is 0, it is to not accept collisions from this avatar
2101 else
2102 {
2103 }
2104 }
2105 else
2106 {
2107 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
2108 //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
2109 if(found)
2110 {
2111 DetectedObject detobj = new DetectedObject();
2112 detobj.keyUUID = av.UUID;
2113 detobj.nameStr = av.ControllingClient.Name;
2114 detobj.ownerUUID = av.UUID;
2115 detobj.posVector = av.AbsolutePosition;
2116 detobj.rotQuat = av.Rotation;
2117 detobj.velVector = av.Velocity;
2118 detobj.colliderType = 0;
2119 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
2120 colliding.Add(detobj);
2121 }
2122 }
2123
1983 } 2124 }
1984 } 2125 }
1985 } 2126 }
@@ -2016,18 +2157,49 @@ namespace OpenSim.Region.Framework.Scenes
2016 if (m_parentGroup.Scene == null) 2157 if (m_parentGroup.Scene == null)
2017 return; 2158 return;
2018 SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId); 2159 SceneObjectPart obj = m_parentGroup.Scene.GetSceneObjectPart(localId);
2160 string data = "";
2019 if (obj != null) 2161 if (obj != null)
2020 { 2162 {
2021 DetectedObject detobj = new DetectedObject(); 2163 if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
2022 detobj.keyUUID = obj.UUID; 2164 {
2023 detobj.nameStr = obj.Name; 2165 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
2024 detobj.ownerUUID = obj._ownerID; 2166 //If it is 1, it is to accept ONLY collisions from this object
2025 detobj.posVector = obj.AbsolutePosition; 2167 if(found)
2026 detobj.rotQuat = obj.GetWorldRotation(); 2168 {
2027 detobj.velVector = obj.Velocity; 2169 DetectedObject detobj = new DetectedObject();
2028 detobj.colliderType = 0; 2170 detobj.keyUUID = obj.UUID;
2029 detobj.groupUUID = obj._groupID; 2171 detobj.nameStr = obj.Name;
2030 colliding.Add(detobj); 2172 detobj.ownerUUID = obj._ownerID;
2173 detobj.posVector = obj.AbsolutePosition;
2174 detobj.rotQuat = obj.GetWorldRotation();
2175 detobj.velVector = obj.Velocity;
2176 detobj.colliderType = 0;
2177 detobj.groupUUID = obj._groupID;
2178 colliding.Add(detobj);
2179 }
2180 //If it is 0, it is to not accept collisions from this object
2181 else
2182 {
2183 }
2184 }
2185 else
2186 {
2187 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
2188 //If it is 1, it is to accept ONLY collisions from this object, so this other object will not work
2189 if(found)
2190 {
2191 DetectedObject detobj = new DetectedObject();
2192 detobj.keyUUID = obj.UUID;
2193 detobj.nameStr = obj.Name;
2194 detobj.ownerUUID = obj._ownerID;
2195 detobj.posVector = obj.AbsolutePosition;
2196 detobj.rotQuat = obj.GetWorldRotation();
2197 detobj.velVector = obj.Velocity;
2198 detobj.colliderType = 0;
2199 detobj.groupUUID = obj._groupID;
2200 colliding.Add(detobj);
2201 }
2202 }
2031 } 2203 }
2032 else 2204 else
2033 { 2205 {
@@ -2039,16 +2211,47 @@ namespace OpenSim.Region.Framework.Scenes
2039 2211
2040 if (av.LocalId == localId) 2212 if (av.LocalId == localId)
2041 { 2213 {
2042 DetectedObject detobj = new DetectedObject(); 2214 if(m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.UUID.ToString()) || m_parentGroup.RootPart.CollisionFilter.ContainsValue(obj.Name))
2043 detobj.keyUUID = av.UUID; 2215 {
2044 detobj.nameStr = av.Name; 2216 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
2045 detobj.ownerUUID = av.UUID; 2217 //If it is 1, it is to accept ONLY collisions from this avatar
2046 detobj.posVector = av.AbsolutePosition; 2218 if(found)
2047 detobj.rotQuat = av.Rotation; 2219 {
2048 detobj.velVector = av.Velocity; 2220 DetectedObject detobj = new DetectedObject();
2049 detobj.colliderType = 0; 2221 detobj.keyUUID = av.UUID;
2050 detobj.groupUUID = av.ControllingClient.ActiveGroupId; 2222 detobj.nameStr = av.ControllingClient.Name;
2051 colliding.Add(detobj); 2223 detobj.ownerUUID = av.UUID;
2224 detobj.posVector = av.AbsolutePosition;
2225 detobj.rotQuat = av.Rotation;
2226 detobj.velVector = av.Velocity;
2227 detobj.colliderType = 0;
2228 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
2229 colliding.Add(detobj);
2230 }
2231 //If it is 0, it is to not accept collisions from this avatar
2232 else
2233 {
2234 }
2235 }
2236 else
2237 {
2238 bool found = m_parentGroup.RootPart.CollisionFilter.TryGetValue(1,out data);
2239 //If it is 1, it is to accept ONLY collisions from this avatar, so this other avatar will not work
2240 if(found)
2241 {
2242 DetectedObject detobj = new DetectedObject();
2243 detobj.keyUUID = av.UUID;
2244 detobj.nameStr = av.ControllingClient.Name;
2245 detobj.ownerUUID = av.UUID;
2246 detobj.posVector = av.AbsolutePosition;
2247 detobj.rotQuat = av.Rotation;
2248 detobj.velVector = av.Velocity;
2249 detobj.colliderType = 0;
2250 detobj.groupUUID = av.ControllingClient.ActiveGroupId;
2251 colliding.Add(detobj);
2252 }
2253 }
2254
2052 } 2255 }
2053 } 2256 }
2054 } 2257 }
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 8b34396..6c2b94a 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/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 1573c73..da7f018 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/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 6102504..d242506 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2752,7 +2752,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2752 public void llCollisionFilter(string name, string id, int accept) 2752 public void llCollisionFilter(string name, string id, int accept)
2753 { 2753 {
2754 m_host.AddScriptLPS(1); 2754 m_host.AddScriptLPS(1);
2755 NotImplemented("llCollisionFilter"); 2755 m_host.CollisionFilter.Clear();
2756 if(id != null)
2757 {
2758 m_host.CollisionFilter.Add(accept,id);
2759 }
2760 else
2761 {
2762 m_host.CollisionFilter.Add(accept,name);
2763 }
2756 } 2764 }
2757 2765
2758 public void llTakeControls(int controls, int accept, int pass_on) 2766 public void llTakeControls(int controls, int accept, int pass_on)
@@ -4232,7 +4240,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4232 public void llPassCollisions(int pass) 4240 public void llPassCollisions(int pass)
4233 { 4241 {
4234 m_host.AddScriptLPS(1); 4242 m_host.AddScriptLPS(1);
4235 NotImplemented("llPassCollisions"); 4243 if(pass == 0)
4244 {
4245 m_host.ParentGroup.PassCollision = false;
4246 }
4247 else
4248 {
4249 m_host.ParentGroup.PassCollision = true;
4250 }
4236 } 4251 }
4237 4252
4238 public LSL_String llGetScriptName() 4253 public LSL_String llGetScriptName()
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 9c7604b..5abe4b1 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -1983,5 +1983,82 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1983 1983
1984 return (int)pws; 1984 return (int)pws;
1985 } 1985 }
1986 public void osSetSpeed(string UUID, float SpeedModifier)
1987 {
1988 CheckThreatLevel(ThreatLevel.Moderate, "osSetSpeed");
1989 m_host.AddScriptLPS(1);
1990 ScenePresence avatar = World.GetScenePresence(new UUID(UUID));
1991 avatar.SpeedModifier = SpeedModifier;
1992 }
1993 public void osKickAvatar(string FirstName,string SurName,string alert)
1994 {
1995 CheckThreatLevel(ThreatLevel.Severe, "osKickAvatar");
1996 if (World.Permissions.CanRunConsoleCommand(m_host.OwnerID))
1997 {
1998 foreach (ScenePresence presence in World.GetAvatars())
1999 {
2000 if ((presence.Firstname == FirstName) &&
2001 presence.Lastname == SurName)
2002 {
2003 // kick client...
2004 if (alert != null)
2005 presence.ControllingClient.Kick(alert);
2006
2007 // ...and close on our side
2008 presence.Scene.IncomingCloseAgent(presence.UUID);
2009 }
2010 }
2011 }
2012 }
2013 public void osCauseDamage(string avatar, double damage)
2014 {
2015 CheckThreatLevel(ThreatLevel.High, "osCauseDamage");
2016 m_host.AddScriptLPS(1);
2017
2018 UUID avatarId = new UUID(avatar);
2019 Vector3 pos = m_host.GetWorldPosition();
2020
2021 ScenePresence presence = World.GetScenePresence(avatarId);
2022 if (presence != null)
2023 {
2024 LandData land = World.GetLandData((float)pos.X, (float)pos.Y);
2025 if ((land.Flags & (uint)ParcelFlags.AllowDamage) == (uint)ParcelFlags.AllowDamage)
2026 {
2027 float health = presence.Health;
2028 health -= (float)damage;
2029 presence.setHealthWithUpdate(health);
2030 if (health <= 0)
2031 {
2032 float healthliveagain = 100;
2033 presence.ControllingClient.SendAgentAlertMessage("You died!", true);
2034 presence.setHealthWithUpdate(healthliveagain);
2035 presence.Scene.TeleportClientHome(presence.UUID, presence.ControllingClient);
2036 }
2037 }
2038 }
2039 }
2040 public void osCauseHealing(string avatar, double healing)
2041 {
2042 CheckThreatLevel(ThreatLevel.High, "osCauseHealing");
2043 m_host.AddScriptLPS(1);
2044
2045 UUID avatarId = new UUID(avatar);
2046 ScenePresence presence = World.GetScenePresence(avatarId);
2047 Vector3 pos = m_host.GetWorldPosition();
2048 bool result = World.ScriptDanger(m_host.LocalId, new Vector3((float)pos.X, (float)pos.Y, (float)pos.Z));
2049 if (result)
2050 {
2051 if (presence != null)
2052 {
2053 float health = presence.Health;
2054 health += (float)healing;
2055 if (health >= 100)
2056 {
2057 health = 100;
2058 }
2059 presence.setHealthWithUpdate(health);
2060 }
2061 }
2062 }
1986 } 2063 }
1987} 2064}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 580c354..ac9405e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -165,5 +165,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
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);
169 void osSetSpeed(string UUID, float SpeedModifier);
170 void osCauseHealing(string avatar, double healing);
171 void osCauseDamage(string avatar, double damage);
168 } 172 }
169} 173}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index 2876ad6..2ec6226 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -647,5 +647,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
647 { 647 {
648 return m_OSSL_Functions.osGetSimulatorMemory(); 648 return m_OSSL_Functions.osGetSimulatorMemory();
649 } 649 }
650 public void osKickAvatar(string FirstName,string SurName,string alert)
651 {
652 m_OSSL_Functions.osKickAvatar( FirstName, SurName, alert);
653 }
654 public void osSetSpeed(string UUID, float SpeedModifier)
655 {
656 m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
657 }
658 public void osCauseDamage(string avatar, double damage)
659 {
660 m_OSSL_Functions.osCauseDamage(avatar, damage);
661 }
662 public void osCauseHealing(string avatar, double healing)
663 {
664 m_OSSL_Functions.osCauseHealing(avatar, healing);
665 }
650 } 666 }
651} 667}
diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs
index 6265ab7..8da9209 100644
--- a/OpenSim/Tests/Common/Mock/TestClient.cs
+++ b/OpenSim/Tests/Common/Mock/TestClient.cs
@@ -287,6 +287,26 @@ namespace OpenSim.Tests.Common.Mock
287 public event AvatarInterestUpdate OnAvatarInterestUpdate; 287 public event AvatarInterestUpdate OnAvatarInterestUpdate;
288 288
289 public event PlacesQuery OnPlacesQuery; 289 public event PlacesQuery OnPlacesQuery;
290
291 public event FindAgentUpdate OnFindAgentEvent;
292 public event TrackAgentUpdate OnTrackAgentEvent;
293 public event NewUserReport OnUserReportEvent;
294 public event SaveStateHandler OnSaveStateEvent;
295 public event GroupAccountSummaryRequest OnGroupAccountSummaryRequest;
296 public event GroupAccountDetailsRequest OnGroupAccountDetailsRequest;
297 public event GroupAccountTransactionsRequest OnGroupAccountTransactionsRequest;
298 public event FreezeUserUpdate OnParcelFreezeUserEvent;
299 public event EjectUserUpdate OnParcelEjectUserEvent;
300 public event ParcelBuyPass OnParcelBuyPass;
301 public event ParcelGodMark OnParcelGodMark;
302 public event GroupActiveProposalsRequest OnGroupActiveProposalsRequest;
303 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
304 public event SimWideDeletesDelegate OnSimWideDeletes;
305 public event SendPostcard OnSendPostcard;
306 public event MuteListEntryUpdate OnUpdateMuteListEntryEvent;
307 public event MuteListEntryRemove OnRemoveMuteListEntryEvent;
308 public event GodlikeMessage onGodlikeMessageEvent;
309 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdateEvent;
290 310
291#pragma warning restore 67 311#pragma warning restore 67
292 312
@@ -1163,5 +1183,17 @@ namespace OpenSim.Tests.Common.Mock
1163 public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages) 1183 public void SendAvatarInterestsReply(UUID avatarID, uint wantMask, string wantText, uint skillsMask, string skillsText, string languages)
1164 { 1184 {
1165 } 1185 }
1186
1187 public void SendGroupAccountingDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID, int amt)
1188 {
1189 }
1190
1191 public void SendGroupAccountingSummary(IClientAPI sender,UUID groupID, uint moneyAmt, int totalTier, int usedTier)
1192 {
1193 }
1194
1195 public void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt)
1196 {
1197 }
1166 } 1198 }
1167} 1199}