* Clarify documentation in InventoryManager

* Allow the destination folder for InventoryItems offered to be set in the callback, will use the Default folder for the type of asset being sent if not set
* Couple minor fixups in PacketDecoder for the BinaryBucket field in the ImprovedInstantMessage packet
* Remove GroupTitle field from EventQueue decoder for the AgentGroupDataUpdateMessage, this is something opensim hacked in but its not used by the client so we'll just ignore it
* Added copyright header to TerrainCompressor.cs

git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@3216 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
Jim Radford
2009-11-07 14:57:56 +00:00
parent 5e9c50c254
commit d072a615ee
5 changed files with 102 additions and 17 deletions

View File

@@ -852,8 +852,7 @@ namespace OpenMetaverse
avatarGroup.AcceptNotices = msg.GroupDataBlock[i].AcceptNotices;
avatarGroup.GroupID = msg.GroupDataBlock[i].GroupID;
avatarGroup.GroupInsigniaID = msg.GroupDataBlock[i].GroupInsigniaID;
avatarGroup.GroupName = msg.GroupDataBlock[i].GroupName;
avatarGroup.GroupTitle = msg.GroupDataBlock[i].GroupTitle;
avatarGroup.GroupName = msg.GroupDataBlock[i].GroupName;
avatarGroup.GroupPowers = msg.GroupDataBlock[i].GroupPowers;
avatarGroup.ListInProfile = msg.NewGroupDataBlock[i].ListInProfile;

View File

