diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 185 |
1 files changed, 114 insertions, 71 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 092c96e..3d4269f 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -37,6 +37,7 @@ using System.Xml; | |||
37 | using log4net; | 37 | using log4net; |
38 | using OpenMetaverse; | 38 | using OpenMetaverse; |
39 | using OpenMetaverse.Packets; | 39 | using OpenMetaverse.Packets; |
40 | using OpenMetaverse.Messages.Linden; | ||
40 | using OpenMetaverse.StructuredData; | 41 | using OpenMetaverse.StructuredData; |
41 | using OpenSim.Framework; | 42 | using OpenSim.Framework; |
42 | using OpenSim.Framework.Client; | 43 | using OpenSim.Framework.Client; |
@@ -59,7 +60,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
59 | public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector | 60 | public class LLClientView : IClientAPI, IClientCore, IClientIM, IClientChat, IClientIPEndpoint, IStatsCollector |
60 | { | 61 | { |
61 | /// <value> | 62 | /// <value> |
62 | /// Debug packet level. At the moment, only 255 does anything (prints out all in and out packets). | 63 | /// Debug packet level. See OpenSim.RegisterConsoleCommands() for more details. |
63 | /// </value> | 64 | /// </value> |
64 | protected int m_debugPacketLevel = 0; | 65 | protected int m_debugPacketLevel = 0; |
65 | 66 | ||
@@ -3407,6 +3408,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3407 | 3408 | ||
3408 | avp.Sender.IsTrial = false; | 3409 | avp.Sender.IsTrial = false; |
3409 | avp.Sender.ID = agentID; | 3410 | avp.Sender.ID = agentID; |
3411 | m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); | ||
3410 | OutPacket(avp, ThrottleOutPacketType.Task); | 3412 | OutPacket(avp, ThrottleOutPacketType.Task); |
3411 | } | 3413 | } |
3412 | 3414 | ||
@@ -4199,94 +4201,101 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4199 | 4201 | ||
4200 | public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) | 4202 | public void SendLandProperties(int sequence_id, bool snap_selection, int request_result, LandData landData, float simObjectBonusFactor, int parcelObjectCapacity, int simObjectCapacity, uint regionFlags) |
4201 | { | 4203 | { |
4202 | ParcelPropertiesPacket updatePacket = (ParcelPropertiesPacket)PacketPool.Instance.GetPacket(PacketType.ParcelProperties); | 4204 | ParcelPropertiesMessage updateMessage = new ParcelPropertiesMessage(); |
4203 | // TODO: don't create new blocks if recycling an old packet | ||
4204 | 4205 | ||
4205 | updatePacket.ParcelData.AABBMax = landData.AABBMax; | 4206 | updateMessage.AABBMax = landData.AABBMax; |
4206 | updatePacket.ParcelData.AABBMin = landData.AABBMin; | 4207 | updateMessage.AABBMin = landData.AABBMin; |
4207 | updatePacket.ParcelData.Area = landData.Area; | 4208 | updateMessage.Area = landData.Area; |
4208 | updatePacket.ParcelData.AuctionID = landData.AuctionID; | 4209 | updateMessage.AuctionID = landData.AuctionID; |
4209 | updatePacket.ParcelData.AuthBuyerID = landData.AuthBuyerID; | 4210 | updateMessage.AuthBuyerID = landData.AuthBuyerID; |
4210 | 4211 | ||
4211 | updatePacket.ParcelData.Bitmap = landData.Bitmap; | 4212 | updateMessage.Bitmap = landData.Bitmap; |
4212 | 4213 | ||
4213 | updatePacket.ParcelData.Desc = Utils.StringToBytes(landData.Description); | 4214 | updateMessage.Desc = landData.Description; |
4214 | updatePacket.ParcelData.Category = (byte)landData.Category; | 4215 | updateMessage.Category = landData.Category; |
4215 | updatePacket.ParcelData.ClaimDate = landData.ClaimDate; | 4216 | updateMessage.ClaimDate = Util.ToDateTime(landData.ClaimDate); |
4216 | updatePacket.ParcelData.ClaimPrice = landData.ClaimPrice; | 4217 | updateMessage.ClaimPrice = landData.ClaimPrice; |
4217 | updatePacket.ParcelData.GroupID = landData.GroupID; | 4218 | updateMessage.GroupID = landData.GroupID; |
4218 | updatePacket.ParcelData.GroupPrims = landData.GroupPrims; | 4219 | updateMessage.GroupPrims = landData.GroupPrims; |
4219 | updatePacket.ParcelData.IsGroupOwned = landData.IsGroupOwned; | 4220 | updateMessage.IsGroupOwned = landData.IsGroupOwned; |
4220 | updatePacket.ParcelData.LandingType = landData.LandingType; | 4221 | updateMessage.LandingType = (LandingType) landData.LandingType; |
4221 | updatePacket.ParcelData.LocalID = landData.LocalID; | 4222 | updateMessage.LocalID = landData.LocalID; |
4222 | 4223 | ||
4223 | if (landData.Area > 0) | 4224 | if (landData.Area > 0) |
4224 | { | 4225 | { |
4225 | updatePacket.ParcelData.MaxPrims = parcelObjectCapacity; | 4226 | updateMessage.MaxPrims = parcelObjectCapacity; |
4226 | } | 4227 | } |
4227 | else | 4228 | else |
4228 | { | 4229 | { |
4229 | updatePacket.ParcelData.MaxPrims = 0; | 4230 | updateMessage.MaxPrims = 0; |
4230 | } | 4231 | } |
4231 | 4232 | ||
4232 | updatePacket.ParcelData.MediaAutoScale = landData.MediaAutoScale; | 4233 | updateMessage.MediaAutoScale = Convert.ToBoolean(landData.MediaAutoScale); |
4233 | updatePacket.ParcelData.MediaID = landData.MediaID; | 4234 | updateMessage.MediaID = landData.MediaID; |
4234 | updatePacket.ParcelData.MediaURL = Util.StringToBytes256(landData.MediaURL); | 4235 | updateMessage.MediaURL = landData.MediaURL; |
4235 | updatePacket.ParcelData.MusicURL = Util.StringToBytes256(landData.MusicURL); | 4236 | updateMessage.MusicURL = landData.MusicURL; |
4236 | updatePacket.ParcelData.Name = Util.StringToBytes256(landData.Name); | 4237 | updateMessage.Name = landData.Name; |
4237 | updatePacket.ParcelData.OtherCleanTime = landData.OtherCleanTime; | 4238 | updateMessage.OtherCleanTime = landData.OtherCleanTime; |
4238 | updatePacket.ParcelData.OtherCount = 0; //TODO: Unimplemented | 4239 | updateMessage.OtherCount = 0; //TODO: Unimplemented |
4239 | updatePacket.ParcelData.OtherPrims = landData.OtherPrims; | 4240 | updateMessage.OtherPrims = landData.OtherPrims; |
4240 | updatePacket.ParcelData.OwnerID = landData.OwnerID; | 4241 | updateMessage.OwnerID = landData.OwnerID; |
4241 | updatePacket.ParcelData.OwnerPrims = landData.OwnerPrims; | 4242 | updateMessage.OwnerPrims = landData.OwnerPrims; |
4242 | updatePacket.ParcelData.ParcelFlags = landData.Flags; | 4243 | updateMessage.ParcelFlags = (ParcelFlags) landData.Flags; |
4243 | updatePacket.ParcelData.ParcelPrimBonus = simObjectBonusFactor; | 4244 | updateMessage.ParcelPrimBonus = simObjectBonusFactor; |
4244 | updatePacket.ParcelData.PassHours = landData.PassHours; | 4245 | updateMessage.PassHours = landData.PassHours; |
4245 | updatePacket.ParcelData.PassPrice = landData.PassPrice; | 4246 | updateMessage.PassPrice = landData.PassPrice; |
4246 | updatePacket.ParcelData.PublicCount = 0; //TODO: Unimplemented | 4247 | updateMessage.PublicCount = 0; //TODO: Unimplemented |
4247 | 4248 | ||
4248 | updatePacket.ParcelData.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0; | 4249 | updateMessage.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0; |
4249 | updatePacket.ParcelData.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0; | 4250 | updateMessage.RegionDenyAnonymous = (regionFlags & (uint)RegionFlags.DenyAnonymous) > 0; |
4250 | updatePacket.ParcelData.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0; | 4251 | |
4251 | updatePacket.ParcelData.RegionPushOverride = (regionFlags & (uint)RegionFlags.RestrictPushObject) > 0; | 4252 | //updateMessage.RegionDenyIdentified = (regionFlags & (uint)RegionFlags.DenyIdentified) > 0; |
4252 | 4253 | //updateMessage.RegionDenyTransacted = (regionFlags & (uint)RegionFlags.DenyTransacted) > 0; | |
4253 | updatePacket.ParcelData.RentPrice = 0; | 4254 | |
4254 | updatePacket.ParcelData.RequestResult = request_result; | 4255 | updateMessage.RentPrice = 0; |
4255 | updatePacket.ParcelData.SalePrice = landData.SalePrice; | 4256 | updateMessage.RequestResult = (ParcelResult) request_result; |
4256 | updatePacket.ParcelData.SelectedPrims = landData.SelectedPrims; | 4257 | updateMessage.SalePrice = landData.SalePrice; |
4257 | updatePacket.ParcelData.SelfCount = 0; //TODO: Unimplemented | 4258 | updateMessage.SelectedPrims = landData.SelectedPrims; |
4258 | updatePacket.ParcelData.SequenceID = sequence_id; | 4259 | updateMessage.SelfCount = 0; //TODO: Unimplemented |
4260 | updateMessage.SequenceID = sequence_id; | ||
4259 | if (landData.SimwideArea > 0) | 4261 | if (landData.SimwideArea > 0) |
4260 | { | 4262 | { |
4261 | updatePacket.ParcelData.SimWideMaxPrims = parcelObjectCapacity; | 4263 | updateMessage.SimWideMaxPrims = parcelObjectCapacity; |
4262 | } | 4264 | } |
4263 | else | 4265 | else |
4264 | { | 4266 | { |
4265 | updatePacket.ParcelData.SimWideMaxPrims = 0; | 4267 | updateMessage.SimWideMaxPrims = 0; |
4266 | } | 4268 | } |
4267 | updatePacket.ParcelData.SimWideTotalPrims = landData.SimwidePrims; | 4269 | updateMessage.SimWideTotalPrims = landData.SimwidePrims; |
4268 | updatePacket.ParcelData.SnapSelection = snap_selection; | 4270 | updateMessage.SnapSelection = snap_selection; |
4269 | updatePacket.ParcelData.SnapshotID = landData.SnapshotID; | 4271 | updateMessage.SnapshotID = landData.SnapshotID; |
4270 | updatePacket.ParcelData.Status = (byte)landData.Status; | 4272 | updateMessage.Status = (ParcelStatus) landData.Status; |
4271 | updatePacket.ParcelData.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims + | 4273 | updateMessage.TotalPrims = landData.OwnerPrims + landData.GroupPrims + landData.OtherPrims + |
4272 | landData.SelectedPrims; | 4274 | landData.SelectedPrims; |
4273 | updatePacket.ParcelData.UserLocation = landData.UserLocation; | 4275 | updateMessage.UserLocation = landData.UserLocation; |
4274 | updatePacket.ParcelData.UserLookAt = landData.UserLookAt; | 4276 | updateMessage.UserLookAt = landData.UserLookAt; |
4275 | updatePacket.Header.Zerocoded = true; | 4277 | |
4278 | updateMessage.MediaType = landData.MediaType; | ||
4279 | updateMessage.MediaDesc = landData.MediaDescription; | ||
4280 | updateMessage.MediaWidth = landData.MediaWidth; | ||
4281 | updateMessage.MediaHeight = landData.MediaHeight; | ||
4282 | updateMessage.MediaLoop = landData.MediaLoop; | ||
4283 | updateMessage.ObscureMusic = landData.ObscureMusic; | ||
4284 | updateMessage.ObscureMedia = landData.ObscureMedia; | ||
4276 | 4285 | ||
4277 | try | 4286 | try |
4278 | { | 4287 | { |
4279 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); | 4288 | IEventQueue eq = Scene.RequestModuleInterface<IEventQueue>(); |
4280 | if (eq != null) | 4289 | if (eq != null) |
4281 | { | 4290 | { |
4282 | eq.ParcelProperties(updatePacket, this.AgentId); | 4291 | eq.ParcelProperties(updateMessage, this.AgentId); |
4283 | } | 4292 | } else { |
4293 | m_log.Warn("No EQ Interface when sending parcel data."); | ||
4294 | } | ||
4284 | } | 4295 | } |
4285 | catch (Exception ex) | 4296 | catch (Exception ex) |
4286 | { | 4297 | { |
4287 | m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); | 4298 | m_log.Error("Unable to send parcel data via eventqueue - exception: " + ex.ToString()); |
4288 | m_log.Warn("sending parcel data via UDP"); | ||
4289 | OutPacket(updatePacket, ThrottleOutPacketType.Task); | ||
4290 | } | 4299 | } |
4291 | } | 4300 | } |
4292 | 4301 | ||
@@ -11166,8 +11175,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11166 | /// handles splitting manually</param> | 11175 | /// handles splitting manually</param> |
11167 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) | 11176 | protected void OutPacket(Packet packet, ThrottleOutPacketType throttlePacketType, bool doAutomaticSplitting) |
11168 | { | 11177 | { |
11169 | if (m_debugPacketLevel >= 255) | 11178 | if (m_debugPacketLevel > 0) |
11170 | m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); | 11179 | { |
11180 | bool outputPacket = true; | ||
11181 | |||
11182 | if (m_debugPacketLevel <= 255 | ||
11183 | && (packet.Type == PacketType.SimStats || packet.Type == PacketType.SimulatorViewerTimeMessage)) | ||
11184 | outputPacket = false; | ||
11185 | |||
11186 | if (m_debugPacketLevel <= 200 | ||
11187 | && | ||
11188 | (packet.Type == PacketType.ImagePacket | ||
11189 | || packet.Type == PacketType.ImageData | ||
11190 | || packet.Type == PacketType.LayerData | ||
11191 | || packet.Type == PacketType.CoarseLocationUpdate)) | ||
11192 | outputPacket = false; | ||
11193 | |||
11194 | if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.AvatarAnimation || packet.Type == PacketType.ViewerEffect)) | ||
11195 | outputPacket = false; | ||
11196 | |||
11197 | if (outputPacket) | ||
11198 | m_log.DebugFormat("[CLIENT]: Packet OUT {0}", packet.Type); | ||
11199 | } | ||
11171 | 11200 | ||
11172 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); | 11201 | m_udpServer.SendPacket(m_udpClient, packet, throttlePacketType, doAutomaticSplitting); |
11173 | } | 11202 | } |
@@ -11238,15 +11267,29 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11238 | /// Entryway from the client to the simulator. All UDP packets from the client will end up here | 11267 | /// Entryway from the client to the simulator. All UDP packets from the client will end up here |
11239 | /// </summary> | 11268 | /// </summary> |
11240 | /// <param name="Pack">OpenMetaverse.packet</param> | 11269 | /// <param name="Pack">OpenMetaverse.packet</param> |
11241 | public void ProcessInPacket(Packet Pack) | 11270 | public void ProcessInPacket(Packet packet) |
11242 | { | 11271 | { |
11243 | if (m_debugPacketLevel >= 255) | 11272 | if (m_debugPacketLevel > 0) |
11244 | m_log.DebugFormat("[CLIENT]: Packet IN {0}", Pack.Type); | 11273 | { |
11274 | bool outputPacket = true; | ||
11275 | |||
11276 | if (m_debugPacketLevel <= 255 && packet.Type == PacketType.AgentUpdate) | ||
11277 | outputPacket = false; | ||
11278 | |||
11279 | if (m_debugPacketLevel <= 200 && packet.Type == PacketType.RequestImage) | ||
11280 | outputPacket = false; | ||
11281 | |||
11282 | if (m_debugPacketLevel <= 100 && (packet.Type == PacketType.ViewerEffect || packet.Type == PacketType.AgentAnimation)) | ||
11283 | outputPacket = false; | ||
11284 | |||
11285 | if (outputPacket) | ||
11286 | m_log.DebugFormat("[CLIENT]: Packet IN {0}", packet.Type); | ||
11287 | } | ||
11245 | 11288 | ||
11246 | if (!ProcessPacketMethod(Pack)) | 11289 | if (!ProcessPacketMethod(packet)) |
11247 | m_log.Warn("[CLIENT]: unhandled packet " + Pack.Type); | 11290 | m_log.Warn("[CLIENT]: unhandled packet " + packet.Type); |
11248 | 11291 | ||
11249 | PacketPool.Instance.ReturnPacket(Pack); | 11292 | PacketPool.Instance.ReturnPacket(packet); |
11250 | } | 11293 | } |
11251 | 11294 | ||
11252 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) | 11295 | private static PrimitiveBaseShape GetShapeFromAddPacket(ObjectAddPacket addPacket) |