From 9a18678fec19ed5e3099a56757634684758a95fc Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 13 Jun 2020 15:51:17 +0100 Subject: [PATCH] and of course i missed a file.. --- .../ClientStack/Linden/UDP/LLClientView.cs | 65 ++----------------- 1 file changed, 5 insertions(+), 60 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f583bfa949..e22222a223 100755 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -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);