cosmetics

This commit is contained in:
UbitUmarov
2020-08-09 01:37:54 +01:00
parent 592b94d142
commit a2fe315d94
7 changed files with 444 additions and 525 deletions

View File

@@ -180,22 +180,21 @@ namespace OpenSim.Region.OptionalModules.World.NPC
if (!objectTouchable)
return false;
// Set up the surface args as if the touch is from a client that does not support this
SurfaceTouchEventArgs surfaceArgs = new SurfaceTouchEventArgs();
surfaceArgs.FaceIndex = -1; // TOUCH_INVALID_FACE
surfaceArgs.Binormal = Vector3.Zero; // TOUCH_INVALID_VECTOR
surfaceArgs.Normal = Vector3.Zero; // TOUCH_INVALID_VECTOR
surfaceArgs.STCoord = new Vector3(-1.0f, -1.0f, 0.0f); // TOUCH_INVALID_TEXCOORD
surfaceArgs.UVCoord = surfaceArgs.STCoord; // TOUCH_INVALID_TEXCOORD
List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>();
touchArgs.Add(surfaceArgs);
SurfaceTouchEventArgs surfaceArgs = new SurfaceTouchEventArgs()
{
FaceIndex = -1, // TOUCH_INVALID_FACE
Binormal = Vector3.Zero, // TOUCH_INVALID_VECTOR
Normal = Vector3.Zero, // TOUCH_INVALID_VECTOR
STCoord = new Vector3(-1.0f, -1.0f, 0.0f), // TOUCH_INVALID_TEXCOORD
UVCoord = new Vector3(-1.0f, -1.0f, 0.0f) // TOUCH_INVALID_TEXCOORD
};
List<SurfaceTouchEventArgs> touchArgs = new List<SurfaceTouchEventArgs>() { surfaceArgs };
Vector3 offset = part.OffsetPosition * -1.0f;
if (OnGrabObject == null)
return false;
OnGrabObject(part.LocalId, offset, this, touchArgs);
if (OnGrabUpdate != null)
OnGrabUpdate(part.UUID, offset, part.ParentGroup.RootPart.GroupPosition, this, touchArgs);
if (OnDeGrabObject != null)
OnDeGrabObject(part.LocalId, this, touchArgs);
OnGrabUpdate?.Invoke(part.UUID, offset, part.ParentGroup.RootPart.GroupPosition, this, touchArgs);
OnDeGrabObject?.Invoke(part.LocalId, this, touchArgs);
return true;
}
@@ -263,25 +262,29 @@ namespace OpenSim.Region.OptionalModules.World.NPC
private void SendOnChatFromClient(int channel, string message, ChatTypeEnum chatType)
{
if(OnChatFromClient == null)
return;
if (channel == 0)
{
message = message.Trim();
if (string.IsNullOrEmpty(message))
{
return;
}
}
OSChatMessage chatFromClient = new OSChatMessage();
chatFromClient.Channel = channel;
chatFromClient.From = Name;
chatFromClient.Message = message;
chatFromClient.Position = StartPos;
chatFromClient.Scene = m_scene;
chatFromClient.Sender = this;
chatFromClient.SenderUUID = AgentId;
chatFromClient.Type = chatType;
OnChatFromClient(this, chatFromClient);
OSChatMessage chatFromClient = new OSChatMessage()
{
Channel = channel,
From = Name,
Message = message,
Position = StartPos,
Scene = m_scene,
Sender = this,
SenderUUID = AgentId,
Type = chatType
};
OnChatFromClient?.Invoke(this, chatFromClient);
}
#endregion
@@ -718,18 +721,12 @@ namespace OpenSim.Region.OptionalModules.World.NPC
string message, byte type, Vector3 fromPos, string fromName,
UUID fromAgentID, UUID ownerID, byte source, byte audible)
{
ChatToNPC ctn = OnChatToNPC;
if (ctn != null)
ctn(message, type, fromPos, fromName, fromAgentID, ownerID, source, audible);
OnChatToNPC?.Invoke(message, type, fromPos, fromName, fromAgentID, ownerID, source, audible);
}
public void SendInstantMessage(GridInstantMessage im)
{
Action<GridInstantMessage> oimtn = OnInstantMessageToNPC;
if (oimtn != null)
oimtn(im);
OnInstantMessageToNPC?.Invoke(im);
}
public void SendGenericMessage(string method, UUID invoice, List<string> message)
@@ -938,10 +935,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
public virtual void SendRegionHandshake()
{
if (OnRegionHandShakeReply != null)
{
OnRegionHandShakeReply(this);
}
OnRegionHandShakeReply?.Invoke(this);
}
public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)