Merge branch 'master' of /home/opensim/var/repo/opensim
commit
fba802bb03
|
@ -79,14 +79,7 @@ namespace OpenSim.Data.MySQL
|
||||||
{
|
{
|
||||||
ret.PrincipalID = principalID;
|
ret.PrincipalID = principalID;
|
||||||
|
|
||||||
if (m_ColumnNames == null)
|
CheckColumnNames(result);
|
||||||
{
|
|
||||||
m_ColumnNames = new List<string>();
|
|
||||||
|
|
||||||
DataTable schemaTable = result.GetSchemaTable();
|
|
||||||
foreach (DataRow row in schemaTable.Rows)
|
|
||||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (string s in m_ColumnNames)
|
foreach (string s in m_ColumnNames)
|
||||||
{
|
{
|
||||||
|
@ -105,6 +98,20 @@ namespace OpenSim.Data.MySQL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CheckColumnNames(IDataReader result)
|
||||||
|
{
|
||||||
|
if (m_ColumnNames != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
List<string> columnNames = new List<string>();
|
||||||
|
|
||||||
|
DataTable schemaTable = result.GetSchemaTable();
|
||||||
|
foreach (DataRow row in schemaTable.Rows)
|
||||||
|
columnNames.Add(row["ColumnName"].ToString());
|
||||||
|
|
||||||
|
m_ColumnNames = columnNames;
|
||||||
|
}
|
||||||
|
|
||||||
public bool Store(AuthenticationData data)
|
public bool Store(AuthenticationData data)
|
||||||
{
|
{
|
||||||
if (data.Data.ContainsKey("UUID"))
|
if (data.Data.ContainsKey("UUID"))
|
||||||
|
|
|
@ -91,15 +91,17 @@ namespace OpenSim.Data.MySQL
|
||||||
if (m_ColumnNames != null)
|
if (m_ColumnNames != null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_ColumnNames = new List<string>();
|
List<string> columnNames = new List<string>();
|
||||||
|
|
||||||
DataTable schemaTable = reader.GetSchemaTable();
|
DataTable schemaTable = reader.GetSchemaTable();
|
||||||
foreach (DataRow row in schemaTable.Rows)
|
foreach (DataRow row in schemaTable.Rows)
|
||||||
{
|
{
|
||||||
if (row["ColumnName"] != null &&
|
if (row["ColumnName"] != null &&
|
||||||
(!m_Fields.ContainsKey(row["ColumnName"].ToString())))
|
(!m_Fields.ContainsKey(row["ColumnName"].ToString())))
|
||||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
columnNames.Add(row["ColumnName"].ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_ColumnNames = columnNames;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual T[] Get(string field, string key)
|
public virtual T[] Get(string field, string key)
|
||||||
|
|
|
@ -162,17 +162,7 @@ namespace OpenSim.Data.MySQL
|
||||||
ret.sizeX = Convert.ToInt32(result["sizeX"]);
|
ret.sizeX = Convert.ToInt32(result["sizeX"]);
|
||||||
ret.sizeY = Convert.ToInt32(result["sizeY"]);
|
ret.sizeY = Convert.ToInt32(result["sizeY"]);
|
||||||
|
|
||||||
if (m_ColumnNames == null)
|
CheckColumnNames(result);
|
||||||
{
|
|
||||||
m_ColumnNames = new List<string>();
|
|
||||||
|
|
||||||
DataTable schemaTable = result.GetSchemaTable();
|
|
||||||
foreach (DataRow row in schemaTable.Rows)
|
|
||||||
{
|
|
||||||
if (row["ColumnName"] != null)
|
|
||||||
m_ColumnNames.Add(row["ColumnName"].ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (string s in m_ColumnNames)
|
foreach (string s in m_ColumnNames)
|
||||||
{
|
{
|
||||||
|
@ -187,6 +177,10 @@ namespace OpenSim.Data.MySQL
|
||||||
if (s == "locY")
|
if (s == "locY")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
object value = result[s];
|
||||||
|
if (value is DBNull)
|
||||||
|
ret.Data[s] = null;
|
||||||
|
else
|
||||||
ret.Data[s] = result[s].ToString();
|
ret.Data[s] = result[s].ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,6 +192,23 @@ namespace OpenSim.Data.MySQL
|
||||||
return retList;
|
return retList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CheckColumnNames(IDataReader result)
|
||||||
|
{
|
||||||
|
if (m_ColumnNames != null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
List<string> columnNames = new List<string>();
|
||||||
|
|
||||||
|
DataTable schemaTable = result.GetSchemaTable();
|
||||||
|
foreach (DataRow row in schemaTable.Rows)
|
||||||
|
{
|
||||||
|
if (row["ColumnName"] != null)
|
||||||
|
columnNames.Add(row["ColumnName"].ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ColumnNames = columnNames;
|
||||||
|
}
|
||||||
|
|
||||||
public bool Store(RegionData data)
|
public bool Store(RegionData data)
|
||||||
{
|
{
|
||||||
if (data.Data.ContainsKey("uuid"))
|
if (data.Data.ContainsKey("uuid"))
|
||||||
|
|
|
@ -296,6 +296,10 @@ namespace OpenSim.Framework.Console
|
||||||
matches[0].Groups["Category"].Value);
|
matches[0].Groups["Category"].Value);
|
||||||
System.Console.Write("]:");
|
System.Console.Write("]:");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
outText = outText.Trim();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (level == "error")
|
if (level == "error")
|
||||||
|
|
|
@ -143,7 +143,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment: {0}{1}", e.Message, e.StackTrace);
|
UUID agentId = (sp.ControllingClient == null) ? (UUID)null : sp.ControllingClient.AgentId;
|
||||||
|
m_log.ErrorFormat("[ATTACHMENTS MODULE]: Unable to rez attachment with itemID {0}, assetID {1}, point {2} for {3}: {4}\n{5}",
|
||||||
|
attach.ItemID, attach.AssetID, p, agentId, e.Message, e.StackTrace);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -389,7 +391,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
lock (sp.AttachmentsSyncLock)
|
lock (sp.AttachmentsSyncLock)
|
||||||
{
|
{
|
||||||
// Save avatar attachment information
|
// Save avatar attachment information
|
||||||
m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + sp.UUID + ", ItemID: " + itemID);
|
// m_log.Debug("[ATTACHMENTS MODULE]: Detaching from UserID: " + sp.UUID + ", ItemID: " + itemID);
|
||||||
|
|
||||||
bool changed = sp.Appearance.DetachAttachment(itemID);
|
bool changed = sp.Appearance.DetachAttachment(itemID);
|
||||||
if (changed && m_scene.AvatarFactory != null)
|
if (changed && m_scene.AvatarFactory != null)
|
||||||
|
@ -469,9 +471,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
|
|
||||||
if (grp.HasGroupChanged || (saveAllScripted && grp.ContainsScripts()))
|
if (grp.HasGroupChanged || (saveAllScripted && grp.ContainsScripts()))
|
||||||
{
|
{
|
||||||
m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
"[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
|
// "[ATTACHMENTS MODULE]: Updating asset for attachment {0}, attachpoint {1}",
|
||||||
grp.UUID, grp.AttachmentPoint);
|
// grp.UUID, grp.AttachmentPoint);
|
||||||
|
|
||||||
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
|
string sceneObjectXml = SceneObjectSerializer.ToOriginalXmlFormat(grp);
|
||||||
|
|
||||||
|
@ -502,12 +504,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
}
|
}
|
||||||
grp.HasGroupChanged = false; // Prevent it being saved over and over
|
grp.HasGroupChanged = false; // Prevent it being saved over and over
|
||||||
}
|
}
|
||||||
else
|
// else
|
||||||
{
|
// {
|
||||||
m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
"[ATTACHMENTS MODULE]: Don't need to update asset for unchanged attachment {0}, attachpoint {1}",
|
// "[ATTACHMENTS MODULE]: Don't need to update asset for unchanged attachment {0}, attachpoint {1}",
|
||||||
grp.UUID, grp.AttachmentPoint);
|
// grp.UUID, grp.AttachmentPoint);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -889,13 +891,12 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||||
// Calls attach with a Zero position
|
// Calls attach with a Zero position
|
||||||
if (AttachObject(sp, part.ParentGroup, AttachmentPt, false))
|
if (AttachObject(sp, part.ParentGroup, AttachmentPt, false))
|
||||||
{
|
{
|
||||||
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.FromItemID, remoteClient.AgentId);
|
// m_log.Debug(
|
||||||
|
// "[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
|
||||||
|
// + ", AttachmentPoint: " + AttachmentPt);
|
||||||
|
|
||||||
// Save avatar attachment information
|
// Save avatar attachment information
|
||||||
m_log.Debug(
|
m_scene.EventManager.TriggerOnAttach(objectLocalID, part.ParentGroup.FromItemID, remoteClient.AgentId);
|
||||||
"[ATTACHMENTS MODULE]: Saving avatar attachment. AgentID: " + remoteClient.AgentId
|
|
||||||
+ ", AttachmentPoint: " + AttachmentPt);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
// Process the baked texture array
|
// Process the baked texture array
|
||||||
if (textureEntry != null)
|
if (textureEntry != null)
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("[AVFACTORY]: Received texture update for {0} {1}", sp.Name, sp.UUID);
|
// m_log.DebugFormat("[AVFACTORY]: Received texture update for {0} {1}", sp.Name, sp.UUID);
|
||||||
|
|
||||||
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
|
// WriteBakedTexturesReport(sp, m_log.DebugFormat);
|
||||||
|
|
||||||
|
@ -208,7 +208,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
ScenePresence sp = m_scene.GetScenePresence(agentId);
|
ScenePresence sp = m_scene.GetScenePresence(agentId);
|
||||||
if (sp == null)
|
if (sp == null)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId);
|
// This is expected if the user has gone away.
|
||||||
|
// m_log.DebugFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentId);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,10 +249,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
|
|
||||||
if (bakedTextureFace == null)
|
if (bakedTextureFace == null)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat(
|
// This can happen legitimately, since some baked textures might not exist
|
||||||
"[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently",
|
//m_log.WarnFormat(
|
||||||
bakeType, sp.Name, m_scene.RegionInfo.RegionName);
|
// "[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently",
|
||||||
|
// bakeType, sp.Name, m_scene.RegionInfo.RegionName);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +338,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID);
|
// m_log.DebugFormat("[AVFACTORY]: Completed texture check for {0} {1}", sp.Name, sp.UUID);
|
||||||
|
|
||||||
// If we only found default textures, then the appearance is not cached
|
// If we only found default textures, then the appearance is not cached
|
||||||
return (defonly ? false : true);
|
return (defonly ? false : true);
|
||||||
|
@ -417,7 +418,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
|
// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
|
||||||
|
|
||||||
int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType);
|
int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType);
|
||||||
bakedTextures[bakeType] = faceTextures[ftIndex];
|
Primitive.TextureEntryFace texture = faceTextures[ftIndex]; // this will be null if there's no such baked texture
|
||||||
|
bakedTextures[bakeType] = texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bakedTextures;
|
return bakedTextures;
|
||||||
|
@ -482,7 +484,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||||
ScenePresence sp = m_scene.GetScenePresence(agentid);
|
ScenePresence sp = m_scene.GetScenePresence(agentid);
|
||||||
if (sp == null)
|
if (sp == null)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid);
|
// This is expected if the user has gone away.
|
||||||
|
// m_log.DebugFormat("[AVFACTORY]: Agent {0} no longer in the scene", agentid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
set { m_MaxTransferDistance = value; }
|
set { m_MaxTransferDistance = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private int m_levelHGTeleport = 0;
|
|
||||||
|
|
||||||
protected bool m_Enabled = false;
|
protected bool m_Enabled = false;
|
||||||
protected Scene m_aScene;
|
protected Scene m_aScene;
|
||||||
protected List<Scene> m_Scenes = new List<Scene>();
|
protected List<Scene> m_Scenes = new List<Scene>();
|
||||||
|
@ -106,7 +104,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (transferConfig != null)
|
if (transferConfig != null)
|
||||||
{
|
{
|
||||||
MaxTransferDistance = transferConfig.GetInt("max_distance", 4095);
|
MaxTransferDistance = transferConfig.GetInt("max_distance", 4095);
|
||||||
m_levelHGTeleport = transferConfig.GetInt("LevelHGTeleport", 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_agentsInTransit = new List<UUID>();
|
m_agentsInTransit = new List<UUID>();
|
||||||
|
@ -172,13 +169,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
// Reset animations; the viewer does that in teleports.
|
// Reset animations; the viewer does that in teleports.
|
||||||
sp.Animator.ResetAnimations();
|
sp.Animator.ResetAnimations();
|
||||||
|
|
||||||
|
string destinationRegionName = "(not found)";
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (regionHandle == sp.Scene.RegionInfo.RegionHandle)
|
if (regionHandle == sp.Scene.RegionInfo.RegionHandle)
|
||||||
{
|
{
|
||||||
|
destinationRegionName = sp.Scene.RegionInfo.RegionName;
|
||||||
|
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: RequestTeleportToLocation {0} within {1}",
|
"[ENTITY TRANSFER MODULE]: RequestTeleportToLocation for {0} to {1} within existing region {2}",
|
||||||
position, sp.Scene.RegionInfo.RegionName);
|
sp.Name, position, destinationRegionName);
|
||||||
|
|
||||||
// Teleport within the same region
|
// Teleport within the same region
|
||||||
if (IsOutsideRegion(sp.Scene, position) || position.Z < 0)
|
if (IsOutsideRegion(sp.Scene, position) || position.Z < 0)
|
||||||
|
@ -188,6 +189,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
m_log.WarnFormat(
|
m_log.WarnFormat(
|
||||||
"[ENTITY TRANSFER MODULE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
|
"[ENTITY TRANSFER MODULE]: RequestTeleportToLocation() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}",
|
||||||
position, sp.Name, sp.UUID, emergencyPos);
|
position, sp.Name, sp.UUID, emergencyPos);
|
||||||
|
|
||||||
position = emergencyPos;
|
position = emergencyPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,6 +212,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
||||||
|
|
||||||
sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
|
sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags);
|
||||||
|
sp.Velocity = Vector3.Zero;
|
||||||
sp.Teleport(position);
|
sp.Teleport(position);
|
||||||
|
|
||||||
foreach (SceneObjectGroup grp in sp.GetAttachments())
|
foreach (SceneObjectGroup grp in sp.GetAttachments())
|
||||||
|
@ -233,15 +236,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if HyperGrid teleport is allowed, based on user level
|
destinationRegionName = finalDestination.RegionName;
|
||||||
int flags = m_aScene.GridService.GetRegionFlags(sp.Scene.RegionInfo.ScopeID, reg.RegionID);
|
|
||||||
|
|
||||||
if (((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) && (sp.UserLevel < m_levelHGTeleport))
|
|
||||||
{
|
|
||||||
m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Final destination link is non permitted hypergrid region. Unable to teleport agent.");
|
|
||||||
sp.ControllingClient.SendTeleportFailed("HyperGrid teleport not permitted");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
uint curX = 0, curY = 0;
|
uint curX = 0, curY = 0;
|
||||||
Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
|
Utils.LongToUInts(sp.Scene.RegionInfo.RegionHandle, out curX, out curY);
|
||||||
|
@ -307,7 +302,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.WarnFormat("[ENTITY TRANSFER MODULE]: Exception on teleport: {0} {1}", e.Message, e.StackTrace);
|
m_log.ErrorFormat(
|
||||||
|
"[ENTITY TRANSFER MODULE]: Exception on teleport of {0} from {1}@{2} to {3}@{4}: {5}{6}",
|
||||||
|
sp.Name, sp.AbsolutePosition, sp.Scene.RegionInfo.RegionName, position, destinationRegionName,
|
||||||
|
e.Message, e.StackTrace);
|
||||||
|
|
||||||
sp.ControllingClient.SendTeleportFailed("Internal error");
|
sp.ControllingClient.SendTeleportFailed("Internal error");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -402,7 +401,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
bool logout = false;
|
bool logout = false;
|
||||||
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
|
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
|
||||||
{
|
{
|
||||||
sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}",
|
sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}",
|
||||||
reason));
|
reason));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private bool m_Initialized = false;
|
private bool m_Initialized = false;
|
||||||
|
private int m_levelHGTeleport = 0;
|
||||||
|
|
||||||
private GatekeeperServiceConnector m_GatekeeperConnector;
|
private GatekeeperServiceConnector m_GatekeeperConnector;
|
||||||
|
|
||||||
|
@ -68,6 +69,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
string name = moduleConfig.GetString("EntityTransferModule", "");
|
string name = moduleConfig.GetString("EntityTransferModule", "");
|
||||||
if (name == Name)
|
if (name == Name)
|
||||||
{
|
{
|
||||||
|
IConfig transferConfig = source.Configs["EntityTransfer"];
|
||||||
|
if (transferConfig != null)
|
||||||
|
m_levelHGTeleport = transferConfig.GetInt("LevelHGTeleport", 0);
|
||||||
|
|
||||||
InitialiseCommon(source);
|
InitialiseCommon(source);
|
||||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
|
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: {0} enabled.", Name);
|
||||||
}
|
}
|
||||||
|
@ -164,6 +169,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
|
||||||
{
|
{
|
||||||
// this user is going to another grid
|
// this user is going to another grid
|
||||||
|
// check if HyperGrid teleport is allowed, based on user level
|
||||||
|
if (sp.UserLevel < m_levelHGTeleport)
|
||||||
|
{
|
||||||
|
m_log.WarnFormat("[HG ENTITY TRANSFER MODULE]: Unable to HG teleport agent due to insufficient UserLevel.");
|
||||||
|
reason = "HyperGrid teleport not permitted";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (agentCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
if (agentCircuit.ServiceURLs.ContainsKey("HomeURI"))
|
||||||
{
|
{
|
||||||
string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();
|
string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();
|
||||||
|
|
|
@ -225,7 +225,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
int tc = 0;
|
int tc = 0;
|
||||||
double[,] hm = whichScene.Heightmap.GetDoubles();
|
double[,] hm = whichScene.Heightmap.GetDoubles();
|
||||||
tc = Environment.TickCount;
|
tc = Environment.TickCount;
|
||||||
m_log.Info("[MAPTILE]: Generating Maptile Step 2: Object Volume Profile");
|
m_log.Debug("[MAPTILE]: Generating Maptile Step 2: Object Volume Profile");
|
||||||
EntityBase[] objs = whichScene.GetEntities();
|
EntityBase[] objs = whichScene.GetEntities();
|
||||||
Dictionary<uint, DrawStruct> z_sort = new Dictionary<uint, DrawStruct>();
|
Dictionary<uint, DrawStruct> z_sort = new Dictionary<uint, DrawStruct>();
|
||||||
//SortedList<float, RectangleDrawStruct> z_sort = new SortedList<float, RectangleDrawStruct>();
|
//SortedList<float, RectangleDrawStruct> z_sort = new SortedList<float, RectangleDrawStruct>();
|
||||||
|
@ -541,7 +541,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
g.Dispose();
|
g.Dispose();
|
||||||
} // lock entities objs
|
} // lock entities objs
|
||||||
|
|
||||||
m_log.Info("[MAPTILE]: Generating Maptile Step 2: Done in " + (Environment.TickCount - tc) + " ms");
|
m_log.Debug("[MAPTILE]: Generating Maptile Step 2: Done in " + (Environment.TickCount - tc) + " ms");
|
||||||
return mapbmp;
|
return mapbmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
public void TerrainToBitmap(Bitmap mapbmp)
|
public void TerrainToBitmap(Bitmap mapbmp)
|
||||||
{
|
{
|
||||||
int tc = Environment.TickCount;
|
int tc = Environment.TickCount;
|
||||||
m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain");
|
m_log.Debug("[MAPTILE]: Generating Maptile Step 1: Terrain");
|
||||||
|
|
||||||
double[,] hm = m_scene.Heightmap.GetDoubles();
|
double[,] hm = m_scene.Heightmap.GetDoubles();
|
||||||
bool ShadowDebugContinue = true;
|
bool ShadowDebugContinue = true;
|
||||||
|
@ -238,7 +238,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_log.Info("[MAPTILE]: Generating Maptile Step 1: Done in " + (Environment.TickCount - tc) + " ms");
|
m_log.Debug("[MAPTILE]: Generating Maptile Step 1: Done in " + (Environment.TickCount - tc) + " ms");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -278,7 +278,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
public void TerrainToBitmap(Bitmap mapbmp)
|
public void TerrainToBitmap(Bitmap mapbmp)
|
||||||
{
|
{
|
||||||
int tc = Environment.TickCount;
|
int tc = Environment.TickCount;
|
||||||
m_log.Info("[MAPTILE]: Generating Maptile Step 1: Terrain");
|
m_log.Debug("[MAPTILE]: Generating Maptile Step 1: Terrain");
|
||||||
|
|
||||||
// These textures should be in the AssetCache anyway, as every client conneting to this
|
// These textures should be in the AssetCache anyway, as every client conneting to this
|
||||||
// region needs them. Except on start, when the map is recreated (before anyone connected),
|
// region needs them. Except on start, when the map is recreated (before anyone connected),
|
||||||
|
@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_log.Info("[MAPTILE]: Generating Maptile Step 1: Done in " + (Environment.TickCount - tc) + " ms");
|
m_log.Debug("[MAPTILE]: Generating Maptile Step 1: Done in " + (Environment.TickCount - tc) + " ms");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,11 +88,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
|
||||||
if (renderers.Count > 0)
|
if (renderers.Count > 0)
|
||||||
{
|
{
|
||||||
m_primMesher = RenderingLoader.LoadRenderer(renderers[0]);
|
m_primMesher = RenderingLoader.LoadRenderer(renderers[0]);
|
||||||
m_log.Info("[MAPTILE]: Loaded prim mesher " + m_primMesher.ToString());
|
m_log.Debug("[MAPTILE]: Loaded prim mesher " + m_primMesher.ToString());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_log.Info("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled");
|
m_log.Debug("[MAPTILE]: No prim mesher loaded, prim rendering will be disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
m_scene.RegisterModuleInterface<IMapImageGenerator>(this);
|
m_scene.RegisterModuleInterface<IMapImageGenerator>(this);
|
||||||
|
|
|
@ -1988,7 +1988,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (permissionToTake)
|
if (permissionToTake && (action != DeRezAction.Delete || this.m_useTrashOnDelete))
|
||||||
{
|
{
|
||||||
m_asyncSceneObjectDeleter.DeleteToInventory(
|
m_asyncSceneObjectDeleter.DeleteToInventory(
|
||||||
action, destinationID, deleteGroups, remoteClient,
|
action, destinationID, deleteGroups, remoteClient,
|
||||||
|
|
|
@ -103,6 +103,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public bool m_trustBinaries;
|
public bool m_trustBinaries;
|
||||||
public bool m_allowScriptCrossings;
|
public bool m_allowScriptCrossings;
|
||||||
public bool m_useFlySlow;
|
public bool m_useFlySlow;
|
||||||
|
public bool m_useTrashOnDelete = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Temporarily setting to trigger appearance resends at 60 second intervals.
|
/// Temporarily setting to trigger appearance resends at 60 second intervals.
|
||||||
|
@ -709,6 +710,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_clampPrimSize = true;
|
m_clampPrimSize = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_useTrashOnDelete = startupConfig.GetBoolean("UseTrashOnDelete",m_useTrashOnDelete);
|
||||||
m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
|
m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
|
||||||
m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
|
m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
|
||||||
m_dontPersistBefore =
|
m_dontPersistBefore =
|
||||||
|
|
|
@ -1969,6 +1969,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="objectGroup">The group of prims which should be linked to this group</param>
|
/// <param name="objectGroup">The group of prims which should be linked to this group</param>
|
||||||
public void LinkToGroup(SceneObjectGroup objectGroup)
|
public void LinkToGroup(SceneObjectGroup objectGroup)
|
||||||
{
|
{
|
||||||
|
LinkToGroup(objectGroup, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LinkToGroup(SceneObjectGroup objectGroup, bool insert)
|
||||||
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
|
// "[SCENE OBJECT GROUP]: Linking group with root part {0}, {1} to group with root part {2}, {3}",
|
||||||
// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
|
// objectGroup.RootPart.Name, objectGroup.RootPart.UUID, RootPart.Name, RootPart.UUID);
|
||||||
|
@ -1979,6 +1984,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
SceneObjectPart linkPart = objectGroup.m_rootPart;
|
SceneObjectPart linkPart = objectGroup.m_rootPart;
|
||||||
|
|
||||||
|
// physics flags from group to be applied to linked parts
|
||||||
|
bool grpusephys = UsesPhysics;
|
||||||
|
bool grptemporary = IsTemporary;
|
||||||
|
|
||||||
Vector3 oldGroupPosition = linkPart.GroupPosition;
|
Vector3 oldGroupPosition = linkPart.GroupPosition;
|
||||||
Quaternion oldRootRotation = linkPart.RotationOffset;
|
Quaternion oldRootRotation = linkPart.RotationOffset;
|
||||||
|
|
||||||
|
@ -2002,15 +2011,35 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
lock (m_parts.SyncRoot)
|
lock (m_parts.SyncRoot)
|
||||||
{
|
{
|
||||||
int linkNum = PrimCount + 1;
|
int linkNum;
|
||||||
|
if (insert)
|
||||||
|
{
|
||||||
|
linkNum = 2;
|
||||||
|
foreach (SceneObjectPart part in Parts)
|
||||||
|
{
|
||||||
|
if (part.LinkNum > 1)
|
||||||
|
part.LinkNum++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
linkNum = PrimCount + 1;
|
||||||
|
}
|
||||||
|
|
||||||
m_parts.Add(linkPart.UUID, linkPart);
|
m_parts.Add(linkPart.UUID, linkPart);
|
||||||
|
|
||||||
linkPart.SetParent(this);
|
linkPart.SetParent(this);
|
||||||
linkPart.CreateSelected = true;
|
linkPart.CreateSelected = true;
|
||||||
|
|
||||||
|
// let physics know preserve part volume dtc messy since UpdatePrimFlags doesn't look to parent changes for now
|
||||||
|
linkPart.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (linkPart.Flags & PrimFlags.Phantom) != 0), linkPart.VolumeDetectActive);
|
||||||
|
if (linkPart.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
|
||||||
|
{
|
||||||
|
linkPart.PhysActor.link(m_rootPart.PhysActor);
|
||||||
|
this.Scene.PhysicsScene.AddPhysicsActorTaint(linkPart.PhysActor);
|
||||||
|
}
|
||||||
|
|
||||||
linkPart.LinkNum = linkNum++;
|
linkPart.LinkNum = linkNum++;
|
||||||
linkPart.UpdatePrimFlags(UsesPhysics, IsTemporary, IsPhantom, IsVolumeDetect);
|
|
||||||
|
|
||||||
SceneObjectPart[] ogParts = objectGroup.Parts;
|
SceneObjectPart[] ogParts = objectGroup.Parts;
|
||||||
Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
|
Array.Sort(ogParts, delegate(SceneObjectPart a, SceneObjectPart b)
|
||||||
|
@ -2022,7 +2051,16 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
SceneObjectPart part = ogParts[i];
|
SceneObjectPart part = ogParts[i];
|
||||||
if (part.UUID != objectGroup.m_rootPart.UUID)
|
if (part.UUID != objectGroup.m_rootPart.UUID)
|
||||||
|
{
|
||||||
LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
|
LinkNonRootPart(part, oldGroupPosition, oldRootRotation, linkNum++);
|
||||||
|
// let physics know
|
||||||
|
part.UpdatePrimFlags(grpusephys, grptemporary, (IsPhantom || (part.Flags & PrimFlags.Phantom) != 0), part.VolumeDetectActive);
|
||||||
|
if (part.PhysActor != null && m_rootPart.PhysActor != null && m_rootPart.PhysActor.IsPhysical)
|
||||||
|
{
|
||||||
|
part.PhysActor.link(m_rootPart.PhysActor);
|
||||||
|
this.Scene.PhysicsScene.AddPhysicsActorTaint(part.PhysActor);
|
||||||
|
}
|
||||||
|
}
|
||||||
part.ClearUndoState();
|
part.ClearUndoState();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -990,23 +990,24 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="pos"></param>
|
/// <param name="pos"></param>
|
||||||
public void Teleport(Vector3 pos)
|
public void Teleport(Vector3 pos)
|
||||||
{
|
{
|
||||||
bool isFlying = Flying;
|
TeleportWithMomentum(pos, null);
|
||||||
RemoveFromPhysicalScene();
|
|
||||||
Velocity = Vector3.Zero;
|
|
||||||
CheckLandingPoint(ref pos);
|
|
||||||
AbsolutePosition = pos;
|
|
||||||
AddToPhysicalScene(isFlying);
|
|
||||||
|
|
||||||
SendTerseUpdateToAllClients();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TeleportWithMomentum(Vector3 pos)
|
public void TeleportWithMomentum(Vector3 pos, Vector3? v)
|
||||||
{
|
{
|
||||||
bool isFlying = Flying;
|
bool isFlying = Flying;
|
||||||
|
Vector3 vel = Velocity;
|
||||||
RemoveFromPhysicalScene();
|
RemoveFromPhysicalScene();
|
||||||
CheckLandingPoint(ref pos);
|
CheckLandingPoint(ref pos);
|
||||||
AbsolutePosition = pos;
|
AbsolutePosition = pos;
|
||||||
AddToPhysicalScene(isFlying);
|
AddToPhysicalScene(isFlying);
|
||||||
|
if (PhysicsActor != null)
|
||||||
|
{
|
||||||
|
if (v.HasValue)
|
||||||
|
PhysicsActor.SetMomentum((Vector3)v);
|
||||||
|
else
|
||||||
|
PhysicsActor.SetMomentum(vel);
|
||||||
|
}
|
||||||
|
|
||||||
SendTerseUpdateToAllClients();
|
SendTerseUpdateToAllClients();
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ using OpenMetaverse;
|
||||||
using OpenSim.Framework;
|
using OpenSim.Framework;
|
||||||
using OpenSim.Framework.Communications;
|
using OpenSim.Framework.Communications;
|
||||||
using OpenSim.Framework.Servers;
|
using OpenSim.Framework.Servers;
|
||||||
|
using OpenSim.Region.CoreModules.Framework.EntityTransfer;
|
||||||
using OpenSim.Region.Framework.Interfaces;
|
using OpenSim.Region.Framework.Interfaces;
|
||||||
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
|
using OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation;
|
||||||
using OpenSim.Tests.Common;
|
using OpenSim.Tests.Common;
|
||||||
|
@ -47,6 +48,41 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
[TestFixture]
|
[TestFixture]
|
||||||
public class ScenePresenceTeleportTests
|
public class ScenePresenceTeleportTests
|
||||||
{
|
{
|
||||||
|
[Test]
|
||||||
|
public void TestSameRegionTeleport()
|
||||||
|
{
|
||||||
|
TestHelpers.InMethod();
|
||||||
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
|
EntityTransferModule etm = new EntityTransferModule();
|
||||||
|
|
||||||
|
IConfigSource config = new IniConfigSource();
|
||||||
|
config.AddConfig("Modules");
|
||||||
|
// Not strictly necessary since FriendsModule assumes it is the default (!)
|
||||||
|
config.Configs["Modules"].Set("EntityTransferModule", etm.Name);
|
||||||
|
|
||||||
|
TestScene scene = SceneHelpers.SetupScene("sceneA", TestHelpers.ParseTail(0x100), 1000, 1000);
|
||||||
|
SceneHelpers.SetupSceneModules(scene, config, etm);
|
||||||
|
|
||||||
|
Vector3 teleportPosition = new Vector3(10, 11, 12);
|
||||||
|
Vector3 teleportLookAt = new Vector3(20, 21, 22);
|
||||||
|
|
||||||
|
ScenePresence sp = SceneHelpers.AddScenePresence(scene, TestHelpers.ParseTail(0x1));
|
||||||
|
sp.AbsolutePosition = new Vector3(30, 31, 32);
|
||||||
|
scene.RequestTeleportLocation(
|
||||||
|
sp.ControllingClient,
|
||||||
|
scene.RegionInfo.RegionHandle,
|
||||||
|
teleportPosition,
|
||||||
|
teleportLookAt,
|
||||||
|
(uint)TeleportFlags.ViaLocation);
|
||||||
|
|
||||||
|
Assert.That(sp.AbsolutePosition, Is.EqualTo(teleportPosition));
|
||||||
|
|
||||||
|
// Lookat is sent to the client only - sp.Lookat does not yield the same thing (calculation from camera
|
||||||
|
// position instead).
|
||||||
|
// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
|
/// Test a teleport between two regions that are not neighbours and do not share any neighbours in common.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -58,6 +58,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
|
||||||
private Scene m_scene;
|
private Scene m_scene;
|
||||||
private IFriendsModule m_friendsModule;
|
private IFriendsModule m_friendsModule;
|
||||||
private IUserManagement m_userManagementModule;
|
private IUserManagement m_userManagementModule;
|
||||||
|
private IPresenceService m_presenceService;
|
||||||
|
|
||||||
// private IAvatarFactoryModule m_avatarFactory;
|
// private IAvatarFactoryModule m_avatarFactory;
|
||||||
|
|
||||||
|
@ -99,8 +100,9 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
|
||||||
|
|
||||||
m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
m_friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
|
||||||
m_userManagementModule = m_scene.RequestModuleInterface<IUserManagement>();
|
m_userManagementModule = m_scene.RequestModuleInterface<IUserManagement>();
|
||||||
|
m_presenceService = m_scene.RequestModuleInterface<IPresenceService>();
|
||||||
|
|
||||||
if (m_friendsModule != null && m_userManagementModule != null)
|
if (m_friendsModule != null && m_userManagementModule != null && m_presenceService != null)
|
||||||
{
|
{
|
||||||
m_scene.AddCommand(
|
m_scene.AddCommand(
|
||||||
"Friends", this, "friends show",
|
"Friends", this, "friends show",
|
||||||
|
@ -162,7 +164,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
|
||||||
|
|
||||||
MainConsole.Instance.OutputFormat("Friends for {0} {1} {2}:", firstName, lastName, userId);
|
MainConsole.Instance.OutputFormat("Friends for {0} {1} {2}:", firstName, lastName, userId);
|
||||||
|
|
||||||
MainConsole.Instance.OutputFormat("UUID, Name, MyFlags, TheirFlags");
|
MainConsole.Instance.OutputFormat(
|
||||||
|
"{0,-36} {1,-36} {2,-7} {3,7} {4,10}", "UUID", "Name", "Status", "MyFlags", "TheirFlags");
|
||||||
|
|
||||||
foreach (FriendInfo friend in friends)
|
foreach (FriendInfo friend in friends)
|
||||||
{
|
{
|
||||||
|
@ -175,14 +178,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Friends
|
||||||
|
|
||||||
UUID friendId;
|
UUID friendId;
|
||||||
string friendName;
|
string friendName;
|
||||||
|
string onlineText;
|
||||||
|
|
||||||
if (UUID.TryParse(friend.Friend, out friendId))
|
if (UUID.TryParse(friend.Friend, out friendId))
|
||||||
friendName = m_userManagementModule.GetUserName(friendId);
|
friendName = m_userManagementModule.GetUserName(friendId);
|
||||||
else
|
else
|
||||||
friendName = friend.Friend;
|
friendName = friend.Friend;
|
||||||
|
|
||||||
|
OpenSim.Services.Interfaces.PresenceInfo[] pi = m_presenceService.GetAgents(new string[] { friend.Friend });
|
||||||
|
if (pi.Length > 0)
|
||||||
|
onlineText = "online";
|
||||||
|
else
|
||||||
|
onlineText = "offline";
|
||||||
|
|
||||||
MainConsole.Instance.OutputFormat(
|
MainConsole.Instance.OutputFormat(
|
||||||
"{0} {1} {2} {3}", friend.Friend, friendName, friend.MyFlags, friend.TheirFlags);
|
"{0,-36} {1,-36} {2,-7} {3,-7} {4,-10}",
|
||||||
|
friend.Friend, friendName, onlineText, friend.MyFlags, friend.TheirFlags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,6 +163,8 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
m_comms.RegisterScriptInvocation(this,"JsonCreateStore");
|
m_comms.RegisterScriptInvocation(this,"JsonCreateStore");
|
||||||
m_comms.RegisterScriptInvocation(this,"JsonDestroyStore");
|
m_comms.RegisterScriptInvocation(this,"JsonDestroyStore");
|
||||||
|
|
||||||
|
@ -186,6 +188,13 @@ namespace OpenSim.Region.OptionalModules.Scripting.JsonStore
|
||||||
|
|
||||||
m_comms.RegisterScriptInvocation(this,"JsonRemoveValue");
|
m_comms.RegisterScriptInvocation(this,"JsonRemoveValue");
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
// See http://opensimulator.org/mantis/view.php?id=5971 for more information
|
||||||
|
m_log.WarnFormat("[JsonStroreScripts] script method registration failed; {0}",e.Message);
|
||||||
|
m_enabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// -----------------------------------------------------------------
|
/// -----------------------------------------------------------------
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.Minimodule
|
||||||
public Vector3 WorldPosition
|
public Vector3 WorldPosition
|
||||||
{
|
{
|
||||||
get { return GetSP().AbsolutePosition; }
|
get { return GetSP().AbsolutePosition; }
|
||||||
set { GetSP().TeleportWithMomentum(value); }
|
set { GetSP().Teleport(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsChildAgent
|
public bool IsChildAgent
|
||||||
|
|
|
@ -157,7 +157,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
|
|
||||||
sp.CompleteMovement(npcAvatar, false);
|
sp.CompleteMovement(npcAvatar, false);
|
||||||
m_avatars.Add(npcAvatar.AgentId, npcAvatar);
|
m_avatars.Add(npcAvatar.AgentId, npcAvatar);
|
||||||
m_log.DebugFormat("[NPC MODULE]: Created NPC with id {0}", npcAvatar.AgentId);
|
m_log.DebugFormat("[NPC MODULE]: Created NPC {0} {1}", npcAvatar.AgentId, sp.Name);
|
||||||
|
|
||||||
return npcAvatar.AgentId;
|
return npcAvatar.AgentId;
|
||||||
}
|
}
|
||||||
|
@ -340,7 +340,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
|
||||||
scene.RemoveClient(agentID, false);
|
scene.RemoveClient(agentID, false);
|
||||||
m_avatars.Remove(agentID);
|
m_avatars.Remove(agentID);
|
||||||
|
|
||||||
// m_log.DebugFormat("[NPC MODULE]: Removed {0} {1}", agentID, av.Name);
|
m_log.DebugFormat("[NPC MODULE]: Removed NPC {0} {1}", agentID, av.Name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -338,6 +338,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
|
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
|
||||||
|
|
||||||
_parent_scene.geom_name_map[prim_geom] = Name;
|
_parent_scene.geom_name_map[prim_geom] = Name;
|
||||||
|
_parent_scene.actor_name_map[prim_geom] = this;
|
||||||
|
|
||||||
if (childPrim)
|
if (childPrim)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,22 +29,21 @@ using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
using log4net;
|
||||||
using OpenSim.Region.ScriptEngine.Interfaces;
|
using OpenSim.Region.ScriptEngine.Interfaces;
|
||||||
|
|
||||||
namespace OpenSim.Region.ScriptEngine.Shared.Api
|
namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
public class ApiManager
|
public class ApiManager
|
||||||
{
|
{
|
||||||
|
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
private Dictionary<string,Type> m_Apis = new Dictionary<string,Type>();
|
private Dictionary<string,Type> m_Apis = new Dictionary<string,Type>();
|
||||||
|
|
||||||
public string[] GetApis()
|
public string[] GetApis()
|
||||||
{
|
{
|
||||||
if (m_Apis.Count > 0)
|
if (m_Apis.Count <= 0)
|
||||||
{
|
{
|
||||||
List<string> l = new List<string>(m_Apis.Keys);
|
|
||||||
return l.ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
Assembly a = Assembly.GetExecutingAssembly();
|
Assembly a = Assembly.GetExecutingAssembly();
|
||||||
|
|
||||||
Type[] types = a.GetExportedTypes();
|
Type[] types = a.GetExportedTypes();
|
||||||
|
@ -62,9 +61,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_Apis[name] = t;
|
m_Apis[name] = t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<string> ret = new List<string>(m_Apis.Keys);
|
// m_log.DebugFormat("[API MANAGER]: Found {0} apis", m_Apis.Keys.Count);
|
||||||
return ret.ToArray();
|
|
||||||
|
return new List<string>(m_Apis.Keys).ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public IScriptApi CreateApi(string api)
|
public IScriptApi CreateApi(string api)
|
||||||
|
|
|
@ -85,7 +85,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
protected IScriptEngine m_ScriptEngine;
|
protected IScriptEngine m_ScriptEngine;
|
||||||
protected SceneObjectPart m_host;
|
protected SceneObjectPart m_host;
|
||||||
protected uint m_localID;
|
protected uint m_localID;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The UUID of the item that hosts this script
|
||||||
|
/// </summary>
|
||||||
protected UUID m_itemID;
|
protected UUID m_itemID;
|
||||||
|
|
||||||
protected bool throwErrorOnNotImplemented = true;
|
protected bool throwErrorOnNotImplemented = true;
|
||||||
protected AsyncCommandManager AsyncCommands = null;
|
protected AsyncCommandManager AsyncCommands = null;
|
||||||
protected float m_ScriptDelayFactor = 1.0f;
|
protected float m_ScriptDelayFactor = 1.0f;
|
||||||
|
@ -267,23 +272,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected UUID InventorySelf()
|
/// <summary>
|
||||||
|
/// Get the inventory item that hosts ourselves.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// FIXME: It would be far easier to pass in TaskInventoryItem rather than just m_itemID so that we don't need
|
||||||
|
/// to keep looking ourselves up.
|
||||||
|
/// </remarks>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected TaskInventoryItem GetSelfInventoryItem()
|
||||||
{
|
{
|
||||||
UUID invItemID = new UUID();
|
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
lock (m_host.TaskInventory)
|
||||||
{
|
return m_host.TaskInventory[m_itemID];
|
||||||
foreach (KeyValuePair<UUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
if (inv.Value.Type == 10 && inv.Value.ItemID == m_itemID)
|
|
||||||
{
|
|
||||||
invItemID = inv.Key;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return invItemID;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected UUID InventoryKey(string name, int type)
|
protected UUID InventoryKey(string name, int type)
|
||||||
|
@ -832,8 +832,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public void llRegionSayTo(string target, int channel, string msg)
|
public void llRegionSayTo(string target, int channel, string msg)
|
||||||
{
|
{
|
||||||
string error = String.Empty;
|
|
||||||
|
|
||||||
if (msg.Length > 1023)
|
if (msg.Length > 1023)
|
||||||
msg = msg.Substring(0, 1023);
|
msg = msg.Substring(0, 1023);
|
||||||
|
|
||||||
|
@ -2701,18 +2699,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public LSL_Integer llGiveMoney(string destination, int amount)
|
public LSL_Integer llGiveMoney(string destination, int amount)
|
||||||
{
|
{
|
||||||
UUID invItemID=InventorySelf();
|
|
||||||
if (invItemID == UUID.Zero)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
TaskInventoryItem item = m_host.TaskInventory[invItemID];
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
item = m_host.TaskInventory[invItemID];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.PermsGranter == UUID.Zero)
|
if (item.PermsGranter == UUID.Zero)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2955,15 +2944,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public void llTakeControls(int controls, int accept, int pass_on)
|
public void llTakeControls(int controls, int accept, int pass_on)
|
||||||
{
|
{
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.PermsGranter != UUID.Zero)
|
if (item.PermsGranter != UUID.Zero)
|
||||||
{
|
{
|
||||||
|
@ -2983,18 +2964,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public void llReleaseControls()
|
public void llReleaseControls()
|
||||||
{
|
{
|
||||||
TaskInventoryItem item;
|
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
if (item.PermsGranter != UUID.Zero)
|
if (item.PermsGranter != UUID.Zero)
|
||||||
{
|
{
|
||||||
ScenePresence presence = World.GetScenePresence(item.PermsGranter);
|
ScenePresence presence = World.GetScenePresence(item.PermsGranter);
|
||||||
|
@ -3019,65 +2992,34 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
m_UrlModule.ReleaseURL(url);
|
m_UrlModule.ReleaseURL(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void llAttachToAvatar(int attachment)
|
/// <summary>
|
||||||
{
|
/// Attach the object containing this script to the avatar that owns it.
|
||||||
m_host.AddScriptLPS(1);
|
/// </summary>
|
||||||
|
/// <param name='attachment'>The attachment point (e.g. ATTACH_CHEST)</param>
|
||||||
// if (m_host.ParentGroup.RootPart.AttachmentPoint == 0)
|
/// <returns>true if the attach suceeded, false if it did not</returns>
|
||||||
// return;
|
public bool AttachToAvatar(int attachmentPoint)
|
||||||
|
|
||||||
TaskInventoryItem item;
|
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.PermsGranter != m_host.OwnerID)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
|
|
||||||
{
|
{
|
||||||
SceneObjectGroup grp = m_host.ParentGroup;
|
SceneObjectGroup grp = m_host.ParentGroup;
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||||
|
|
||||||
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
|
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
|
||||||
|
|
||||||
if (attachmentsModule != null)
|
if (attachmentsModule != null)
|
||||||
attachmentsModule.AttachObject(presence, grp, (uint)attachment, false);
|
return attachmentsModule.AttachObject(presence, grp, (uint)attachmentPoint, false);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void llDetachFromAvatar()
|
|
||||||
{
|
|
||||||
m_host.AddScriptLPS(1);
|
|
||||||
|
|
||||||
if (m_host.ParentGroup.AttachmentPoint == 0)
|
|
||||||
return;
|
|
||||||
|
|
||||||
TaskInventoryItem item;
|
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
|
||||||
return;
|
|
||||||
else
|
else
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.PermsGranter != m_host.OwnerID)
|
/// <summary>
|
||||||
return;
|
/// Detach the object containing this script from the avatar it is attached to.
|
||||||
|
/// </summary>
|
||||||
if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
|
/// <remarks>
|
||||||
|
/// Nothing happens if the object is not attached.
|
||||||
|
/// </remarks>
|
||||||
|
public void DetachFromAvatar()
|
||||||
{
|
{
|
||||||
IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
|
|
||||||
if (attachmentsModule != null)
|
|
||||||
Util.FireAndForget(DetachWrapper, m_host);
|
Util.FireAndForget(DetachWrapper, m_host);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void DetachWrapper(object o)
|
private void DetachWrapper(object o)
|
||||||
{
|
{
|
||||||
|
@ -3092,6 +3034,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
attachmentsModule.DetachSingleAttachmentToInv(presence, itemID);
|
attachmentsModule.DetachSingleAttachmentToInv(presence, itemID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void llAttachToAvatar(int attachmentPoint)
|
||||||
|
{
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
// if (m_host.ParentGroup.RootPart.AttachmentPoint == 0)
|
||||||
|
// return;
|
||||||
|
|
||||||
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
|
if (item.PermsGranter != m_host.OwnerID)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
|
||||||
|
AttachToAvatar(attachmentPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void llDetachFromAvatar()
|
||||||
|
{
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
if (m_host.ParentGroup.AttachmentPoint == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
|
if (item.PermsGranter != m_host.OwnerID)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
|
||||||
|
DetachFromAvatar();
|
||||||
|
}
|
||||||
|
|
||||||
public void llTakeCamera(string avatar)
|
public void llTakeCamera(string avatar)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
@ -3317,19 +3291,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
UUID invItemID = InventorySelf();
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
if (invItemID == UUID.Zero)
|
|
||||||
return;
|
|
||||||
|
|
||||||
TaskInventoryItem item;
|
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.PermsGranter == UUID.Zero)
|
if (item.PermsGranter == UUID.Zero)
|
||||||
return;
|
return;
|
||||||
|
@ -3354,19 +3316,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
UUID invItemID=InventorySelf();
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
if (invItemID == UUID.Zero)
|
|
||||||
return;
|
|
||||||
|
|
||||||
TaskInventoryItem item;
|
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
if (!m_host.TaskInventory.ContainsKey(InventorySelf()))
|
|
||||||
return;
|
|
||||||
else
|
|
||||||
item = m_host.TaskInventory[InventorySelf()];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item.PermsGranter == UUID.Zero)
|
if (item.PermsGranter == UUID.Zero)
|
||||||
return;
|
return;
|
||||||
|
@ -3421,22 +3371,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public void llRequestPermissions(string agent, int perm)
|
public void llRequestPermissions(string agent, int perm)
|
||||||
{
|
{
|
||||||
UUID agentID = new UUID();
|
UUID agentID;
|
||||||
|
|
||||||
if (!UUID.TryParse(agent, out agentID))
|
if (!UUID.TryParse(agent, out agentID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UUID invItemID = InventorySelf();
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
if (invItemID == UUID.Zero)
|
|
||||||
return; // Not in a prim? How??
|
|
||||||
|
|
||||||
TaskInventoryItem item;
|
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
item = m_host.TaskInventory[invItemID];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (agentID == UUID.Zero || perm == 0) // Releasing permissions
|
if (agentID == UUID.Zero || perm == 0) // Releasing permissions
|
||||||
{
|
{
|
||||||
|
@ -3470,8 +3410,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
lock (m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
m_host.TaskInventory[m_itemID].PermsGranter = agentID;
|
||||||
m_host.TaskInventory[invItemID].PermsMask = perm;
|
m_host.TaskInventory[m_itemID].PermsMask = perm;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
||||||
|
@ -3494,8 +3434,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
lock (m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
m_host.TaskInventory[m_itemID].PermsGranter = agentID;
|
||||||
m_host.TaskInventory[invItemID].PermsMask = perm;
|
m_host.TaskInventory[m_itemID].PermsMask = perm;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
||||||
|
@ -3519,8 +3459,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
lock (m_host.TaskInventory)
|
lock (m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
m_host.TaskInventory[invItemID].PermsGranter = agentID;
|
m_host.TaskInventory[m_itemID].PermsGranter = agentID;
|
||||||
m_host.TaskInventory[invItemID].PermsMask = 0;
|
m_host.TaskInventory[m_itemID].PermsMask = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
presence.ControllingClient.OnScriptAnswer += handleScriptAnswer;
|
presence.ControllingClient.OnScriptAnswer += handleScriptAnswer;
|
||||||
|
@ -3528,7 +3468,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
}
|
}
|
||||||
|
|
||||||
presence.ControllingClient.SendScriptQuestion(
|
presence.ControllingClient.SendScriptQuestion(
|
||||||
m_host.UUID, m_host.ParentGroup.RootPart.Name, ownerName, invItemID, perm);
|
m_host.UUID, m_host.ParentGroup.RootPart.Name, ownerName, m_itemID, perm);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -3545,11 +3485,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
if (taskID != m_host.UUID)
|
if (taskID != m_host.UUID)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
UUID invItemID = InventorySelf();
|
|
||||||
|
|
||||||
if (invItemID == UUID.Zero)
|
|
||||||
return;
|
|
||||||
|
|
||||||
client.OnScriptAnswer -= handleScriptAnswer;
|
client.OnScriptAnswer -= handleScriptAnswer;
|
||||||
m_waitingForScriptAnswer = false;
|
m_waitingForScriptAnswer = false;
|
||||||
|
|
||||||
|
@ -3558,7 +3493,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
lock (m_host.TaskInventory)
|
||||||
{
|
{
|
||||||
m_host.TaskInventory[invItemID].PermsMask = answer;
|
m_host.TaskInventory[m_itemID].PermsMask = answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams(
|
||||||
|
@ -3571,39 +3506,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
return GetSelfInventoryItem().PermsGranter.ToString();
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
|
||||||
{
|
|
||||||
if (item.Type == 10 && item.ItemID == m_itemID)
|
|
||||||
{
|
|
||||||
return item.PermsGranter.ToString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return UUID.Zero.ToString();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Integer llGetPermissions()
|
public LSL_Integer llGetPermissions()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
int perms = GetSelfInventoryItem().PermsMask;
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
|
||||||
{
|
|
||||||
if (item.Type == 10 && item.ItemID == m_itemID)
|
|
||||||
{
|
|
||||||
int perms = item.PermsMask;
|
|
||||||
if (m_automaticLinkPermission)
|
if (m_automaticLinkPermission)
|
||||||
perms |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
perms |= ScriptBaseClass.PERMISSION_CHANGE_LINKS;
|
||||||
return perms;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return perms;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Integer llGetLinkNumber()
|
public LSL_Integer llGetLinkNumber()
|
||||||
|
@ -3631,17 +3546,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public void llCreateLink(string target, int parent)
|
public void llCreateLink(string target, int parent)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
UUID invItemID = InventorySelf();
|
|
||||||
UUID targetID;
|
UUID targetID;
|
||||||
|
|
||||||
if (!UUID.TryParse(target, out targetID))
|
if (!UUID.TryParse(target, out targetID))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TaskInventoryItem item;
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
item = m_host.TaskInventory[invItemID];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
if ((item.PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
||||||
&& !m_automaticLinkPermission)
|
&& !m_automaticLinkPermission)
|
||||||
|
@ -3659,11 +3569,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
if (targetPart.ParentGroup.AttachmentPoint != 0)
|
if (targetPart.ParentGroup.AttachmentPoint != 0)
|
||||||
return; // Fail silently if attached
|
return; // Fail silently if attached
|
||||||
|
|
||||||
|
if (targetPart.ParentGroup.RootPart.OwnerID != m_host.ParentGroup.RootPart.OwnerID)
|
||||||
|
return;
|
||||||
|
|
||||||
SceneObjectGroup parentPrim = null, childPrim = null;
|
SceneObjectGroup parentPrim = null, childPrim = null;
|
||||||
|
|
||||||
if (targetPart != null)
|
if (targetPart != null)
|
||||||
{
|
{
|
||||||
if (parent != 0) {
|
if (parent != 0)
|
||||||
|
{
|
||||||
parentPrim = m_host.ParentGroup;
|
parentPrim = m_host.ParentGroup;
|
||||||
childPrim = targetPart.ParentGroup;
|
childPrim = targetPart.ParentGroup;
|
||||||
}
|
}
|
||||||
|
@ -3675,7 +3590,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
// Required for linking
|
// Required for linking
|
||||||
childPrim.RootPart.ClearUpdateSchedule();
|
childPrim.RootPart.ClearUpdateSchedule();
|
||||||
parentPrim.LinkToGroup(childPrim);
|
parentPrim.LinkToGroup(childPrim, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
parentPrim.TriggerScriptChangedEvent(Changed.LINK);
|
parentPrim.TriggerScriptChangedEvent(Changed.LINK);
|
||||||
|
@ -3692,17 +3607,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public void llBreakLink(int linknum)
|
public void llBreakLink(int linknum)
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
UUID invItemID = InventorySelf();
|
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
if ((GetSelfInventoryItem().PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
||||||
{
|
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CHANGE_LINKS) == 0
|
|
||||||
&& !m_automaticLinkPermission)
|
&& !m_automaticLinkPermission)
|
||||||
{
|
{
|
||||||
ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!");
|
ShoutError("Script trying to link but PERMISSION_CHANGE_LINKS permission not set!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (linknum < ScriptBaseClass.LINK_THIS)
|
if (linknum < ScriptBaseClass.LINK_THIS)
|
||||||
return;
|
return;
|
||||||
|
@ -4578,23 +4489,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public LSL_String llGetScriptName()
|
public LSL_String llGetScriptName()
|
||||||
{
|
{
|
||||||
string result = String.Empty;
|
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
{
|
|
||||||
foreach (TaskInventoryItem item in m_host.TaskInventory.Values)
|
|
||||||
{
|
|
||||||
if (item.Type == 10 && item.ItemID == m_itemID)
|
|
||||||
{
|
|
||||||
result = item.Name != null ? item.Name : String.Empty;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
return item.Name != null ? item.Name : String.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LSL_Integer llGetLinkNumberOfSides(int link)
|
public LSL_Integer llGetLinkNumberOfSides(int link)
|
||||||
|
@ -9695,22 +9594,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public LSL_Vector llGetCameraPos()
|
public LSL_Vector llGetCameraPos()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
UUID invItemID = InventorySelf();
|
|
||||||
|
|
||||||
if (invItemID == UUID.Zero)
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
|
if (item.PermsGranter == UUID.Zero)
|
||||||
return new LSL_Vector();
|
return new LSL_Vector();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
if ((item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
||||||
{
|
|
||||||
if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
|
|
||||||
return new LSL_Vector();
|
|
||||||
|
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
|
||||||
{
|
{
|
||||||
ShoutError("No permissions to track the camera");
|
ShoutError("No permissions to track the camera");
|
||||||
return new LSL_Vector();
|
return new LSL_Vector();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
|
@ -9724,21 +9618,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
public LSL_Rotation llGetCameraRot()
|
public LSL_Rotation llGetCameraRot()
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
UUID invItemID = InventorySelf();
|
|
||||||
if (invItemID == UUID.Zero)
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
|
if (item.PermsGranter == UUID.Zero)
|
||||||
return new LSL_Rotation();
|
return new LSL_Rotation();
|
||||||
|
|
||||||
lock (m_host.TaskInventory)
|
if ((item.PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
||||||
{
|
|
||||||
if (m_host.TaskInventory[invItemID].PermsGranter == UUID.Zero)
|
|
||||||
return new LSL_Rotation();
|
|
||||||
|
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_TRACK_CAMERA) == 0)
|
|
||||||
{
|
{
|
||||||
ShoutError("No permissions to track the camera");
|
ShoutError("No permissions to track the camera");
|
||||||
return new LSL_Rotation();
|
return new LSL_Rotation();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
|
||||||
if (presence != null)
|
if (presence != null)
|
||||||
|
@ -9911,23 +9801,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
// our key in the object we are in
|
|
||||||
UUID invItemID = InventorySelf();
|
|
||||||
if (invItemID == UUID.Zero) return;
|
|
||||||
|
|
||||||
// the object we are in
|
// the object we are in
|
||||||
UUID objectID = m_host.ParentUUID;
|
UUID objectID = m_host.ParentUUID;
|
||||||
if (objectID == UUID.Zero) return;
|
if (objectID == UUID.Zero)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
UUID agentID;
|
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
|
||||||
// we need the permission first, to know which avatar we want to set the camera for
|
// we need the permission first, to know which avatar we want to set the camera for
|
||||||
agentID = m_host.TaskInventory[invItemID].PermsGranter;
|
UUID agentID = item.PermsGranter;
|
||||||
|
|
||||||
if (agentID == UUID.Zero) return;
|
if (agentID == UUID.Zero)
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
|
return;
|
||||||
}
|
|
||||||
|
if ((item.PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(agentID);
|
ScenePresence presence = World.GetScenePresence(agentID);
|
||||||
|
|
||||||
|
@ -9967,27 +9855,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
{
|
{
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
// our key in the object we are in
|
|
||||||
UUID invItemID=InventorySelf();
|
|
||||||
if (invItemID == UUID.Zero) return;
|
|
||||||
|
|
||||||
// the object we are in
|
// the object we are in
|
||||||
UUID objectID = m_host.ParentUUID;
|
UUID objectID = m_host.ParentUUID;
|
||||||
if (objectID == UUID.Zero) return;
|
if (objectID == UUID.Zero)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TaskInventoryItem item = GetSelfInventoryItem();
|
||||||
|
|
||||||
// we need the permission first, to know which avatar we want to clear the camera for
|
// we need the permission first, to know which avatar we want to clear the camera for
|
||||||
UUID agentID;
|
UUID agentID = item.PermsGranter;
|
||||||
lock (m_host.TaskInventory)
|
|
||||||
{
|
if (agentID == UUID.Zero)
|
||||||
agentID = m_host.TaskInventory[invItemID].PermsGranter;
|
return;
|
||||||
if (agentID == UUID.Zero) return;
|
|
||||||
if ((m_host.TaskInventory[invItemID].PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0) return;
|
if ((item.PermsMask & ScriptBaseClass.PERMISSION_CONTROL_CAMERA) == 0)
|
||||||
}
|
return;
|
||||||
|
|
||||||
ScenePresence presence = World.GetScenePresence(agentID);
|
ScenePresence presence = World.GetScenePresence(agentID);
|
||||||
|
|
||||||
// we are not interested in child-agents
|
// we are not interested in child-agents
|
||||||
if (presence.IsChildAgent) return;
|
if (presence.IsChildAgent)
|
||||||
|
return;
|
||||||
|
|
||||||
presence.ControllingClient.SendClearFollowCamProperties(objectID);
|
presence.ControllingClient.SendClearFollowCamProperties(objectID);
|
||||||
}
|
}
|
||||||
|
|
|
@ -209,6 +209,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
throw new Exception("OSSL Runtime Error: " + msg);
|
throw new Exception("OSSL Runtime Error: " + msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Initialize the LSL interface.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// FIXME: This is an abomination. We should be able to set this up earlier but currently we have no
|
||||||
|
/// guarantee the interface is present on Initialize(). There needs to be another post initialize call from
|
||||||
|
/// ScriptInstance.
|
||||||
|
/// </remarks>
|
||||||
private void InitLSL()
|
private void InitLSL()
|
||||||
{
|
{
|
||||||
if (m_LSL_Api != null)
|
if (m_LSL_Api != null)
|
||||||
|
@ -1609,7 +1617,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
|
|
||||||
public Object osParseJSONNew(string JSON)
|
public Object osParseJSONNew(string JSON)
|
||||||
{
|
{
|
||||||
CheckThreatLevel(ThreatLevel.None, "osParseJSON");
|
CheckThreatLevel(ThreatLevel.None, "osParseJSONNew");
|
||||||
|
|
||||||
m_host.AddScriptLPS(1);
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
@ -3132,5 +3140,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high);
|
estate.setEstateTerrainTextureHeights(corner, (float)low, (float)high);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void osForceAttachToAvatar(int attachmentPoint)
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osForceAttachToAvatar");
|
||||||
|
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
InitLSL();
|
||||||
|
((LSL_Api)m_LSL_Api).AttachToAvatar(attachmentPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osForceDetachFromAvatar()
|
||||||
|
{
|
||||||
|
CheckThreatLevel(ThreatLevel.High, "osForceDetachFromAvatar");
|
||||||
|
|
||||||
|
m_host.AddScriptLPS(1);
|
||||||
|
|
||||||
|
InitLSL();
|
||||||
|
((LSL_Api)m_LSL_Api).DetachFromAvatar();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -98,6 +98,20 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
|
||||||
void osAvatarPlayAnimation(string avatar, string animation);
|
void osAvatarPlayAnimation(string avatar, string animation);
|
||||||
void osAvatarStopAnimation(string avatar, string animation);
|
void osAvatarStopAnimation(string avatar, string animation);
|
||||||
|
|
||||||
|
// Attachment commands
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Attach the object containing this script to the avatar that owns it without checking for PERMISSION_ATTACH
|
||||||
|
/// </summary>
|
||||||
|
/// <param name='attachment'>The attachment point. For example, ATTACH_CHEST</param>
|
||||||
|
void osForceAttachToAvatar(int attachment);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Detach the object containing this script from the avatar it is attached to without checking for PERMISSION_ATTACH
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Nothing happens if the object is not attached.</remarks>
|
||||||
|
void osForceDetachFromAvatar();
|
||||||
|
|
||||||
//texture draw functions
|
//texture draw functions
|
||||||
string osMovePen(string drawList, int x, int y);
|
string osMovePen(string drawList, int x, int y);
|
||||||
string osDrawLine(string drawList, int startX, int startY, int endX, int endY);
|
string osDrawLine(string drawList, int startX, int startY, int endX, int endY);
|
||||||
|
|
|
@ -289,6 +289,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
||||||
m_OSSL_Functions.osAvatarStopAnimation(avatar, animation);
|
m_OSSL_Functions.osAvatarStopAnimation(avatar, animation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Avatar functions
|
||||||
|
|
||||||
|
public void osForceAttachToAvatar(int attachmentPoint)
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osForceAttachToAvatar(attachmentPoint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void osForceDetachFromAvatar()
|
||||||
|
{
|
||||||
|
m_OSSL_Functions.osForceDetachFromAvatar();
|
||||||
|
}
|
||||||
|
|
||||||
// Texture Draw functions
|
// Texture Draw functions
|
||||||
|
|
||||||
|
|
|
@ -964,7 +964,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
public IScriptApi GetApi(string name)
|
public IScriptApi GetApi(string name)
|
||||||
{
|
{
|
||||||
if (m_Apis.ContainsKey(name))
|
if (m_Apis.ContainsKey(name))
|
||||||
|
{
|
||||||
|
// m_log.DebugFormat("[SCRIPT INSTANCE]: Found api {0} in {1}@{2}", name, ScriptName, PrimName);
|
||||||
|
|
||||||
return m_Apis[name];
|
return m_Apis[name];
|
||||||
|
}
|
||||||
|
|
||||||
|
// m_log.DebugFormat("[SCRIPT INSTANCE]: Did not find api {0} in {1}@{2}", name, ScriptName, PrimName);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1812,9 +1812,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
// if there already exists a file at that location, it may be locked.
|
// if there already exists a file at that location, it may be locked.
|
||||||
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message);
|
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string textpath = path + ".text";
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
using (FileStream fs = File.Create(path + ".text"))
|
using (FileStream fs = File.Create(textpath))
|
||||||
{
|
{
|
||||||
using (StreamWriter sw = new StreamWriter(fs))
|
using (StreamWriter sw = new StreamWriter(fs))
|
||||||
{
|
{
|
||||||
|
@ -1827,7 +1829,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
// if there already exists a file at that location, it may be locked.
|
// if there already exists a file at that location, it may be locked.
|
||||||
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", path, ex.Message);
|
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", textpath, ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1876,7 +1878,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
// if there already exists a file at that location, it may be locked.
|
// if there already exists a file at that location, it may be locked.
|
||||||
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", statepath, ex.Message);
|
m_log.ErrorFormat("[XEngine]: File {0} already exists! {1}", mappath, ex.Message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,10 @@ namespace OpenSim.Server.Base
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
if (!(e is System.MissingMethodException))
|
if (!(e is System.MissingMethodException))
|
||||||
m_log.ErrorFormat("Error loading plugin from {0}, exception {1}", dllName, e.InnerException);
|
{
|
||||||
|
m_log.ErrorFormat("Error loading plugin {0} from {1}. Exception: {2}",
|
||||||
|
interfaceName, dllName, e.InnerException == null ? e.Message : e.InnerException.Message);
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ namespace OpenSim.Services.AvatarService
|
||||||
if (kvp.Key.StartsWith("_"))
|
if (kvp.Key.StartsWith("_"))
|
||||||
count++;
|
count++;
|
||||||
|
|
||||||
m_log.DebugFormat("[AVATAR SERVICE]: SetAvatar for {0}, attachs={1}", principalID, count);
|
// m_log.DebugFormat("[AVATAR SERVICE]: SetAvatar for {0}, attachs={1}", principalID, count);
|
||||||
m_Database.Delete("PrincipalID", principalID.ToString());
|
m_Database.Delete("PrincipalID", principalID.ToString());
|
||||||
|
|
||||||
AvatarBaseData av = new AvatarBaseData();
|
AvatarBaseData av = new AvatarBaseData();
|
||||||
|
|
|
@ -349,7 +349,31 @@ namespace OpenSim.Services.LLLoginService
|
||||||
|
|
||||||
private void SetDefaultValues()
|
private void SetDefaultValues()
|
||||||
{
|
{
|
||||||
DST = TimeZone.CurrentTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
|
TimeZoneInfo gridTimeZone;
|
||||||
|
|
||||||
|
// Disabled for now pending making timezone a config value, which can at some point have a default of
|
||||||
|
// a ; separated list of possible timezones.
|
||||||
|
// The problem here is that US/Pacific (or even the Olsen America/Los_Angeles) is not universal across
|
||||||
|
// windows, mac and various distributions of linux, introducing another element of consistency.
|
||||||
|
// The server operator needs to be able to control this setting
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// // First try to fetch DST from Pacific Standard Time, because this is
|
||||||
|
// // the one expected by the viewer. "US/Pacific" is the string to search
|
||||||
|
// // on linux and mac, and should work also on Windows (to confirm)
|
||||||
|
// gridTimeZone = TimeZoneInfo.FindSystemTimeZoneById("US/Pacific");
|
||||||
|
// }
|
||||||
|
// catch (Exception e)
|
||||||
|
// {
|
||||||
|
// m_log.WarnFormat(
|
||||||
|
// "[TIMEZONE]: {0} Falling back to system time. System time should be set to Pacific Standard Time to provide the expected time",
|
||||||
|
// e.Message);
|
||||||
|
|
||||||
|
gridTimeZone = TimeZoneInfo.Local;
|
||||||
|
// }
|
||||||
|
|
||||||
|
DST = gridTimeZone.IsDaylightSavingTime(DateTime.Now) ? "Y" : "N";
|
||||||
|
|
||||||
StipendSinceLogin = "N";
|
StipendSinceLogin = "N";
|
||||||
Gendered = "Y";
|
Gendered = "Y";
|
||||||
EverLoggedIn = "Y";
|
EverLoggedIn = "Y";
|
||||||
|
|
|
@ -337,6 +337,13 @@
|
||||||
; OpenJPEG if false
|
; OpenJPEG if false
|
||||||
; UseCSJ2K = true
|
; UseCSJ2K = true
|
||||||
|
|
||||||
|
|
||||||
|
; Use "Trash" folder for items deleted from the scene
|
||||||
|
; When set to True (the default) items deleted from the scene will be
|
||||||
|
; stored in the user's trash or lost and found folder. When set to
|
||||||
|
; False items will be removed from the scene permanently
|
||||||
|
UseTrashOnDelete = True
|
||||||
|
|
||||||
; Persist avatar baked textures
|
; Persist avatar baked textures
|
||||||
; Persisting baked textures can speed up login and region border
|
; Persisting baked textures can speed up login and region border
|
||||||
; crossings especially with large numbers of users, though it
|
; crossings especially with large numbers of users, though it
|
||||||
|
|
Loading…
Reference in New Issue