本文整理汇总了C#中Aurora.Framework.GridInstantMessage.ToOSD方法的典型用法代码示例。如果您正苦于以下问题:C# GridInstantMessage.ToOSD方法的具体用法?C# GridInstantMessage.ToOSD怎么用?C# GridInstantMessage.ToOSD使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aurora.Framework.GridInstantMessage
的用法示例。
在下文中一共展示了GridInstantMessage.ToOSD方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddOfflineMessage
public bool AddOfflineMessage(GridInstantMessage message)
{
foreach (string m_ServerURI in m_ServerURIs)
{
SimianUtils.AddGeneric(message.toAgentID, "OfflineMessages", UUID.Random().ToString(), message.ToOSD(),
m_ServerURI);
}
return true;
}
示例2: ConvertGridInstantMessageToXMLRPC
/// <summary>
/// Takes a GridInstantMessage and converts it into a Hashtable for XMLRPC
/// </summary>
/// <param name="msg">The GridInstantMessage object</param>
/// <returns>Hashtable containing the XMLRPC request</returns>
protected virtual Hashtable ConvertGridInstantMessageToXMLRPC(GridInstantMessage msg)
{
Hashtable gim = new Hashtable ();
gim["message"] = OSDParser.SerializeJsonString (msg.ToOSD ());
return gim;
}
示例3: AddOfflineMessage
public bool AddOfflineMessage(GridInstantMessage message)
{
object remoteValue = DoRemote(message);
if (remoteValue != null || m_doRemoteOnly)
return remoteValue == null ? false : (bool)remoteValue;
if (message.fromGroup)
{
if (!m_saveGroupOfflineMessages)
return false;
if (m_maxGroupOfflineMessages <= 0 ||
GenericUtils.GetGenericCount(message.toAgentID, "GroupOfflineMessages", GD) < m_maxOfflineMessages)
{
GenericUtils.AddGeneric(message.toAgentID, "GroupOfflineMessages", UUID.Random().ToString(),
message.ToOSD(), GD);
return true;
}
}
else
{
if (m_maxOfflineMessages <= 0 ||
GenericUtils.GetGenericCount(message.toAgentID, "OfflineMessages", GD) < m_maxOfflineMessages)
{
GenericUtils.AddGeneric(message.toAgentID, "OfflineMessages", UUID.Random().ToString(),
message.ToOSD(), GD);
return true;
}
}
return false;
}
示例4: FriendshipOffered
public static OSDMap FriendshipOffered(UUID requester, UUID friend, GridInstantMessage im,
ulong requestingRegion)
{
OSDMap llsdBody = new OSDMap
{
{"Requester", requester},
{"Friend", friend},
{"IM", im.ToOSD()},
{"RequestingRegion", requestingRegion}
};
return buildEvent("FriendshipOffered", llsdBody, requester, requestingRegion);
}
示例5: AddOfflineMessage
public bool AddOfflineMessage(GridInstantMessage message)
{
OSDMap sendData = message.ToOSD();
sendData["Method"] = "addofflinemessage";
try
{
List<string> urls =
m_registry.RequestModuleInterface<IConfigurationService>().FindValueOf(
message.toAgentID.ToString(), "RemoteServerURI");
#if (!ISWIN)
foreach (string url in urls)
{
OSDMap result = WebUtils.PostToService(url + "osd", sendData, true, false);
return ((OSDMap) OSDParser.DeserializeJson(result["_RawResult"]))["Result"].AsBoolean();
}
#else
foreach (OSDMap result in urls.Select(url => WebUtils.PostToService(url + "osd", sendData, true, false)))
{
return ((OSDMap) OSDParser.DeserializeJson(result["_RawResult"]))["Result"].AsBoolean();
}
#endif
}
catch (Exception e)
{
MainConsole.Instance.DebugFormat("[AuroraRemoteOfflineMessagesConnector]: Exception when contacting server: {0}", e);
}
return false;
}
示例6: AddOfflineMessage
/// <summary>
/// Adds a new offline message for the user.
/// </summary>
/// <param name = "message"></param>
public bool AddOfflineMessage(GridInstantMessage message)
{
if (message.fromGroup)
{
if (!m_saveGroupOfflineMessages)
return false;
if (m_maxGroupOfflineMessages <= 0 ||
GenericUtils.GetGenericCount(message.toAgentID, "GroupOfflineMessages", GD) < m_maxOfflineMessages)
{
GenericUtils.AddGeneric(message.toAgentID, "GroupOfflineMessages", UUID.Random().ToString(),
message.ToOSD(), GD);
return true;
}
}
else
{
if (m_maxOfflineMessages <= 0 ||
GenericUtils.GetGenericCount(message.toAgentID, "OfflineMessages", GD) < m_maxOfflineMessages)
{
GenericUtils.AddGeneric(message.toAgentID, "OfflineMessages", UUID.Random().ToString(),
message.ToOSD(), GD);
return true;
}
}
return false;
}