Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor
commit
98f0b4c72a
|
@ -1131,6 +1131,12 @@ namespace OpenSim.Client.MXP.ClientStack
|
||||||
// SL Specific, Ignore. (Remove from IClient)
|
// SL Specific, Ignore. (Remove from IClient)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendAbortXferPacket(ulong xferID)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
|
public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
|
||||||
{
|
{
|
||||||
// SL Specific, Ignore. (Remove from IClient)
|
// SL Specific, Ignore. (Remove from IClient)
|
||||||
|
|
|
@ -675,6 +675,11 @@ namespace OpenSim.Client.VWoHTTP.ClientStack
|
||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void SendAbortXferPacket(ulong xferID)
|
||||||
|
{
|
||||||
|
throw new System.NotImplementedException();
|
||||||
|
}
|
||||||
|
|
||||||
public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
|
public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
throw new System.NotImplementedException();
|
||||||
|
|
|
@ -1344,7 +1344,11 @@ namespace OpenSim.Framework.Capabilities
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string uploaderCaps(byte[] data, string path, string param)
|
public string uploaderCaps(byte[] data, string path, string param)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[CAPS] baked texture upload completed for {0}",newAssetID);
|
handlerUpLoad = OnUpLoad;
|
||||||
|
if (handlerUpLoad != null)
|
||||||
|
{
|
||||||
|
Util.FireAndForget(delegate(object o) { handlerUpLoad(newAssetID, data); });
|
||||||
|
}
|
||||||
|
|
||||||
string res = String.Empty;
|
string res = String.Empty;
|
||||||
LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
|
LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
|
||||||
|
@ -1356,12 +1360,6 @@ namespace OpenSim.Framework.Capabilities
|
||||||
|
|
||||||
httpListener.RemoveStreamHandler("POST", uploaderPath);
|
httpListener.RemoveStreamHandler("POST", uploaderPath);
|
||||||
|
|
||||||
handlerUpLoad = OnUpLoad;
|
|
||||||
if (handlerUpLoad != null)
|
|
||||||
{
|
|
||||||
handlerUpLoad(newAssetID, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID);
|
m_log.InfoFormat("[CAPS] baked texture upload completed for {0}",newAssetID);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
@ -1062,6 +1062,8 @@ namespace OpenSim.Framework
|
||||||
|
|
||||||
void SendXferPacket(ulong xferID, uint packet, byte[] data);
|
void SendXferPacket(ulong xferID, uint packet, byte[] data);
|
||||||
|
|
||||||
|
void SendAbortXferPacket(ulong xferID);
|
||||||
|
|
||||||
void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
||||||
int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent,
|
int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent,
|
||||||
float PriceObjectScaleFactor,
|
float PriceObjectScaleFactor,
|
||||||
|
|
|
@ -53,8 +53,8 @@ namespace OpenSim.Framework.Servers.HttpServer
|
||||||
|
|
||||||
private static byte[] ReadFully(Stream stream)
|
private static byte[] ReadFully(Stream stream)
|
||||||
{
|
{
|
||||||
byte[] buffer = new byte[32768];
|
byte[] buffer = new byte[1024];
|
||||||
using (MemoryStream ms = new MemoryStream())
|
using (MemoryStream ms = new MemoryStream(1024*256))
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
|
|
|
@ -127,7 +127,7 @@ namespace OpenSim.Framework
|
||||||
m_threads.Add(threadInfo.Thread.ManagedThreadId, threadInfo);
|
m_threads.Add(threadInfo.Thread.ManagedThreadId, threadInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool RemoveThread(int threadID)
|
public static bool RemoveThread(int threadID)
|
||||||
{
|
{
|
||||||
lock (m_threads)
|
lock (m_threads)
|
||||||
return m_threads.Remove(threadID);
|
return m_threads.Remove(threadID);
|
||||||
|
|
|
@ -2097,6 +2097,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
OutPacket(sendXfer, ThrottleOutPacketType.Asset);
|
OutPacket(sendXfer, ThrottleOutPacketType.Asset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendAbortXferPacket(ulong xferID)
|
||||||
|
{
|
||||||
|
AbortXferPacket xferItem = (AbortXferPacket)PacketPool.Instance.GetPacket(PacketType.AbortXfer);
|
||||||
|
xferItem.XferID.ID = xferID;
|
||||||
|
OutPacket(xferItem, ThrottleOutPacketType.Asset);
|
||||||
|
}
|
||||||
|
|
||||||
public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
||||||
int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
|
int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
|
||||||
int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
|
int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
|
||||||
|
|
|
@ -40,8 +40,8 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
private Dictionary<string, XferRequest> Requests = new Dictionary<string, XferRequest>();
|
private Dictionary<string, XferRequest> Requests = new Dictionary<string, XferRequest>();
|
||||||
private List<XferRequest> RequestTime = new List<XferRequest>();
|
private List<XferRequest> RequestTime = new List<XferRequest>();
|
||||||
public Dictionary<string, byte[]> NewFiles = new Dictionary<string, byte[]>();
|
private Dictionary<string, FileData> NewFiles = new Dictionary<string, FileData>();
|
||||||
public Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
|
private Dictionary<ulong, XferDownLoad> Transfers = new Dictionary<ulong, XferDownLoad>();
|
||||||
|
|
||||||
|
|
||||||
public struct XferRequest
|
public struct XferRequest
|
||||||
|
@ -52,6 +52,12 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
public DateTime timeStamp;
|
public DateTime timeStamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private class FileData
|
||||||
|
{
|
||||||
|
public byte[] Data;
|
||||||
|
public int Count;
|
||||||
|
}
|
||||||
|
|
||||||
#region IRegionModule Members
|
#region IRegionModule Members
|
||||||
|
|
||||||
public void Initialise(Scene scene, IConfigSource config)
|
public void Initialise(Scene scene, IConfigSource config)
|
||||||
|
@ -89,20 +95,22 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
lock (NewFiles)
|
lock (NewFiles)
|
||||||
{
|
{
|
||||||
if (NewFiles.ContainsKey(fileName))
|
if (NewFiles.ContainsKey(fileName))
|
||||||
{
|
NewFiles[fileName].Count++;
|
||||||
NewFiles[fileName] = data;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NewFiles.Add(fileName, data);
|
FileData fd = new FileData();
|
||||||
|
fd.Count = 1;
|
||||||
|
fd.Data = data;
|
||||||
|
NewFiles.Add(fileName, fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Requests.ContainsKey(fileName))
|
// This should not be here
|
||||||
{
|
//if (Requests.ContainsKey(fileName))
|
||||||
RequestXfer(Requests[fileName].remoteClient, Requests[fileName].xferID, fileName);
|
//{
|
||||||
Requests.Remove(fileName);
|
// RequestXfer(Requests[fileName].remoteClient, Requests[fileName].xferID, fileName);
|
||||||
}
|
// Requests.Remove(fileName);
|
||||||
|
//}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -113,6 +121,7 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
{
|
{
|
||||||
client.OnRequestXfer += RequestXfer;
|
client.OnRequestXfer += RequestXfer;
|
||||||
client.OnConfirmXfer += AckPacket;
|
client.OnConfirmXfer += AckPacket;
|
||||||
|
client.OnAbortXfer += AbortXfer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -125,20 +134,35 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
{
|
{
|
||||||
lock (NewFiles)
|
lock (NewFiles)
|
||||||
{
|
{
|
||||||
|
if (RequestTime.Count > 0)
|
||||||
|
{
|
||||||
|
TimeSpan ts = new TimeSpan(DateTime.UtcNow.Ticks - RequestTime[0].timeStamp.Ticks);
|
||||||
|
if (ts.TotalSeconds > 30)
|
||||||
|
{
|
||||||
|
ulong zxferid = RequestTime[0].xferID;
|
||||||
|
remoteClient.SendAbortXferPacket(zxferid);
|
||||||
|
RemoveXferData(zxferid);
|
||||||
|
RemoveOrDecrement(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (NewFiles.ContainsKey(fileName))
|
if (NewFiles.ContainsKey(fileName))
|
||||||
{
|
{
|
||||||
if (!Transfers.ContainsKey(xferID))
|
if (!Transfers.ContainsKey(xferID))
|
||||||
{
|
{
|
||||||
byte[] fileData = NewFiles[fileName];
|
byte[] fileData = NewFiles[fileName].Data;
|
||||||
XferDownLoad transaction = new XferDownLoad(fileName, fileData, xferID, remoteClient);
|
XferDownLoad transaction = new XferDownLoad(fileName, fileData, xferID, remoteClient);
|
||||||
|
|
||||||
Transfers.Add(xferID, transaction);
|
Transfers.Add(xferID, transaction);
|
||||||
NewFiles.Remove(fileName);
|
|
||||||
|
|
||||||
if (transaction.StartSend())
|
if (transaction.StartSend())
|
||||||
{
|
{
|
||||||
Transfers.Remove(xferID);
|
RemoveXferData(xferID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The transaction for this file is either complete or on its way
|
||||||
|
RemoveOrDecrement(fileName);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -150,6 +174,8 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
{
|
{
|
||||||
Requests.Remove(RequestTime[0].fileName);
|
Requests.Remove(RequestTime[0].fileName);
|
||||||
RequestTime.RemoveAt(0);
|
RequestTime.RemoveAt(0);
|
||||||
|
// Do we want to abort this here?
|
||||||
|
//remoteClient.SendAbortXfer(xferID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,19 +191,81 @@ namespace OpenSim.Region.CoreModules.Agent.Xfer
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet)
|
public void AckPacket(IClientAPI remoteClient, ulong xferID, uint packet)
|
||||||
|
{
|
||||||
|
lock (NewFiles) // This is actually to lock Transfers
|
||||||
{
|
{
|
||||||
if (Transfers.ContainsKey(xferID))
|
if (Transfers.ContainsKey(xferID))
|
||||||
{
|
{
|
||||||
|
XferDownLoad dl = Transfers[xferID];
|
||||||
if (Transfers[xferID].AckPacket(packet))
|
if (Transfers[xferID].AckPacket(packet))
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
RemoveXferData(xferID);
|
||||||
|
RemoveOrDecrement(dl.FileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Requests.ContainsKey(dl.FileName))
|
||||||
|
{
|
||||||
|
//
|
||||||
|
XferRequest req = Requests[dl.FileName];
|
||||||
|
req.timeStamp = DateTime.UtcNow;
|
||||||
|
Requests[dl.FileName] = req;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveXferData(ulong xferID)
|
||||||
|
{
|
||||||
|
// NewFiles must be locked!
|
||||||
|
if (Transfers.ContainsKey(xferID))
|
||||||
|
{
|
||||||
|
// Qualifier distinguishes between the OpenMetaverse version and the nested class
|
||||||
|
|
||||||
|
XferModule.XferDownLoad xferItem = Transfers[xferID];
|
||||||
|
//string filename = xferItem.FileName;
|
||||||
Transfers.Remove(xferID);
|
Transfers.Remove(xferID);
|
||||||
|
xferItem.Data = new byte[0]; // Clear the data
|
||||||
|
xferItem.DataPointer = 0;
|
||||||
|
|
||||||
|
// If the abort comes in
|
||||||
|
|
||||||
|
if (Requests.ContainsKey(xferItem.FileName))
|
||||||
|
Requests.Remove(xferItem.FileName);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AbortXfer(IClientAPI remoteClient, ulong xferID)
|
||||||
|
{
|
||||||
|
lock (NewFiles)
|
||||||
|
{
|
||||||
|
if (Transfers.ContainsKey(xferID))
|
||||||
|
RemoveOrDecrement(Transfers[xferID].FileName);
|
||||||
|
|
||||||
|
RemoveXferData(xferID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RemoveOrDecrement(string fileName)
|
||||||
|
{
|
||||||
|
// NewFiles must be locked
|
||||||
|
|
||||||
|
if (NewFiles.ContainsKey(fileName))
|
||||||
|
{
|
||||||
|
if (NewFiles[fileName].Count == 1)
|
||||||
|
NewFiles.Remove(fileName);
|
||||||
|
else
|
||||||
|
NewFiles[fileName].Count--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -620,8 +620,7 @@ namespace OpenSim.Region.CoreModules.Avatar.InstantMessage
|
||||||
}
|
}
|
||||||
catch (WebException e)
|
catch (WebException e)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0}} the host didn't respond ({2})",
|
m_log.ErrorFormat("[GRID INSTANT MESSAGE]: Error sending message to {0} the host didn't respond " + e.ToString(), reginfo.ServerURI.ToString());
|
||||||
reginfo.ServerURI, e.Message);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -602,6 +602,12 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void SendAbortXferPacket(ulong xferID)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
||||||
int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
|
int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
|
||||||
int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
|
int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
|
||||||
|
|
|
@ -195,13 +195,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
/// in this prim's inventory.</returns>
|
/// in this prim's inventory.</returns>
|
||||||
int RemoveInventoryItem(UUID itemID);
|
int RemoveInventoryItem(UUID itemID);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return the name with which a client can request a xfer of this prim's inventory metadata
|
|
||||||
/// </summary>
|
|
||||||
string GetInventoryFileName();
|
|
||||||
|
|
||||||
bool GetInventoryFileName(IClientAPI client, uint localID);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Serialize all the metadata for the items in this prim's inventory ready for sending to the client
|
/// Serialize all the metadata for the items in this prim's inventory ready for sending to the client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -951,23 +951,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="primLocalID"></param>
|
/// <param name="primLocalID"></param>
|
||||||
public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
|
public void RequestTaskInventory(IClientAPI remoteClient, uint primLocalID)
|
||||||
{
|
{
|
||||||
SceneObjectGroup group = GetGroupByPrim(primLocalID);
|
SceneObjectPart part = GetSceneObjectPart(primLocalID);
|
||||||
if (group != null)
|
if (part == null)
|
||||||
{
|
return;
|
||||||
bool fileChange = group.GetPartInventoryFileName(remoteClient, primLocalID);
|
|
||||||
if (fileChange)
|
|
||||||
{
|
|
||||||
if (XferManager != null)
|
if (XferManager != null)
|
||||||
{
|
part.Inventory.RequestInventoryFile(remoteClient, XferManager);
|
||||||
group.RequestInventoryFile(remoteClient, primLocalID, XferManager);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[PRIM INVENTORY]: Inventory requested of prim {0} which doesn't exist", primLocalID);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1093,6 +1093,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName);
|
m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName);
|
||||||
HeartbeatThread.Abort();
|
HeartbeatThread.Abort();
|
||||||
|
Watchdog.RemoveThread(HeartbeatThread.ManagedThreadId);
|
||||||
HeartbeatThread = null;
|
HeartbeatThread = null;
|
||||||
}
|
}
|
||||||
m_lastUpdate = Util.EnvironmentTickCount();
|
m_lastUpdate = Util.EnvironmentTickCount();
|
||||||
|
@ -4801,7 +4802,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (m_firstHeartbeat)
|
if (m_firstHeartbeat)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 2000)
|
if (Util.EnvironmentTickCountSubtract(m_lastUpdate) > 10000)
|
||||||
StartTimer();
|
StartTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -76,49 +76,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
parts[i].Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
|
parts[i].Inventory.RemoveScriptInstances(sceneObjectBeingDeleted);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="remoteClient"></param>
|
|
||||||
/// <param name="localID"></param>
|
|
||||||
public bool GetPartInventoryFileName(IClientAPI remoteClient, uint localID)
|
|
||||||
{
|
|
||||||
SceneObjectPart part = GetChildPart(localID);
|
|
||||||
if (part != null)
|
|
||||||
{
|
|
||||||
return part.Inventory.GetInventoryFileName(remoteClient, localID);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[PRIM INVENTORY]: " +
|
|
||||||
"Couldn't find part {0} in object group {1}, {2} to retreive prim inventory",
|
|
||||||
localID, Name, UUID);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return serialized inventory metadata for the given constituent prim
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="localID"></param>
|
|
||||||
/// <param name="xferManager"></param>
|
|
||||||
public void RequestInventoryFile(IClientAPI client, uint localID, IXfer xferManager)
|
|
||||||
{
|
|
||||||
SceneObjectPart part = GetChildPart(localID);
|
|
||||||
if (part != null)
|
|
||||||
{
|
|
||||||
part.Inventory.RequestInventoryFile(client, xferManager);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
m_log.ErrorFormat(
|
|
||||||
"[PRIM INVENTORY]: " +
|
|
||||||
"Couldn't find part {0} in object group {1}, {2} to request inventory data",
|
|
||||||
localID, Name, UUID);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Add an inventory item to a prim in this group.
|
/// Add an inventory item to a prim in this group.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -46,7 +46,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private string m_inventoryFileName = String.Empty;
|
private string m_inventoryFileName = String.Empty;
|
||||||
private int m_inventoryFileNameSerial = 0;
|
private byte[] m_inventoryFileData = new byte[0];
|
||||||
|
private uint m_inventoryFileNameSerial = 0;
|
||||||
|
|
||||||
private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>();
|
private Dictionary<UUID, ArrayList> m_scriptErrors = new Dictionary<UUID, ArrayList>();
|
||||||
|
|
||||||
|
@ -930,40 +931,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetInventoryFileName()
|
private bool CreateInventoryFileName()
|
||||||
{
|
{
|
||||||
if (m_inventoryFileName == String.Empty)
|
if (m_inventoryFileName == String.Empty ||
|
||||||
m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
|
m_inventoryFileNameSerial < m_inventorySerial)
|
||||||
if (m_inventoryFileNameSerial < m_inventorySerial)
|
|
||||||
{
|
{
|
||||||
m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
|
m_inventoryFileName = "inventory_" + UUID.Random().ToString() + ".tmp";
|
||||||
}
|
m_inventoryFileNameSerial = m_inventorySerial;
|
||||||
return m_inventoryFileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Return the name with which a client can request a xfer of this prim's inventory metadata
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="client"></param>
|
|
||||||
/// <param name="localID"></param>
|
|
||||||
public bool GetInventoryFileName(IClientAPI client, uint localID)
|
|
||||||
{
|
|
||||||
// m_log.DebugFormat(
|
|
||||||
// "[PRIM INVENTORY]: Received request from client {0} for inventory file name of {1}, {2}",
|
|
||||||
// client.AgentId, Name, UUID);
|
|
||||||
|
|
||||||
if (m_inventorySerial > 0)
|
|
||||||
{
|
|
||||||
client.SendTaskInventory(m_part.UUID, (short)m_inventorySerial,
|
|
||||||
Utils.StringToBytes(GetInventoryFileName()));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Serialize all the metadata for the items in this prim's inventory ready for sending to the client
|
/// Serialize all the metadata for the items in this prim's inventory ready for sending to the client
|
||||||
|
@ -971,19 +950,37 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="xferManager"></param>
|
/// <param name="xferManager"></param>
|
||||||
public void RequestInventoryFile(IClientAPI client, IXfer xferManager)
|
public void RequestInventoryFile(IClientAPI client, IXfer xferManager)
|
||||||
{
|
{
|
||||||
byte[] fileData = new byte[0];
|
bool changed = CreateInventoryFileName();
|
||||||
|
|
||||||
// Confusingly, the folder item has to be the object id, while the 'parent id' has to be zero. This matches
|
|
||||||
// what appears to happen in the Second Life protocol. If this isn't the case. then various functionality
|
|
||||||
// isn't available (such as drag from prim inventory to agent inventory)
|
|
||||||
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
|
InventoryStringBuilder invString = new InventoryStringBuilder(m_part.UUID, UUID.Zero);
|
||||||
|
|
||||||
|
Items.LockItemsForRead(true);
|
||||||
|
|
||||||
|
if (m_inventorySerial == 0) // No inventory
|
||||||
|
{
|
||||||
|
client.SendTaskInventory(m_part.UUID, 0, new byte[0]);
|
||||||
|
Items.LockItemsForRead(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
client.SendTaskInventory(m_part.UUID, (short)m_inventorySerial,
|
||||||
|
Util.StringToBytes256(m_inventoryFileName));
|
||||||
|
|
||||||
|
if (!changed)
|
||||||
|
{
|
||||||
|
if (m_inventoryFileData.Length > 2)
|
||||||
|
{
|
||||||
|
xferManager.AddNewFile(m_inventoryFileName,
|
||||||
|
m_inventoryFileData);
|
||||||
|
Items.LockItemsForRead(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool includeAssets = false;
|
bool includeAssets = false;
|
||||||
if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId))
|
if (m_part.ParentGroup.Scene.Permissions.CanEditObjectInventory(m_part.UUID, client.AgentId))
|
||||||
includeAssets = true;
|
includeAssets = true;
|
||||||
|
|
||||||
lock (m_items)
|
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_items.Values)
|
foreach (TaskInventoryItem item in m_items.Values)
|
||||||
{
|
{
|
||||||
UUID ownerID = item.OwnerID;
|
UUID ownerID = item.OwnerID;
|
||||||
|
@ -1031,18 +1028,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
|
invString.AddNameValueLine("creation_date", item.CreationDate.ToString());
|
||||||
invString.AddSectionEnd();
|
invString.AddSectionEnd();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
int count = m_items.Count;
|
|
||||||
m_items.LockItemsForRead(false);
|
|
||||||
|
|
||||||
fileData = Utils.StringToBytes(invString.BuildString);
|
Items.LockItemsForRead(false);
|
||||||
|
|
||||||
//m_log.Debug(Utils.BytesToString(fileData));
|
m_inventoryFileData = Utils.StringToBytes(invString.BuildString);
|
||||||
//m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Utils.BytesToString(fileData));
|
|
||||||
|
|
||||||
if (fileData.Length > 2)
|
if (m_inventoryFileData.Length > 2)
|
||||||
{
|
{
|
||||||
xferManager.AddNewFile(m_inventoryFileName, fileData);
|
xferManager.AddNewFile(m_inventoryFileName, m_inventoryFileData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
g.ScheduleFullUpdateToAvatar(m_presence);
|
g.ScheduleFullUpdateToAvatar(m_presence);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (m_partsUpdateQueue.Count > 0)
|
while (m_partsUpdateQueue.Count != null && m_partsUpdateQueue.Count > 0)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = m_partsUpdateQueue.Dequeue();
|
SceneObjectPart part = m_partsUpdateQueue.Dequeue();
|
||||||
|
|
||||||
|
|
|
@ -1123,6 +1123,11 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SendAbortXferPacket(ulong xferID)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
|
public void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit, int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor, int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay, int PricePublicObjectDelete, int PriceRentLight, int PriceUpload, int TeleportMinPrice, float TeleportPriceExponent)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -686,6 +686,10 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
|
|
||||||
public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data)
|
public virtual void SendXferPacket(ulong xferID, uint packet, byte[] data)
|
||||||
{
|
{
|
||||||
|
}
|
||||||
|
public virtual void SendAbortXferPacket(ulong xferID)
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
||||||
|
|
|
@ -696,6 +696,11 @@ namespace OpenSim.Tests.Common.Mock
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual void SendAbortXferPacket(ulong xferID)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
public virtual void SendEconomyData(float EnergyEfficiency, int ObjectCapacity, int ObjectCount, int PriceEnergyUnit,
|
||||||
int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
|
int PriceGroupCreate, int PriceObjectClaim, float PriceObjectRent, float PriceObjectScaleFactor,
|
||||||
int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
|
int PriceParcelClaim, float PriceParcelClaimFactor, int PriceParcelRent, int PricePublicObjectDecay,
|
||||||
|
|
Loading…
Reference in New Issue