From 47180080f0f4b93c60232b47ca4e093bd7c73a1d Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 18 Mar 2008 05:16:43 +0000 Subject: Formatting cleanup. --- OpenSim/Grid/MessagingServer/MessageService.cs | 107 +++++++++---------------- 1 file changed, 39 insertions(+), 68 deletions(-) (limited to 'OpenSim/Grid/MessagingServer/MessageService.cs') diff --git a/OpenSim/Grid/MessagingServer/MessageService.cs b/OpenSim/Grid/MessagingServer/MessageService.cs index fc16a88..c4e8a58 100644 --- a/OpenSim/Grid/MessagingServer/MessageService.cs +++ b/OpenSim/Grid/MessagingServer/MessageService.cs @@ -1,30 +1,30 @@ /* -* Copyright (c) Contributors, http://opensimulator.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -* -*/ + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + using System; using System.Net; using System.Net.Sockets; @@ -60,8 +60,6 @@ namespace OpenSim.Grid.MessagingServer // Hashtable containing work units that need to be processed private Hashtable m_unProcessedWorkUnits = new Hashtable(); - - public MessageService(MessageServerConfig cfg) { m_cfg = cfg; @@ -69,11 +67,9 @@ namespace OpenSim.Grid.MessagingServer #region RegionComms Methods - #endregion #region FriendList Methods - /// /// Process Friendlist subscriptions for a user @@ -102,8 +98,6 @@ namespace OpenSim.Grid.MessagingServer SubscribeToPresenceUpdates(userpresence, friendup, uFriendList[i],i); } } - - } /// @@ -118,7 +112,6 @@ namespace OpenSim.Grid.MessagingServer public void SubscribeToPresenceUpdates(UserPresenceData userpresence, UserPresenceData friendpresence, FriendListItem uFriendListItem, int uFriendListIndex) { - if ((uFriendListItem.FriendListOwnerPerms & (uint)FriendRights.CanSeeOnline) != 0) { // Subscribe and Send Out updates @@ -126,12 +119,10 @@ namespace OpenSim.Grid.MessagingServer { userpresence.subscriptionData.Add(friendpresence.agentData.AgentID); //Send Region Notice.... - } else { // we need to send out online status update, but the user is already subscribed - } PresenceInformer friendlistupdater = new PresenceInformer(); friendlistupdater.presence1 = friendpresence; @@ -141,6 +132,7 @@ namespace OpenSim.Grid.MessagingServer //SendRegionPresenceUpdate(friendpresence, userpresence); } + if ((uFriendListItem.FriendPerms & (uint)FriendRights.CanSeeOnline) != 0) { if (!friendpresence.subscriptionData.Contains(userpresence.agentData.AgentID)) @@ -151,7 +143,6 @@ namespace OpenSim.Grid.MessagingServer else { // we need to send out online status update, but the user is already subscribed - } PresenceInformer friendlistupdater = new PresenceInformer(); friendlistupdater.presence1 = userpresence; @@ -162,10 +153,8 @@ namespace OpenSim.Grid.MessagingServer //SendRegionPresenceUpdate(userpresence, friendpresence); } - } - /// /// Adds a backreference so presence specific data doesn't have to be /// enumerated for each logged in user every time someone logs on or off. @@ -214,6 +203,7 @@ namespace OpenSim.Grid.MessagingServer } } } + /// /// Logoff Processor. Call this to clean up agent presence data and send logoff presence notifications /// @@ -242,7 +232,6 @@ namespace OpenSim.Grid.MessagingServer //} //} - for (int i = 0; i < AgentsNeedingNotification.Count; i++) { // TODO: Do Region Notifications @@ -254,7 +243,7 @@ namespace OpenSim.Grid.MessagingServer } } - // This might need to be enumerated and checked before we try to remove it. + // This might need to be enumerated and checked before we try to remove it. if (friendd != null) { lock (friendd) @@ -268,12 +257,12 @@ namespace OpenSim.Grid.MessagingServer { fl[j].onlinestatus = false; } - } + friendd.friendData = fl; m_presences[AgentsNeedingNotification[i]] = friendd; - } + PresenceInformer friendlistupdater = new PresenceInformer(); friendlistupdater.presence1 = AgentData; friendlistupdater.presence2 = friendd; @@ -283,17 +272,12 @@ namespace OpenSim.Grid.MessagingServer //SendRegionPresenceUpdate(AgentData, friendd); - //removeBackReference(AgentID, AgentsNeedingNotification[i]); } - } - } - } - #endregion #region UserServer Comms @@ -330,7 +314,6 @@ namespace OpenSim.Grid.MessagingServer // Return Empty list (no friends) } return buddylist; - } /// @@ -343,7 +326,6 @@ namespace OpenSim.Grid.MessagingServer List buddylist = new List(); int buddycount = Convert.ToInt32((string)data["avcount"]); - for (int i = 0; i < buddycount; i++) { FriendListItem buddylistitem = new FriendListItem(); @@ -356,9 +338,9 @@ namespace OpenSim.Grid.MessagingServer buddylist.Add(buddylistitem); } - return buddylist; } + /// /// UserServer sends an expect_user method /// this handles the method and provisions the @@ -415,7 +397,6 @@ namespace OpenSim.Grid.MessagingServer ProcessFriendListSubscriptions(up); - return new XmlRpcResponse(); } @@ -427,19 +408,17 @@ namespace OpenSim.Grid.MessagingServer /// public XmlRpcResponse UserLoggedOff(XmlRpcRequest request) { - Hashtable requestData = (Hashtable)request.Params[0]; LLUUID AgentID = new LLUUID((string)requestData["agentid"]); - ProcessLogOff(AgentID); - return new XmlRpcResponse(); } #endregion + #region regioninfo gathering /// @@ -461,6 +440,7 @@ namespace OpenSim.Grid.MessagingServer } return regionInfo; } + /// /// Get RegionProfileData from the GridServer /// We'll Cache this information and use it for presence updates @@ -471,7 +451,6 @@ namespace OpenSim.Grid.MessagingServer { RegionProfileData regionProfile = null; try { - Hashtable requestData = new Hashtable(); requestData["region_handle"] = regionHandle.ToString(); requestData["authkey"] = m_cfg.GridSendKey; @@ -516,17 +495,16 @@ namespace OpenSim.Grid.MessagingServer catch (WebException) { m_log.Error("[GRID]: " + - "Region lookup failed for: " + regionHandle.ToString() + - " - Is the GridServer down?"); + "Region lookup failed for: " + regionHandle.ToString() + + " - Is the GridServer down?"); return null; } - return regionProfile; } + public bool registerWithUserServer () { - Hashtable UserParams = new Hashtable(); // Login / Authentication @@ -542,9 +520,6 @@ namespace OpenSim.Grid.MessagingServer UserParams["recvkey"] = m_cfg.UserRecvKey; UserParams["sendkey"] = m_cfg.UserRecvKey; - - - // Package into an XMLRPC Request ArrayList SendParams = new ArrayList(); SendParams.Add(UserParams); @@ -573,12 +548,10 @@ namespace OpenSim.Grid.MessagingServer { return false; } - - } + public bool deregisterWithUserServer() { - Hashtable UserParams = new Hashtable(); // Login / Authentication @@ -623,10 +596,8 @@ namespace OpenSim.Grid.MessagingServer { return false; } - - } + #endregion } - } -- cgit v1.1