and of course i missed a file..

master
UbitUmarov 2020-06-13 15:51:17 +01:00
parent b37141182a
commit 9a18678fec
1 changed files with 5 additions and 60 deletions

View File

@ -3227,78 +3227,23 @@ namespace OpenSim.Region.ClientStack.LindenUDP
OutPacket(sound, ThrottleOutPacketType.Task);
}
public void SendSunPos(Vector3 Position, Vector3 Velocity, float sunphase)
public void SendViewerTime(Vector3 sunDir, float sunphase)
{
// Viewers based on the Linden viwer code, do wacky things for oribital positions from Midnight to Sunrise
// So adjust for that
// Contributed by: Godfrey
SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage);
viewertime.TimeInfo.SunDirection = Position;
viewertime.TimeInfo.SunAngVelocity = Velocity;
viewertime.TimeInfo.UsecSinceStart = Util.UnixTimeSinceEpoch_uS();
viewertime.TimeInfo.SunDirection = sunDir;
viewertime.TimeInfo.SunPhase = sunphase;
viewertime.TimeInfo.SunAngVelocity = Vector3.Zero; //legacy
viewertime.TimeInfo.SecPerDay = 14400; // legacy
viewertime.TimeInfo.SecPerYear = 158400; // legacy
viewertime.TimeInfo.SunPhase = sunphase;
viewertime.Header.Reliable = false;
viewertime.Header.Zerocoded = true;
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;
//viewertime.TimeInfo.SecPerYear = 31536000;
viewertime.TimeInfo.SecPerDay = 1000;
viewertime.TimeInfo.SecPerYear = 365000;
viewertime.TimeInfo.SunPhase = 1;
int sunPhase = (phase + 2) / 2;
if ((sunPhase < 6) || (sunPhase > 36))
{
viewertime.TimeInfo.SunDirection = new Vector3(0f, 0.8f, -0.8f);
Console.WriteLine("sending night");
}
else
{
if (sunPhase < 12)
{
sunPhase = 12;
}
sunPhase = sunPhase - 12;
float yValue = 0.1f * (sunPhase);
Console.WriteLine("Computed SunPhase: {0}, yValue: {1}", sunPhase, yValue);
if (yValue > 1.2f)
{
yValue = yValue - 1.2f;
}
yValue = Util.Clip(yValue, 0, 1);
if (sunPhase < 14)
{
yValue = 1 - yValue;
}
if (sunPhase < 12)
{
yValue *= -1;
}
viewertime.TimeInfo.SunDirection = new Vector3(0f, yValue, 0.3f);
Console.WriteLine("sending sun update " + yValue);
}
viewertime.TimeInfo.SunAngVelocity = new Vector3(0, 0.0f, 10.0f);
viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch();
viewertime.Header.Reliable = false;
OutPacket(viewertime, ThrottleOutPacketType.Task);
*/
}
public void SendViewerEffect(ViewerEffectPacket.EffectBlock[] effectBlocks)
{
ViewerEffectPacket packet = (ViewerEffectPacket)PacketPool.Instance.GetPacket(PacketType.ViewerEffect);