Fixed more appearance woes that showed up using remote connectors. Appearance is now being passed with AgentCircuitData, as it should be.

slimupdates
Diva Canto 2010-01-12 09:22:58 -08:00
parent 77e43f4801
commit 66920a9047
12 changed files with 102 additions and 33 deletions

View File

@ -155,6 +155,31 @@ namespace OpenSim.Framework
args["secure_session_id"] = OSD.FromUUID(SecureSessionID); args["secure_session_id"] = OSD.FromUUID(SecureSessionID);
args["session_id"] = OSD.FromUUID(SessionID); args["session_id"] = OSD.FromUUID(SessionID);
args["start_pos"] = OSD.FromString(startpos.ToString()); args["start_pos"] = OSD.FromString(startpos.ToString());
args["appearance_serial"] = OSD.FromInteger(Appearance.Serial);
// We might not pass this in all cases...
if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0))
{
OSDArray wears = new OSDArray(Appearance.Wearables.Length);
foreach (AvatarWearable awear in Appearance.Wearables)
{
wears.Add(OSD.FromUUID(awear.ItemID));
wears.Add(OSD.FromUUID(awear.AssetID));
}
args["wearables"] = wears;
}
Dictionary<int, UUID[]> attachments = Appearance.GetAttachmentDictionary();
if ((attachments != null) && (attachments.Count > 0))
{
OSDArray attachs = new OSDArray(attachments.Count);
foreach (KeyValuePair<int, UUID[]> kvp in attachments)
{
AttachmentData adata = new AttachmentData(kvp.Key, kvp.Value[0], kvp.Value[1]);
attachs.Add(adata.PackUpdateMessage());
}
args["attachments"] = attachs;
}
return args; return args;
} }
@ -209,8 +234,35 @@ namespace OpenSim.Framework
if (args["session_id"] != null) if (args["session_id"] != null)
SessionID = args["session_id"].AsUUID(); SessionID = args["session_id"].AsUUID();
if (args["start_pos"] != null) if (args["start_pos"] != null)
Vector3.TryParse(args["start_pos"].AsString(), out startpos); Vector3.TryParse(args["start_pos"].AsString(), out startpos);
Appearance = new AvatarAppearance(AgentID);
if (args["appearance_serial"] != null)
Appearance.Serial = args["appearance_serial"].AsInteger();
if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array)
{
OSDArray wears = (OSDArray)(args["wearables"]);
for (int i = 0; i < wears.Count / 2; i++)
{
Appearance.Wearables[i].ItemID = wears[i*2].AsUUID();
Appearance.Wearables[i].AssetID = wears[(i*2)+1].AsUUID();
}
}
if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
{
OSDArray attachs = (OSDArray)(args["attachments"]);
AttachmentData[] attachments = new AttachmentData[attachs.Count];
int i = 0;
foreach (OSD o in attachs)
{
if (o.Type == OSDType.Map)
{
attachments[i++] = new AttachmentData((OSDMap)o);
}
}
Appearance.SetAttachments(attachments);
}
} }
} }

View File

@ -566,6 +566,16 @@ namespace OpenSim.Framework
private Dictionary<int, UUID[]> m_attachments = new Dictionary<int, UUID[]>(); private Dictionary<int, UUID[]> m_attachments = new Dictionary<int, UUID[]>();
public void SetAttachments(AttachmentData[] data)
{
foreach (AttachmentData a in data)
{
m_attachments[a.AttachPoint] = new UUID[2];
m_attachments[a.AttachPoint][0] = a.ItemID;
m_attachments[a.AttachPoint][1] = a.AssetID;
}
}
public void SetAttachments(Hashtable data) public void SetAttachments(Hashtable data)
{ {
m_attachments.Clear(); m_attachments.Clear();
@ -595,6 +605,11 @@ namespace OpenSim.Framework
} }
} }
public Dictionary<int, UUID[]> GetAttachmentDictionary()
{
return m_attachments;
}
public Hashtable GetAttachments() public Hashtable GetAttachments()
{ {
if (m_attachments.Count == 0) if (m_attachments.Count == 0)

View File

@ -334,6 +334,7 @@ namespace OpenSim.Framework
args["left_axis"] = OSD.FromString(LeftAxis.ToString()); args["left_axis"] = OSD.FromString(LeftAxis.ToString());
args["up_axis"] = OSD.FromString(UpAxis.ToString()); args["up_axis"] = OSD.FromString(UpAxis.ToString());
args["changed_grid"] = OSD.FromBoolean(ChangedGrid); args["changed_grid"] = OSD.FromBoolean(ChangedGrid);
args["far"] = OSD.FromReal(Far); args["far"] = OSD.FromReal(Far);
args["aspect"] = OSD.FromReal(Aspect); args["aspect"] = OSD.FromReal(Aspect);
@ -353,7 +354,7 @@ namespace OpenSim.Framework
args["agent_access"] = OSD.FromString(AgentAccess.ToString()); args["agent_access"] = OSD.FromString(AgentAccess.ToString());
args["active_group_id"] = OSD.FromUUID(ActiveGroupID); args["active_group_id"] = OSD.FromUUID(ActiveGroupID);
if ((Groups != null) && (Groups.Length > 0)) if ((Groups != null) && (Groups.Length > 0))
{ {
OSDArray groups = new OSDArray(Groups.Length); OSDArray groups = new OSDArray(Groups.Length);
@ -378,6 +379,7 @@ namespace OpenSim.Framework
// args["agent_textures"] = textures; // args["agent_textures"] = textures;
//} //}
if ((AgentTextures != null) && (AgentTextures.Length > 0)) if ((AgentTextures != null) && (AgentTextures.Length > 0))
args["texture_entry"] = OSD.FromBinary(AgentTextures); args["texture_entry"] = OSD.FromBinary(AgentTextures);
@ -393,6 +395,7 @@ namespace OpenSim.Framework
args["wearables"] = wears; args["wearables"] = wears;
} }
if ((Attachments != null) && (Attachments.Length > 0)) if ((Attachments != null) && (Attachments.Length > 0))
{ {
OSDArray attachs = new OSDArray(Attachments.Length); OSDArray attachs = new OSDArray(Attachments.Length);
@ -401,9 +404,11 @@ namespace OpenSim.Framework
args["attachments"] = attachs; args["attachments"] = attachs;
} }
if ((CallbackURI != null) && (!CallbackURI.Equals(""))) if ((CallbackURI != null) && (!CallbackURI.Equals("")))
args["callback_uri"] = OSD.FromString(CallbackURI); args["callback_uri"] = OSD.FromString(CallbackURI);
return args; return args;
} }

