Update svn properties, formatting cleanup, fix a couple compiler warnings.

0.6.0-stable
Jeff Ames 2008-08-15 10:24:04 +00:00
parent e1620c5cc3
commit dde21314e7
13 changed files with 80 additions and 70 deletions

View File

@ -133,7 +133,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
return XmlWriterResult;
}
if (2 == comps.Length) {
if (2 == comps.Length)
{
string resp = ShortRegionInfo(comps[1], details[comps[1]]);
if (null != resp) return resp;
@ -153,7 +154,8 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
}
}
if (3 == comps.Length) {
if (3 == comps.Length)
{
switch (comps[1].ToLower())
{
case "prims":
@ -166,7 +168,7 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
min = new LLVector3((float)Double.Parse(subregion[0]), (float)Double.Parse(subregion[1]), (float)Double.Parse(subregion[2]));
max = new LLVector3((float)Double.Parse(subregion[3]), (float)Double.Parse(subregion[4]), (float)Double.Parse(subregion[5]));
}
catch (Exception e)
catch (Exception)
{
return Failure(httpResponse, OSHttpStatusCode.ClientErrorBadRequest,
"GET", "invalid subregion parameter");

View File

@ -173,8 +173,8 @@ namespace Opensim.Framework
public class Cache
{
private List<CacheItemBase> m_Index = new List<CacheItemBase>();
private Dictionary<LLUUID, CacheItemBase> m_Lookup =
new Dictionary<LLUUID, CacheItemBase>();
private Dictionary<LLUUID, CacheItemBase> m_Lookup =
new Dictionary<LLUUID, CacheItemBase>();
private CacheStrategy m_Strategy;
private CacheMedium m_Medium;
@ -270,10 +270,10 @@ namespace Opensim.Framework
m_Index.RemoveRange(newSize, Count - newSize);
m_Size = newSize;
m_Lookup.Clear();
m_Lookup.Clear();
foreach (CacheItemBase item in m_Index)
m_Lookup[item.uuid] = item;
foreach (CacheItemBase item in m_Index)
m_Lookup[item.uuid] = item;
}
}
@ -291,8 +291,8 @@ namespace Opensim.Framework
lock (m_Index)
{
if(m_Lookup.ContainsKey(index))
item = m_Lookup[index];
if (m_Lookup.ContainsKey(index))
item = m_Lookup[index];
}
if (item == null)
@ -340,10 +340,10 @@ namespace Opensim.Framework
{
CacheItemBase missing = new CacheItemBase(index);
if (!m_Index.Contains(missing))
{
{
m_Index.Add(missing);
m_Lookup[index] = missing;
}
m_Lookup[index] = missing;
}
}
}
return null;
@ -354,17 +354,17 @@ namespace Opensim.Framework
return data;
}
// Find an object in cache by delegate.
//
public Object Find(Predicate<Opensim.Framework.CacheItemBase> d)
{
CacheItemBase item = m_Index.Find(d);
// Find an object in cache by delegate.
//
public Object Find(Predicate<Opensim.Framework.CacheItemBase> d)
{
CacheItemBase item = m_Index.Find(d);
if(item == null)
return null;
if (item == null)
return null;
return item.Retrieve();
}
return item.Retrieve();
}
public virtual void Store(LLUUID index, Object data)
{
@ -421,7 +421,7 @@ namespace Opensim.Framework
item.expires = DateTime.Now + m_DefaultTTL;
m_Index.Add(item);
m_Lookup[index] = item;
m_Lookup[index] = item;
}
item.Store(data);
}
@ -439,10 +439,10 @@ namespace Opensim.Framework
{
if (item.expires.Ticks == 0 ||
item.expires <= now)
{
{
m_Index.Remove(item);
m_Lookup.Remove(item.uuid);
}
m_Lookup.Remove(item.uuid);
}
}
}
@ -471,20 +471,20 @@ namespace Opensim.Framework
foreach (CacheItemBase i in candidates)
{
if (doExpire(i.uuid))
{
{
m_Index.Remove(i);
m_Lookup.Remove(i.uuid);
}
m_Lookup.Remove(i.uuid);
}
}
}
else
{
m_Index.RemoveRange(target, Count - target);
m_Lookup.Clear();
m_Lookup.Clear();
foreach (CacheItemBase item in m_Index)
m_Lookup[item.uuid] = item;
foreach (CacheItemBase item in m_Index)
m_Lookup[item.uuid] = item;
}
}
break;

View File

