本文整理汇总了C#中LLSDMap.Add方法的典型用法代码示例。如果您正苦于以下问题:C# LLSDMap.Add方法的具体用法?C# LLSDMap.Add怎么用?C# LLSDMap.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLSDMap
的用法示例。
在下文中一共展示了LLSDMap.Add方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RequestCreateItemFromAsset
public void RequestCreateItemFromAsset(byte[] data, string name, string description, AssetType assetType,
InventoryType invType, LLUUID folderID, ItemCreatedFromAssetCallback callback)
{
if (_Client.Network.CurrentSim == null || _Client.Network.CurrentSim.Caps == null)
throw new Exception("NewFileAgentInventory capability is not currently available");
Uri url = _Client.Network.CurrentSim.Caps.CapabilityURI("NewFileAgentInventory");
if (url != null)
{
LLSDMap query = new LLSDMap();
query.Add("folder_id", LLSD.FromUUID(folderID));
query.Add("asset_type", LLSD.FromString(AssetTypeToString(assetType)));
query.Add("inventory_type", LLSD.FromString(InventoryTypeToString(invType)));
query.Add("name", LLSD.FromString(name));
query.Add("description", LLSD.FromString(description));
byte[] postData = StructuredData.LLSDParser.SerializeXmlBytes(query);
// Make the request
CapsClient request = new CapsClient(url);
request.OnComplete += new CapsClient.CompleteCallback(CreateItemFromAssetResponse);
request.UserData = new KeyValuePair<ItemCreatedFromAssetCallback, byte[]>(callback, data);
request.StartRequest(postData);
}
else
{
throw new Exception("NewFileAgentInventory capability is not currently available");
}
}
示例2: ModerateChatSessions
/// <summary>
/// Moderate a chat session
/// </summary>
/// <param name="sessionID">the <see cref="UUID"/> of the session to moderate, for group chats this will be the groups UUID</param>
/// <param name="memberID">the <see cref="UUID"/> of the avatar to moderate</param>
/// <param name="moderateText">true to moderate (silence user), false to allow avatar to speak</param>
public void ModerateChatSessions(UUID sessionID, UUID memberID, bool moderateText)
{
if (Client.Network.CurrentSim == null || Client.Network.CurrentSim.Caps == null)
throw new Exception("ChatSessionRequest capability is not currently available");
Uri url = Client.Network.CurrentSim.Caps.CapabilityURI("ChatSessionRequest");
if (url != null)
{
LLSDMap req = new LLSDMap();
req.Add("method", LLSD.FromString("mute update"));
LLSDMap mute_info = new LLSDMap();
mute_info.Add("text", LLSD.FromBoolean(moderateText));
LLSDMap parameters = new LLSDMap();
parameters["agent_id"] = LLSD.FromUUID(memberID);
parameters["mute_info"] = mute_info;
req["params"] = parameters;
req.Add("session-id", LLSD.FromUUID(sessionID));
byte[] postData = StructuredData.LLSDParser.SerializeXmlBytes(req);
CapsClient request = new CapsClient(url);
request.StartRequest(postData);
}
else
{
throw new Exception("ChatSessionRequest capability is not currently available");
}
}
示例3: RequestUploadNotecardAsset
/// <summary>
///
/// </summary>
/// <param name="data"></param>
/// <param name="notecardID"></param>
/// <param name="callback"></param>
public void RequestUploadNotecardAsset(byte[] data, UUID notecardID, NotecardUploadedAssetCallback callback)
{
if (_Network.CurrentSim == null || _Network.CurrentSim.Caps == null)
throw new Exception("UpdateNotecardAgentInventory capability is not currently available");
Uri url = _Network.CurrentSim.Caps.CapabilityURI("UpdateNotecardAgentInventory");
if (url != null)
{
LLSDMap query = new LLSDMap();
query.Add("item_id", LLSD.FromUUID(notecardID));
byte[] postData = StructuredData.LLSDParser.SerializeXmlBytes(query);
// Make the request
CapsClient request = new CapsClient(url);
request.OnComplete += new CapsClient.CompleteCallback(UploadNotecardAssetResponse);
request.UserData = new object[2] { new KeyValuePair<NotecardUploadedAssetCallback, byte[]>(callback, data), notecardID };
request.StartRequest(postData);
}
else
{
throw new Exception("UpdateNotecardAgentInventory capability is not currently available");
}
}
示例4: RequestCreateItemFromAsset
public void RequestCreateItemFromAsset(byte[] data, string name, string description, AssetType assetType,
InventoryType invType, UUID folderID, CapsClient.ProgressCallback progCallback, ItemCreatedFromAssetCallback callback)
{
if (_Network.CurrentSim == null || _Network.CurrentSim.Caps == null)
throw new Exception("NewFileAgentInventory capability is not currently available");
Uri url = _Network.CurrentSim.Caps.CapabilityURI("NewFileAgentInventory");
if (url != null)
{
LLSDMap query = new LLSDMap();
query.Add("folder_id", LLSD.FromUUID(folderID));
query.Add("asset_type", LLSD.FromString(AssetTypeToString(assetType)));
query.Add("inventory_type", LLSD.FromString(InventoryTypeToString(invType)));
query.Add("name", LLSD.FromString(name));
query.Add("description", LLSD.FromString(description));
// Make the request
CapsClient request = new CapsClient(url);
request.OnComplete += new CapsClient.CompleteCallback(CreateItemFromAssetResponse);
request.UserData = new object[] { progCallback, callback, data };
request.StartRequest(query);
}
else
{
throw new Exception("NewFileAgentInventory capability is not currently available");
}
}
示例5: CreateUser
/// <summary>
/// Returns the new user ID or throws an exception containing the error code
/// The error codes can be found here: https://wiki.secondlife.com/wiki/RegAPIError
/// </summary>
/// <param name="user">New user account to create</param>
/// <returns>The UUID of the new user account</returns>
public LLUUID CreateUser(CreateUserParam user)
{
if (Initializing)
throw new InvalidOperationException("still initializing");
if (_caps.CreateUser == null)
throw new InvalidOperationException("access denied; only approved developers have access to the registration api");
// Create the POST data
LLSDMap query = new LLSDMap();
query.Add("username", LLSD.FromString(user.FirstName));
query.Add("last_name_id", LLSD.FromInteger(user.LastName.ID));
query.Add("email", LLSD.FromString(user.Email));
query.Add("password", LLSD.FromString(user.Password));
query.Add("dob", LLSD.FromString(user.Birthdate.ToString("yyyy-MM-dd")));
if (user.LimitedToEstate != null)
query.Add("limited_to_estate", LLSD.FromInteger(user.LimitedToEstate.Value));
if (!string.IsNullOrEmpty(user.StartRegionName))
query.Add("start_region_name", LLSD.FromInteger(user.LimitedToEstate.Value));
if (user.StartLocation != null)
{
query.Add("start_local_x", LLSD.FromReal(user.StartLocation.Value.X));
query.Add("start_local_y", LLSD.FromReal(user.StartLocation.Value.Y));
query.Add("start_local_z", LLSD.FromReal(user.StartLocation.Value.Z));
}
if (user.StartLookAt != null)
{
query.Add("start_look_at_x", LLSD.FromReal(user.StartLookAt.Value.X));
query.Add("start_look_at_y", LLSD.FromReal(user.StartLookAt.Value.Y));
query.Add("start_look_at_z", LLSD.FromReal(user.StartLookAt.Value.Z));
}
byte[] postData = LLSDParser.SerializeXmlBytes(query);
// Make the request
CapsClient request = new CapsClient(_caps.CreateUser);
request.OnComplete += new CapsClient.CompleteCallback(CreateUserResponse);
request.StartRequest();
// FIXME: Block
return LLUUID.Zero;
}
示例6: CheckName
public bool CheckName(string firstName, LastName lastName)
{
if (Initializing)
throw new InvalidOperationException("still initializing");
if (_caps.CheckName == null)
throw new InvalidOperationException("access denied; only approved developers have access to the registration api");
// Create the POST data
LLSDMap query = new LLSDMap();
query.Add("username", LLSD.FromString(firstName));
query.Add("last_name_id", LLSD.FromInteger(lastName.ID));
byte[] postData = LLSDParser.SerializeXmlBytes(query);
CapsClient request = new CapsClient(_caps.CheckName);
request.OnComplete += new CapsClient.CompleteCallback(CheckNameResponse);
request.StartRequest();
// FIXME:
return false;
}