本文整理汇总了C#中OpenSim.Framework.OSChatMessage.FromKVP方法的典型用法代码示例。如果您正苦于以下问题:C# OSChatMessage.FromKVP方法的具体用法?C# OSChatMessage.FromKVP怎么用?C# OSChatMessage.FromKVP使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Framework.OSChatMessage
的用法示例。
在下文中一共展示了OSChatMessage.FromKVP方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InformNeighborsOfChatMessage
private byte[] InformNeighborsOfChatMessage(Dictionary<string, object> request)
{
byte[] result = new byte[0];
if (!CheckThreatLevel(NeighborThreatLevel.Low))
{
return result;
}
// retrieve the region
RegionInfo aRegion = new RegionInfo();
try
{
aRegion.UnpackRegionInfoData(Util.DictionaryToOSD(request));
}
catch (Exception)
{
return result;
}
OSChatMessage message = new OSChatMessage();
message.FromKVP(WebUtils.ParseQueryString(request["MESSAGE"].ToString()));
ChatSourceType type = (ChatSourceType)int.Parse(request["TYPE"].ToString());
if (m_AuthenticationService != null)
{
//Set password on the incoming region
if (m_AuthenticationService.CheckExists(aRegion.RegionID))
{
if (m_AuthenticationService.Authenticate(aRegion.RegionID, aRegion.Password.ToString(), 100) == "")
{
m_log.Warn("[RegionPostHandler]: Authentication failed for region " + aRegion.RegionName);
return result;
}
else
m_log.InfoFormat("[RegionPostHandler]: Authentication succeeded for {0}", aRegion.RegionName);
}
else //Set the password then
m_AuthenticationService.SetPasswordHashed(aRegion.RegionID, aRegion.Password.ToString());
}
// Finally!
m_NeighborService.SendChatMessageToNeighbors(message, type, aRegion);
Dictionary<string, object> resp = new Dictionary<string, object>();
resp["success"] = "true";
string xmlString = WebUtils.BuildXmlResponse(resp);
UTF8Encoding encoding = new UTF8Encoding();
return encoding.GetBytes(xmlString);
}