* Renamed stuff on UserManagerBase to get implicit implementation of IUserServices (instead of stubs)

afrisby
lbsa71 2007-09-24 01:16:21 +00:00
parent b3eeb5a8dc
commit 79045abe68
7 changed files with 29 additions and 37 deletions

View File

@ -202,7 +202,7 @@ namespace OpenSim.Framework.UserManagement
/// <returns></returns> /// <returns></returns>
public virtual UserProfileData GetTheUser(string firstname, string lastname) public virtual UserProfileData GetTheUser(string firstname, string lastname)
{ {
return this.m_userManager.getUserProfile(firstname, lastname); return this.m_userManager.GetUserProfile(firstname, lastname);
} }
/// <summary> /// <summary>

View File

@ -85,7 +85,7 @@ namespace OpenSim.Framework.UserManagement
/// </summary> /// </summary>
/// <param name="uuid">The target UUID</param> /// <param name="uuid">The target UUID</param>
/// <returns>A user profile</returns> /// <returns>A user profile</returns>
public UserProfileData getUserProfile(LLUUID uuid) public UserProfileData GetUserProfile(LLUUID uuid)
{ {
foreach (KeyValuePair<string, IUserData> plugin in _plugins) foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{ {
@ -110,7 +110,7 @@ namespace OpenSim.Framework.UserManagement
/// </summary> /// </summary>
/// <param name="name">The target name</param> /// <param name="name">The target name</param>
/// <returns>A user profile</returns> /// <returns>A user profile</returns>
public UserProfileData getUserProfile(string name) public UserProfileData GetUserProfile(string name)
{ {
foreach (KeyValuePair<string, IUserData> plugin in _plugins) foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{ {
@ -136,7 +136,7 @@ namespace OpenSim.Framework.UserManagement
/// <param name="fname">First name</param> /// <param name="fname">First name</param>
/// <param name="lname">Last name</param> /// <param name="lname">Last name</param>
/// <returns>A user profile</returns> /// <returns>A user profile</returns>
public UserProfileData getUserProfile(string fname, string lname) public UserProfileData GetUserProfile(string fname, string lname)
{ {
foreach (KeyValuePair<string, IUserData> plugin in _plugins) foreach (KeyValuePair<string, IUserData> plugin in _plugins)
{ {
@ -228,7 +228,7 @@ namespace OpenSim.Framework.UserManagement
// TODO: document // TODO: document
public void clearUserAgent(LLUUID agentID) public void clearUserAgent(LLUUID agentID)
{ {
UserProfileData profile = getUserProfile(agentID); UserProfileData profile = GetUserProfile(agentID);
profile.currentAgent = null; profile.currentAgent = null;
setUserProfile(profile); setUserProfile(profile);
} }

View File

@ -122,7 +122,7 @@ namespace OpenSim.Grid.UserServer
UserProfileData userProfile; UserProfileData userProfile;
if (requestData.Contains("avatar_name")) if (requestData.Contains("avatar_name"))
{ {
userProfile = getUserProfile((string)requestData["avatar_name"]); userProfile = GetUserProfile((string)requestData["avatar_name"]);
if (userProfile == null) if (userProfile == null)
{ {
return CreateUnknownUserErrorResponse(); return CreateUnknownUserErrorResponse();
@ -144,7 +144,7 @@ namespace OpenSim.Grid.UserServer
System.Console.WriteLine("METHOD BY UUID CALLED"); System.Console.WriteLine("METHOD BY UUID CALLED");
if (requestData.Contains("avatar_uuid")) if (requestData.Contains("avatar_uuid"))
{ {
userProfile = getUserProfile((LLUUID)(string)requestData["avatar_uuid"]); userProfile = GetUserProfile((LLUUID)(string)requestData["avatar_uuid"]);
if (userProfile == null) if (userProfile == null)
{ {
return CreateUnknownUserErrorResponse(); return CreateUnknownUserErrorResponse();

View File

@ -110,11 +110,17 @@ namespace OpenSim.Region.ClientStack
} }
catch (System.Net.Sockets.SocketException e) catch (System.Net.Sockets.SocketException e)
{ {
Console.WriteLine("Remote host Closed connection"); // TODO : Actually only handle those states that we have control over, re-throw everything else,
// TODO: implement cases as we encounter them.
CloseEndPoint(epSender); switch (e.SocketErrorCode)
{
//Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); case SocketError.AlreadyInProgress:
case SocketError.NetworkReset:
default:
Console.WriteLine("Remote host Closed connection");
CloseEndPoint(epSender);
break;
}
return; return;
} }

View File

@ -45,7 +45,7 @@ namespace OpenSim.Region.Communications.Local
public LocalLoginService LoginServices; public LocalLoginService LoginServices;
public LocalInventoryService InvenServices; public LocalInventoryService InvenServices;
// public CAPSService CapsServices; // public CAPSService CapsServices;
private LocalSettings m_settings; private readonly LocalSettings m_settings;
public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings) public CommunicationsLocal(NetworkServersInfo serversInfo, BaseHttpServer httpServer, AssetCache assetCache, LocalSettings settings)
: base(serversInfo, httpServer, assetCache) : base(serversInfo, httpServer, assetCache)

View File

@ -33,7 +33,7 @@ namespace OpenSim.Region.Communications.Local
public override UserProfileData GetTheUser(string firstname, string lastname) 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) if (profile != null)
{ {
@ -46,7 +46,7 @@ namespace OpenSim.Region.Communications.Local
Console.WriteLine("No User account found so creating a new one "); Console.WriteLine("No User account found so creating a new one ");
this.m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); 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) if (profile != null)
{ {
m_Parent.InvenServices.CreateNewUserInventory(profile.UUID); m_Parent.InvenServices.CreateNewUserInventory(profile.UUID);

View File

@ -10,36 +10,22 @@ namespace OpenSim.Region.Communications.Local
{ {
public class LocalUserServices : UserManagerBase, IUserServices public class LocalUserServices : UserManagerBase, IUserServices
{ {
private CommunicationsLocal m_Parent; private readonly CommunicationsLocal m_Parent;
private NetworkServersInfo serversInfo; private readonly NetworkServersInfo serversInfo;
private uint defaultHomeX ; private readonly uint defaultHomeX ;
private uint defaultHomeY; private readonly uint defaultHomeY;
public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo) public LocalUserServices(CommunicationsLocal parent, NetworkServersInfo serversInfo)
{ {
m_Parent = parent; m_Parent = parent;
this.serversInfo = serversInfo; this.serversInfo = serversInfo;
defaultHomeX = this.serversInfo.DefaultHomeLocX; defaultHomeX = this.serversInfo.DefaultHomeLocX;
defaultHomeY = this.serversInfo.DefaultHomeLocY; 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) public UserProfileData SetupMasterUser(string firstName, string lastName)
{ {
return SetupMasterUser(firstName, lastName, ""); return SetupMasterUser(firstName, lastName, "");
@ -47,7 +33,7 @@ namespace OpenSim.Region.Communications.Local
public UserProfileData SetupMasterUser(string firstName, string lastName, string password) public UserProfileData SetupMasterUser(string firstName, string lastName, string password)
{ {
UserProfileData profile = getUserProfile(firstName, lastName); UserProfileData profile = base.GetUserProfile(firstName, lastName);
if (profile != null) if (profile != null)
{ {
@ -57,7 +43,7 @@ namespace OpenSim.Region.Communications.Local
Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account"); Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account");
this.AddUserProfile(firstName, lastName, password, defaultHomeX, defaultHomeY); this.AddUserProfile(firstName, lastName, password, defaultHomeX, defaultHomeY);
profile = getUserProfile(firstName, lastName); profile = base.GetUserProfile(firstName, lastName);
if (profile == null) if (profile == null)
{ {