Merge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/careminster into careminster-presence-refactor

avinationmerge
Kitto Flora 2010-09-02 21:51:27 +00:00
commit 24c73aa8b2
7 changed files with 114 additions and 20 deletions

View File

@ -44,6 +44,8 @@ namespace OpenSim.Framework.Capabilities
string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder, string assetName, string description, UUID assetID, UUID inventoryItem, UUID parentFolder,
byte[] data, string inventoryType, string assetType); byte[] data, string inventoryType, string assetType);
public delegate void UploadedBakedTexture(UUID assetID, byte[] data);
public delegate UUID UpdateItem(UUID itemID, byte[] data); public delegate UUID UpdateItem(UUID itemID, byte[] data);
public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors); public delegate void UpdateTaskScript(UUID itemID, UUID primID, bool isScriptRunning, byte[] data, ref ArrayList errors);
@ -97,6 +99,7 @@ namespace OpenSim.Framework.Capabilities
// private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module. // private static readonly string m_provisionVoiceAccountRequestPath = "0008/";// This is in a module.
// private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule. // private static readonly string m_remoteParcelRequestPath = "0009/";// This is in the LandManagementModule.
private static readonly string m_uploadBakedTexturePath = "0010/";// This is in the LandManagementModule.
//private string eventQueue = "0100/"; //private string eventQueue = "0100/";
private IScene m_Scene; private IScene m_Scene;
@ -185,6 +188,8 @@ namespace OpenSim.Framework.Capabilities
m_capsHandlers["UpdateScriptTaskInventory"] = m_capsHandlers["UpdateScriptTaskInventory"] =
new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory); new RestStreamHandler("POST", capsBase + m_notecardTaskUpdatePath, ScriptTaskInventory);
m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"]; m_capsHandlers["UpdateScriptTask"] = m_capsHandlers["UpdateScriptTaskInventory"];
m_capsHandlers["UploadBakedTexture"] =
new RestStreamHandler("POST", capsBase + m_uploadBakedTexturePath, UploadBakedTexture);
} }
catch (Exception e) catch (Exception e)
@ -742,6 +747,50 @@ namespace OpenSim.Framework.Capabilities
return null; return null;
} }
public string UploadBakedTexture(string request, string path,
string param, OSHttpRequest httpRequest,
OSHttpResponse httpResponse)
{
try
{
m_log.Debug("[CAPS]: UploadBakedTexture Request in region: " +
m_regionName);
string capsBase = "/CAPS/" + m_capsObjectPath;
string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000");
BakedTextureUploader uploader =
new BakedTextureUploader( capsBase + uploaderPath,
m_httpListener);
uploader.OnUpLoad += BakedTextureUploaded;
m_httpListener.AddStreamHandler(
new BinaryStreamHandler("POST", capsBase + uploaderPath,
uploader.uploaderCaps));
string protocol = "http://";
if (m_httpListener.UseSSL)
protocol = "https://";
string uploaderURL = protocol + m_httpListenerHostName + ":" +
m_httpListenPort.ToString() + capsBase + uploaderPath;
LLSDAssetUploadResponse uploadResponse =
new LLSDAssetUploadResponse();
uploadResponse.uploader = uploaderURL;
uploadResponse.state = "upload";
return LLSDHelpers.SerialiseLLSDReply(uploadResponse);
}
catch (Exception e)
{
m_log.Error("[CAPS]: " + e.ToString());
}
return null;
}
/// <summary> /// <summary>
/// Called by the notecard update handler. Provides a URL to which the client can upload a new asset. /// Called by the notecard update handler. Provides a URL to which the client can upload a new asset.
/// </summary> /// </summary>
@ -925,6 +974,17 @@ namespace OpenSim.Framework.Capabilities
} }
} }
public void BakedTextureUploaded(UUID assetID, byte[] data)
{
m_log.DebugFormat("[CAPS]: Received baked texture {0}", assetID.ToString());
AssetBase asset;
asset = new AssetBase(assetID, "Baked Texture", (sbyte)AssetType.Texture, m_agentID.ToString());
asset.Data = data;
asset.Temporary = true;
asset.Local = true;
m_assetCache.Store(asset);
}
/// <summary> /// <summary>
/// Called when new asset data for an agent inventory item update has been uploaded. /// Called when new asset data for an agent inventory item update has been uploaded.
/// </summary> /// </summary>
@ -1243,5 +1303,50 @@ namespace OpenSim.Framework.Capabilities
fs.Close(); fs.Close();
} }
} }
public class BakedTextureUploader
{
public event UploadedBakedTexture OnUpLoad;
private UploadedBakedTexture handlerUpLoad = null;
private string uploaderPath = String.Empty;
private UUID newAssetID;
private IHttpServer httpListener;
public BakedTextureUploader(string path, IHttpServer httpServer)
{
newAssetID = UUID.Random();
uploaderPath = path;
httpListener = httpServer;
}
/// <summary>
///
/// </summary>
/// <param name="data"></param>
/// <param name="path"></param>
/// <param name="param"></param>
/// <returns></returns>
public string uploaderCaps(byte[] data, string path, string param)
{
string res = String.Empty;
LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete();
uploadComplete.new_asset = newAssetID.ToString();
uploadComplete.new_inventory_item = UUID.Zero;
uploadComplete.state = "complete";
res = LLSDHelpers.SerialiseLLSDReply(uploadComplete);
httpListener.RemoveStreamHandler("POST", uploaderPath);
handlerUpLoad = OnUpLoad;
if (handlerUpLoad != null)
{
handlerUpLoad(newAssetID, data);
}
return res;
}
}
} }
} }