View File

@ -337,15 +337,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
private UUID GetSessionID(UUID userID) private UUID GetSessionID(UUID userID)
{ {
ScenePresence sp = null;
if (m_Scene.TryGetAvatar(userID, out sp))
{
return sp.ControllingClient.SessionId;
}
m_log.DebugFormat("[INVENTORY CONNECTOR]: scene presence for {0} not found", userID);
return UUID.Zero; return UUID.Zero;
} }
} }

View File

@ -172,12 +172,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
{ {
if (s.RegionInfo.RegionHandle == destination.RegionHandle) if (s.RegionInfo.RegionHandle == destination.RegionHandle)
{ {
m_log.DebugFormat("[LOCAL COMMS]: Found region {0} to send SendCreateChildAgent", destination.RegionName); m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Found region {0} to send SendCreateChildAgent", destination.RegionName);
return s.NewUserConnection(aCircuit, teleportFlags, out reason); return s.NewUserConnection(aCircuit, teleportFlags, out reason);
} }
} }
m_log.DebugFormat("[LOCAL COMMS]: Did not find region {0} for SendCreateChildAgent", destination.RegionName); m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Did not find region {0} for SendCreateChildAgent", destination.RegionName);
reason = "Did not find region " + destination.RegionName; reason = "Did not find region " + destination.RegionName;
return false; return false;
} }
@ -191,9 +191,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
{ {
if (s.RegionInfo.RegionHandle == destination.RegionHandle) if (s.RegionInfo.RegionHandle == destination.RegionHandle)
{ {
//m_log.DebugFormat( m_log.DebugFormat(
// "[LOCAL COMMS]: Found region {0} {1} to send ChildAgentUpdate", "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
// s.RegionInfo.RegionName, regionHandle); s.RegionInfo.RegionName, destination.RegionHandle);
s.IncomingChildAgentDataUpdate(cAgentData); s.IncomingChildAgentDataUpdate(cAgentData);
return true; return true;

View File

@ -3708,8 +3708,8 @@ namespace OpenSim.Region.Framework.Scenes
/// <returns>true if we handled it.</returns> /// <returns>true if we handled it.</returns>
public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData)
{ {
// m_log.DebugFormat( m_log.DebugFormat(
// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName);
// We have to wait until the viewer contacts this region after receiving EAC. // We have to wait until the viewer contacts this region after receiving EAC.
// That calls AddNewClient, which finally creates the ScenePresence // That calls AddNewClient, which finally creates the ScenePresence

View File

@ -2575,9 +2575,9 @@ namespace OpenSim.Region.Framework.Scenes
if (m_appearance.AvatarHeight > 0) if (m_appearance.AvatarHeight > 0)
SetHeight(m_appearance.AvatarHeight); SetHeight(m_appearance.AvatarHeight);
AvatarData adata = new AvatarData(m_appearance); // This is not needed, because only the transient data changed
//AvatarData adata = new AvatarData(m_appearance);
m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata); //m_scene.AvatarService.SetAvatar(m_controllingClient.AgentId, adata);
SendAppearanceToAllOtherAgents(); SendAppearanceToAllOtherAgents();
if (!m_startAnimationSet) if (!m_startAnimationSet)

View File

@ -210,12 +210,12 @@ namespace OpenSim.Services.Connectors.Simulation
public bool UpdateAgent(GridRegion destination, AgentData data) public bool UpdateAgent(GridRegion destination, AgentData data)
{ {
return UpdateAgent(destination, data); return UpdateAgent(destination, (IAgentData)data);
} }
public bool UpdateAgent(GridRegion destination, AgentPosition data) public bool UpdateAgent(GridRegion destination, AgentPosition data)
{ {
return UpdateAgent(destination, data); return UpdateAgent(destination, (IAgentData)data);
} }
private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
@ -231,7 +231,7 @@ namespace OpenSim.Services.Connectors.Simulation
m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message); m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message);
return false; return false;
} }
//Console.WriteLine(" >>> DoChildAgentUpdateCall <<< " + uri); Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
ChildUpdateRequest.Method = "PUT"; ChildUpdateRequest.Method = "PUT";
@ -276,12 +276,12 @@ namespace OpenSim.Services.Connectors.Simulation
ChildUpdateRequest.ContentLength = buffer.Length; //Count bytes to send ChildUpdateRequest.ContentLength = buffer.Length; //Count bytes to send
os = ChildUpdateRequest.GetRequestStream(); os = ChildUpdateRequest.GetRequestStream();
os.Write(buffer, 0, strBuffer.Length); //Send it os.Write(buffer, 0, strBuffer.Length); //Send it
//m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted ChildAgentUpdate request to remote sim {0}", uri); m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Posted AgentUpdate request to remote sim {0}", uri);
} }
//catch (WebException ex) catch (WebException ex)
catch //catch
{ {
//m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on ChildAgentUpdate {0}", ex.Message); m_log.InfoFormat("[REMOTE SIMULATION CONNECTOR]: Bad send on AgentUpdate {0}", ex.Message);
return false; return false;
} }

