mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Telehub Support:
Telehub settings now persist to the database and are saved across sim restarts. So-far this only works on MySQL. this is a work in progress, teleport routing is not yet implemented.
This commit is contained in:
@@ -373,5 +373,155 @@ namespace OpenSim.Framework
|
||||
|
||||
return l_EstateAccess.Contains(user);
|
||||
}
|
||||
|
||||
// Telehub support
|
||||
private bool m_TelehubEnabled = false;
|
||||
public bool HasTelehub
|
||||
{
|
||||
get { return m_TelehubEnabled; }
|
||||
set { m_TelehubEnabled = value; }
|
||||
}
|
||||
|
||||
// Connected Telehub object
|
||||
private UUID m_TelehubObject;
|
||||
public UUID TelehubObject
|
||||
{
|
||||
get
|
||||
{
|
||||
if (HasTelehub)
|
||||
{
|
||||
return m_TelehubObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
return UUID.Zero;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
m_TelehubObject = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Connected Telehub name
|
||||
private string m_TelehubName;
|
||||
public string TelehubName
|
||||
{
|
||||
get
|
||||
{
|
||||
if (HasTelehub)
|
||||
{
|
||||
return m_TelehubName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return String.Empty;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
m_TelehubName = value;
|
||||
}
|
||||
}
|
||||
|
||||
// Connected Telehub position
|
||||
private float m_TelehubPosX;
|
||||
private float m_TelehubPosY;
|
||||
private float m_TelehubPosZ;
|
||||
public Vector3 TelehubPos
|
||||
{
|
||||
get
|
||||
{
|
||||
if (HasTelehub)
|
||||
{
|
||||
Vector3 Pos = new Vector3(m_TelehubPosX, m_TelehubPosY, m_TelehubPosZ);
|
||||
return Pos;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Vector3.Zero;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
m_TelehubPosX = value.X;
|
||||
m_TelehubPosY = value.Y;
|
||||
m_TelehubPosZ = value.Z;
|
||||
}
|
||||
}
|
||||
|
||||
// Connected Telehub rotation
|
||||
private float m_TelehubRotX;
|
||||
private float m_TelehubRotY;
|
||||
private float m_TelehubRotZ;
|
||||
private float m_TelehubRotW;
|
||||
public Quaternion TelehubRot
|
||||
{
|
||||
get
|
||||
{
|
||||
if (HasTelehub)
|
||||
{
|
||||
Quaternion quat = new Quaternion();
|
||||
|
||||
quat.X = m_TelehubRotX;
|
||||
quat.Y = m_TelehubRotY;
|
||||
quat.Z = m_TelehubRotZ;
|
||||
quat.W = m_TelehubRotW;
|
||||
|
||||
return quat;
|
||||
}
|
||||
else
|
||||
{
|
||||
// What else to do??
|
||||
Quaternion quat = new Quaternion();
|
||||
|
||||
quat.X = m_TelehubRotX;
|
||||
quat.X = m_TelehubRotY;
|
||||
quat.X = m_TelehubRotZ;
|
||||
quat.X = m_TelehubRotW;
|
||||
|
||||
return quat;
|
||||
}
|
||||
}
|
||||
set
|
||||
{
|
||||
m_TelehubRotX = value.X;
|
||||
m_TelehubRotY = value.Y;
|
||||
m_TelehubRotZ = value.Z;
|
||||
m_TelehubRotW = value.W;
|
||||
}
|
||||
}
|
||||
|
||||
// Our Connected Telehub's SpawnPoints
|
||||
public List<Vector3> l_SpawnPoints = new List<Vector3>();
|
||||
|
||||
// Add a SpawnPoint
|
||||
// ** These are not region coordinates **
|
||||
// They are relative to the Telehub coordinates
|
||||
//
|
||||
public void AddSpawnPoint(Vector3 point)
|
||||
{
|
||||
l_SpawnPoints.Add(point);
|
||||
}
|
||||
|
||||
// Remove a SpawnPoint
|
||||
public void RemoveSpawnPoint(int point_index)
|
||||
{
|
||||
l_SpawnPoints.RemoveAt(point_index);
|
||||
}
|
||||
|
||||
// Return the List of SpawnPoints
|
||||
public List<Vector3> SpawnPoints()
|
||||
{
|
||||
return l_SpawnPoints;
|
||||
|
||||
}
|
||||
|
||||
// Clear the SpawnPoints List of all entries
|
||||
public void ClearSpawnPoints()
|
||||
{
|
||||
l_SpawnPoints.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user