diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP')
4 files changed, 50 insertions, 18 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index b53a2fb..9869a99 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | |||
@@ -31,7 +31,6 @@ using OpenMetaverse; | |||
31 | using OpenMetaverse.Imaging; | 31 | using OpenMetaverse.Imaging; |
32 | using OpenSim.Framework; | 32 | using OpenSim.Framework; |
33 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes.Hypergrid; | ||
35 | using OpenSim.Services.Interfaces; | 34 | using OpenSim.Services.Interfaces; |
36 | using log4net; | 35 | using log4net; |
37 | using System.Reflection; | 36 | using System.Reflection; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 2ca2657..ef49205 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -40,11 +40,10 @@ using OpenMetaverse.Packets; | |||
40 | using OpenMetaverse.StructuredData; | 40 | using OpenMetaverse.StructuredData; |
41 | using OpenSim.Framework; | 41 | using OpenSim.Framework; |
42 | using OpenSim.Framework.Client; | 42 | using OpenSim.Framework.Client; |
43 | using OpenSim.Framework.Communications.Cache; | 43 | |
44 | using OpenSim.Framework.Statistics; | 44 | using OpenSim.Framework.Statistics; |
45 | using OpenSim.Region.Framework.Interfaces; | 45 | using OpenSim.Region.Framework.Interfaces; |
46 | using OpenSim.Region.Framework.Scenes; | 46 | using OpenSim.Region.Framework.Scenes; |
47 | using OpenSim.Region.Framework.Scenes.Hypergrid; | ||
48 | using OpenSim.Services.Interfaces; | 47 | using OpenSim.Services.Interfaces; |
49 | using Timer = System.Timers.Timer; | 48 | using Timer = System.Timers.Timer; |
50 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 49 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
@@ -122,7 +121,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
122 | public event ObjectAttach OnObjectAttach; | 121 | public event ObjectAttach OnObjectAttach; |
123 | public event ObjectDeselect OnObjectDetach; | 122 | public event ObjectDeselect OnObjectDetach; |
124 | public event ObjectDrop OnObjectDrop; | 123 | public event ObjectDrop OnObjectDrop; |
125 | public event GenericCall2 OnCompleteMovementToRegion; | 124 | public event GenericCall1 OnCompleteMovementToRegion; |
126 | public event UpdateAgent OnAgentUpdate; | 125 | public event UpdateAgent OnAgentUpdate; |
127 | public event AgentRequestSit OnAgentRequestSit; | 126 | public event AgentRequestSit OnAgentRequestSit; |
128 | public event AgentSit OnAgentSit; | 127 | public event AgentSit OnAgentSit; |
@@ -353,6 +352,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
353 | private bool m_SendLogoutPacketWhenClosing = true; | 352 | private bool m_SendLogoutPacketWhenClosing = true; |
354 | private AgentUpdateArgs lastarg; | 353 | private AgentUpdateArgs lastarg; |
355 | private bool m_IsActive = true; | 354 | private bool m_IsActive = true; |
355 | private bool m_IsLoggingOut = false; | ||
356 | 356 | ||
357 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); | 357 | protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); |
358 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers | 358 | protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers |
@@ -416,6 +416,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
416 | get { return m_IsActive; } | 416 | get { return m_IsActive; } |
417 | set { m_IsActive = value; } | 417 | set { m_IsActive = value; } |
418 | } | 418 | } |
419 | public bool IsLoggingOut | ||
420 | { | ||
421 | get { return m_IsLoggingOut; } | ||
422 | set { m_IsLoggingOut = value; } | ||
423 | } | ||
424 | |||
419 | public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } } | 425 | public bool SendLogoutPacketWhenClosing { set { m_SendLogoutPacketWhenClosing = value; } } |
420 | 426 | ||
421 | #endregion Properties | 427 | #endregion Properties |
@@ -2527,6 +2533,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
2527 | 2533 | ||
2528 | public void SendAsset(AssetRequestToClient req) | 2534 | public void SendAsset(AssetRequestToClient req) |
2529 | { | 2535 | { |
2536 | if (req.AssetInf.Data == null) | ||
2537 | { | ||
2538 | m_log.ErrorFormat("Cannot send asset {0} ({1}), asset data is null", | ||
2539 | req.AssetInf.ID, req.AssetInf.Metadata.ContentType); | ||
2540 | return; | ||
2541 | } | ||
2542 | |||
2530 | //m_log.Debug("sending asset " + req.RequestAssetID); | 2543 | //m_log.Debug("sending asset " + req.RequestAssetID); |
2531 | TransferInfoPacket Transfer = new TransferInfoPacket(); | 2544 | TransferInfoPacket Transfer = new TransferInfoPacket(); |
2532 | Transfer.TransferInfo.ChannelType = 2; | 2545 | Transfer.TransferInfo.ChannelType = 2; |
@@ -4065,10 +4078,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4065 | EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); | 4078 | EstateCovenantReplyPacket.DataBlock edata = new EstateCovenantReplyPacket.DataBlock(); |
4066 | edata.CovenantID = covenant; | 4079 | edata.CovenantID = covenant; |
4067 | edata.CovenantTimestamp = 0; | 4080 | edata.CovenantTimestamp = 0; |
4068 | if (m_scene.RegionInfo.EstateSettings.EstateOwner != UUID.Zero) | 4081 | edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; |
4069 | edata.EstateOwnerID = m_scene.RegionInfo.EstateSettings.EstateOwner; | ||
4070 | else | ||
4071 | edata.EstateOwnerID = m_scene.RegionInfo.MasterAvatarAssignedUUID; | ||
4072 | edata.EstateName = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName); | 4082 | edata.EstateName = Utils.StringToBytes(m_scene.RegionInfo.EstateSettings.EstateName); |
4073 | einfopack.Data = edata; | 4083 | einfopack.Data = edata; |
4074 | OutPacket(einfopack, ThrottleOutPacketType.Task); | 4084 | OutPacket(einfopack, ThrottleOutPacketType.Task); |
@@ -4089,8 +4099,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4089 | 4099 | ||
4090 | //Sending Estate Settings | 4100 | //Sending Estate Settings |
4091 | returnblock[0].Parameter = Utils.StringToBytes(estateName); | 4101 | returnblock[0].Parameter = Utils.StringToBytes(estateName); |
4092 | // TODO: remove this cruft once MasterAvatar is fully deprecated | ||
4093 | // | ||
4094 | returnblock[1].Parameter = Utils.StringToBytes(estateOwner.ToString()); | 4102 | returnblock[1].Parameter = Utils.StringToBytes(estateOwner.ToString()); |
4095 | returnblock[2].Parameter = Utils.StringToBytes(estateID.ToString()); | 4103 | returnblock[2].Parameter = Utils.StringToBytes(estateID.ToString()); |
4096 | 4104 | ||
@@ -5518,6 +5526,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5518 | // for the client session anyway, in order to protect ourselves against bad code in plugins | 5526 | // for the client session anyway, in order to protect ourselves against bad code in plugins |
5519 | try | 5527 | try |
5520 | { | 5528 | { |
5529 | |||
5521 | byte[] visualparams = new byte[appear.VisualParam.Length]; | 5530 | byte[] visualparams = new byte[appear.VisualParam.Length]; |
5522 | for (int i = 0; i < appear.VisualParam.Length; i++) | 5531 | for (int i = 0; i < appear.VisualParam.Length; i++) |
5523 | visualparams[i] = appear.VisualParam[i].ParamValue; | 5532 | visualparams[i] = appear.VisualParam[i].ParamValue; |
@@ -5728,10 +5737,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5728 | 5737 | ||
5729 | private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) | 5738 | private bool HandleCompleteAgentMovement(IClientAPI sender, Packet Pack) |
5730 | { | 5739 | { |
5731 | GenericCall2 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; | 5740 | GenericCall1 handlerCompleteMovementToRegion = OnCompleteMovementToRegion; |
5732 | if (handlerCompleteMovementToRegion != null) | 5741 | if (handlerCompleteMovementToRegion != null) |
5733 | { | 5742 | { |
5734 | handlerCompleteMovementToRegion(); | 5743 | handlerCompleteMovementToRegion(sender); |
5735 | } | 5744 | } |
5736 | handlerCompleteMovementToRegion = null; | 5745 | handlerCompleteMovementToRegion = null; |
5737 | 5746 | ||
@@ -7051,7 +7060,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7051 | assetRequestItem = invService.GetItem(assetRequestItem); | 7060 | assetRequestItem = invService.GetItem(assetRequestItem); |
7052 | if (assetRequestItem == null) | 7061 | if (assetRequestItem == null) |
7053 | { | 7062 | { |
7054 | assetRequestItem = ((Scene)m_scene).CommsManager.UserProfileCacheService.LibraryRoot.FindItem(itemID); | 7063 | ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>(); |
7064 | if (lib != null) | ||
7065 | assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); | ||
7055 | if (assetRequestItem == null) | 7066 | if (assetRequestItem == null) |
7056 | return true; | 7067 | return true; |
7057 | } | 7068 | } |
@@ -11346,6 +11357,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11346 | const uint m_maxPacketSize = 600; | 11357 | const uint m_maxPacketSize = 600; |
11347 | int numPackets = 1; | 11358 | int numPackets = 1; |
11348 | 11359 | ||
11360 | if (data == null) | ||
11361 | return 0; | ||
11362 | |||
11349 | if (data.LongLength > m_maxPacketSize) | 11363 | if (data.LongLength > m_maxPacketSize) |
11350 | { | 11364 | { |
11351 | // over max number of bytes so split up file | 11365 | // over max number of bytes so split up file |
@@ -11591,5 +11605,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11591 | packet.PropertiesData.LanguagesText = Utils.StringToBytes(languages); | 11605 | packet.PropertiesData.LanguagesText = Utils.StringToBytes(languages); |
11592 | OutPacket(packet, ThrottleOutPacketType.Task); | 11606 | OutPacket(packet, ThrottleOutPacketType.Task); |
11593 | } | 11607 | } |
11608 | |||
11609 | public void SendChangeUserRights(UUID agentID, UUID friendID, int rights) | ||
11610 | { | ||
11611 | ChangeUserRightsPacket packet = (ChangeUserRightsPacket)PacketPool.Instance.GetPacket(PacketType.ChangeUserRights); | ||
11612 | |||
11613 | packet.AgentData = new ChangeUserRightsPacket.AgentDataBlock(); | ||
11614 | packet.AgentData.AgentID = agentID; | ||
11615 | |||
11616 | packet.Rights = new ChangeUserRightsPacket.RightsBlock[1]; | ||
11617 | packet.Rights[0] = new ChangeUserRightsPacket.RightsBlock(); | ||
11618 | packet.Rights[0].AgentRelated = friendID; | ||
11619 | packet.Rights[0].RelatedRights = rights; | ||
11620 | |||
11621 | OutPacket(packet, ThrottleOutPacketType.Task); | ||
11622 | } | ||
11594 | } | 11623 | } |
11595 | } | 11624 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs index adf171e..10e5a95 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLFileTransfer.cs | |||
@@ -197,7 +197,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
197 | 197 | ||
198 | private void Initialise(UUID fileID, string fileName) | 198 | private void Initialise(UUID fileID, string fileName) |
199 | { | 199 | { |
200 | m_asset = new AssetBase(fileID, fileName, type); | 200 | m_asset = new AssetBase(fileID, fileName, type, UUID.Zero.ToString()); |
201 | m_asset.Data = new byte[0]; | 201 | m_asset.Data = new byte[0]; |
202 | m_asset.Description = "empty"; | 202 | m_asset.Description = "empty"; |
203 | m_asset.Local = true; | 203 | m_asset.Local = true; |
@@ -212,6 +212,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
212 | 212 | ||
213 | public void RequestStartXfer(IClientAPI pRemoteClient) | 213 | public void RequestStartXfer(IClientAPI pRemoteClient) |
214 | { | 214 | { |
215 | m_asset.Metadata.CreatorID = pRemoteClient.AgentId.ToString(); | ||
216 | |||
215 | if (!String.IsNullOrEmpty(m_asset.Name)) | 217 | if (!String.IsNullOrEmpty(m_asset.Name)) |
216 | { | 218 | { |
217 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); | 219 | pRemoteClient.SendXferRequest(mXferID, m_asset.Type, m_asset.FullID, 0, Utils.StringToBytes(m_asset.Name)); |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index 3c4fa72..36d24e8 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs | |||
@@ -596,15 +596,14 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
596 | } | 596 | } |
597 | catch (MalformedDataException) | 597 | catch (MalformedDataException) |
598 | { | 598 | { |
599 | m_log.ErrorFormat("[LLUDPSERVER]: Malformed data, cannot parse packet from {0}:\n{1}", | ||
600 | buffer.RemoteEndPoint, Utils.BytesToHexString(buffer.Data, buffer.DataLength, null)); | ||
601 | } | 599 | } |
602 | 600 | ||
603 | // Fail-safe check | 601 | // Fail-safe check |
604 | if (packet == null) | 602 | if (packet == null) |
605 | { | 603 | { |
606 | m_log.Warn("[LLUDPSERVER]: Couldn't build a message from incoming data " + buffer.DataLength + | 604 | m_log.ErrorFormat("[LLUDPSERVER]: Malformed data, cannot parse {0} byte packet from {1}:", |
607 | " bytes long from " + buffer.RemoteEndPoint); | 605 | buffer.DataLength, buffer.RemoteEndPoint); |
606 | m_log.Error(Utils.BytesToHexString(buffer.Data, buffer.DataLength, null)); | ||
608 | return; | 607 | return; |
609 | } | 608 | } |
610 | 609 | ||
@@ -919,7 +918,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
919 | // Remove this client from the scene | 918 | // Remove this client from the scene |
920 | IClientAPI client; | 919 | IClientAPI client; |
921 | if (m_scene.TryGetClient(udpClient.AgentID, out client)) | 920 | if (m_scene.TryGetClient(udpClient.AgentID, out client)) |
921 | { | ||
922 | client.IsLoggingOut = true; | ||
922 | client.Close(); | 923 | client.Close(); |
924 | } | ||
923 | } | 925 | } |
924 | 926 | ||
925 | private void IncomingPacketHandler() | 927 | private void IncomingPacketHandler() |