mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 20:55:43 +08:00
From: Chris Yeoh <yeohc@au1.ibm.com>
Attached is a patch that changes the oar file saving of creation date/time to an integer instead of a string. I did this after justincc emailed me saying there is a problem with internationalisation doing it the old way and I said I'd fix it. Its been tested with MySQL and I've made the changes for MSSQL but that hasn't been well tested.
This commit is contained in:
@@ -128,11 +128,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
|
||||
private void OnInstantMessage(IClientAPI client, GridInstantMessage im)
|
||||
{
|
||||
m_log.InfoFormat("OnInstantMessage {0}", im.dialog);
|
||||
Scene scene = FindClientScene(client.AgentId);
|
||||
|
||||
if (scene == null) // Something seriously wrong here.
|
||||
return;
|
||||
|
||||
|
||||
|
||||
if (im.dialog == (byte) InstantMessageDialog.InventoryOffered)
|
||||
{
|
||||
//m_log.DebugFormat("Asset type {0}", ((AssetType)im.binaryBucket[0]));
|
||||
@@ -177,6 +180,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
{
|
||||
// First byte of the array is probably the item type
|
||||
// Next 16 bytes are the UUID
|
||||
m_log.Info("OnInstantMessage - giving item");
|
||||
|
||||
UUID itemID = new UUID(im.binaryBucket, 1);
|
||||
|
||||
@@ -382,6 +386,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
|
||||
{
|
||||
// Check if this is ours to handle
|
||||
//
|
||||
m_log.Info("OnFridInstantMessage");
|
||||
if (msg.dialog != (byte) InstantMessageDialog.InventoryOffered)
|
||||
return;
|
||||
|
||||
|
||||
@@ -504,24 +504,19 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
RegionSettings currentRegionSettings = m_scene.RegionInfo.RegionSettings;
|
||||
|
||||
// Loaded metadata will empty if no information exists in the archive
|
||||
currentRegionSettings.LoadedCreationDate = "";
|
||||
currentRegionSettings.LoadedCreationTime = "";
|
||||
currentRegionSettings.LoadedCreationDateTime = 0;
|
||||
currentRegionSettings.LoadedCreationID = "";
|
||||
|
||||
while (xtr.Read())
|
||||
{
|
||||
if (xtr.NodeType == XmlNodeType.Element)
|
||||
{
|
||||
if (xtr.Name.ToString() == "date")
|
||||
if (xtr.Name.ToString() == "datetime")
|
||||
{
|
||||
// Disable date & time for now until load problem in
|
||||
// http://opensimulator.org/mantis/view.php?id=3741 (note 0012120 by WWWench) is resolved
|
||||
//currentRegionSettings.LoadedCreationDate = xtr.ReadElementContentAsString();
|
||||
int value;
|
||||
if (Int32.TryParse(xtr.ReadElementContentAsString(), out value))
|
||||
currentRegionSettings.LoadedCreationDateTime = value;
|
||||
}
|
||||
else if (xtr.Name.ToString() == "time")
|
||||
{
|
||||
//currentRegionSettings.LoadedCreationTime = xtr.ReadElementContentAsString();
|
||||
}
|
||||
else if (xtr.Name.ToString() == "id")
|
||||
{
|
||||
currentRegionSettings.LoadedCreationID = xtr.ReadElementContentAsString();
|
||||
|
||||
@@ -152,12 +152,12 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
xtw.WriteStartDocument();
|
||||
xtw.WriteStartElement("archive");
|
||||
xtw.WriteAttributeString("major_version", "0");
|
||||
xtw.WriteAttributeString("minor_version", "2");
|
||||
xtw.WriteAttributeString("minor_version", "3");
|
||||
|
||||
xtw.WriteStartElement("creation_info");
|
||||
DateTime now = DateTime.UtcNow;
|
||||
xtw.WriteElementString("date", now.ToLongDateString());
|
||||
xtw.WriteElementString("time", now.ToLongTimeString());
|
||||
TimeSpan t = now - new DateTime(1970, 1, 1);
|
||||
xtw.WriteElementString("datetime", ((int)t.TotalSeconds).ToString());
|
||||
xtw.WriteElementString("id", UUID.Random().ToString());
|
||||
xtw.WriteEndElement();
|
||||
xtw.WriteEndElement();
|
||||
|
||||
@@ -448,6 +448,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
// Retrieve the item from the sender
|
||||
CachedUserInfo senderUserInfo = CommsManager.UserProfileCacheService.GetUserDetails(senderId);
|
||||
|
||||
Console.WriteLine("Scene.Inventory.cs: GiveInventoryItem");
|
||||
|
||||
if (senderUserInfo == null)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
@@ -1064,6 +1066,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
|
||||
private InventoryItemBase CreateAgentInventoryItemFromTask(UUID destAgent, SceneObjectPart part, UUID itemId)
|
||||
{
|
||||
Console.WriteLine("CreateAgentInventoryItemFromTask");
|
||||
TaskInventoryItem taskItem = part.Inventory.GetInventoryItem(itemId);
|
||||
|
||||
if (null == taskItem)
|
||||
@@ -1133,6 +1136,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="itemID"></param>
|
||||
public InventoryItemBase MoveTaskInventoryItem(IClientAPI remoteClient, UUID folderId, SceneObjectPart part, UUID itemId)
|
||||
{
|
||||
m_log.Info("Adding task inventory");
|
||||
InventoryItemBase agentItem = CreateAgentInventoryItemFromTask(remoteClient.AgentId, part, itemId);
|
||||
|
||||
if (agentItem == null)
|
||||
|
||||
@@ -3657,6 +3657,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
byte[] objBytes = objId.GetBytes();
|
||||
Array.Copy(objBytes, 0, bucket, 1, 16);
|
||||
|
||||
Console.WriteLine("Giving inventory");
|
||||
GridInstantMessage msg = new GridInstantMessage(World,
|
||||
m_host.UUID, m_host.Name+", an object owned by "+
|
||||
resolveName(m_host.OwnerID)+",", destId,
|
||||
|
||||
Reference in New Issue
Block a user