Minor formatting cleanup.

0.6.0-stable
Jeff Ames 2008-06-25 14:30:28 +00:00
parent c4641d7005
commit a2b1a1787d
15 changed files with 149 additions and 143 deletions

View File

@ -91,7 +91,9 @@ namespace OpenSim.Data.NHibernate
{ {
user = session.Load(typeof(UserProfileData), uuid) as UserProfileData; user = session.Load(typeof(UserProfileData), uuid) as UserProfileData;
} }
catch (Exception) {} catch (Exception)
{
}
return (user != null); return (user != null);
} }
@ -161,10 +163,13 @@ namespace OpenSim.Data.NHibernate
{ {
UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData; UserAgentData old = session.Load(typeof(UserAgentData), agent.ProfileID) as UserAgentData;
if (old == null) { if (old == null)
{
session.Save(agent); session.Save(agent);
session.Transaction.Commit(); session.Transaction.Commit();
} else { }
else
{
UpdateUserAgent(agent); UpdateUserAgent(agent);
} }
} }
@ -235,13 +240,13 @@ namespace OpenSim.Data.NHibernate
// TODO: actually implement these // TODO: actually implement these
public override void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle) { return; } public override void UpdateUserCurrentRegion(LLUUID avatarid, LLUUID regionuuid, ulong regionhandle) { return; }
public override void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) {return;} public override void StoreWebLoginKey(LLUUID agentID, LLUUID webLoginKey) { return; }
public override void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) {return;} public override void AddNewUserFriend(LLUUID friendlistowner, LLUUID friend, uint perms) { return; }
public override void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) {return;} public override void RemoveUserFriend(LLUUID friendlistowner, LLUUID friend) { return; }
public override void UpdateUserFriendPerms(LLUUID friendlistowner, LLUUID friend, uint perms) {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 List<FriendListItem> GetUserFriendList(LLUUID friendlistowner) { return new List<FriendListItem>(); }
public override bool MoneyTransferRequest(LLUUID from, LLUUID to, uint amount) {return true;} 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 bool InventoryTransferRequest(LLUUID from, LLUUID to, LLUUID inventory) { return true; }
/// Appearance /// Appearance
/// TODO: stubs for now to get us to a compiling state gently /// TODO: stubs for now to get us to a compiling state gently

View File

@ -136,13 +136,13 @@ namespace OpenSim
#region Console Commands #region Console Commands
private void RunEchoTest(string[] cmdparams) private void RunEchoTest(string[] cmdparams)
{ {
for (int i = 0; i < cmdparams.Length; i++) for (int i = 0; i < cmdparams.Length; i++)
{ {
m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">"); m_log.Info("[EchoTest]: <arg" + i + ">"+cmdparams[i]+"</arg" + i + ">");
} }
} }
private void KickUserCommand(string[] cmdparams) private void KickUserCommand(string[] cmdparams)
{ {

View File

@ -470,7 +470,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
} }
} }
/// <summary> /// <summary>
/// Checks to see height deltas in the tainted terrain patch at xStart ,yStart /// Checks to see height deltas in the tainted terrain patch at xStart ,yStart
/// are all within the current estate limits /// 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 bakedHeight = m_revert[x, y];
double requestedDelta = requestedHeight - bakedHeight; double requestedDelta = requestedHeight - bakedHeight;
if (requestedDelta > maxDelta ) if (requestedDelta > maxDelta)
{ {
m_channel[x, y] = bakedHeight + maxDelta; m_channel[x, y] = bakedHeight + maxDelta;
changesLimited = true; changesLimited = true;
@ -509,7 +508,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
return changesLimited; return changesLimited;
} }
/// <summary> /// <summary>
/// Sends a copy of the current terrain to the scenes clients /// Sends a copy of the current terrain to the scenes clients
/// </summary> /// </summary>
@ -589,7 +587,6 @@ namespace OpenSim.Region.Environment.Modules.World.Terrain
} }
} }
#region Console Commands #region Console Commands
private void InterfaceLoadFile(Object[] args) private void InterfaceLoadFile(Object[] args)

View File

