CommunicationsManager is practically empty. Only NetworkServersInfo is there.
parent
49618dc102
commit
0c2946031b
|
@ -45,41 +45,12 @@ namespace OpenSim.Framework.Communications
|
|||
{
|
||||
//private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected Dictionary<UUID, string[]> m_nameRequestCache = new Dictionary<UUID, string[]>();
|
||||
|
||||
public IUserService UserService
|
||||
{
|
||||
get { return m_userService; }
|
||||
}
|
||||
protected IUserService m_userService;
|
||||
|
||||
public IAvatarService AvatarService
|
||||
{
|
||||
get { return m_avatarService; }
|
||||
}
|
||||
protected IAvatarService m_avatarService;
|
||||
|
||||
public IInterServiceInventoryServices InterServiceInventoryService
|
||||
{
|
||||
get { return m_interServiceInventoryService; }
|
||||
}
|
||||
protected IInterServiceInventoryServices m_interServiceInventoryService;
|
||||
|
||||
public NetworkServersInfo NetworkServersInfo
|
||||
{
|
||||
get { return m_networkServersInfo; }
|
||||
}
|
||||
protected NetworkServersInfo m_networkServersInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Interface to user service for administrating users.
|
||||
/// </summary>
|
||||
public IUserAdminService UserAdminService
|
||||
{
|
||||
get { return m_userAdminService; }
|
||||
}
|
||||
protected IUserAdminService m_userAdminService;
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
|
@ -90,20 +61,5 @@ namespace OpenSim.Framework.Communications
|
|||
m_networkServersInfo = serversInfo;
|
||||
}
|
||||
|
||||
#region Packet Handlers
|
||||
|
||||
public void UpdateAvatarPropertiesRequest(IClientAPI remote_client, UserProfileData UserProfile)
|
||||
{
|
||||
m_userService.UpdateUserProfile(UserProfile);
|
||||
return;
|
||||
}
|
||||
|
||||
public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query)
|
||||
{
|
||||
List<AvatarPickerAvatar> pickerlist = m_userService.GenerateAgentPickerRequestResponse(queryID, query);
|
||||
return pickerlist;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -686,25 +686,6 @@ namespace OpenSim.Framework.Communications
|
|||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// WARNING: This is a horrible hack
|
||||
// The purpose here is to avoid touching the user server at this point.
|
||||
// There are dragons there that I can't deal with right now.
|
||||
// diva 06/09/09
|
||||
//
|
||||
if (m_InventoryService != null)
|
||||
{
|
||||
// local service (standalone)
|
||||
m_log.Debug("[USERSTORAGE]: using IInventoryService to create user's inventory");
|
||||
m_InventoryService.CreateUserInventory(userProf.ID);
|
||||
}
|
||||
else if (m_commsManager.InterServiceInventoryService != null)
|
||||
{
|
||||
// used by the user server
|
||||
m_log.Debug("[USERSTORAGE]: using m_commsManager.InterServiceInventoryService to create user's inventory");
|
||||
m_commsManager.InterServiceInventoryService.CreateNewUserInventory(userProf.ID);
|
||||
}
|
||||
|
||||
return userProf.ID;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,7 +34,6 @@ namespace OpenSim.Grid.UserServer
|
|||
public UserServerCommsManager(IInterServiceInventoryServices interServiceInventoryService)
|
||||
: base(null, null)
|
||||
{
|
||||
m_interServiceInventoryService = interServiceInventoryService;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,8 +52,6 @@ namespace OpenSim.Region.Communications.Hypergrid
|
|||
userServices.AddPlugin(new TemporaryUserProfilePlugin());
|
||||
userServices.AddPlugin(new HGUserDataPlugin(this, userServices));
|
||||
|
||||
m_userService = userServices;
|
||||
m_avatarService = userServices;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,9 +58,6 @@ namespace OpenSim.Region.Communications.Hypergrid
|
|||
hgUserService.AddPlugin(new TemporaryUserProfilePlugin());
|
||||
hgUserService.AddPlugin(new HGUserDataPlugin(this, hgUserService));
|
||||
|
||||
m_userService = hgUserService;
|
||||
m_userAdminService = hgUserService;
|
||||
m_avatarService = hgUserService;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,9 +48,6 @@ namespace OpenSim.Region.Communications.Local
|
|||
serversInfo.DefaultHomeLocX, serversInfo.DefaultHomeLocY, this);
|
||||
lus.AddPlugin(new TemporaryUserProfilePlugin());
|
||||
lus.AddPlugin(configSettings.StandaloneUserPlugin, configSettings.StandaloneUserSource);
|
||||
m_userService = lus;
|
||||
m_userAdminService = lus;
|
||||
m_avatarService = lus;
|
||||
|
||||
//LocalLoginService loginService = CreateLoginService(libraryRootFolder, inventoryService, userService, backendService);
|
||||
}
|
||||
|
|
|
@ -45,8 +45,6 @@ namespace OpenSim.Region.Communications.OGS1
|
|||
userServices.AddPlugin(new TemporaryUserProfilePlugin());
|
||||
userServices.AddPlugin(new OGS1UserDataPlugin(this));
|
||||
|
||||
m_userService = userServices;
|
||||
m_avatarService = (IAvatarService)m_userService;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -154,9 +154,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
public void AvatarIsWearing(Object sender, AvatarWearingArgs e)
|
||||
{
|
||||
IClientAPI clientView = (IClientAPI)sender;
|
||||
ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId);
|
||||
ScenePresence sp = m_scene.GetScenePresence(clientView.AgentId);
|
||||
|
||||
if (avatar == null)
|
||||
if (sp == null)
|
||||
{
|
||||
m_log.Error("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event");
|
||||
return;
|
||||
|
@ -166,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance))
|
||||
{
|
||||
m_log.Warn("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresence");
|
||||
avatAppearance = avatar.Appearance;
|
||||
avatAppearance = sp.Appearance;
|
||||
}
|
||||
|
||||
//m_log.DebugFormat("[APPEARANCE]: Received wearables for {0}", clientView.Name);
|
||||
|
@ -179,10 +179,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
}
|
||||
}
|
||||
|
||||
SetAppearanceAssets(avatar.UUID, ref avatAppearance);
|
||||
SetAppearanceAssets(sp.UUID, ref avatAppearance);
|
||||
AvatarData adata = new AvatarData(avatAppearance);
|
||||
m_scene.AvatarService.SetAvatar(clientView.AgentId, adata);
|
||||
|
||||
m_scene.CommsManager.AvatarService.UpdateUserAppearance(clientView.AgentId, avatAppearance);
|
||||
avatar.Appearance = avatAppearance;
|
||||
sp.Appearance = avatAppearance;
|
||||
}
|
||||
|
||||
public static void GetDefaultAvatarAppearance(out AvatarWearable[] wearables, out byte[] visualParams)
|
||||
|
@ -193,7 +194,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
|
||||
public void UpdateDatabase(UUID user, AvatarAppearance appearance)
|
||||
{
|
||||
m_scene.CommsManager.AvatarService.UpdateUserAppearance(user, appearance);
|
||||
AvatarData adata = new AvatarData(appearance);
|
||||
m_scene.AvatarService.SetAvatar(user, adata);
|
||||
|
||||
}
|
||||
|
||||
private static byte[] GetDefaultVisualParams()
|
||||
|
|
|
@ -332,14 +332,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
//EventManager.TriggerAvatarPickerRequest();
|
||||
|
||||
List<AvatarPickerAvatar> AvatarResponses = new List<AvatarPickerAvatar>();
|
||||
AvatarResponses = m_sceneGridService.GenerateAgentPickerRequestResponse(RequestID, query);
|
||||
List<UserAccount> accounts = UserAccountService.GetUserAccounts(RegionInfo.ScopeID, query);
|
||||
|
||||
if (accounts == null)
|
||||
return;
|
||||
|
||||
AvatarPickerReplyPacket replyPacket = (AvatarPickerReplyPacket) PacketPool.Instance.GetPacket(PacketType.AvatarPickerReply);
|
||||
// TODO: don't create new blocks if recycling an old packet
|
||||
|
||||
AvatarPickerReplyPacket.DataBlock[] searchData =
|
||||
new AvatarPickerReplyPacket.DataBlock[AvatarResponses.Count];
|
||||
new AvatarPickerReplyPacket.DataBlock[accounts.Count];
|
||||
AvatarPickerReplyPacket.AgentDataBlock agentData = new AvatarPickerReplyPacket.AgentDataBlock();
|
||||
|
||||
agentData.AgentID = avatarID;
|
||||
|
@ -348,16 +350,16 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
//byte[] bytes = new byte[AvatarResponses.Count*32];
|
||||
|
||||
int i = 0;
|
||||
foreach (AvatarPickerAvatar item in AvatarResponses)
|
||||
foreach (UserAccount item in accounts)
|
||||
{
|
||||
UUID translatedIDtem = item.AvatarID;
|
||||
UUID translatedIDtem = item.PrincipalID;
|
||||
searchData[i] = new AvatarPickerReplyPacket.DataBlock();
|
||||
searchData[i].AvatarID = translatedIDtem;
|
||||
searchData[i].FirstName = Utils.StringToBytes((string) item.firstName);
|
||||
searchData[i].LastName = Utils.StringToBytes((string) item.lastName);
|
||||
searchData[i].FirstName = Utils.StringToBytes((string) item.FirstName);
|
||||
searchData[i].LastName = Utils.StringToBytes((string) item.LastName);
|
||||
i++;
|
||||
}
|
||||
if (AvatarResponses.Count == 0)
|
||||
if (accounts.Count == 0)
|
||||
{
|
||||
searchData = new AvatarPickerReplyPacket.DataBlock[0];
|
||||
}
|
||||
|
|
|
@ -1444,11 +1444,6 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
//m_log.DebugFormat("[SCENE COMM]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
|
||||
}
|
||||
|
||||
public List<AvatarPickerAvatar> GenerateAgentPickerRequestResponse(UUID queryID, string query)
|
||||
{
|
||||
return m_commsProvider.GenerateAgentPickerRequestResponse(queryID, query);
|
||||
}
|
||||
|
||||
public List<GridRegion> RequestNamedRegions(string name, int maxNumber)
|
||||
{
|
||||
return m_scene.GridService.GetRegionsByName(UUID.Zero, name, maxNumber);
|
||||
|
|
|
@ -2573,7 +2573,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
m_appearance.SetAppearance(textureEntry, visualParams);
|
||||
if (m_appearance.AvatarHeight > 0)
|
||||
SetHeight(m_appearance.AvatarHeight);
|
||||
m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
|
||||
AvatarData adata = new AvatarData(m_appearance);
|
||||
m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata);
|
||||
|
||||
SendAppearanceToAllOtherAgents();
|
||||
if (!m_startAnimationSet)
|
||||
|
@ -2593,7 +2594,8 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
public void SetWearable(int wearableId, AvatarWearable wearable)
|
||||
{
|
||||
m_appearance.SetWearable(wearableId, wearable);
|
||||
m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
|
||||
AvatarData adata = new AvatarData(m_appearance);
|
||||
m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata);
|
||||
m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,7 @@ using OpenSim.Region.Framework.Scenes;
|
|||
using OpenSim.Region.CoreModules.Avatar.NPC;
|
||||
using OpenSim.Framework;
|
||||
using Timer=System.Timers.Timer;
|
||||
using OpenSim.Services.Interfaces;
|
||||
|
||||
namespace OpenSim.Region.OptionalModules.World.NPC
|
||||
{
|
||||
|
@ -63,11 +64,16 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
|||
if (m_appearanceCache.ContainsKey(target))
|
||||
return m_appearanceCache[target];
|
||||
|
||||
AvatarAppearance x = scene.CommsManager.AvatarService.GetUserAppearance(target);
|
||||
AvatarData adata = scene.AvatarService.GetAvatar(target);
|
||||
if (adata != null)
|
||||
{
|
||||
AvatarAppearance x = adata.ToAvatarAppearance();
|
||||
|
||||
m_appearanceCache.Add(target, x);
|
||||
m_appearanceCache.Add(target, x);
|
||||
|
||||
return x;
|
||||
return x;
|
||||
}
|
||||
return new AvatarAppearance();
|
||||
}
|
||||
|
||||
public UUID CreateNPC(string firstname, string lastname,Vector3 position, Scene scene, UUID cloneAppearanceFrom)
|
||||
|
|
|
@ -62,8 +62,6 @@ namespace OpenSim.Tests.Common.Mock
|
|||
lus.AddPlugin(new TemporaryUserProfilePlugin());
|
||||
m_userDataPlugin = new TestUserDataPlugin();
|
||||
lus.AddPlugin(m_userDataPlugin);
|
||||
m_userService = lus;
|
||||
m_userAdminService = lus;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue