* 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)
{
if (this.RequestedTextures.ContainsKey(assetID))
{
MainLog.Instance.Warn("ASSET CACHE", "sending image not found for {0}", assetID);
AssetRequest req = this.RequestedTextures[assetID];
ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
notFound.ImageID.ID = assetID;
req.RequestUser.OutPacket(notFound);
this.RequestedTextures.Remove(assetID);
}
else
{
MainLog.Instance.Error("ASSET CACHE", "Cound not send image not found for {0}", assetID);
}
//if (this.RequestedTextures.ContainsKey(assetID))
//{
// MainLog.Instance.Warn("ASSET CACHE", "sending image not found for {0}", assetID);
// AssetRequest req = this.RequestedTextures[assetID];
// ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
// notFound.ImageID.ID = assetID;
// req.RequestUser.OutPacket(notFound);
// this.RequestedTextures.Remove(assetID);
//}
//else
//{
// MainLog.Instance.Error("ASSET CACHE", "Cound not send image not found for {0}", assetID);
//}
}
#region Assets

View File

@ -248,8 +248,8 @@ namespace OpenSim.Region.Environment.Scenes
Animations.LoadAnims();
//register for events
m_controllingClient.OnRequestWearables += SendAppearance;
m_controllingClient.OnSetAppearance += SetAppearance;
m_controllingClient.OnRequestWearables += SendOurAppearance;
m_controllingClient.OnSetAppearance += new SetAppearance(SetAppearance);
m_controllingClient.OnCompleteMovementToRegion += CompleteMovement;
m_controllingClient.OnCompleteMovementToRegion += SendInitialData;
m_controllingClient.OnAgentUpdate += HandleAgentUpdate;
@ -412,7 +412,7 @@ namespace OpenSim.Region.Environment.Scenes
m_visualParams[i] = visualParam[i].ParamValue;
}
SendAppearanceToAllOtherClients();
SendAppearanceToAllOtherAgents();
}
/// <summary>
@ -707,19 +707,16 @@ namespace OpenSim.Region.Environment.Scenes
public void SendFullUpdateToAllClients()
{
List<ScenePresence> agents = m_scene.GetScenePresences();
foreach (ScenePresence agent in agents)
List<ScenePresence> avatars = m_scene.GetScenePresences();
foreach (ScenePresence avatar in avatars)
{
IClientAPI client = agent.ControllingClient;
client.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid,
LocalId, AbsolutePosition, m_textureEntry.ToBytes(), m_parentID );
if (agent.LocalId != LocalId)
SendFullUpdateToOtherClient(avatar);
if (avatar.LocalId != LocalId)
{
if (!agent.m_isChildAgent)
if (!avatar.m_isChildAgent)
{
client.SendAppearance(m_controllingClient.AgentId, m_visualParams,
m_textureEntry.ToBytes());
avatar.SendFullUpdateToOtherClient(this);
avatar.SendAppearanceToOtherAgent(this);
}
}
}
@ -739,28 +736,22 @@ namespace OpenSim.Region.Environment.Scenes
}
SendFullUpdateToAllClients();
SendAppearanceToAllOtherClients();
SendAppearanceToAllOtherAgents();
}
public void SetWearable( int wearableId, AvatarWearable wearable )
{
m_wearables[wearableId] = wearable;
m_scene.ForEachClient( delegate( IClientAPI client )
{
SendAppearance( client );
});
}
public void SendAppearance(IClientAPI client)
/// <summary>
///
/// </summary>
/// <param name="client"></param>
public void SendOurAppearance(IClientAPI client)
{
client.SendWearables(m_wearables);
//this.SendFullUpdateToAllClients();
//this.SendAppearanceToAllOtherClients();
//this.SendAppearanceToAllOtherAgents();
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
//gives the user god powers, should help with debuging things in the future
@ -776,18 +767,27 @@ namespace OpenSim.Region.Environment.Scenes
/// <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,
m_textureEntry.ToBytes() );
SendAppearanceToOtherAgent(scenePresence);
}
});
}
/// <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();
}
public void SetWearable(int wearableId, AvatarWearable wearable)
{
m_wearables[wearableId] = wearable;
SendOurAppearance( m_controllingClient );
}
}
}