aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
diff options
context:
space:
mode:
authorUbitUmarov2019-03-18 18:03:22 +0000
committerUbitUmarov2019-03-18 18:03:22 +0000
commit84187975bdfc4a877fb1f6a2c193d8227d3c258a (patch)
tree6d4f5e62371691a38a2011a87bfd20916581801b /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
parentstop sending some useless small packets (diff)
downloadopensim-SC-84187975bdfc4a877fb1f6a2c193d8227d3c258a.zip
opensim-SC-84187975bdfc4a877fb1f6a2c193d8227d3c258a.tar.gz
opensim-SC-84187975bdfc4a877fb1f6a2c193d8227d3c258a.tar.bz2
opensim-SC-84187975bdfc4a877fb1f6a2c193d8227d3c258a.tar.xz
lludp AgentMovementComplete enconding
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs64
1 files changed, 36 insertions, 28 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 39e2d39..ab5790c 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -332,7 +332,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
332 private readonly UUID m_secureSessionId; 332 private readonly UUID m_secureSessionId;
333 protected readonly UUID m_agentId; 333 protected readonly UUID m_agentId;
334 private readonly uint m_circuitCode; 334 private readonly uint m_circuitCode;
335 private readonly byte[] m_channelVersion = Utils.EmptyBytes; 335 private readonly byte[] m_regionChannelVersion = Utils.EmptyBytes;
336 private readonly IGroupsModule m_GroupsModule; 336 private readonly IGroupsModule m_GroupsModule;
337 337
338// private int m_cachedTextureSerial; 338// private int m_cachedTextureSerial;
@@ -531,7 +531,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
531 m_assetService = m_scene.RequestModuleInterface<IAssetService>(); 531 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
532 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); 532 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
533 ImageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); 533 ImageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
534 m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); 534 m_regionChannelVersion = Util.StringToBytes1024(scene.GetSimulatorVersion());
535 m_agentId = agentId; 535 m_agentId = agentId;
536 m_sessionId = sessionId; 536 m_sessionId = sessionId;
537 m_secureSessionId = sessionInfo.LoginInfo.SecureSession; 537 m_secureSessionId = sessionInfo.LoginInfo.SecureSession;
@@ -865,32 +865,55 @@ namespace OpenSim.Region.ClientStack.LindenUDP
865 OutPacket(handshake, ThrottleOutPacketType.Unknown); 865 OutPacket(handshake, ThrottleOutPacketType.Unknown);
866 } 866 }
867 867
868 static private readonly byte[] AgentMovementCompleteHeader = new byte[] {
869 Helpers.MSG_RELIABLE,
870 0, 0, 0, 0, // sequence number
871 0, // extra
872 0xff, 0xff, 0, 250 // ID 250 (low frequency bigendian)
873 };
868 874
869 public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look) 875 public void MoveAgentIntoRegion(RegionInfo regInfo, Vector3 pos, Vector3 look)
870 { 876 {
877 // reset agent update args
871 m_thisAgentUpdateArgs.CameraAtAxis.X = float.MinValue; 878 m_thisAgentUpdateArgs.CameraAtAxis.X = float.MinValue;
872 m_thisAgentUpdateArgs.lastUpdateTS = 0; 879 m_thisAgentUpdateArgs.lastUpdateTS = 0;
873 m_thisAgentUpdateArgs.ControlFlags = 0; 880 m_thisAgentUpdateArgs.ControlFlags = 0;
874 881
875 AgentMovementCompletePacket mov = (AgentMovementCompletePacket)PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); 882 UDPPacketBuffer buf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint);
876 mov.SimData.ChannelVersion = m_channelVersion; 883 byte[] data = buf.Data;
877 mov.AgentData.SessionID = m_sessionId; 884
878 mov.AgentData.AgentID = AgentId; 885 //setup header
879 mov.Data.RegionHandle = regInfo.RegionHandle; 886 Buffer.BlockCopy(AgentMovementCompleteHeader, 0, data, 0, 10);
880 mov.Data.Timestamp = (uint)Util.UnixTimeSinceEpoch(); 887
888 //AgentData block
889 AgentId.ToBytes(data, 10); // 26
890 SessionId.ToBytes(data, 26); // 42
881 891
892 //Data block
882 if ((pos.X == 0) && (pos.Y == 0) && (pos.Z == 0)) 893 if ((pos.X == 0) && (pos.Y == 0) && (pos.Z == 0))
894 m_startpos.ToBytes(data, 42); //54
895 else
896 pos.ToBytes(data, 42); //54
897 look.ToBytes(data, 54); // 66
898 Utils.UInt64ToBytesSafepos(regInfo.RegionHandle, data, 66); // 74
899 Utils.UIntToBytesSafepos((uint)Util.UnixTimeSinceEpoch(), data, 74); //78
900
901 //SimData
902 int len = m_regionChannelVersion.Length;
903 if(len == 0)
883 { 904 {
884 mov.Data.Position = m_startpos; 905 data[78] = 0;
906 data[79] = 0;
885 } 907 }
886 else 908 else
887 { 909 {
888 mov.Data.Position = pos; 910 data[78] = (byte)len;
911 data[79] = (byte)(len >> 8);
912 Buffer.BlockCopy(m_regionChannelVersion, 0, data, 80, len);
889 } 913 }
890 mov.Data.LookAt = look;
891 914
892 // Hack to get this out immediately and skip the throttles 915 buf.DataLength = 80 + len;
893 OutPacket(mov, ThrottleOutPacketType.Unknown); 916 m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Unknown, null, false, false);
894 } 917 }
895 918
896 public void SendChatMessage( 919 public void SendChatMessage(
@@ -4265,20 +4288,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4265 /// </summary> 4288 /// </summary>
4266 public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags) 4289 public void SendEntityUpdate(ISceneEntity entity, PrimUpdateFlags updateFlags)
4267 { 4290 {
4268/*
4269 if (entity.UUID == m_agentId && !updateFlags.HasFlag(PrimUpdateFlags.FullUpdate))
4270 {
4271 ImprovedTerseObjectUpdatePacket packet
4272 = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate);
4273
4274 packet.RegionData.RegionHandle = m_scene.RegionInfo.RegionHandle;
4275 packet.RegionData.TimeDilation = Utils.FloatToUInt16(1, 0.0f, 1.0f);
4276 packet.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
4277 packet.ObjectData[0] = CreateImprovedTerseBlock(entity, false);
4278 OutPacket(packet, ThrottleOutPacketType.Unknown, true);
4279 return;
4280 }
4281*/
4282 if (entity is SceneObjectPart) 4291 if (entity is SceneObjectPart)
4283 { 4292 {
4284 SceneObjectPart p = (SceneObjectPart)entity; 4293 SceneObjectPart p = (SceneObjectPart)entity;
@@ -4297,7 +4306,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4297 } 4306 }
4298 } 4307 }
4299 4308
4300 //double priority = m_prioritizer.GetUpdatePriority(this, entity);
4301 uint priority = m_prioritizer.GetUpdatePriority(this, entity); 4309 uint priority = m_prioritizer.GetUpdatePriority(this, entity);
4302 4310
4303 lock (m_entityUpdates.SyncRoot) 4311 lock (m_entityUpdates.SyncRoot)