* minor: Add documentation to some of the appearance methods, change some logging messages
							parent
							
								
									f34079cc8c
								
							
						
					
					
						commit
						247b806134
					
				|  | @ -71,17 +71,23 @@ namespace OpenSim.Framework | |||
|                 { | ||||
|                     defaultWearables[i] = new AvatarWearable(); | ||||
|                 } | ||||
|                  | ||||
|                 // Body | ||||
|                 defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); | ||||
|                 defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); | ||||
| 
 | ||||
|                 // Skin | ||||
|                 defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); | ||||
|                 defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb"); | ||||
| 
 | ||||
|                 // Shirt | ||||
|                 defaultWearables[4].ItemID = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); | ||||
|                 defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110"); | ||||
| 
 | ||||
|                 // Pants | ||||
|                 defaultWearables[5].ItemID = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); | ||||
|                 defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120"); | ||||
|                  | ||||
|                 return defaultWearables; | ||||
|             } | ||||
|         } | ||||
|  |  | |||
|  | @ -635,8 +635,20 @@ namespace OpenSim.Framework | |||
| 
 | ||||
|    //     void ActivateGesture(UUID assetId, UUID gestureId); | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// Tell this client what items it should be wearing now | ||||
|         /// </summary> | ||||
|         /// <param name="wearables"></param>         | ||||
|         void SendWearables(AvatarWearable[] wearables, int serial); | ||||
|          | ||||
|         /// <summary> | ||||
|         /// Send information about the given agent's appearance to another client. | ||||
|         /// </summary> | ||||
|         /// <param name="agentID">The id of the agent associated with the appearance</param> | ||||
|         /// <param name="visualParams"></param> | ||||
|         /// <param name="textureEntry"></param>         | ||||
|         void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry); | ||||
|          | ||||
|         void SendStartPingCheck(byte seq); | ||||
|          | ||||
|         /// <summary> | ||||
|  |  | |||
|  | @ -2221,11 +2221,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
|         // Gesture | ||||
| 
 | ||||
|         #region Appearance/ Wearables Methods | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// | ||||
|         /// </summary> | ||||
|         /// <param name="wearables"></param> | ||||
|          | ||||
|         public void SendWearables(AvatarWearable[] wearables, int serial) | ||||
|         { | ||||
|             AgentWearablesUpdatePacket aw = (AgentWearablesUpdatePacket)PacketPool.Instance.GetPacket(PacketType.AgentWearablesUpdate); | ||||
|  | @ -2248,12 +2244,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
|             OutPacket(aw, ThrottleOutPacketType.Task); | ||||
|         } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// | ||||
|         /// </summary> | ||||
|         /// <param name="agentID"></param> | ||||
|         /// <param name="visualParams"></param> | ||||
|         /// <param name="textureEntry"></param> | ||||
|         public void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry) | ||||
|         { | ||||
|             AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); | ||||
|  | @ -4199,6 +4189,7 @@ Console.WriteLine(msgpack.ToString()); | |||
|                         } | ||||
| 
 | ||||
|                         break; | ||||
|                      | ||||
|                     case PacketType.RegionHandshakeReply: | ||||
| 
 | ||||
|                         handlerRegionHandShakeReply = OnRegionHandShakeReply; | ||||
|  | @ -4208,6 +4199,7 @@ Console.WriteLine(msgpack.ToString()); | |||
|                         } | ||||
| 
 | ||||
|                         break; | ||||
|                      | ||||
|                     case PacketType.AgentWearablesRequest: | ||||
|                         handlerRequestWearables = OnRequestWearables; | ||||
| 
 | ||||
|  | @ -4224,6 +4216,7 @@ Console.WriteLine(msgpack.ToString()); | |||
|                         } | ||||
| 
 | ||||
|                         break; | ||||
|                      | ||||
|                     case PacketType.AgentSetAppearance: | ||||
|                         AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack; | ||||
| 
 | ||||
|  |  | |||
|  | @ -131,8 +131,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
|                     } | ||||
|                     else | ||||
|                     { | ||||
|                         // UUID assetId; | ||||
| 
 | ||||
|                         InventoryItemBase baseItem = profile.RootFolder.FindItem(appearance.Wearables[i].ItemID); | ||||
| 
 | ||||
|                         if (baseItem != null) | ||||
|  | @ -141,7 +139,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
|                         } | ||||
|                         else | ||||
|                         { | ||||
|                             m_log.ErrorFormat("[APPEARANCE] Can't find inventory item {0}, setting to default", appearance.Wearables[i].ItemID); | ||||
|                             m_log.ErrorFormat("[APPEARANCE]: Can't find inventory item {0}, setting to default", appearance.Wearables[i].ItemID); | ||||
|                             appearance.Wearables[i].AssetID = def.Wearables[i].AssetID; | ||||
|                         } | ||||
|                     } | ||||
|  | @ -149,7 +147,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
|             } | ||||
|             else | ||||
|             { | ||||
|                 m_log.Error("[APPEARANCE] you have no inventory, appearance stuff isn't going to work"); | ||||
|                 m_log.Error("[APPEARANCE]: you have no inventory, appearance stuff isn't going to work"); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  | @ -157,19 +155,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
|         { | ||||
|             IClientAPI clientView = (IClientAPI)sender; | ||||
|             ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId); | ||||
|             if (avatar == null) { | ||||
|                 m_log.Info("Avatar is child agent, ignoring AvatarIsWearing event"); | ||||
|              | ||||
|             if (avatar == null)  | ||||
|             { | ||||
|                 m_log.Warn("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event"); | ||||
|                 return; | ||||
|             } | ||||
| 
 | ||||
|             CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); | ||||
| 
 | ||||
|             AvatarAppearance avatAppearance = null; | ||||
|             if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) { | ||||
|                 m_log.Info("We didn't seem to find the appearance, falling back to ScenePresense"); | ||||
|             if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance))  | ||||
|             { | ||||
|                 m_log.Info("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresense"); | ||||
|                 avatAppearance = avatar.Appearance; | ||||
|             } | ||||
|             m_log.Info("Calling Avatar is Wearing"); | ||||
|              | ||||
|             m_log.Info("[APPEARANCE]: Calling Avatar is Wearing"); | ||||
|              | ||||
|             if (profile != null) | ||||
|             { | ||||
|                 if (profile.RootFolder != null) | ||||
|  | @ -181,6 +184,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
|                             avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; | ||||
|                         } | ||||
|                     } | ||||
|                      | ||||
|                     SetAppearanceAssets(profile, ref avatAppearance); | ||||
| 
 | ||||
