diff options
author | Justin Clarke Casey | 2008-10-28 17:35:36 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-10-28 17:35:36 +0000 |
commit | 247b806134819f3806c078ca891791b718ff8984 (patch) | |
tree | 71b36f876c2b78426e76bb9c80bf1ee984da95d3 /OpenSim/Region/Environment | |
parent | * Eliminate an extra unnecessary appearance fetch on login (diff) | |
download | opensim-SC_OLD-247b806134819f3806c078ca891791b718ff8984.zip opensim-SC_OLD-247b806134819f3806c078ca891791b718ff8984.tar.gz opensim-SC_OLD-247b806134819f3806c078ca891791b718ff8984.tar.bz2 opensim-SC_OLD-247b806134819f3806c078ca891791b718ff8984.tar.xz |
* minor: Add documentation to some of the appearance methods, change some logging messages
Diffstat (limited to '')
3 files changed, 28 insertions, 21 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs index d3b782f..94c27a5 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -131,8 +131,6 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
131 | } | 131 | } |
132 | else | 132 | else |
133 | { | 133 | { |
134 | // UUID assetId; | ||
135 | |||
136 | InventoryItemBase baseItem = profile.RootFolder.FindItem(appearance.Wearables[i].ItemID); | 134 | InventoryItemBase baseItem = profile.RootFolder.FindItem(appearance.Wearables[i].ItemID); |
137 | 135 | ||
138 | if (baseItem != null) | 136 | if (baseItem != null) |
@@ -141,7 +139,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
141 | } | 139 | } |
142 | else | 140 | else |
143 | { | 141 | { |
144 | m_log.ErrorFormat("[APPEARANCE] Can't find inventory item {0}, setting to default", appearance.Wearables[i].ItemID); | 142 | m_log.ErrorFormat("[APPEARANCE]: Can't find inventory item {0}, setting to default", appearance.Wearables[i].ItemID); |
145 | appearance.Wearables[i].AssetID = def.Wearables[i].AssetID; | 143 | appearance.Wearables[i].AssetID = def.Wearables[i].AssetID; |
146 | } | 144 | } |
147 | } | 145 | } |
@@ -149,7 +147,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
149 | } | 147 | } |
150 | else | 148 | else |
151 | { | 149 | { |
152 | m_log.Error("[APPEARANCE] you have no inventory, appearance stuff isn't going to work"); | 150 | m_log.Error("[APPEARANCE]: you have no inventory, appearance stuff isn't going to work"); |
153 | } | 151 | } |
154 | } | 152 | } |
155 | 153 | ||
@@ -157,19 +155,24 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
157 | { | 155 | { |
158 | IClientAPI clientView = (IClientAPI)sender; | 156 | IClientAPI clientView = (IClientAPI)sender; |
159 | ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId); | 157 | ScenePresence avatar = m_scene.GetScenePresence(clientView.AgentId); |
160 | if (avatar == null) { | 158 | |
161 | m_log.Info("Avatar is child agent, ignoring AvatarIsWearing event"); | 159 | if (avatar == null) |
160 | { | ||
161 | m_log.Warn("[APPEARANCE]: Avatar is child agent, ignoring AvatarIsWearing event"); | ||
162 | return; | 162 | return; |
163 | } | 163 | } |
164 | 164 | ||
165 | CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); | 165 | CachedUserInfo profile = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(clientView.AgentId); |
166 | 166 | ||
167 | AvatarAppearance avatAppearance = null; | 167 | AvatarAppearance avatAppearance = null; |
168 | if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) { | 168 | if (!TryGetAvatarAppearance(clientView.AgentId, out avatAppearance)) |
169 | m_log.Info("We didn't seem to find the appearance, falling back to ScenePresense"); | 169 | { |
170 | m_log.Info("[APPEARANCE]: We didn't seem to find the appearance, falling back to ScenePresense"); | ||
170 | avatAppearance = avatar.Appearance; | 171 | avatAppearance = avatar.Appearance; |
171 | } | 172 | } |
172 | m_log.Info("Calling Avatar is Wearing"); | 173 | |
174 | m_log.Info("[APPEARANCE]: Calling Avatar is Wearing"); | ||
175 | |||
173 | if (profile != null) | 176 | if (profile != null) |
174 | { | 177 | { |
175 | if (profile.RootFolder != null) | 178 | if (profile.RootFolder != null) |
@@ -181,6 +184,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
181 | avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; | 184 | avatAppearance.Wearables[wear.Type].ItemID = wear.ItemID; |
182 | } | 185 | } |
183 | } | 186 | } |
187 | |||
184 | SetAppearanceAssets(profile, ref avatAppearance); | 188 | SetAppearanceAssets(profile, ref avatAppearance); |
185 | 189 | ||
186 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(clientView.AgentId, avatAppearance); | 190 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(clientView.AgentId, avatAppearance); |
@@ -188,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules.Avatar.AvatarFactory | |||
188 | } | 192 | } |
189 | else | 193 | else |
190 | { | 194 | { |
191 | m_log.Error("Root Profile is null, we can't set the appearance"); | 195 | m_log.Error("[APPEARANCE]: Root Profile is null, we can't set the appearance"); |
192 | } | 196 | } |
193 | } | 197 | } |
194 | } | 198 | } |
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 8d94c68..77afc43 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2236,8 +2236,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
2236 | protected virtual void SubscribeToClientEvents(IClientAPI client) | 2236 | protected virtual void SubscribeToClientEvents(IClientAPI client) |
2237 | { | 2237 | { |
2238 | client.OnRegionHandShakeReply += SendLayerData; | 2238 | client.OnRegionHandShakeReply += SendLayerData; |
2239 | //remoteClient.OnRequestWearables += new GenericCall(this.GetInitialPrims); | ||
2240 | // client.OnRequestWearables += InformClientOfNeighbours; | ||
2241 | client.OnAddPrim += AddNewPrim; | 2239 | client.OnAddPrim += AddNewPrim; |
2242 | client.OnUpdatePrimGroupPosition += m_innerScene.UpdatePrimPosition; | 2240 | client.OnUpdatePrimGroupPosition += m_innerScene.UpdatePrimPosition; |
2243 | client.OnUpdatePrimSinglePosition += m_innerScene.UpdatePrimSinglePosition; | 2241 | client.OnUpdatePrimSinglePosition += m_innerScene.UpdatePrimSinglePosition; |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 6f6e0cb..7bc0360 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -527,7 +527,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
527 | 527 | ||
528 | public void RegisterToEvents() | 528 | public void RegisterToEvents() |
529 | { | 529 | { |
530 | m_controllingClient.OnRequestWearables += SendOwnAppearance; | 530 | m_controllingClient.OnRequestWearables += SendWearables; |
531 | m_controllingClient.OnSetAppearance += SetAppearance; | 531 | m_controllingClient.OnSetAppearance += SetAppearance; |
532 | m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; | 532 | m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; |
533 | m_controllingClient.OnCompleteMovementToRegion += SendInitialData; | 533 | m_controllingClient.OnCompleteMovementToRegion += SendInitialData; |
@@ -1843,12 +1843,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1843 | } | 1843 | } |
1844 | 1844 | ||
1845 | /// <summary> | 1845 | /// <summary> |
1846 | /// | 1846 | /// Tell the client for this scene presence what items it should be wearing now |
1847 | /// </summary> | 1847 | /// </summary> |
1848 | /// <param name="client"></param> | 1848 | /// <param name="client"></param> |
1849 | public void SendOwnAppearance() | 1849 | public void SendWearables() |
1850 | { | 1850 | { |
1851 | m_log.Info("[APPEARANCE]: Sending Own Appearance"); | 1851 | m_log.DebugFormat("[APPEARANCE]: Sending wearables to {0}", Name); |
1852 | |||
1852 | ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); | 1853 | ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); |
1853 | // ControllingClient.SendAppearance( | 1854 | // ControllingClient.SendAppearance( |
1854 | // m_appearance.Owner, | 1855 | // m_appearance.Owner, |
@@ -1862,8 +1863,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1862 | /// </summary> | 1863 | /// </summary> |
1863 | public void SendAppearanceToAllOtherAgents() | 1864 | public void SendAppearanceToAllOtherAgents() |
1864 | { | 1865 | { |
1865 | m_log.Info("[APPEARANCE]: Sending Appearance to All Other Agents"); | 1866 | m_log.DebugFormat("[APPEARANCE]: Sending appearance to all other agents for {0}", Name); |
1866 | m_perfMonMS=System.Environment.TickCount; | 1867 | |
1868 | m_perfMonMS = System.Environment.TickCount; | ||
1867 | 1869 | ||
1868 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) | 1870 | m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence) |
1869 | { | 1871 | { |
@@ -1872,6 +1874,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1872 | SendAppearanceToOtherAgent(scenePresence); | 1874 | SendAppearanceToOtherAgent(scenePresence); |
1873 | } | 1875 | } |
1874 | }); | 1876 | }); |
1877 | |||
1875 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); | 1878 | m_scene.AddAgentTime(System.Environment.TickCount - m_perfMonMS); |
1876 | } | 1879 | } |
1877 | 1880 | ||
@@ -1886,18 +1889,20 @@ namespace OpenSim.Region.Environment.Scenes | |||
1886 | 1889 | ||
1887 | public void SetAppearance(byte[] texture, List<byte> visualParam) | 1890 | public void SetAppearance(byte[] texture, List<byte> visualParam) |
1888 | { | 1891 | { |
1889 | m_log.Info("[APPEARANCE]: Setting Appearance"); | 1892 | m_log.DebugFormat("[APPEARANCE]: Setting appearance for {0}", Name); |
1893 | |||
1890 | m_appearance.SetAppearance(texture, visualParam); | 1894 | m_appearance.SetAppearance(texture, visualParam); |
1891 | SetHeight(m_appearance.AvatarHeight); | 1895 | SetHeight(m_appearance.AvatarHeight); |
1892 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); | 1896 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); |
1893 | 1897 | ||
1894 | SendAppearanceToAllOtherAgents(); | 1898 | SendAppearanceToAllOtherAgents(); |
1895 | SendOwnAppearance(); | 1899 | SendWearables(); |
1896 | } | 1900 | } |
1897 | 1901 | ||
1898 | public void SetWearable(int wearableId, AvatarWearable wearable) | 1902 | public void SetWearable(int wearableId, AvatarWearable wearable) |
1899 | { | 1903 | { |
1900 | m_log.Info("[APPEARANCE]: Setting Wearable"); | 1904 | m_log.DebugFormat("[APPEARANCE]: Setting wearable for {0}", Name); |
1905 | |||
1901 | m_appearance.SetWearable(wearableId, wearable); | 1906 | m_appearance.SetWearable(wearableId, wearable); |
1902 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); | 1907 | m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); |
1903 | m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); | 1908 | m_controllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); |