diff options
author | MW | 2007-07-28 13:44:12 +0000 |
---|---|---|
committer | MW | 2007-07-28 13:44:12 +0000 |
commit | e86396ad1fbb492dd2164b7d26f3ed87e0ba0fa0 (patch) | |
tree | 7e712f5ea23c05b57fa2f3dd93e20c51573fe21c | |
parent | Should now have version 0.1 of our new ruth default avatar. At the moment, yo... (diff) | |
download | opensim-SC-e86396ad1fbb492dd2164b7d26f3ed87e0ba0fa0.zip opensim-SC-e86396ad1fbb492dd2164b7d26f3ed87e0ba0fa0.tar.gz opensim-SC-e86396ad1fbb492dd2164b7d26f3ed87e0ba0fa0.tar.bz2 opensim-SC-e86396ad1fbb492dd2164b7d26f3ed87e0ba0fa0.tar.xz |
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).
5 files changed, 52 insertions, 12 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index a55297a..5aacecb 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -91,7 +91,7 @@ namespace OpenSim.Region.Capabilities | |||
91 | string capsBase = "/CAPS/" + m_capsObjectPath; | 91 | string capsBase = "/CAPS/" + m_capsObjectPath; |
92 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); | 92 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); |
93 | } | 93 | } |
94 | 94 | ||
95 | /// <summary> | 95 | /// <summary> |
96 | /// | 96 | /// |
97 | /// </summary> | 97 | /// </summary> |
diff --git a/OpenSim/Framework/General/Interfaces/IClientAPI.cs b/OpenSim/Framework/General/Interfaces/IClientAPI.cs index 260da81..c1d91d5 100644 --- a/OpenSim/Framework/General/Interfaces/IClientAPI.cs +++ b/OpenSim/Framework/General/Interfaces/IClientAPI.cs | |||
@@ -172,6 +172,7 @@ namespace OpenSim.Framework.Interfaces | |||
172 | 172 | ||
173 | void OutPacket(Packet newPack); | 173 | void OutPacket(Packet newPack); |
174 | void SendWearables(AvatarWearable[] wearables); | 174 | void SendWearables(AvatarWearable[] wearables); |
175 | void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry); | ||
175 | void SendStartPingCheck(byte seq); | 176 | void SendStartPingCheck(byte seq); |
176 | void SendKillObject(ulong regionHandle, uint avatarLocalID); | 177 | void SendKillObject(ulong regionHandle, uint avatarLocalID); |
177 | void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); | 178 | void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId); |
diff --git a/OpenSim/Framework/General/NullClientAPI.cs b/OpenSim/Framework/General/NullClientAPI.cs index 9815aca..45c1a14 100644 --- a/OpenSim/Framework/General/NullClientAPI.cs +++ b/OpenSim/Framework/General/NullClientAPI.cs | |||
@@ -104,6 +104,7 @@ namespace OpenSim.Framework | |||
104 | 104 | ||
105 | public virtual void OutPacket(Packet newPack){} | 105 | public virtual void OutPacket(Packet newPack){} |
106 | public virtual void SendWearables(AvatarWearable[] wearables){} | 106 | public virtual void SendWearables(AvatarWearable[] wearables){} |
107 | public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) { } | ||
107 | public virtual void SendStartPingCheck(byte seq){} | 108 | public virtual void SendStartPingCheck(byte seq){} |
108 | public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID){} | 109 | public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID){} |
109 | public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId){} | 110 | public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId){} |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 124b426..30f00d6 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -52,9 +52,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
52 | private byte movementflag = 0; | 52 | private byte movementflag = 0; |
53 | private List<NewForce> forcesList = new List<NewForce>(); | 53 | private List<NewForce> forcesList = new List<NewForce>(); |
54 | private short _updateCount = 0; | 54 | private short _updateCount = 0; |
55 | |||
55 | private Quaternion bodyRot; | 56 | private Quaternion bodyRot; |
56 | private byte[] visualParams; | 57 | private byte[] visualParams; |
57 | private AvatarWearable[] Wearables; | 58 | private AvatarWearable[] Wearables; |
59 | private LLObject.TextureEntry m_textureEntry; | ||
60 | |||
58 | private ulong m_regionHandle; | 61 | private ulong m_regionHandle; |
59 | 62 | ||
60 | public bool childAgent = false; | 63 | public bool childAgent = false; |
@@ -143,6 +146,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
143 | this.lastname = ControllingClient.LastName; | 146 | this.lastname = ControllingClient.LastName; |
144 | m_localId = m_scene.NextLocalId; | 147 | m_localId = m_scene.NextLocalId; |
145 | Pos = ControllingClient.StartPos; | 148 | Pos = ControllingClient.StartPos; |
149 | |||
146 | visualParams = new byte[218]; | 150 | visualParams = new byte[218]; |
147 | for (int i = 0; i < 218; i++) | 151 | for (int i = 0; i < 218; i++) |
148 | { | 152 | { |
@@ -153,11 +157,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
153 | Animations = new ScenePresence.AvatarAnimations(); | 157 | Animations = new ScenePresence.AvatarAnimations(); |
154 | Animations.LoadAnims(); | 158 | Animations.LoadAnims(); |
155 | 159 | ||
156 | // this.avatarAppearanceTexture = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); | ||
157 | |||
158 | //register for events | 160 | //register for events |
159 | ControllingClient.OnRequestWearables += this.SendOurAppearance; | 161 | ControllingClient.OnRequestWearables += this.SendOurAppearance; |
160 | //ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance); | 162 | ControllingClient.OnSetAppearance += new SetAppearance(this.SetAppearance); |
161 | ControllingClient.OnCompleteMovementToRegion += this.CompleteMovement; | 163 | ControllingClient.OnCompleteMovementToRegion += this.CompleteMovement; |
162 | ControllingClient.OnCompleteMovementToRegion += this.SendInitialData; | 164 | ControllingClient.OnCompleteMovementToRegion += this.SendInitialData; |
163 | ControllingClient.OnAgentUpdate += this.HandleAgentUpdate; | 165 | ControllingClient.OnAgentUpdate += this.HandleAgentUpdate; |
@@ -171,8 +173,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
171 | Dir_Vectors[3] = new Vector3(0, -1, 0); //RIGHT | 173 | Dir_Vectors[3] = new Vector3(0, -1, 0); //RIGHT |
172 | Dir_Vectors[4] = new Vector3(0, 0, 1); //UP | 174 | Dir_Vectors[4] = new Vector3(0, 0, 1); //UP |
173 | Dir_Vectors[5] = new Vector3(0, 0, -1); //DOWN | 175 | Dir_Vectors[5] = new Vector3(0, 0, -1); //DOWN |
174 | 176 | ||
175 | //tempoary until we move some code into the body classes | 177 | this.m_textureEntry = new LLObject.TextureEntry(DefaultTexture, 0, DefaultTexture.Length); |
178 | |||
179 | //temporary until we move some code into the body classes | ||
176 | this.m_body = new ChildAgent(); | 180 | this.m_body = new ChildAgent(); |
177 | 181 | ||
178 | } | 182 | } |
@@ -242,7 +246,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
242 | /// <param name="visualParam"></param> | 246 | /// <param name="visualParam"></param> |
243 | public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam) | 247 | public void SetAppearance(byte[] texture, AgentSetAppearancePacket.VisualParamBlock[] visualParam) |
244 | { | 248 | { |
249 | LLObject.TextureEntry textureEnt = new LLObject.TextureEntry(texture, 0, texture.Length); | ||
250 | this.m_textureEntry = textureEnt; | ||
251 | |||
252 | for (int i = 0; i < visualParam.Length; i++) | ||
253 | { | ||
254 | this.visualParams[i] = visualParam[i].ParamValue; | ||
255 | } | ||
245 | 256 | ||
257 | this.SendArrearanceToAllOtherAgents(); | ||
246 | } | 258 | } |
247 | 259 | ||
248 | /// <summary> | 260 | /// <summary> |
@@ -422,7 +434,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
422 | /// <param name="remoteAvatar"></param> | 434 | /// <param name="remoteAvatar"></param> |
423 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) | 435 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) |
424 | { | 436 | { |
425 | remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture); | 437 | remoteAvatar.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes()); |
426 | } | 438 | } |
427 | 439 | ||
428 | public void SendFullUpdateToALLClients() | 440 | public void SendFullUpdateToALLClients() |
@@ -440,7 +452,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
440 | /// </summary> | 452 | /// </summary> |
441 | public void SendInitialData() | 453 | public void SendInitialData() |
442 | { | 454 | { |
443 | this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, DefaultTexture); | 455 | this.ControllingClient.SendAvatarData(m_regionInfo.RegionHandle, this.firstname, this.lastname, this.m_uuid, this.LocalId, this.Pos, this.m_textureEntry.ToBytes()); |
444 | if (this.newAvatar) | 456 | if (this.newAvatar) |
445 | { | 457 | { |
446 | this.m_scene.InformClientOfNeighbours(this.ControllingClient); | 458 | this.m_scene.InformClientOfNeighbours(this.ControllingClient); |
@@ -455,17 +467,32 @@ namespace OpenSim.Region.Environment.Scenes | |||
455 | public void SendOurAppearance(IClientAPI OurClient) | 467 | public void SendOurAppearance(IClientAPI OurClient) |
456 | { | 468 | { |
457 | this.ControllingClient.SendWearables(this.Wearables); | 469 | this.ControllingClient.SendWearables(this.Wearables); |
470 | |||
458 | this.SendFullUpdateToALLClients(); | 471 | this.SendFullUpdateToALLClients(); |
472 | this.SendArrearanceToAllOtherAgents(); | ||
473 | |||
459 | this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient); | 474 | this.m_scene.SendAllSceneObjectsToClient(this.ControllingClient); |
460 | } | 475 | } |
461 | 476 | ||
462 | /// <summary> | 477 | /// <summary> |
463 | /// | 478 | /// |
464 | /// </summary> | 479 | /// </summary> |
480 | public void SendArrearanceToAllOtherAgents() | ||
481 | { | ||
482 | List<ScenePresence> avatars = this.m_scene.RequestAvatarList(); | ||
483 | foreach (ScenePresence avatar in this.m_scene.RequestAvatarList()) | ||
484 | { | ||
485 | this.SendAppearanceToOtherAgent(avatar); | ||
486 | } | ||
487 | } | ||
488 | |||
489 | /// <summary> | ||
490 | /// | ||
491 | /// </summary> | ||
465 | /// <param name="avatarInfo"></param> | 492 | /// <param name="avatarInfo"></param> |
466 | public void SendAppearanceToOtherAgent(ScenePresence avatarInfo) | 493 | public void SendAppearanceToOtherAgent(ScenePresence avatarInfo) |
467 | { | 494 | { |
468 | 495 | avatarInfo.ControllingClient.SendAppearance(this.ControllingClient.AgentId, this.visualParams, this.m_textureEntry.ToBytes()); | |
469 | } | 496 | } |
470 | 497 | ||
471 | /// <summary> | 498 | /// <summary> |
@@ -614,7 +641,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
614 | 641 | ||
615 | public static void LoadTextureFile(string name) | 642 | public static void LoadTextureFile(string name) |
616 | { | 643 | { |
617 | FileInfo fInfo = new FileInfo(name); | 644 | /* FileInfo fInfo = new FileInfo(name); |
618 | long numBytes = fInfo.Length; | 645 | long numBytes = fInfo.Length; |
619 | FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); | 646 | FileStream fStream = new FileStream(name, FileMode.Open, FileAccess.Read); |
620 | BinaryReader br = new BinaryReader(fStream); | 647 | BinaryReader br = new BinaryReader(fStream); |
@@ -622,8 +649,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
622 | br.Close(); | 649 | br.Close(); |
623 | fStream.Close(); | 650 | fStream.Close(); |
624 | DefaultTexture = data1; | 651 | DefaultTexture = data1; |
625 | // LLObject.TextureEntry textu = new LLObject.TextureEntry(data1, 0, data1.Length); | 652 | LLObject.TextureEntry textu = new LLObject.TextureEntry(data1, 0, data1.Length); |
626 | // Console.WriteLine("default texture entry: " + textu.ToString()); | 653 | Console.WriteLine("default texture entry: " + textu.ToString());*/ |
654 | |||
655 | LLObject.TextureEntry textu = new LLObject.TextureEntry(new LLUUID("C228D1CF-4B5D-4BA8-84F4-899A0796AA97")); | ||
656 | textu.CreateFace(0).TextureID = new LLUUID("00000000-0000-1111-9999-000000000012"); | ||
657 | textu.CreateFace(1).TextureID = new LLUUID("5748decc-f629-461c-9a36-a35a221fe21f"); | ||
658 | textu.CreateFace(2).TextureID = new LLUUID("5748decc-f629-461c-9a36-a35a221fe21f"); | ||
659 | textu.CreateFace(3).TextureID = new LLUUID("6522E74D-1660-4E7F-B601-6F48C1659A77"); | ||
660 | textu.CreateFace(4).TextureID = new LLUUID("7CA39B4C-BD19-4699-AFF7-F93FD03D3E7B"); | ||
661 | textu.CreateFace(5).TextureID = new LLUUID("00000000-0000-1111-9999-000000000010"); | ||
662 | textu.CreateFace(6).TextureID = new LLUUID("00000000-0000-1111-9999-000000000011"); | ||
663 | DefaultTexture = textu.ToBytes(); | ||
627 | } | 664 | } |
628 | 665 | ||
629 | public class NewForce | 666 | public class NewForce |
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs index 1593f6c..6bcec5c 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs | |||
@@ -119,6 +119,7 @@ namespace SimpleApp | |||
119 | 119 | ||
120 | public virtual void OutPacket(Packet newPack) { } | 120 | public virtual void OutPacket(Packet newPack) { } |
121 | public virtual void SendWearables(AvatarWearable[] wearables) { } | 121 | public virtual void SendWearables(AvatarWearable[] wearables) { } |
122 | public virtual void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) { } | ||
122 | public virtual void SendStartPingCheck(byte seq) { } | 123 | public virtual void SendStartPingCheck(byte seq) { } |
123 | public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID) { } | 124 | public virtual void SendKillObject(ulong regionHandle, uint avatarLocalID) { } |
124 | public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) { } | 125 | public virtual void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) { } |