|                     m_scene.CommsManager.AvatarService.UpdateUserAppearance(clientView.AgentId, avatAppearance); | ||||
|  | @ -188,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     m_log.Error("Root Profile is null, we can't set the appearance"); | ||||
|                     m_log.Error("[APPEARANCE]: Root Profile is null, we can't set the appearance"); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  |  | |||
|  | @ -2236,8 +2236,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
|         protected virtual void SubscribeToClientEvents(IClientAPI client) | ||||
|         { | ||||
|             client.OnRegionHandShakeReply += SendLayerData; | ||||
|             //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); | ||||
|             // client.OnRequestWearables += InformClientOfNeighbours; | ||||
|             client.OnAddPrim += AddNewPrim; | ||||
|             client.OnUpdatePrimGroupPosition += m_innerScene.UpdatePrimPosition; | ||||
|             client.OnUpdatePrimSinglePosition += m_innerScene.UpdatePrimSinglePosition; | ||||
|  |  | |||
|  | @ -527,7 +527,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
| 
 | ||||
|         public void RegisterToEvents() | ||||
|         { | ||||
|             m_controllingClient.OnRequestWearables += SendOwnAppearance; | ||||
|             m_controllingClient.OnRequestWearables += SendWearables; | ||||
|             m_controllingClient.OnSetAppearance += SetAppearance; | ||||
|             m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; | ||||
|             m_controllingClient.OnCompleteMovementToRegion += SendInitialData; | ||||
|  | @ -1843,12 +1843,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
|          } | ||||
| 
 | ||||
|         /// <summary> | ||||
|         /// | ||||
|         /// Tell the client for this scene presence what items it should be wearing now | ||||
|         /// </summary> | ||||
|         /// <param name="client"></param> | ||||
|         public void SendOwnAppearance() | ||||
|         public void SendWearables() | ||||
|         { | ||||
|             m_log.Info("[APPEARANCE]: Sending Own Appearance"); | ||||
|             m_log.DebugFormat("[APPEARANCE]: Sending wearables to {0}", Name); | ||||
|              | ||||
|             ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); | ||||
|             // ControllingClient.SendAppearance( | ||||
|             //                                 m_appearance.Owner, | ||||
|  | @ -1862,8 +1863,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
|         /// </summary> | ||||
|         public void SendAppearanceToAllOtherAgents() | ||||
|         { | ||||
|             m_log.Info("[APPEARANCE]: Sending Appearance to All Other Agents"); | ||||
|             m_perfMonMS=System.Environment.TickCount; | ||||
|             m_log.DebugFormat("[APPEARANCE]: Sending appearance to all other agents for {0}", Name); | ||||
|              | ||||
|             m_perfMonMS = System.Environment.TickCount; | ||||
| 
 | ||||
|             m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | ||||
|                                          { | ||||
|  | @ -1872,6 +1874,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
|                                                  SendAppearanceToOtherAgent(scenePresence); | ||||
|                                              } | ||||
|                                          }); | ||||
|              | ||||
|             m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | ||||
|         } | ||||
| 
 | ||||
|  | @ -1886,18 +1889,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
| 
 | ||||
|         public void SetAppearance(byte[] texture, List<byte> visualParam) | ||||
|         { | ||||
|             m_log.Info("[APPEARANCE]: Setting Appearance"); | ||||
|             m_log.DebugFormat("[APPEARANCE]: Setting appearance for {0}", Name); | ||||
|              | ||||
|             m_appearance.SetAppearance(texture, visualParam); | ||||
|             SetHeight(m_appearance.AvatarHeight); | ||||
|             m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); | ||||
| 
 | ||||
|             SendAppearanceToAllOtherAgents(); | ||||
|             SendOwnAppearance(); | ||||
|             SendWearables(); | ||||
|         } | ||||
| 
 | ||||
|         public void SetWearable(int wearableId, AvatarWearable wearable) | ||||
|         { | ||||
|             m_log.Info("[APPEARANCE]: Setting Wearable"); | ||||
|             m_log.DebugFormat("[APPEARANCE]: Setting wearable for {0}", Name); | ||||
|              | ||||
|             m_appearance.SetWearable(wearableId, wearable); | ||||
|             m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); | ||||
|             m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 Justin Clarke Casey
						Justin Clarke Casey