mirror of
https://github.com/opensim/opensim.git
synced 2026-08-08 10:15:33 +08:00
Attachments now save to MySQL. No reattach on login yet.
This commit is contained in:
@@ -380,7 +380,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
SceneObjectGroup group = (SceneObjectGroup)obj;
|
||||
|
||||
//group.DetachToGround();
|
||||
DetachSingleAttachmentToInv(group.GetFromAssetID(),remoteClient);
|
||||
m_parentScene.DetachSingleAttachmentToInv(group.GetFromAssetID(),remoteClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
AttachObject(remoteClient, objectLocalID, AttachmentPt, rot, LLVector3.Zero);
|
||||
}
|
||||
|
||||
protected internal void RezSingleAttachment(
|
||||
public SceneObjectGroup RezSingleAttachment(
|
||||
IClientAPI remoteClient, LLUUID itemID, uint AttachmentPt,uint ItemFlags, uint NextOwnerMask)
|
||||
{
|
||||
SceneObjectGroup objatt = m_parentScene.RezObject(remoteClient, itemID, LLVector3.Zero, LLVector3.Zero, LLUUID.Zero, (byte)1, true,
|
||||
@@ -446,11 +446,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
AttachObject(remoteClient,objatt.LocalId,AttachmentPt,new LLQuaternion(0,0,0,1),objatt.AbsolutePosition);
|
||||
objatt.ScheduleGroupForFullUpdate();
|
||||
}
|
||||
return objatt;
|
||||
}
|
||||
|
||||
// What makes this method odd and unique is it tries to detach using an LLUUID.... Yay for standards.
|
||||
// To LocalId or LLUUID, *THAT* is the question. How now Brown LLUUID??
|
||||
protected internal void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient)
|
||||
public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient)
|
||||
{
|
||||
if (itemID == LLUUID.Zero) // If this happened, someone made a mistake....
|
||||
return;
|
||||
|
||||
@@ -2316,5 +2316,48 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
//
|
||||
// imod.TestFunction();
|
||||
// }
|
||||
|
||||
public void RezSingleAttachment(IClientAPI remoteClient, LLUUID itemID,
|
||||
uint AttachmentPt, uint ItemFlags, uint NextOwnerMask)
|
||||
{
|
||||
SceneObjectGroup att = m_innerScene.RezSingleAttachment(remoteClient, itemID, AttachmentPt, ItemFlags, NextOwnerMask);
|
||||
|
||||
if (att == null)
|
||||
{
|
||||
DetachSingleAttachmentToInv(itemID, remoteClient);
|
||||
return;
|
||||
}
|
||||
|
||||
if (att.RootPart != null)
|
||||
AttachmentPt = att.RootPart.AttachmentPoint;
|
||||
|
||||
ScenePresence presence;
|
||||
if(TryGetAvatar(remoteClient.AgentId, out presence))
|
||||
{
|
||||
presence.Appearance.SetAttachment((int)AttachmentPt, itemID, att.GetFromAssetID());
|
||||
IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
|
||||
if(ava != null)
|
||||
{
|
||||
ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void DetachSingleAttachmentToInv(LLUUID itemID, IClientAPI remoteClient)
|
||||
{
|
||||
ScenePresence presence;
|
||||
if(TryGetAvatar(remoteClient.AgentId, out presence))
|
||||
{
|
||||
presence.Appearance.DetachAttachment(itemID);
|
||||
IAvatarFactory ava = RequestModuleInterface<IAvatarFactory>();
|
||||
if(ava != null)
|
||||
{
|
||||
ava.UpdateDatabase(remoteClient.AgentId, presence.Appearance);
|
||||
}
|
||||
|
||||
}
|
||||
m_innerScene.DetachSingleAttachmentToInv(itemID, remoteClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2109,8 +2109,8 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
client.OnGrabUpdate += m_innerScene.MoveObject;
|
||||
client.OnDeRezObject += DeRezObject;
|
||||
client.OnRezObject += RezObject;
|
||||
client.OnRezSingleAttachmentFromInv += m_innerScene.RezSingleAttachment;
|
||||
client.OnDetachAttachmentIntoInv += m_innerScene.DetachSingleAttachmentToInv;
|
||||
client.OnRezSingleAttachmentFromInv += RezSingleAttachment;
|
||||
client.OnDetachAttachmentIntoInv += DetachSingleAttachmentToInv;
|
||||
client.OnObjectAttach += m_innerScene.AttachObject;
|
||||
client.OnObjectDetach += m_innerScene.DetachObject;
|
||||
client.OnNameFromUUIDRequest += CommsManager.HandleUUIDNameRequest;
|
||||
@@ -3859,5 +3859,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
//Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY);
|
||||
client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user