本文整理汇总了C#中IMessageTransferModule.SendInstantMessage方法的典型用法代码示例。如果您正苦于以下问题:C# IMessageTransferModule.SendInstantMessage方法的具体用法?C# IMessageTransferModule.SendInstantMessage怎么用?C# IMessageTransferModule.SendInstantMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMessageTransferModule
的用法示例。
在下文中一共展示了IMessageTransferModule.SendInstantMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: dotransaction
private string dotransaction(UUID from, UUID to, int amount, int type, string message)
{
IClientAPI clientAPI = LocateClient (from);
Scene scene = (Scene)clientAPI.Scene;
m_MoneyModule = scene.RequestModuleInterface<IMoneyModule> ();
m_TransferModule = scene.RequestModuleInterface<IMessageTransferModule> ();
if (m_MoneyModule == null) {
return "No Money Module Configured";
}
bool flag = m_MoneyModule.AmountCovered (from, amount);
if (flag) {
scene.ProcessMoneyTransferRequest (from, to, amount, type, message);
if (m_TransferModule != null) {
GridInstantMessage im = new GridInstantMessage(
scene, UUID.Zero, "Web Store",
from,
(byte)InstantMessageDialog.MessageFromAgent,
"You made a Web Store purchase your item will be delivered shortly", false,
new Vector3());
m_TransferModule.SendInstantMessage (im, delegate(bool success) {
});
}
m_Database.UpdateTranPaid (transID);
return "transaction ok";
}
return "Insuficient Funds";
}
示例2: dodelivery
private string dodelivery(UUID buyer, UUID box, string item)
{
List<UUID> list = new List<UUID> ();
SceneObjectPart mbox = LocateBox (box);
Scene current = LocateBoxScene (box);
m_TransferModule = current.RequestModuleInterface<IMessageTransferModule> ();
TaskInventoryItem inventoryItem = mbox.Inventory.GetInventoryItem (item);
if (inventoryItem != null && inventoryItem.Type == 6) {
list.Add (inventoryItem.ItemID);
}
UUID uUID = MoveInventory (current,buyer, item, mbox, list);
m_Database.UpdateTranSession (transID, uUID);
if (this.m_TransferModule != null) {
byte[] copyIDBytes = uUID.GetBytes();
byte[] binaryBucket = new byte[1 + copyIDBytes.Length];
binaryBucket[0] = (byte)AssetType.Folder;
Array.Copy(copyIDBytes, 0, binaryBucket, 1, copyIDBytes.Length);
//byte[] bucket = new byte[] { (byte)AssetType.Folder };
Vector3 absolutePosition = mbox.AbsolutePosition;
GridInstantMessage im
= new GridInstantMessage(
current,
mbox.OwnerID,
"Web Store",
buyer,
(byte)InstantMessageDialog.InventoryOffered,
false,
item,
uUID,
false,
absolutePosition,
binaryBucket,
true);
//GridInstantMessage im = new GridInstantMessage(
// current, mbox.OwnerID, mbox.Name,
// buyer,
// (byte)InstantMessageDialog.InventoryOffered,false,
// string.Format ("'{0}'", item),uUID, false,
// absolutePosition,bucket,false);
//GridInstantMessage im = new GridInstantMessage (current, mbox.OwnerID, mbox.Name, buyer, 9, false, string.Format ("'{0}'", item), uUID, false, absolutePosition, binaryBucket, false);
m_TransferModule.SendInstantMessage (im, delegate(bool success) {
});
m_Database.UpdateTranOffered (transID);
}
return "Item Delivered";
}