@ -849,7 +849,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <returns></returns> /// <returns></returns>
protected internal List<EntityBase> GetEntities() protected internal List<EntityBase> GetEntities()
{ {
lock(Entities) lock (Entities)
{ {
if (0 == Entities.Count) return null; if (0 == Entities.Count) return null;
return new List<EntityBase>(Entities.Values); return new List<EntityBase>(Entities.Values);

View File

@ -918,7 +918,7 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
/// <summary> /// <summary>
/// <see>ClientMoveTaskInventoryItem</see> /// <see>ClientMoveTaskInventoryItem</see>
/// </summary> /// </summary>
@ -927,7 +927,7 @@ namespace OpenSim.Region.Environment.Scenes
/// <param name="primLocalID"></param> /// <param name="primLocalID"></param>
/// <param name="itemID"></param> /// <param name="itemID"></param>
public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId) public void ClientMoveTaskInventoryItem(IClientAPI remoteClient, LLUUID folderId, uint primLocalId, LLUUID itemId)
{ {
SceneObjectPart part = GetSceneObjectPart(primLocalId); SceneObjectPart part = GetSceneObjectPart(primLocalId);
if (null == part) if (null == part)
@ -948,19 +948,19 @@ namespace OpenSim.Region.Environment.Scenes
return; return;
} }
MoveTaskInventoryItem(remoteClient, folderId, part, itemId); MoveTaskInventoryItem(remoteClient, folderId, part, itemId);
} }
/// <summary> /// <summary>
/// <see>MoveTaskInventoryItem</see> /// <see>MoveTaskInventoryItem</see>
/// </summary> /// </summary>
/// <param name="remoteClient"></param> /// <param name="remoteClient"></param>
/// <param name="folderID"></param> /// <param name="folderID"></param>
/// <param name="part"></param> /// <param name="part"></param>
/// <param name="itemID"></param> /// <param name="itemID"></param>
public void MoveTaskInventoryItem(LLUUID avatarId, LLUUID folderId, SceneObjectPart part, LLUUID itemId) public void MoveTaskInventoryItem(LLUUID avatarId, LLUUID folderId, SceneObjectPart part, LLUUID itemId)
{ {
ScenePresence avatar; ScenePresence avatar;
if (TryGetAvatar(avatarId, out 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", "Avatar {0} cannot be found to update its prim item asset",
avatarId); avatarId);
} }
} }
/// <summary> /// <summary>
/// Copy a task (prim) inventory item to another task (prim) /// Copy a task (prim) inventory item to another task (prim)
/// </summary> /// </summary>
/// <param name="destId"></param> /// <param name="destId"></param>
/// <param name="part"></param> /// <param name="part"></param>
/// <param name="itemId"></param> /// <param name="itemId"></param>
public void MoveTaskInventoryItem(LLUUID destId, SceneObjectPart part, LLUUID itemId) public void MoveTaskInventoryItem(LLUUID destId, SceneObjectPart part, LLUUID itemId)
{ {
TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId); TaskInventoryItem srcTaskItem = part.GetInventoryItem(itemId);
if(srcTaskItem == null) if (srcTaskItem == null)
{ {
// error was already logged // error was already logged
return; return;
} }
SceneObjectPart destPart = GetSceneObjectPart(destId); SceneObjectPart destPart = GetSceneObjectPart(destId);
if(destPart == null) if (destPart == null)
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[PRIM INVENTORY]: " + "[PRIM INVENTORY]: " +
"Could not find prim for ID {0}", "Could not find prim for ID {0}",
destId); destId);
return; return;
} }
TaskInventoryItem destTaskItem = new TaskInventoryItem(); TaskInventoryItem destTaskItem = new TaskInventoryItem();
destTaskItem.ItemID = LLUUID.Random(); destTaskItem.ItemID = LLUUID.Random();
destTaskItem.CreatorID = srcTaskItem.CreatorID; destTaskItem.CreatorID = srcTaskItem.CreatorID;
destTaskItem.AssetID = srcTaskItem.AssetID; destTaskItem.AssetID = srcTaskItem.AssetID;
destTaskItem.GroupID = destPart.GroupID; destTaskItem.GroupID = destPart.GroupID;
destTaskItem.OwnerID = destPart.OwnerID; destTaskItem.OwnerID = destPart.OwnerID;
destTaskItem.ParentID = destPart.UUID; destTaskItem.ParentID = destPart.UUID;
destTaskItem.ParentPartID = destPart.UUID; destTaskItem.ParentPartID = destPart.UUID;
destTaskItem.BaseMask = srcTaskItem.BaseMask; destTaskItem.BaseMask = srcTaskItem.BaseMask;
destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask; destTaskItem.EveryoneMask = srcTaskItem.EveryoneMask;
destTaskItem.GroupMask = srcTaskItem.GroupMask; destTaskItem.GroupMask = srcTaskItem.GroupMask;
destTaskItem.OwnerMask = srcTaskItem.OwnerMask; destTaskItem.OwnerMask = srcTaskItem.OwnerMask;
destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask; destTaskItem.NextOwnerMask = srcTaskItem.NextOwnerMask;
destTaskItem.Flags = srcTaskItem.Flags; destTaskItem.Flags = srcTaskItem.Flags;
if(destPart.OwnerID != part.OwnerID) if (destPart.OwnerID != part.OwnerID)
{ {
if (ExternalChecks.ExternalChecksPropagatePermissions()) if (ExternalChecks.ExternalChecksPropagatePermissions())
{ {
@ -1035,18 +1035,18 @@ namespace OpenSim.Region.Environment.Scenes
} }
} }
destTaskItem.Description = srcTaskItem.Description; destTaskItem.Description = srcTaskItem.Description;
destTaskItem.Name = srcTaskItem.Name; destTaskItem.Name = srcTaskItem.Name;
destTaskItem.InvType = srcTaskItem.InvType; destTaskItem.InvType = srcTaskItem.InvType;
destTaskItem.Type = srcTaskItem.Type; destTaskItem.Type = srcTaskItem.Type;
destPart.AddInventoryItem(destTaskItem); destPart.AddInventoryItem(destTaskItem);
if((srcTaskItem.OwnerMask & (uint)PermissionMask.Copy) == 0) if ((srcTaskItem.OwnerMask & (uint)PermissionMask.Copy) == 0)
part.RemoveInventoryItem(itemId); part.RemoveInventoryItem(itemId);
} }
/// <summary> /// <summary>
/// Update an item in a prim (task) inventory. /// Update an item in a prim (task) inventory.
/// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see> /// This method does not handle scripts, <see>RezScript(IClientAPI, LLUUID, unit)</see>

View File

@ -1530,7 +1530,7 @@ namespace OpenSim.Region.Physics.Meshing
) )
{ {
#if SPAM #if SPAM
System.Console.WriteLine( "reverting to geodesic sphere for prim: " + primName ); System.Console.WriteLine("reverting to geodesic sphere for prim: " + primName);
#endif #endif
return CreateSphereMesh(primName, primShape, size); return CreateSphereMesh(primName, primShape, size);
} }
@ -1802,10 +1802,13 @@ namespace OpenSim.Region.Physics.Meshing
#if SPAM #if SPAM
int vCount = 0; int vCount = 0;
foreach ( Vertex v in result.vertices ) foreach (Vertex v in result.vertices)
if ( v != null ) {
if (v != null)
vCount++; vCount++;
System.Console.WriteLine( "Mesh vertex count: " + vCount.ToString()); }
System.Console.WriteLine("Mesh vertex count: " + vCount.ToString());
#endif #endif
return result; return result;

View File

@ -1773,22 +1773,23 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
} }
// Finished with all sim stepping. If requested, dump world state to file for debugging.
// 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 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?
// 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))
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 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 string prefix = "world" + world.ToString(); // prefix for variable names in exported .DIF file
if(physics_logging_append_existing_logfile) { if (physics_logging_append_existing_logfile)
string header = "-------------- START OF PHYSICS FRAME " + framecount.ToString() + " --------------"; {
TextWriter fwriter = File.AppendText(fname); string header = "-------------- START OF PHYSICS FRAME " + framecount.ToString() + " --------------";
fwriter.WriteLine(header); TextWriter fwriter = File.AppendText(fname);
fwriter.Close(); fwriter.WriteLine(header);
} fwriter.Close();
d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); }
} d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix);
}
} }
return fps; return fps;

View File

