You should now see the correct Avatar for other users, including their clothes, although their still seems to be a few problems with the clothes, in that sometimes other avatar's default clothes are white.
At last, removed the need for the avatar-texture.dat file. (Please never come back).afrisby
parent
1b850b4483
commit
e86396ad1f
|
@ -172,6 +172,7 @@ namespace OpenSim.Framework.Interfaces
|
||||||
|
|
||||||
void OutPacket(Packet newPack);
|
void OutPacket(Packet newPack);
|
||||||
void SendWearables(AvatarWearable[] wearables);
|
void SendWearables(AvatarWearable[] wearables);
|
||||||
|
void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry);
|
||||||
void SendStartPingCheck(byte seq);
|
void SendStartPingCheck(byte seq);
|
||||||
void SendKillObject(ulong regionHandle, uint avatarLocalID);
|
void SendKillObject(ulong regionHandle, uint avatarLocalID);
|
||||||
void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId);
|
void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId);
|
||||||
|
|
|
@ -104,6 +104,7 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
public virtual void OutPacket(Packet newPack){}
|
public virtual void OutPacket(Packet newPack){}
|
||||||
public virtual void SendWearables(AvatarWearable[] wearables){}
|
public virtual void SendWearables(AvatarWearable[] wearables){}
|
||||||
|
public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) { }
|
||||||
public virtual void SendStartPingCheck(byte seq){}
|
public virtual void SendStartPingCheck(byte seq){}
|
||||||
public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID){}
|
public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID){}
|
||||||
public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId){}
|
public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId){}
|
||||||
|
|
|
@ -52,9 +52,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
private byte movementflag = 0;
|
private byte movementflag = 0;
|
||||||
private List<NewForce> forcesList = new List<NewForce>();
|
private List<NewForce> forcesList = new List<NewForce>();
|
||||||
private short _updateCount = 0;
|
private short _updateCount = 0;
|
||||||
|
|
||||||
private Quaternion bodyRot;
|
private Quaternion bodyRot;
|
||||||
private byte[] visualParams;
|
private byte[] visualParams;
|
||||||
private AvatarWearable[] Wearables;
|
private AvatarWearable[] Wearables;
|
||||||
|
private LLObject.TextureEntry m_textureEntry;
|
||||||
|
|
||||||
private ulong m_regionHandle;
|
private ulong m_regionHandle;
|
||||||
|
|
||||||
public bool childAgent = false;
|
public bool childAgent = false;
|
||||||
|
@ -143,6 +146,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
this.lastname = ControllingClient.LastName;
|
this.lastname = ControllingClient.LastName;
|
||||||
m_localId = m_scene.NextLocalId;
|
m_localId = m_scene.NextLocalId;
|
||||||
Pos = ControllingClient.StartPos;
|
Pos = ControllingClient.StartPos;
|
||||||
|
|
||||||
visualParams = new byte[218];
|
visualParams = new byte[218];
|
||||||
for (int i = 0; i < 218; i++)
|
for (int i = 0; i < 218; i++)
|
||||||
{
|
{
|
||||||
|
@ -153,11 +157,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
Animations = new ScenePresence.AvatarAnimations();
|
Animations = new ScenePresence.AvatarAnimations();
|
||||||
Animations.LoadAnims();
|
Animations.LoadAnims();
|
||||||
|
|
||||||
// this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005"));
|
|
||||||
|
|
||||||
//register for events
|
//register for events
|
||||||
ControllingClient.OnRequestWearables += this.SendOurAppearance;
|
ControllingClient.OnRequestWearables += this.SendOurAppearance;
|
||||||
//ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
|
ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance);
|
||||||
ControllingClient.OnCompleteMovementToRegion += this.CompleteMovement;
|
ControllingClient.OnCompleteMovementToRegion += this.CompleteMovement;
|
||||||
ControllingClient.OnCompleteMovementToRegion += this.SendInitialData;
|
ControllingClient.OnCompleteMovementToRegion += this.SendInitialData;
|
||||||
ControllingClient.OnAgentUpdate += this.HandleAgentUpdate;
|
ControllingClient.OnAgentUpdate += this.HandleAgentUpdate;
|
||||||
|
@ -172,7 +174,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
Dir_Vectors[4] = new Vector3(0, 0, 1); //UP
|
Dir_Vectors[4] = new Vector3(0, 0, 1); //UP
|
||||||
Dir_Vectors[5] = new Vector3(0, 0, -1); //DOWN
|
Dir_Vectors[5] = new Vector3(0, 0, -1); //DOWN
|
||||||
|
|
||||||
//tempoary until we move some code into the body classes
|
this.m_textureEntry = new LLObject.TextureEntry(DefaultTexture, 0, DefaultTexture.Length);
|
||||||
|
|
||||||
|
//temporary until we move some code into the body classes
|
||||||
this.m_body = new ChildAgent();
|
this.m_body = new ChildAgent();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -242,7 +246,15 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="visualParam"></param>
|
/// <param name="visualParam"></param>
|
||||||
public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam)
|
public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam)
|
||||||
{
|
{
|
||||||
|
LLObject.TextureEntry textureEnt = new LLObject.TextureEntry(texture, 0, texture.Length);
|
||||||
|
this.m_textureEntry = textureEnt;
|
||||||
|
|
||||||
|
for (int i = 0; i < visualParam.Length; i++)
|
||||||
|
{
|
||||||
|
this.visualParams[i] = visualParam[i].ParamValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.SendArrearanceToAllOtherAgents();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -422,7 +434,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// <param name="remoteAvatar"></param>
|
/// <param name="remoteAvatar"></param>
|
||||||
public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
|
public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
|
||||||
{
|
{
|
||||||
remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture);
|
remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendFullUpdateToALLClients()
|
public void SendFullUpdateToALLClients()
|
||||||
|
@ -440,7 +452,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendInitialData()
|
public void SendInitialData()
|
||||||
{
|
{
|
||||||
this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture);
|
this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes());
|
||||||
if (this.newAvatar)
|
if (this.newAvatar)
|
||||||
{
|
{
|
||||||
this.m_scene.InformClientOfNeighbours(this.ControllingClient);
|
this.m_scene.InformClientOfNeighbours(this.ControllingClient);
|
||||||
|
@ -455,17 +467,32 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
public void SendOurAppearance(IClientAPI OurClient)
|
public void SendOurAppearance(IClientAPI OurClient)
|
||||||
{
|
{
|
||||||
this.ControllingClient.SendWearables(this.Wearables);
|
this.ControllingClient.SendWearables(this.Wearables);
|
||||||
|
|
||||||
this.SendFullUpdateToALLClients();
|
this.SendFullUpdateToALLClients();
|
||||||
|
this.SendArrearanceToAllOtherAgents();
|
||||||
|
|
||||||
this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
|
this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
public void SendArrearanceToAllOtherAgents()
|
||||||
|
{
|
||||||
|
List<ScenePresence> avatars = this.m_scene.RequestAvatarList();
|
||||||
|
foreach (ScenePresence avatar in this.m_scene.RequestAvatarList())
|
||||||
|
{
|
||||||
|
this.SendAppearanceToOtherAgent(avatar);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="avatarInfo"></param>
|
/// <param name="avatarInfo"></param>
|
||||||
public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
|
public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
|
||||||
{
|
{
|
||||||
|
avatarInfo.ControllingClient.SendAppearance(this.ControllingClient.AgentId, this.visualParams, this.m_textureEntry.ToBytes());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -614,7 +641,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
public static void LoadTextureFile(string name)
|
public static void LoadTextureFile(string name)
|
||||||
{
|
{
|
||||||
FileInfo fInfo = new FileInfo(name);
|
/* FileInfo fInfo = new FileInfo(name);
|
||||||
long numBytes = fInfo.Length;
|
long numBytes = fInfo.Length;
|
||||||
FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read);
|
FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read);
|
||||||
BinaryReader br = new BinaryReader(fStream);
|
BinaryReader br = new BinaryReader(fStream);
|
||||||
|
@ -622,8 +649,18 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
br.Close();
|
br.Close();
|
||||||
fStream.Close();
|
fStream.Close();
|
||||||
DefaultTexture = data1;
|
DefaultTexture = data1;
|
||||||
// LLObject.TextureEntry textu = new LLObject.TextureEntry(data1, 0, data1.Length);
|
LLObject.TextureEntry textu = new LLObject.TextureEntry(data1, 0, data1.Length);
|
||||||
// Console.WriteLine("default texture entry: " + textu.ToString());
|
Console.WriteLine("default texture entry: " + textu.ToString());*/
|
||||||
|
|
||||||
|
LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97"));
|
||||||
|
textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012");
|
||||||
|
textu.CreateFace(1).TextureID = new LLUUID("5748decc-f629-461c-9a36-a35a221fe21f");
|
||||||
|
textu.CreateFace(2).TextureID = new LLUUID("5748decc-f629-461c-9a36-a35a221fe21f");
|
||||||
|
textu.CreateFace(3).TextureID = new LLUUID("6522E74D-1660-4E7F-B601-6F48C1659A77");
|
||||||
|
textu.CreateFace(4).TextureID = new LLUUID("7CA39B4C-BD19-4699-AFF7-F93FD03D3E7B");
|
||||||
|
textu.CreateFace(5).TextureID = new LLUUID("00000000-0000-1111-9999-000000000010");
|
||||||
|
textu.CreateFace(6).TextureID = new LLUUID("00000000-0000-1111-9999-000000000011");
|
||||||
|
DefaultTexture = textu.ToBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NewForce
|
public class NewForce
|
||||||
|
|
|
@ -119,6 +119,7 @@ namespace SimpleApp
|
||||||
|
|
||||||
public virtual void OutPacket(Packet newPack) { }
|
public virtual void OutPacket(Packet newPack) { }
|
||||||
public virtual void SendWearables(AvatarWearable[] wearables) { }
|
public virtual void SendWearables(AvatarWearable[] wearables) { }
|
||||||
|
public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) { }
|
||||||
public virtual void SendStartPingCheck(byte seq) { }
|
public virtual void SendStartPingCheck(byte seq) { }
|
||||||
public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID) { }
|
public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID) { }
|
||||||
public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) { }
|
public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) { }
|
||||||
|
|
Loading…
Reference in New Issue