Merge branch 'presence-refactor' of ssh://opensimulator.org/var/git/opensim into presence-refactor

This commit is contained in:
John Hurliman
2010-02-22 14:10:19 -08:00
94 changed files with 1068 additions and 14387 deletions

View File

@@ -69,7 +69,7 @@ namespace OpenSim.Framework
private static UUID HAIR_ASSET = new UUID("d342e6c0-b9d2-11dc-95ff-0800200c9a66");
private static UUID HAIR_ITEM = new UUID("d342e6c1-b9d2-11dc-95ff-0800200c9a66");
public readonly static int VISUALPARAM_COUNT = 218;
public readonly static int VISUALPARAM_COUNT = 218;
protected UUID m_owner;
@@ -361,7 +361,7 @@ namespace OpenSim.Framework
// This sets Visual Params with *less* weirder values then default. Instead of a ugly alien, it looks like a fat scientist
SetDefaultParams(m_visualparams);
SetDefaultWearables();
m_texture = GetDefaultTexture();
m_texture = GetDefaultTexture();
}
public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, byte[] visualParams)

View File

@@ -1,104 +0,0 @@
/*
* 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 OpenSimulator 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.Collections.Generic;
using System.Reflection;
using log4net;
using OpenMetaverse;
using OpenSim.Data;
namespace OpenSim.Framework.Communications
{
/// <summary>
/// Plugin for managing temporary user profiles.
/// </summary>
public class TemporaryUserProfilePlugin : IUserDataPlugin
{
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
protected Dictionary<UUID, UserProfileData> m_profiles = new Dictionary<UUID, UserProfileData>();
public string Name { get { return "TemporaryUserProfilePlugin"; } }
public string Version { get { return "0.1"; } }
public void Initialise() {}
public void Initialise(string connect) {}
public void Dispose() {}
public UserProfileData GetUserByUUID(UUID user)
{
//m_log.DebugFormat("[TEMP USER PROFILE]: Received request for {0}", user);
lock (m_profiles)
{
if (m_profiles.ContainsKey(user))
return m_profiles[user];
else
return null;
}
}
public UserProfileData GetUserByName(string fname, string lname)
{
// We deliberately don't look up a temporary profile by name so that we don't obscure non-temporary
// profiles.
return null;
}
public virtual void AddTemporaryUserProfile(UserProfileData userProfile)
{
//m_log.DebugFormat("[TEMP USER PROFILE]: Adding {0} {1}", userProfile.Name, userProfile.ID);
lock (m_profiles)
{
m_profiles[userProfile.ID] = userProfile;
}
}
public UserProfileData GetUserByUri(Uri uri) { return null; }
public List<AvatarPickerAvatar> GeneratePickerResults(UUID queryID, string query) { return null; }
public UserAgentData GetAgentByUUID(UUID user) { return null; }
public UserAgentData GetAgentByName(string name) { return null; }
public UserAgentData GetAgentByName(string fname, string lname) { return null; }
public void StoreWebLoginKey(UUID agentID, UUID webLoginKey) {}
public void AddNewUserProfile(UserProfileData user) {}
public bool UpdateUserProfile(UserProfileData user) { return false; }
public void AddNewUserAgent(UserAgentData agent) {}
public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) {}
public void RemoveUserFriend(UUID friendlistowner, UUID friend) {}
public void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms) {}
public List<FriendListItem> GetUserFriendList(UUID friendlistowner) { return null; }
public Dictionary<UUID, FriendRegionInfo> GetFriendRegionInfos(List<UUID> uuids) { return null; }
public bool MoneyTransferRequest(UUID from, UUID to, uint amount) { return false; }
public bool InventoryTransferRequest(UUID from, UUID to, UUID inventory) { return false; }
public AvatarAppearance GetUserAppearance(UUID user) { return null; }
public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) {}
public void ResetAttachments(UUID userID) {}
public void LogoutUsers(UUID regionID) {}
}
}

View File

@@ -38,7 +38,7 @@ namespace OpenSim.Framework.Console
{
/// <summary>
/// A console that uses cursor control and color
/// </summary>
/// </summary>
public class LocalConsole : CommandConsole
{
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -100,8 +100,8 @@ namespace OpenSim.Framework.Console
private int SetCursorTop(int top)
{
// From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
// to set a cursor row position with a currently invalid column, mono will throw an exception.
// Therefore, we need to make sure that the column position is valid first.
// to set a cursor row position with a currently invalid column, mono will throw an exception.
// Therefore, we need to make sure that the column position is valid first.
int left = System.Console.CursorLeft;
if (left < 0)
@@ -129,12 +129,12 @@ namespace OpenSim.Framework.Console
/// </param>
/// <returns>
/// The new cursor column.
/// </returns>
/// </returns>
private int SetCursorLeft(int left)
{
// From at least mono 2.4.2.3, window resizing can give mono an invalid row and column values. If we try
// to set a cursor column position with a currently invalid row, mono will throw an exception.
// Therefore, we need to make sure that the row position is valid first.
// to set a cursor column position with a currently invalid row, mono will throw an exception.
// Therefore, we need to make sure that the row position is valid first.
int top = System.Console.CursorTop;
if (top < 0)
@@ -183,7 +183,7 @@ namespace OpenSim.Framework.Console
System.Console.Write("{0}", prompt);
SetCursorTop(new_y);
SetCursorLeft(new_x);
SetCursorLeft(new_x);
}
}

View File

@@ -302,9 +302,9 @@ namespace OpenSim.Framework.Console
if (!UUID.TryParse(post["ID"].ToString(), out id))
return reply;
lock(m_Connections)
lock (m_Connections)
{
if(!m_Connections.ContainsKey(id))
if (!m_Connections.ContainsKey(id))
return reply;
}

View File

@@ -483,7 +483,6 @@ namespace OpenSim.Framework
else
m_externalHostName = externalName;
m_regionType = config.GetString("RegionType", String.Empty);
// Prim stuff

View File

@@ -589,11 +589,17 @@ namespace OpenSim.Framework
public static IPAddress GetLocalHost()
{
string dnsAddress = "localhost";
IPAddress[] iplist = GetLocalHosts();
IPAddress[] hosts = Dns.GetHostEntry(dnsAddress).AddressList;
if (iplist.Length == 0) // No accessible external interfaces
{
IPAddress[] loopback = Dns.GetHostAddresses("localhost");
IPAddress localhost = loopback[0];
foreach (IPAddress host in hosts)
return localhost;
}
foreach (IPAddress host in iplist)
{
if (!IPAddress.IsLoopback(host) && host.AddressFamily == AddressFamily.InterNetwork)
{
@@ -601,15 +607,15 @@ namespace OpenSim.Framework
}
}
if (hosts.Length > 0)
if (iplist.Length > 0)
{
foreach (IPAddress host in hosts)
foreach (IPAddress host in iplist)
{
if (host.AddressFamily == AddressFamily.InterNetwork)
return host;
}
// Well all else failed...
return hosts[0];
return iplist[0];
}
return null;