@ -153,7 +153,7 @@ namespace OpenSim.Grid.UserServer
else if (startLocationRequest == "home")
{
// use the homeRegionID if it is stored already. If not, use the regionHandle as before
if(theUser.HomeRegionID != LLUUID.Zero)
if (theUser.HomeRegionID != LLUUID.Zero)
{
SimInfo =
RegionProfileData.RequestSimProfileData(

View File

@ -2669,7 +2669,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock();
edata.CovenantID = covenant;
edata.CovenantTimestamp = 0;
if(m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner;
else
edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID;

View File

@ -175,9 +175,10 @@ namespace OpenSim.Region.Communications.Local
public RegionInfo RequestNeighbourInfo(LLUUID regionID)
{
// TODO add a dictionary for faster lookup
foreach(RegionInfo info in m_regions.Values)
foreach (RegionInfo info in m_regions.Values)
{
if(info.RegionID == regionID) return info;
if (info.RegionID == regionID)
return info;
}
return null;
}
@ -186,7 +187,8 @@ namespace OpenSim.Region.Communications.Local
{
foreach (RegionInfo regInfo in m_regions.Values)
{
if (regInfo.RegionName == regionName) return regInfo;
if (regInfo.RegionName == regionName)
return regInfo;
}
return null;
}

View File

@ -75,8 +75,10 @@ namespace OpenSim.Region.Communications.OGS1
userData.Image = new LLUUID((string) data["profile_image"]);
userData.LastLogin = Convert.ToInt32((string) data["profile_lastlogin"]);
userData.HomeRegion = Convert.ToUInt64((string) data["home_region"]);
if(data.Contains("home_region_id")) userData.HomeRegionID = new LLUUID((string)data["home_region_id"]);
else userData.HomeRegionID = LLUUID.Zero;
if (data.Contains("home_region_id"))
userData.HomeRegionID = new LLUUID((string)data["home_region_id"]);
else
userData.HomeRegionID = LLUUID.Zero;
userData.HomeLocation =
new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]),
(float) Convert.ToDecimal((string) data["home_coordinates_y"]),
@ -85,10 +87,10 @@ namespace OpenSim.Region.Communications.OGS1
new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]),
(float) Convert.ToDecimal((string) data["home_look_y"]),
(float) Convert.ToDecimal((string) data["home_look_z"]));
if(data.Contains("user_flags"))
userData.UserFlags = Convert.ToInt32((string) data["user_flags"]);
if(data.Contains("god_level"))
userData.GodLevel = Convert.ToInt32((string) data["god_level"]);
if (data.Contains("user_flags"))
userData.UserFlags = Convert.ToInt32((string) data["user_flags"]);
if (data.Contains("god_level"))
userData.GodLevel = Convert.ToInt32((string) data["god_level"]);
return userData;
}

View File

