Formatting cleanup.

This commit is contained in:
Jeff Ames
2008-05-14 05:11:23 +00:00
parent eff470c0de
commit c995d60d37
62 changed files with 283 additions and 291 deletions

View File

@@ -171,7 +171,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.Xfer
{
if (Data.Length < 1000)
{
// for now (testing ) we only support files under 1000 bytes
// for now (testing) we only support files under 1000 bytes
byte[] transferData = new byte[Data.Length + 4];
Array.Copy(Helpers.IntToBytes(Data.Length), 0, transferData, 0, 4);
Array.Copy(Data, 0, transferData, 4, Data.Length);

View File

@@ -278,7 +278,7 @@ namespace OpenSim.Region.Environment.Modules.World.Land
list.Add(entry.AgentID);
}
}
if(list.Count == 0)
if (list.Count == 0)
{
list.Add(LLUUID.Zero);
}

View File

@@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
}
protected void DebugPermissionInformation(string permissionCalled)
{
if(m_debugPermissions)
if (m_debugPermissions)
m_log.Info("[PERMISSIONS]: " + permissionCalled + " was called from " + m_scene.RegionInfo.RegionName);
}
@@ -240,7 +240,7 @@ namespace OpenSim.Region.Environment.Modules.World.Permissions
if (user != LLUUID.Zero)
{
LLUUID[] estatemanagers = m_scene.RegionInfo.EstateSettings.estateManagers;
foreach(LLUUID estatemanager in estatemanagers)
foreach (LLUUID estatemanager in estatemanagers)
{
if (estatemanager == user)
return true;

View File

@@ -65,7 +65,7 @@ namespace OpenSim.Region.Environment.Modules
private double d_day_length = 4; // A VW day is 4 RW hours long
private int d_year_length = 60; // There are 60 VW days in a VW year
private double d_day_night = 0.45; // axis offset: ratio of light-to-dark, approx 1:3
private double d_longitude = -73.53;
private double d_longitude = -73.53;
private double d_latitude = 41.29;
// Frame counter
@@ -155,48 +155,44 @@ namespace OpenSim.Region.Environment.Modules
m_longitude = d_longitude;
}
switch(m_mode)
switch (m_mode)
{
case "T1":
default:
case "SL":
// Time taken to complete a cycle (day and season)
case "T1" :
SecondsPerSunCycle = (uint) (m_day_length * 60 * 60);
SecondsPerYear = (uint) (SecondsPerSunCycle*m_year_length);
default :
// Ration of real-to-virtual time
case "SL" :
// Time taken to complete a cycle (day and season)
VWTimeRatio = 24/m_day_length;
SecondsPerSunCycle = (uint) (m_day_length * 60 * 60);
SecondsPerYear = (uint) (SecondsPerSunCycle*m_year_length);
// Speed of rotation needed to complete a cycle in the
// designated period (day and season)
// Ration of real-to-virtual time
SunSpeed = SunCycle/SecondsPerSunCycle;
SeasonSpeed = SeasonalCycle/SecondsPerYear;
VWTimeRatio = 24/m_day_length;
// Horizon translation
// Speed of rotation needed to complete a cycle in the
// designated period (day and season)
HorizonShift = m_day_night; // Z axis translation
HoursToRadians = (SunCycle/24)*VWTimeRatio;
SunSpeed = SunCycle/SecondsPerSunCycle;
SeasonSpeed = SeasonalCycle/SecondsPerYear;
// Insert our event handling hooks
// Horizon translation
scene.EventManager.OnFrame += SunUpdate;
scene.EventManager.OnNewClient += SunToClient;
HorizonShift = m_day_night; // Z axis translation
HoursToRadians = (SunCycle/24)*VWTimeRatio;
ready = true;
// Insert our event handling hooks
scene.EventManager.OnFrame += SunUpdate;
scene.EventManager.OnNewClient += SunToClient;
ready = true;
m_log.Debug("[SUN] Mode is "+m_mode);
m_log.Debug("[SUN] Initialization completed. Day is "+SecondsPerSunCycle+" seconds, and year is "+m_year_length+" days");
m_log.Debug("[SUN] Axis offset is "+m_day_night);
m_log.Debug("[SUN] Positional data updated every "+m_frame_mod+" frames");
m_log.Debug("[SUN] Mode is "+m_mode);
m_log.Debug("[SUN] Initialization completed. Day is "+SecondsPerSunCycle+" seconds, and year is "+m_year_length+" days");
m_log.Debug("[SUN] Axis offset is "+m_day_night);
m_log.Debug("[SUN] Positional data updated every "+m_frame_mod+" frames");
break;
}
}
@@ -224,21 +220,20 @@ namespace OpenSim.Region.Environment.Modules
public void SunToClient(IClientAPI client)
{
if(m_mode != "T1")
if (m_mode != "T1")
{
if(ready)
{
GenSunPos(); // Generate shared values once
client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition);
if (ready)
{
GenSunPos(); // Generate shared values once
client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition);
m_log.Debug("[SUN] Initial update for new client");
}
}
}
}
public void SunUpdate()
{
if(((m_frame++%m_frame_mod) != 0) || !ready)
if (((m_frame++%m_frame_mod) != 0) || !ready)
{
return;
}
@@ -253,7 +248,6 @@ namespace OpenSim.Region.Environment.Modules
// set estate settings for region access to sun position
m_scene.RegionInfo.EstateSettings.sunPosition = Position;
}
/// <summary>