@@ -2375,7 +2375,7 @@ namespace OpenMetaverse
/// <param name="groupOwner">UUID of group to own the object</param>
/// <param name="queryID">User defined queryID to correlate replies</param>
/// <param name="rezSelected">If set to true, the CreateSelected flag
/// will be set on the rezzed object</param>
/// will be set on the rezzed object</param>
public UUID RequestRezFromInventory(Simulator simulator, Quaternion rotation, Vector3 position,
InventoryItem item, UUID groupOwner, UUID queryID, bool rezSelected)
{
@@ -2428,6 +2428,7 @@ namespace OpenMetaverse
/// DeRez an object from the simulator to the agents Objects folder in the agents Inventory
/// </summary>
/// <param name="objectLocalID">The simulator Local ID of the object</param>
/// <remarks>If objectLocalID is a child primitive in a linkset, the entire linkset will be derezzed</remarks>
public void RequestDeRezToInventory(uint objectLocalID)
{
RequestDeRezToInventory(objectLocalID, DeRezDestination.AgentInventoryTake,
@@ -2443,6 +2444,7 @@ namespace OpenMetaverse
/// if DeRezzing object to a tasks Inventory, the Tasks <seealso cref="UUID"/></param>
/// <param name="transactionID">The transaction ID for this request which
/// can be used to correlate this request with other packets</param>
/// <remarks>If objectLocalID is a child primitive in a linkset, the entire linkset will be derezzed</remarks>
public void RequestDeRezToInventory(uint objectLocalID, DeRezDestination destType, UUID destFolder, UUID transactionID)
{
DeRezObjectPacket take = new DeRezObjectPacket();
@@ -3444,10 +3446,17 @@ namespace OpenMetaverse
break;
case InstantMessageDialog.GroupNotice:
imp.MessageBlock.Dialog = (byte)InstantMessageDialog.GroupNoticeInventoryAccepted;
break;
break;
}
imp.MessageBlock.BinaryBucket = destinationFolderID.GetBytes();
if (args.FolderID != UUID.Zero)
{
imp.MessageBlock.BinaryBucket = args.FolderID.GetBytes();
}
else
{
imp.MessageBlock.BinaryBucket = destinationFolderID.GetBytes();
}
}
else
{
@@ -4163,10 +4172,14 @@ namespace OpenMetaverse
/// <summary>Set to true to accept offer, false to decline it</summary>
public bool Accept { get; set; }
/// <summary>The folder to accept the inventory into, if null default folder for <see cref="AssetType"/> will be used</summary>
public UUID FolderID { get; set; }
public InstantMessage Offer { get { return m_Offer; } }
public AssetType AssetType { get { return m_AssetType; } }
public UUID ObjectID { get { return m_ObjectID; } }
public bool FromTask { get { return m_FromTask; } }
public InventoryObjectOfferedEventArgs(InstantMessage offerDetails, AssetType type, UUID objectID, bool fromTask)
{

View File

@@ -1181,9 +1181,7 @@ namespace OpenMetaverse.Messages.Linden
/// <summary>The <seealso cref="UUID"/> of the groups insignia</summary>
public UUID GroupInsigniaID;
/// <summary>The name of the group</summary>
public string GroupName;
/// <summary>The Active Title</summary>
public string GroupTitle;
public string GroupName;
/// <summary>The aggregate permissions the agent has in the group for all roles the agent
/// is assigned</summary>
public GroupPowers GroupPowers;
@@ -1224,13 +1222,12 @@ namespace OpenMetaverse.Messages.Linden
for (int i = 0; i < GroupDataBlock.Length; i++)
{
OSDMap group = new OSDMap(7);
OSDMap group = new OSDMap(6);
group["AcceptNotices"] = OSD.FromBoolean(GroupDataBlock[i].AcceptNotices);
group["Contribution"] = OSD.FromInteger(GroupDataBlock[i].Contribution);
group["GroupID"] = OSD.FromUUID(GroupDataBlock[i].GroupID);
group["GroupInsigniaID"] = OSD.FromUUID(GroupDataBlock[i].GroupInsigniaID);
group["GroupName"] = OSD.FromString(GroupDataBlock[i].GroupName);
group["GroupTitle"] = OSD.FromString(GroupDataBlock[i].GroupTitle);
group["GroupPowers"] = OSD.FromLong((long)GroupDataBlock[i].GroupPowers);
groupDataArray.Add(group);
}
@@ -1277,7 +1274,6 @@ namespace OpenMetaverse.Messages.Linden
groupData.GroupName = groupMap["GroupName"].AsString();
groupData.GroupPowers = (GroupPowers)groupMap["GroupPowers"].AsLong();
groupData.AcceptNotices = groupMap["AcceptNotices"].AsBoolean();
groupData.GroupTitle = groupMap["GroupTitle"].AsString();
GroupDataBlock[i] = groupData;
}

View File

@@ -1,4 +1,30 @@
using System;
/*
* Copyright (c) 2009, openmetaverse.org
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the openmetaverse.org nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
@@ -61,6 +87,10 @@ namespace OpenMetaverse.Packets
AddCallback("SimAccess", DecodeSimAccess);
AddCallback("ControlFlags", DecodeControlFlags);
// AgentUpdate
AddCallback("AgentData.State", DecodeAgentState);
AddCallback("AgentData.Flags", DecodeAgentFlags);
// ViewerEffect TypeData
AddCallback("ViewerEffect.Effect.TypeData", DecodeViewerEffectTypeData);
AddCallback("ViewerEffect.Effect.Type", DecodeViewerEffectType);
@@ -658,7 +688,6 @@ namespace OpenMetaverse.Packets
result.AppendFormat("{0,30}", "</TextureAnimation>");
return result.ToString();
}
private static string DecodeEstateParameter(string fieldName, object fieldData)
@@ -973,16 +1002,21 @@ namespace OpenMetaverse.Packets
}
else if (bytes.Length == 17)
{
bucket = String.Format("{0} {1,-40} ({2}) [Byte[]]",
bucket = String.Format("{0,-36} {1} ({2})",
new UUID(bytes, 1),
bytes[0],
(AssetType)bytes[0]);
(AssetType)(sbyte)bytes[0]);
}
else if (bytes.Length == 16) // the folder ID for the asset to be stored into if we accept an inventory offer
{
bucket = new UUID(bytes, 0).ToString();
}
else
{
bucket = Utils.BytesToString(bytes);
bucket = Utils.BytesToString(bytes); // we'll try a string lastly
}
return String.Format("{0,30}: {1,-40} [Byte[]]", fieldName, bucket);
return String.Format("{0,30}: {1,-40} [Byte[{2}]]", fieldName, bucket, bytes.Length);
}
private static string DecodeBinaryToHexString(string fieldName, object fieldData)
@@ -1393,6 +1427,23 @@ namespace OpenMetaverse.Packets
return String.Format("{0,30}: (No Decoder) Length={1}" + Environment.NewLine, fieldName, data.Length) + Utils.BytesToHexString(data, String.Format("{0,30}", ""));
}
}
private static string DecodeAgentState(string fieldName, object fieldData)
{
return String.Format("{0,30}: {1,-2} {2,-37} [AgentState]",
fieldName,
fieldData,
"(" + (AgentState)(byte)fieldData + ")");
}
private static string DecodeAgentFlags(string fieldName, object fieldData)
{
return String.Format("{0,30}: {1,-2} {2,-37} [AgentFlags]",
fieldName,
fieldData,
"(" + (AgentFlags)(byte)fieldData + ")");
}
private static string DecodeViewerEffectType(string fieldName, object fieldData)
{

View File

@@ -1,3 +1,29 @@
/*
* Copyright (c) 2009, openmetaverse.org
* All rights reserved.
*
* - Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* - Neither the name of the openmetaverse.org nor the names
* of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
using System;
using OpenMetaverse.Packets;