aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs58
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs3
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs5
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs26
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs82
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs325
-rw-r--r--OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs1
-rw-r--r--OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs36
-rw-r--r--OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs1
-rw-r--r--OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerPermissionModule.cs4
-rw-r--r--OpenSim/Region/OptionalModules/RegionCombinerModule/RegionConnections.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs6
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs5
-rw-r--r--OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs2
-rw-r--r--OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs7
-rw-r--r--OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs7
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs67
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs78
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs4
-rw-r--r--OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs6
24 files changed, 437 insertions, 300 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
index 6fe86b2..6611744 100644
--- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
+++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs
@@ -58,6 +58,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
58 58
59 public ISceneAgent SceneAgent { get; set; } 59 public ISceneAgent SceneAgent { get; set; }
60 60
61 public int PingTimeMS { get { return 0; } }
62
61 private string m_username; 63 private string m_username;
62 private string m_nick; 64 private string m_nick;
63 65
@@ -66,6 +68,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
66 68
67 private bool m_connected = true; 69 private bool m_connected = true;
68 70
71 public List<uint> SelectedObjects {get; private set;}
72
69 public IRCClientView(TcpClient client, Scene scene) 73 public IRCClientView(TcpClient client, Scene scene)
70 { 74 {
71 m_client = client; 75 m_client = client;
@@ -671,6 +675,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
671 public event ObjectDrop OnObjectDrop; 675 public event ObjectDrop OnObjectDrop;
672 public event StartAnim OnStartAnim; 676 public event StartAnim OnStartAnim;
673 public event StopAnim OnStopAnim; 677 public event StopAnim OnStopAnim;
678 public event ChangeAnim OnChangeAnim;
674 public event LinkObjects OnLinkObjects; 679 public event LinkObjects OnLinkObjects;
675 public event DelinkObjects OnDelinkObjects; 680 public event DelinkObjects OnDelinkObjects;
676 public event RequestMapBlocks OnRequestMapBlocks; 681 public event RequestMapBlocks OnRequestMapBlocks;
@@ -717,6 +722,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
717 public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily; 722 public event RequestObjectPropertiesFamily OnRequestObjectPropertiesFamily;
718 public event UpdatePrimFlags OnUpdatePrimFlags; 723 public event UpdatePrimFlags OnUpdatePrimFlags;
719 public event UpdatePrimTexture OnUpdatePrimTexture; 724 public event UpdatePrimTexture OnUpdatePrimTexture;
725 public event ClientChangeObject onClientChangeObject;
720 public event UpdateVector OnUpdatePrimGroupPosition; 726 public event UpdateVector OnUpdatePrimGroupPosition;
721 public event UpdateVector OnUpdatePrimSinglePosition; 727 public event UpdateVector OnUpdatePrimSinglePosition;
722 public event UpdatePrimRotation OnUpdatePrimGroupRotation; 728 public event UpdatePrimRotation OnUpdatePrimGroupRotation;
@@ -821,6 +827,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
821 public event ObjectOwner OnObjectOwner; 827 public event ObjectOwner OnObjectOwner;
822 public event DirPlacesQuery OnDirPlacesQuery; 828 public event DirPlacesQuery OnDirPlacesQuery;
823 public event DirFindQuery OnDirFindQuery; 829 public event DirFindQuery OnDirFindQuery;
830 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
824 public event DirLandQuery OnDirLandQuery; 831 public event DirLandQuery OnDirLandQuery;
825 public event DirPopularQuery OnDirPopularQuery; 832 public event DirPopularQuery OnDirPopularQuery;
826 public event DirClassifiedQuery OnDirClassifiedQuery; 833 public event DirClassifiedQuery OnDirClassifiedQuery;
@@ -837,7 +844,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
837 public event ClassifiedInfoRequest OnClassifiedInfoRequest; 844 public event ClassifiedInfoRequest OnClassifiedInfoRequest;
838 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; 845 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
839 public event ClassifiedDelete OnClassifiedDelete; 846 public event ClassifiedDelete OnClassifiedDelete;
840 public event ClassifiedDelete OnClassifiedGodDelete; 847 public event ClassifiedGodDelete OnClassifiedGodDelete;
841 public event EventNotificationAddRequest OnEventNotificationAddRequest; 848 public event EventNotificationAddRequest OnEventNotificationAddRequest;
842 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; 849 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
843 public event EventGodDelete OnEventGodDelete; 850 public event EventGodDelete OnEventGodDelete;
@@ -867,10 +874,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
867 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; 874 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
868 public event SimWideDeletesDelegate OnSimWideDeletes; 875 public event SimWideDeletesDelegate OnSimWideDeletes;
869 public event SendPostcard OnSendPostcard; 876 public event SendPostcard OnSendPostcard;
877 public event ChangeInventoryItemFlags OnChangeInventoryItemFlags;
870 public event MuteListEntryUpdate OnUpdateMuteListEntry; 878 public event MuteListEntryUpdate OnUpdateMuteListEntry;
871 public event MuteListEntryRemove OnRemoveMuteListEntry; 879 public event MuteListEntryRemove OnRemoveMuteListEntry;
872 public event GodlikeMessage onGodlikeMessage; 880 public event GodlikeMessage onGodlikeMessage;
873 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; 881 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
882 public event GenericCall2 OnUpdateThrottles;
874 883
875#pragma warning restore 67 884#pragma warning restore 67
876 885
@@ -888,10 +897,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
888 897
889 public void Close() 898 public void Close()
890 { 899 {
891 Close(false); 900 Close(true, false);
892 } 901 }
893 902
894 public void Close(bool force) 903 public void Close(bool sendStop, bool force)
895 { 904 {
896 Disconnect(); 905 Disconnect();
897 } 906 }
@@ -988,6 +997,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
988 997
989 } 998 }
990 999
1000 public virtual bool CanSendLayerData()
1001 {
1002 return false;
1003 }
1004
991 public void SendLayerData(float[] map) 1005 public void SendLayerData(float[] map)
992 { 1006 {
993 1007
@@ -1104,7 +1118,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1104 1118
1105 public void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId) 1119 public void SendInventoryItemCreateUpdate(InventoryItemBase Item, uint callbackId)
1106 { 1120 {
1107 1121
1122 }
1123
1124 public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId)
1125 {
1126
1108 } 1127 }
1109 1128
1110 public void SendRemoveInventoryItem(UUID itemID) 1129 public void SendRemoveInventoryItem(UUID itemID)
@@ -1127,7 +1146,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1127 1146
1128 } 1147 }
1129 1148
1130 public void SendXferPacket(ulong xferID, uint packet, byte[] data) 1149 public void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory)
1131 { 1150 {
1132 1151
1133 } 1152 }
@@ -1356,6 +1375,10 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1356 1375
1357 } 1376 }
1358 1377
1378 public void SendFindAgent(UUID HunterID, UUID PreyID, double GlobalX, double GlobalY)
1379 {
1380 }
1381
1359 public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) 1382 public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
1360 { 1383 {
1361 1384
@@ -1421,6 +1444,16 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1421 1444
1422 } 1445 }
1423 1446
1447 public virtual void SetChildAgentThrottle(byte[] throttle,float factor)
1448 {
1449
1450 }
1451
1452 public void SetAgentThrottleSilent(int throttle, int setting)
1453 {
1454
1455
1456 }
1424 public byte[] GetThrottlesPacked(float multiplier) 1457 public byte[] GetThrottlesPacked(float multiplier)
1425 { 1458 {
1426 return new byte[0]; 1459 return new byte[0];
@@ -1544,7 +1577,12 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1544 1577
1545 public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data) 1578 public void SendAvatarGroupsReply(UUID avatarID, GroupMembershipData[] data)
1546 { 1579 {
1547 1580
1581 }
1582
1583 public void SendAgentGroupDataUpdate(UUID avatarID, GroupMembershipData[] data)
1584 {
1585
1548 } 1586 }
1549 1587
1550 public void SendOfferCallingCard(UUID srcID, UUID transactionID) 1588 public void SendOfferCallingCard(UUID srcID, UUID transactionID)
@@ -1687,5 +1725,13 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
1687 { 1725 {
1688 } 1726 }
1689 1727
1728 public void SendPartFullUpdate(ISceneEntity ent, uint? parentID)
1729 {
1730 }
1731
1732 public int GetAgentThrottleSilent(int throttle)
1733 {
1734 return 0;
1735 }
1690 } 1736 }
1691} 1737}
diff --git a/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs b/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs
index 84211a9..5c45e4d 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs
@@ -42,6 +42,7 @@ using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes; 42using OpenSim.Region.Framework.Scenes;
43using OpenSim.Region.Framework.Scenes.Animation; 43using OpenSim.Region.Framework.Scenes.Animation;
44using OpenSim.Services.Interfaces; 44using OpenSim.Services.Interfaces;
45using AnimationSet = OpenSim.Region.Framework.Scenes.Animation.AnimationSet;
45 46
46namespace OpenSim.Region.OptionalModules.Avatar.Animations 47namespace OpenSim.Region.OptionalModules.Avatar.Animations
47{ 48{
@@ -197,4 +198,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations
197 sb.Append("\n"); 198 sb.Append("\n");
198 } 199 }
199 } 200 }
200} \ No newline at end of file 201}
diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
index 535bf67..c53a762 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs
@@ -184,7 +184,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
184 hostPart.ParentGroup.RootPart.ScheduleFullUpdate(); 184 hostPart.ParentGroup.RootPart.ScheduleFullUpdate();
185 } 185 }
186 186
187 return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, true) ? 1 : 0; 187 return attachmentsModule.AttachObject(target, hostPart.ParentGroup, (uint)attachmentPoint, false, false, false, true) ? 1 : 0;
188 } 188 }
189 } 189 }
190} 190}
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
index b5d9fda..73215cb 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
48 private static readonly ILog m_log = 48 private static readonly ILog m_log =
49 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50 50
51 private static Regex arg = new Regex(@"\[[^\[\]]*\]"); 51 private static Regex arg = new Regex(@"(?<!\\)\[[^\[\]]*(?<!\\)\]");
52 private static int _idk_ = 0; 52 private static int _idk_ = 0;
53 private static int DEBUG_CHANNEL = 2147483647; 53 private static int DEBUG_CHANNEL = 2147483647;
54 54
@@ -499,6 +499,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
499 // m_log.DebugFormat("[IRC-Channel] Parse[2]: {0}", result); 499 // m_log.DebugFormat("[IRC-Channel] Parse[2]: {0}", result);
500 } 500 }
501 501
502 // Now we unescape the literal brackets
503 result = result.Replace(@"\[","[").Replace(@"\]","]");
504
502 // m_log.DebugFormat("[IRC-Channel] Parse[3]: {0}", result); 505 // m_log.DebugFormat("[IRC-Channel] Parse[3]: {0}", result);
503 return result; 506 return result;
504 507
diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs
index 6985371..5b9a5b5 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs
@@ -368,11 +368,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
368 m_writer.Flush(); 368 m_writer.Flush();
369 m_writer.WriteLine(m_user); 369 m_writer.WriteLine(m_user);
370 m_writer.Flush(); 370 m_writer.Flush();
371 m_writer.WriteLine(String.Format("JOIN {0}", m_ircChannel));
372 m_writer.Flush();
373
374 m_log.InfoFormat("[IRC-Connector-{0}]: {1} has asked to join {2}", idn, m_nick, m_ircChannel);
375
376 } 371 }
377 catch (Exception e) 372 catch (Exception e)
378 { 373 {
@@ -521,7 +516,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
521 c.Message = data["msg"]; 516 c.Message = data["msg"];
522 c.Type = ChatTypeEnum.Region; 517 c.Type = ChatTypeEnum.Region;
523 c.Position = CenterOfRegion; 518 c.Position = CenterOfRegion;
524 c.From = data["nick"]; 519 c.From = data["nick"] + "@IRC";
525 c.Sender = null; 520 c.Sender = null;
526 c.SenderUUID = UUID.Zero; 521 c.SenderUUID = UUID.Zero;
527 522
@@ -659,6 +654,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
659 version = commArgs[2]; 654 version = commArgs[2];
660 usermod = commArgs[3]; 655 usermod = commArgs[3];
661 chanmod = commArgs[4]; 656 chanmod = commArgs[4];
657
658 m_writer.WriteLine(String.Format("JOIN {0}", m_ircChannel));
659 m_writer.Flush();
660 m_log.InfoFormat("[IRC-Connector-{0}]: sent request to join {1} ", idn, m_ircChannel);
661
662 break; 662 break;
663 case "005": // Server information 663 case "005": // Server information
664 break; 664 break;
@@ -721,11 +721,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
721 case "PONG": 721 case "PONG":
722 break; 722 break;
723 case "JOIN": 723 case "JOIN":
724 if (m_pending) 724
725 {
726 m_log.InfoFormat("[IRC-Connector-{0}] [{1}] Connected", idn, cmd);
727 m_pending = false;
728 }
729 m_log.DebugFormat("[IRC-Connector-{0}] [{1}] parms = <{2}>", idn, cmd, parms); 725 m_log.DebugFormat("[IRC-Connector-{0}] [{1}] parms = <{2}>", idn, cmd, parms);
730 eventIrcJoin(pfx, cmd, parms); 726 eventIrcJoin(pfx, cmd, parms);
731 break; 727 break;
@@ -767,7 +763,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat
767 if (IrcChannel.StartsWith(":")) 763 if (IrcChannel.StartsWith(":"))
768 IrcChannel = IrcChannel.Substring(1); 764 IrcChannel = IrcChannel.Substring(1);
769 765
770 m_log.DebugFormat("[IRC-Connector-{0}] Event: IRCJoin {1}:{2}", idn, m_server, m_ircChannel); 766 if(IrcChannel == m_ircChannel)
767 {
768 m_log.InfoFormat("[IRC-Connector-{0}] Joined requested channel {1} at {2}", idn, IrcChannel,m_server);
769 m_pending = false;
770 }
771 else
772 m_log.InfoFormat("[IRC-Connector-{0}] Joined unknown channel {1} at {2}", idn, IrcChannel,m_server);
771 BroadcastSim(IrcUser, "/me joins {0}", IrcChannel); 773 BroadcastSim(IrcUser, "/me joins {0}", IrcChannel);
772 } 774 }
773 775
diff --git a/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs
index 4e84364..026ceca 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs
@@ -107,7 +107,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
107 m_scene.AddCommand( 107 m_scene.AddCommand(
108 "Friends", this, "friends show", 108 "Friends", this, "friends show",
109 "friends show [--cache] <first-name> <last-name>", 109 "friends show [--cache] <first-name> <last-name>",
110 "Show the friends for the given user if they exist.\n", 110 "Show the friends for the given user if they exist.",
111 "The --cache option will show locally cached information for that user.", 111 "The --cache option will show locally cached information for that user.",
112 HandleFriendsShowCommand); 112 HandleFriendsShowCommand);
113 } 113 }
@@ -197,4 +197,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
197 } 197 }
198 } 198 }
199 } 199 }
200} \ No newline at end of file 200}
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 45af212..3db0781 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -575,7 +575,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
575 575
576 public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request) 576 public Hashtable FreeSwitchSLVoiceGetPreloginHTTPHandler(Hashtable request)
577 { 577 {
578 m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceGetPreloginHTTPHandler called"); 578// m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceGetPreloginHTTPHandler called");
579 579
580 Hashtable response = new Hashtable(); 580 Hashtable response = new Hashtable();
581 response["content_type"] = "text/xml"; 581 response["content_type"] = "text/xml";
@@ -726,7 +726,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
726 726
727 public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request) 727 public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request)
728 { 728 {
729 m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceSigninHTTPHandler called"); 729 //m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceSigninHTTPHandler called");
730// string requestbody = (string)request["body"]; 730// string requestbody = (string)request["body"];
731// string uri = (string)request["uri"]; 731// string uri = (string)request["uri"];
732// string contenttype = (string)request["content-type"]; 732// string contenttype = (string)request["content-type"];
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
index dd44564..f51527e 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs
@@ -121,6 +121,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
121 121
122 public void Initialise(IConfigSource config) 122 public void Initialise(IConfigSource config)
123 { 123 {
124 MainConsole.Instance.Commands.AddCommand("vivox", false, "vivox debug", "vivox debug <on>|<off>", "Set vivox debugging", HandleDebug);
124 125
125 m_config = config.Configs["VivoxVoice"]; 126 m_config = config.Configs["VivoxVoice"];
126 127
@@ -196,7 +197,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
196 break; 197 break;
197 } 198 }
198 199
199 m_vivoxVoiceAccountApi = String.Format("http://{0}/api2", m_vivoxServer); 200 m_vivoxVoiceAccountApi = String.Format("https://{0}/api2", m_vivoxServer);
200 201
201 // Admin interface required values 202 // Admin interface required values
202 if (String.IsNullOrEmpty(m_vivoxServer) || 203 if (String.IsNullOrEmpty(m_vivoxServer) ||
@@ -475,8 +476,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
475 avatarName = avatar.Name; 476 avatarName = avatar.Name;
476 477
477 m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: scene = {0}, agentID = {1}", scene, agentID); 478 m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: scene = {0}, agentID = {1}", scene, agentID);
478 m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}", 479// m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: request: {0}, path: {1}, param: {2}",
479 request, path, param); 480// request, path, param);
480 481
481 XmlElement resp; 482 XmlElement resp;
482 bool retry = false; 483 bool retry = false;
@@ -583,7 +584,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
583 584
584 string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse); 585 string r = LLSDHelpers.SerialiseLLSDReply(voiceAccountResponse);
585 586
586 m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: avatar \"{0}\": {1}", avatarName, r); 587// m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: avatar \"{0}\": {1}", avatarName, r);
587 588
588 return r; 589 return r;
589 } 590 }
@@ -630,24 +631,28 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
630 // voice, if all do retrieve or obtain the parcel 631 // voice, if all do retrieve or obtain the parcel
631 // voice channel 632 // voice channel
632 LandData land = scene.GetLandData(avatar.AbsolutePosition); 633 LandData land = scene.GetLandData(avatar.AbsolutePosition);
634 if (land == null)
635 {
636 return "<llsd><undef /></llsd>";
637 }
633 638
634 m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}", 639// m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": request: {4}, path: {5}, param: {6}",
635 scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param); 640// scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, request, path, param);
636 // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: avatar \"{0}\": location: {1} {2} {3}", 641 // m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: avatar \"{0}\": location: {1} {2} {3}",
637 // avatarName, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z); 642 // avatarName, avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z);
638 643
639 // TODO: EstateSettings don't seem to get propagated... 644 // TODO: EstateSettings don't seem to get propagated...
640 if (!scene.RegionInfo.EstateSettings.AllowVoice) 645 if (!scene.RegionInfo.EstateSettings.AllowVoice)
641 { 646 {
642 m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": voice not enabled in estate settings", 647 //m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": voice not enabled in estate settings",
643 scene.RegionInfo.RegionName); 648 // scene.RegionInfo.RegionName);
644 channel_uri = String.Empty; 649 channel_uri = String.Empty;
645 } 650 }
646 651
647 if ((land.Flags & (uint)ParcelFlags.AllowVoiceChat) == 0) 652 if ((land.Flags & (uint)ParcelFlags.AllowVoiceChat) == 0)
648 { 653 {
649 m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": voice not enabled for parcel", 654 //m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": voice not enabled for parcel",
650 scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName); 655 // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName);
651 channel_uri = String.Empty; 656 channel_uri = String.Empty;
652 } 657 }
653 else 658 else
@@ -662,8 +667,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
662 parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); 667 parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds);
663 string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); 668 string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo);
664 669
665 m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", 670// m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}",
666 scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); 671// scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r);
667 return r; 672 return r;
668 } 673 }
669 catch (Exception e) 674 catch (Exception e)
@@ -690,11 +695,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
690 public string ChatSessionRequest(Scene scene, string request, string path, string param, 695 public string ChatSessionRequest(Scene scene, string request, string path, string param,
691 UUID agentID, Caps caps) 696 UUID agentID, Caps caps)
692 { 697 {
693 ScenePresence avatar = scene.GetScenePresence(agentID); 698// ScenePresence avatar = scene.GetScenePresence(agentID);
694 string avatarName = avatar.Name; 699// string avatarName = avatar.Name;
695 700
696 m_log.DebugFormat("[VivoxVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", 701// m_log.DebugFormat("[VivoxVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}",
697 avatarName, request, path, param); 702// avatarName, request, path, param);
698 return "<llsd>true</llsd>"; 703 return "<llsd>true</llsd>";
699 } 704 }
700 705
@@ -744,7 +749,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
744 return channelUri; 749 return channelUri;
745 } 750 }
746 751
747 private static readonly string m_vivoxLoginPath = "http://{0}/api2/viv_signin.php?userid={1}&pwd={2}"; 752
753 private static readonly string m_vivoxLoginPath = "https://{0}/api2/viv_signin.php?userid={1}&pwd={2}";
748 754
749 /// <summary> 755 /// <summary>
750 /// Perform administrative login for Vivox. 756 /// Perform administrative login for Vivox.
@@ -756,7 +762,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
756 return VivoxCall(requrl, false); 762 return VivoxCall(requrl, false);
757 } 763 }
758 764
759 private static readonly string m_vivoxLogoutPath = "http://{0}/api2/viv_signout.php?auth_token={1}"; 765 private static readonly string m_vivoxLogoutPath = "https://{0}/api2/viv_signout.php?auth_token={1}";
760 766
761 /// <summary> 767 /// <summary>
762 /// Perform administrative logout for Vivox. 768 /// Perform administrative logout for Vivox.
@@ -767,7 +773,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
767 return VivoxCall(requrl, false); 773 return VivoxCall(requrl, false);
768 } 774 }
769 775
770 private static readonly string m_vivoxGetAccountPath = "http://{0}/api2/viv_get_acct.php?auth_token={1}&user_name={2}"; 776
777 private static readonly string m_vivoxGetAccountPath = "https://{0}/api2/viv_get_acct.php?auth_token={1}&user_name={2}";
771 778
772 /// <summary> 779 /// <summary>
773 /// Retrieve account information for the specified user. 780 /// Retrieve account information for the specified user.
@@ -779,7 +786,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
779 return VivoxCall(requrl, true); 786 return VivoxCall(requrl, true);
780 } 787 }
781 788
782 private static readonly string m_vivoxNewAccountPath = "http://{0}/api2/viv_adm_acct_new.php?username={1}&pwd={2}&auth_token={3}"; 789
790 private static readonly string m_vivoxNewAccountPath = "https://{0}/api2/viv_adm_acct_new.php?username={1}&pwd={2}&auth_token={3}";
783 791
784 /// <summary> 792 /// <summary>
785 /// Creates a new account. 793 /// Creates a new account.
@@ -793,7 +801,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
793 return VivoxCall(requrl, true); 801 return VivoxCall(requrl, true);
794 } 802 }
795 803
796 private static readonly string m_vivoxPasswordPath = "http://{0}/api2/viv_adm_password.php?user_name={1}&new_pwd={2}&auth_token={3}"; 804
805 private static readonly string m_vivoxPasswordPath = "https://{0}/api2/viv_adm_password.php?user_name={1}&new_pwd={2}&auth_token={3}";
797 806
798 /// <summary> 807 /// <summary>
799 /// Change the user's password. 808 /// Change the user's password.
@@ -804,7 +813,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
804 return VivoxCall(requrl, true); 813 return VivoxCall(requrl, true);
805 } 814 }
806 815
807 private static readonly string m_vivoxChannelPath = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_name={2}&auth_token={3}"; 816
817 private static readonly string m_vivoxChannelPath = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_name={2}&auth_token={3}";
808 818
809 /// <summary> 819 /// <summary>
810 /// Create a channel. 820 /// Create a channel.
@@ -876,7 +886,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
876 return false; 886 return false;
877 } 887 }
878 888
879 private static readonly string m_vivoxChannelSearchPath = "http://{0}/api2/viv_chan_search.php?cond_channame={1}&auth_token={2}"; 889 private static readonly string m_vivoxChannelSearchPath = "https://{0}/api2/viv_chan_search.php?cond_channame={1}&auth_token={2}";
880 890
881 /// <summary> 891 /// <summary>
882 /// Retrieve a channel. 892 /// Retrieve a channel.
@@ -1019,7 +1029,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1019 return false; 1029 return false;
1020 } 1030 }
1021 1031
1022 // private static readonly string m_vivoxChannelById = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; 1032 // private static readonly string m_vivoxChannelById = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}";
1023 1033
1024 // private XmlElement VivoxGetChannelById(string parent, string channelid) 1034 // private XmlElement VivoxGetChannelById(string parent, string channelid)
1025 // { 1035 // {
@@ -1031,7 +1041,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1031 // return VivoxCall(requrl, true); 1041 // return VivoxCall(requrl, true);
1032 // } 1042 // }
1033 1043
1034 private static readonly string m_vivoxChannelDel = "http://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; 1044 private static readonly string m_vivoxChannelDel = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}";
1035 1045
1036 /// <summary> 1046 /// <summary>
1037 /// Delete a channel. 1047 /// Delete a channel.
@@ -1044,6 +1054,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1044 /// are required in a later phase. 1054 /// are required in a later phase.
1045 /// In this case the call handles parent and description as optional values. 1055 /// In this case the call handles parent and description as optional values.
1046 /// </summary> 1056 /// </summary>
1057
1047 private XmlElement VivoxDeleteChannel(string parent, string channelid) 1058 private XmlElement VivoxDeleteChannel(string parent, string channelid)
1048 { 1059 {
1049 string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); 1060 string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken);
@@ -1054,11 +1065,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1054 return VivoxCall(requrl, true); 1065 return VivoxCall(requrl, true);
1055 } 1066 }
1056 1067
1057 private static readonly string m_vivoxChannelSearch = "http://{0}/api2/viv_chan_search.php?&cond_chanparent={1}&auth_token={2}"; 1068 private static readonly string m_vivoxChannelSearch = "https://{0}/api2/viv_chan_search.php?&cond_chanparent={1}&auth_token={2}";
1058 1069
1059 /// <summary> 1070 /// <summary>
1060 /// Return information on channels in the given directory 1071 /// Return information on channels in the given directory
1061 /// </summary> 1072 /// </summary>
1073
1062 private XmlElement VivoxListChildren(string channelid) 1074 private XmlElement VivoxListChildren(string channelid)
1063 { 1075 {
1064 string requrl = String.Format(m_vivoxChannelSearch, m_vivoxServer, channelid, m_authToken); 1076 string requrl = String.Format(m_vivoxChannelSearch, m_vivoxServer, channelid, m_authToken);
@@ -1124,7 +1136,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1124 try 1136 try
1125 { 1137 {
1126 // Otherwise prepare the request 1138 // Otherwise prepare the request
1127 m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl); 1139 //m_log.DebugFormat("[VivoxVoice] Sending request <{0}>", requrl);
1128 1140
1129 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl); 1141 HttpWebRequest req = (HttpWebRequest)WebRequest.Create(requrl);
1130 1142
@@ -1324,5 +1336,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice
1324 result = String.Empty; 1336 result = String.Empty;
1325 return false; 1337 return false;
1326 } 1338 }
1339
1340 private void HandleDebug(string module, string[] cmd)
1341 {
1342 if (cmd.Length < 3)
1343 {
1344 MainConsole.Instance.Output("Error: missing on/off flag");
1345 return;
1346 }
1347
1348 if (cmd[2] == "on")
1349 m_dumpXml = true;
1350 else if (cmd[2] == "off")
1351 m_dumpXml = false;
1352 else
1353 MainConsole.Instance.Output("Error: only on and off are supported");
1354 }
1327 } 1355 }
1328} 1356}
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
index 1565da9..8d587b9 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs
@@ -79,7 +79,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
79 private IMessageTransferModule m_msgTransferModule; 79 private IMessageTransferModule m_msgTransferModule;
80 80
81 private IGroupsMessagingModule m_groupsMessagingModule; 81 private IGroupsMessagingModule m_groupsMessagingModule;
82 82
83 private IGroupsServicesConnector m_groupData; 83 private IGroupsServicesConnector m_groupData;
84 84
85 // Configuration settings 85 // Configuration settings
@@ -205,10 +205,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
205 } 205 }
206 206
207 scene.EventManager.OnNewClient += OnNewClient; 207 scene.EventManager.OnNewClient += OnNewClient;
208 scene.EventManager.OnMakeRootAgent += OnMakeRoot;
209 scene.EventManager.OnMakeChildAgent += OnMakeChild;
208 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage; 210 scene.EventManager.OnIncomingInstantMessage += OnGridInstantMessage;
209 // The InstantMessageModule itself doesn't do this, 211 scene.EventManager.OnClientClosed += OnClientClosed;
210 // so lets see if things explode if we don't do it
211 // scene.EventManager.OnClientClosed += OnClientClosed;
212 212
213 } 213 }
214 214
@@ -233,7 +233,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
233 if (m_debugEnabled) m_log.Debug("[GROUPS]: Shutting down Groups module."); 233 if (m_debugEnabled) m_log.Debug("[GROUPS]: Shutting down Groups module.");
234 } 234 }
235 235
236 public Type ReplaceableInterface 236 public Type ReplaceableInterface
237 { 237 {
238 get { return null; } 238 get { return null; }
239 } 239 }
@@ -255,84 +255,121 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
255 #endregion 255 #endregion
256 256
257 #region EventHandlers 257 #region EventHandlers
258
259 private void OnMakeRoot(ScenePresence sp)
260 {
261 if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
262
263 sp.ControllingClient.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
264 // Used for Notices and Group Invites/Accept/Reject
265 sp.ControllingClient.OnInstantMessage += OnInstantMessage;
266
267 // comented out because some viewers no longer suport it
268 // sp.ControllingClient.AddGenericPacketHandler("avatargroupsrequest", AvatarGroupsRequest);
269
270 // we should send a DataUpdate here for compatibility,
271 // but this is a bad place and a bad thread to do it
272 // also current viewers do ignore it and ask later on a much nicer thread
273 }
274
275 private void OnMakeChild(ScenePresence sp)
276 {
277 if (m_debugEnabled) m_log.DebugFormat("[Groups]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
278
279 sp.ControllingClient.OnUUIDGroupNameRequest -= HandleUUIDGroupNameRequest;
280 sp.ControllingClient.OnInstantMessage -= OnInstantMessage;
281 }
282
258 private void OnNewClient(IClientAPI client) 283 private void OnNewClient(IClientAPI client)
259 { 284 {
260 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 285 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
261 286
262 client.OnUUIDGroupNameRequest += HandleUUIDGroupNameRequest;
263 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest; 287 client.OnAgentDataUpdateRequest += OnAgentDataUpdateRequest;
264 client.OnRequestAvatarProperties += OnRequestAvatarProperties; 288 client.OnRequestAvatarProperties += OnRequestAvatarProperties;
265 289
266 // Used for Notices and Group Invites/Accept/Reject
267 client.OnInstantMessage += OnInstantMessage;
268 290
269 // Send client their groups information.
270 SendAgentGroupDataUpdate(client, client.AgentId);
271 } 291 }
272 292
293/* this should be the right message to ask for other avatars groups
294
295 private void AvatarGroupsRequest(Object sender, string method, List<String> args)
296 {
297 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
298
299 if (!(sender is IClientAPI))
300 return;
301
302 IClientAPI remoteClient = (IClientAPI)sender;
303
304 UUID avatarID;
305 UUID.TryParse(args[0], out avatarID);
306
307 if (avatarID != UUID.Zero)
308 {
309 GroupMembershipData[] avatarGroups = GetProfileListedGroupMemberships(remoteClient, avatarID);
310 remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups);
311 }
312 }
313*/
314
315 // this should not be used to send groups memberships, but some viewers do expect it
316 // it does send unnecessary memberships, when viewers just want other properties information
273 private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID) 317 private void OnRequestAvatarProperties(IClientAPI remoteClient, UUID avatarID)
274 { 318 {
275 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 319 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
276 320
277 //GroupMembershipData[] avatarGroups = m_groupData.GetAgentGroupMemberships(GetRequestingAgentID(remoteClient), avatarID).ToArray();
278 GroupMembershipData[] avatarGroups = GetProfileListedGroupMemberships(remoteClient, avatarID); 321 GroupMembershipData[] avatarGroups = GetProfileListedGroupMemberships(remoteClient, avatarID);
279 remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups); 322 remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups);
280 } 323 }
281 324
282 /* 325
283 * This becomes very problematic in a shared module. In a shared module you may have more then one 326 private void OnClientClosed(UUID AgentId, Scene scene)
284 * reference to IClientAPI's, one for 0 or 1 root connections, and 0 or more child connections.
285 * The OnClientClosed event does not provide anything to indicate which one of those should be closed
286 * nor does it provide what scene it was from so that the specific reference can be looked up.
287 * The InstantMessageModule.cs does not currently worry about unregistering the handles,
288 * and it should be an issue, since it's the client that references us not the other way around
289 * , so as long as we don't keep a reference to the client laying around, the client can still be GC'ed
290 private void OnClientClosed(UUID AgentId)
291 { 327 {
292 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 328 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
329 if (scene == null)
330 return;
293 331
294 lock (m_ActiveClients) 332 ScenePresence sp = scene.GetScenePresence(AgentId);
333 IClientAPI client = sp.ControllingClient;
334 if (client != null)
295 { 335 {
296 if (m_ActiveClients.ContainsKey(AgentId)) 336 client.OnAgentDataUpdateRequest -= OnAgentDataUpdateRequest;
337 client.OnRequestAvatarProperties -= OnRequestAvatarProperties;
338 // make child possible not called?
339 client.OnUUIDGroupNameRequest -= HandleUUIDGroupNameRequest;
340 client.OnInstantMessage -= OnInstantMessage;
341 }
342
343/*
344 lock (m_ActiveClients)
297 { 345 {
298 IClientAPI client = m_ActiveClients[AgentId]; 346 if (m_ActiveClients.ContainsKey(AgentId))
299 client.OnUUIDGroupNameRequest -= HandleUUIDGroupNameRequest; 347 {
300 client.OnAgentDataUpdateRequest -= OnAgentDataUpdateRequest; 348 IClientAPI client = m_ActiveClients[AgentId];
301 client.OnDirFindQuery -= OnDirFindQuery; 349 client.OnUUIDGroupNameRequest -= HandleUUIDGroupNameRequest;
302 client.OnInstantMessage -= OnInstantMessage; 350 client.OnAgentDataUpdateRequest -= OnAgentDataUpdateRequest;
351 client.OnDirFindQuery -= OnDirFindQuery;
352 client.OnInstantMessage -= OnInstantMessage;
303 353
304 m_ActiveClients.Remove(AgentId); 354 m_ActiveClients.Remove(AgentId);
305 } 355 }
306 else 356 else
307 { 357 {
308 if (m_debugEnabled) m_log.WarnFormat("[GROUPS]: Client closed that wasn't registered here."); 358 if (m_debugEnabled) m_log.WarnFormat("[GROUPS]: Client closed that wasn't registered here.");
359 }
309 } 360 }
310 361*/
311
312 }
313 } 362 }
314 */
315 363
316 private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID) 364 private void OnAgentDataUpdateRequest(IClientAPI remoteClient, UUID dataForAgentID, UUID sessionID)
317 { 365 {
318 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 366 // this a private message for own agent only
319 367 if (dataForAgentID != GetRequestingAgentID(remoteClient))
320 UUID activeGroupID = UUID.Zero; 368 return;
321 string activeGroupTitle = string.Empty;
322 string activeGroupName = string.Empty;
323 ulong activeGroupPowers = (ulong)GroupPowers.None;
324
325 GroupMembershipData membership = m_groupData.GetAgentActiveMembership(GetRequestingAgentID(remoteClient), dataForAgentID);
326 if (membership != null)
327 {
328 activeGroupID = membership.GroupID;
329 activeGroupTitle = membership.GroupTitle;
330 activeGroupPowers = membership.GroupPowers;
331 }
332
333 SendAgentDataUpdate(remoteClient, dataForAgentID, activeGroupID, activeGroupName, activeGroupPowers, activeGroupTitle);
334 369
335 SendScenePresenceUpdate(dataForAgentID, activeGroupTitle); 370 SendAgentGroupDataUpdate(remoteClient, false);
371 // its a info request not a change, so nothing is sent to others
372 // they do get the group title with the avatar object update on arrivel to a region
336 } 373 }
337 374
338 private void HandleUUIDGroupNameRequest(UUID GroupID, IClientAPI remoteClient) 375 private void HandleUUIDGroupNameRequest(UUID GroupID, IClientAPI remoteClient)
@@ -403,7 +440,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
403 440
404 OutgoingInstantMessage(msg, inviteInfo.AgentID); 441 OutgoingInstantMessage(msg, inviteInfo.AgentID);
405 442
406 UpdateAllClientsWithGroupInfo(inviteInfo.AgentID); 443 IClientAPI client = GetActiveClient(inviteInfo.AgentID);
444 if (client != null)
445 SendDataUpdate(remoteClient, true);
407 446
408 // TODO: If the inviter is still online, they need an agent dataupdate 447 // TODO: If the inviter is still online, they need an agent dataupdate
409 // and maybe group membership updates for the invitee 448 // and maybe group membership updates for the invitee
@@ -656,13 +695,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
656 { 695 {
657 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 696 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
658 697
659 m_groupData.SetAgentActiveGroup(GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID); 698 UUID agentID = GetRequestingAgentID(remoteClient);
699 m_groupData.SetAgentActiveGroup(agentID, agentID, groupID);
660 700
661 // Changing active group changes title, active powers, all kinds of things 701 // llClientView does this
662 // anyone who is in any region that can see this client, should probably be 702 SendAgentGroupDataUpdate(remoteClient, true);
663 // updated with new group info. At a minimum, they should get ScenePresence
664 // updated with new title.
665 UpdateAllClientsWithGroupInfo(GetRequestingAgentID(remoteClient));
666 } 703 }
667 704
668 /// <summary> 705 /// <summary>
@@ -672,7 +709,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
672 { 709 {
673 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 710 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
674 711
675
676 List<GroupRolesData> agentRoles = m_groupData.GetAgentGroupRoles(GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID); 712 List<GroupRolesData> agentRoles = m_groupData.GetAgentGroupRoles(GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID);
677 GroupMembershipData agentMembership = m_groupData.GetAgentGroupMembership(GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID); 713 GroupMembershipData agentMembership = m_groupData.GetAgentGroupMembership(GetRequestingAgentID(remoteClient), GetRequestingAgentID(remoteClient), groupID);
678 714
@@ -710,7 +746,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
710 } 746 }
711 747
712 return data; 748 return data;
713
714 } 749 }
715 750
716 public List<GroupRolesData> GroupRoleDataRequest(IClientAPI remoteClient, UUID groupID) 751 public List<GroupRolesData> GroupRoleDataRequest(IClientAPI remoteClient, UUID groupID)
@@ -848,7 +883,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
848 remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly"); 883 remoteClient.SendCreateGroupReply(groupID, true, "Group created successfullly");
849 884
850 // Update the founder with new group information. 885 // Update the founder with new group information.
851 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient)); 886 SendAgentGroupDataUpdate(remoteClient, false);
852 887
853 return groupID; 888 return groupID;
854 } 889 }
@@ -889,10 +924,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
889 // TODO: Not sure what all is needed here, but if the active group role change is for the group 924 // TODO: Not sure what all is needed here, but if the active group role change is for the group
890 // the client currently has set active, then we need to do a scene presence update too 925 // the client currently has set active, then we need to do a scene presence update too
891 // if (m_groupData.GetAgentActiveMembership(GetRequestingAgentID(remoteClient)).GroupID == GroupID) 926 // if (m_groupData.GetAgentActiveMembership(GetRequestingAgentID(remoteClient)).GroupID == GroupID)
892
893 UpdateAllClientsWithGroupInfo(GetRequestingAgentID(remoteClient));
894 }
895 927
928 SendDataUpdate(remoteClient, true);
929 }
896 930
897 public void GroupRoleUpdate(IClientAPI remoteClient, UUID groupID, UUID roleID, string name, string description, string title, ulong powers, byte updateType) 931 public void GroupRoleUpdate(IClientAPI remoteClient, UUID groupID, UUID roleID, string name, string description, string title, ulong powers, byte updateType)
898 { 932 {
@@ -929,7 +963,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
929 } 963 }
930 964
931 // TODO: This update really should send out updates for everyone in the role that just got changed. 965 // TODO: This update really should send out updates for everyone in the role that just got changed.
932 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient)); 966 SendAgentGroupDataUpdate(remoteClient, false);
933 } 967 }
934 968
935 public void GroupRoleChanges(IClientAPI remoteClient, UUID groupID, UUID roleID, UUID memberID, uint changes) 969 public void GroupRoleChanges(IClientAPI remoteClient, UUID groupID, UUID roleID, UUID memberID, uint changes)
@@ -955,7 +989,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
955 } 989 }
956 990
957 // TODO: This update really should send out updates for everyone in the role that just got changed. 991 // TODO: This update really should send out updates for everyone in the role that just got changed.
958 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient)); 992 SendAgentGroupDataUpdate(remoteClient, false);
959 } 993 }
960 994
961 public void GroupNoticeRequest(IClientAPI remoteClient, UUID groupNoticeID) 995 public void GroupNoticeRequest(IClientAPI remoteClient, UUID groupNoticeID)
@@ -983,7 +1017,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
983 msg.toAgentID = agentID.Guid; 1017 msg.toAgentID = agentID.Guid;
984 msg.dialog = dialog; 1018 msg.dialog = dialog;
985 msg.fromGroup = true; 1019 msg.fromGroup = true;
986 msg.offline = (byte)0; 1020 msg.offline = (byte)1; // Allow this message to be stored for offline use
987 msg.ParentEstateID = 0; 1021 msg.ParentEstateID = 0;
988 msg.Position = Vector3.Zero; 1022 msg.Position = Vector3.Zero;
989 msg.RegionID = UUID.Zero.Guid; 1023 msg.RegionID = UUID.Zero.Guid;
@@ -1035,14 +1069,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1035 return msg; 1069 return msg;
1036 } 1070 }
1037 1071
1038 public void SendAgentGroupDataUpdate(IClientAPI remoteClient)
1039 {
1040 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1041
1042 // Send agent information about his groups
1043 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient));
1044 }
1045
1046 public void JoinGroupRequest(IClientAPI remoteClient, UUID groupID) 1072 public void JoinGroupRequest(IClientAPI remoteClient, UUID groupID)
1047 { 1073 {
1048 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 1074 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
@@ -1052,8 +1078,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1052 1078
1053 remoteClient.SendJoinGroupReply(groupID, true); 1079 remoteClient.SendJoinGroupReply(groupID, true);
1054 1080
1055 // Should this send updates to everyone in the group? 1081 SendAgentGroupDataUpdate(remoteClient, true);
1056 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient));
1057 } 1082 }
1058 1083
1059 public void LeaveGroupRequest(IClientAPI remoteClient, UUID groupID) 1084 public void LeaveGroupRequest(IClientAPI remoteClient, UUID groupID)
@@ -1068,7 +1093,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1068 1093
1069 // SL sends out notifcations to the group messaging session that the person has left 1094 // SL sends out notifcations to the group messaging session that the person has left
1070 // Should this also update everyone who is in the group? 1095 // Should this also update everyone who is in the group?
1071 SendAgentGroupDataUpdate(remoteClient, GetRequestingAgentID(remoteClient)); 1096 SendAgentGroupDataUpdate(remoteClient, true);
1072 } 1097 }
1073 1098
1074 public void EjectGroupMemberRequest(IClientAPI remoteClient, UUID groupID, UUID ejecteeID) 1099 public void EjectGroupMemberRequest(IClientAPI remoteClient, UUID groupID, UUID ejecteeID)
@@ -1177,10 +1202,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1177 msg.binaryBucket = new byte[0]; 1202 msg.binaryBucket = new byte[0];
1178 OutgoingInstantMessage(msg, agentID); 1203 OutgoingInstantMessage(msg, agentID);
1179 1204
1180
1181 // SL sends out messages to everyone in the group 1205 // SL sends out messages to everyone in the group
1182 // Who all should receive updates and what should they be updated with? 1206 // Who all should receive updates and what should they be updated with?
1183 UpdateAllClientsWithGroupInfo(ejecteeID); 1207 // just tell this the group change
1208 SendAgentGroupDataUpdate(remoteClient, false);
1209 // TODO fix the rest of sends
1184 } 1210 }
1185 1211
1186 public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID) 1212 public void InviteGroupRequest(IClientAPI remoteClient, UUID groupID, UUID invitedAgentID, UUID roleID)
@@ -1303,67 +1329,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1303 return child; 1329 return child;
1304 } 1330 }
1305 1331
1306 /// <summary>
1307 /// Send 'remoteClient' the group membership 'data' for agent 'dataForAgentID'.
1308 /// </summary>
1309 private void SendGroupMembershipInfoViaCaps(IClientAPI remoteClient, UUID dataForAgentID, GroupMembershipData[] data)
1310 {
1311 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1312
1313 OSDArray AgentData = new OSDArray(1);
1314 OSDMap AgentDataMap = new OSDMap(1);
1315 AgentDataMap.Add("AgentID", OSD.FromUUID(dataForAgentID));
1316 AgentData.Add(AgentDataMap);
1317
1318 OSDArray GroupData = new OSDArray(data.Length);
1319 OSDArray NewGroupData = new OSDArray(data.Length);
1320
1321 foreach (GroupMembershipData membership in data)
1322 {
1323 if (GetRequestingAgentID(remoteClient) != dataForAgentID)
1324 {
1325 if (!membership.ListInProfile)
1326 {
1327 // If we're sending group info to remoteclient about another agent,
1328 // filter out groups the other agent doesn't want to share.
1329 continue;
1330 }
1331 }
1332
1333 OSDMap GroupDataMap = new OSDMap(6);
1334 OSDMap NewGroupDataMap = new OSDMap(1);
1335
1336 GroupDataMap.Add("GroupID", OSD.FromUUID(membership.GroupID));
1337 GroupDataMap.Add("GroupPowers", OSD.FromULong(membership.GroupPowers));
1338 GroupDataMap.Add("AcceptNotices", OSD.FromBoolean(membership.AcceptNotices));
1339 GroupDataMap.Add("GroupInsigniaID", OSD.FromUUID(membership.GroupPicture));
1340 GroupDataMap.Add("Contribution", OSD.FromInteger(membership.Contribution));
1341 GroupDataMap.Add("GroupName", OSD.FromString(membership.GroupName));
1342 NewGroupDataMap.Add("ListInProfile", OSD.FromBoolean(membership.ListInProfile));
1343
1344 GroupData.Add(GroupDataMap);
1345 NewGroupData.Add(NewGroupDataMap);
1346 }
1347
1348 OSDMap llDataStruct = new OSDMap(3);
1349 llDataStruct.Add("AgentData", AgentData);
1350 llDataStruct.Add("GroupData", GroupData);
1351 llDataStruct.Add("NewGroupData", NewGroupData);
1352
1353 if (m_debugEnabled)
1354 {
1355 m_log.InfoFormat("[GROUPS]: {0}", OSDParser.SerializeJsonString(llDataStruct));
1356 }
1357
1358 IEventQueue queue = remoteClient.Scene.RequestModuleInterface<IEventQueue>();
1359
1360 if (queue != null)
1361 {
1362 queue.Enqueue(queue.BuildEvent("AgentGroupDataUpdate", llDataStruct), GetRequestingAgentID(remoteClient));
1363 }
1364
1365 }
1366
1367 private void SendScenePresenceUpdate(UUID AgentID, string Title) 1332 private void SendScenePresenceUpdate(UUID AgentID, string Title)
1368 { 1333 {
1369 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Updating scene title for {0} with title: {1}", AgentID, Title); 1334 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Updating scene title for {0} with title: {1}", AgentID, Title);
@@ -1380,54 +1345,35 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1380 presence.Grouptitle = Title; 1345 presence.Grouptitle = Title;
1381 1346
1382 if (! presence.IsChildAgent) 1347 if (! presence.IsChildAgent)
1383 presence.SendAvatarDataToAllClients(); 1348 presence.SendAvatarDataToAllAgents();
1384 } 1349 }
1385 } 1350 }
1386 } 1351 }
1387 } 1352 }
1388 1353
1389 /// <summary> 1354 public void SendAgentGroupDataUpdate(IClientAPI remoteClient)
1390 /// Send updates to all clients who might be interested in groups data for dataForClientID
1391 /// </summary>
1392 private void UpdateAllClientsWithGroupInfo(UUID dataForClientID)
1393 { 1355 {
1394 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 1356 SendAgentGroupDataUpdate(remoteClient, true);
1395
1396 // TODO: Probably isn't nessesary to update every client in every scene.
1397 // Need to examine client updates and do only what's nessesary.
1398 lock (m_sceneList)
1399 {
1400 foreach (Scene scene in m_sceneList)
1401 {
1402 scene.ForEachClient(delegate(IClientAPI client) { SendAgentGroupDataUpdate(client, dataForClientID); });
1403 }
1404 }
1405 } 1357 }
1406 1358
1407 /// <summary> 1359 /// <summary>
1408 /// Update remoteClient with group information about dataForAgentID 1360 /// Tell remoteClient about its agent groups, and optionally send title to others
1409 /// </summary> 1361 /// </summary>
1410 private void SendAgentGroupDataUpdate(IClientAPI remoteClient, UUID dataForAgentID) 1362 private void SendAgentGroupDataUpdate(IClientAPI remoteClient, bool tellOthers)
1411 { 1363 {
1412 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called for {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name); 1364 if (m_debugEnabled) m_log.InfoFormat("[GROUPS]: {0} called for {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name);
1413 1365
1414 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff 1366 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff
1415 1367
1416 OnAgentDataUpdateRequest(remoteClient, dataForAgentID, UUID.Zero); 1368 UUID agentID = GetRequestingAgentID(remoteClient);
1417 1369
1418 // Need to send a group membership update to the client 1370 SendDataUpdate(remoteClient, tellOthers);
1419 // UDP version doesn't seem to behave nicely. But we're going to send it out here
1420 // with an empty group membership to hopefully remove groups being displayed due
1421 // to the core Groups Stub
1422 remoteClient.SendGroupMembership(new GroupMembershipData[0]);
1423 1371
1424 GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, dataForAgentID); 1372 GroupMembershipData[] membershipArray = GetProfileListedGroupMemberships(remoteClient, agentID);
1425 SendGroupMembershipInfoViaCaps(remoteClient, dataForAgentID, membershipArray); 1373 remoteClient.SendAgentGroupDataUpdate(agentID, membershipArray);
1426 remoteClient.SendAvatarGroupsReply(dataForAgentID, membershipArray);
1427 1374
1428 if (remoteClient.AgentId == dataForAgentID) 1375 remoteClient.RefreshGroupMembership();
1429 remoteClient.RefreshGroupMembership(); 1376 }
1430 }
1431 1377
1432 /// <summary> 1378 /// <summary>
1433 /// Get a list of groups memberships for the agent that are marked "ListInProfile" 1379 /// Get a list of groups memberships for the agent that are marked "ListInProfile"
@@ -1478,13 +1424,27 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1478 return membershipArray; 1424 return membershipArray;
1479 } 1425 }
1480 1426
1481 1427 //tell remoteClient about its agent group info, and optionally send title to others
1482 private void SendAgentDataUpdate(IClientAPI remoteClient, UUID dataForAgentID, UUID activeGroupID, string activeGroupName, ulong activeGroupPowers, string activeGroupTitle) 1428 private void SendDataUpdate(IClientAPI remoteClient, bool tellOthers)
1483 { 1429 {
1484 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); 1430 if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name);
1485 1431
1486 // TODO: All the client update functions need to be reexamined because most do too much and send too much stuff 1432 UUID activeGroupID = UUID.Zero;
1487 UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, dataForAgentID); 1433 string activeGroupTitle = string.Empty;
1434 string activeGroupName = string.Empty;
1435 ulong activeGroupPowers = (ulong)GroupPowers.None;
1436
1437 UUID agentID = GetRequestingAgentID(remoteClient);
1438 GroupMembershipData membership = m_groupData.GetAgentActiveMembership(agentID, agentID);
1439 if (membership != null)
1440 {
1441 activeGroupID = membership.GroupID;
1442 activeGroupTitle = membership.GroupTitle;
1443 activeGroupPowers = membership.GroupPowers;
1444 activeGroupName = membership.GroupName;
1445 }
1446
1447 UserAccount account = m_sceneList[0].UserAccountService.GetUserAccount(remoteClient.Scene.RegionInfo.ScopeID, agentID);
1488 string firstname, lastname; 1448 string firstname, lastname;
1489 if (account != null) 1449 if (account != null)
1490 { 1450 {
@@ -1497,9 +1457,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
1497 lastname = "Unknown"; 1457 lastname = "Unknown";
1498 } 1458 }
1499 1459
1500 remoteClient.SendAgentDataUpdate(dataForAgentID, activeGroupID, firstname, 1460 remoteClient.SendAgentDataUpdate(agentID, activeGroupID, firstname,
1501 lastname, activeGroupPowers, activeGroupName, 1461 lastname, activeGroupPowers, activeGroupName,
1502 activeGroupTitle); 1462 activeGroupTitle);
1463
1464 if (tellOthers)
1465 SendScenePresenceUpdate(agentID, activeGroupTitle);
1466
1467 ScenePresence sp = (ScenePresence)remoteClient.SceneAgent;
1468 if (sp != null)
1469 sp.Grouptitle = activeGroupTitle;
1503 } 1470 }
1504 1471
1505 #endregion 1472 #endregion
diff --git a/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs
index 0c3446d..4e766eb 100644
--- a/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs
+++ b/OpenSim/Region/OptionalModules/DataSnapshot/DataSnapshotManager.cs
@@ -432,7 +432,6 @@ namespace OpenSim.Region.DataSnapshot
432 m_log.Info("[DATASNAPSHOT]: data service " + url + " notified. Secret: " + m_Secret); 432 m_log.Info("[DATASNAPSHOT]: data service " + url + " notified. Secret: " + m_Secret);
433 } 433 }
434 } 434 }
435
436 } 435 }
437 #endregion 436 #endregion
438 437
diff --git a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
index 395bbf1..50a5fae 100644
--- a/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
+++ b/OpenSim/Region/OptionalModules/PrimLimitsModule/PrimLimitsModule.cs
@@ -135,30 +135,40 @@ namespace OpenSim.Region.OptionalModules
135 135
136 private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene) 136 private bool CanObjectEnter(UUID objectID, bool enteringRegion, Vector3 newPoint, Scene scene)
137 { 137 {
138 if (newPoint.X < -1f || newPoint.X > (scene.RegionInfo.RegionSizeX + 1) ||
139 newPoint.Y < -1f || newPoint.Y > (scene.RegionInfo.RegionSizeY) )
140 return true;
141
138 SceneObjectPart obj = scene.GetSceneObjectPart(objectID); 142 SceneObjectPart obj = scene.GetSceneObjectPart(objectID);
139 Vector3 oldPoint = obj.GroupPosition; 143
140 int objectCount = obj.ParentGroup.PrimCount; 144 if (obj == null)
141 ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y); 145 return false;
146
147 // Prim counts are determined by the location of the root prim. if we're
148 // moving a child prim, just let it pass
149 if (!obj.IsRoot)
150 {
151 return true;
152 }
153
142 ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y); 154 ILandObject newParcel = scene.LandChannel.GetLandObject(newPoint.X, newPoint.Y);
143 155
144 // newParcel will be null only if it outside of our current region. If this is the case, then the
145 // receiving permissions will perform the check.
146 if (newParcel == null) 156 if (newParcel == null)
147 return true; 157 return true;
148 158
149 // The prim hasn't crossed a region boundary so we don't need to worry 159 Vector3 oldPoint = obj.GroupPosition;
160 ILandObject oldParcel = scene.LandChannel.GetLandObject(oldPoint.X, oldPoint.Y);
161
162 // The prim hasn't crossed a region boundry so we don't need to worry
150 // about prim counts here 163 // about prim counts here
151 if(oldParcel.Equals(newParcel)) 164 if(oldParcel != null && oldParcel.Equals(newParcel))
152 { 165 {
153 return true; 166 return true;
154 } 167 }
155 168
156 // Prim counts are determined by the location of the root prim. if we're 169 int objectCount = obj.ParentGroup.PrimCount;
157 // moving a child prim, just let it pass 170 int usedPrims = newParcel.PrimCounts.Total;
158 if(!obj.IsRoot) 171 int simulatorCapacity = newParcel.GetSimulatorMaxPrimCount();
159 {
160 return true;
161 }
162 172
163 // TODO: Add Special Case here for temporary prims 173 // TODO: Add Special Case here for temporary prims
164 174
diff --git a/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs
index 4bf2a82..e5e76e9 100644
--- a/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs
+++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerLargeLandChannel.cs
@@ -196,6 +196,7 @@ namespace OpenSim.Region.RegionCombinerModule
196 RootRegionLandChannel.SetParcelOtherCleanTime(remoteClient, localID, otherCleanTime); 196 RootRegionLandChannel.SetParcelOtherCleanTime(remoteClient, localID, otherCleanTime);
197 } 197 }
198 198
199 public void sendClientInitialLandInfo(IClientAPI remoteClient) { }
199 #endregion 200 #endregion
200 } 201 }
201} \ No newline at end of file 202} \ No newline at end of file
diff --git a/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerPermissionModule.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerPermissionModule.cs
index 07dd68b..ddfe3e0 100644
--- a/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerPermissionModule.cs
+++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionCombinerPermissionModule.cs
@@ -105,9 +105,9 @@ namespace OpenSim.Region.RegionCombinerModule
105 return m_rootScene.Permissions.CanEditObject(objectid, editorid); 105 return m_rootScene.Permissions.CanEditObject(objectid, editorid);
106 } 106 }
107 107
108 public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene) 108 public bool CanEditParcelProperties(UUID user, ILandObject parcel, GroupPowers g, Scene scene, bool allowManager)
109 { 109 {
110 return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g); 110 return m_rootScene.Permissions.CanEditParcelProperties(user, parcel, g, allowManager);
111 } 111 }
112 112
113 public bool CanInstantMessage(UUID user, UUID target, Scene startscene) 113 public bool CanInstantMessage(UUID user, UUID target, Scene startscene)
diff --git a/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionConnections.cs b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionConnections.cs
index 62a3a91..6bf1c4a 100644
--- a/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionConnections.cs
+++ b/OpenSim/Region/OptionalModules/RegionCombinerModule/RegionConnections.cs
@@ -91,4 +91,4 @@ namespace OpenSim.Region.RegionCombinerModule
91 YEnd = (uint)extents.Y; 91 YEnd = (uint)extents.Y;
92 } 92 }
93 } 93 }
94} \ No newline at end of file 94}
diff --git a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
index edf51a2..e7d461f 100644
--- a/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/JsonStore/JsonStoreScriptModule.cs
@@ -746,8 +746,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
746 746
747 List<SceneObjectGroup> objlist; 747 List<SceneObjectGroup> objlist;
748 List<Vector3> veclist; 748 List<Vector3> veclist;
749 749
750 bool success = host.RootPart.Inventory.GetRezReadySceneObjects(item, out objlist, out veclist); 750 Vector3 bbox = new Vector3();
751 float offsetHeight;
752 bool success = host.RootPart.Inventory.GetRezReadySceneObjects(item, out objlist, out veclist, out bbox, out offsetHeight);
751 if (! success) 753 if (! success)
752 { 754 {
753 GenerateRuntimeError("Failed to create object"); 755 GenerateRuntimeError("Failed to create object");
diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
index 744d1e3..4b7295d 100644
--- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcGridRouterModule.cs
@@ -178,7 +178,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcGridRouterModule
178 { 178 {
179 if(!m_Channels.ContainsKey(itemID)) 179 if(!m_Channels.ContainsKey(itemID))
180 { 180 {
181 m_log.InfoFormat("[XMLRPC GRID ROUTER]: Attempted to unregister non-existing Item: {0}", itemID.ToString()); 181 //m_log.InfoFormat("[XMLRPC GRID ROUTER]: Attempted to unregister non-existing Item: {0}", itemID.ToString());
182 return false; 182 return false;
183 } 183 }
184 184
diff --git a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
index 943675e..32549d6 100644
--- a/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/XmlRpcRouterModule/XmlRpcRouterModule.cs
@@ -98,7 +98,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.XmlRpcRouterModule
98 98
99 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri) 99 public void RegisterNewReceiver(IScriptModule scriptEngine, UUID channel, UUID objectID, UUID itemID, string uri)
100 { 100 {
101 scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] {uri}); 101 if (m_Enabled)
102 {
103 scriptEngine.PostScriptEvent(itemID, "xmlrpc_uri", new Object[] { uri });
104 }
102 } 105 }
103 106
104 public void UnRegisterReceiver(string channelID, UUID itemID) 107 public void UnRegisterReceiver(string channelID, UUID itemID)
diff --git a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs
index bcb6361..bd5289f 100644
--- a/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/OptionalModules/UserStatistics/WebStatsModule.cs
@@ -1197,7 +1197,7 @@ VALUES
1197 m_pendingDownloads = stats.StatsBlock[17].StatValue; 1197 m_pendingDownloads = stats.StatsBlock[17].StatValue;
1198 m_pendingUploads = stats.StatsBlock[18].StatValue; 1198 m_pendingUploads = stats.StatsBlock[18].StatValue;
1199 m_activeScripts = stats.StatsBlock[19].StatValue; 1199 m_activeScripts = stats.StatsBlock[19].StatValue;
1200 m_scriptLinesPerSecond = stats.StatsBlock[20].StatValue; 1200 m_scriptLinesPerSecond = stats.ExtraStatsBlock[0].StatValue;
1201 } 1201 }
1202 } 1202 }
1203} \ No newline at end of file 1203} \ No newline at end of file
diff --git a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs
index d37369c..709a16d 100644
--- a/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs
+++ b/OpenSim/Region/OptionalModules/ViewerSupport/DynamicMenuModule.cs
@@ -131,8 +131,11 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
131 { 131 {
132 foreach (MenuItemData d in m_menuItems[UUID.Zero]) 132 foreach (MenuItemData d in m_menuItems[UUID.Zero])
133 { 133 {
134 if (d.Mode == UserMode.God && (!m_scene.Permissions.IsGod(agentID))) 134 if (!m_scene.Permissions.IsGod(agentID))
135 continue; 135 {
136 if (d.Mode == UserMode.RegionManager && (!m_scene.Permissions.IsAdministrator(agentID)))
137 continue;
138 }
136 139
137 OSDMap loc = null; 140 OSDMap loc = null;
138 switch (d.Location) 141 switch (d.Location)
diff --git a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
index 4cd5676..8565f5a 100644
--- a/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
+++ b/OpenSim/Region/OptionalModules/World/MoneyModule/SampleMoneyModule.cs
@@ -205,8 +205,9 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
205 { 205 {
206 } 206 }
207 207
208 public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount) 208 public bool ObjectGiveMoney(UUID objectID, UUID fromID, UUID toID, int amount, UUID txn, out string result)
209 { 209 {
210 result = String.Empty;
210 string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID)); 211 string description = String.Format("Object {0} pays {1}", resolveObjectName(objectID), resolveAgentName(toID));
211 212
212 bool give_result = doMoneyTransfer(fromID, toID, amount, 2, description); 213 bool give_result = doMoneyTransfer(fromID, toID, amount, 2, description);
@@ -842,6 +843,10 @@ namespace OpenSim.Region.OptionalModules.World.MoneyModule
842 if (module != null) 843 if (module != null)
843 module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice); 844 module.BuyObject(remoteClient, categoryID, localID, saleType, salePrice);
844 } 845 }
846
847 public void MoveMoney(UUID fromAgentID, UUID toAgentID, int amount, string text)
848 {
849 }
845 } 850 }
846 851
847 public enum TransactionType : int 852 public enum TransactionType : int
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index fb644b7..7228348 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -61,10 +61,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC
61 private readonly string m_firstname; 61 private readonly string m_firstname;
62 private readonly string m_lastname; 62 private readonly string m_lastname;
63 private readonly Vector3 m_startPos; 63 private readonly Vector3 m_startPos;
64 private readonly UUID m_uuid; 64 private UUID m_uuid = UUID.Random();
65 private readonly Scene m_scene; 65 private readonly Scene m_scene;
66 private readonly UUID m_ownerID; 66 private readonly UUID m_ownerID;
67 67
68 public List<uint> SelectedObjects {get; private set;}
69
68 public NPCAvatar( 70 public NPCAvatar(
69 string firstname, string lastname, Vector3 position, UUID ownerID, bool senseAsAgent, Scene scene) 71 string firstname, string lastname, Vector3 position, UUID ownerID, bool senseAsAgent, Scene scene)
70 { 72 {
@@ -94,6 +96,8 @@ namespace OpenSim.Region.OptionalModules.World.NPC
94 get { return m_scene; } 96 get { return m_scene; }
95 } 97 }
96 98
99 public int PingTimeMS { get { return 0; } }
100
97 public UUID OwnerID 101 public UUID OwnerID
98 { 102 {
99 get { return m_ownerID; } 103 get { return m_ownerID; }
@@ -187,9 +191,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
187 { 191 {
188 192
189 } 193 }
190 194
191 public void SendSitResponse(UUID TargetID, Vector3 OffsetPos, Quaternion SitOrientation, bool autopilot, 195 public void SendFindAgent(UUID HunterID, UUID PreyID, double GlobalX, double GlobalY)
192 Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook) 196 {
197
198 }
199
200 public void SendSitResponse(UUID TargetID, Vector3 OffsetPos,
201 Quaternion SitOrientation, bool autopilot,
202 Vector3 CameraAtOffset, Vector3 CameraEyeOffset, bool ForceMouseLook)
193 { 203 {
194 204
195 } 205 }
@@ -248,7 +258,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
248#pragma warning disable 67 258#pragma warning disable 67
249 public event Action<IClientAPI> OnLogout; 259 public event Action<IClientAPI> OnLogout;
250 public event ObjectPermissions OnObjectPermissions; 260 public event ObjectPermissions OnObjectPermissions;
251 261 public event MoveItemsAndLeaveCopy OnMoveItemsAndLeaveCopy;
252 public event MoneyTransferRequest OnMoneyTransferRequest; 262 public event MoneyTransferRequest OnMoneyTransferRequest;
253 public event ParcelBuy OnParcelBuy; 263 public event ParcelBuy OnParcelBuy;
254 public event Action<IClientAPI> OnConnectionClosed; 264 public event Action<IClientAPI> OnConnectionClosed;
@@ -268,6 +278,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
268 public event ObjectDrop OnObjectDrop; 278 public event ObjectDrop OnObjectDrop;
269 public event StartAnim OnStartAnim; 279 public event StartAnim OnStartAnim;
270 public event StopAnim OnStopAnim; 280 public event StopAnim OnStopAnim;
281 public event ChangeAnim OnChangeAnim;
271 public event LinkObjects OnLinkObjects; 282 public event LinkObjects OnLinkObjects;
272 public event DelinkObjects OnDelinkObjects; 283 public event DelinkObjects OnDelinkObjects;
273 public event RequestMapBlocks OnRequestMapBlocks; 284 public event RequestMapBlocks OnRequestMapBlocks;
@@ -318,6 +329,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
318 public event UpdatePrimTexture OnUpdatePrimTexture; 329 public event UpdatePrimTexture OnUpdatePrimTexture;
319 public event UpdateVector OnUpdatePrimGroupPosition; 330 public event UpdateVector OnUpdatePrimGroupPosition;
320 public event UpdateVector OnUpdatePrimSinglePosition; 331 public event UpdateVector OnUpdatePrimSinglePosition;
332 public event ClientChangeObject onClientChangeObject;
321 public event UpdatePrimRotation OnUpdatePrimGroupRotation; 333 public event UpdatePrimRotation OnUpdatePrimGroupRotation;
322 public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition; 334 public event UpdatePrimSingleRotationPosition OnUpdatePrimSingleRotationPosition;
323 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; 335 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
@@ -456,7 +468,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
456 public event ClassifiedInfoRequest OnClassifiedInfoRequest; 468 public event ClassifiedInfoRequest OnClassifiedInfoRequest;
457 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate; 469 public event ClassifiedInfoUpdate OnClassifiedInfoUpdate;
458 public event ClassifiedDelete OnClassifiedDelete; 470 public event ClassifiedDelete OnClassifiedDelete;
459 public event ClassifiedDelete OnClassifiedGodDelete; 471 public event ClassifiedGodDelete OnClassifiedGodDelete;
460 472
461 public event EventNotificationAddRequest OnEventNotificationAddRequest; 473 public event EventNotificationAddRequest OnEventNotificationAddRequest;
462 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest; 474 public event EventNotificationRemoveRequest OnEventNotificationRemoveRequest;
@@ -495,11 +507,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC
495 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest; 507 public event GroupVoteHistoryRequest OnGroupVoteHistoryRequest;
496 public event SimWideDeletesDelegate OnSimWideDeletes; 508 public event SimWideDeletesDelegate OnSimWideDeletes;
497 public event SendPostcard OnSendPostcard; 509 public event SendPostcard OnSendPostcard;
510 public event ChangeInventoryItemFlags OnChangeInventoryItemFlags;
498 public event MuteListEntryUpdate OnUpdateMuteListEntry; 511 public event MuteListEntryUpdate OnUpdateMuteListEntry;
499 public event MuteListEntryRemove OnRemoveMuteListEntry; 512 public event MuteListEntryRemove OnRemoveMuteListEntry;
500 public event GodlikeMessage onGodlikeMessage; 513 public event GodlikeMessage onGodlikeMessage;
501 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate; 514 public event GodUpdateRegionInfoUpdate OnGodUpdateRegionInfoUpdate;
502 515 public event GenericCall2 OnUpdateThrottles;
503#pragma warning restore 67 516#pragma warning restore 67
504 517
505 #endregion 518 #endregion
@@ -522,6 +535,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
522 public virtual UUID AgentId 535 public virtual UUID AgentId
523 { 536 {
524 get { return m_uuid; } 537 get { return m_uuid; }
538 set { m_uuid = value; }
525 } 539 }
526 540
527 public UUID SessionId 541 public UUID SessionId
@@ -627,6 +641,17 @@ namespace OpenSim.Region.OptionalModules.World.NPC
627 public virtual void SetChildAgentThrottle(byte[] throttle) 641 public virtual void SetChildAgentThrottle(byte[] throttle)
628 { 642 {
629 } 643 }
644
645 public virtual void SetChildAgentThrottle(byte[] throttle, float factor)
646 {
647
648 }
649
650 public void SetAgentThrottleSilent(int throttle, int setting)
651 {
652
653
654 }
630 public byte[] GetThrottlesPacked(float multiplier) 655 public byte[] GetThrottlesPacked(float multiplier)
631 { 656 {
632 return new byte[0]; 657 return new byte[0];
@@ -665,6 +690,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
665 690
666 } 691 }
667 692
693 public virtual bool CanSendLayerData()
694 {
695 return false;
696 }
697
668 public virtual void SendLayerData(float[] map) 698 public virtual void SendLayerData(float[] map)
669 { 699 {
670 } 700 }
@@ -772,6 +802,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
772 { 802 {
773 } 803 }
774 804
805 public void SendInventoryItemCreateUpdate(InventoryItemBase Item, UUID transactionID, uint callbackId)
806 {
807 }
808
775 public virtual void SendRemoveInventoryItem(UUID itemID) 809 public virtual void SendRemoveInventoryItem(UUID itemID)
776 { 810 {
777 } 811 }
@@ -788,7 +822,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
788 { 822 {
789 } 823 }
790 824
791 public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data) 825 public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data, bool isTaskInventory)
792 { 826 {
793 } 827 }
794 public virtual void SendAbortXferPacket(ulong xferID) 828 public virtual void SendAbortXferPacket(ulong xferID)
@@ -933,10 +967,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
933 967
934 public void Close() 968 public void Close()
935 { 969 {
936 Close(false); 970 Close(true, false);
937 } 971 }
938 972
939 public void Close(bool force) 973 public void Close(bool sendStop, bool force)
940 { 974 {
941 // Remove ourselves from the scene 975 // Remove ourselves from the scene
942 m_scene.RemoveClient(AgentId, false); 976 m_scene.RemoveClient(AgentId, false);
@@ -1155,6 +1189,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
1155 { 1189 {
1156 } 1190 }
1157 1191
1192 public void SendAgentGroupDataUpdate(UUID avatarID, GroupMembershipData[] data)
1193 {
1194 }
1195
1158 public void SendTerminateFriend(UUID exFriendID) 1196 public void SendTerminateFriend(UUID exFriendID)
1159 { 1197 {
1160 } 1198 }
@@ -1269,5 +1307,14 @@ namespace OpenSim.Region.OptionalModules.World.NPC
1269 { 1307 {
1270 } 1308 }
1271 1309
1310 public void SendPartFullUpdate(ISceneEntity ent, uint? parentID)
1311 {
1312 }
1313
1314 public int GetAgentThrottleSilent(int throttle)
1315 {
1316 return 0;
1317 }
1318
1272 } 1319 }
1273} 1320}
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
index 9232db9..d40fa48 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs
@@ -52,6 +52,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC
52 private Dictionary<UUID, NPCAvatar> m_avatars = 52 private Dictionary<UUID, NPCAvatar> m_avatars =
53 new Dictionary<UUID, NPCAvatar>(); 53 new Dictionary<UUID, NPCAvatar>();
54 54
55
56
57 private NPCOptionsFlags m_NPCOptionFlags;
58 public NPCOptionsFlags NPCOptionFlags {get {return m_NPCOptionFlags;}}
59
55 public bool Enabled { get; private set; } 60 public bool Enabled { get; private set; }
56 61
57 public void Initialise(IConfigSource source) 62 public void Initialise(IConfigSource source)
@@ -59,6 +64,21 @@ namespace OpenSim.Region.OptionalModules.World.NPC
59 IConfig config = source.Configs["NPC"]; 64 IConfig config = source.Configs["NPC"];
60 65
61 Enabled = (config != null && config.GetBoolean("Enabled", false)); 66 Enabled = (config != null && config.GetBoolean("Enabled", false));
67 m_NPCOptionFlags = NPCOptionsFlags.None;
68 if(Enabled)
69 {
70 if(config.GetBoolean("AllowNotOwned", true))
71 m_NPCOptionFlags |= NPCOptionsFlags.AllowNotOwned;
72
73 if(config.GetBoolean("AllowSenseAsAvatar", true))
74 m_NPCOptionFlags |= NPCOptionsFlags.AllowSenseAsAvatar;
75
76 if(config.GetBoolean("AllowCloneOtherAvatars", true))
77 m_NPCOptionFlags |= NPCOptionsFlags.AllowCloneOtherAvatars;
78
79 if(config.GetBoolean("NoNPCGroup", true))
80 m_NPCOptionFlags |= NPCOptionsFlags.NoNPCGroup;
81 }
62 } 82 }
63 83
64 public void AddRegion(Scene scene) 84 public void AddRegion(Scene scene)
@@ -167,10 +187,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC
167 npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0, 187 npcAvatar.CircuitCode = (uint)Util.RandomClass.Next(0,
168 int.MaxValue); 188 int.MaxValue);
169 189
170 m_log.DebugFormat( 190// m_log.DebugFormat(
171 "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}", 191// "[NPC MODULE]: Creating NPC {0} {1} {2}, owner={3}, senseAsAgent={4} at {5} in {6}",
172 firstname, lastname, npcAvatar.AgentId, owner, 192// firstname, lastname, npcAvatar.AgentId, owner, senseAsAgent, position, scene.RegionInfo.RegionName);
173 senseAsAgent, position, scene.RegionInfo.RegionName);
174 193
175 AgentCircuitData acd = new AgentCircuitData(); 194 AgentCircuitData acd = new AgentCircuitData();
176 acd.AgentID = npcAvatar.AgentId; 195 acd.AgentID = npcAvatar.AgentId;
@@ -192,36 +211,31 @@ namespace OpenSim.Region.OptionalModules.World.NPC
192 } 211 }
193 */ 212 */
194 213
195 lock (m_avatars) 214// ManualResetEvent ev = new ManualResetEvent(false);
196 {
197 scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode,
198 acd);
199 scene.AddNewAgent(npcAvatar, PresenceType.Npc);
200 215
201 ScenePresence sp; 216// Util.FireAndForget(delegate(object x) {
202 if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp)) 217 lock (m_avatars)
203 { 218 {
204 /* 219 scene.AuthenticateHandler.AddNewCircuit(npcAvatar.CircuitCode, acd);
205 m_log.DebugFormat( 220 scene.AddNewAgent(npcAvatar, PresenceType.Npc);
206 "[NPC MODULE]: Successfully retrieved scene presence for NPC {0} {1}",
207 sp.Name, sp.UUID);
208 */
209
210 sp.CompleteMovement(npcAvatar, false);
211 m_avatars.Add(npcAvatar.AgentId, npcAvatar);
212 m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name);
213 221
214 return npcAvatar.AgentId; 222 ScenePresence sp;
223 if (scene.TryGetScenePresence(npcAvatar.AgentId, out sp))
224 {
225
226 sp.CompleteMovement(npcAvatar, false);
227 m_avatars.Add(npcAvatar.AgentId, npcAvatar);
228// m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name);
229 }
215 } 230 }
216 else 231// ev.Set();
217 { 232// });
218 m_log.WarnFormat(
219 "[NPC MODULE]: Could not find scene presence for NPC {0} {1}",
220 sp.Name, sp.UUID);
221 233
222 return UUID.Zero; 234// ev.WaitOne();
223 } 235
224 } 236// m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId);
237
238 return npcAvatar.AgentId;
225 } 239 }
226 240
227 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos, 241 public bool MoveToTarget(UUID agentID, Scene scene, Vector3 pos,
@@ -436,9 +450,15 @@ namespace OpenSim.Region.OptionalModules.World.NPC
436 { 450 {
437 NPCAvatar av; 451 NPCAvatar av;
438 if (m_avatars.TryGetValue(npcID, out av)) 452 if (m_avatars.TryGetValue(npcID, out av))
453 {
454 if (npcID == callerID)
455 return true;
439 return CheckPermissions(av, callerID); 456 return CheckPermissions(av, callerID);
457 }
440 else 458 else
459 {
441 return false; 460 return false;
461 }
442 } 462 }
443 } 463 }
444 464
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index 77dfd40..a892cf4 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
112 // ScenePresence.SendInitialData() to reset our entire appearance. 112 // ScenePresence.SendInitialData() to reset our entire appearance.
113 m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId)); 113 m_scene.AssetService.Store(AssetHelpers.CreateNotecardAsset(originalFace8TextureId));
114 114
115 m_afMod.SetAppearance(sp, originalTe, null, null); 115 m_afMod.SetAppearance(sp, originalTe, null, new WearableCacheItem[0] );
116 116
117 UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance); 117 UUID npcId = m_npcMod.CreateNPC("John", "Smith", new Vector3(128, 128, 30), UUID.Zero, true, m_scene, sp.Appearance);
118 118
@@ -483,4 +483,4 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
483 Assert.That(npc.ParentID, Is.EqualTo(0)); 483 Assert.That(npc.ParentID, Is.EqualTo(0));
484 } 484 }
485 } 485 }
486} \ No newline at end of file 486}
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
index 0927c4f..1102aca 100644
--- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
@@ -166,7 +166,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
166 cdl.AddRow("physics", m_scene.PhysicsEnabled); 166 cdl.AddRow("physics", m_scene.PhysicsEnabled);
167 cdl.AddRow("scripting", m_scene.ScriptsEnabled); 167 cdl.AddRow("scripting", m_scene.ScriptsEnabled);
168 cdl.AddRow("teleport", m_scene.DebugTeleporting); 168 cdl.AddRow("teleport", m_scene.DebugTeleporting);
169 cdl.AddRow("update-on-timer", m_scene.UpdateOnTimer); 169// cdl.AddRow("update-on-timer", m_scene.UpdateOnTimer);
170 cdl.AddRow("updates", m_scene.DebugUpdates); 170 cdl.AddRow("updates", m_scene.DebugUpdates);
171 171
172 MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name); 172 MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name);
@@ -313,7 +313,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
313 bool enableUpdateOnTimer; 313 bool enableUpdateOnTimer;
314 if (bool.TryParse(options["update-on-timer"], out enableUpdateOnTimer)) 314 if (bool.TryParse(options["update-on-timer"], out enableUpdateOnTimer))
315 { 315 {
316 m_scene.UpdateOnTimer = enableUpdateOnTimer; 316// m_scene.UpdateOnTimer = enableUpdateOnTimer;
317 m_scene.Active = false; 317 m_scene.Active = false;
318 318
319 while (m_scene.IsRunning) 319 while (m_scene.IsRunning)
@@ -334,4 +334,4 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
334 } 334 }
335 } 335 }
336 } 336 }
337} \ No newline at end of file 337}