* Applying melanie's Landmark patch. Thanks Melanie!

* To make a landmark, you currently have to enable admin options in the advanced menu first.  We're working on this..   however use the admin options solution in the mean time.
This commit is contained in:
Teravus Ovares
2008-04-16 14:10:54 +00:00
parent 1eb0fedd93
commit 7c1f17b994
8 changed files with 62 additions and 34 deletions

View File

@@ -545,7 +545,20 @@ namespace OpenSim.Region.Environment.Scenes
if (userInfo != null)
{
AssetBase asset = CreateAsset(name, description, invType, assetType, null);
ScenePresence presence;
TryGetAvatar(remoteClient.AgentId, out presence);
byte[] data = null;
if(invType == 3 && presence != null) // libsecondlife.asset.assettype.landmark = 3 - needs to be turned into an enum
{
LLVector3 pos=presence.AbsolutePosition;
string strdata=String.Format("Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\n",
presence.Scene.RegionInfo.RegionID,
pos.X, pos.Y, pos.Z,
presence.RegionHandle);
data=Encoding.ASCII.GetBytes(strdata);
}
AssetBase asset = CreateAsset(name, description, invType, assetType, data);
AssetCache.AddAsset(asset);
CreateNewInventoryItem(remoteClient, folderID, callbackID, asset, nextOwnerMask);

View File

@@ -1518,6 +1518,7 @@ namespace OpenSim.Region.Environment.Scenes
client.OnRequestMapBlocks += RequestMapBlocks;
client.OnUpdatePrimTexture += m_innerScene.UpdatePrimTexture;
client.OnTeleportLocationRequest += RequestTeleportLocation;
client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
client.OnObjectSelect += SelectPrim;
client.OnObjectDeselect += DeselectPrim;
client.OnGrabUpdate += m_innerScene.MoveObject;
@@ -2081,6 +2082,21 @@ namespace OpenSim.Region.Environment.Scenes
}
}
/// <summary>
/// Tries to teleport agent to landmark.
/// </summary>
/// <param name="remoteClient"></param>
/// <param name="regionHandle"></param>
/// <param name="position"></param>
public void RequestTeleportLandmark(IClientAPI remoteClient, ulong regionHandle, LLVector3 position)
{
if (m_scenePresences.ContainsKey(remoteClient.AgentId))
{
m_sceneGridService.RequestTeleportToLocation(m_scenePresences[remoteClient.AgentId], regionHandle,
position, LLVector3.Zero, 0);
}
}
/// <summary>
/// Agent is crossing the border into a neighbouring region. Tell the neighbour about it!
/// </summary>

View File

@@ -270,6 +270,7 @@ namespace OpenSim.Region.Environment.Scenes
}
m_pos = value;
m_parentPosition=new LLVector3(0, 0, 0);
}
}
@@ -602,7 +603,10 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="pos"></param>
public void Teleport(LLVector3 pos)
{
RemoveFromPhysicalScene();
Velocity = new LLVector3(0, 0, 0);
AbsolutePosition = pos;
AddToPhysicalScene();
SendTerseUpdateToAllClients();
}