From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- .../Avatar/Animations/AnimationsCommandModule.cs | 28 ++--- .../Avatar/Appearance/AppearanceInfoModule.cs | 42 ++++---- .../Avatar/Attachments/AttachmentsCommandModule.cs | 20 ++-- .../Avatar/Attachments/TempAttachmentsModule.cs | 4 +- .../OptionalModules/Avatar/Chat/ChannelState.cs | 22 ++-- .../OptionalModules/Avatar/Chat/IRCConnector.cs | 16 +-- .../OptionalModules/Avatar/Chat/RegionState.cs | 4 +- .../Avatar/Concierge/ConciergeModule.cs | 40 +++---- .../Avatar/Friends/FriendsCommandsModule.cs | 16 +-- .../Avatar/SitStand/SitStandCommandsModule.cs | 22 ++-- .../Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs | 60 +++++------ .../Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs | 118 ++++++++++----------- .../Avatar/XmlRpcGroups/GroupsMessagingModule.cs | 60 +++++------ .../Avatar/XmlRpcGroups/GroupsModule.cs | 48 ++++----- .../XmlRpcGroups/IGroupsServicesConnector.cs | 4 +- .../SimianGroupsServicesConnectorModule.cs | 94 ++++++++-------- .../Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs | 16 +-- .../XmlRpcGroupsServicesConnectorModule.cs | 22 ++-- 18 files changed, 318 insertions(+), 318 deletions(-) (limited to 'OpenSim/Region/OptionalModules/Avatar') diff --git a/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs b/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs index 5c45e4d..0698cec 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Animations/AnimationsCommandModule.cs @@ -57,41 +57,41 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations private List m_scenes = new List(); public string Name { get { return "Animations Command Module"; } } - + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: CLOSED MODULE"); } - + public void AddRegion(Scene scene) { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); } - + public void RemoveRegion(Scene scene) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); - + lock (m_scenes) m_scenes.Remove(scene); - } - + } + public void RegionLoaded(Scene scene) { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); - + lock (m_scenes) m_scenes.Add(scene); @@ -156,18 +156,18 @@ namespace OpenSim.Region.OptionalModules.Avatar.Animations string cma = spa.CurrentMovementAnimation; cdl.AddRow( - "Current movement anim", + "Current movement anim", string.Format("{0}, {1}", DefaultAvatarAnimations.GetDefaultAnimation(cma), cma)); UUID defaultAnimId = anims.DefaultAnimation.AnimID; cdl.AddRow( - "Default anim", + "Default anim", string.Format("{0}, {1}", defaultAnimId, sp.Animator.GetAnimName(defaultAnimId))); UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID; cdl.AddRow( - "Implicit default anim", - string.Format("{0}, {1}", + "Implicit default anim", + string.Format("{0}, {1}", implicitDefaultAnimId, sp.Animator.GetAnimName(implicitDefaultAnimId))); cdl.AddToStringBuilder(sb); diff --git a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs index 2f9bb1e..60ae0cb 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Appearance/AppearanceInfoModule.cs @@ -54,43 +54,43 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance private List m_scenes = new List(); // private IAvatarFactoryModule m_avatarFactory; - - public string Name { get { return "Appearance Information Module"; } } - + + public string Name { get { return "Appearance Information Module"; } } + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[APPEARANCE INFO MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[APPEARANCE INFO MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[APPEARANCE INFO MODULE]: CLOSED MODULE"); } - + public void AddRegion(Scene scene) { -// m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); +// m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); } - + public void RemoveRegion(Scene scene) { // m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); - + lock (m_scenes) m_scenes.Remove(scene); - } - + } + public void RegionLoaded(Scene scene) { // m_log.DebugFormat("[APPEARANCE INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); - + lock (m_scenes) m_scenes.Add(scene); @@ -99,7 +99,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance "show appearance [ ]", "Synonym for 'appearance show'", HandleShowAppearanceCommand); - + scene.AddCommand( "Users", this, "appearance show", "appearance show [ ]", @@ -222,7 +222,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance } lock (m_scenes) - { + { foreach (Scene scene in m_scenes) { if (targetNameSupplied) @@ -344,7 +344,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance if (targetNameSupplied) { - lock (m_scenes) + lock (m_scenes) { foreach (Scene scene in m_scenes) { @@ -360,12 +360,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance cdt.AddColumn("Name", ConsoleDisplayUtil.UserNameSize); cdt.AddColumn("Wearables", 2); - lock (m_scenes) + lock (m_scenes) { foreach (Scene scene in m_scenes) { scene.ForEachRootScenePresence( - sp => + sp => { int count = 0; @@ -428,7 +428,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance uuidGatherer.AddForInspection(wi.AssetID); uuidGatherer.GatherAll(); - string[] assetStrings + string[] assetStrings = Array.ConvertAll(uuidGatherer.GatheredUuids.Keys.ToArray(), u => u.ToString()); bool[] existChecks = scene.AssetService.AssetsExist(assetStrings); @@ -438,10 +438,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Appearance cdt.AddColumn("Type", 10); cdt.AddColumn("UUID", ConsoleDisplayUtil.UuidSize); cdt.AddColumn("Found", 5); - + for (int k = 0; k < existChecks.Length; k++) cdt.AddRow( - (AssetType)uuidGatherer.GatheredUuids[new UUID(assetStrings[k])], + (AssetType)uuidGatherer.GatheredUuids[new UUID(assetStrings[k])], assetStrings[k], existChecks[k] ? "yes" : "no"); sb.Append(cdt.ToString()); diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs index a147e9b..3685041 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/AttachmentsCommandModule.cs @@ -55,41 +55,41 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments // private IAvatarFactoryModule m_avatarFactory; public string Name { get { return "Attachments Command Module"; } } - + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: CLOSED MODULE"); } - + public void AddRegion(Scene scene) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); } - + public void RemoveRegion(Scene scene) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); - + lock (m_scenes) m_scenes.Remove(scene); - } - + } + public void RegionLoaded(Scene scene) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); - + lock (m_scenes) m_scenes.Add(scene); diff --git a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs index 535bf67..ed27385 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Attachments/TempAttachmentsModule.cs @@ -125,7 +125,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments SendConsoleOutput(agentID, "Command parameter error"); return; } - + m_scene.StoreExtraSetting("auto_grant_attach_perms", val); SendConsoleOutput(agentID, String.Format("auto_grant_attach_perms set to {0}", val)); @@ -155,7 +155,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments ScenePresence target; if (!m_scene.TryGetScenePresence(item.PermsGranter, out target)) return 0; - + if (target.UUID != hostPart.ParentGroup.OwnerID) { uint effectivePerms = hostPart.ParentGroup.GetEffectivePermissions(); diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs index 73215cb..27ab32f 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/ChannelState.cs @@ -38,7 +38,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.OptionalModules.Avatar.Chat { - // An instance of this class exists for each unique combination of + // An instance of this class exists for each unique combination of // IRC chat interface characteristics, as determined by the supplied // configuration file. @@ -266,11 +266,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat ChannelState cs = p_cs; // Check to see if we have an existing server/channel setup that can be used - // In the absence of variable substitution this will always resolve to the - // same ChannelState instance, and the table will only contains a single - // entry, so the performance considerations for the existing behavior are + // In the absence of variable substitution this will always resolve to the + // same ChannelState instance, and the table will only contains a single + // entry, so the performance considerations for the existing behavior are // zero. Only the IRC connector is shared, the ChannelState still contains - // values that, while independent of the IRC connetion, do still distinguish + // values that, while independent of the IRC connetion, do still distinguish // this region's behavior. lock (IRCBridgeModule.m_channels) @@ -335,7 +335,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat } - // These routines allow differentiating changes to + // These routines allow differentiating changes to // the underlying channel state. If necessary, a // new channel state will be created. @@ -426,7 +426,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat } // This level of obsessive matching allows us to produce - // a minimal overhead int he case of a server which does + // a minimal overhead int he case of a server which does // need to differentiate IRC at a region level. private bool IsAPerfectMatchFor(ChannelState cs) @@ -447,8 +447,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat ); } - // This function implements the variable substitution mechanism - // for the configuration values. Each string read from the + // This function implements the variable substitution mechanism + // for the configuration values. Each string read from the // configuration file is scanned for '[...]' enclosures. Each // one that is found is replaced by either a runtime variable // (%xxx) or an existing configuration key. When no further @@ -585,7 +585,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat } - // This function is lifted from the IRCConnector because it + // This function is lifted from the IRCConnector because it // contains information that is not differentiating from an // IRC point-of-view. @@ -598,7 +598,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat { // Scan through the set of unique channel configuration for those - // that belong to this connector. And then forward the message to + // that belong to this connector. And then forward the message to // all regions known to those channels. // Note that this code is responsible for completing some of the // settings for the inbound OSChatMessage diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs index 941379f..ffbebe7 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/IRCConnector.cs @@ -97,14 +97,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat // How many regions depend upon this connection // This count is updated by the ChannelState object and reflects the sum - // of the region clients associated with the set of associated channel + // of the region clients associated with the set of associated channel // state instances. That's why it cannot be managed here. internal int depends = 0; // This variable counts the number of resets that have been performed - // on the connector. When a listener thread terminates, it checks to - // see of the reset count has changed before it schedules another + // on the connector. When a listener thread terminates, it checks to + // see of the reset count has changed before it schedules another // reset. internal int m_resetk = 0; @@ -428,7 +428,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat public void PrivMsg(string pattern, string from, string region, string msg) { - // m_log.DebugFormat("[IRC-Connector-{0}] PrivMsg to IRC from {1}: <{2}>", idn, from, + // m_log.DebugFormat("[IRC-Connector-{0}] PrivMsg to IRC from {1}: <{2}>", idn, from, // String.Format(pattern, m_ircChannel, from, region, msg)); // One message to the IRC server @@ -510,7 +510,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat c.Sender = null; c.SenderUUID = UUID.Zero; - // Is message "\001ACTION foo bar\001"? + // Is message "\001ACTION foo bar\001"? // Then change to: "/me foo bar" if ((1 == c.Message[0]) && c.Message.Substring(1).StartsWith("ACTION")) @@ -608,8 +608,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat string parms = String.Empty; // ":" indicates that a prefix is present - // There are NEVER more than 17 real - // fields. A parameter that starts with + // There are NEVER more than 17 real + // fields. A parameter that starts with // ":" indicates that the remainder of the // line is a single parameter value. @@ -873,7 +873,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat } // Being marked connected is not enough to ping. Socket establishment can sometimes take a long - // time, in which case the watch dog might try to ping the server before the socket has been + // time, in which case the watch dog might try to ping the server before the socket has been // set up, with nasty side-effects. else if (_pdk_ == 0) diff --git a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs index 5505001..a3ef83b 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Chat/RegionState.cs @@ -414,7 +414,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat } } - // This method gives the region an opportunity to interfere with + // This method gives the region an opportunity to interfere with // message delivery. For now we just enforce the enable/disable // flag. @@ -428,7 +428,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Chat } } - // This supports any local message traffic that might be needed in + // This supports any local message traffic that might be needed in // support of command processing. At present there is none. internal void LocalChat(string msg) diff --git a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs index 6c147f4..c0de3d9 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Concierge/ConciergeModule.cs @@ -98,7 +98,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge // replace it. m_replacingChatModule = false; } - else + else { m_replacingChatModule = !configSource.Configs["Chat"].GetBoolean("enabled", true); } @@ -107,7 +107,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge { m_replacingChatModule = false; } - + m_log.InfoFormat("[Concierge] {0} ChatModule", m_replacingChatModule ? "replacing" : "not replacing"); // take note of concierge channel and of identity @@ -119,7 +119,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge m_xmlRpcPassword = config.GetString("password", m_xmlRpcPassword); m_brokerURI = config.GetString("broker", m_brokerURI); m_brokerUpdateTimeout = config.GetInt("broker_timeout", m_brokerUpdateTimeout); - + m_log.InfoFormat("[Concierge] reporting as \"{0}\" to our users", m_whoami); // calculate regions Regex @@ -207,7 +207,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge { } - new public Type ReplaceableInterface + new public Type ReplaceableInterface { get { return null; } } @@ -278,7 +278,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge // range of chat to cover the whole // region. however, we don't do this for whisper // (got to have some privacy) - if (c.Type != ChatTypeEnum.Whisper) + if (c.Type != ChatTypeEnum.Whisper) { base.OnChatBroadcast(sender, c); return; @@ -296,17 +296,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge { client.OnLogout += OnClientLoggedOut; - if (m_replacingChatModule) + if (m_replacingChatModule) client.OnChatFromClient += OnChatFromClient; } - + public void OnClientLoggedOut(IClientAPI client) { client.OnLogout -= OnClientLoggedOut; client.OnConnectionClosed -= OnClientLoggedOut; - + if (m_conciergedScenes.Contains(client.Scene)) { Scene scene = client.Scene as Scene; @@ -324,7 +324,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge Scene scene = agent.Scene; m_log.DebugFormat("[Concierge]: {0} enters {1}", agent.Name, scene.RegionInfo.RegionName); WelcomeAvatar(agent, scene); - AnnounceToAgentsRegion(scene, String.Format(m_announceEntering, agent.Name, + AnnounceToAgentsRegion(scene, String.Format(m_announceEntering, agent.Name, scene.RegionInfo.RegionName, scene.GetRootAgentCount())); UpdateBroker(scene); } @@ -337,7 +337,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge { Scene scene = agent.Scene; m_log.DebugFormat("[Concierge]: {0} leaves {1}", agent.Name, scene.RegionInfo.RegionName); - AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, agent.Name, + AnnounceToAgentsRegion(scene, String.Format(m_announceLeaving, agent.Name, scene.RegionInfo.RegionName, scene.GetRootAgentCount())); UpdateBroker(scene); } @@ -374,7 +374,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge scene.ForEachRootScenePresence(delegate(ScenePresence sp) { - list.Append(String.Format(" \n", sp.Name, sp.UUID)); + list.Append(String.Format(" \n", sp.Name, sp.UUID)); }); list.Append(""); @@ -437,7 +437,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge private void UpdateBrokerDone(IAsyncResult result) { BrokerState bs = null; - try + try { bs = result.AsyncState as BrokerState; HttpWebRequest updatePost = bs.Poster; @@ -450,15 +450,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge catch (WebException we) { m_log.ErrorFormat("[Concierge] broker update to {0} failed with status {1}", bs.Uri, we.Status); - if (null != we.Response) + if (null != we.Response) { using (HttpWebResponse resp = we.Response as HttpWebResponse) { m_log.ErrorFormat("[Concierge] response from {0} status code: {1}", bs.Uri, resp.StatusCode); m_log.ErrorFormat("[Concierge] response from {0} status desc: {1}", bs.Uri, resp.StatusDescription); m_log.ErrorFormat("[Concierge] response from {0} server: {1}", bs.Uri, resp.Server); - - if (resp.ContentLength > 0) + + if (resp.ContentLength > 0) { StreamReader content = new StreamReader(resp.GetResponseStream()); m_log.ErrorFormat("[Concierge] response from {0} content: {1}", bs.Uri, content.ReadToEnd()); @@ -476,12 +476,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge // welcome file there: if yes, send it to the agent if (!String.IsNullOrEmpty(m_welcomes)) { - string[] welcomes = new string[] { + string[] welcomes = new string[] { Path.Combine(m_welcomes, agent.Scene.RegionInfo.RegionName), Path.Combine(m_welcomes, "DEFAULT")}; foreach (string welcome in welcomes) { - if (File.Exists(welcome)) + if (File.Exists(welcome)) { try { @@ -500,7 +500,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge { m_log.ErrorFormat("[Concierge]: welcome file {0} is malformed: {1}", welcome, fe); } - } + } return; } m_log.DebugFormat("[Concierge]: no welcome message for region {0}", scene.RegionInfo.RegionName); @@ -512,7 +512,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge // protected void AnnounceToAgentsRegion(Scene scene, string msg) // { // ScenePresence agent = null; - // if ((client.Scene is Scene) && (client.Scene as Scene).TryGetScenePresence(client.AgentId, out agent)) + // if ((client.Scene is Scene) && (client.Scene as Scene).TryGetScenePresence(client.AgentId, out agent)) // AnnounceToAgentsRegion(agent, msg); // else // m_log.DebugFormat("[Concierge]: could not find an agent for client {0}", client.Name); @@ -587,7 +587,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Concierge string regionName = (string)requestData["region"]; IScene scene = m_scenes.Find(delegate(IScene s) { return s.RegionInfo.RegionName == regionName; }); - if (scene == null) + if (scene == null) throw new Exception(String.Format("unknown region \"{0}\"", regionName)); if (!m_conciergedScenes.Contains(scene)) diff --git a/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs b/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs index 026ceca..31fc56a 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Friends/FriendsCommandsModule.cs @@ -61,31 +61,31 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends private IPresenceService m_presenceService; // private IAvatarFactoryModule m_avatarFactory; - - public string Name { get { return "Appearance Information Module"; } } - + + public string Name { get { return "Appearance Information Module"; } } + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[FRIENDS COMMAND MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[FRIENDS COMMAND MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[FRIENDS COMMAND MODULE]: CLOSED MODULE"); } - + public void AddRegion(Scene scene) { // m_log.DebugFormat("[FRIENDS COMMANDO MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); } - + public void RemoveRegion(Scene scene) { // m_log.DebugFormat("[FRIENDS COMMAND MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); diff --git a/OpenSim/Region/OptionalModules/Avatar/SitStand/SitStandCommandsModule.cs b/OpenSim/Region/OptionalModules/Avatar/SitStand/SitStandCommandsModule.cs index 5a6b284..1b5ee04 100644 --- a/OpenSim/Region/OptionalModules/Avatar/SitStand/SitStandCommandsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/SitStand/SitStandCommandsModule.cs @@ -54,34 +54,34 @@ namespace OpenSim.Region.OptionalModules.Avatar.SitStand private Scene m_scene; public string Name { get { return "SitStand Command Module"; } } - + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: CLOSED MODULE"); } - + public void AddRegion(Scene scene) { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); } - + public void RemoveRegion(Scene scene) { // m_log.DebugFormat("[ATTACHMENTS COMMAND MODULE]: REGION {0} REMOVED", scene.RegionInfo.RegionName); - } - + } + public void RegionLoaded(Scene scene) { // m_log.DebugFormat("[ANIMATIONS COMMAND MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); @@ -143,7 +143,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.SitStand if (sitPart != null) { MainConsole.Instance.OutputFormat( - "Sitting {0} on {1} {2} in {3}", + "Sitting {0} on {1} {2} in {3}", sp.Name, sitPart.ParentGroup.Name, sitPart.ParentGroup.UUID, m_scene.Name); sp.HandleAgentRequestSit(sp.ControllingClient, sp.UUID, sitPart.UUID, Vector3.Zero); @@ -202,14 +202,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.SitStand foreach (ScenePresence sp in scenePresences) { - if (!sp.IsChildAgent && nameRegex.IsMatch(sp.Name)) + if (!sp.IsChildAgent && nameRegex.IsMatch(sp.Name)) scenePresencesMatched.Add(sp); } } else { ScenePresence sp = m_scene.GetScenePresence(firstName, lastName); - + if (sp != null && !sp.IsChildAgent) scenePresencesMatched.Add(sp); } diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs index 3db0781..c6d7fe6 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs @@ -143,7 +143,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice if (String.IsNullOrEmpty(m_freeSwitchRealm) || String.IsNullOrEmpty(m_freeSwitchAPIPrefix)) { - m_log.Error("[FreeSwitchVoice]: Freeswitch service mis-configured. Not starting."); + m_log.Error("[FreeSwitchVoice]: Freeswitch service mis-configured. Not starting."); return; } @@ -168,9 +168,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_buddy.php", m_freeSwitchAPIPrefix), FreeSwitchSLVoiceBuddyHTTPHandler); - + MainServer.Instance.AddHTTPHandler(String.Format("{0}/viv_watcher.php", m_freeSwitchAPIPrefix), - FreeSwitchSLVoiceWatcherHTTPHandler); + FreeSwitchSLVoiceWatcherHTTPHandler); m_log.InfoFormat("[FreeSwitchVoice]: using FreeSwitch server {0}", m_freeSwitchRealm); @@ -302,7 +302,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice public void OnRegisterCaps(Scene scene, UUID agentID, Caps caps) { m_log.DebugFormat( - "[FreeSwitchVoice]: OnRegisterCaps() called with agentID {0} caps {1} in scene {2}", + "[FreeSwitchVoice]: OnRegisterCaps() called with agentID {0} caps {1} in scene {2}", agentID, caps, scene.RegionInfo.RegionName); string capsBase = "/CAPS/" + caps.CapsObjectPath; @@ -352,7 +352,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice { m_log.DebugFormat( "[FreeSwitchVoice][PROVISIONVOICE]: ProvisionVoiceAccountRequest() request: {0}, path: {1}, param: {2}", request, path, param); - + ScenePresence avatar = scene.GetScenePresence(agentID); if (avatar == null) { @@ -423,9 +423,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice UUID agentID, Caps caps) { m_log.DebugFormat( - "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}", + "[FreeSwitchVoice][PARCELVOICE]: ParcelVoiceInfoRequest() on {0} for {1}", scene.RegionInfo.RegionName, agentID); - + ScenePresence avatar = scene.GetScenePresence(agentID); string avatarName = avatar.Name; @@ -512,7 +512,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice m_log.DebugFormat("[FreeSwitchVoice][CHATSESSION]: avatar \"{0}\": request: {1}, path: {2}, param: {3}", avatarName, request, path, param); - + return "true"; } @@ -610,7 +610,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice public Hashtable FreeSwitchSLVoiceBuddyHTTPHandler(Hashtable request) { m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceBuddyHTTPHandler called"); - + Hashtable response = new Hashtable(); response["int_response_code"] = 200; response["str_response_string"] = string.Empty; @@ -678,16 +678,16 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice // Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); // // m_log.DebugFormat( -// "[FREESWITCH]: FreeSwitchSLVoiceBuddyHTTPHandler() response {0}", +// "[FREESWITCH]: FreeSwitchSLVoiceBuddyHTTPHandler() response {0}", // normalizeEndLines.Replace((string)response["str_response_string"],"")); - + return response; } public Hashtable FreeSwitchSLVoiceWatcherHTTPHandler(Hashtable request) { m_log.Debug("[FreeSwitchVoice]: FreeSwitchSLVoiceWatcherHTTPHandler called"); - + Hashtable response = new Hashtable(); response["int_response_code"] = 200; response["content-type"] = "text/xml"; @@ -700,8 +700,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice StringBuilder resp = new StringBuilder(); resp.Append(""); - - // FIXME: This is enough of a response to stop viewer 2 complaining about a login failure and get voice to work. If we don't + + // FIXME: This is enough of a response to stop viewer 2 complaining about a login failure and get voice to work. If we don't // give an OK response, then viewer 2 engages in an continuous viv_signin.php, viv_buddy.php, viv_watcher.php loop // Viewer 1 appeared happy to ignore the lack of reply and still works with this reply. // @@ -711,19 +711,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice lib_session {0} {0} - ", auth_token)); - + ", auth_token)); + response["str_response_string"] = resp.ToString(); - + // Regex normalizeEndLines = new Regex(@"(\r\n|\n)", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.Multiline); // // m_log.DebugFormat( -// "[FREESWITCH]: FreeSwitchSLVoiceWatcherHTTPHandler() response {0}", +// "[FREESWITCH]: FreeSwitchSLVoiceWatcherHTTPHandler() response {0}", // normalizeEndLines.Replace((string)response["str_response_string"],"")); - + return response; } - + public Hashtable FreeSwitchSLVoiceSigninHTTPHandler(Hashtable request) { //m_log.Debug("[FreeSwitchVoice] FreeSwitchSLVoiceSigninHTTPHandler called"); @@ -771,10 +771,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice ", userid, pos, avatarName); - response["int_response_code"] = 200; - + response["int_response_code"] = 200; + // m_log.DebugFormat("[FreeSwitchVoice]: Sending FreeSwitchSLVoiceSigninHTTPHandler response"); - + return response; } @@ -859,23 +859,23 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice response["keepalive"] = false; response["int_response_code"] = 500; - Hashtable requestBody = ParseRequestBody((string)request["body"]); + Hashtable requestBody = ParseRequestBody((string)request["body"]); - string section = (string) requestBody["section"]; + string section = (string) requestBody["section"]; if (section == "directory") { string eventCallingFunction = (string)requestBody["Event-Calling-Function"]; m_log.DebugFormat( - "[FreeSwitchVoice]: Received request for config section directory, event calling function '{0}'", - eventCallingFunction); - + "[FreeSwitchVoice]: Received request for config section directory, event calling function '{0}'", + eventCallingFunction); + response = m_FreeswitchService.HandleDirectoryRequest(requestBody); } else if (section == "dialplan") - { + { m_log.DebugFormat("[FreeSwitchVoice]: Received request for config section dialplan"); - + response = m_FreeswitchService.HandleDialplanRequest(requestBody); } else diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 5ea4a31..57930d7 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs @@ -114,7 +114,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice private static Dictionary m_parents = new Dictionary(); private static bool m_dumpXml; - + private IConfig m_config; private object m_Lock; @@ -153,22 +153,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // Validate against constraints and default if necessary if (m_vivoxChannelRollOff < CHAN_ROLL_OFF_MIN || m_vivoxChannelRollOff > CHAN_ROLL_OFF_MAX) { - m_log.WarnFormat("[VivoxVoice] Invalid value for roll off ({0}), reset to {1}.", + m_log.WarnFormat("[VivoxVoice] Invalid value for roll off ({0}), reset to {1}.", m_vivoxChannelRollOff, CHAN_ROLL_OFF_DEFAULT); m_vivoxChannelRollOff = CHAN_ROLL_OFF_DEFAULT; } if (m_vivoxChannelMaximumRange < CHAN_MAX_RANGE_MIN || m_vivoxChannelMaximumRange > CHAN_MAX_RANGE_MAX) { - m_log.WarnFormat("[VivoxVoice] Invalid value for maximum range ({0}), reset to {1}.", + m_log.WarnFormat("[VivoxVoice] Invalid value for maximum range ({0}), reset to {1}.", m_vivoxChannelMaximumRange, CHAN_MAX_RANGE_DEFAULT); m_vivoxChannelMaximumRange = CHAN_MAX_RANGE_DEFAULT; } - if (m_vivoxChannelClampingDistance < CHAN_CLAMPING_DISTANCE_MIN || + if (m_vivoxChannelClampingDistance < CHAN_CLAMPING_DISTANCE_MIN || m_vivoxChannelClampingDistance > CHAN_CLAMPING_DISTANCE_MAX) { - m_log.WarnFormat("[VivoxVoice] Invalid value for clamping distance ({0}), reset to {1}.", + m_log.WarnFormat("[VivoxVoice] Invalid value for clamping distance ({0}), reset to {1}.", m_vivoxChannelClampingDistance, CHAN_CLAMPING_DISTANCE_DEFAULT); m_vivoxChannelClampingDistance = CHAN_CLAMPING_DISTANCE_DEFAULT; } @@ -180,7 +180,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice case "presentation" : break; case "auditorium" : break; default : - m_log.WarnFormat("[VivoxVoice] Invalid value for channel mode ({0}), reset to {1}.", + m_log.WarnFormat("[VivoxVoice] Invalid value for channel mode ({0}), reset to {1}.", m_vivoxChannelMode, CHAN_MODE_DEFAULT); m_vivoxChannelMode = CHAN_MODE_DEFAULT; break; @@ -191,7 +191,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice case "positional" : break; case "channel" : break; default : - m_log.WarnFormat("[VivoxVoice] Invalid value for channel type ({0}), reset to {1}.", + m_log.WarnFormat("[VivoxVoice] Invalid value for channel type ({0}), reset to {1}.", m_vivoxChannelType, CHAN_TYPE_DEFAULT); m_vivoxChannelType = CHAN_TYPE_DEFAULT; break; @@ -230,7 +230,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice public void AddRegion(Scene scene) { - if (m_pluginEnabled) + if (m_pluginEnabled) { lock (vlock) { @@ -238,13 +238,13 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice string sceneUUID = scene.RegionInfo.RegionID.ToString(); string sceneName = scene.RegionInfo.RegionName; - + // Make sure that all local channels are deleted. // So we have to search for the children, and then do an // iteration over the set of chidren identified. // This assumes that there is just one directory per // region. - + if (VivoxTryGetDirectory(sceneUUID + "D", out channelId)) { m_log.DebugFormat("[VivoxVoice]: region {0}: uuid {1}: located directory id {2}", @@ -263,7 +263,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice { if (!IsOK(VivoxDeleteChannel(channelId, id))) m_log.WarnFormat("[VivoxVoice] Channel delete failed {0}:{1}:{2}", i, channelId, id); - } + } } } } @@ -311,7 +311,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice public void RemoveRegion(Scene scene) { - if (m_pluginEnabled) + if (m_pluginEnabled) { lock (vlock) { @@ -319,7 +319,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice string sceneUUID = scene.RegionInfo.RegionID.ToString(); string sceneName = scene.RegionInfo.RegionName; - + // Make sure that all local channels are deleted. // So we have to search for the children, and then do an // iteration over the set of chidren identified. @@ -343,7 +343,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice { if (!IsOK(VivoxDeleteChannel(channelId, id))) m_log.WarnFormat("[VivoxVoice] Channel delete failed {0}:{1}:{2}", i, channelId, id); - } + } } } } @@ -353,7 +353,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // Remove the channel umbrella entry - lock (m_parents) + lock (m_parents) { if (m_parents.ContainsKey(sceneUUID)) { @@ -375,7 +375,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice VivoxLogout(); } - public Type ReplaceableInterface + public Type ReplaceableInterface { get { return null; } } @@ -396,11 +396,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // (login, region crossing). We contribute two capabilities to // the set of capabilities handed back to the client: // ProvisionVoiceAccountRequest and ParcelVoiceInfoRequest. - // + // // ProvisionVoiceAccountRequest allows the client to obtain // the voice account credentials for the avatar it is // controlling (e.g., user name, password, etc). - // + // // ParcelVoiceInfoRequest is invoked whenever the client // changes from one region or parcel to another. // @@ -493,9 +493,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice if (XmlFind(resp, "response.level0.status", out code)) { - if (code != "OK") + if (code != "OK") { - if (XmlFind(resp, "response.level0.body.code", out code)) + if (XmlFind(resp, "response.level0.body.code", out code)) { // If the request was recognized, then this should be set to something switch (code) @@ -530,27 +530,27 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice switch (code) { case "201" : // Account expired - m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : expired credentials", + m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : expired credentials", avatarName); m_adminConnected = false; retry = DoAdminLogin(); break; - + case "202" : // Missing credentials - m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : missing credentials", + m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : missing credentials", avatarName); break; - + case "212" : // Not authorized m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : not authorized", avatarName); break; - + case "300" : // Required parameter missing - m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : parameter missing", + m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : parameter missing", avatarName); break; - + case "400" : // Create failed m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Create account information failed : create failed", avatarName); @@ -558,7 +558,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice } } break; - + case "404" : // Failed to retrieve account m_log.ErrorFormat("[VivoxVoice]: avatar \"{0}\": Get account information failed : retrieve failed"); // [AMW] Sleep and retry for a fixed period? Or just abandon? @@ -575,7 +575,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice m_log.DebugFormat("[VivoxVoice][PROVISIONVOICE]: Get Account Request failed for \"{0}\"", avatarName); throw new Exception("Unable to execute request"); } - + // Unconditionally change the password on each request VivoxPassword(agentname, password); @@ -613,7 +613,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice string avatarName = avatar.Name; // - check whether we have a region channel in our cache - // - if not: + // - if not: // create it and cache it // - send it to the client // - send channel_uri: as "sip:regionID@m_sipDomain" @@ -622,7 +622,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice LLSDParcelVoiceInfoResponse parcelVoiceInfo; string channel_uri; - if (null == scene.LandChannel) + if (null == scene.LandChannel) throw new Exception(String.Format("region \"{0}\": avatar \"{1}\": land data not yet available", scene.RegionInfo.RegionName, avatarName)); @@ -667,15 +667,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice parcelVoiceInfo = new LLSDParcelVoiceInfoResponse(scene.RegionInfo.RegionName, land.LocalID, creds); string r = LLSDHelpers.SerialiseLLSDReply(parcelVoiceInfo); -// m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", +// m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": Parcel \"{1}\" ({2}): avatar \"{3}\": {4}", // scene.RegionInfo.RegionName, land.Name, land.LocalID, avatarName, r); return r; } catch (Exception e) { - m_log.ErrorFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2}, retry later", + m_log.ErrorFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2}, retry later", scene.RegionInfo.RegionName, avatarName, e.Message); - m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2} failed", + m_log.DebugFormat("[VivoxVoice][PARCELVOICE]: region \"{0}\": avatar \"{1}\": {2} failed", scene.RegionInfo.RegionName, avatarName, e.ToString()); return ""; @@ -721,17 +721,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice { landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name); landUUID = land.GlobalID.ToString(); - m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", + m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", landName, land.LocalID, landUUID); } else { landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, scene.RegionInfo.RegionName); landUUID = scene.RegionInfo.RegionID.ToString(); - m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", + m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parcel id {1}: using channel name {2}", landName, land.LocalID, landUUID); } - + lock (vlock) { // Added by Adam to help debug channel not availible errors. @@ -742,7 +742,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice else throw new Exception("vivox channel uri not available"); - m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parent channel id {1}: retrieved parcel channel_uri {2} ", + m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parent channel id {1}: retrieved parcel channel_uri {2} ", landName, parentId, channelUri); } @@ -817,14 +817,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// /// Create a channel. - /// Once again, there a multitude of options possible. In the simplest case + /// Once again, there a multitude of options possible. In the simplest case /// we specify only the name and get a non-persistent cannel in return. Non /// persistent means that the channel gets deleted if no-one uses it for /// 5 hours. To accomodate future requirements, it may be a good idea to /// initially create channels under the umbrella of a parent ID based upon /// the region name. That way we have a context for side channels, if those /// are required in a later phase. - /// + /// /// In this case the call handles parent and description as optional values. /// private bool VivoxTryCreateChannel(string parent, string channelId, string description, out string channelUri) @@ -846,7 +846,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice requrl = String.Format("{0}&chan_dist_model={1}", requrl, m_vivoxChannelDistanceModel); requrl = String.Format("{0}&chan_max_range={1}", requrl, m_vivoxChannelMaximumRange); requrl = String.Format("{0}&chan_clamping_distance={1}", requrl, m_vivoxChannelClampingDistance); - + XmlElement resp = VivoxCall(requrl, true); if (XmlFind(resp, "response.level0.body.chan_uri", out channelUri)) return true; @@ -889,7 +889,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// /// Retrieve a channel. - /// Once again, there a multitude of options possible. In the simplest case + /// Once again, there a multitude of options possible. In the simplest case /// we specify only the name and get a non-persistent cannel in return. Non /// persistent means that the channel gets deleted if no-one uses it for /// 5 hours. To accomodate future requirements, it may be a good idea to @@ -898,7 +898,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// are required in a later phase. /// In this case the call handles parent and description as optional values. /// - private bool VivoxTryGetChannel(string channelParent, string channelName, + private bool VivoxTryGetChannel(string channelParent, string channelName, out string channelId, out string channelUri) { string count; @@ -1006,7 +1006,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice string type; // skip if not a directory - if (!XmlFind(resp, "response.level0.channel-search.channels.channels.level4.type", i, out type) || + if (!XmlFind(resp, "response.level0.channel-search.channels.channels.level4.type", i, out type) || type != "dir") continue; @@ -1044,7 +1044,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// /// Delete a channel. - /// Once again, there a multitude of options possible. In the simplest case + /// Once again, there a multitude of options possible. In the simplest case /// we specify only the name and get a non-persistent cannel in return. Non /// persistent means that the channel gets deleted if no-one uses it for /// 5 hours. To accomodate future requirements, it may be a good idea to @@ -1098,7 +1098,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // return VivoxGetChannelById(null, id); // } // } - // } + // } // } // } @@ -1106,12 +1106,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // return VivoxGetChannel(null, Guid.NewGuid().ToString()); // } - + /// /// This method handles the WEB side of making a request over the /// Vivox interface. The returned values are tansferred to a has /// table which is returned as the result. - /// The outcome of the call can be determined by examining the + /// The outcome of the call can be determined by examining the /// status value in the hash table. /// private XmlElement VivoxCall(string requrl, bool admin) @@ -1127,7 +1127,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice doc = new XmlDocument(); // Let's serialize all calls to Vivox. Most of these are driven by - // the clients (CAPs), when the user arrives at the region. We don't + // the clients (CAPs), when the user arrives at the region. We don't // want to issue many simultaneous http requests to Vivox, because mono // doesn't like that lock (m_Lock) @@ -1173,7 +1173,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// /// Login has been factored in this way because it gets called - /// from several places in the module, and we want it to work + /// from several places in the module, and we want it to work /// the same way each time. /// private bool DoAdminLogin() @@ -1188,15 +1188,15 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice XmlElement resp = null; resp = VivoxLogin(m_vivoxAdminUser, m_vivoxAdminPassword); - - if (XmlFind(resp, "response.level0.body.status", out status)) + + if (XmlFind(resp, "response.level0.body.status", out status)) { if (status == "Ok") { m_log.Info("[VivoxVoice] Admin connection established"); if (XmlFind(resp, "response.level0.body.auth_token", out m_authToken)) { - if (m_dumpXml) m_log.DebugFormat("[VivoxVoice] Auth Token <{0}>", + if (m_dumpXml) m_log.DebugFormat("[VivoxVoice] Auth Token <{0}>", m_authToken); m_adminConnected = true; } @@ -1215,9 +1215,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// /// The XmlScan routine is provided to aid in the - /// reverse engineering of incompletely + /// reverse engineering of incompletely /// documented packets returned by the Vivox - /// voice server. It is only called if the + /// voice server. It is only called if the /// m_dumpXml switch is set. /// private void XmlScanl(XmlElement e, int index) @@ -1262,7 +1262,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice private bool XmlFind(XmlElement root, string tag, int nth, out string result) { if (root == null || tag == null || tag == String.Empty) - { + { result = String.Empty; return false; } @@ -1273,7 +1273,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice { int nth = 0; if (root == null || tag == null || tag == String.Empty) - { + { result = String.Empty; return false; } @@ -1284,7 +1284,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// XmlSearch is initially called by XmlFind, and then /// recursively called by itself until the document /// supplied to XmlFind is either exhausted or the name hierarchy - /// is matched. + /// is matched. /// /// If the hierarchy is matched, the value is returned in /// result, and true returned as the function's @@ -1298,7 +1298,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice result = String.Empty; return false; } - + if (tags.Length-index == 1) { if (nth == 0) diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs index 0aaf95c..8791235 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsMessagingModule.cs @@ -125,7 +125,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (!m_groupMessagingEnabled) return; - + scene.RegisterModuleInterface(this); scene.AddCommand( @@ -136,7 +136,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups "This setting turns on very verbose groups messaging debugging", HandleDebugGroupsMessagingVerbose); } - + public void RegionLoaded(Scene scene) { if (!m_groupMessagingEnabled) @@ -205,7 +205,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_msgTransferModule = null; } - public Type ReplaceableInterface + public Type ReplaceableInterface { get { return null; } } @@ -253,7 +253,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); - + GroupRecord groupInfo = m_groupData.GetGroupRecord(agentID, groupID, null); if (groupInfo != null) @@ -270,7 +270,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { SendMessageToGroup(im, groupID, new UUID(im.fromAgentID), null); } - + public void SendMessageToGroup( GridInstantMessage im, UUID groupID, UUID sendingAgentForGroupCalls, Func sendCondition) { @@ -294,19 +294,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_usersOnlineCache.Add(groupID, onlineAgents, m_usersOnlineCacheExpirySeconds); } - attemptDeliveryUuidSet + attemptDeliveryUuidSet = new HashSet(Array.ConvertAll(onlineAgents, pi => pi.UserID)); } else { - attemptDeliveryUuidSet + attemptDeliveryUuidSet = new HashSet(groupMembers.ConvertAll(gmd => gmd.AgentID.ToString())); if (m_debugEnabled) m_log.DebugFormat( "[GROUPS-MESSAGING]: SendMessageToGroup called for group {0} with {1} visible members", groupID, groupMembers.Count); - } + } foreach (GroupMembersData member in groupMembers) { @@ -314,9 +314,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (!sendCondition(member)) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( - "[GROUPS-MESSAGING]: Not sending to {0} as they do not fulfill send condition", + "[GROUPS-MESSAGING]: Not sending to {0} as they do not fulfill send condition", member.AgentID); continue; @@ -325,7 +325,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups else if (m_groupData.hasAgentDroppedGroupChatSession(member.AgentID, groupID)) { // Don't deliver messages to people who have dropped this session - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( "[GROUPS-MESSAGING]: {0} has dropped session, not delivering to them", member.AgentID); @@ -360,9 +360,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // If they're not local, forward across the grid m_msgTransferModule.SendInstantMessage(msg, delegate(bool success) { }); - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( - "[GROUPS-MESSAGING]: Delivering to {0} via grid took {1} ms", + "[GROUPS-MESSAGING]: Delivering to {0} via grid took {1} ms", member.AgentID, Environment.TickCount - startTick); } else @@ -372,9 +372,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups ProcessMessageFromGroupSession(msg, client); // Deliver locally, directly - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( - "[GROUPS-MESSAGING]: Delivering to {0} locally took {1} ms", + "[GROUPS-MESSAGING]: Delivering to {0} locally took {1} ms", member.AgentID, Environment.TickCount - startTick); } } @@ -385,9 +385,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_msgTransferModule.HandleUndeliverableMessage(msg, delegate(bool success) { }); - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( - "[GROUPS-MESSAGING]: Handling undeliverable message for {0} took {1} ms", + "[GROUPS-MESSAGING]: Handling undeliverable message for {0} took {1} ms", member.AgentID, Environment.TickCount - startTick); } } @@ -397,7 +397,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups "[GROUPS-MESSAGING]: Total SendMessageToGroup for group {0} with {1} members, {2} candidates for delivery took {3} ms", groupID, groupMembersCount, attemptDeliveryUuidSet.Count(), Environment.TickCount - requestStartTick); } - + #region SimGridEventHandlers void OnClientLogin(IClientAPI client) @@ -417,7 +417,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // The instant message module will only deliver messages of dialog types: // MessageFromAgent, StartTyping, StopTyping, MessageFromObject // - // Any other message type will not be delivered to a client by the + // Any other message type will not be delivered to a client by the // Instant Message Module if (m_debugEnabled) @@ -428,7 +428,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } // Incoming message from a group - if ((msg.fromGroup == true) && + if ((msg.fromGroup == true) && ((msg.dialog == (byte)InstantMessageDialog.SessionSend) || (msg.dialog == (byte)InstantMessageDialog.SessionAdd) || (msg.dialog == (byte)InstantMessageDialog.SessionDrop))) @@ -450,7 +450,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private void ProcessMessageFromGroupSession(GridInstantMessage msg, IClientAPI client) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( "[GROUPS-MESSAGING]: Session message from {0} going to agent {1}, sessionID {2}, type {3}", msg.fromAgentName, msg.toAgentID, msg.imSessionID, (InstantMessageDialog)msg.dialog); @@ -522,7 +522,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } } } - else + else { client.SendInstantMessage(msg); } @@ -570,7 +570,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_debugEnabled) m_log.InfoFormat("[GROUPS-MESSAGING]: imSessionID({0}) toAgentID({1})", im.imSessionID, im.toAgentID); GroupRecord groupInfo = m_groupData.GetGroupRecord(UUID.Zero, GroupID, null); - + if (groupInfo != null) { m_groupData.AgentInvitedToGroupChatSession(AgentID, GroupID); @@ -586,7 +586,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // Send a message from locally connected client to a group if ((im.dialog == (byte)InstantMessageDialog.SessionSend)) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString()); //If this agent is sending a message, then they want to be in the session @@ -597,7 +597,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if ((im.dialog == (byte)InstantMessageDialog.SessionDrop)) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Send message to session for group {0} with session ID {1}", GroupID, im.imSessionID.ToString()); m_groupData.AgentDroppedFromGroupChatSession(AgentID, GroupID); @@ -659,7 +659,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups /// private IClientAPI GetActiveClient(UUID agentID) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Looking for local client {0}", agentID); IClientAPI child = null; @@ -672,14 +672,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (!sp.IsChildAgent) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Found root agent for client : {0}", sp.ControllingClient.Name); return sp.ControllingClient; } else { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Found child agent for client : {0}", sp.ControllingClient.Name); child = sp.ControllingClient; @@ -690,12 +690,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // If we didn't find a root, then just return whichever child we found, or null if none if (child == null) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Could not find local client for agent : {0}", agentID); } else { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[GROUPS-MESSAGING]: Returning child agent for client : {0}", child.Name); } diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs index 81add13..f0de7d4 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/GroupsModule.cs @@ -50,19 +50,19 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups /// ; To use this module, you must specify the following in your OpenSim.ini /// [GROUPS] /// Enabled = true - /// + /// /// Module = GroupsModule /// NoticesEnabled = true /// DebugEnabled = true - /// + /// /// GroupsServicesConnectorModule = XmlRpcGroupsServicesConnector /// XmlRpcServiceURL = http://osflotsam.org/xmlrpc.php /// XmlRpcServiceReadKey = 1234 /// XmlRpcServiceWriteKey = 1234 - /// + /// /// MessagingModule = GroupsMessagingModule /// MessagingEnabled = true - /// + /// /// ; Disables HTTP Keep-Alive for Groups Module HTTP Requests, work around for /// ; a problem discovered on some Windows based region servers. Only disable /// ; if you see a large number (dozens) of the following Exceptions: @@ -332,7 +332,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups remoteClient.SendAvatarGroupsReply(avatarID, avatarGroups); } - + private void OnClientClosed(UUID AgentId, Scene scene) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); @@ -387,7 +387,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); string GroupName; - + GroupRecord group = m_groupData.GetGroupRecord(GetRequestingAgentID(remoteClient), GroupID, null); if (group != null) { @@ -403,9 +403,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private void OnInstantMessage(IClientAPI remoteClient, GridInstantMessage im) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( - "[GROUPS]: {0} called for {1}, message type {2}", + "[GROUPS]: {0} called for {1}, message type {2}", System.Reflection.MethodBase.GetCurrentMethod().Name, remoteClient.Name, (InstantMessageDialog)im.dialog); // Group invitations @@ -569,20 +569,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (targetUser != null) { m_log.DebugFormat( - "[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", + "[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, targetUser.FirstName + " " + targetUser.LastName, member.AcceptNotices); } else { m_log.DebugFormat( - "[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", + "[GROUPS]: Prepping group notice {0} for agent: {1} who Accepts Notices ({2})", NoticeID, member.AgentID, member.AcceptNotices); } } } } - GridInstantMessage msg + GridInstantMessage msg = CreateGroupNoticeIM(UUID.Zero, NoticeID, (byte)OpenMetaverse.InstantMessageDialog.GroupNotice); if (m_groupsMessagingModule != null) @@ -599,7 +599,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups UUID noticeID = new UUID(im.imSessionID); - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: Requesting notice {0} for {1}", noticeID, remoteClient.AgentId); GroupNoticeInfo notice = m_groupData.GetGroupNotice(GetRequestingAgentID(remoteClient), noticeID); @@ -625,10 +625,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } else { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( - "[GROUPS]: Could not find notice {0} for {1} on GroupNoticeInventoryAccepted.", - noticeID, remoteClient.AgentId); + "[GROUPS]: Could not find notice {0} for {1} on GroupNoticeInventoryAccepted.", + noticeID, remoteClient.AgentId); } } @@ -698,7 +698,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { return m_groupData.GetGroupRecord(UUID.Zero, UUID.Zero, name); } - + public void ActivateGroup(IClientAPI remoteClient, UUID groupID) { if (m_debugEnabled) m_log.DebugFormat("[GROUPS]: {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); @@ -739,10 +739,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public List GroupMembersRequest(IClientAPI remoteClient, UUID groupID) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( "[GROUPS]: GroupMembersRequest called for {0} from client {1}", groupID, remoteClient.Name); - + List data = m_groupData.GetGroupMembers(GetRequestingAgentID(remoteClient), groupID); if (m_debugEnabled) @@ -829,7 +829,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups public GroupMembershipData GetMembershipData(UUID groupID, UUID agentID) { - if (m_debugEnabled) + if (m_debugEnabled) m_log.DebugFormat( "[GROUPS]: {0} called with groupID={1}, agentID={2}", System.Reflection.MethodBase.GetCurrentMethod().Name, groupID, agentID); @@ -926,7 +926,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (membership != null) { return membership.GroupTitle; - } + } return string.Empty; } @@ -999,7 +999,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups case 1: // Remove m_groupData.RemoveAgentFromGroupRole(GetRequestingAgentID(remoteClient), memberID, groupID, roleID); - + break; default: m_log.ErrorFormat("[GROUPS]: {0} does not understand changes == {1}", System.Reflection.MethodBase.GetCurrentMethod().Name, changes); @@ -1185,7 +1185,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // Send Message to Ejectee GridInstantMessage msg = new GridInstantMessage(); - + string ejecteeName = "Unknown member"; // if local send a normal message if(ejecteeClient != null) @@ -1219,7 +1219,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups msg.timestamp = 0; msg.fromAgentName = agentName; msg.message = string.Format("You have been ejected from '{1}' by {0}.", agentName, groupInfo.GroupName); -// +// msg.fromGroup = false; msg.offline = (byte)0; msg.ParentEstateID = 0; @@ -1470,7 +1470,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups membershipArray = membershipData.ToArray(); } } - + if (m_debugEnabled) { m_log.InfoFormat("[GROUPS]: Get group membership information for {0} requested by {1}", dataForAgentID, requestingClient.AgentId); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs index cff3212..08c7096 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/IGroupsServicesConnector.cs @@ -43,7 +43,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups /// /// The UUID of the user making the request. /// - /// The ID of the record to retrieve. + /// The ID of the record to retrieve. /// GroupName may be specified instead, in which case this parameter will be UUID.Zero /// /// @@ -89,7 +89,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups /// If the user is a member of the group then the data structure is returned. If not, then null is returned. /// GroupMembershipData GetAgentGroupMembership(UUID RequestingAgentID, UUID AgentID, UUID GroupID); - + /// /// Get information about the groups to which a user belongs. /// diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs index 2c45712..98c7ed4 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/SimianGroupsServicesConnectorModule.cs @@ -48,16 +48,16 @@ using OpenSim.Services.Interfaces; /*************************************************************************** * Simian Data Map * =============== - * + * * OwnerID -> Type -> Key * ----------------------- - * + * * UserID -> Group -> ActiveGroup * + GroupID - * + * * UserID -> GroupSessionDropped -> GroupID * UserID -> GroupSessionInvited -> GroupID - * + * * UserID -> GroupMember -> GroupID * + SelectedRoleID [UUID] * + AcceptNotices [bool] @@ -65,9 +65,9 @@ using OpenSim.Services.Interfaces; * + Contribution [int] * * UserID -> GroupRole[GroupID] -> RoleID - * - * - * GroupID -> Group -> GroupName + * + * + * GroupID -> Group -> GroupName * + Charter * + ShowInList * + InsigniaID @@ -79,17 +79,17 @@ using OpenSim.Services.Interfaces; * + EveryonePowers * + OwnerRoleID * + OwnersPowers - * + * * GroupID -> GroupRole -> RoleID * + Name * + Description * + Title * + Powers - * + * * GroupID -> GroupMemberInvite -> InviteID * + AgentID * + RoleID - * + * * GroupID -> GroupNotice -> NoticeID * + TimeStamp [uint] * + FromName [string] @@ -106,12 +106,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | - GroupPowers.Accountable | - GroupPowers.JoinChat | - GroupPowers.AllowVoiceChat | - GroupPowers.ReceiveNotices | - GroupPowers.StartProposal | + public const GroupPowers m_DefaultEveryonePowers = GroupPowers.AllowSetHome | + GroupPowers.Accountable | + GroupPowers.JoinChat | + GroupPowers.AllowVoiceChat | + GroupPowers.ReceiveNotices | + GroupPowers.StartProposal | GroupPowers.VoteOnProposal; // Would this be cleaner as (GroupPowers)ulong.MaxValue; @@ -168,12 +168,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private bool m_debugEnabled = false; private Dictionary m_pendingRequests = new Dictionary(); - + private ExpiringCache m_memoryCache; private int m_cacheTimeout = 30; // private IUserAccountService m_accountService = null; - + #region Region Module interfaceBase Members @@ -229,10 +229,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] Groups Cache Timeout set to {0}.", m_cacheTimeout); } - + m_memoryCache = new ExpiringCache(); - + // If we got all the config options we need, lets start'er'up m_connectorEnabled = true; @@ -287,8 +287,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups /// /// Create a Group, including Everyone and Owners Role, place FounderID in both groups, select Owner as selected role, and newly created group as agent's active role. /// - public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, - int membershipFee, bool openEnrollment, bool allowPublish, + public UUID CreateGroup(UUID requestingAgentID, string name, string charter, bool showInList, UUID insigniaID, + int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish, UUID founderID) { if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); @@ -313,7 +313,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { AddGroupRole(requestingAgentID, GroupID, UUID.Zero, "Everyone", "Members of " + name, "Member of " + name, (ulong)m_DefaultEveryonePowers); AddGroupRole(requestingAgentID, GroupID, OwnerRoleID, "Owners", "Owners of " + name, "Owner of " + name, (ulong)m_DefaultOwnerPowers); - + AddAgentToGroup(requestingAgentID, requestingAgentID, GroupID, OwnerRoleID); return GroupID; @@ -325,8 +325,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } - public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, - UUID insigniaID, int membershipFee, bool openEnrollment, + public void UpdateGroup(UUID requestingAgentID, UUID groupID, string charter, bool showInList, + UUID insigniaID, int membershipFee, bool openEnrollment, bool allowPublish, bool maturePublish) { if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); @@ -350,7 +350,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } - public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, + public void AddGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, string title, ulong powers) { if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); @@ -393,7 +393,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups } - public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, + public void UpdateGroupRole(UUID requestingAgentID, UUID groupID, UUID roleID, string name, string description, string title, ulong powers) { if (m_debugEnabled) m_log.InfoFormat("[SIMIAN-GROUPS-CONNECTOR] {0} called", System.Reflection.MethodBase.GetCurrentMethod().Name); @@ -434,7 +434,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { return null; } - } + } else if (!string.IsNullOrEmpty(groupName)) { if (!SimianGetFirstGenericEntry("Group", groupName, out groupID, out GroupInfoMap)) @@ -481,7 +481,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { MemberGroupProfile.Charter = groupProfile["Charter"].AsString(); } - + MemberGroupProfile.ShowInList = groupProfile["ShowInList"].AsString() == "1"; MemberGroupProfile.InsigniaID = groupProfile["InsigniaID"].AsUUID(); MemberGroupProfile.MembershipFee = groupProfile["MembershipFee"].AsInteger(); @@ -489,7 +489,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups MemberGroupProfile.AllowPublish = groupProfile["AllowPublish"].AsBoolean(); MemberGroupProfile.MaturePublish = groupProfile["MaturePublish"].AsBoolean(); MemberGroupProfile.FounderID = groupProfile["FounderID"].AsUUID();; - MemberGroupProfile.OwnerRole = groupProfile["OwnerRoleID"].AsUUID(); + MemberGroupProfile.OwnerRole = groupProfile["OwnerRoleID"].AsUUID(); Dictionary Members; if (SimianGetGenericEntries("GroupMember",groupID.ToString(), out Members)) @@ -546,7 +546,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { GroupMemberInfo = new OSDMap(); } - + GroupMemberInfo["AcceptNotices"] = OSD.FromBoolean(acceptNotices); GroupMemberInfo["ListInProfile"] = OSD.FromBoolean(listInProfile); GroupMemberInfo["Contribution"] = OSD.FromInteger(0); @@ -624,7 +624,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // Remove Group Member information for this group SimianRemoveGenericEntry(agentID, "GroupMember", groupID.ToString()); - // By using a Simian Generics Type consisting of a prefix and a groupID, + // By using a Simian Generics Type consisting of a prefix and a groupID, // combined with RoleID as key allows us to get a list of roles a particular member // of a group is assigned to. string GroupRoleMemberType = "GroupRole" + groupID.ToString(); @@ -696,7 +696,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { data.members = 0; } - + // TODO: sort results? // data.searchOrder = order; @@ -721,8 +721,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups data.AcceptNotices = UserGroupMemberInfo["AcceptNotices"].AsBoolean(); data.Contribution = UserGroupMemberInfo["Contribution"].AsInteger(); data.ListInProfile = UserGroupMemberInfo["ListInProfile"].AsBoolean(); - data.ActiveRole = UserGroupMemberInfo["SelectedRoleID"].AsUUID(); - + data.ActiveRole = UserGroupMemberInfo["SelectedRoleID"].AsUUID(); + /////////////////////////////// // Agent Specific Information: // @@ -730,7 +730,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (SimianGetGenericEntry(agentID, "Group", "ActiveGroup", out UserActiveGroup)) { data.Active = UserActiveGroup["GroupID"].AsUUID().Equals(groupID); - } + } /////////////////////////////// // Role Specific Information: @@ -740,8 +740,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { data.GroupTitle = GroupRoleInfo["Title"].AsString(); data.GroupPowers = GroupRoleInfo["Powers"].AsULong(); - } - + } + /////////////////////////////// // Group Specific Information: // @@ -759,7 +759,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups data.MembershipFee = GroupInfo["MembershipFee"].AsInteger(); data.OpenEnrollment = GroupInfo["OpenEnrollment"].AsBoolean(); data.ShowInList = GroupInfo["ShowInList"].AsBoolean(); - } + } } return data; @@ -794,7 +794,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups memberships.Add(GetAgentGroupMembership(requestingAgentID, agentID, UUID.Parse(key))); } } - + return memberships; } @@ -1017,7 +1017,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups Notice["BinaryBucket"] = OSD.FromBinary(binaryBucket); SimianAddGeneric(groupID, "GroupNotice", noticeID.ToString(), Notice); - + } #endregion @@ -1250,7 +1250,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { "OwnerID", ownerID.ToString() }, { "Type", type } }; - + OSDMap response = CachedPostRequest(requestArgs); @@ -1357,7 +1357,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups || requestArgs["RequestMethod"] == "AddGeneric") { m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: clearing generics cache"); - + // Any and all updates cause the cache to clear m_memoryCache.Clear(); @@ -1383,14 +1383,14 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { if (m_memoryCache.TryGetValue(CacheKey, out response)) return response; - + if (! m_pendingRequests.ContainsKey(CacheKey)) { m_pendingRequests.Add(CacheKey,true); firstRequest = true; } } - + if (firstRequest) { // if it wasn't in the cache, pass the request to the Simian Grid Services @@ -1402,7 +1402,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups { m_log.ErrorFormat("[SIMIAN GROUPS CONNECTOR]: request failed {0}", CacheKey); } - + // and cache the response lock (m_memoryCache) { @@ -1420,7 +1420,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups // { // m_log.WarnFormat("[SIMIAN GROUPS CONNECTOR]: query not in the cache"); // Util.PrintCallStack(); - + // // if it wasn't in the cache, pass the request to the Simian Grid Services // response = WebUtil.PostToService(m_groupsServerURI, requestArgs); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs index a942516..ccfcd8b 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/Tests/GroupsModuleTests.cs @@ -77,12 +77,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests /* AgentGroupDataUpdate is udp TestHelpers.InMethod(); // TestHelpers.EnableLogging(); - + TestScene scene = new SceneHelpers().SetupScene(); IConfigSource configSource = new IniConfigSource(); - IConfig config = configSource.AddConfig("Groups"); + IConfig config = configSource.AddConfig("Groups"); config.Set("Enabled", true); - config.Set("Module", "GroupsModule"); + config.Set("Module", "GroupsModule"); config.Set("DebugEnabled", true); GroupsModule gm = new GroupsModule(); @@ -124,8 +124,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests Assert.That(foundUpdate, Is.True, "Did not find AgentGroupDataUpdate in response"); - // TODO: More checking of more actual event data. -*/ + // TODO: More checking of more actual event data. +*/ } [Test] @@ -133,7 +133,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests { TestHelpers.InMethod(); // TestHelpers.EnableLogging(); - + TestScene scene = new SceneHelpers().SetupScene(); MessageTransferModule mtm = new MessageTransferModule(); @@ -144,12 +144,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups.Tests IConfigSource configSource = new IniConfigSource(); { - IConfig config = configSource.AddConfig("Messaging"); + IConfig config = configSource.AddConfig("Messaging"); config.Set("MessageTransferModule", mtm.Name); } { - IConfig config = configSource.AddConfig("Groups"); + IConfig config = configSource.AddConfig("Groups"); config.Set("Enabled", true); config.Set("Module", gm.Name); config.Set("DebugEnabled", true); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index eb64f71..50d3f94 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -53,17 +53,17 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private bool m_debugEnabled = false; - public const GroupPowers DefaultEveryonePowers - = GroupPowers.AllowSetHome - | GroupPowers.Accountable - | GroupPowers.JoinChat - | GroupPowers.AllowVoiceChat - | GroupPowers.ReceiveNotices - | GroupPowers.StartProposal + public const GroupPowers DefaultEveryonePowers + = GroupPowers.AllowSetHome + | GroupPowers.Accountable + | GroupPowers.JoinChat + | GroupPowers.AllowVoiceChat + | GroupPowers.ReceiveNotices + | GroupPowers.StartProposal | GroupPowers.VoteOnProposal; // Would this be cleaner as (GroupPowers)ulong.MaxValue? - public const GroupPowers DefaultOwnerPowers + public const GroupPowers DefaultOwnerPowers = GroupPowers.Accountable | GroupPowers.AllowEditLand | GroupPowers.AllowFly @@ -823,7 +823,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if (!m_groupsAgentsInvitedToChatSession[groupID].Contains(agentID)) m_groupsAgentsInvitedToChatSession[groupID].Add(agentID); - } + } private void CreateGroupChatSessionTracking(UUID groupID) { @@ -1051,7 +1051,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups private void LogRespDataToConsoleError(UUID requestingAgentID, string function, Hashtable param, Hashtable respData) { m_log.ErrorFormat( - "[XMLRPC-GROUPS-CONNECTOR]: Error when calling {0} for {1} with params {2}. Response params are {3}", + "[XMLRPC-GROUPS-CONNECTOR]: Error when calling {0} for {1} with params {2}. Response params are {3}", function, requestingAgentID, Util.PrettyFormatToSingleLine(param), Util.PrettyFormatToSingleLine(respData)); } @@ -1151,7 +1151,7 @@ namespace Nwc.XmlRpc { _serializer.Serialize(xml, this); xml.Flush(); - } + } } XmlRpcResponse resp; -- cgit v1.1