View File

@ -3427,6 +3427,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
avp.Sender.IsTrial = false; avp.Sender.IsTrial = false;
avp.Sender.ID = agentID; avp.Sender.ID = agentID;
m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
OutPacket(avp, ThrottleOutPacketType.Task); OutPacket(avp, ThrottleOutPacketType.Task);
} }

View File

@ -689,7 +689,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
} }
// Fire on_rez // Fire on_rez
group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 0); group.CreateScriptInstances(0, true, m_Scene.DefaultScriptEngine, 1);
rootPart.ParentGroup.ResumeScripts(); rootPart.ParentGroup.ResumeScripts();
rootPart.ScheduleFullUpdate(); rootPart.ScheduleFullUpdate();

View File

@ -218,8 +218,7 @@ namespace OpenSim.Region.Framework.Scenes
// Update item with new asset // Update item with new asset
item.AssetID = asset.FullID; item.AssetID = asset.FullID;
if (group.UpdateInventoryItem(item)) group.UpdateInventoryItem(item);
remoteClient.SendAgentAlertMessage("Script saved", false);
part.GetProperties(remoteClient); part.GetProperties(remoteClient);
@ -232,10 +231,6 @@ namespace OpenSim.Region.Framework.Scenes
// //
errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0); errors = part.Inventory.CreateScriptInstanceEr(item.ItemID, 0, false, DefaultScriptEngine, 0);
} }
else
{
remoteClient.SendAgentAlertMessage("Script saved", false);
}
part.ParentGroup.ResumeScripts(); part.ParentGroup.ResumeScripts();
return errors; return errors;
} }
@ -1401,13 +1396,6 @@ namespace OpenSim.Region.Framework.Scenes
{ {
agentTransactions.HandleTaskItemUpdateFromTransaction( agentTransactions.HandleTaskItemUpdateFromTransaction(
remoteClient, part, transactionID, currentItem); remoteClient, part, transactionID, currentItem);
if ((InventoryType)itemInfo.InvType == InventoryType.Notecard)
remoteClient.SendAgentAlertMessage("Notecard saved", false);
else if ((InventoryType)itemInfo.InvType == InventoryType.LSL)
remoteClient.SendAgentAlertMessage("Script saved", false);
else
remoteClient.SendAgentAlertMessage("Item saved", false);
} }
// Base ALWAYS has move // Base ALWAYS has move
@ -1993,7 +1981,7 @@ namespace OpenSim.Region.Framework.Scenes
// We can only call this after adding the scene object, since the scene object references the scene // We can only call this after adding the scene object, since the scene object references the scene
// to find out if scripts should be activated at all. // to find out if scripts should be activated at all.
group.CreateScriptInstances(param, true, DefaultScriptEngine, 2); group.CreateScriptInstances(param, true, DefaultScriptEngine, 3);
group.ScheduleGroupForFullUpdate(); group.ScheduleGroupForFullUpdate();

View File

@ -1160,6 +1160,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); //m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
if (HeartbeatThread != null) if (HeartbeatThread != null)
{ {
m_log.ErrorFormat("[SCENE]: Restarting heartbeat thread because it hasn't reported in in region {0}", RegionInfo.RegionName);
HeartbeatThread.Abort(); HeartbeatThread.Abort();
HeartbeatThread = null; HeartbeatThread = null;
} }
@ -2442,7 +2443,7 @@ namespace OpenSim.Region.Framework.Scenes
return false; return false;
} }
newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 1); newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, 2);
newObject.ResumeScripts(); newObject.ResumeScripts();
@ -4555,7 +4556,7 @@ namespace OpenSim.Region.Framework.Scenes
// //
int health=1; // Start at 1, means we're up int health=1; // Start at 1, means we're up
if ((Util.EnvironmentTickCountSubtract(m_lastUpdate)) < 1000) if (m_firstHeartbeat || ((Util.EnvironmentTickCountSubtract(m_lastUpdate)) < 1000))
health+=1; health+=1;
else else
return health; return health;
@ -5067,7 +5068,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
ForEachSOG(delegate (SceneObjectGroup grp) ForEachSOG(delegate (SceneObjectGroup grp)
{ {
if (grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp))) if (grp.RootPart.Shape.PCode == 0 && grp.RootPart.Shape.State != 0 && (!objectsToDelete.Contains(grp)))
{ {
UUID agentID = grp.OwnerID; UUID agentID = grp.OwnerID;
if (agentID == UUID.Zero) if (agentID == UUID.Zero)

View File

@ -1928,7 +1928,7 @@ namespace OpenSim.Region.Framework.Scenes
copy.UpdateGroupRotationR(rot); copy.UpdateGroupRotationR(rot);
} }
copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 0); copy.CreateScriptInstances(0, false, m_parentScene.DefaultScriptEngine, 1);
copy.HasGroupChanged = true; copy.HasGroupChanged = true;
copy.ScheduleGroupForFullUpdate(); copy.ScheduleGroupForFullUpdate();
copy.ResumeScripts(); copy.ResumeScripts();

View File

@ -2810,7 +2810,6 @@ namespace OpenSim.Region.Framework.Scenes
m_controllingClient.SendAvatarDataImmediate(this); m_controllingClient.SendAvatarDataImmediate(this);
SendInitialFullUpdateToAllClients(); SendInitialFullUpdateToAllClients();
SendAppearanceToAllOtherAgents();
} }
/// <summary> /// <summary>