@ -238,12 +238,12 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
// If there is no master avatar, return false
if (m_scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
{
if(m_scene.RegionInfo.MasterAvatarAssignedUUID == user)
if (m_scene.RegionInfo.MasterAvatarAssignedUUID == user)
return true;
}
if (m_scene.RegionInfo.EstateSettings.EstateOwner != LLUUID.Zero)
{
if(m_scene.RegionInfo.EstateSettings.EstateOwner == user)
if (m_scene.RegionInfo.EstateSettings.EstateOwner == user)
return true;
}

View File

@ -98,9 +98,9 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator
{
if (args[0] == "tree")
{
LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner;
if(uuid == LLUUID.Zero)
uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner;
if (uuid == LLUUID.Zero)
uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
m_log.Debug("[TREES]: New tree planting");
CreateTree(uuid, new LLVector3(128.0f, 128.0f, 0.0f));
}
@ -223,9 +223,9 @@ namespace OpenSim.Region.Environment.Modules.World.TreePopulator
position.X += (float) randX;
position.Y += (float) randY;
LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner;
if(uuid == LLUUID.Zero)
uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
LLUUID uuid = m_scene.RegionInfo.EstateSettings.EstateOwner;
if (uuid == LLUUID.Zero)
uuid = m_scene.RegionInfo.MasterAvatarAssignedUUID;
CreateTree(uuid, position);
}

View File

@ -2122,10 +2122,10 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 homePostion = new LLVector3(UserProfile.HomeLocationX,UserProfile.HomeLocationY,UserProfile.HomeLocationZ);
LLVector3 homeLookat = new LLVector3(UserProfile.HomeLookAt);
ulong homeRegionHandle = UserProfile.HomeRegion;
if(homeRegionID == LLUUID.Zero)
if (homeRegionID == LLUUID.Zero)
{
RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion);
if(info == null)
if (info == null)
{
// can't find the region: Tell viewer and abort
client.SendTeleportFailed("Your home-region could not be found.");
@ -2137,7 +2137,7 @@ namespace OpenSim.Region.Environment.Scenes
else
{
RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(homeRegionID);
if(info == null)
if (info == null)
{
// can't find the region: Tell viewer and abort
client.SendTeleportFailed("Your home-region could not be found.");
@ -2762,7 +2762,7 @@ namespace OpenSim.Region.Environment.Scenes
public void RequestTeleportLandmark(IClientAPI remoteClient, LLUUID regionID, LLVector3 position)
{
RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID);
if(info == null)
if (info == null)
{
// can't find the region: Tell viewer and abort
remoteClient.SendTeleportFailed("The teleport destination could not be found.");
@ -3518,10 +3518,10 @@ namespace OpenSim.Region.Environment.Scenes
// their scripts will actually run.
// -- Leaf, Tue Aug 12 14:17:05 EDT 2008
SceneObjectPart parent = part.ParentGroup.RootPart;
if( parent != null && parent.IsAttachment )
return scriptDanger(parent, parent.GetWorldPosition() );
if (parent != null && parent.IsAttachment)
return scriptDanger(parent, parent.GetWorldPosition());
else
return scriptDanger(part, part.GetWorldPosition() );
return scriptDanger(part, part.GetWorldPosition());
}
else
{

View File

@ -1102,12 +1102,13 @@ namespace OpenSim.Region.Environment.Scenes
// Get our own copy of the part array, and sort into the order we want to test
SceneObjectPart[] partArray = targetPart.ParentGroup.GetParts();
Array.Sort(partArray, delegate(SceneObjectPart p1, SceneObjectPart p2) {
// we want the originally selected part first, then the rest in link order -- so make the selected part link num (-1)
int linkNum1 = p1==targetPart ? -1 : p1.LinkNum;
int linkNum2 = p2==targetPart ? -1 : p2.LinkNum;
return linkNum1 - linkNum2;
}
Array.Sort(partArray, delegate(SceneObjectPart p1, SceneObjectPart p2)
{
// we want the originally selected part first, then the rest in link order -- so make the selected part link num (-1)
int linkNum1 = p1==targetPart ? -1 : p1.LinkNum;
int linkNum2 = p2==targetPart ? -1 : p2.LinkNum;
return linkNum1 - linkNum2;
}
);
//look for prims with explicit sit targets that are available
@ -1772,7 +1773,8 @@ namespace OpenSim.Region.Environment.Scenes
// Because appearance setting is in a module, we actually need
// to give it access to our appearance directly, otherwise we
// get a synchronization issue.
public AvatarAppearance Appearance {
public AvatarAppearance Appearance
{
get { return m_appearance; }
set { m_appearance = value; }
}
@ -2789,7 +2791,8 @@ namespace OpenSim.Region.Environment.Scenes
}
// optimization; we have to check per script, but if nothing is pressed and nothing changed, we can skip that
if(allflags != ScriptControlled.CONTROL_ZERO || allflags != LastCommands) {
if (allflags != ScriptControlled.CONTROL_ZERO || allflags != LastCommands)
{
lock (scriptedcontrols)
{
foreach (LLUUID scriptUUID in scriptedcontrols.Keys)
@ -2798,7 +2801,8 @@ namespace OpenSim.Region.Environment.Scenes
ScriptControlled localHeld = allflags & scriptControlData.eventControls; // the flags interesting for us
ScriptControlled localLast = LastCommands & scriptControlData.eventControls; // the activated controls in the last cycle
ScriptControlled localChange = localHeld ^ localLast; // the changed bits
if(localHeld != ScriptControlled.CONTROL_ZERO || localChange != ScriptControlled.CONTROL_ZERO) {
if (localHeld != ScriptControlled.CONTROL_ZERO || localChange != ScriptControlled.CONTROL_ZERO)
{
// only send if still pressed or just changed
m_scene.EventManager.TriggerControlEvent(scriptControlData.objID, scriptUUID, UUID, (uint)localHeld, (uint)localChange);
}

View File

@ -6907,7 +6907,7 @@ namespace OpenSim.Region.ScriptEngine.Common
if (aList.Data[i] != null)
{
switch((ParcelMediaCommandEnum)aList.Data[i])
switch ((ParcelMediaCommandEnum) aList.Data[i])
{
case ParcelMediaCommandEnum.Url:
list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL);

View File

@ -43,7 +43,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
/// </summary>
public class EventQueueThreadClass : iScriptEngineFunctionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
/// <summary>
/// How many ms to sleep if queue is empty

View File

@ -6662,7 +6662,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if (aList.Data[i] != null)
{
switch((ParcelMediaCommandEnum)aList.Data[i])
switch ((ParcelMediaCommandEnum) aList.Data[i])
{
case ParcelMediaCommandEnum.Url:
list.Add(World.GetLandData(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y).MediaURL);