From 79045abe685efef2c497b6cae97601689186153f Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Mon, 24 Sep 2007 01:16:21 +0000 Subject: [PATCH] * Renamed stuff on UserManagerBase to get implicit implementation of IUserServices (instead of stubs) --- OpenSim/Framework/UserManager/LoginService.cs | 2 +- .../Framework/UserManager/UserManagerBase.cs | 8 +++--- OpenSim/Grid/UserServer/UserManager.cs | 4 +-- OpenSim/Region/ClientStack/UDPServer.cs | 18 ++++++++---- .../Local/CommunicationsLocal.cs | 2 +- .../Communications/Local/LocalLoginService.cs | 4 +-- .../Communications/Local/LocalUserServices.cs | 28 +++++-------------- 7 files changed, 29 insertions(+), 37 deletions(-) diff --git a/OpenSim/Framework/UserManager/LoginService.cs b/OpenSim/Framework/UserManager/LoginService.cs index 32f5565c6d..483665e25f 100644 --- a/OpenSim/Framework/UserManager/LoginService.cs +++ b/OpenSim/Framework/UserManager/LoginService.cs @@ -202,7 +202,7 @@ namespace OpenSim.Framework.UserManagement /// public virtual UserProfileData GetTheUser(string firstname, string lastname) { - return this.m_userManager.getUserProfile(firstname, lastname); + return this.m_userManager.GetUserProfile(firstname, lastname); } /// diff --git a/OpenSim/Framework/UserManager/UserManagerBase.cs b/OpenSim/Framework/UserManager/UserManagerBase.cs index 649831df5e..82b3731c3f 100644 --- a/OpenSim/Framework/UserManager/UserManagerBase.cs +++ b/OpenSim/Framework/UserManager/UserManagerBase.cs @@ -85,7 +85,7 @@ namespace OpenSim.Framework.UserManagement /// /// The target UUID /// A user profile - public UserProfileData getUserProfile(LLUUID uuid) + public UserProfileData GetUserProfile(LLUUID uuid) { foreach (KeyValuePair plugin in _plugins) { @@ -110,7 +110,7 @@ namespace OpenSim.Framework.UserManagement /// /// The target name /// A user profile - public UserProfileData getUserProfile(string name) + public UserProfileData GetUserProfile(string name) { foreach (KeyValuePair plugin in _plugins) { @@ -136,7 +136,7 @@ namespace OpenSim.Framework.UserManagement /// First name /// Last name /// A user profile - public UserProfileData getUserProfile(string fname, string lname) + public UserProfileData GetUserProfile(string fname, string lname) { foreach (KeyValuePair plugin in _plugins) { @@ -228,7 +228,7 @@ namespace OpenSim.Framework.UserManagement // TODO: document public void clearUserAgent(LLUUID agentID) { - UserProfileData profile = getUserProfile(agentID); + UserProfileData profile = GetUserProfile(agentID); profile.currentAgent = null; setUserProfile(profile); } diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index 44f92b4c1f..20f3b95e0f 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -122,7 +122,7 @@ namespace OpenSim.Grid.UserServer UserProfileData userProfile; if (requestData.Contains("avatar_name")) { - userProfile = getUserProfile((string)requestData["avatar_name"]); + userProfile = GetUserProfile((string)requestData["avatar_name"]); if (userProfile == null) { return CreateUnknownUserErrorResponse(); @@ -144,7 +144,7 @@ namespace OpenSim.Grid.UserServer System.Console.WriteLine("METHOD BY UUID CALLED"); if (requestData.Contains("avatar_uuid")) { - userProfile = getUserProfile((LLUUID)(string)requestData["avatar_uuid"]); + userProfile = GetUserProfile((LLUUID)(string)requestData["avatar_uuid"]); if (userProfile == null) { return CreateUnknownUserErrorResponse(); diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index 64ed4b4655..9a3d01a3f4 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -103,18 +103,24 @@ namespace OpenSim.Region.ClientStack Packet packet = null; int numBytes; - + try { numBytes = Server.EndReceiveFrom(result, ref epSender); } catch (System.Net.Sockets.SocketException e) { - Console.WriteLine("Remote host Closed connection"); - - CloseEndPoint(epSender); - - //Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); + // TODO : Actually only handle those states that we have control over, re-throw everything else, + // TODO: implement cases as we encounter them. + switch (e.SocketErrorCode) + { + case SocketError.AlreadyInProgress: + case SocketError.NetworkReset: + default: + Console.WriteLine("Remote host Closed connection"); + CloseEndPoint(epSender); + break; + } return; } diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index e326a1e2c2..0105b9d0ec 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -45,7 +45,7 @@ namespace OpenSim.Region.Communications.Local public LocalLoginService LoginServices; public LocalInventoryService InvenServices; // public CAPSService CapsServices; - private LocalSettings m_settings; + private readonly LocalSettings m_settings; public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings) : base(serversInfo, httpServer, assetCache) diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 3c43d29008..9c15742906 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.Communications.Local public override UserProfileData GetTheUser(string firstname, string lastname) { - UserProfileData profile = this.m_userManager.getUserProfile(firstname, lastname); + UserProfileData profile = this.m_userManager.GetUserProfile(firstname, lastname); if (profile != null) { @@ -46,7 +46,7 @@ namespace OpenSim.Region.Communications.Local Console.WriteLine("No User account found so creating a new one "); this.m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); - profile = this.m_userManager.getUserProfile(firstname, lastname); + profile = this.m_userManager.GetUserProfile(firstname, lastname); if (profile != null) { m_Parent.InvenServices.CreateNewUserInventory(profile.UUID); diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index 1a409bf0fb..02b6e60ab3 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -10,36 +10,22 @@ namespace OpenSim.Region.Communications.Local { public class LocalUserServices : UserManagerBase, IUserServices { - private CommunicationsLocal m_Parent; + private readonly CommunicationsLocal m_Parent; - private NetworkServersInfo serversInfo; - private uint defaultHomeX ; - private uint defaultHomeY; + private readonly NetworkServersInfo serversInfo; + private readonly uint defaultHomeX ; + private readonly uint defaultHomeY; public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo) { m_Parent = parent; this.serversInfo = serversInfo; + defaultHomeX = this.serversInfo.DefaultHomeLocX; defaultHomeY = this.serversInfo.DefaultHomeLocY; } - public UserProfileData GetUserProfile(string firstName, string lastName) - { - return GetUserProfile(firstName + " " + lastName); - } - - public UserProfileData GetUserProfile(string name) - { - return this.getUserProfile(name); - } - - public UserProfileData GetUserProfile(LLUUID avatarID) - { - return this.getUserProfile(avatarID); - } - public UserProfileData SetupMasterUser(string firstName, string lastName) { return SetupMasterUser(firstName, lastName, ""); @@ -47,7 +33,7 @@ namespace OpenSim.Region.Communications.Local public UserProfileData SetupMasterUser(string firstName, string lastName, string password) { - UserProfileData profile = getUserProfile(firstName, lastName); + UserProfileData profile = base.GetUserProfile(firstName, lastName); if (profile != null) { @@ -57,7 +43,7 @@ namespace OpenSim.Region.Communications.Local Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account"); this.AddUserProfile(firstName, lastName, password, defaultHomeX, defaultHomeY); - profile = getUserProfile(firstName, lastName); + profile = base.GetUserProfile(firstName, lastName); if (profile == null) {