View File

@ -123,7 +123,7 @@ namespace OpenSim.Services.Interfaces
if (_kvp.Value != null) if (_kvp.Value != null)
result[_kvp.Key] = _kvp.Value; result[_kvp.Key] = _kvp.Value;
} }
return null; return result;
} }
public AvatarData(AvatarAppearance appearance) public AvatarData(AvatarAppearance appearance)

View File

@ -298,6 +298,7 @@ namespace OpenSim.Services.InventoryService
if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown))
folders[(AssetType)folder.Type] = folder; folders[(AssetType)folder.Type] = folder;
} }
m_log.DebugFormat("[INVENTORY SERVICE]: Got {0} system folders for {1}", folders.Count, userID);
return folders; return folders;
} }
} }

View File

@ -75,7 +75,7 @@ ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.S
[OpenIdService] [OpenIdService]
; for the server connector ; for the server connector
AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" AuthenticationServiceModule = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" UserAccountServiceModule = "OpenSim.Services.UserAccountService.dll:UserAccountService"
; * This is the new style user service. ; * This is the new style user service.
; * "Realm" is the table that is used for user lookup. ; * "Realm" is the table that is used for user lookup.
@ -96,6 +96,13 @@ ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.S
StorageProvider = "OpenSim.Data.MySQL.dll" StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;" ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;"
[AvatarService]
; for the server connector
LocalServiceModule = "OpenSim.Services.AvatarService.dll:AvatarService"
; for the service
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim123;"
[LibraryService] [LibraryService]
LibraryName = "OpenSim Library" LibraryName = "OpenSim Library"
DefaultLibrary = "./inventory/Libraries.xml" DefaultLibrary = "./inventory/Libraries.xml"
@ -107,6 +114,7 @@ ServiceConnectors = "OpenSim.Server.Handlers.dll:AssetServiceConnector,OpenSim.S
UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService" UserAccountService = "OpenSim.Services.UserAccountService.dll:UserAccountService"
AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService" AuthenticationService = "OpenSim.Services.AuthenticationService.dll:PasswordAuthenticationService"
InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService" InventoryService = "OpenSim.Services.InventoryService.dll:InventoryService"
AvatarService = "OpenSim.Services.AvatarService.dll:AvatarService"
PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService" PresenceService = "OpenSim.Services.PresenceService.dll:PresenceService"
GridService = "OpenSim.Services.GridService.dll:GridService" GridService = "OpenSim.Services.GridService.dll:GridService"
SimulationService ="OpenSim.Services.Connectors.dll:SimulationServiceConnector" SimulationService ="OpenSim.Services.Connectors.dll:SimulationServiceConnector"

View File

@ -44,7 +44,3 @@
; which in turn uses this ; which in turn uses this
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
StorageProvider = "OpenSim.Data.Null.dll:NullRegionData" StorageProvider = "OpenSim.Data.Null.dll:NullRegionData"
; Temporary...
[Communications]
InterregionComms = "LocalComms"