本文整理汇总了C#中OpenSim.Framework.OSChatMessage.Copy方法的典型用法代码示例。如果您正苦于以下问题:C# OSChatMessage.Copy方法的具体用法?C# OSChatMessage.Copy怎么用?C# OSChatMessage.Copy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Framework.OSChatMessage
的用法示例。
在下文中一共展示了OSChatMessage.Copy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnChatFromWorld
/// <summary>
/// Send the message from the prim to the avatars in the regions
/// </summary>
/// <param name="sender"></param>
/// <param name="c"></param>
public virtual void OnChatFromWorld(Object sender, OSChatMessage c)
{
// early return if not on public or debug channel
if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return;
bool Sent = false;
if(c.Range > m_maxChatDistance) //Check for max distance
c.Range = m_maxChatDistance;
//Send the message into neighboring regions if possible
if (c.Type == ChatTypeEnum.Say ||
c.Type == ChatTypeEnum.Whisper ||
c.Type == ChatTypeEnum.Shout ||
c.Type == ChatTypeEnum.Custom)
{
int distance = c.Type == ChatTypeEnum.Say ? m_saydistance :
(c.Type == ChatTypeEnum.Whisper) ? m_whisperdistance :
(c.Type == ChatTypeEnum.Custom) ? (int)c.Range : m_shoutdistance;
if (((Scene)c.Scene).TestBorderCross(new Vector3(c.Position.X + distance,
c.Position.Y,
c.Position.Z), Cardinals.E))
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX + 1, c.Scene.RegionInfo.RegionLocY);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.X -= Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (((Scene)c.Scene).TestBorderCross(new Vector3(c.Position.X,
c.Position.Y + distance,
c.Position.Z), Cardinals.N))
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX, c.Scene.RegionInfo.RegionLocY + 1);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.Y -= Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (((Scene)c.Scene).TestBorderCross(new Vector3(c.Position.X + distance,
c.Position.Y + distance,
c.Position.Z), Cardinals.E) &&
((Scene)c.Scene).TestBorderCross(new Vector3(c.Position.X + distance,
c.Position.Y + distance,
c.Position.Z), Cardinals.N))
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX + 1, c.Scene.RegionInfo.RegionLocY + 1);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.X -= Constants.RegionSize;
Position.Y -= Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (((Scene)c.Scene).TestBorderCross(new Vector3(c.Position.X + distance,
c.Position.Y,
c.Position.Z), Cardinals.E) && c.Position.Y - distance < 0)
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX + 1, c.Scene.RegionInfo.RegionLocY - 1);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.X -= Constants.RegionSize;
Position.Y += Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (c.Position.Y - distance < 0)
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX, c.Scene.RegionInfo.RegionLocY - 1);
if (scene != null)
{
//.........这里部分代码省略.........
示例2: OnChatFromWorld
public virtual void OnChatFromWorld(Object sender, OSChatMessage c)
{
// early return if not on public or debug channel
if (c.Channel != 0 && c.Channel != DEBUG_CHANNEL) return;
bool Sent = false;
if(c.Range > m_maxChatDistance)
c.Range = m_maxChatDistance;
if (c.Type == ChatTypeEnum.Say)
{
if (c.Position.X + m_saydistance > 256)
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX + 1, c.Scene.RegionInfo.RegionLocY);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.X -= Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (c.Position.Y + m_saydistance > 256)
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX, c.Scene.RegionInfo.RegionLocY + 1);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.Y -= Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (c.Position.X + m_saydistance > 256 && c.Position.Y + m_saydistance > 256)
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX + 1, c.Scene.RegionInfo.RegionLocY + 1);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.X -= Constants.RegionSize;
Position.Y -= Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (c.Position.X + m_saydistance > 256 && c.Position.Y - m_saydistance < 0)
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX + 1, c.Scene.RegionInfo.RegionLocY - 1);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.X -= Constants.RegionSize;
Position.Y += Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (c.Position.Y - m_saydistance < 0)
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX, c.Scene.RegionInfo.RegionLocY - 1);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.Y += Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (c.Position.X - m_saydistance < 0 && c.Position.Y - m_saydistance < 0)
{
Scene scene = FindScene(c.Scene.RegionInfo.RegionLocX - 1, c.Scene.RegionInfo.RegionLocY - 1);
if (scene != null)
{
OSChatMessage newC = c.Copy();
newC.Scene = scene;
Vector3 Position = newC.Position;
Position.X += Constants.RegionSize;
Position.Y += Constants.RegionSize;
newC.Position = Position;
DeliverChatToAvatars(ChatSourceType.Object, newC);
Sent = true;
}
}
if (c.Position.X - m_saydistance < 0)
//.........这里部分代码省略.........