Bunch of fixes that reduce the number of times appearance
and avatar data are sent. And the number of times they are stored.viewer-2-initial-appearance
parent
68666efd25
commit
f5c9a56c8b
|
@ -45,6 +45,7 @@ namespace OpenSim.Framework
|
||||||
public readonly static int VISUALPARAM_COUNT = 218;
|
public readonly static int VISUALPARAM_COUNT = 218;
|
||||||
|
|
||||||
public readonly static int TEXTURE_COUNT = 21;
|
public readonly static int TEXTURE_COUNT = 21;
|
||||||
|
public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
|
||||||
|
|
||||||
protected UUID m_owner;
|
protected UUID m_owner;
|
||||||
protected int m_serial = 1;
|
protected int m_serial = 1;
|
||||||
|
@ -347,14 +348,8 @@ namespace OpenSim.Framework
|
||||||
protected virtual void SetDefaultTexture()
|
protected virtual void SetDefaultTexture()
|
||||||
{
|
{
|
||||||
m_texture = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
|
m_texture = new Primitive.TextureEntry(new UUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
|
||||||
// The initialization of these seems to force a rebake regardless of whether it is needed
|
for (uint i = 0; i < TEXTURE_COUNT; i++)
|
||||||
// m_textures.CreateFace(0).TextureID = new UUID("00000000-0000-1111-9999-000000000012");
|
m_texture.CreateFace(i).TextureID = new UUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE);
|
||||||
// m_textures.CreateFace(1).TextureID = Util.BLANK_TEXTURE_UUID;
|
|
||||||
// m_textures.CreateFace(2).TextureID = Util.BLANK_TEXTURE_UUID;
|
|
||||||
// m_textures.CreateFace(3).TextureID = new UUID("6522E74D-1660-4E7F-B601-6F48C1659A77");
|
|
||||||
// m_textures.CreateFace(4).TextureID = new UUID("7CA39B4C-BD19-4699-AFF7-F93FD03D3E7B");
|
|
||||||
// m_textures.CreateFace(5).TextureID = new UUID("00000000-0000-1111-9999-000000000010");
|
|
||||||
// m_textures.CreateFace(6).TextureID = new UUID("00000000-0000-1111-9999-000000000011");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -371,7 +366,7 @@ namespace OpenSim.Framework
|
||||||
// made. We determine if any of the textures actually
|
// made. We determine if any of the textures actually
|
||||||
// changed to know if the appearance should be saved later
|
// changed to know if the appearance should be saved later
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
|
for (uint i = 0; i < AvatarAppearance.TEXTURE_COUNT; i++)
|
||||||
{
|
{
|
||||||
Primitive.TextureEntryFace newface = textureEntry.FaceTextures[i];
|
Primitive.TextureEntryFace newface = textureEntry.FaceTextures[i];
|
||||||
Primitive.TextureEntryFace oldface = m_texture.FaceTextures[i];
|
Primitive.TextureEntryFace oldface = m_texture.FaceTextures[i];
|
||||||
|
@ -385,7 +380,6 @@ namespace OpenSim.Framework
|
||||||
if (oldface != null && oldface.TextureID == newface.TextureID) continue;
|
if (oldface != null && oldface.TextureID == newface.TextureID) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_texture.FaceTextures[i] = (newface != null) ? new Primitive.TextureEntryFace(newface) : null;
|
|
||||||
changed = true;
|
changed = true;
|
||||||
// DEBUG ON
|
// DEBUG ON
|
||||||
if (newface != null)
|
if (newface != null)
|
||||||
|
@ -393,6 +387,7 @@ namespace OpenSim.Framework
|
||||||
// DEBUG OFF
|
// DEBUG OFF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_texture = textureEntry;
|
||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -415,8 +410,8 @@ namespace OpenSim.Framework
|
||||||
if (visualParams[i] != m_visualparams[i])
|
if (visualParams[i] != m_visualparams[i])
|
||||||
{
|
{
|
||||||
// DEBUG ON
|
// DEBUG ON
|
||||||
m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
|
// m_log.WarnFormat("[AVATARAPPEARANCE] vparams changed [{0}] {1} ==> {2}",
|
||||||
i,m_visualparams[i],visualParams[i]);
|
// i,m_visualparams[i],visualParams[i]);
|
||||||
// DEBUG OFF
|
// DEBUG OFF
|
||||||
m_visualparams[i] = visualParams[i];
|
m_visualparams[i] = visualParams[i];
|
||||||
changed = true;
|
changed = true;
|
||||||
|
@ -581,6 +576,8 @@ namespace OpenSim.Framework
|
||||||
m_attachments.Clear();
|
m_attachments.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region Packing Functions
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Create an OSDMap from the appearance data
|
/// Create an OSDMap from the appearance data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -605,7 +602,7 @@ namespace OpenSim.Framework
|
||||||
if (m_texture.FaceTextures[i] != null)
|
if (m_texture.FaceTextures[i] != null)
|
||||||
textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID));
|
textures.Add(OSD.FromUUID(m_texture.FaceTextures[i].TextureID));
|
||||||
else
|
else
|
||||||
textures.Add(OSD.FromUUID(UUID.Zero));
|
textures.Add(OSD.FromUUID(AppearanceManager.DEFAULT_AVATAR_TEXTURE));
|
||||||
}
|
}
|
||||||
data["textures"] = textures;
|
data["textures"] = textures;
|
||||||
|
|
||||||
|
@ -657,12 +654,10 @@ namespace OpenSim.Framework
|
||||||
OSDArray textures = (OSDArray)(data["textures"]);
|
OSDArray textures = (OSDArray)(data["textures"]);
|
||||||
for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT && i < textures.Count; i++)
|
for (int i = 0; i < AvatarAppearance.TEXTURE_COUNT && i < textures.Count; i++)
|
||||||
{
|
{
|
||||||
|
UUID textureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
|
||||||
if (textures[i] != null)
|
if (textures[i] != null)
|
||||||
{
|
textureID = textures[i].AsUUID();
|
||||||
UUID textureID = textures[i].AsUUID();
|
m_texture.CreateFace((uint)i).TextureID = new UUID(textureID);
|
||||||
if (textureID != UUID.Zero)
|
|
||||||
m_texture.CreateFace((uint)i).TextureID = textureID;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -697,6 +692,9 @@ namespace OpenSim.Framework
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region VPElement
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Viewer Params Array Element for AgentSetAppearance
|
/// Viewer Params Array Element for AgentSetAppearance
|
||||||
|
@ -1460,5 +1458,6 @@ namespace OpenSim.Framework
|
||||||
SKIRT_SKIRT_GREEN = 216,
|
SKIRT_SKIRT_GREEN = 216,
|
||||||
SKIRT_SKIRT_BLUE = 217
|
SKIRT_SKIRT_BLUE = 217
|
||||||
}
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -123,15 +123,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
|
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.GetFromItemID(), remoteClient.AgentId);
|
||||||
|
|
||||||
// Save avatar attachment information
|
// Save avatar attachment information
|
||||||
ScenePresence presence;
|
m_log.Info(
|
||||||
if (m_scene.AvatarService != null && m_scene.TryGetScenePresence(remoteClient.AgentId, out presence))
|
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
|
||||||
{
|
+ ", AttachmentPoint: " + AttachmentPt);
|
||||||
m_log.Info(
|
|
||||||
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
|
|
||||||
+ ", AttachmentPoint: " + AttachmentPt);
|
|
||||||
|
|
||||||
m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance);
|
if (m_scene.AvatarFactory != null)
|
||||||
}
|
m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -382,8 +379,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
item = m_scene.InventoryService.GetItem(item);
|
item = m_scene.InventoryService.GetItem(item);
|
||||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
|
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, item.AssetID /* att.UUID */);
|
||||||
|
|
||||||
if (m_scene.AvatarService != null)
|
if (m_scene.AvatarFactory != null)
|
||||||
m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance);
|
m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -405,11 +402,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
presence.Appearance.DetachAttachment(itemID);
|
presence.Appearance.DetachAttachment(itemID);
|
||||||
|
|
||||||
// Save avatar attachment information
|
// Save avatar attachment information
|
||||||
if (m_scene.AvatarService != null)
|
m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
|
||||||
{
|
if (m_scene.AvatarFactory != null)
|
||||||
m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + remoteClient.AgentId + ", ItemID: " + itemID);
|
m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
|
||||||
m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DetachSingleAttachmentToInv(itemID, remoteClient);
|
DetachSingleAttachmentToInv(itemID, remoteClient);
|
||||||
|
@ -435,10 +430,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
|
|
||||||
presence.Appearance.DetachAttachment(itemID);
|
presence.Appearance.DetachAttachment(itemID);
|
||||||
|
|
||||||
if (m_scene.AvatarService != null)
|
if (m_scene.AvatarFactory != null)
|
||||||
{
|
m_scene.AvatarFactory.QueueAppearanceSave(remoteClient.AgentId);
|
||||||
m_scene.AvatarService.SetAppearance(remoteClient.AgentId, presence.Appearance);
|
|
||||||
}
|
|
||||||
part.ParentGroup.DetachToGround();
|
part.ParentGroup.DetachToGround();
|
||||||
|
|
||||||
List<UUID> uuids = new List<UUID>();
|
List<UUID> uuids = new List<UUID>();
|
||||||
|
|
|
@ -42,10 +42,9 @@ using OpenSim.Services.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
{
|
{
|
||||||
public class AvatarFactoryModule : IRegionModule
|
public class AvatarFactoryModule : IAvatarFactory, IRegionModule
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
private static readonly byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
|
|
||||||
private Scene m_scene = null;
|
private Scene m_scene = null;
|
||||||
|
|
||||||
private int m_savetime = 5; // seconds to wait before saving changed appearance
|
private int m_savetime = 5; // seconds to wait before saving changed appearance
|
||||||
|
@ -60,8 +59,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
|
|
||||||
public void Initialise(Scene scene, IConfigSource config)
|
public void Initialise(Scene scene, IConfigSource config)
|
||||||
{
|
{
|
||||||
|
scene.RegisterModuleInterface<IAvatarFactory>(this);
|
||||||
scene.EventManager.OnNewClient += NewClient;
|
scene.EventManager.OnNewClient += NewClient;
|
||||||
|
|
||||||
if (config != null)
|
if (config != null)
|
||||||
{
|
{
|
||||||
IConfig sconfig = config.Configs["Startup"];
|
IConfig sconfig = config.Configs["Startup"];
|
||||||
|
@ -112,6 +112,34 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
public bool ValidateBakedTextureCache(IClientAPI client)
|
||||||
|
{
|
||||||
|
ScenePresence sp = m_scene.GetScenePresence(client.AgentId);
|
||||||
|
if (sp == null)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[AVFACTORY] SetAppearance unable to find presence for {0}",client.AgentId);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cached = true;
|
||||||
|
|
||||||
|
// Process the texture entry
|
||||||
|
for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
|
||||||
|
{
|
||||||
|
int idx = AvatarAppearance.BAKE_INDICES[i];
|
||||||
|
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
|
||||||
|
if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||||
|
if (! CheckBakedTextureAsset(client,face.TextureID,idx))
|
||||||
|
{
|
||||||
|
sp.Appearance.Texture.FaceTextures[idx] = null;
|
||||||
|
cached = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cached;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set appearance data (textureentry and slider settings) received from the client
|
/// Set appearance data (textureentry and slider settings) received from the client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -137,12 +165,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
{
|
{
|
||||||
changed = sp.Appearance.SetTextureEntries(textureEntry);
|
changed = sp.Appearance.SetTextureEntries(textureEntry);
|
||||||
|
|
||||||
for (int i = 0; i < BAKE_INDICES.Length; i++)
|
for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
|
||||||
{
|
{
|
||||||
int idx = BAKE_INDICES[i];
|
int idx = AvatarAppearance.BAKE_INDICES[i];
|
||||||
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
|
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
|
||||||
if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
if (face != null && face.TextureID != AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||||
Util.FireAndForget(delegate(object o) { CheckBakedTextureAssets(client,face.TextureID,idx); });
|
Util.FireAndForget(delegate(object o) {
|
||||||
|
if (! CheckBakedTextureAsset(client,face.TextureID,idx))
|
||||||
|
client.SendRebakeAvatarTextures(face.TextureID);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,9 +196,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
QueueAppearanceSend(client.AgentId);
|
QueueAppearanceSend(client.AgentId);
|
||||||
|
|
||||||
// Send the appearance back to the avatar
|
// Send the appearance back to the avatar
|
||||||
AvatarAppearance avp = sp.Appearance;
|
// AvatarAppearance avp = sp.Appearance;
|
||||||
sp.ControllingClient.SendAvatarDataImmediate(sp);
|
// sp.ControllingClient.SendAvatarDataImmediate(sp);
|
||||||
sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes());
|
// sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -177,14 +208,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
/// <param name="client"></param>
|
/// <param name="client"></param>
|
||||||
/// <param name="textureID"></param>
|
/// <param name="textureID"></param>
|
||||||
/// <param name="idx"></param>
|
/// <param name="idx"></param>
|
||||||
private void CheckBakedTextureAssets(IClientAPI client, UUID textureID, int idx)
|
private bool CheckBakedTextureAsset(IClientAPI client, UUID textureID, int idx)
|
||||||
{
|
{
|
||||||
if (m_scene.AssetService.Get(textureID.ToString()) == null)
|
if (m_scene.AssetService.Get(textureID.ToString()) == null)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",
|
m_log.WarnFormat("[AVFACTORY]: Missing baked texture {0} ({1}) for avatar {2}",
|
||||||
textureID,idx,client.Name);
|
textureID,idx,client.Name);
|
||||||
client.SendRebakeAvatarTextures(textureID);
|
return false;
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region UpdateAppearanceTimer
|
#region UpdateAppearanceTimer
|
||||||
|
@ -229,16 +261,16 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
// DEBUG ON
|
// DEBUG ON
|
||||||
m_log.WarnFormat("[AVFACTORY] Handle appearance send for {0}\n{1}",agentid,sp.Appearance.ToString());
|
m_log.WarnFormat("[AVFACTORY] Handle appearance send for {0}",agentid);
|
||||||
// DEBUG OFF
|
// DEBUG OFF
|
||||||
|
|
||||||
// Send the appearance to everyone in the scene
|
// Send the appearance to everyone in the scene
|
||||||
sp.SendAppearanceToAllOtherAgents();
|
sp.SendAppearanceToAllOtherAgents();
|
||||||
|
sp.ControllingClient.SendAvatarDataImmediate(sp);
|
||||||
|
|
||||||
// Send the appearance back to the avatar
|
// Send the appearance back to the avatar
|
||||||
AvatarAppearance avp = sp.Appearance;
|
// AvatarAppearance avp = sp.Appearance;
|
||||||
sp.ControllingClient.SendAvatarDataImmediate(sp);
|
// sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes());
|
||||||
sp.ControllingClient.SendAppearance(avp.Owner,avp.VisualParams,avp.Texture.GetBytes());
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// this needs to be fixed, the flag should be on scene presence not the region module
|
// this needs to be fixed, the flag should be on scene presence not the region module
|
||||||
|
@ -337,14 +369,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
|
|
||||||
AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance);
|
AvatarAppearance avatAppearance = new AvatarAppearance(sp.Appearance);
|
||||||
|
|
||||||
//if (!TryGetAvatarAppearance(client.AgentId, out avatAppearance))
|
|
||||||
//{
|
|
||||||
// m_log.Warn("[AVFACTORY]: We didn't seem to find the appearance, falling back to ScenePresence");
|
|
||||||
// avatAppearance = sp.Appearance;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//m_log.DebugFormat("[AVFACTORY]: Received wearables for {0}", client.Name);
|
|
||||||
|
|
||||||
foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
|
foreach (AvatarWearingArgs.Wearable wear in e.NowWearing)
|
||||||
{
|
{
|
||||||
if (wear.Type < AvatarWearable.MAX_WEARABLES)
|
if (wear.Type < AvatarWearable.MAX_WEARABLES)
|
||||||
|
@ -354,10 +378,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This could take awhile since it needs to pull inventory
|
||||||
SetAppearanceAssets(sp.UUID, ref avatAppearance);
|
SetAppearanceAssets(sp.UUID, ref avatAppearance);
|
||||||
|
|
||||||
m_scene.AvatarService.SetAppearance(client.AgentId, avatAppearance);
|
|
||||||
sp.Appearance = avatAppearance;
|
sp.Appearance = avatAppearance;
|
||||||
|
m_scene.AvatarService.SetAppearance(client.AgentId, sp.Appearance);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance)
|
private void SetAppearanceAssets(UUID userID, ref AvatarAppearance appearance)
|
||||||
|
|
|
@ -119,6 +119,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
protected IXMLRPC m_xmlrpcModule;
|
protected IXMLRPC m_xmlrpcModule;
|
||||||
protected IWorldComm m_worldCommModule;
|
protected IWorldComm m_worldCommModule;
|
||||||
|
protected IAvatarFactory m_AvatarFactory;
|
||||||
protected IConfigSource m_config;
|
protected IConfigSource m_config;
|
||||||
protected IRegionSerialiserModule m_serialiser;
|
protected IRegionSerialiserModule m_serialiser;
|
||||||
protected IDialogModule m_dialogModule;
|
protected IDialogModule m_dialogModule;
|
||||||
|
@ -398,6 +399,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
public IAttachmentsModule AttachmentsModule { get; set; }
|
public IAttachmentsModule AttachmentsModule { get; set; }
|
||||||
|
|
||||||
|
public IAvatarFactory AvatarFactory
|
||||||
|
{
|
||||||
|
get { return m_AvatarFactory; }
|
||||||
|
}
|
||||||
|
|
||||||
public ICapabilitiesModule CapsModule
|
public ICapabilitiesModule CapsModule
|
||||||
{
|
{
|
||||||
get { return m_capsModule; }
|
get { return m_capsModule; }
|
||||||
|
@ -1153,6 +1159,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
|
m_xmlrpcModule = RequestModuleInterface<IXMLRPC>();
|
||||||
m_worldCommModule = RequestModuleInterface<IWorldComm>();
|
m_worldCommModule = RequestModuleInterface<IWorldComm>();
|
||||||
XferManager = RequestModuleInterface<IXfer>();
|
XferManager = RequestModuleInterface<IXfer>();
|
||||||
|
m_AvatarFactory = RequestModuleInterface<IAvatarFactory>();
|
||||||
AttachmentsModule = RequestModuleInterface<IAttachmentsModule>();
|
AttachmentsModule = RequestModuleInterface<IAttachmentsModule>();
|
||||||
m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
|
m_serialiser = RequestModuleInterface<IRegionSerialiserModule>();
|
||||||
m_dialogModule = RequestModuleInterface<IDialogModule>();
|
m_dialogModule = RequestModuleInterface<IDialogModule>();
|
||||||
|
|
|
@ -704,20 +704,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// we created a new ScenePresence (a new child agent) in a fresh region.
|
// we created a new ScenePresence (a new child agent) in a fresh region.
|
||||||
// Request info about all the (root) agents in this region
|
// Request info about all the (root) agents in this region
|
||||||
// Note: This won't send data *to* other clients in that region (children don't send)
|
// Note: This won't send data *to* other clients in that region (children don't send)
|
||||||
SendInitialFullUpdateToAllClients();
|
|
||||||
|
// MIC: This should be called by OnCompleteMovement
|
||||||
|
// SendInitialFullUpdateToAllClients();
|
||||||
|
|
||||||
RegisterToEvents();
|
RegisterToEvents();
|
||||||
SetDirectionVectors();
|
SetDirectionVectors();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, byte[] visualParams,
|
|
||||||
AvatarWearable[] wearables)
|
|
||||||
: this(client, world, reginfo)
|
|
||||||
{
|
|
||||||
m_appearance = new AvatarAppearance(m_uuid, wearables, visualParams);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance)
|
public ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo, AvatarAppearance appearance)
|
||||||
: this(client, world, reginfo)
|
: this(client, world, reginfo)
|
||||||
{
|
{
|
||||||
|
@ -1081,7 +1075,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void CompleteMovement(IClientAPI client)
|
public void CompleteMovement(IClientAPI client)
|
||||||
{
|
{
|
||||||
//m_log.Debug("[SCENE PRESENCE]: CompleteMovement");
|
// DEBUG ON
|
||||||
|
m_log.WarnFormat("[SCENE PRESENCE]: CompleteMovement for {0}",UUID);
|
||||||
|
// DEBUG OFF
|
||||||
|
|
||||||
Vector3 look = Velocity;
|
Vector3 look = Velocity;
|
||||||
if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
|
if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
|
||||||
|
@ -2381,12 +2377,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// 2 stage check is needed.
|
// 2 stage check is needed.
|
||||||
if (remoteAvatar == null)
|
if (remoteAvatar == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
IClientAPI cl=remoteAvatar.ControllingClient;
|
IClientAPI cl=remoteAvatar.ControllingClient;
|
||||||
if (cl == null)
|
if (cl == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_appearance.Texture == null)
|
if (m_appearance.Texture == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (LocalId == remoteAvatar.LocalId)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[SP] An agent is attempting to send data to itself; {0}",UUID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (IsChildAgent)
|
if (IsChildAgent)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[SCENEPRESENCE] A child agent is attempting to send out avatar data");
|
m_log.WarnFormat("[SCENEPRESENCE] A child agent is attempting to send out avatar data");
|
||||||
|
@ -2407,20 +2411,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
++avUpdates;
|
++avUpdates;
|
||||||
// only send if this is the root (children are only "listening posts" in a foreign region)
|
|
||||||
|
// Don't update ourselves
|
||||||
|
if (avatar.LocalId == LocalId)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// If this is a root agent, then get info about the avatar
|
||||||
if (!IsChildAgent)
|
if (!IsChildAgent)
|
||||||
{
|
{
|
||||||
SendFullUpdateToOtherClient(avatar);
|
SendFullUpdateToOtherClient(avatar);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avatar.LocalId != LocalId)
|
// If the other avatar is a root
|
||||||
|
if (!avatar.IsChildAgent)
|
||||||
{
|
{
|
||||||
if (!avatar.IsChildAgent)
|
avatar.SendFullUpdateToOtherClient(this);
|
||||||
{
|
avatar.SendAppearanceToOtherAgent(this);
|
||||||
avatar.SendFullUpdateToOtherClient(this);
|
avatar.Animator.SendAnimPackToClient(ControllingClient);
|
||||||
avatar.SendAppearanceToOtherAgent(this);
|
|
||||||
avatar.Animator.SendAnimPackToClient(ControllingClient);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2465,7 +2472,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
|
// m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
|
||||||
|
|
||||||
m_controllingClient.SendAvatarDataImmediate(this);
|
m_controllingClient.SendAvatarDataImmediate(this);
|
||||||
m_controllingClient.SendAppearance(m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes());
|
if (m_scene.AvatarFactory != null)
|
||||||
|
{
|
||||||
|
if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient))
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[SP] baked textures are in the ache for {0}",Name);
|
||||||
|
m_controllingClient.SendAppearance(
|
||||||
|
m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[SP] AvatarFactory not set");
|
||||||
|
}
|
||||||
|
|
||||||
SendInitialFullUpdateToAllClients();
|
SendInitialFullUpdateToAllClients();
|
||||||
}
|
}
|
||||||
|
@ -2497,9 +2516,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="avatar"></param>
|
/// <param name="avatar"></param>
|
||||||
public void SendAppearanceToOtherAgent(ScenePresence avatar)
|
public void SendAppearanceToOtherAgent(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
|
if (LocalId == avatar.LocalId)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[SP] An agent is attempting to send data to itself; {0}",UUID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// DEBUG ON
|
// DEBUG ON
|
||||||
m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId);
|
// m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId);
|
||||||
// DEBUG OFF
|
// DEBUG OFF
|
||||||
|
|
||||||
avatar.ControllingClient.SendAppearance(
|
avatar.ControllingClient.SendAppearance(
|
||||||
m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
|
m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue