Updates to LibSL revision 1498. Thanks Johan!
parent
57f666497b
commit
3d938f76b7
|
@ -258,7 +258,7 @@ namespace OpenSim.Region.Capabilities
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string NoteCardAgentInventory(string request, string path, string param)
|
public string NoteCardAgentInventory(string request, string path, string param)
|
||||||
{
|
{
|
||||||
Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request));
|
libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)libsecondlife.StructuredData.LLSDParser.DeserializeBinary(Helpers.StringToField(request));
|
||||||
LLSDItemUpdate llsdRequest = new LLSDItemUpdate();
|
LLSDItemUpdate llsdRequest = new LLSDItemUpdate();
|
||||||
LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest);
|
LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest);
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,7 @@ namespace OpenSim.Region.Capabilities
|
||||||
return sw.ToString();
|
return sw.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SerializeLLSDType(XmlTextWriter writer, object obj)
|
private static void SerializeLLSDType(XmlTextWriter writer, object obj)
|
||||||
{
|
{
|
||||||
Type myType = obj.GetType();
|
Type myType = obj.GetType();
|
||||||
LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false);
|
LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false);
|
||||||
|
@ -76,7 +76,8 @@ namespace OpenSim.Region.Capabilities
|
||||||
writer.WriteStartElement(String.Empty, "key", String.Empty);
|
writer.WriteStartElement(String.Empty, "key", String.Empty);
|
||||||
writer.WriteString(fields[i].Name);
|
writer.WriteString(fields[i].Name);
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
LLSD.LLSDWriteOne(writer, fieldValue);
|
libsecondlife.StructuredData.LLSDParser.SerializeXmlElement(
|
||||||
|
writer, libsecondlife.StructuredData.LLSD.FromObject(fieldValue));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
writer.WriteEndElement();
|
writer.WriteEndElement();
|
||||||
|
@ -99,11 +100,12 @@ namespace OpenSim.Region.Capabilities
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLSD.LLSDWriteOne(writer, obj);
|
libsecondlife.StructuredData.LLSDParser.SerializeXmlElement(
|
||||||
|
writer, libsecondlife.StructuredData.LLSD.FromObject(obj));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static object DeserialiseLLSDMap(Hashtable llsd, object obj)
|
public static object DeserialiseLLSDMap(libsecondlife.StructuredData.LLSDMap llsd, object obj)
|
||||||
{
|
{
|
||||||
Type myType = obj.GetType();
|
Type myType = obj.GetType();
|
||||||
LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false);
|
LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false);
|
||||||
|
@ -118,10 +120,10 @@ namespace OpenSim.Region.Capabilities
|
||||||
FieldInfo field = myType.GetField((string) enumerator.Key);
|
FieldInfo field = myType.GetField((string) enumerator.Key);
|
||||||
if (field != null)
|
if (field != null)
|
||||||
{
|
{
|
||||||
if (enumerator.Value is Hashtable)
|
if (enumerator.Value is libsecondlife.StructuredData.LLSDMap)
|
||||||
{
|
{
|
||||||
object fieldValue = field.GetValue(obj);
|
object fieldValue = field.GetValue(obj);
|
||||||
DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue);
|
DeserialiseLLSDMap((libsecondlife.StructuredData.LLSDMap) enumerator.Value, fieldValue);
|
||||||
}
|
}
|
||||||
else if (enumerator.Value is ArrayList)
|
else if (enumerator.Value is ArrayList)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,7 @@ using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using libsecondlife;
|
using libsecondlife;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
|
using System.Xml;
|
||||||
|
|
||||||
namespace OpenSim.Region.Capabilities
|
namespace OpenSim.Region.Capabilities
|
||||||
{
|
{
|
||||||
|
@ -53,7 +54,8 @@ namespace OpenSim.Region.Capabilities
|
||||||
//string requestBody = streamReader.ReadToEnd();
|
//string requestBody = streamReader.ReadToEnd();
|
||||||
//streamReader.Close();
|
//streamReader.Close();
|
||||||
|
|
||||||
Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request);
|
libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)
|
||||||
|
libsecondlife.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request));
|
||||||
TRequest llsdRequest = new TRequest();
|
TRequest llsdRequest = new TRequest();
|
||||||
LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest);
|
LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest);
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,12 @@ namespace OpenSim.Framework
|
||||||
private static object XferLock = new object();
|
private static object XferLock = new object();
|
||||||
private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>();
|
private static Dictionary<LLUUID, string> capsURLS = new Dictionary<LLUUID, string>();
|
||||||
|
|
||||||
|
public static double GetDistanceTo(LLVector3 a, LLVector3 b) {
|
||||||
|
float dx = a.X - b.X;
|
||||||
|
float dy = a.Y - b.Y;
|
||||||
|
float dz = a.Z - b.Z;
|
||||||
|
return Math.Sqrt(dx * dx + dy * dy + dz * dz);
|
||||||
|
}
|
||||||
|
|
||||||
public static ulong UIntsToLong(uint X, uint Y)
|
public static ulong UIntsToLong(uint X, uint Y)
|
||||||
{
|
{
|
||||||
|
|
|
@ -722,9 +722,11 @@ namespace OpenSim.Region.ClientStack
|
||||||
///
|
///
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="regInfo"></param>
|
/// <param name="regInfo"></param>
|
||||||
|
private byte[] m_channelVersion=new byte[] { 0x00} ; // Dummy value needed by libSL
|
||||||
public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
|
public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
|
||||||
{
|
{
|
||||||
AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
|
AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
|
||||||
|
mov.SimData.ChannelVersion = m_channelVersion;
|
||||||
mov.AgentData.SessionID = m_sessionId;
|
mov.AgentData.SessionID = m_sessionId;
|
||||||
mov.AgentData.AgentID = AgentId;
|
mov.AgentData.AgentID = AgentId;
|
||||||
mov.Data.RegionHandle = regInfo.RegionHandle;
|
mov.Data.RegionHandle = regInfo.RegionHandle;
|
||||||
|
@ -1170,15 +1172,13 @@ namespace OpenSim.Region.ClientStack
|
||||||
inventoryReply.InventoryData[0].SaleType = 0;
|
inventoryReply.InventoryData[0].SaleType = 0;
|
||||||
inventoryReply.InventoryData[0].Type = (sbyte) item.assetType;
|
inventoryReply.InventoryData[0].Type = (sbyte) item.assetType;
|
||||||
inventoryReply.InventoryData[0].CRC =
|
inventoryReply.InventoryData[0].CRC =
|
||||||
Helpers.InventoryCRC(inventoryReply.InventoryData[0].CreationDate, inventoryReply.InventoryData[0].SaleType,
|
Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType,
|
||||||
inventoryReply.InventoryData[0].InvType,
|
|
||||||
inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
|
inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID,
|
||||||
inventoryReply.InventoryData[0].GroupID, inventoryReply.InventoryData[0].SalePrice,
|
inventoryReply.InventoryData[0].GroupID, 100,
|
||||||
inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID,
|
inventoryReply.InventoryData[0].OwnerID, inventoryReply.InventoryData[0].CreatorID,
|
||||||
inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID,
|
inventoryReply.InventoryData[0].ItemID, inventoryReply.InventoryData[0].FolderID,
|
||||||
inventoryReply.InventoryData[0].EveryoneMask, inventoryReply.InventoryData[0].Flags,
|
FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
|
||||||
inventoryReply.InventoryData[0].NextOwnerMask, inventoryReply.InventoryData[0].GroupMask,
|
FULL_MASK_PERMISSIONS);
|
||||||
inventoryReply.InventoryData[0].OwnerMask);
|
|
||||||
|
|
||||||
OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
|
OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
|
||||||
}
|
}
|
||||||
|
@ -1213,16 +1213,13 @@ namespace OpenSim.Region.ClientStack
|
||||||
InventoryReply.InventoryData[0].SaleType = 0;
|
InventoryReply.InventoryData[0].SaleType = 0;
|
||||||
InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType;
|
InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType;
|
||||||
InventoryReply.InventoryData[0].CRC =
|
InventoryReply.InventoryData[0].CRC =
|
||||||
Helpers.InventoryCRC(InventoryReply.InventoryData[0].CreationDate, InventoryReply.InventoryData[0].SaleType,
|
Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType,
|
||||||
InventoryReply.InventoryData[0].InvType,
|
|
||||||
InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID,
|
InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID,
|
||||||
InventoryReply.InventoryData[0].GroupID, InventoryReply.InventoryData[0].SalePrice,
|
InventoryReply.InventoryData[0].GroupID, 100,
|
||||||
InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID,
|
InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID,
|
||||||
InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID,
|
InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID,
|
||||||
InventoryReply.InventoryData[0].EveryoneMask, InventoryReply.InventoryData[0].Flags,
|
FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
|
||||||
InventoryReply.InventoryData[0].NextOwnerMask, InventoryReply.InventoryData[0].GroupMask,
|
FULL_MASK_PERMISSIONS);
|
||||||
InventoryReply.InventoryData[0].OwnerMask);
|
|
||||||
|
|
||||||
|
|
||||||
OutPacket(InventoryReply, ThrottleOutPacketType.Asset);
|
OutPacket(InventoryReply, ThrottleOutPacketType.Asset);
|
||||||
}
|
}
|
||||||
|
@ -1603,7 +1600,6 @@ namespace OpenSim.Region.ClientStack
|
||||||
//outPacket.ObjectData[0].Flags = 0;
|
//outPacket.ObjectData[0].Flags = 0;
|
||||||
outPacket.ObjectData[0].Radius = 20;
|
outPacket.ObjectData[0].Radius = 20;
|
||||||
|
|
||||||
|
|
||||||
byte[] pb = pos.GetBytes();
|
byte[] pb = pos.GetBytes();
|
||||||
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
|
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
|
||||||
|
|
||||||
|
@ -2904,7 +2900,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
{
|
{
|
||||||
if (OnObjectDescription != null)
|
if (OnObjectDescription != null)
|
||||||
{
|
{
|
||||||
OnObjectDescription(this,objDes.ObjectData[i].LocalID,
|
OnObjectDescription(this, objDes.ObjectData[i].LocalID,
|
||||||
enc.GetString(objDes.ObjectData[i].Description));
|
enc.GetString(objDes.ObjectData[i].Description));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2915,7 +2911,7 @@ namespace OpenSim.Region.ClientStack
|
||||||
{
|
{
|
||||||
if (OnObjectName != null)
|
if (OnObjectName != null)
|
||||||
{
|
{
|
||||||
OnObjectName(this,objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name));
|
OnObjectName(this, objName.ObjectData[i].LocalID, enc.GetString(objName.ObjectData[i].Name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3003,7 +2999,8 @@ namespace OpenSim.Region.ClientStack
|
||||||
// Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToStringHyphenated());
|
// Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToStringHyphenated());
|
||||||
if (OnAssetUploadRequest != null)
|
if (OnAssetUploadRequest != null)
|
||||||
{
|
{
|
||||||
OnAssetUploadRequest(this, request.AssetBlock.TransactionID.Combine(SecureSessionId),
|
LLUUID temp=libsecondlife.LLUUID.Combine(request.AssetBlock.TransactionID, SecureSessionId);
|
||||||
|
OnAssetUploadRequest(this, temp,
|
||||||
request.AssetBlock.TransactionID, request.AssetBlock.Type,
|
request.AssetBlock.TransactionID, request.AssetBlock.Type,
|
||||||
request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
|
request.AssetBlock.AssetData, request.AssetBlock.StoreLocal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
scene.RegionInfo.RegionLocY * 256,
|
scene.RegionInfo.RegionLocY * 256,
|
||||||
0);
|
0);
|
||||||
dis =
|
dis =
|
||||||
Math.Abs((int)avatarRegionPos.GetDistanceTo(fromRegionPos));
|
Math.Abs((int) Util.GetDistanceTo(avatarRegionPos, fromRegionPos));
|
||||||
|
|
||||||
switch (e.Type)
|
switch (e.Type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -171,9 +171,9 @@ namespace OpenSim.Region.Environment.Modules
|
||||||
double dis = 0;
|
double dis = 0;
|
||||||
|
|
||||||
if (source != null)
|
if (source != null)
|
||||||
dis = sPart.AbsolutePosition.GetDistanceTo(source.AbsolutePosition);
|
dis = Util.GetDistanceTo(sPart.AbsolutePosition, source.AbsolutePosition);
|
||||||
else
|
else
|
||||||
dis = sPart.AbsolutePosition.GetDistanceTo(avatar.AbsolutePosition);
|
dis = Util.GetDistanceTo(sPart.AbsolutePosition, avatar.AbsolutePosition);
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
if (transactions != null)
|
if (transactions != null)
|
||||||
{
|
{
|
||||||
LLUUID assetID = transactionID.Combine(remoteClient.SecureSessionId);
|
LLUUID assetID = libsecondlife.LLUUID.Combine(transactionID, remoteClient.SecureSessionId);
|
||||||
AssetBase asset = AssetCache.GetAsset(assetID);
|
AssetBase asset = AssetCache.GetAsset(assetID);
|
||||||
|
|
||||||
if (asset == null)
|
if (asset == null)
|
||||||
|
@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId),
|
((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId),
|
||||||
((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId),
|
((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId),
|
||||||
(sbyte) InventoryType.Object,
|
(sbyte) InventoryType.Object,
|
||||||
(sbyte) AssetType.Object, // TODO: after libSL r1357, this becomes AssetType.Primitive
|
(sbyte) AssetType.Primitive,
|
||||||
Helpers.StringToField(sceneObjectXml));
|
Helpers.StringToField(sceneObjectXml));
|
||||||
AssetCache.AddAsset(asset);
|
AssetCache.AddAsset(asset);
|
||||||
|
|
||||||
|
|
|
@ -675,7 +675,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
if (lastPhysGroupPos.GetDistanceTo(AbsolutePosition) > 0.02)
|
if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02)
|
||||||
{
|
{
|
||||||
foreach (SceneObjectPart part in m_parts.Values)
|
foreach (SceneObjectPart part in m_parts.Values)
|
||||||
{
|
{
|
||||||
|
|
|
@ -749,7 +749,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z);
|
LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.z);
|
||||||
LLVector3 distanceConvert2 = new LLVector3(ipoint.x, ipoint.y, ipoint.z);
|
LLVector3 distanceConvert2 = new LLVector3(ipoint.x, ipoint.y, ipoint.z);
|
||||||
float distance = (float)distanceConvert1.GetDistanceTo(distanceConvert2);
|
float distance = (float)Util.GetDistanceTo(distanceConvert1, distanceConvert2);
|
||||||
|
|
||||||
returnresult.distance = distance;
|
returnresult.distance = distance;
|
||||||
|
|
||||||
|
|
|
@ -93,12 +93,12 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
private enum Dir_ControlFlags
|
private enum Dir_ControlFlags
|
||||||
{
|
{
|
||||||
DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS,
|
DIR_CONTROL_FLAG_FOWARD = AgentManager.ControlFlags.AGENT_CONTROL_AT_POS,
|
||||||
DIR_CONTROL_FLAG_BACK = MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG,
|
DIR_CONTROL_FLAG_BACK = AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG,
|
||||||
DIR_CONTROL_FLAG_LEFT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_POS,
|
DIR_CONTROL_FLAG_LEFT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS,
|
||||||
DIR_CONTROL_FLAG_RIGHT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_NEG,
|
DIR_CONTROL_FLAG_RIGHT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG,
|
||||||
DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS,
|
DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS,
|
||||||
DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG
|
DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -609,7 +609,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
//MainLog.Instance.Verbose("CAMERA", "AtAxis:" + m_CameraAtAxis.ToString() + " Center:" + m_CameraCenter.ToString() + " LeftAxis:" + m_CameraLeftAxis.ToString() + " UpAxis:" + m_CameraUpAxis.ToString() + " Far:" + m_CameraFar);
|
//MainLog.Instance.Verbose("CAMERA", "AtAxis:" + m_CameraAtAxis.ToString() + " Center:" + m_CameraCenter.ToString() + " LeftAxis:" + m_CameraLeftAxis.ToString() + " UpAxis:" + m_CameraUpAxis.ToString() + " Far:" + m_CameraFar);
|
||||||
|
|
||||||
|
|
||||||
if ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
|
if ((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
|
||||||
{
|
{
|
||||||
StandUp();
|
StandUp();
|
||||||
}
|
}
|
||||||
|
@ -630,7 +630,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
|
Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
|
||||||
bool oldflying = PhysicsActor.Flying;
|
bool oldflying = PhysicsActor.Flying;
|
||||||
|
|
||||||
PhysicsActor.Flying = ((flags & (uint)MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0);
|
PhysicsActor.Flying = ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0);
|
||||||
if (PhysicsActor.Flying != oldflying)
|
if (PhysicsActor.Flying != oldflying)
|
||||||
{
|
{
|
||||||
update_movementflag = true;
|
update_movementflag = true;
|
||||||
|
@ -796,7 +796,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (((m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) &&
|
if (((m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) &&
|
||||||
PhysicsActor.IsColliding)
|
PhysicsActor.IsColliding)
|
||||||
{
|
{
|
||||||
SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1);
|
||||||
|
@ -807,7 +807,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1);
|
||||||
}
|
}
|
||||||
else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && (m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0)
|
else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0)
|
||||||
{
|
{
|
||||||
SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1);
|
||||||
}
|
}
|
||||||
|
@ -839,7 +839,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (((m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) &&
|
if (((m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) &&
|
||||||
PhysicsActor.IsColliding)
|
PhysicsActor.IsColliding)
|
||||||
{
|
{
|
||||||
SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1);
|
||||||
|
@ -854,7 +854,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
{
|
{
|
||||||
SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1);
|
||||||
}
|
}
|
||||||
else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying && (m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0)
|
else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying && (m_movementflag & (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0)
|
||||||
{
|
{
|
||||||
SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1);
|
SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1);
|
||||||
}
|
}
|
||||||
|
@ -955,7 +955,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
m_updateCount = 0;
|
m_updateCount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (lastPhysPos.GetDistanceTo(AbsolutePosition) > 0.02) // physics-related movement
|
else if (Util.GetDistanceTo(lastPhysPos, AbsolutePosition) > 0.02) // physics-related movement
|
||||||
{
|
{
|
||||||
SendTerseUpdateToAllClients();
|
SendTerseUpdateToAllClients();
|
||||||
m_updateCount = 0;
|
m_updateCount = 0;
|
||||||
|
@ -1123,7 +1123,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||||
|
|
||||||
protected void CheckForSignificantMovement()
|
protected void CheckForSignificantMovement()
|
||||||
{
|
{
|
||||||
if (AbsolutePosition.GetDistanceTo(posLastSignificantMove) > 0.02)
|
if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.02)
|
||||||
{
|
{
|
||||||
posLastSignificantMove = AbsolutePosition;
|
posLastSignificantMove = AbsolutePosition;
|
||||||
if (OnSignificantClientMovement != null)
|
if (OnSignificantClientMovement != null)
|
||||||
|
|
|
@ -384,19 +384,19 @@ namespace SimpleApp
|
||||||
}
|
}
|
||||||
if (flyState == 0)
|
if (flyState == 0)
|
||||||
{
|
{
|
||||||
movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY |
|
movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY |
|
||||||
(uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG;
|
(uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG;
|
||||||
flyState = 1;
|
flyState = 1;
|
||||||
}
|
}
|
||||||
else if (flyState == 1)
|
else if (flyState == 1)
|
||||||
{
|
{
|
||||||
movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY |
|
movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY |
|
||||||
(uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS;
|
(uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
|
||||||
flyState = 2;
|
flyState = 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY;
|
movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
||||||
flyState = 0;
|
flyState = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue