Merge branch 'master' into careminster
commit
87bce90086
|
@ -350,7 +350,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
protected IAssetService m_assetService;
|
protected IAssetService m_assetService;
|
||||||
private IHyperAssetService m_hyperAssets;
|
private IHyperAssetService m_hyperAssets;
|
||||||
|
private const bool m_checkPackets = true;
|
||||||
|
|
||||||
#endregion Class Members
|
#endregion Class Members
|
||||||
|
|
||||||
|
@ -4043,7 +4043,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
|
|
||||||
if (collisionPlane == Vector4.Zero)
|
if (collisionPlane == Vector4.Zero)
|
||||||
collisionPlane = Vector4.UnitW;
|
collisionPlane = Vector4.UnitW;
|
||||||
|
//m_log.DebugFormat("CollisionPlane: {0}",collisionPlane);
|
||||||
collisionPlane.ToBytes(data, pos);
|
collisionPlane.ToBytes(data, pos);
|
||||||
pos += 16;
|
pos += 16;
|
||||||
}
|
}
|
||||||
|
@ -4128,12 +4128,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
update.PCode = (byte)PCode.Avatar;
|
update.PCode = (byte)PCode.Avatar;
|
||||||
update.ProfileCurve = 1;
|
update.ProfileCurve = 1;
|
||||||
update.PSBlock = Utils.EmptyBytes;
|
update.PSBlock = Utils.EmptyBytes;
|
||||||
update.Scale = Vector3.One;
|
update.Scale = new Vector3(0.45f,0.6f,1.9f);
|
||||||
update.Text = Utils.EmptyBytes;
|
update.Text = Utils.EmptyBytes;
|
||||||
update.TextColor = new byte[4];
|
update.TextColor = new byte[4];
|
||||||
update.TextureAnim = Utils.EmptyBytes;
|
update.TextureAnim = Utils.EmptyBytes;
|
||||||
update.TextureEntry = data.TextureEntry ?? Utils.EmptyBytes;
|
update.TextureEntry = data.TextureEntry ?? Utils.EmptyBytes;
|
||||||
update.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); // TODO: Replace these numbers with PrimFlags
|
update.UpdateFlags = (uint)(PrimFlags.Physics | PrimFlags.ObjectModify | PrimFlags.ObjectCopy | PrimFlags.ObjectAnyOwner | PrimFlags.ObjectYouOwner | PrimFlags.ObjectMove | PrimFlags.InventoryEmpty | PrimFlags.ObjectTransfer | PrimFlags.ObjectOwnerModify);//61 + (9 << 8) + (130 << 16) + (16 << 24); // TODO: Replace these numbers with PrimFlags
|
||||||
|
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
@ -4280,6 +4280,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest);
|
AddLocalPacketHandler(PacketType.UUIDGroupNameRequest, HandleUUIDGroupNameRequest);
|
||||||
AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest);
|
AddLocalPacketHandler(PacketType.ObjectGroup, HandleObjectGroupRequest);
|
||||||
AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
|
AddLocalPacketHandler(PacketType.GenericMessage, HandleGenericMessage);
|
||||||
|
AddLocalPacketHandler(PacketType.AvatarPropertiesRequest, HandleAvatarPropertiesRequest);
|
||||||
|
AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
|
||||||
|
AddLocalPacketHandler(PacketType.AvatarPropertiesUpdate, HandlerAvatarPropertiesUpdate);
|
||||||
|
//AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
|
||||||
|
//AddLocalPacketHandler(PacketType.ChatFromViewer, HandleChatFromViewer);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Packet Handlers
|
#region Packet Handlers
|
||||||
|
@ -4495,6 +4500,98 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool HandleAvatarPropertiesRequest(IClientAPI sender, Packet Pack)
|
||||||
|
{
|
||||||
|
AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
|
||||||
|
|
||||||
|
#region Packet Session and User Check
|
||||||
|
if (m_checkPackets)
|
||||||
|
{
|
||||||
|
if (avatarProperties.AgentData.SessionID != SessionId ||
|
||||||
|
avatarProperties.AgentData.AgentID != AgentId)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
RequestAvatarProperties handlerRequestAvatarProperties = OnRequestAvatarProperties;
|
||||||
|
if (handlerRequestAvatarProperties != null)
|
||||||
|
{
|
||||||
|
handlerRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool HandleChatFromViewer(IClientAPI sender, Packet Pack)
|
||||||
|
{
|
||||||
|
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
|
||||||
|
|
||||||
|
#region Packet Session and User Check
|
||||||
|
if (m_checkPackets)
|
||||||
|
{
|
||||||
|
if (inchatpack.AgentData.SessionID != SessionId ||
|
||||||
|
inchatpack.AgentData.AgentID != AgentId)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
string fromName = String.Empty; //ClientAvatar.firstname + " " + ClientAvatar.lastname;
|
||||||
|
byte[] message = inchatpack.ChatData.Message;
|
||||||
|
byte type = inchatpack.ChatData.Type;
|
||||||
|
Vector3 fromPos = new Vector3(); // ClientAvatar.Pos;
|
||||||
|
// UUID fromAgentID = AgentId;
|
||||||
|
|
||||||
|
int channel = inchatpack.ChatData.Channel;
|
||||||
|
|
||||||
|
if (OnChatFromClient != null)
|
||||||
|
{
|
||||||
|
OSChatMessage args = new OSChatMessage();
|
||||||
|
args.Channel = channel;
|
||||||
|
args.From = fromName;
|
||||||
|
args.Message = Utils.BytesToString(message);
|
||||||
|
args.Type = (ChatTypeEnum)type;
|
||||||
|
args.Position = fromPos;
|
||||||
|
|
||||||
|
args.Scene = Scene;
|
||||||
|
args.Sender = this;
|
||||||
|
args.SenderUUID = this.AgentId;
|
||||||
|
|
||||||
|
ChatMessage handlerChatFromClient = OnChatFromClient;
|
||||||
|
if (handlerChatFromClient != null)
|
||||||
|
handlerChatFromClient(this, args);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private bool HandlerAvatarPropertiesUpdate(IClientAPI sender, Packet Pack)
|
||||||
|
{
|
||||||
|
AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack;
|
||||||
|
|
||||||
|
#region Packet Session and User Check
|
||||||
|
if (m_checkPackets)
|
||||||
|
{
|
||||||
|
if (avatarProps.AgentData.SessionID != SessionId ||
|
||||||
|
avatarProps.AgentData.AgentID != AgentId)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
UpdateAvatarProperties handlerUpdateAvatarProperties = OnUpdateAvatarProperties;
|
||||||
|
if (handlerUpdateAvatarProperties != null)
|
||||||
|
{
|
||||||
|
AvatarPropertiesUpdatePacket.PropertiesDataBlock Properties = avatarProps.PropertiesData;
|
||||||
|
UserProfileData UserProfile = new UserProfileData();
|
||||||
|
UserProfile.ID = AgentId;
|
||||||
|
UserProfile.AboutText = Utils.BytesToString(Properties.AboutText);
|
||||||
|
UserProfile.FirstLifeAboutText = Utils.BytesToString(Properties.FLAboutText);
|
||||||
|
UserProfile.FirstLifeImage = Properties.FLImageID;
|
||||||
|
UserProfile.Image = Properties.ImageID;
|
||||||
|
UserProfile.ProfileUrl = Utils.BytesToString(Properties.ProfileURL);
|
||||||
|
|
||||||
|
handlerUpdateAvatarProperties(this, UserProfile);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#endregion Packet Handlers
|
#endregion Packet Handlers
|
||||||
|
|
||||||
public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
|
public void SendScriptQuestion(UUID taskID, string taskName, string ownerName, UUID itemID, int question)
|
||||||
|
@ -4986,13 +5083,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool m_checkPackets = true;
|
|
||||||
|
|
||||||
// Main packet processing conditional
|
// Main packet processing conditional
|
||||||
switch (Pack.Type)
|
switch (Pack.Type)
|
||||||
{
|
{
|
||||||
#region Scene/Avatar
|
#region Scene/Avatar
|
||||||
|
/*
|
||||||
case PacketType.AvatarPropertiesRequest:
|
case PacketType.AvatarPropertiesRequest:
|
||||||
AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
|
AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack;
|
||||||
|
|
||||||
|
@ -5012,7 +5109,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PacketType.ChatFromViewer:
|
case PacketType.ChatFromViewer:
|
||||||
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
|
ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack;
|
||||||
|
|
||||||
|
@ -5051,7 +5148,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
handlerChatFromClient(this, args);
|
handlerChatFromClient(this, args);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PacketType.AvatarPropertiesUpdate:
|
case PacketType.AvatarPropertiesUpdate:
|
||||||
AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack;
|
AvatarPropertiesUpdatePacket avatarProps = (AvatarPropertiesUpdatePacket)Pack;
|
||||||
|
|
||||||
|
@ -5079,7 +5176,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
||||||
handlerUpdateAvatarProperties(this, UserProfile);
|
handlerUpdateAvatarProperties(this, UserProfile);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
*/
|
||||||
case PacketType.ScriptDialogReply:
|
case PacketType.ScriptDialogReply:
|
||||||
ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack;
|
ScriptDialogReplyPacket rdialog = (ScriptDialogReplyPacket)Pack;
|
||||||
|
|
||||||
|
|
|
@ -1016,9 +1016,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
Animator.TrySetMovementAnimation("LAND");
|
Animator.TrySetMovementAnimation("LAND");
|
||||||
SendFullUpdateToAllClients();
|
//SendFullUpdateToAllClients();
|
||||||
ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
|
ControllingClient.SendAvatarTerseUpdate(new SendAvatarTerseData(m_rootRegionHandle, (ushort)(m_scene.TimeDilation * ushort.MaxValue), LocalId,
|
||||||
AbsolutePosition, Velocity, -Vector3.UnitZ, m_bodyRot, Vector4.UnitW, m_uuid, null, GetUpdatePriority(ControllingClient)));
|
AbsolutePosition, Velocity, Vector3.Zero, m_bodyRot, new Vector4(0,0,1,AbsolutePosition.Z - 0.5f), m_uuid, null, GetUpdatePriority(ControllingClient)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddNeighbourRegion(ulong regionHandle, string cap)
|
public void AddNeighbourRegion(ulong regionHandle, string cap)
|
||||||
|
|
Loading…
Reference in New Issue