aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
authorSean Dague2008-05-12 18:39:19 +0000
committerSean Dague2008-05-12 18:39:19 +0000
commite826f5808bc35f5fbdbf626b32cf23968fc29ea9 (patch)
tree21fd9ccee8f8d30e0d009d17ddf3b91042e81df9 /OpenSim/Region/Environment
parentmove the sun based on localtime instead of utc. Now it won't set for me at (diff)
downloadopensim-SC_OLD-e826f5808bc35f5fbdbf626b32cf23968fc29ea9.zip
opensim-SC_OLD-e826f5808bc35f5fbdbf626b32cf23968fc29ea9.tar.gz
opensim-SC_OLD-e826f5808bc35f5fbdbf626b32cf23968fc29ea9.tar.bz2
opensim-SC_OLD-e826f5808bc35f5fbdbf626b32cf23968fc29ea9.tar.xz
my last patch didn't actually get the sun to possition correctly, but
now we are correctly using the timezone offset. If you set day_length to 24.0 you'll get a sun progression that roughly follows your real world day on your server.
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
index 5224f84..0314562 100644
--- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
+++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Environment.Modules
81 private double SunSpeed; // Rate of passage in radians/second 81 private double SunSpeed; // Rate of passage in radians/second
82 private double SeasonSpeed; // Rate of change for seasonal effects 82 private double SeasonSpeed; // Rate of change for seasonal effects
83 private double HoursToRadians; // Rate of change for seasonal effects 83 private double HoursToRadians; // Rate of change for seasonal effects
84 private long m_offset = 0; // seconds offset from UTC 84 private long TicksOffset = 0; // seconds offset from UTC
85 // Calculated every update 85 // Calculated every update
86 private float OrbitalPosition; // Orbital placement at a point in time 86 private float OrbitalPosition; // Orbital placement at a point in time
87 private double HorizonShift; // Axis offset to skew day and night 87 private double HorizonShift; // Axis offset to skew day and night
@@ -100,7 +100,7 @@ namespace OpenSim.Region.Environment.Modules
100 private ulong CurrentTime 100 private ulong CurrentTime
101 { 101 {
102 get { 102 get {
103 return (ulong)(((System.DateTime.Now.Ticks)-TicksToEpoch)/10000000 + m_offset); 103 return (ulong)(((System.DateTime.Now.Ticks) - TicksToEpoch + TicksOffset)/10000000);
104 } 104 }
105 } 105 }
106 106
@@ -117,7 +117,9 @@ namespace OpenSim.Region.Environment.Modules
117 m_frame = 0; 117 m_frame = 0;
118 118
119 TimeZone local = TimeZone.CurrentTimeZone; 119 TimeZone local = TimeZone.CurrentTimeZone;
120 m_offset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Seconds; 120 TicksOffset = local.GetUtcOffset(local.ToLocalTime(DateTime.Now)).Ticks;
121
122 m_log.Debug("[SUN] localtime offset is " + TicksOffset);
121 123
122 // Align ticks with Second Life 124 // Align ticks with Second Life
123 125