* Removed AssetNotFound as it crashes client

* Fixed introduced bugs in ScenePresence
afrisby
lbsa71 2007-10-29 12:59:04 +00:00
parent 03d49b0217
commit 27b5fad56d
2 changed files with 56 additions and 50 deletions

View File

@ -358,19 +358,19 @@ namespace OpenSim.Framework.Communications.Cache
public void AssetNotFound(LLUUID assetID) public void AssetNotFound(LLUUID assetID)
{ {
if (this.RequestedTextures.ContainsKey(assetID)) //if (this.RequestedTextures.ContainsKey(assetID))
{ //{
MainLog.Instance.Warn("ASSET CACHE", "sending image not found for {0}", assetID); // MainLog.Instance.Warn("ASSET CACHE", "sending image not found for {0}", assetID);
AssetRequest req = this.RequestedTextures[assetID]; // AssetRequest req = this.RequestedTextures[assetID];
ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); // ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
notFound.ImageID.ID = assetID; // notFound.ImageID.ID = assetID;
req.RequestUser.OutPacket(notFound); // req.RequestUser.OutPacket(notFound);
this.RequestedTextures.Remove(assetID); // this.RequestedTextures.Remove(assetID);
} //}
else //else
{ //{
MainLog.Instance.Error("ASSET CACHE", "Cound not send image not found for {0}", assetID); // MainLog.Instance.Error("ASSET CACHE", "Cound not send image not found for {0}", assetID);
} //}
} }
#region Assets #region Assets

View File

@ -248,8 +248,8 @@ namespace OpenSim.Region.Environment.Scenes
Animations.LoadAnims(); Animations.LoadAnims();
//register for events //register for events
m_controllingClient.OnRequestWearables += SendAppearance; m_controllingClient.OnRequestWearables += SendOurAppearance;
m_controllingClient.OnSetAppearance += SetAppearance; m_controllingClient.OnSetAppearance += new SetAppearance(SetAppearance);
m_controllingClient.OnCompleteMovementToRegion += CompleteMovement; m_controllingClient.OnCompleteMovementToRegion += CompleteMovement;
m_controllingClient.OnCompleteMovementToRegion += SendInitialData; m_controllingClient.OnCompleteMovementToRegion += SendInitialData;
m_controllingClient.OnAgentUpdate += HandleAgentUpdate; m_controllingClient.OnAgentUpdate += HandleAgentUpdate;
@ -412,7 +412,7 @@ namespace OpenSim.Region.Environment.Scenes
m_visualParams[i] = visualParam[i].ParamValue; m_visualParams[i] = visualParam[i].ParamValue;
} }
SendAppearanceToAllOtherClients(); SendAppearanceToAllOtherAgents();
} }
/// <summary> /// <summary>
@ -707,19 +707,16 @@ namespace OpenSim.Region.Environment.Scenes
public void SendFullUpdateToAllClients() public void SendFullUpdateToAllClients()
{ {
List<ScenePresence> agents = m_scene.GetScenePresences(); List<ScenePresence> avatars = m_scene.GetScenePresences();
foreach (ScenePresence agent in agents) foreach (ScenePresence avatar in avatars)
{ {
IClientAPI client = agent.ControllingClient; SendFullUpdateToOtherClient(avatar);
client.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, if (avatar.LocalId != LocalId)
LocalId, AbsolutePosition, m_textureEntry.ToBytes(), m_parentID );
if (agent.LocalId != LocalId)
{ {
if (!agent.m_isChildAgent) if (!avatar.m_isChildAgent)
{ {
client.SendAppearance(m_controllingClient.AgentId, m_visualParams, avatar.SendFullUpdateToOtherClient(this);
m_textureEntry.ToBytes()); avatar.SendAppearanceToOtherAgent(this);
} }
} }
} }
@ -739,28 +736,22 @@ namespace OpenSim.Region.Environment.Scenes
} }
SendFullUpdateToAllClients(); SendFullUpdateToAllClients();
SendAppearanceToAllOtherClients(); SendAppearanceToAllOtherAgents();
} }
public void SetWearable( int wearableId, AvatarWearable wearable ) /// <summary>
{ ///
m_wearables[wearableId] = wearable; /// </summary>
/// <param name="client"></param>
m_scene.ForEachClient( delegate( IClientAPI client ) public void SendOurAppearance(IClientAPI client)
{
SendAppearance( client );
});
}
public void SendAppearance(IClientAPI client)
{ {
client.SendWearables(m_wearables); client.SendWearables(m_wearables);
//this.SendFullUpdateToAllClients(); //this.SendFullUpdateToAllClients();
//this.SendAppearanceToAllOtherClients(); //this.SendAppearanceToAllOtherAgents();
m_scene.SendAllSceneObjectsToClient(this); m_scene.SendAllSceneObjectsToClient(this);
client.SendViewerTime(m_scene.TimePhase); m_controllingClient.SendViewerTime(m_scene.TimePhase);
//Please don't remove the following code (at least not yet), just leave it commented out //Please don't remove the following code (at least not yet), just leave it commented out
//gives the user god powers, should help with debuging things in the future //gives the user god powers, should help with debuging things in the future
@ -776,16 +767,25 @@ namespace OpenSim.Region.Environment.Scenes
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public void SendAppearanceToAllOtherClients() public void SendAppearanceToAllOtherAgents()
{ {
m_scene.ForEachClient(delegate(IClientAPI client) m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
{ {
if( client != m_controllingClient ) if (scenePresence != this)
{ {
client.SendAppearance(m_controllingClient.AgentId, m_visualParams, SendAppearanceToOtherAgent(scenePresence);
m_textureEntry.ToBytes() ); }
} });
}); }
/// <summary>
///
/// </summary>
/// <param name="avatarInfo"></param>
public void SendAppearanceToOtherAgent(ScenePresence avatarInfo)
{
avatarInfo.m_controllingClient.SendAppearance(m_controllingClient.AgentId, m_visualParams,
m_textureEntry.ToBytes());
} }
/// <summary> /// <summary>
@ -1005,5 +1005,11 @@ namespace OpenSim.Region.Environment.Scenes
{ {
RemoveFromPhysicalScene(); RemoveFromPhysicalScene();
} }
public void SetWearable(int wearableId, AvatarWearable wearable)
{
m_wearables[wearableId] = wearable;
SendOurAppearance( m_controllingClient );
}
} }
} }