Second part of invisible base avatar option

avinationmerge
Melanie Thielker 2014-11-10 19:49:58 +01:00
parent 785a2cc729
commit 64deb6ae6f
3 changed files with 43 additions and 5 deletions

View File

@ -72,6 +72,7 @@ namespace OpenSim.Framework
protected float m_avatarAnimOffset = 0; protected float m_avatarAnimOffset = 0;
protected WearableCacheItem[] m_cacheitems; protected WearableCacheItem[] m_cacheitems;
protected bool m_cacheItemsDirty = true; protected bool m_cacheItemsDirty = true;
public static Primitive.TextureEntry Invisible = null;
public virtual int Serial public virtual int Serial
{ {
@ -134,8 +135,30 @@ namespace OpenSim.Framework
set { m_cacheItemsDirty = value; } set { m_cacheItemsDirty = value; }
} }
private void CreateInvisibleTextureEntry()
{
if (Invisible != null)
return;
Invisible = new Primitive.TextureEntry(new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"));
Invisible.FaceTextures[8] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[8].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[9] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[9].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[10] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[10].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[11] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[11].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[19] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[19].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
Invisible.FaceTextures[20] = new Primitive.TextureEntryFace(null);
Invisible.FaceTextures[20].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903");
}
public AvatarAppearance() public AvatarAppearance()
{ {
CreateInvisibleTextureEntry();
// m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance"); // m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance");
m_serial = 0; m_serial = 0;
@ -149,6 +172,9 @@ namespace OpenSim.Framework
public AvatarAppearance(OSDMap map) public AvatarAppearance(OSDMap map)
{ {
CreateInvisibleTextureEntry();
Invisible = new Primitive.TextureEntry(new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"));
// m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap"); // m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap");
Unpack(map); Unpack(map);
@ -157,6 +183,7 @@ namespace OpenSim.Framework
public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams) public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams)
{ {
CreateInvisibleTextureEntry();
// m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance"); // m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance");
m_serial = 0; m_serial = 0;
@ -194,6 +221,7 @@ namespace OpenSim.Framework
public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool copyBaked) public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool copyBaked)
{ {
CreateInvisibleTextureEntry();
// m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance"); // m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance");
if (appearance == null) if (appearance == null)

View File

@ -5142,7 +5142,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
acceleration = Vector3.Zero; acceleration = Vector3.Zero;
if (sendTexture) if (sendTexture)
textureEntry = presence.Appearance.Texture.GetBytes(); {
if (presence.Invisible)
textureEntry = AvatarAppearance.Invisible.GetBytes();
else
textureEntry = presence.Appearance.Texture.GetBytes();
}
else else
textureEntry = null; textureEntry = null;
} }

View File

@ -90,6 +90,7 @@ namespace OpenSim.Region.Framework.Scenes
public bool isNPC { get; private set; } public bool isNPC { get; private set; }
public bool Invisible { get; set; }
private PresenceType m_presenceType; private PresenceType m_presenceType;
public PresenceType PresenceType { public PresenceType PresenceType {
get {return m_presenceType;} get {return m_presenceType;}
@ -949,6 +950,7 @@ namespace OpenSim.Region.Framework.Scenes
public ScenePresence( public ScenePresence(
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
{ {
Invisible = false;
AttachmentsSyncLock = new Object(); AttachmentsSyncLock = new Object();
AllowMovement = true; AllowMovement = true;
IsChildAgent = true; IsChildAgent = true;
@ -3709,14 +3711,17 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID); // "[SCENE PRESENCE]: Sending appearance data from {0} {1} to {2} {3}", Name, m_uuid, avatar.Name, avatar.UUID);
if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodLevel < 200) if (ParcelHideThisAvatar && currentParcelUUID != avatar.currentParcelUUID && avatar.GodLevel < 200)
return; return;
avatar.ControllingClient.SendAppearance( SendAppearanceToAgentNF(avatar);
UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
} }
public void SendAppearanceToAgentNF(ScenePresence avatar) public void SendAppearanceToAgentNF(ScenePresence avatar)
{ {
avatar.ControllingClient.SendAppearance( if (Invisible)
UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); avatar.ControllingClient.SendAppearance(
UUID, Appearance.VisualParams, AvatarAppearance.Invisible.GetBytes());
else
avatar.ControllingClient.SendAppearance(
UUID, Appearance.VisualParams, Appearance.Texture.GetBytes());
} }
public void SendAnimPackToAgent(ScenePresence p) public void SendAnimPackToAgent(ScenePresence p)