The attached patch moves the sun module incrementally nearer where it
needs to be. Default behavior, i.e. no overriding configuration is to
match Second Life's diurnal/nocturnal rhythm.

All designated values are now sent to the client.There remain a couple
of unanswered questions about how this SHOULD be implemented though.
This commit is contained in:
Justin Clarke Casey
2008-05-07 14:15:59 +00:00
parent 0ea48cf786
commit 382b9c18ed
4 changed files with 193 additions and 55 deletions

View File

@@ -1772,18 +1772,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(sound, ThrottleOutPacketType.Task);
}
public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel)
public void SendSunPos(LLVector3 Position, LLVector3 Velocity, ulong CurrentTime, uint SecondsPerSunCycle, uint SecondsPerYear, float OrbitalPosition)
{
SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage);
viewertime.TimeInfo.SunDirection = sunPos;
viewertime.TimeInfo.SunAngVelocity = sunVel;
viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch();
viewertime.Header.Reliable = false;
viewertime.TimeInfo.SunDirection = Position;
viewertime.TimeInfo.SunAngVelocity = Velocity;
viewertime.TimeInfo.UsecSinceStart = CurrentTime;
viewertime.TimeInfo.SecPerDay = SecondsPerSunCycle;
viewertime.TimeInfo.SecPerYear = SecondsPerYear;
viewertime.TimeInfo.SunPhase = OrbitalPosition;
viewertime.Header.Reliable = false;
OutPacket(viewertime, ThrottleOutPacketType.Task);
}
// Currently Deprecated
public void SendViewerTime(int phase)
{
/*
Console.WriteLine("SunPhase: {0}", phase);
SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage);
//viewertime.TimeInfo.SecPerDay = 86400;
@@ -1829,6 +1834,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch();
viewertime.Header.Reliable = false;
OutPacket(viewertime, ThrottleOutPacketType.Task);
*/
}
public void SendAvatarProperties(LLUUID avatarID, string aboutText, string bornOn, string charterMember,
@@ -5474,4 +5480,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP
m_sequence = info.sequence;
}
}
}
}