From 3d938f76b7c2f8ede862f9979383d79dfb21372c Mon Sep 17 00:00:00 2001
From: Adam Johnson
Date: Fri, 7 Dec 2007 08:54:31 +0000
Subject: Updates to LibSL revision 1498. Thanks Johan!
---
OpenSim/Region/ClientStack/ClientView.cs | 31 ++++++++++------------
OpenSim/Region/Environment/Modules/ChatModule.cs | 2 +-
.../Region/Environment/Modules/WorldCommModule.cs | 8 +++---
.../Region/Environment/Scenes/Scene.Inventory.cs | 4 +--
.../Region/Environment/Scenes/SceneObjectGroup.cs | 2 +-
.../Region/Environment/Scenes/SceneObjectPart.cs | 2 +-
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 28 +++++++++----------
.../Region/Examples/SimpleApp/MyNpcCharacter.cs | 10 +++----
8 files changed, 42 insertions(+), 45 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 284a2de..b2db4cb 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -722,9 +722,11 @@ namespace OpenSim.Region.ClientStack
///
///
///
+ private byte[] m_channelVersion=new byte[] { 0x00} ; // Dummy value needed by libSL
public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
{
AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
+ mov.SimData.ChannelVersion = m_channelVersion;
mov.AgentData.SessionID = m_sessionId;
mov.AgentData.AgentID = AgentId;
mov.Data.RegionHandle = regInfo.RegionHandle;
@@ -1170,15 +1172,13 @@ namespace OpenSim.Region.ClientStack
inventoryReply.InventoryData[0].SaleType = 0;
inventoryReply.InventoryData[0].Type = (sbyte) item.assetType;
inventoryReply.InventoryData[0].CRC =
- Helpers.InventoryCRC(inventoryReply.InventoryData[0].CreationDate, inventoryReply.InventoryData[0].SaleType,
- inventoryReply.InventoryData[0].InvType,
+ Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType,
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].ItemID, inventoryReply.InventoryData[0].FolderID,
- inventoryReply.InventoryData[0].EveryoneMask, inventoryReply.InventoryData[0].Flags,
- inventoryReply.InventoryData[0].NextOwnerMask, inventoryReply.InventoryData[0].GroupMask,
- inventoryReply.InventoryData[0].OwnerMask);
+ FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
+ FULL_MASK_PERMISSIONS);
OutPacket(inventoryReply, ThrottleOutPacketType.Asset);
}
@@ -1213,16 +1213,13 @@ namespace OpenSim.Region.ClientStack
InventoryReply.InventoryData[0].SaleType = 0;
InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType;
InventoryReply.InventoryData[0].CRC =
- Helpers.InventoryCRC(InventoryReply.InventoryData[0].CreationDate, InventoryReply.InventoryData[0].SaleType,
- InventoryReply.InventoryData[0].InvType,
+ Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType,
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].ItemID, InventoryReply.InventoryData[0].FolderID,
- InventoryReply.InventoryData[0].EveryoneMask, InventoryReply.InventoryData[0].Flags,
- InventoryReply.InventoryData[0].NextOwnerMask, InventoryReply.InventoryData[0].GroupMask,
- InventoryReply.InventoryData[0].OwnerMask);
-
+ FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS,
+ FULL_MASK_PERMISSIONS);
OutPacket(InventoryReply, ThrottleOutPacketType.Asset);
}
@@ -1602,7 +1599,6 @@ namespace OpenSim.Region.ClientStack
outPacket.ObjectData[0].ClickAction = clickAction;
//outPacket.ObjectData[0].Flags = 0;
outPacket.ObjectData[0].Radius = 20;
-
byte[] pb = pos.GetBytes();
Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
@@ -2904,7 +2900,7 @@ namespace OpenSim.Region.ClientStack
{
if (OnObjectDescription != null)
{
- OnObjectDescription(this,objDes.ObjectData[i].LocalID,
+ OnObjectDescription(this, objDes.ObjectData[i].LocalID,
enc.GetString(objDes.ObjectData[i].Description));
}
}
@@ -2915,7 +2911,7 @@ namespace OpenSim.Region.ClientStack
{
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;
@@ -3003,7 +2999,8 @@ namespace OpenSim.Region.ClientStack
// Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToStringHyphenated());
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.AssetData, request.AssetBlock.StoreLocal);
}
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index c93804f..8af7b49 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -192,7 +192,7 @@ namespace OpenSim.Region.Environment.Modules
scene.RegionInfo.RegionLocY * 256,
0);
dis =
- Math.Abs((int)avatarRegionPos.GetDistanceTo(fromRegionPos));
+ Math.Abs((int) Util.GetDistanceTo(avatarRegionPos, fromRegionPos));
switch (e.Type)
{
diff --git a/OpenSim/Region/Environment/Modules/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/WorldCommModule.cs
index a31b484..0dad998 100644
--- a/OpenSim/Region/Environment/Modules/WorldCommModule.cs
+++ b/OpenSim/Region/Environment/Modules/WorldCommModule.cs
@@ -135,7 +135,7 @@ namespace OpenSim.Region.Environment.Modules
{
m_listenerManager.Remove(handle);
}
-
+
// This method scans nearby objects and determines if they are listeners,
// and if so if this message fits the filter. If it does, then
// enqueue the message for delivery to the objects listen event handler.
@@ -171,9 +171,9 @@ namespace OpenSim.Region.Environment.Modules
double dis = 0;
if (source != null)
- dis = sPart.AbsolutePosition.GetDistanceTo(source.AbsolutePosition);
+ dis = Util.GetDistanceTo(sPart.AbsolutePosition, source.AbsolutePosition);
else
- dis = sPart.AbsolutePosition.GetDistanceTo(avatar.AbsolutePosition);
+ dis = Util.GetDistanceTo(sPart.AbsolutePosition, avatar.AbsolutePosition);
switch (type)
{
@@ -490,4 +490,4 @@ namespace OpenSim.Region.Environment.Modules
return m_id;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 6c8b3bf..ac504e1 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -144,7 +144,7 @@ namespace OpenSim.Region.Environment.Scenes
if (transactions != null)
{
- LLUUID assetID = transactionID.Combine(remoteClient.SecureSessionId);
+ LLUUID assetID = libsecondlife.LLUUID.Combine(transactionID, remoteClient.SecureSessionId);
AssetBase asset = AssetCache.GetAsset(assetID);
if (asset == null)
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Environment.Scenes
((SceneObjectGroup) selectedEnt).GetPartName(selectedEnt.LocalId),
((SceneObjectGroup) selectedEnt).GetPartDescription(selectedEnt.LocalId),
(sbyte) InventoryType.Object,
- (sbyte) AssetType.Object, // TODO: after libSL r1357, this becomes AssetType.Primitive
+ (sbyte) AssetType.Primitive,
Helpers.StringToField(sceneObjectXml));
AssetCache.AddAsset(asset);
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index bcee5c7..89e2f0d 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -675,7 +675,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public override void Update()
{
- if (lastPhysGroupPos.GetDistanceTo(AbsolutePosition) > 0.02)
+ if (Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02)
{
foreach (SceneObjectPart part in m_parts.Values)
{
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index bf02e8d..05a59a2 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -749,7 +749,7 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 distanceConvert1 = new LLVector3(iray.Origin.x, iray.Origin.y, iray.Origin.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;
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index b8a2555..66872fa 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -93,12 +93,12 @@ namespace OpenSim.Region.Environment.Scenes
private enum Dir_ControlFlags
{
- DIR_CONTROL_FLAG_FOWARD = MainAvatar.ControlFlags.AGENT_CONTROL_AT_POS,
- DIR_CONTROL_FLAG_BACK = MainAvatar.ControlFlags.AGENT_CONTROL_AT_NEG,
- DIR_CONTROL_FLAG_LEFT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_POS,
- DIR_CONTROL_FLAG_RIGHT = MainAvatar.ControlFlags.AGENT_CONTROL_LEFT_NEG,
- DIR_CONTROL_FLAG_UP = MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS,
- DIR_CONTROL_FLAG_DOWN = MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG
+ DIR_CONTROL_FLAG_FOWARD = AgentManager.ControlFlags.AGENT_CONTROL_AT_POS,
+ DIR_CONTROL_FLAG_BACK = AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG,
+ DIR_CONTROL_FLAG_LEFT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS,
+ DIR_CONTROL_FLAG_RIGHT = AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG,
+ DIR_CONTROL_FLAG_UP = AgentManager.ControlFlags.AGENT_CONTROL_UP_POS,
+ DIR_CONTROL_FLAG_DOWN = AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG
}
///
@@ -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);
- if ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
+ if ((flags & (uint) AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
{
StandUp();
}
@@ -630,7 +630,7 @@ namespace OpenSim.Region.Environment.Scenes
Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z);
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)
{
update_movementflag = true;
@@ -796,7 +796,7 @@ namespace OpenSim.Region.Environment.Scenes
}
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)
{
SendAnimPack(Animations.AnimsLLUUID["CROUCHWALK"], 1);
@@ -807,7 +807,7 @@ namespace OpenSim.Region.Environment.Scenes
{
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);
}
@@ -839,7 +839,7 @@ namespace OpenSim.Region.Environment.Scenes
}
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)
{
SendAnimPack(Animations.AnimsLLUUID["CROUCH"], 1);
@@ -854,7 +854,7 @@ namespace OpenSim.Region.Environment.Scenes
{
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);
}
@@ -955,7 +955,7 @@ namespace OpenSim.Region.Environment.Scenes
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();
m_updateCount = 0;
@@ -1123,7 +1123,7 @@ namespace OpenSim.Region.Environment.Scenes
protected void CheckForSignificantMovement()
{
- if (AbsolutePosition.GetDistanceTo(posLastSignificantMove) > 0.02)
+ if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.02)
{
posLastSignificantMove = AbsolutePosition;
if (OnSignificantClientMovement != null)
diff --git a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
index a3046b0..a9bba3f 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyNpcCharacter.cs
@@ -384,19 +384,19 @@ namespace SimpleApp
}
if (flyState == 0)
{
- movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY |
- (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_NEG;
+ movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY |
+ (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG;
flyState = 1;
}
else if (flyState == 1)
{
- movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY |
- (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS;
+ movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY |
+ (uint) AgentManager.ControlFlags.AGENT_CONTROL_UP_POS;
flyState = 2;
}
else
{
- movementFlag = (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY;
+ movementFlag = (uint) AgentManager.ControlFlags.AGENT_CONTROL_FLY;
flyState = 0;
}
--
cgit v1.1