aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/AssetLandmark.cs2
-rw-r--r--OpenSim/Framework/EstateSettings.cs3
-rw-r--r--OpenSim/Framework/IClientAPI.cs4
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs51
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs15
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs4
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs1
8 files changed, 62 insertions, 34 deletions
diff --git a/OpenSim/Framework/AssetLandmark.cs b/OpenSim/Framework/AssetLandmark.cs
index fe6f835..e0f5415 100644
--- a/OpenSim/Framework/AssetLandmark.cs
+++ b/OpenSim/Framework/AssetLandmark.cs
@@ -35,6 +35,7 @@ namespace OpenSim.Framework
35 public int Version; 35 public int Version;
36 public LLVector3 Position; 36 public LLVector3 Position;
37 public LLUUID RegionID; 37 public LLUUID RegionID;
38 public ulong RegionHandle;
38 39
39 public AssetLandmark(AssetBase a) 40 public AssetLandmark(AssetBase a)
40 { 41 {
@@ -54,6 +55,7 @@ namespace OpenSim.Framework
54 int.TryParse(parts[0].Substring(17, 1), out Version); 55 int.TryParse(parts[0].Substring(17, 1), out Version);
55 LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID); 56 LLUUID.TryParse(parts[1].Substring(10, 36), out RegionID);
56 LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position); 57 LLVector3.TryParse(parts[2].Substring(11, parts[2].Length - 11), out Position);
58 ulong.TryParse(parts[3].Substring(14, parts[3].Length - 14), out RegionHandle);
57 } 59 }
58 } 60 }
59} 61}
diff --git a/OpenSim/Framework/EstateSettings.cs b/OpenSim/Framework/EstateSettings.cs
index 42154e9..02b7f27 100644
--- a/OpenSim/Framework/EstateSettings.cs
+++ b/OpenSim/Framework/EstateSettings.cs
@@ -128,6 +128,7 @@ namespace OpenSim.Framework
128 get { return m_regionFlags; } 128 get { return m_regionFlags; }
129 set 129 set
130 { 130 {
131 //m_regionFlags = (Simulator.RegionFlags)0x400000;
131 m_regionFlags = value; 132 m_regionFlags = value;
132 configMember.forceSetConfigurationOption("region_flags", ((uint)m_regionFlags).ToString()); 133 configMember.forceSetConfigurationOption("region_flags", ((uint)m_regionFlags).ToString());
133 } 134 }
@@ -784,7 +785,7 @@ namespace OpenSim.Framework
784 configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty, 785 configMember.addConfigurationOption("redirect_grid_y", ConfigurationOption.ConfigurationTypes.TYPE_INT32, String.Empty,
785 "0", true); 786 "0", true);
786 configMember.addConfigurationOption("region_flags", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty, 787 configMember.addConfigurationOption("region_flags", ConfigurationOption.ConfigurationTypes.TYPE_UINT32, String.Empty,
787 "0", true); 788 "4194304", true); //The String value of RegionFlags.RestrictPushObject
788 configMember.addConfigurationOption("sim_access", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "21", 789 configMember.addConfigurationOption("sim_access", ConfigurationOption.ConfigurationTypes.TYPE_BYTE, String.Empty, "21",
789 true); 790 true);
790 configMember.addConfigurationOption("sun_hour", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "0", 791 configMember.addConfigurationOption("sun_hour", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, String.Empty, "0",
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index c0f7fce..75e6fcd 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -260,6 +260,9 @@ namespace OpenSim.Framework
260 public delegate void TeleportLocationRequest( 260 public delegate void TeleportLocationRequest(
261 IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); 261 IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags);
262 262
263 public delegate void TeleportLandmarkRequest(
264 IClientAPI remoteClient, ulong regionHandle, LLVector3 position);
265
263 public delegate void DisconnectUser(); 266 public delegate void DisconnectUser();
264 267
265 public delegate void RequestAvatarProperties(IClientAPI remoteClient, LLUUID avatarID); 268 public delegate void RequestAvatarProperties(IClientAPI remoteClient, LLUUID avatarID);
@@ -458,6 +461,7 @@ namespace OpenSim.Framework
458 event DisconnectUser OnDisconnectUser; 461 event DisconnectUser OnDisconnectUser;
459 event RequestAvatarProperties OnRequestAvatarProperties; 462 event RequestAvatarProperties OnRequestAvatarProperties;
460 event SetAlwaysRun OnSetAlwaysRun; 463 event SetAlwaysRun OnSetAlwaysRun;
464 event TeleportLandmarkRequest OnTeleportLandmarkRequest;
461 event GenericCall4 OnDeRezObject; 465 event GenericCall4 OnDeRezObject;
462 event Action<IClientAPI> OnRegionHandShakeReply; 466 event Action<IClientAPI> OnRegionHandShakeReply;
463 event GenericCall2 OnRequestWearables; 467 event GenericCall2 OnRequestWearables;
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index dba5b38..9c56c52 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -154,6 +154,7 @@ namespace OpenSim.Region.ClientStack
154 private FetchInventory handlerAgentDataUpdateRequest = null; //OnAgentDataUpdateRequest; 154 private FetchInventory handlerAgentDataUpdateRequest = null; //OnAgentDataUpdateRequest;
155 private FetchInventory handlerUserInfoRequest = null; //OnUserInfoRequest; 155 private FetchInventory handlerUserInfoRequest = null; //OnUserInfoRequest;
156 private TeleportLocationRequest handlerSetStartLocationRequest = null; //OnSetStartLocationRequest; 156 private TeleportLocationRequest handlerSetStartLocationRequest = null; //OnSetStartLocationRequest;
157 private TeleportLandmarkRequest handlerTeleportLandmarkRequest = null; //OnTeleportLandmarkRequest;
157 private LinkObjects handlerLinkObjects = null; //OnLinkObjects; 158 private LinkObjects handlerLinkObjects = null; //OnLinkObjects;
158 private DelinkObjects handlerDelinkObjects = null; //OnDelinkObjects; 159 private DelinkObjects handlerDelinkObjects = null; //OnDelinkObjects;
159 private AddNewPrim handlerAddPrim = null; //OnAddPrim; 160 private AddNewPrim handlerAddPrim = null; //OnAddPrim;
@@ -716,6 +717,7 @@ namespace OpenSim.Region.ClientStack
716 public event RequestMapBlocks OnRequestMapBlocks; 717 public event RequestMapBlocks OnRequestMapBlocks;
717 public event RequestMapName OnMapNameRequest; 718 public event RequestMapName OnMapNameRequest;
718 public event TeleportLocationRequest OnTeleportLocationRequest; 719 public event TeleportLocationRequest OnTeleportLocationRequest;
720 public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
719 public event DisconnectUser OnDisconnectUser; 721 public event DisconnectUser OnDisconnectUser;
720 public event RequestAvatarProperties OnRequestAvatarProperties; 722 public event RequestAvatarProperties OnRequestAvatarProperties;
721 public event SetAlwaysRun OnSetAlwaysRun; 723 public event SetAlwaysRun OnSetAlwaysRun;
@@ -4185,50 +4187,35 @@ namespace OpenSim.Region.ClientStack
4185 break; 4187 break;
4186 case PacketType.TeleportLandmarkRequest: 4188 case PacketType.TeleportLandmarkRequest:
4187 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; 4189 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack;
4188
4189 TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart);
4190 tpStart.Info.TeleportFlags = 8; // tp via lm
4191 OutPacket(tpStart, ThrottleOutPacketType.Task);
4192
4193 TeleportProgressPacket tpProgress = (TeleportProgressPacket)PacketPool.Instance.GetPacket(PacketType.TeleportProgress);
4194 tpProgress.Info.Message = (new UTF8Encoding()).GetBytes("sending_landmark");
4195 tpProgress.Info.TeleportFlags = 8;
4196 tpProgress.AgentData.AgentID = tpReq.Info.AgentID;
4197 OutPacket(tpProgress, ThrottleOutPacketType.Task);
4198
4199 // Fetch landmark
4200 LLUUID lmid = tpReq.Info.LandmarkID; 4190 LLUUID lmid = tpReq.Info.LandmarkID;
4201 AssetBase lma = m_assetCache.GetAsset(lmid, false); 4191 AssetBase lma = m_assetCache.GetAsset(lmid, false);
4202 if (lma != null) 4192
4193 if(lma == null)
4203 { 4194 {
4204 AssetLandmark lm = new AssetLandmark(lma); 4195 // Failed to find landmark
4205 4196
4206 if (lm.RegionID == m_scene.RegionInfo.RegionID) 4197 TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel);
4207 { 4198 tpCancel.Info.SessionID = tpReq.Info.SessionID;
4208 TeleportLocalPacket tpLocal = (TeleportLocalPacket)PacketPool.Instance.GetPacket(PacketType.TeleportLocal); 4199 tpCancel.Info.AgentID = tpReq.Info.AgentID;
4200 OutPacket(tpCancel, ThrottleOutPacketType.Task);
4201 }
4209 4202
4210 tpLocal.Info.AgentID = tpReq.Info.AgentID; 4203 AssetLandmark lm = new AssetLandmark(lma);
4211 tpLocal.Info.TeleportFlags = 8; // Teleport via landmark 4204 handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest;
4212 tpLocal.Info.LocationID = 2; 4205 if (handlerTeleportLandmarkRequest != null)
4213 tpLocal.Info.Position = lm.Position; 4206 {
4214 OutPacket(tpLocal, ThrottleOutPacketType.Task); 4207 handlerTeleportLandmarkRequest(this, lm.RegionHandle, lm.Position);
4215 }
4216 else
4217 {
4218 TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel);
4219 tpCancel.Info.AgentID = tpReq.Info.AgentID;
4220 tpCancel.Info.SessionID = tpReq.Info.SessionID;
4221 OutPacket(tpCancel, ThrottleOutPacketType.Task);
4222 }
4223 } 4208 }
4224 else 4209 else
4225 { 4210 {
4226 Console.WriteLine("Cancelling Teleport - fetch asset not yet implemented"); 4211 //no event handler so cancel request
4212
4227 4213
4228 TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); 4214 TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel);
4229 tpCancel.Info.AgentID = tpReq.Info.AgentID; 4215 tpCancel.Info.AgentID = tpReq.Info.AgentID;
4230 tpCancel.Info.SessionID = tpReq.Info.SessionID; 4216 tpCancel.Info.SessionID = tpReq.Info.SessionID;
4231 OutPacket(tpCancel, ThrottleOutPacketType.Task); 4217 OutPacket(tpCancel, ThrottleOutPacketType.Task);
4218
4232 } 4219 }
4233 break; 4220 break;
4234 case PacketType.TeleportLocationRequest: 4221 case PacketType.TeleportLocationRequest:
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 97d09aa..ff0f3a7 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -545,7 +545,20 @@ namespace OpenSim.Region.Environment.Scenes
545 545
546 if (userInfo != null) 546 if (userInfo != null)
547 { 547 {
548 AssetBase asset = CreateAsset(name, description, invType, assetType, null); 548 ScenePresence presence;
549 TryGetAvatar(remoteClient.AgentId, out presence);
550 byte[] data = null;
551 if(invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum
552 {
553 LLVector3 pos=presence.AbsolutePosition;
554 string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n",
555 presence.Scene.RegionInfo.RegionID,
556 pos.X, pos.Y, pos.Z,
557 presence.RegionHandle);
558 data=Encoding.ASCII.GetBytes(strdata);
559 }
560
561 AssetBase asset = CreateAsset(name, description, invType, assetType, data);
549 AssetCache.AddAsset(asset); 562 AssetCache.AddAsset(asset);
550 563
551 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask); 564 CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask);
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 464926d..08cf3d8 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1518,6 +1518,7 @@ namespace OpenSim.Region.Environment.Scenes
1518 client.OnRequestMapBlocks += RequestMapBlocks; 1518 client.OnRequestMapBlocks += RequestMapBlocks;
1519 client.OnUpdatePrimTexture += m_innerScene.UpdatePrimTexture; 1519 client.OnUpdatePrimTexture += m_innerScene.UpdatePrimTexture;
1520 client.OnTeleportLocationRequest += RequestTeleportLocation; 1520 client.OnTeleportLocationRequest += RequestTeleportLocation;
1521 client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
1521 client.OnObjectSelect += SelectPrim; 1522 client.OnObjectSelect += SelectPrim;
1522 client.OnObjectDeselect += DeselectPrim; 1523 client.OnObjectDeselect += DeselectPrim;
1523 client.OnGrabUpdate += m_innerScene.MoveObject; 1524 client.OnGrabUpdate += m_innerScene.MoveObject;
@@ -2082,6 +2083,21 @@ namespace OpenSim.Region.Environment.Scenes
2082 } 2083 }
2083 2084
2084 /// <summary> 2085 /// <summary>
2086 /// Tries to teleport agent to landmark.
2087 /// </summary>
2088 /// <param name="remoteClient"></param>
2089 /// <param name="regionHandle"></param>
2090 /// <param name="position"></param>
2091 public void RequestTeleportLandmark(IClientAPI remoteClient, ulong regionHandle, LLVector3 position)
2092 {
2093 if (m_scenePresences.ContainsKey(remoteClient.AgentId))
2094 {
2095 m_sceneGridService.RequestTeleportToLocation(m_scenePresences[remoteClient.AgentId], regionHandle,
2096 position, LLVector3.Zero, 0);
2097 }
2098 }
2099
2100 /// <summary>
2085 /// Agent is crossing the border into a neighbouring region. Tell the neighbour about it! 2101 /// Agent is crossing the border into a neighbouring region. Tell the neighbour about it!
2086 /// </summary> 2102 /// </summary>
2087 /// <param name="regionHandle"></param> 2103 /// <param name="regionHandle"></param>
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 795224e..8b8373d 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -270,6 +270,7 @@ namespace OpenSim.Region.Environment.Scenes
270 } 270 }
271 271
272 m_pos = value; 272 m_pos = value;
273 m_parentPosition=new LLVector3(0, 0, 0);
273 } 274 }
274 } 275 }
275 276
@@ -602,7 +603,10 @@ namespace OpenSim.Region.Environment.Scenes
602 /// <param name="pos"></param> 603 /// <param name="pos"></param>
603 public void Teleport(LLVector3 pos) 604 public void Teleport(LLVector3 pos)
604 { 605 {
606 RemoveFromPhysicalScene();
607 Velocity = new LLVector3(0, 0, 0);
605 AbsolutePosition = pos; 608 AbsolutePosition = pos;
609 AddToPhysicalScene();
606 SendTerseUpdateToAllClients(); 610 SendTerseUpdateToAllClients();
607 } 611 }
608 612
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index d5dc937..426ab7e 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -68,6 +68,7 @@ namespace OpenSim.Region.Examples.SimpleModule
68 public event RequestMapBlocks OnRequestMapBlocks; 68 public event RequestMapBlocks OnRequestMapBlocks;
69 public event RequestMapName OnMapNameRequest; 69 public event RequestMapName OnMapNameRequest;
70 public event TeleportLocationRequest OnTeleportLocationRequest; 70 public event TeleportLocationRequest OnTeleportLocationRequest;
71 public event TeleportLandmarkRequest OnTeleportLandmarkRequest;
71 public event DisconnectUser OnDisconnectUser; 72 public event DisconnectUser OnDisconnectUser;
72 public event RequestAvatarProperties OnRequestAvatarProperties; 73 public event RequestAvatarProperties OnRequestAvatarProperties;
73 public event SetAlwaysRun OnSetAlwaysRun; 74 public event SetAlwaysRun OnSetAlwaysRun;