Fixed issues with save and retrieve appearance from grid.
parent
c7923338bc
commit
2b390f2436
|
@ -284,16 +284,19 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
m_log.WarnFormat("[AVFACTORY]: RefreshAppearance unable to find presence for {0}", agentid);
|
m_log.WarnFormat("[AVFACTORY]: RefreshAppearance unable to find presence for {0}", agentid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
m_log.DebugFormat("[AVFACTORY]: FireAndForget called for RefreshAppearance on agentid {0}", agentid);
|
||||||
Util.FireAndForget(delegate(object o)
|
Util.FireAndForget(delegate(object o)
|
||||||
{
|
{
|
||||||
AvatarAppearance appearance = m_scene.AvatarService.GetAppearance(agentid);
|
AvatarAppearance appearance = m_scene.AvatarService.GetAppearance(agentid);
|
||||||
if (appearance.Texture != null && appearance.VisualParams != null)
|
if (appearance.Texture != null && appearance.VisualParams != null)
|
||||||
{
|
{
|
||||||
sp.Appearance.SetTextureEntries(appearance.Texture);
|
sp.Appearance = appearance;
|
||||||
sp.Appearance.SetVisualParams(appearance.VisualParams);
|
if (sp.Appearance.AvatarHeight > 0)
|
||||||
sp.SetHeight(appearance.AvatarHeight);
|
sp.SetHeight(sp.Appearance.AvatarHeight);
|
||||||
QueueAppearanceSend(agentid);
|
// Send the appearance to everyone in the scene
|
||||||
|
sp.SendAppearanceToAllOtherAgents();
|
||||||
|
// Send animations back to the avatar as well
|
||||||
|
sp.Animator.SendAnimPack();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -430,6 +433,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
// since the "iswearing" will trigger a new set of visual param and baked texture changes
|
// since the "iswearing" will trigger a new set of visual param and baked texture changes
|
||||||
// when those complete, the new appearance will be sent
|
// when those complete, the new appearance will be sent
|
||||||
sp.Appearance = avatAppearance;
|
sp.Appearance = avatAppearance;
|
||||||
|
if (sp.Appearance.AvatarHeight > 0)
|
||||||
|
sp.SetHeight(sp.Appearance.AvatarHeight);
|
||||||
QueueAppearanceSave(client.AgentId);
|
QueueAppearanceSave(client.AgentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -330,7 +330,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
m_startPos = startPos;
|
m_startPos = startPos;
|
||||||
m_clientView = null;
|
m_clientView = null;
|
||||||
|
|
||||||
m_log.Debug("[REGION SYNC AVATAR] instance");
|
m_log.DebugFormat("[REGION SYNC AVATAR] instance: uuid={0}, first={1}, last={2}, startPos={3}", agentID, first, last, startPos.ToString());
|
||||||
|
|
||||||
//m_scene.EventManager.OnFrame += Update;
|
//m_scene.EventManager.OnFrame += Update;
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
m_startPos = startPos;
|
m_startPos = startPos;
|
||||||
m_clientView = view;
|
m_clientView = view;
|
||||||
|
|
||||||
m_log.Debug("[REGION SYNC AVATAR] instance");
|
m_log.Debug("[REGION SYNC AVATAR] instance: uuid={0}, first={1}, last={2}, startPos={3}, RSCV", agentID, first, last, startPos.ToString());
|
||||||
|
|
||||||
//m_scene.EventManager.OnFrame += Update;
|
//m_scene.EventManager.OnFrame += Update;
|
||||||
}
|
}
|
||||||
|
|
|
@ -269,7 +269,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
public void SendAppearanceToScene(UUID agentID)
|
public void SendAppearanceToScene(UUID agentID)
|
||||||
{
|
{
|
||||||
OSDMap data = new OSDMap();
|
OSDMap data = new OSDMap();
|
||||||
data["agentID"] = OSD.FromUUID(agentID);
|
data["id"] = OSD.FromUUID(agentID);
|
||||||
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.AvatarAppearance, OSDParser.SerializeJsonString(data)));
|
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.AvatarAppearance, OSDParser.SerializeJsonString(data)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,7 +512,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
{
|
{
|
||||||
if (doFullUpdate)
|
if (doFullUpdate)
|
||||||
{
|
{
|
||||||
presence.SendFullUpdateToAllClients();
|
presence.SendAvatarDataToAllAgents();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -808,7 +808,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
{
|
{
|
||||||
m_scene.DeleteAllSceneObjects();
|
m_scene.DeleteAllSceneObjects();
|
||||||
//KittyL: added to distinguish different actors
|
//KittyL: added to distinguish different actors
|
||||||
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.ActorType, m_actorType.ToString()));
|
//Send(new RegionSyncMessage(RegionSyncMessage.MsgType.ActorType, m_actorType.ToString()));
|
||||||
|
|
||||||
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.RegionName, m_scene.RegionInfo.RegionName));
|
Send(new RegionSyncMessage(RegionSyncMessage.MsgType.RegionName, m_scene.RegionInfo.RegionName));
|
||||||
m_log.WarnFormat("Sending region name: \"{0}\"", m_scene.RegionInfo.RegionName);
|
m_log.WarnFormat("Sending region name: \"{0}\"", m_scene.RegionInfo.RegionName);
|
||||||
|
|
|
@ -747,7 +747,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("{0} Unable to handle unsupported message type", LogHeader);
|
m_log.WarnFormat("{0} Unable to handle unsupported message type: {1}", LogHeader, msg.ToString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1411,10 +1411,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
// Run through all ScenePresences looking for updates
|
// Run through all ScenePresences looking for updates
|
||||||
// Presence updates and queued object updates for each presence are sent to clients
|
// Presence updates and queued object updates for each presence are sent to clients
|
||||||
// If it's a synced client, just send prim updates
|
// If it's a client manager, just send prim updates
|
||||||
// This will get fixed later to only send to locally logged in presences rather than all presences
|
// This will get fixed later to only send to locally logged in presences rather than all presences
|
||||||
// but requires pulling apart the concept of a client from the concept of a presence/avatar
|
// but requires pulling apart the concept of a client from the concept of a presence/avatar
|
||||||
if (IsSyncedClient())
|
if (IsSyncedClient() || !RegionSyncEnabled)
|
||||||
|
|
||||||
{
|
{
|
||||||
ForEachScenePresence(delegate(ScenePresence sp) { sp.SendPrimUpdates(); });
|
ForEachScenePresence(delegate(ScenePresence sp) { sp.SendPrimUpdates(); });
|
||||||
|
@ -1448,6 +1448,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_regionSyncServerModule.SendUpdates();
|
m_regionSyncServerModule.SendUpdates();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
// The authoritative sim should not try to send coarse locations
|
// The authoritative sim should not try to send coarse locations
|
||||||
// Leave this up to the client managers
|
// Leave this up to the client managers
|
||||||
if (!IsSyncedServer())
|
if (!IsSyncedServer())
|
||||||
|
@ -1464,6 +1465,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
* */
|
||||||
|
|
||||||
int tmpPhysicsMS2 = Util.EnvironmentTickCount();
|
int tmpPhysicsMS2 = Util.EnvironmentTickCount();
|
||||||
// Do not simulate physics locally if this is a synced client
|
// Do not simulate physics locally if this is a synced client
|
||||||
|
@ -2753,11 +2755,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
|
AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(client.CircuitCode);
|
||||||
bool vialogin = false;
|
bool vialogin = false;
|
||||||
|
|
||||||
if (aCircuit == null) // no good, didn't pass NewUserConnection successfully
|
// REGION SYNC
|
||||||
return;
|
if (!RegionSyncEnabled)
|
||||||
|
{
|
||||||
|
if (aCircuit == null) // no good, didn't pass NewUserConnection successfully
|
||||||
|
return;
|
||||||
|
|
||||||
vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 ||
|
vialogin = (aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0 ||
|
||||||
(aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
|
(aCircuit.teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
CheckHeartbeat();
|
CheckHeartbeat();
|
||||||
ScenePresence presence;
|
ScenePresence presence;
|
||||||
|
|
|
@ -2405,10 +2405,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
SendTerseUpdateToAllClients();
|
SendTerseUpdateToAllClients();
|
||||||
|
|
||||||
// REGION SYNC
|
|
||||||
if(m_scene.IsSyncedServer())
|
|
||||||
m_scene.RegionSyncServerModule.QueuePresenceForTerseUpdate(this);
|
|
||||||
|
|
||||||
// Update the "last" values
|
// Update the "last" values
|
||||||
m_lastPosition = m_pos;
|
m_lastPosition = m_pos;
|
||||||
m_lastRotation = m_bodyRot;
|
m_lastRotation = m_bodyRot;
|
||||||
|
@ -2460,9 +2456,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void SendTerseUpdateToAllClients()
|
public void SendTerseUpdateToAllClients()
|
||||||
{
|
{
|
||||||
// REGION SYNC
|
// REGION SYNC
|
||||||
// The server should not be doing anything via the ForEachScenePresence method
|
|
||||||
if (m_scene.IsSyncedServer())
|
if (m_scene.IsSyncedServer())
|
||||||
|
{
|
||||||
|
m_scene.RegionSyncServerModule.QueuePresenceForTerseUpdate(this);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_perfMonMS = Util.EnvironmentTickCount();
|
m_perfMonMS = Util.EnvironmentTickCount();
|
||||||
|
|
||||||
m_scene.ForEachClient(SendTerseUpdateToClient);
|
m_scene.ForEachClient(SendTerseUpdateToClient);
|
||||||
|
@ -2548,6 +2547,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void SendAvatarDataToAllAgents()
|
public void SendAvatarDataToAllAgents()
|
||||||
{
|
{
|
||||||
|
// REGION SYNC
|
||||||
|
// The server sends appearance to all client managers since there are no local clients
|
||||||
|
if (m_scene.IsSyncedServer())
|
||||||
|
{
|
||||||
|
m_scene.RegionSyncServerModule.SendAppearance(UUID);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// only send update from root agents to other clients; children are only "listening posts"
|
// only send update from root agents to other clients; children are only "listening posts"
|
||||||
if (IsChildAgent)
|
if (IsChildAgent)
|
||||||
{
|
{
|
||||||
|
@ -2621,7 +2628,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
// The server should not be doing anything via the ForEachScenePresence method
|
// The server should not be doing anything via the ForEachScenePresence method
|
||||||
if (m_scene.IsSyncedServer())
|
if (m_scene.IsSyncedServer())
|
||||||
{
|
{
|
||||||
m_scene.RegionSyncServerModule.QueuePresenceForTerseUpdate(this);
|
m_scene.RegionSyncServerModule.SendAppearance(UUID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// only send update from root agents to other clients; children are only "listening posts"
|
// only send update from root agents to other clients; children are only "listening posts"
|
||||||
|
@ -2679,7 +2686,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="avatar"></param>
|
/// <param name="avatar"></param>
|
||||||
public void SendAppearanceToAgent(ScenePresence avatar)
|
public void SendAppearanceToAgent(ScenePresence avatar)
|
||||||
{
|
{
|
||||||
// m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId);
|
m_log.DebugFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId);
|
||||||
|
|
||||||
avatar.ControllingClient.SendAppearance(
|
avatar.ControllingClient.SendAppearance(
|
||||||
m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
|
m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
|
||||||
|
|
|
@ -116,6 +116,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
// <param name="userID"></param>
|
// <param name="userID"></param>
|
||||||
public AvatarAppearance GetAppearance(UUID userID)
|
public AvatarAppearance GetAppearance(UUID userID)
|
||||||
{
|
{
|
||||||
|
m_log.DebugFormat("[SIMIAN AVATAR CONNECTOR] Start of GetAppearance for {0}", userID);
|
||||||
NameValueCollection requestArgs = new NameValueCollection
|
NameValueCollection requestArgs = new NameValueCollection
|
||||||
{
|
{
|
||||||
{ "RequestMethod", "GetUser" },
|
{ "RequestMethod", "GetUser" },
|
||||||
|
@ -125,25 +126,39 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
|
OSDMap response = WebUtil.PostToService(m_serverUrl, requestArgs);
|
||||||
if (response["Success"].AsBoolean())
|
if (response["Success"].AsBoolean())
|
||||||
{
|
{
|
||||||
OSDMap map = null;
|
OSDMap usermap = null;
|
||||||
try { map = OSDParser.DeserializeJson(response["LLPackedAppearance"].AsString()) as OSDMap; }
|
try
|
||||||
catch { }
|
|
||||||
|
|
||||||
if (map != null)
|
|
||||||
{
|
{
|
||||||
AvatarAppearance appearance = new AvatarAppearance(map);
|
usermap = OSDParser.DeserializeJson(response["User"].ToString()) as OSDMap;
|
||||||
// DEBUG ON
|
}
|
||||||
m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR] retrieved appearance for {0}:\n{1}",userID,appearance.ToString());
|
catch (Exception e)
|
||||||
// DEBUG OFF
|
{
|
||||||
return appearance;
|
m_log.ErrorFormat("[SIMIAN AVATAR CONNECTOR] Caught exception deserializing \"User\" in GetAppearance for {0}: {1}", userID, e.Message);
|
||||||
|
}
|
||||||
|
if (usermap != null)
|
||||||
|
{
|
||||||
|
OSDMap appearancemap = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
appearancemap = OSDParser.DeserializeJson(usermap["LLPackedAppearance"].ToString()) as OSDMap;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[SIMIAN AVATAR CONNECTOR] Caught exception deserializing \"LLPackedAppearance\" in GetAppearance for {0}: {1}", userID, e.Message);
|
||||||
|
}
|
||||||
|
if (appearancemap != null)
|
||||||
|
{
|
||||||
|
AvatarAppearance appearance = new AvatarAppearance(userID, appearancemap);
|
||||||
|
m_log.DebugFormat("[SIMIAN AVATAR CONNECTOR] Retrieved appearance for {0}:\n{1}", userID, appearance.ToString());
|
||||||
|
return appearance;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to decode appearance for {0}",userID);
|
m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to decode appearance for {0}", userID);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to get appearance for {0}: {1}",
|
m_log.WarnFormat("[SIMIAN AVATAR CONNECTOR]: Failed to get appearance for {0}: {1}", userID, response["Message"].AsString());
|
||||||
userID,response["Message"].AsString());
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
</appender>
|
</appender>
|
||||||
|
|
||||||
<root>
|
<root>
|
||||||
<level value="WARN" />
|
<level value="DEBUG" />
|
||||||
<appender-ref ref="Console" />
|
<appender-ref ref="Console" />
|
||||||
<appender-ref ref="LogFileAppender" />
|
<appender-ref ref="LogFileAppender" />
|
||||||
</root>
|
</root>
|
||||||
|
|
Loading…
Reference in New Issue