@ -2697,40 +2697,40 @@ namespace OpenSim.Region.ScriptEngine.Common
public void llGiveInventory(string destination, string inventory) public void llGiveInventory(string destination, string inventory)
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
bool found = false; bool found = false;
LLUUID destId = LLUUID.Zero; LLUUID destId = LLUUID.Zero;
LLUUID objId = 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); llSay(0, "Could not parse key " + destination);
return; return;
} }
// move the first object found with this inventory name // move the first object found with this inventory name
foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory) foreach (KeyValuePair<LLUUID, TaskInventoryItem> inv in m_host.TaskInventory)
{ {
if (inv.Value.Name == inventory) if (inv.Value.Name == inventory)
{ {
found = true; found = true;
objId = inv.Key; objId = inv.Key;
break; break;
} }
} }
// check if destination is an avatar // check if destination is an avatar
if (World.GetScenePresence(destId) != null) if (World.GetScenePresence(destId) != null)
{ {
// destination is an avatar // destination is an avatar
World.MoveTaskInventoryItem(destId, null, m_host, objId); World.MoveTaskInventoryItem(destId, null, m_host, objId);
} }
else else
{ {
// destination is an object // destination is an object
World.MoveTaskInventoryItem(destId, m_host, objId); World.MoveTaskInventoryItem(destId, m_host, objId);
} }
if (!found) if (!found)
llSay(0, "Could not find object " + inventory); llSay(0, "Could not find object " + inventory);
} }

View File

@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
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); List<string> l = new List<string>(m_Apis.Keys);
return l.ToArray(); return l.ToArray();
@ -53,10 +53,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
string name = t.ToString(); string name = t.ToString();
int idx = name.LastIndexOf('.'); int idx = name.LastIndexOf('.');
if(idx != -1) if (idx != -1)
name = name.Substring(idx+1); name = name.Substring(idx+1);
if(name.EndsWith("_Api")) if (name.EndsWith("_Api"))
{ {
name = name.Substring(0, name.Length - 4); name = name.Substring(0, name.Length - 4);
m_Apis[name] = t; m_Apis[name] = t;
@ -69,7 +69,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public IScriptApi CreateApi(string api) public IScriptApi CreateApi(string api)
{ {
if(!m_Apis.ContainsKey(api)) if (!m_Apis.ContainsKey(api))
return null; return null;
IScriptApi ret = (IScriptApi)(Activator.CreateInstance(m_Apis[api])); IScriptApi ret = (IScriptApi)(Activator.CreateInstance(m_Apis[api]));

View File

@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
public AsyncCommandManager(IScriptEngine _ScriptEngine) public AsyncCommandManager(IScriptEngine _ScriptEngine)
{ {
m_ScriptEngine = _ScriptEngine; m_ScriptEngine = _ScriptEngine;
if(!m_Managers.Contains(this)) if (!m_Managers.Contains(this))
m_Managers.Add(this); m_Managers.Add(this);
ReadConfig(); ReadConfig();

View File

@ -2553,7 +2553,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
LLUUID destId = LLUUID.Zero; LLUUID destId = LLUUID.Zero;
LLUUID objId = 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); llSay(0, "Could not parse key " + destination);
return; return;

View File

@ -46,7 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public void ApiTypeLSL(IScriptApi api) public void ApiTypeLSL(IScriptApi api)
{ {
if(!(api is ILSL_Api)) if (!(api is ILSL_Api))
return; return;
m_LSL_Functions = (ILSL_Api)api; m_LSL_Functions = (ILSL_Api)api;

View File

@ -47,7 +47,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public void ApiTypeOSSL(IScriptApi api) public void ApiTypeOSSL(IScriptApi api)
{ {
if(!(api is IOSSL_Api)) if (!(api is IOSSL_Api))
return; return;
m_OSSL_Functions = (IOSSL_Api)api; m_OSSL_Functions = (IOSSL_Api)api;

View File

@ -44,9 +44,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{ {
MethodInfo[] myArrayMethodInfo = GetType().GetMethods(BindingFlags.Public|BindingFlags.Instance); 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); string type=mi.Name.Substring(7);
inits[type]=mi; inits[type]=mi;
@ -63,7 +63,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
public void InitApi(string api, IScriptApi data) public void InitApi(string api, IScriptApi data)
{ {
if(!inits.ContainsKey(api)) if (!inits.ContainsKey(api))
return; return;
MethodInfo mi = inits[api]; MethodInfo mi = inits[api];

View File

@ -1476,7 +1476,7 @@ namespace OpenSim.Region.ScriptEngine.Shared
public override bool Equals(Object o) public override bool Equals(Object o)
{ {
if(!(o is LSLFloat)) if (!(o is LSLFloat))
return false; return false;
return value == ((LSLFloat)o).value; return value == ((LSLFloat)o).value;