Minor formatting cleanup.
parent
c4641d7005
commit
a2b1a1787d
|
@ -91,7 +91,9 @@ namespace OpenSim.Data.NHibernate
|
|||
{
|
||||
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
|
||||
}
|
||||
catch (Exception) {}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return (user != null);
|
||||
}
|
||||
|
@ -161,10 +163,13 @@ namespace OpenSim.Data.NHibernate
|
|||
{
|
||||
UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData;
|
||||
|
||||
if (old == null) {
|
||||
if (old == null)
|
||||
{
|
||||
session.Save(agent);
|
||||
session.Transaction.Commit();
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
UpdateUserAgent(agent);
|
||||
}
|
||||
}
|
||||
|
@ -235,13 +240,13 @@ namespace OpenSim.Data.NHibernate
|
|||
|
||||
// TODO: actually implement these
|
||||
public override void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle) { return; }
|
||||
public override void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) {return;}
|
||||
public override void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) {return;}
|
||||
public override void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) {return;}
|
||||
public override void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) {return;}
|
||||
public override List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) {return new List<FriendListItem>();}
|
||||
public override bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) {return true;}
|
||||
public override bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory) {return true;}
|
||||
public override void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) { return; }
|
||||
public override void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) { return; }
|
||||
public override void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) { return; }
|
||||
public override void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) { return; }
|
||||
public override List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) { return new List<FriendListItem>(); }
|
||||
public override bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) { return true; }
|
||||
public override bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory) { return true; }
|
||||
|
||||
/// Appearance
|
||||
/// TODO: stubs for now to get us to a compiling state gently
|
||||
|
|
|
@ -136,13 +136,13 @@ namespace OpenSim
|
|||
|
||||
#region Console Commands
|
||||
|
||||
private void RunEchoTest(string[] cmdparams)
|
||||
{
|
||||
for (int i = 0; i < cmdparams.Length; i++)
|
||||
{
|
||||
m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">");
|
||||
}
|
||||
}
|
||||
private void RunEchoTest(string[] cmdparams)
|
||||
{
|
||||
for (int i = 0; i < cmdparams.Length; i++)
|
||||
{
|
||||
m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">");
|
||||
}
|
||||
}
|
||||
|
||||
private void KickUserCommand(string[] cmdparams)
|
||||
{
|
||||
|
|
|
@ -470,7 +470,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Checks to see height deltas in the tainted terrain patch at xStart ,yStart
|
||||
/// are all within the current estate limits
|
||||
|
@ -493,7 +492,7 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
|
|||
double bakedHeight = m_revert[x, y];
|
||||
double requestedDelta = requestedHeight - bakedHeight;
|
||||
|
||||
if (requestedDelta > maxDelta )
|
||||
if (requestedDelta > maxDelta)
|
||||
{
|
||||
m_channel[x, y] = bakedHeight + maxDelta;
|
||||
changesLimited = true;
|
||||
|
@ -509,7 +508,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
|
|||
return changesLimited;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Sends a copy of the current terrain to the scenes clients
|
||||
/// </summary>
|
||||
|
@ -589,7 +587,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
#region Console Commands
|
||||
|
||||
private void InterfaceLoadFile(Object[] args)
|
||||
|
|
|
@ -849,7 +849,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <returns></returns>
|
||||
protected internal List<EntityBase> GetEntities()
|
||||
{
|
||||
lock(Entities)
|
||||
lock (Entities)
|
||||
{
|
||||
if (0 == Entities.Count) return null;
|
||||
return new List<EntityBase>(Entities.Values);
|
||||
|
|
|
@ -918,7 +918,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// <see>ClientMoveTaskInventoryItem</see>
|
||||
/// </summary>
|
||||
|
@ -927,7 +927,7 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
/// <param name="primLocalID"></param>
|
||||
/// <param name="itemID"></param>
|
||||
public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
|
||||
{
|
||||
{
|
||||
SceneObjectPart part = GetSceneObjectPart(primLocalId);
|
||||
|
||||
if (null == part)
|
||||
|
@ -948,19 +948,19 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
return;
|
||||
}
|
||||
|
||||
MoveTaskInventoryItem(remoteClient, folderId, part, itemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see>MoveTaskInventoryItem</see>
|
||||
/// </summary>
|
||||
MoveTaskInventoryItem(remoteClient, folderId, part, itemId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <see>MoveTaskInventoryItem</see>
|
||||
/// </summary>
|
||||
/// <param name="remoteClient"></param>
|
||||
/// <param name="folderID"></param>
|
||||
/// <param name="part"></param>
|
||||
/// <param name="itemID"></param>
|
||||
public void MoveTaskInventoryItem(LLUUID avatarId, LLUUID folderId, SceneObjectPart part, LLUUID itemId)
|
||||
{
|
||||
ScenePresence avatar;
|
||||
public void MoveTaskInventoryItem(LLUUID avatarId, LLUUID folderId, SceneObjectPart part, LLUUID itemId)
|
||||
{
|
||||
ScenePresence avatar;
|
||||
|
||||
if (TryGetAvatar(avatarId, out avatar))
|
||||
{
|
||||
|
@ -973,53 +973,53 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
"Avatar {0} cannot be found to update its prim item asset",
|
||||
avatarId);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy a task (prim) inventory item to another task (prim)
|
||||
/// </summary>
|
||||
/// <param name="destId"></param>
|
||||
/// <param name="part"></param>
|
||||
/// <param name="itemId"></param>
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Copy a task (prim) inventory item to another task (prim)
|
||||
/// </summary>
|
||||
/// <param name="destId"></param>
|
||||
/// <param name="part"></param>
|
||||
/// <param name="itemId"></param>
|
||||
public void MoveTaskInventoryItem(LLUUID destId, SceneObjectPart part, LLUUID itemId)
|
||||
{
|
||||
TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId);
|
||||
{
|
||||
TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId);
|
||||
|
||||
if(srcTaskItem == null)
|
||||
{
|
||||
// error was already logged
|
||||
return;
|
||||
}
|
||||
|
||||
SceneObjectPart destPart = GetSceneObjectPart(destId);
|
||||
if (srcTaskItem == null)
|
||||
{
|
||||
// error was already logged
|
||||
return;
|
||||
}
|
||||
|
||||
SceneObjectPart destPart = GetSceneObjectPart(destId);
|
||||
|
||||
if(destPart == null)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Could not find prim for ID {0}",
|
||||
destId);
|
||||
return;
|
||||
}
|
||||
|
||||
TaskInventoryItem destTaskItem = new TaskInventoryItem();
|
||||
|
||||
destTaskItem.ItemID = LLUUID.Random();
|
||||
destTaskItem.CreatorID = srcTaskItem.CreatorID;
|
||||
destTaskItem.AssetID = srcTaskItem.AssetID;
|
||||
if (destPart == null)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Could not find prim for ID {0}",
|
||||
destId);
|
||||
return;
|
||||
}
|
||||
|
||||
TaskInventoryItem destTaskItem = new TaskInventoryItem();
|
||||
|
||||
destTaskItem.ItemID = LLUUID.Random();
|
||||
destTaskItem.CreatorID = srcTaskItem.CreatorID;
|
||||
destTaskItem.AssetID = srcTaskItem.AssetID;
|
||||
destTaskItem.GroupID = destPart.GroupID;
|
||||
destTaskItem.OwnerID = destPart.OwnerID;
|
||||
destTaskItem.ParentID = destPart.UUID;
|
||||
destTaskItem.ParentPartID = destPart.UUID;
|
||||
|
||||
destTaskItem.BaseMask = srcTaskItem.BaseMask;
|
||||
destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask;
|
||||
destTaskItem.GroupMask = srcTaskItem.GroupMask;
|
||||
destTaskItem.OwnerMask = srcTaskItem.OwnerMask;
|
||||
destTaskItem.BaseMask = srcTaskItem.BaseMask;
|
||||
destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask;
|
||||
destTaskItem.GroupMask = srcTaskItem.GroupMask;
|
||||
destTaskItem.OwnerMask = srcTaskItem.OwnerMask;
|
||||
destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask;
|
||||
destTaskItem.Flags = srcTaskItem.Flags;
|
||||
|
||||
if(destPart.OwnerID != part.OwnerID)
|
||||
destTaskItem.Flags = srcTaskItem.Flags;
|
||||
|
||||
if (destPart.OwnerID != part.OwnerID)
|
||||
{
|
||||
if (ExternalChecks.ExternalChecksPropagatePermissions())
|
||||
{
|
||||
|
@ -1035,18 +1035,18 @@ namespace OpenSim.Region.Environment.Scenes
|
|||
}
|
||||
}
|
||||
|
||||
destTaskItem.Description = srcTaskItem.Description;
|
||||
destTaskItem.Name = srcTaskItem.Name;
|
||||
destTaskItem.InvType = srcTaskItem.InvType;
|
||||
destTaskItem.Type = srcTaskItem.Type;
|
||||
|
||||
destPart.AddInventoryItem(destTaskItem);
|
||||
destTaskItem.Description = srcTaskItem.Description;
|
||||
destTaskItem.Name = srcTaskItem.Name;
|
||||
destTaskItem.InvType = srcTaskItem.InvType;
|
||||
destTaskItem.Type = srcTaskItem.Type;
|
||||
|
||||
destPart.AddInventoryItem(destTaskItem);
|
||||
|
||||
if((srcTaskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
|
||||
if ((srcTaskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
|
||||
part.RemoveInventoryItem(itemId);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update an item in a prim (task) inventory.
|
||||
/// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see>
|
||||
|
|
|
@ -1530,7 +1530,7 @@ namespace OpenSim.Region.Physics.Meshing
|
|||
)
|
||||
{
|
||||
#if SPAM
|
||||
System.Console.WriteLine( "reverting to geodesic sphere for prim: " + primName );
|
||||
System.Console.WriteLine("reverting to geodesic sphere for prim: " + primName);
|
||||
#endif
|
||||
return CreateSphereMesh(primName, primShape, size);
|
||||
}
|
||||
|
@ -1802,10 +1802,13 @@ namespace OpenSim.Region.Physics.Meshing
|
|||
#if SPAM
|
||||
int vCount = 0;
|
||||
|
||||
foreach ( Vertex v in result.vertices )
|
||||
if ( v != null )
|
||||
foreach (Vertex v in result.vertices)
|
||||
{
|
||||
if (v != null)
|
||||
vCount++;
|
||||
System.Console.WriteLine( "Mesh vertex count: " + vCount.ToString());
|
||||
}
|
||||
|
||||
System.Console.WriteLine("Mesh vertex count: " + vCount.ToString());
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
|
|
@ -1773,22 +1773,23 @@ namespace OpenSim.Region.Physics.OdePlugin
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// Finished with all sim stepping. If requested, dump world state to file for debugging.
|
||||
// TODO: This call to the export function is already inside lock(OdeLock) - but is an extra lock needed?
|
||||
// TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots?
|
||||
if(physics_logging && (physics_logging_interval>0) && (framecount % physics_logging_interval == 0) ) {
|
||||
string fname = "state-" + world.ToString() + ".DIF"; // give each physics world a separate filename
|
||||
string prefix = "world" + world.ToString(); // prefix for variable names in exported .DIF file
|
||||
// Finished with all sim stepping. If requested, dump world state to file for debugging.
|
||||
// TODO: This call to the export function is already inside lock (OdeLock) - but is an extra lock needed?
|
||||
// TODO: This overwrites all dump files in-place. Should this be a growing logfile, or separate snapshots?
|
||||
if (physics_logging && (physics_logging_interval>0) && (framecount % physics_logging_interval == 0))
|
||||
{
|
||||
string fname = "state-" + world.ToString() + ".DIF"; // give each physics world a separate filename
|
||||
string prefix = "world" + world.ToString(); // prefix for variable names in exported .DIF file
|
||||
|
||||
if(physics_logging_append_existing_logfile) {
|
||||
string header = "-------------- START OF PHYSICS FRAME " + framecount.ToString() + " --------------";
|
||||
TextWriter fwriter = File.AppendText(fname);
|
||||
fwriter.WriteLine(header);
|
||||
fwriter.Close();
|
||||
}
|
||||
d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix);
|
||||
}
|
||||
if (physics_logging_append_existing_logfile)
|
||||
{
|
||||
string header = "-------------- START OF PHYSICS FRAME " + framecount.ToString() + " --------------";
|
||||
TextWriter fwriter = File.AppendText(fname);
|
||||
fwriter.WriteLine(header);
|
||||
fwriter.Close();
|
||||
}
|
||||
d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix);
|
||||
}
|
||||
}
|
||||
|
||||
return fps;
|
||||
|
|
|
@ -2697,40 +2697,40 @@ namespace OpenSim.Region.ScriptEngine.Common
|
|||
public void llGiveInventory(string destination, string inventory)
|
||||
{
|
||||
m_host.AddScriptLPS(1);
|
||||
bool found = false;
|
||||
LLUUID destId = LLUUID.Zero;
|
||||
LLUUID objId = LLUUID.Zero;
|
||||
|
||||
if(!LLUUID.TryParse(destination, out destId))
|
||||
{
|
||||
llSay(0, "Could not parse key " + destination);
|
||||
return;
|
||||
}
|
||||
|
||||
// move the first object found with this inventory name
|
||||
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if (inv.Value.Name == inventory)
|
||||
{
|
||||
found = true;
|
||||
objId = inv.Key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// check if destination is an avatar
|
||||
if (World.GetScenePresence(destId) != null)
|
||||
{
|
||||
// destination is an avatar
|
||||
bool found = false;
|
||||
LLUUID destId = LLUUID.Zero;
|
||||
LLUUID objId = LLUUID.Zero;
|
||||
|
||||
if (!LLUUID.TryParse(destination, out destId))
|
||||
{
|
||||
llSay(0, "Could not parse key " + destination);
|
||||
return;
|
||||
}
|
||||
|
||||
// move the first object found with this inventory name
|
||||
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
|
||||
{
|
||||
if (inv.Value.Name == inventory)
|
||||
{
|
||||
found = true;
|
||||
objId = inv.Key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// check if destination is an avatar
|
||||
if (World.GetScenePresence(destId) != null)
|
||||
{
|
||||
// destination is an avatar
|
||||
World.MoveTaskInventoryItem(destId, null, m_host, objId);
|
||||
}
|
||||
else
|
||||
{
|
||||
// destination is an object
|
||||
}
|
||||
else
|
||||
{
|
||||
// destination is an object
|
||||
World.MoveTaskInventoryItem(destId, m_host, objId);
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
if (!found)
|
||||
llSay(0, "Could not find object " + inventory);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
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();
|
||||
|
@ -53,10 +53,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
{
|
||||
string name = t.ToString();
|
||||
int idx = name.LastIndexOf('.');
|
||||
if(idx != -1)
|
||||
if (idx != -1)
|
||||
name = name.Substring(idx+1);
|
||||
|
||||
if(name.EndsWith("_Api"))
|
||||
if (name.EndsWith("_Api"))
|
||||
{
|
||||
name = name.Substring(0, name.Length - 4);
|
||||
m_Apis[name] = t;
|
||||
|
@ -69,7 +69,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
|
||||
public IScriptApi CreateApi(string api)
|
||||
{
|
||||
if(!m_Apis.ContainsKey(api))
|
||||
if (!m_Apis.ContainsKey(api))
|
||||
return null;
|
||||
|
||||
IScriptApi ret = (IScriptApi)(Activator.CreateInstance(m_Apis[api]));
|
||||
|
|
|
@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
public AsyncCommandManager(IScriptEngine _ScriptEngine)
|
||||
{
|
||||
m_ScriptEngine = _ScriptEngine;
|
||||
if(!m_Managers.Contains(this))
|
||||
if (!m_Managers.Contains(this))
|
||||
m_Managers.Add(this);
|
||||
|
||||
ReadConfig();
|
||||
|
|
|
@ -2553,7 +2553,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
|||
LLUUID destId = LLUUID.Zero;
|
||||
LLUUID objId = LLUUID.Zero;
|
||||
|
||||
if(!LLUUID.TryParse(destination, out destId))
|
||||
if (!LLUUID.TryParse(destination, out destId))
|
||||
{
|
||||
llSay(0, "Could not parse key " + destination);
|
||||
return;
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
|
||||
public void ApiTypeLSL(IScriptApi api)
|
||||
{
|
||||
if(!(api is ILSL_Api))
|
||||
if (!(api is ILSL_Api))
|
||||
return;
|
||||
|
||||
m_LSL_Functions = (ILSL_Api)api;
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
|
||||
public void ApiTypeOSSL(IScriptApi api)
|
||||
{
|
||||
if(!(api is IOSSL_Api))
|
||||
if (!(api is IOSSL_Api))
|
||||
return;
|
||||
|
||||
m_OSSL_Functions = (IOSSL_Api)api;
|
||||
|
|
|
@ -44,9 +44,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
{
|
||||
MethodInfo[] myArrayMethodInfo = GetType().GetMethods(BindingFlags.Public|BindingFlags.Instance);
|
||||
|
||||
foreach(MethodInfo mi in myArrayMethodInfo)
|
||||
foreach (MethodInfo mi in myArrayMethodInfo)
|
||||
{
|
||||
if(mi.Name.Length > 7 && mi.Name.Substring(0, 7) == "ApiType")
|
||||
if (mi.Name.Length > 7 && mi.Name.Substring(0, 7) == "ApiType")
|
||||
{
|
||||
string type=mi.Name.Substring(7);
|
||||
inits[type]=mi;
|
||||
|
@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
|
|||
|
||||
public void InitApi(string api, IScriptApi data)
|
||||
{
|
||||
if(!inits.ContainsKey(api))
|
||||
if (!inits.ContainsKey(api))
|
||||
return;
|
||||
|
||||
MethodInfo mi = inits[api];
|
||||
|
|
|
@ -1476,7 +1476,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
|
|||
|
||||
public override bool Equals(Object o)
|
||||
{
|
||||
if(!(o is LSLFloat))
|
||||
if (!(o is LSLFloat))
|
||||
return false;
|
||||
|
||||
return value == ((LSLFloat)o).value;
|
||||
|
|
Loading…
Reference in New Issue