From c01dfe4953561d9b54a68a6e99ffaf8310bd5b66 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Tue, 8 Jan 2008 15:01:15 +0000 Subject: * Removed superfluous and erroneous perms check on parts. --- OpenSim/Region/ClientStack/ClientView.cs | 782 +++++++++++++++---------------- 1 file changed, 390 insertions(+), 392 deletions(-) diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 24157ae..23160cd 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -39,7 +39,7 @@ using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; using OpenSim.Framework.Console; using OpenSim.Region.Environment.Scenes; -using Timer=System.Timers.Timer; +using Timer = System.Timers.Timer; namespace OpenSim.Region.ClientStack { @@ -73,7 +73,7 @@ namespace OpenSim.Region.ClientStack private readonly uint m_circuitCode; private int m_moneyBalance; - private readonly byte[] m_channelVersion = new byte[] {0x00}; // Dummy value needed by libSL + private readonly byte[] m_channelVersion = new byte[] { 0x00 }; // Dummy value needed by libSL /* protected variables */ @@ -224,7 +224,7 @@ namespace OpenSim.Region.ClientStack { m_scene.RemoveClient(AgentId); // Send the STOP packet - DisableSimulatorPacket disable = (DisableSimulatorPacket) PacketPool.Instance.GetPacket(PacketType.DisableSimulator); + DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); OutPacket(disable, ThrottleOutPacketType.Task); @@ -574,7 +574,7 @@ namespace OpenSim.Region.ClientStack /// public void SendRegionHandshake(RegionInfo regionInfo) { - RegionHandshakePacket handshake = (RegionHandshakePacket) PacketPool.Instance.GetPacket(PacketType.RegionHandshake); + RegionHandshakePacket handshake = (RegionHandshakePacket)PacketPool.Instance.GetPacket(PacketType.RegionHandshake); handshake.RegionInfo.BillableFactor = regionInfo.EstateSettings.billableFactor; handshake.RegionInfo.IsEstateManager = false; @@ -586,10 +586,10 @@ namespace OpenSim.Region.ClientStack handshake.RegionInfo.TerrainStartHeight01 = regionInfo.EstateSettings.terrainStartHeight1; handshake.RegionInfo.TerrainStartHeight10 = regionInfo.EstateSettings.terrainStartHeight2; handshake.RegionInfo.TerrainStartHeight11 = regionInfo.EstateSettings.terrainStartHeight3; - handshake.RegionInfo.SimAccess = (byte) regionInfo.EstateSettings.simAccess; + handshake.RegionInfo.SimAccess = (byte)regionInfo.EstateSettings.simAccess; handshake.RegionInfo.WaterHeight = regionInfo.EstateSettings.waterHeight; - handshake.RegionInfo.RegionFlags = (uint) regionInfo.EstateSettings.regionFlags; + handshake.RegionInfo.RegionFlags = (uint)regionInfo.EstateSettings.regionFlags; handshake.RegionInfo.SimName = Helpers.StringToField(regionInfo.RegionName); handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID; handshake.RegionInfo.TerrainBase0 = regionInfo.EstateSettings.terrainBase0; @@ -611,7 +611,7 @@ namespace OpenSim.Region.ClientStack /// public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) { - AgentMovementCompletePacket mov = (AgentMovementCompletePacket) PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); + AgentMovementCompletePacket mov = (AgentMovementCompletePacket)PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); mov.SimData.ChannelVersion = m_channelVersion; mov.AgentData.SessionID = m_sessionId; mov.AgentData.AgentID = AgentId; @@ -646,7 +646,7 @@ namespace OpenSim.Region.ClientStack public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) { - ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket) PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); + ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); reply.ChatData.Audible = 1; reply.ChatData.Message = message; reply.ChatData.ChatType = type; @@ -667,7 +667,7 @@ namespace OpenSim.Region.ClientStack public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) { - ImprovedInstantMessagePacket msg = (ImprovedInstantMessagePacket) PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage); + ImprovedInstantMessagePacket msg = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage); msg.AgentData.AgentID = fromAgent; msg.AgentData.SessionID = fromAgentSession; msg.MessageBlock.FromAgentName = Helpers.StringToField(fromName); @@ -700,10 +700,10 @@ namespace OpenSim.Region.ClientStack { for (int x = 0; x < 16; x += 4) { - patches[0] = x + 0 + y*16; - patches[1] = x + 1 + y*16; - patches[2] = x + 2 + y*16; - patches[3] = x + 3 + y*16; + patches[0] = x + 0 + y * 16; + patches[1] = x + 1 + y * 16; + patches[2] = x + 2 + y * 16; + patches[3] = x + 3 + y * 16; Packet layerpack = TerrainManager.CreateLandPacket(map, patches); OutPacket(layerpack, ThrottleOutPacketType.Land); @@ -732,7 +732,7 @@ namespace OpenSim.Region.ClientStack patchx = px; patchy = py; - patches[0] = patchx + 0 + patchy*16; + patches[0] = patchx + 0 + patchy * 16; Packet layerpack = TerrainManager.CreateLandPacket(map, patches); OutPacket(layerpack, ThrottleOutPacketType.Land); @@ -753,18 +753,18 @@ namespace OpenSim.Region.ClientStack public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint) { IPAddress neighbourIP = neighbourEndPoint.Address; - ushort neighbourPort = (ushort) neighbourEndPoint.Port; + ushort neighbourPort = (ushort)neighbourEndPoint.Port; - EnableSimulatorPacket enablesimpacket = (EnableSimulatorPacket) PacketPool.Instance.GetPacket(PacketType.EnableSimulator); + EnableSimulatorPacket enablesimpacket = (EnableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.EnableSimulator); // TODO: don't create new blocks if recycling an old packet enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); enablesimpacket.SimulatorInfo.Handle = neighbourHandle; byte[] byteIP = neighbourIP.GetAddressBytes(); - enablesimpacket.SimulatorInfo.IP = (uint) byteIP[3] << 24; - enablesimpacket.SimulatorInfo.IP += (uint) byteIP[2] << 16; - enablesimpacket.SimulatorInfo.IP += (uint) byteIP[1] << 8; - enablesimpacket.SimulatorInfo.IP += (uint) byteIP[0]; + enablesimpacket.SimulatorInfo.IP = (uint)byteIP[3] << 24; + enablesimpacket.SimulatorInfo.IP += (uint)byteIP[2] << 16; + enablesimpacket.SimulatorInfo.IP += (uint)byteIP[1] << 8; + enablesimpacket.SimulatorInfo.IP += (uint)byteIP[0]; enablesimpacket.SimulatorInfo.Port = neighbourPort; OutPacket(enablesimpacket, ThrottleOutPacketType.Task); } @@ -790,9 +790,9 @@ namespace OpenSim.Region.ClientStack public void CrossRegion(ulong newRegionHandle, LLVector3 pos, LLVector3 lookAt, IPEndPoint externalIPEndPoint, string capsURL) { - LLVector3 look = new LLVector3(lookAt.X*10, lookAt.Y*10, lookAt.Z*10); + LLVector3 look = new LLVector3(lookAt.X * 10, lookAt.Y * 10, lookAt.Z * 10); - CrossedRegionPacket newSimPack = (CrossedRegionPacket) PacketPool.Instance.GetPacket(PacketType.CrossedRegion); + CrossedRegionPacket newSimPack = (CrossedRegionPacket)PacketPool.Instance.GetPacket(PacketType.CrossedRegion); // TODO: don't create new blocks if recycling an old packet newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock(); newSimPack.AgentData.AgentID = AgentId; @@ -803,11 +803,11 @@ namespace OpenSim.Region.ClientStack newSimPack.RegionData = new CrossedRegionPacket.RegionDataBlock(); newSimPack.RegionData.RegionHandle = newRegionHandle; byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes(); - newSimPack.RegionData.SimIP = (uint) byteIP[3] << 24; - newSimPack.RegionData.SimIP += (uint) byteIP[2] << 16; - newSimPack.RegionData.SimIP += (uint) byteIP[1] << 8; - newSimPack.RegionData.SimIP += (uint) byteIP[0]; - newSimPack.RegionData.SimPort = (ushort) externalIPEndPoint.Port; + newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; + newSimPack.RegionData.SimIP += (uint)byteIP[2] << 16; + newSimPack.RegionData.SimIP += (uint)byteIP[1] << 8; + newSimPack.RegionData.SimIP += (uint)byteIP[0]; + newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port; newSimPack.RegionData.SeedCapability = Helpers.StringToField(capsURL); OutPacket(newSimPack, ThrottleOutPacketType.Task); @@ -815,7 +815,7 @@ namespace OpenSim.Region.ClientStack public void SendMapBlock(List mapBlocks) { - MapBlockReplyPacket mapReply = (MapBlockReplyPacket) PacketPool.Instance.GetPacket(PacketType.MapBlockReply); + MapBlockReplyPacket mapReply = (MapBlockReplyPacket)PacketPool.Instance.GetPacket(PacketType.MapBlockReply); // TODO: don't create new blocks if recycling an old packet mapReply.AgentData.AgentID = AgentId; mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count]; @@ -838,7 +838,7 @@ namespace OpenSim.Region.ClientStack public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) { - TeleportLocalPacket tpLocal = (TeleportLocalPacket) PacketPool.Instance.GetPacket(PacketType.TeleportLocal); + TeleportLocalPacket tpLocal = (TeleportLocalPacket)PacketPool.Instance.GetPacket(PacketType.TeleportLocal); tpLocal.Info.AgentID = AgentId; tpLocal.Info.TeleportFlags = flags; tpLocal.Info.LocationID = 2; @@ -850,7 +850,7 @@ namespace OpenSim.Region.ClientStack public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags, string capsURL) { - TeleportFinishPacket teleport = (TeleportFinishPacket) PacketPool.Instance.GetPacket(PacketType.TeleportFinish); + TeleportFinishPacket teleport = (TeleportFinishPacket)PacketPool.Instance.GetPacket(PacketType.TeleportFinish); teleport.Info.AgentID = AgentId; teleport.Info.RegionHandle = regionHandle; teleport.Info.SimAccess = simAccess; @@ -859,13 +859,13 @@ namespace OpenSim.Region.ClientStack IPAddress oIP = newRegionEndPoint.Address; byte[] byteIP = oIP.GetAddressBytes(); - uint ip = (uint) byteIP[3] << 24; - ip += (uint) byteIP[2] << 16; - ip += (uint) byteIP[1] << 8; - ip += (uint) byteIP[0]; + uint ip = (uint)byteIP[3] << 24; + ip += (uint)byteIP[2] << 16; + ip += (uint)byteIP[1] << 8; + ip += (uint)byteIP[0]; teleport.Info.SimIP = ip; - teleport.Info.SimPort = (ushort) newRegionEndPoint.Port; + teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; teleport.Info.LocationID = 4; teleport.Info.TeleportFlags = 1 << 4; OutPacket(teleport, ThrottleOutPacketType.Task); @@ -876,7 +876,7 @@ namespace OpenSim.Region.ClientStack /// public void SendTeleportFailed() { - TeleportFailedPacket tpFailed = (TeleportFailedPacket) PacketPool.Instance.GetPacket(PacketType.TeleportFailed); + TeleportFailedPacket tpFailed = (TeleportFailedPacket)PacketPool.Instance.GetPacket(PacketType.TeleportFailed); tpFailed.Info.AgentID = AgentId; tpFailed.Info.Reason = Helpers.StringToField("unknown failure of teleport"); OutPacket(tpFailed, ThrottleOutPacketType.Task); @@ -887,14 +887,14 @@ namespace OpenSim.Region.ClientStack /// public void SendTeleportLocationStart() { - TeleportStartPacket tpStart = (TeleportStartPacket) PacketPool.Instance.GetPacket(PacketType.TeleportStart); + TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); tpStart.Info.TeleportFlags = 16; // Teleport via location OutPacket(tpStart, ThrottleOutPacketType.Task); } public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) { - MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket) PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); + MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket)PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); money.MoneyData.AgentID = AgentId; money.MoneyData.TransactionID = transaction; money.MoneyData.TransactionSuccess = success; @@ -905,7 +905,7 @@ namespace OpenSim.Region.ClientStack public void SendStartPingCheck(byte seq) { - StartPingCheckPacket pc = (StartPingCheckPacket) PacketPool.Instance.GetPacket(PacketType.StartPingCheck); + StartPingCheckPacket pc = (StartPingCheckPacket)PacketPool.Instance.GetPacket(PacketType.StartPingCheck); pc.PingID.PingID = seq; pc.Header.Reliable = false; OutPacket(pc, ThrottleOutPacketType.Task); @@ -913,7 +913,7 @@ namespace OpenSim.Region.ClientStack public void SendKillObject(ulong regionHandle, uint localID) { - KillObjectPacket kill = (KillObjectPacket) PacketPool.Instance.GetPacket(PacketType.KillObject); + KillObjectPacket kill = (KillObjectPacket)PacketPool.Instance.GetPacket(PacketType.KillObject); // TODO: don't create new blocks if recycling an old packet kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); @@ -1109,7 +1109,7 @@ namespace OpenSim.Region.ClientStack private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID) { - InventoryDescendentsPacket descend = (InventoryDescendentsPacket) PacketPool.Instance.GetPacket(PacketType.InventoryDescendents); + InventoryDescendentsPacket descend = (InventoryDescendentsPacket)PacketPool.Instance.GetPacket(PacketType.InventoryDescendents); descend.AgentData.AgentID = AgentId; descend.AgentData.OwnerID = ownerID; descend.AgentData.FolderID = folderID; @@ -1122,7 +1122,7 @@ namespace OpenSim.Region.ClientStack { Encoding enc = Encoding.ASCII; uint FULL_MASK_PERMISSIONS = 2147483647; - FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket) PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); + FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); // TODO: don't create new blocks if recycling an old packet inventoryReply.AgentData.AgentID = AgentId; inventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1]; @@ -1132,21 +1132,21 @@ namespace OpenSim.Region.ClientStack inventoryReply.InventoryData[0].CreatorID = item.creatorsID; inventoryReply.InventoryData[0].BaseMask = item.inventoryBasePermissions; inventoryReply.InventoryData[0].CreationDate = - (int) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; + (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; inventoryReply.InventoryData[0].Description = Helpers.StringToField(item.inventoryDescription); inventoryReply.InventoryData[0].EveryoneMask = item.inventoryEveryOnePermissions; inventoryReply.InventoryData[0].Flags = 0; inventoryReply.InventoryData[0].FolderID = item.parentFolderID; inventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); inventoryReply.InventoryData[0].GroupMask = 0; - inventoryReply.InventoryData[0].InvType = (sbyte) item.invType; + inventoryReply.InventoryData[0].InvType = (sbyte)item.invType; inventoryReply.InventoryData[0].Name = Helpers.StringToField(item.inventoryName); inventoryReply.InventoryData[0].NextOwnerMask = item.inventoryNextPermissions; inventoryReply.InventoryData[0].OwnerID = item.avatarID; inventoryReply.InventoryData[0].OwnerMask = item.inventoryCurrentPermissions; inventoryReply.InventoryData[0].SalePrice = 0; inventoryReply.InventoryData[0].SaleType = 0; - inventoryReply.InventoryData[0].Type = (sbyte) item.assetType; + inventoryReply.InventoryData[0].Type = (sbyte)item.assetType; inventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, inventoryReply.InventoryData[0].InvType, inventoryReply.InventoryData[0].Type, inventoryReply.InventoryData[0].AssetID, @@ -1164,7 +1164,7 @@ namespace OpenSim.Region.ClientStack { Encoding enc = Encoding.ASCII; uint FULL_MASK_PERMISSIONS = 2147483647; - UpdateCreateInventoryItemPacket InventoryReply = (UpdateCreateInventoryItemPacket) PacketPool.Instance.GetPacket(PacketType.UpdateCreateInventoryItem); + UpdateCreateInventoryItemPacket InventoryReply = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket(PacketType.UpdateCreateInventoryItem); // TODO: don't create new blocks if recycling an old packet InventoryReply.AgentData.AgentID = AgentId; InventoryReply.AgentData.SimApproved = true; @@ -1181,14 +1181,14 @@ namespace OpenSim.Region.ClientStack InventoryReply.InventoryData[0].FolderID = Item.parentFolderID; InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); InventoryReply.InventoryData[0].GroupMask = 0; - InventoryReply.InventoryData[0].InvType = (sbyte) Item.invType; + InventoryReply.InventoryData[0].InvType = (sbyte)Item.invType; InventoryReply.InventoryData[0].Name = Helpers.StringToField(Item.inventoryName); InventoryReply.InventoryData[0].NextOwnerMask = Item.inventoryNextPermissions; InventoryReply.InventoryData[0].OwnerID = Item.avatarID; InventoryReply.InventoryData[0].OwnerMask = Item.inventoryCurrentPermissions; InventoryReply.InventoryData[0].SalePrice = 100; InventoryReply.InventoryData[0].SaleType = 0; - InventoryReply.InventoryData[0].Type = (sbyte) Item.assetType; + InventoryReply.InventoryData[0].Type = (sbyte)Item.assetType; InventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, @@ -1203,7 +1203,7 @@ namespace OpenSim.Region.ClientStack public void SendRemoveInventoryItem(LLUUID itemID) { - RemoveInventoryItemPacket remove = (RemoveInventoryItemPacket) PacketPool.Instance.GetPacket(PacketType.RemoveInventoryItem); + RemoveInventoryItemPacket remove = (RemoveInventoryItemPacket)PacketPool.Instance.GetPacket(PacketType.RemoveInventoryItem); // TODO: don't create new blocks if recycling an old packet remove.AgentData.AgentID = AgentId; remove.AgentData.SessionID = m_sessionId; @@ -1216,7 +1216,7 @@ namespace OpenSim.Region.ClientStack public void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) { - ReplyTaskInventoryPacket replytask = (ReplyTaskInventoryPacket) PacketPool.Instance.GetPacket(PacketType.ReplyTaskInventory); + ReplyTaskInventoryPacket replytask = (ReplyTaskInventoryPacket)PacketPool.Instance.GetPacket(PacketType.ReplyTaskInventory); replytask.InventoryData.TaskID = taskID; replytask.InventoryData.Serial = serial; replytask.InventoryData.Filename = fileName; @@ -1225,7 +1225,7 @@ namespace OpenSim.Region.ClientStack public void SendXferPacket(ulong xferID, uint packet, byte[] data) { - SendXferPacketPacket sendXfer = (SendXferPacketPacket) PacketPool.Instance.GetPacket(PacketType.SendXferPacket); + SendXferPacketPacket sendXfer = (SendXferPacketPacket)PacketPool.Instance.GetPacket(PacketType.SendXferPacket); sendXfer.XferID.ID = xferID; sendXfer.XferID.Packet = packet; sendXfer.DataPacket.Data = data; @@ -1243,7 +1243,7 @@ namespace OpenSim.Region.ClientStack /// public void SendAlertMessage(string message) { - AlertMessagePacket alertPack = (AlertMessagePacket) PacketPool.Instance.GetPacket(PacketType.AlertMessage); + AlertMessagePacket alertPack = (AlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AlertMessage); alertPack.AlertData.Message = Helpers.StringToField(message); OutPacket(alertPack, ThrottleOutPacketType.Task); } @@ -1255,7 +1255,7 @@ namespace OpenSim.Region.ClientStack /// public void SendAgentAlertMessage(string message, bool modal) { - AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket) PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); + AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket)PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); alertPack.AgentData.AgentID = AgentId; alertPack.AlertData.Message = Helpers.StringToField(message); alertPack.AlertData.Modal = modal; @@ -1265,7 +1265,7 @@ namespace OpenSim.Region.ClientStack public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, string url) { - LoadURLPacket loadURL = (LoadURLPacket) PacketPool.Instance.GetPacket(PacketType.LoadURL); + LoadURLPacket loadURL = (LoadURLPacket)PacketPool.Instance.GetPacket(PacketType.LoadURL); loadURL.Data.ObjectName = Helpers.StringToField(objectname); loadURL.Data.ObjectID = objectID; loadURL.Data.OwnerID = ownerID; @@ -1279,7 +1279,7 @@ namespace OpenSim.Region.ClientStack public void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID) { - PreloadSoundPacket preSound = (PreloadSoundPacket) PacketPool.Instance.GetPacket(PacketType.PreloadSound); + PreloadSoundPacket preSound = (PreloadSoundPacket)PacketPool.Instance.GetPacket(PacketType.PreloadSound); // TODO: don't create new blocks if recycling an old packet preSound.DataBlock = new PreloadSoundPacket.DataBlockBlock[1]; preSound.DataBlock[0] = new PreloadSoundPacket.DataBlockBlock(); @@ -1291,7 +1291,7 @@ namespace OpenSim.Region.ClientStack public void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags) { - AttachedSoundPacket sound = (AttachedSoundPacket) PacketPool.Instance.GetPacket(PacketType.AttachedSound); + AttachedSoundPacket sound = (AttachedSoundPacket)PacketPool.Instance.GetPacket(PacketType.AttachedSound); sound.DataBlock.SoundID = soundID; sound.DataBlock.ObjectID = objectID; sound.DataBlock.OwnerID = ownerID; @@ -1303,23 +1303,23 @@ namespace OpenSim.Region.ClientStack public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel) { - SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket) PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); + SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket)PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); viewertime.TimeInfo.SunDirection = sunPos; viewertime.TimeInfo.SunAngVelocity = sunVel; - viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); + viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch(); OutPacket(viewertime, ThrottleOutPacketType.Task); } public void SendViewerTime(int phase) { Console.WriteLine("SunPhase: {0}", phase); - SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket) PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); + 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; + int sunPhase = (phase + 2) / 2; if ((sunPhase < 6) || (sunPhase > 36)) { viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f); @@ -1333,7 +1333,7 @@ namespace OpenSim.Region.ClientStack } sunPhase = sunPhase - 12; - float yValue = 0.1f*(sunPhase); + float yValue = 0.1f * (sunPhase); Console.WriteLine("Computed SunPhase: {0}, yValue: {1}", sunPhase, yValue); if (yValue > 1.2f) { @@ -1354,7 +1354,7 @@ namespace OpenSim.Region.ClientStack Console.WriteLine("sending sun update " + yValue); } viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f); - viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); + viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch(); OutPacket(viewertime, ThrottleOutPacketType.Task); } @@ -1362,7 +1362,7 @@ namespace OpenSim.Region.ClientStack string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, LLUUID partnerID) { - AvatarPropertiesReplyPacket avatarReply = (AvatarPropertiesReplyPacket) PacketPool.Instance.GetPacket(PacketType.AvatarPropertiesReply); + AvatarPropertiesReplyPacket avatarReply = (AvatarPropertiesReplyPacket)PacketPool.Instance.GetPacket(PacketType.AvatarPropertiesReply); avatarReply.AgentData.AgentID = AgentId; avatarReply.AgentData.AvatarID = avatarID; avatarReply.PropertiesData.AboutText = Helpers.StringToField(aboutText); @@ -1387,9 +1387,9 @@ namespace OpenSim.Region.ClientStack /// public void SendWearables(AvatarWearable[] wearables, int serial) { - AgentWearablesUpdatePacket aw = (AgentWearablesUpdatePacket) PacketPool.Instance.GetPacket(PacketType.AgentWearablesUpdate); + AgentWearablesUpdatePacket aw = (AgentWearablesUpdatePacket)PacketPool.Instance.GetPacket(PacketType.AgentWearablesUpdate); aw.AgentData.AgentID = AgentId; - aw.AgentData.SerialNum = (uint) serial; + aw.AgentData.SerialNum = (uint)serial; aw.AgentData.SessionID = m_sessionId; // TODO: don't create new blocks if recycling an old packet @@ -1398,7 +1398,7 @@ namespace OpenSim.Region.ClientStack for (int i = 0; i < wearables.Length; i++) { awb = new AgentWearablesUpdatePacket.WearableDataBlock(); - awb.WearableType = (byte) i; + awb.WearableType = (byte)i; awb.AssetID = wearables[i].AssetID; awb.ItemID = wearables[i].ItemID; aw.WearableData[i] = awb; @@ -1415,7 +1415,7 @@ namespace OpenSim.Region.ClientStack /// public void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) { - AvatarAppearancePacket avp = (AvatarAppearancePacket) PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); + AvatarAppearancePacket avp = (AvatarAppearancePacket)PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); // TODO: don't create new blocks if recycling an old packet avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; avp.ObjectData.TextureEntry = textureEntry; @@ -1435,7 +1435,7 @@ namespace OpenSim.Region.ClientStack public void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) { - AvatarAnimationPacket ani = (AvatarAnimationPacket) PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); + AvatarAnimationPacket ani = (AvatarAnimationPacket)PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); // TODO: don't create new blocks if recycling an old packet ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); @@ -1470,7 +1470,7 @@ namespace OpenSim.Region.ClientStack public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID) { - ObjectUpdatePacket objupdate = (ObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); + ObjectUpdatePacket objupdate = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); // TODO: don't create new blocks if recycling an old packet objupdate.RegionData.RegionHandle = regionHandle; objupdate.RegionData.TimeDilation = 64096; @@ -1483,7 +1483,7 @@ namespace OpenSim.Region.ClientStack objupdate.ObjectData[0].ParentID = parentID; objupdate.ObjectData[0].NameValue = Helpers.StringToField("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName); - LLVector3 pos2 = new LLVector3((float) Pos.X, (float) Pos.Y, (float) Pos.Z); + LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z); byte[] pb = pos2.GetBytes(); Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); @@ -1503,7 +1503,7 @@ namespace OpenSim.Region.ClientStack { ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateAvatarImprovedBlock(localID, position, velocity, rotation); - ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); + ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); // TODO: don't create new blocks if recycling an old packet terse.RegionData.RegionHandle = regionHandle; terse.RegionData.TimeDilation = timeDilation; @@ -1515,7 +1515,7 @@ namespace OpenSim.Region.ClientStack public void SendCoarseLocationUpdate(List CoarseLocations) { - CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket) PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); + CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket)PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); // TODO: don't create new blocks if recycling an old packet int total = CoarseLocations.Count; CoarseLocationUpdatePacket.IndexBlock ib = @@ -1525,9 +1525,9 @@ namespace OpenSim.Region.ClientStack { CoarseLocationUpdatePacket.LocationBlock lb = new CoarseLocationUpdatePacket.LocationBlock(); - lb.X = (byte) CoarseLocations[i].X; - lb.Y = (byte) CoarseLocations[i].Y; - lb.Z = (byte) (CoarseLocations[i].Z/4); + lb.X = (byte)CoarseLocations[i].X; + lb.Y = (byte)CoarseLocations[i].Y; + lb.Z = (byte)(CoarseLocations[i].Z / 4); loc.Location[i] = lb; } ib.You = -1; @@ -1548,7 +1548,7 @@ namespace OpenSim.Region.ClientStack /// public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) { - ObjectAttachPacket attach = (ObjectAttachPacket) PacketPool.Instance.GetPacket(PacketType.ObjectAttach); + ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach); // TODO: don't create new blocks if recycling an old packet attach.AgentData.AgentID = AgentId; attach.AgentData.SessionID = m_sessionId; @@ -1568,7 +1568,7 @@ namespace OpenSim.Region.ClientStack LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, LLQuaternion rotation, byte clickAction) { - ObjectUpdatePacket outPacket = (ObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); + ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); // TODO: don't create new blocks if recycling an old packet outPacket.RegionData.RegionHandle = regionHandle; outPacket.RegionData.TimeDilation = timeDilation; @@ -1612,7 +1612,7 @@ namespace OpenSim.Region.ClientStack { LLVector3 velocity = new LLVector3(0f, 0f, 0f); LLVector3 rotationalvelocity = new LLVector3(0f, 0f, 0f); - ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); + ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); // TODO: don't create new blocks if recycling an old packet terse.RegionData.RegionHandle = regionHandle; terse.RegionData.TimeDilation = timeDilation; @@ -1625,7 +1625,7 @@ namespace OpenSim.Region.ClientStack public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity) { - ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); + ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); // TODO: don't create new blocks if recycling an old packet terse.RegionData.RegionHandle = regionHandle; terse.RegionData.TimeDilation = timeDilation; @@ -1651,10 +1651,10 @@ namespace OpenSim.Region.ClientStack uint ID = localID; - bytes[i++] = (byte) (ID%256); - bytes[i++] = (byte) ((ID >> 8)%256); - bytes[i++] = (byte) ((ID >> 16)%256); - bytes[i++] = (byte) ((ID >> 24)%256); + bytes[i++] = (byte)(ID % 256); + bytes[i++] = (byte)((ID >> 8) % 256); + bytes[i++] = (byte)((ID >> 16) % 256); + bytes[i++] = (byte)((ID >> 24) % 256); bytes[i++] = 0; bytes[i++] = 1; i += 14; @@ -1671,55 +1671,55 @@ namespace OpenSim.Region.ClientStack internDirec = new Vector3(velocity.X, velocity.Y, velocity.Z); - internDirec = internDirec/128.0f; + internDirec = internDirec / 128.0f; internDirec.x += 1; internDirec.y += 1; internDirec.z += 1; - InternVelocityX = (ushort) (32768*internDirec.x); - InternVelocityY = (ushort) (32768*internDirec.y); - InternVelocityZ = (ushort) (32768*internDirec.z); + InternVelocityX = (ushort)(32768 * internDirec.x); + InternVelocityY = (ushort)(32768 * internDirec.y); + InternVelocityZ = (ushort)(32768 * internDirec.z); ushort ac = 32767; - bytes[i++] = (byte) (InternVelocityX%256); - bytes[i++] = (byte) ((InternVelocityX >> 8)%256); - bytes[i++] = (byte) (InternVelocityY%256); - bytes[i++] = (byte) ((InternVelocityY >> 8)%256); - bytes[i++] = (byte) (InternVelocityZ%256); - bytes[i++] = (byte) ((InternVelocityZ >> 8)%256); + bytes[i++] = (byte)(InternVelocityX % 256); + bytes[i++] = (byte)((InternVelocityX >> 8) % 256); + bytes[i++] = (byte)(InternVelocityY % 256); + bytes[i++] = (byte)((InternVelocityY >> 8) % 256); + bytes[i++] = (byte)(InternVelocityZ % 256); + bytes[i++] = (byte)((InternVelocityZ >> 8) % 256); //accel - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); //rotation ushort rw, rx, ry, rz; - rw = (ushort) (32768*(rotation.W + 1)); - rx = (ushort) (32768*(rotation.X + 1)); - ry = (ushort) (32768*(rotation.Y + 1)); - rz = (ushort) (32768*(rotation.Z + 1)); + rw = (ushort)(32768 * (rotation.W + 1)); + rx = (ushort)(32768 * (rotation.X + 1)); + ry = (ushort)(32768 * (rotation.Y + 1)); + rz = (ushort)(32768 * (rotation.Z + 1)); //rot - bytes[i++] = (byte) (rx%256); - bytes[i++] = (byte) ((rx >> 8)%256); - bytes[i++] = (byte) (ry%256); - bytes[i++] = (byte) ((ry >> 8)%256); - bytes[i++] = (byte) (rz%256); - bytes[i++] = (byte) ((rz >> 8)%256); - bytes[i++] = (byte) (rw%256); - bytes[i++] = (byte) ((rw >> 8)%256); + bytes[i++] = (byte)(rx % 256); + bytes[i++] = (byte)((rx >> 8) % 256); + bytes[i++] = (byte)(ry % 256); + bytes[i++] = (byte)((ry >> 8) % 256); + bytes[i++] = (byte)(rz % 256); + bytes[i++] = (byte)((rz >> 8) % 256); + bytes[i++] = (byte)(rw % 256); + bytes[i++] = (byte)((rw >> 8) % 256); //rotation vel - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); dat.Data = bytes; @@ -1745,10 +1745,10 @@ namespace OpenSim.Region.ClientStack int i = 0; ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); dat.TextureEntry = new byte[0]; - bytes[i++] = (byte) (ID%256); - bytes[i++] = (byte) ((ID >> 8)%256); - bytes[i++] = (byte) ((ID >> 16)%256); - bytes[i++] = (byte) ((ID >> 24)%256); + bytes[i++] = (byte)(ID % 256); + bytes[i++] = (byte)((ID >> 8) % 256); + bytes[i++] = (byte)((ID >> 16) % 256); + bytes[i++] = (byte)((ID >> 24) % 256); bytes[i++] = 0; bytes[i++] = 0; @@ -1760,65 +1760,65 @@ namespace OpenSim.Region.ClientStack ushort velx, vely, velz; Vector3 vel = new Vector3(velocity.X, velocity.Y, velocity.Z); - vel = vel/128.0f; + vel = vel / 128.0f; vel.x += 1; vel.y += 1; vel.z += 1; //vel - velx = (ushort) (32768*(vel.x)); - vely = (ushort) (32768*(vel.y)); - velz = (ushort) (32768*(vel.z)); + velx = (ushort)(32768 * (vel.x)); + vely = (ushort)(32768 * (vel.y)); + velz = (ushort)(32768 * (vel.z)); - bytes[i++] = (byte) (velx%256); - bytes[i++] = (byte) ((velx >> 8)%256); - bytes[i++] = (byte) (vely%256); - bytes[i++] = (byte) ((vely >> 8)%256); - bytes[i++] = (byte) (velz%256); - bytes[i++] = (byte) ((velz >> 8)%256); + bytes[i++] = (byte)(velx % 256); + bytes[i++] = (byte)((velx >> 8) % 256); + bytes[i++] = (byte)(vely % 256); + bytes[i++] = (byte)((vely >> 8) % 256); + bytes[i++] = (byte)(velz % 256); + bytes[i++] = (byte)((velz >> 8) % 256); //accel - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); - bytes[i++] = (byte) (ac%256); - bytes[i++] = (byte) ((ac >> 8)%256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); + bytes[i++] = (byte)(ac % 256); + bytes[i++] = (byte)((ac >> 8) % 256); ushort rw, rx, ry, rz; - rw = (ushort) (32768*(rotation.W + 1)); - rx = (ushort) (32768*(rotation.X + 1)); - ry = (ushort) (32768*(rotation.Y + 1)); - rz = (ushort) (32768*(rotation.Z + 1)); + rw = (ushort)(32768 * (rotation.W + 1)); + rx = (ushort)(32768 * (rotation.X + 1)); + ry = (ushort)(32768 * (rotation.Y + 1)); + rz = (ushort)(32768 * (rotation.Z + 1)); //rot - bytes[i++] = (byte) (rx%256); - bytes[i++] = (byte) ((rx >> 8)%256); - bytes[i++] = (byte) (ry%256); - bytes[i++] = (byte) ((ry >> 8)%256); - bytes[i++] = (byte) (rz%256); - bytes[i++] = (byte) ((rz >> 8)%256); - bytes[i++] = (byte) (rw%256); - bytes[i++] = (byte) ((rw >> 8)%256); + bytes[i++] = (byte)(rx % 256); + bytes[i++] = (byte)((rx >> 8) % 256); + bytes[i++] = (byte)(ry % 256); + bytes[i++] = (byte)((ry >> 8) % 256); + bytes[i++] = (byte)(rz % 256); + bytes[i++] = (byte)((rz >> 8) % 256); + bytes[i++] = (byte)(rw % 256); + bytes[i++] = (byte)((rw >> 8) % 256); //rotation vel ushort rvelx, rvely, rvelz; Vector3 rvel = new Vector3(rotationalvelocity.X, rotationalvelocity.Y, rotationalvelocity.Z); - rvel = rvel/128.0f; + rvel = rvel / 128.0f; rvel.x += 1; rvel.y += 1; rvel.z += 1; //vel - rvelx = (ushort) (32768*(rvel.x)); - rvely = (ushort) (32768*(rvel.y)); - rvelz = (ushort) (32768*(rvel.z)); + rvelx = (ushort)(32768 * (rvel.x)); + rvely = (ushort)(32768 * (rvel.y)); + rvelz = (ushort)(32768 * (rvel.z)); - bytes[i++] = (byte) (rvelx%256); - bytes[i++] = (byte) ((rvelx >> 8)%256); - bytes[i++] = (byte) (rvely%256); - bytes[i++] = (byte) ((rvely >> 8)%256); - bytes[i++] = (byte) (rvelz%256); - bytes[i++] = (byte) ((rvelz >> 8)%256); + bytes[i++] = (byte)(rvelx % 256); + bytes[i++] = (byte)((rvelx >> 8) % 256); + bytes[i++] = (byte)(rvely % 256); + bytes[i++] = (byte)((rvely >> 8) % 256); + bytes[i++] = (byte)(rvelz % 256); + bytes[i++] = (byte)((rvelz >> 8) % 256); dat.Data = bytes; return dat; @@ -1963,7 +1963,7 @@ namespace OpenSim.Region.ClientStack public void SendNameReply(LLUUID profileId, string firstname, string lastname) { - UUIDNameReplyPacket packet = (UUIDNameReplyPacket) PacketPool.Instance.GetPacket(PacketType.UUIDNameReply); + UUIDNameReplyPacket packet = (UUIDNameReplyPacket)PacketPool.Instance.GetPacket(PacketType.UUIDNameReply); // TODO: don't create new blocks if recycling an old packet packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1]; packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); @@ -1986,7 +1986,7 @@ namespace OpenSim.Region.ClientStack private bool HandleViewerEffect(IClientAPI sender, Packet Pack) { - ViewerEffectPacket viewer = (ViewerEffectPacket) Pack; + ViewerEffectPacket viewer = (ViewerEffectPacket)Pack; if (OnViewerEffect != null) { @@ -2011,8 +2011,8 @@ namespace OpenSim.Region.ClientStack protected bool AgentTextureCached(IClientAPI simclient, Packet packet) { //System.Console.WriteLine("texture cached: " + packet.ToString()); - AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket) packet; - AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket) PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); + AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket)packet; + AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); // TODO: don't create new blocks if recycling an old packet cachedresp.AgentData.AgentID = AgentId; cachedresp.AgentData.SessionID = m_sessionId; @@ -2033,9 +2033,9 @@ namespace OpenSim.Region.ClientStack protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet) { - MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket) packet; + MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; // System.Console.WriteLine("new multi update packet " + multipleupdate.ToString()); - Scene tScene = (Scene) m_scene; + Scene tScene = (Scene)m_scene; for (int i = 0; i < multipleupdate.ObjectData.Length; i++) { @@ -2057,100 +2057,98 @@ namespace OpenSim.Region.ClientStack { LLUUID partId = part.UUID; - if (tScene.PermissionsMngr.CanEditObjectPosition(simClient.AgentId, partId)) + + switch (block.Type) { - switch (block.Type) - { - case 1: - if (OnUpdatePrimSinglePosition != null) - { - LLVector3 pos = new LLVector3(block.Data, 0); - // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); - OnUpdatePrimSinglePosition(localId, pos, this); - } - break; - case 2: - if (OnUpdatePrimSingleRotation != null) - { - LLQuaternion rot = new LLQuaternion(block.Data, 0, true); - //System.Console.WriteLine("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); - OnUpdatePrimSingleRotation(localId, rot, this); - } - break; - case 3: - if (OnUpdatePrimSingleRotation != null) - { - LLQuaternion rot = new LLQuaternion(block.Data, 12, true); - //System.Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); - OnUpdatePrimSingleRotation(localId, rot, this); - } - break; - case 5: - if (OnUpdatePrimScale != null) - { - LLVector3 scale = new LLVector3(block.Data, 12); - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); - OnUpdatePrimScale(localId, scale, this); - } - break; - case 9: - if (OnUpdatePrimGroupPosition != null) - { - LLVector3 pos = new LLVector3(block.Data, 0); - OnUpdatePrimGroupPosition(localId, pos, this); - } - break; - case 10: - if (OnUpdatePrimGroupRotation != null) - { - LLQuaternion rot = new LLQuaternion(block.Data, 0, true); - // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); - OnUpdatePrimGroupRotation(localId, rot, this); - } - break; - case 11: - if (OnUpdatePrimGroupMouseRotation != null) - { - LLVector3 pos = new LLVector3(block.Data, 0); - LLQuaternion rot = new LLQuaternion(block.Data, 12, true); - //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); - // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); - OnUpdatePrimGroupMouseRotation(localId, pos, rot, - this); - } - break; - case 13: - if (OnUpdatePrimScale != null) - { - LLVector3 scale = new LLVector3(block.Data, 12); - //Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); - OnUpdatePrimScale(localId, scale, this); - - // Change the position based on scale (for bug number 246) - LLVector3 pos = new LLVector3(block.Data, 0); - // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); - OnUpdatePrimSinglePosition(localId, pos, this); - } - break; - case 29: - if (OnUpdatePrimScale != null) - { - LLVector3 scale = new LLVector3(block.Data, 12); - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z ); - OnUpdatePrimScale(localId, scale, this); - LLVector3 pos = new LLVector3(block.Data, 0); - OnUpdatePrimSinglePosition(localId, pos, this); - } - break; - case 21: - if (OnUpdatePrimScale != null) - { - LLVector3 scale = new LLVector3(block.Data, 12); - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); - OnUpdatePrimScale(localId, scale, this); - } - break; - } + case 1: + if (OnUpdatePrimSinglePosition != null) + { + LLVector3 pos = new LLVector3(block.Data, 0); + // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + OnUpdatePrimSinglePosition(localId, pos, this); + } + break; + case 2: + if (OnUpdatePrimSingleRotation != null) + { + LLQuaternion rot = new LLQuaternion(block.Data, 0, true); + //System.Console.WriteLine("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + OnUpdatePrimSingleRotation(localId, rot, this); + } + break; + case 3: + if (OnUpdatePrimSingleRotation != null) + { + LLQuaternion rot = new LLQuaternion(block.Data, 12, true); + //System.Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + OnUpdatePrimSingleRotation(localId, rot, this); + } + break; + case 5: + if (OnUpdatePrimScale != null) + { + LLVector3 scale = new LLVector3(block.Data, 12); + // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + OnUpdatePrimScale(localId, scale, this); + } + break; + case 9: + if (OnUpdatePrimGroupPosition != null) + { + LLVector3 pos = new LLVector3(block.Data, 0); + OnUpdatePrimGroupPosition(localId, pos, this); + } + break; + case 10: + if (OnUpdatePrimGroupRotation != null) + { + LLQuaternion rot = new LLQuaternion(block.Data, 0, true); + // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + OnUpdatePrimGroupRotation(localId, rot, this); + } + break; + case 11: + if (OnUpdatePrimGroupMouseRotation != null) + { + LLVector3 pos = new LLVector3(block.Data, 0); + LLQuaternion rot = new LLQuaternion(block.Data, 12, true); + //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + OnUpdatePrimGroupMouseRotation(localId, pos, rot, + this); + } + break; + case 13: + if (OnUpdatePrimScale != null) + { + LLVector3 scale = new LLVector3(block.Data, 12); + //Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + OnUpdatePrimScale(localId, scale, this); + + // Change the position based on scale (for bug number 246) + LLVector3 pos = new LLVector3(block.Data, 0); + // System.Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + OnUpdatePrimSinglePosition(localId, pos, this); + } + break; + case 29: + if (OnUpdatePrimScale != null) + { + LLVector3 scale = new LLVector3(block.Data, 12); + // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z ); + OnUpdatePrimScale(localId, scale, this); + LLVector3 pos = new LLVector3(block.Data, 0); + OnUpdatePrimSinglePosition(localId, pos, this); + } + break; + case 21: + if (OnUpdatePrimScale != null) + { + LLVector3 scale = new LLVector3(block.Data, 12); + // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + OnUpdatePrimScale(localId, scale, this); + } + break; } } } @@ -2162,7 +2160,7 @@ namespace OpenSim.Region.ClientStack { //should be getting the map layer from the grid server //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) - MapLayerReplyPacket mapReply = (MapLayerReplyPacket) PacketPool.Instance.GetPacket(PacketType.MapLayerReply); + MapLayerReplyPacket mapReply = (MapLayerReplyPacket)PacketPool.Instance.GetPacket(PacketType.MapLayerReply); // TODO: don't create new blocks if recycling an old packet mapReply.AgentData.AgentID = AgentId; mapReply.AgentData.Flags = 0; @@ -2307,18 +2305,18 @@ namespace OpenSim.Region.ClientStack // Actually make the byte array and send it try { - byte[] sendbuffer = Pack.ToBytes(); - PacketPool.Instance.ReturnPacket(Pack); - - if (Pack.Header.Zerocoded) - { - int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); - m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode); - } - else - { - m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode); - } + byte[] sendbuffer = Pack.ToBytes(); + PacketPool.Instance.ReturnPacket(Pack); + + if (Pack.Header.Zerocoded) + { + int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); + m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode); + } + else + { + m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode); + } } catch (Exception e) { @@ -2350,7 +2348,7 @@ namespace OpenSim.Region.ClientStack // Handle PacketAck packets if (NewPack.Type == PacketType.PacketAck) { - PacketAckPacket ackPacket = (PacketAckPacket) NewPack; + PacketAckPacket ackPacket = (PacketAckPacket)NewPack; lock (m_needAck) { @@ -2363,8 +2361,8 @@ namespace OpenSim.Region.ClientStack else if ((NewPack.Type == PacketType.StartPingCheck)) { //reply to pingcheck - StartPingCheckPacket startPing = (StartPingCheckPacket) NewPack; - CompletePingCheckPacket endPing = (CompletePingCheckPacket) PacketPool.Instance.GetPacket(PacketType.CompletePingCheck); + StartPingCheckPacket startPing = (StartPingCheckPacket)NewPack; + CompletePingCheckPacket endPing = (CompletePingCheckPacket)PacketPool.Instance.GetPacket(PacketType.CompletePingCheck); endPing.PingID.PingID = startPing.PingID.PingID; OutPacket(endPing, ThrottleOutPacketType.Task); } @@ -2393,7 +2391,7 @@ namespace OpenSim.Region.ClientStack { if (Pack.Header.Reliable) { - PacketAckPacket ack_it = (PacketAckPacket) PacketPool.Instance.GetPacket(PacketType.PacketAck); + PacketAckPacket ack_it = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); // TODO: don't create new blocks if recycling an old packet ack_it.Packets = new PacketAckPacket.PacketsBlock[1]; ack_it.Packets[0] = new PacketAckPacket.PacketsBlock(); @@ -2449,7 +2447,7 @@ namespace OpenSim.Region.ClientStack //MainLog.Instance.Verbose("NETWORK", "Sending PacketAck"); int i = 0; - PacketAckPacket acks = (PacketAckPacket) PacketPool.Instance.GetPacket(PacketType.PacketAck); + PacketAckPacket acks = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck); // TODO: don't create new blocks if recycling an old packet acks.Packets = new PacketAckPacket.PacketsBlock[m_pendingAcks.Count]; @@ -2507,17 +2505,17 @@ namespace OpenSim.Region.ClientStack switch (Pack.Type) { - #region Scene/Avatar + #region Scene/Avatar case PacketType.AvatarPropertiesRequest: - AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket) Pack; + AvatarPropertiesRequestPacket avatarProperties = (AvatarPropertiesRequestPacket)Pack; if (OnRequestAvatarProperties != null) { OnRequestAvatarProperties(this, avatarProperties.AgentData.AvatarID); } break; case PacketType.ChatFromViewer: - ChatFromViewerPacket inchatpack = (ChatFromViewerPacket) Pack; + ChatFromViewerPacket inchatpack = (ChatFromViewerPacket)Pack; string fromName = ""; //ClientAvatar.firstname + " " + ClientAvatar.lastname; byte[] message = inchatpack.ChatData.Message; @@ -2533,7 +2531,7 @@ namespace OpenSim.Region.ClientStack args.Channel = channel; args.From = fromName; args.Message = Helpers.FieldToUTF8String(message); - args.Type = (ChatTypeEnum) type; + args.Type = (ChatTypeEnum)type; args.Position = fromPos; args.Scene = Scene; @@ -2543,12 +2541,12 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ImprovedInstantMessage: - ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket) Pack; + ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket)Pack; string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); string IMmessage = Helpers.FieldToUTF8String(msgpack.MessageBlock.Message); if (OnInstantMessage != null) { - OnInstantMessage(this,msgpack.AgentData.AgentID, msgpack.AgentData.SessionID, + OnInstantMessage(this, msgpack.AgentData.AgentID, msgpack.AgentData.SessionID, msgpack.MessageBlock.ToAgentID, msgpack.MessageBlock.ID, msgpack.MessageBlock.Timestamp, IMfromName, IMmessage, msgpack.MessageBlock.Dialog, msgpack.MessageBlock.FromGroup, @@ -2563,7 +2561,7 @@ namespace OpenSim.Region.ClientStack // My guess is this is the folder to stick the calling card into List callingCardFolders = new List(); - + LLUUID agentID = afriendpack.AgentData.AgentID; LLUUID transactionID = afriendpack.TransactionBlock.TransactionID; @@ -2591,7 +2589,7 @@ namespace OpenSim.Region.ClientStack break; case PacketType.RezObject: - RezObjectPacket rezPacket = (RezObjectPacket) Pack; + RezObjectPacket rezPacket = (RezObjectPacket)Pack; if (OnRezObject != null) { //rezPacket.RezData.BypassRaycast; @@ -2604,11 +2602,11 @@ namespace OpenSim.Region.ClientStack //rezPacket.RezData.FromTaskID; //MainLog.Instance.Verbose("REZData", rezPacket.ToString()); OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, - rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID, - rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection, - rezPacket.RezData.EveryoneMask, rezPacket.RezData.GroupMask, - rezPacket.RezData.NextOwnerMask, rezPacket.RezData.ItemFlags, - rezPacket.RezData.RezSelected, rezPacket.RezData.RemoveItem, + rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID, + rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection, + rezPacket.RezData.EveryoneMask, rezPacket.RezData.GroupMask, + rezPacket.RezData.NextOwnerMask, rezPacket.RezData.ItemFlags, + rezPacket.RezData.RezSelected, rezPacket.RezData.RemoveItem, rezPacket.RezData.FromTaskID); } break; @@ -2619,7 +2617,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ModifyLand: - ModifyLandPacket modify = (ModifyLandPacket) Pack; + ModifyLandPacket modify = (ModifyLandPacket)Pack; if (modify.ParcelData.Length > 0) { if (OnModifyTerrain != null) @@ -2652,7 +2650,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.AgentSetAppearance: - AgentSetAppearancePacket appear = (AgentSetAppearancePacket) Pack; + AgentSetAppearancePacket appear = (AgentSetAppearancePacket)Pack; if (OnSetAppearance != null) { OnSetAppearance(appear.ObjectData.TextureEntry, appear.VisualParam); @@ -2661,7 +2659,7 @@ namespace OpenSim.Region.ClientStack case PacketType.AgentIsNowWearing: if (OnAvatarNowWearing != null) { - AgentIsNowWearingPacket nowWearing = (AgentIsNowWearingPacket) Pack; + AgentIsNowWearingPacket nowWearing = (AgentIsNowWearingPacket)Pack; AvatarWearingArgs wearingArgs = new AvatarWearingArgs(); for (int i = 0; i < nowWearing.WearableData.Length; i++) { @@ -2674,7 +2672,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.SetAlwaysRun: - SetAlwaysRunPacket run = (SetAlwaysRunPacket) Pack; + SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack; if (OnSetAlwaysRun != null) OnSetAlwaysRun(this, run.AgentData.AlwaysRun); @@ -2689,14 +2687,14 @@ namespace OpenSim.Region.ClientStack case PacketType.AgentUpdate: if (OnAgentUpdate != null) { - AgentUpdatePacket agenUpdate = (AgentUpdatePacket) Pack; + AgentUpdatePacket agenUpdate = (AgentUpdatePacket)Pack; OnAgentUpdate(this, agenUpdate); - //agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotationa); + //agenUpdate.AgentData.ControlFlags, agenUpdate.AgentData.BodyRotationa); } break; case PacketType.AgentAnimation: - AgentAnimationPacket AgentAni = (AgentAnimationPacket) Pack; + AgentAnimationPacket AgentAni = (AgentAnimationPacket)Pack; for (int i = 0; i < AgentAni.AnimationList.Length; i++) { if (AgentAni.AnimationList[i].StartAnim) @@ -2718,7 +2716,7 @@ namespace OpenSim.Region.ClientStack case PacketType.AgentRequestSit: if (OnAgentRequestSit != null) { - AgentRequestSitPacket agentRequestSit = (AgentRequestSitPacket) Pack; + AgentRequestSitPacket agentRequestSit = (AgentRequestSitPacket)Pack; OnAgentRequestSit(this, agentRequestSit.AgentData.AgentID, agentRequestSit.TargetObject.TargetID, agentRequestSit.TargetObject.Offset); } @@ -2726,12 +2724,12 @@ namespace OpenSim.Region.ClientStack case PacketType.AgentSit: if (OnAgentSit != null) { - AgentSitPacket agentSit = (AgentSitPacket) Pack; + AgentSitPacket agentSit = (AgentSitPacket)Pack; OnAgentSit(this, agentSit.AgentData.AgentID); } break; case PacketType.AvatarPickerRequest: - AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket) Pack; + AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData; AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; //System.Console.WriteLine("Agent Sends:" + Helpers.FieldToUTF8String(querydata.Name)); @@ -2742,12 +2740,12 @@ namespace OpenSim.Region.ClientStack } break; - #endregion + #endregion - #region Objects/m_sceneObjects + #region Objects/m_sceneObjects case PacketType.ObjectLink: - ObjectLinkPacket link = (ObjectLinkPacket) Pack; + ObjectLinkPacket link = (ObjectLinkPacket)Pack; uint parentprimid = 0; List childrenprims = new List(); if (link.ObjectData.Length > 1) @@ -2765,7 +2763,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectDelink: - ObjectDelinkPacket delink = (ObjectDelinkPacket) Pack; + ObjectDelinkPacket delink = (ObjectDelinkPacket)Pack; // It appears the prim at index 0 is not always the root prim (for // instance, when one prim of a link set has been edited independently @@ -2786,19 +2784,19 @@ namespace OpenSim.Region.ClientStack case PacketType.ObjectAdd: if (OnAddPrim != null) { - ObjectAddPacket addPacket = (ObjectAddPacket) Pack; + ObjectAddPacket addPacket = (ObjectAddPacket)Pack; PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); - // MainLog.Instance.Verbose("REZData", addPacket.ToString()); + // MainLog.Instance.Verbose("REZData", addPacket.ToString()); //BypassRaycast: 1 //RayStart: <69.79469, 158.2652, 98.40343> //RayEnd: <61.97724, 141.995, 92.58341> //RayTargetID: 00000000-0000-0000-0000-000000000000 - OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape,addPacket.ObjectData.BypassRaycast,addPacket.ObjectData.RayStart,addPacket.ObjectData.RayTargetID,addPacket.ObjectData.RayEndIsIntersection); + OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection); } break; case PacketType.ObjectShape: - ObjectShapePacket shapePacket = (ObjectShapePacket) Pack; + ObjectShapePacket shapePacket = (ObjectShapePacket)Pack; for (int i = 0; i < shapePacket.ObjectData.Length; i++) { if (OnUpdatePrimShape != null) @@ -2809,7 +2807,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectExtraParams: - ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket) Pack; + ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket)Pack; if (OnUpdateExtraParams != null) { OnUpdateExtraParams(m_agentId, extraPar.ObjectData[0].ObjectLocalID, @@ -2818,7 +2816,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectDuplicate: - ObjectDuplicatePacket dupe = (ObjectDuplicatePacket) Pack; + ObjectDuplicatePacket dupe = (ObjectDuplicatePacket)Pack; ObjectDuplicatePacket.AgentDataBlock AgentandGroupData = dupe.AgentData; for (int i = 0; i < dupe.ObjectData.Length; i++) { @@ -2833,7 +2831,7 @@ namespace OpenSim.Region.ClientStack break; case PacketType.ObjectSelect: - ObjectSelectPacket incomingselect = (ObjectSelectPacket) Pack; + ObjectSelectPacket incomingselect = (ObjectSelectPacket)Pack; for (int i = 0; i < incomingselect.ObjectData.Length; i++) { if (OnObjectSelect != null) @@ -2843,7 +2841,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectDeselect: - ObjectDeselectPacket incomingdeselect = (ObjectDeselectPacket) Pack; + ObjectDeselectPacket incomingdeselect = (ObjectDeselectPacket)Pack; for (int i = 0; i < incomingdeselect.ObjectData.Length; i++) { if (OnObjectDeselect != null) @@ -2853,14 +2851,14 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectFlagUpdate: - ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket) Pack; + ObjectFlagUpdatePacket flags = (ObjectFlagUpdatePacket)Pack; if (OnUpdatePrimFlags != null) { OnUpdatePrimFlags(flags.AgentData.ObjectLocalID, Pack, this); } break; case PacketType.ObjectImage: - ObjectImagePacket imagePack = (ObjectImagePacket) Pack; + ObjectImagePacket imagePack = (ObjectImagePacket)Pack; for (int i = 0; i < imagePack.ObjectData.Length; i++) { if (OnUpdatePrimTexture != null) @@ -2871,14 +2869,14 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectGrab: - ObjectGrabPacket grab = (ObjectGrabPacket) Pack; + ObjectGrabPacket grab = (ObjectGrabPacket)Pack; if (OnGrabObject != null) { OnGrabObject(grab.ObjectData.LocalID, grab.ObjectData.GrabOffset, this); } break; case PacketType.ObjectGrabUpdate: - ObjectGrabUpdatePacket grabUpdate = (ObjectGrabUpdatePacket) Pack; + ObjectGrabUpdatePacket grabUpdate = (ObjectGrabUpdatePacket)Pack; if (OnGrabUpdate != null) { OnGrabUpdate(grabUpdate.ObjectData.ObjectID, grabUpdate.ObjectData.GrabOffsetInitial, @@ -2886,14 +2884,14 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectDeGrab: - ObjectDeGrabPacket deGrab = (ObjectDeGrabPacket) Pack; + ObjectDeGrabPacket deGrab = (ObjectDeGrabPacket)Pack; if (OnDeGrabObject != null) { OnDeGrabObject(deGrab.ObjectData.LocalID, this); } break; case PacketType.ObjectDescription: - ObjectDescriptionPacket objDes = (ObjectDescriptionPacket) Pack; + ObjectDescriptionPacket objDes = (ObjectDescriptionPacket)Pack; for (int i = 0; i < objDes.ObjectData.Length; i++) { if (OnObjectDescription != null) @@ -2904,7 +2902,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.ObjectName: - ObjectNamePacket objName = (ObjectNamePacket) Pack; + ObjectNamePacket objName = (ObjectNamePacket)Pack; for (int i = 0; i < objName.ObjectData.Length; i++) { if (OnObjectName != null) @@ -2916,7 +2914,7 @@ namespace OpenSim.Region.ClientStack break; case PacketType.ObjectPermissions: MainLog.Instance.Warn("CLIENT", "unhandled packet " + PacketType.ObjectPermissions.ToString()); - ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket) Pack; + ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack; List permChanges = new List(); @@ -2949,7 +2947,7 @@ namespace OpenSim.Region.ClientStack case PacketType.RequestObjectPropertiesFamily: //This powers the little tooltip that appears when you move your mouse over an object - RequestObjectPropertiesFamilyPacket packToolTip = (RequestObjectPropertiesFamilyPacket) Pack; + RequestObjectPropertiesFamilyPacket packToolTip = (RequestObjectPropertiesFamilyPacket)Pack; RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData; @@ -2962,12 +2960,12 @@ namespace OpenSim.Region.ClientStack break; - #endregion + #endregion - #region Inventory/Asset/Other related packets + #region Inventory/Asset/Other related packets case PacketType.RequestImage: - RequestImagePacket imageRequest = (RequestImagePacket) Pack; + RequestImagePacket imageRequest = (RequestImagePacket)Pack; //Console.WriteLine("image request: " + Pack.ToString()); for (int i = 0; i < imageRequest.RequestImage.Length; i++) { @@ -2985,11 +2983,11 @@ namespace OpenSim.Region.ClientStack break; case PacketType.TransferRequest: //Console.WriteLine("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); - TransferRequestPacket transfer = (TransferRequestPacket) Pack; + TransferRequestPacket transfer = (TransferRequestPacket)Pack; m_assetCache.AddAssetRequest(this, transfer); break; case PacketType.AssetUploadRequest: - AssetUploadRequestPacket request = (AssetUploadRequestPacket) Pack; + AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; // Console.WriteLine("upload request " + Pack.ToString()); // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); if (OnAssetUploadRequest != null) @@ -3002,21 +3000,21 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.RequestXfer: - RequestXferPacket xferReq = (RequestXferPacket) Pack; + RequestXferPacket xferReq = (RequestXferPacket)Pack; if (OnRequestXfer != null) { OnRequestXfer(this, xferReq.XferID.ID, Util.FieldToString(xferReq.XferID.Filename)); } break; case PacketType.SendXferPacket: - SendXferPacketPacket xferRec = (SendXferPacketPacket) Pack; + SendXferPacketPacket xferRec = (SendXferPacketPacket)Pack; if (OnXferReceive != null) { OnXferReceive(this, xferRec.XferID.ID, xferRec.XferID.Packet, xferRec.DataPacket.Data); } break; case PacketType.ConfirmXferPacket: - ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket) Pack; + ConfirmXferPacketPacket confirmXfer = (ConfirmXferPacketPacket)Pack; if (OnConfirmXfer != null) { OnConfirmXfer(this, confirmXfer.XferID.ID, confirmXfer.XferID.Packet); @@ -3025,9 +3023,9 @@ namespace OpenSim.Region.ClientStack case PacketType.CreateInventoryFolder: if (OnCreateNewInventoryFolder != null) { - CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket) Pack; + CreateInventoryFolderPacket invFolder = (CreateInventoryFolderPacket)Pack; OnCreateNewInventoryFolder(this, invFolder.FolderData.FolderID, - (ushort) invFolder.FolderData.Type, + (ushort)invFolder.FolderData.Type, Util.FieldToString(invFolder.FolderData.Name), invFolder.FolderData.ParentID); } @@ -3035,11 +3033,11 @@ namespace OpenSim.Region.ClientStack case PacketType.UpdateInventoryFolder: if (OnUpdateInventoryFolder != null) { - UpdateInventoryFolderPacket invFolder = (UpdateInventoryFolderPacket) Pack; + UpdateInventoryFolderPacket invFolder = (UpdateInventoryFolderPacket)Pack; for (int i = 0; i < invFolder.FolderData.Length; i++) { OnUpdateInventoryFolder(this, invFolder.FolderData[i].FolderID, - (ushort) invFolder.FolderData[i].Type, + (ushort)invFolder.FolderData[i].Type, Util.FieldToString(invFolder.FolderData[i].Name), invFolder.FolderData[i].ParentID); } @@ -3048,7 +3046,7 @@ namespace OpenSim.Region.ClientStack case PacketType.MoveInventoryFolder: if (OnMoveInventoryFolder != null) { - MoveInventoryFolderPacket invFolder = (MoveInventoryFolderPacket) Pack; + MoveInventoryFolderPacket invFolder = (MoveInventoryFolderPacket)Pack; for (int i = 0; i < invFolder.InventoryData.Length; i++) { OnMoveInventoryFolder(this, invFolder.InventoryData[i].FolderID, @@ -3057,7 +3055,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.CreateInventoryItem: - CreateInventoryItemPacket createItem = (CreateInventoryItemPacket) Pack; + CreateInventoryItemPacket createItem = (CreateInventoryItemPacket)Pack; if (OnCreateNewInventoryItem != null) { OnCreateNewInventoryItem(this, createItem.InventoryBlock.TransactionID, @@ -3074,7 +3072,7 @@ namespace OpenSim.Region.ClientStack case PacketType.FetchInventory: if (OnFetchInventory != null) { - FetchInventoryPacket FetchInventory = (FetchInventoryPacket) Pack; + FetchInventoryPacket FetchInventory = (FetchInventoryPacket)Pack; for (int i = 0; i < FetchInventory.InventoryData.Length; i++) { OnFetchInventory(this, FetchInventory.InventoryData[i].ItemID, @@ -3085,7 +3083,7 @@ namespace OpenSim.Region.ClientStack case PacketType.FetchInventoryDescendents: if (OnFetchInventoryDescendents != null) { - FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket) Pack; + FetchInventoryDescendentsPacket Fetch = (FetchInventoryDescendentsPacket)Pack; OnFetchInventoryDescendents(this, Fetch.InventoryData.FolderID, Fetch.InventoryData.OwnerID, Fetch.InventoryData.FetchFolders, Fetch.InventoryData.FetchItems, Fetch.InventoryData.SortOrder); @@ -3094,12 +3092,12 @@ namespace OpenSim.Region.ClientStack case PacketType.PurgeInventoryDescendents: if (OnPurgeInventoryDescendents != null) { - PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket) Pack; + PurgeInventoryDescendentsPacket Purge = (PurgeInventoryDescendentsPacket)Pack; OnPurgeInventoryDescendents(this, Purge.InventoryData.FolderID); } break; case PacketType.UpdateInventoryItem: - UpdateInventoryItemPacket update = (UpdateInventoryItemPacket) Pack; + UpdateInventoryItemPacket update = (UpdateInventoryItemPacket)Pack; if (OnUpdateInventoryItem != null) { for (int i = 0; i < update.InventoryData.Length; i++) @@ -3143,7 +3141,7 @@ namespace OpenSim.Region.ClientStack }*/ break; case PacketType.CopyInventoryItem: - CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket) Pack; + CopyInventoryItemPacket copyitem = (CopyInventoryItemPacket)Pack; if (OnCopyInventoryItem != null) { foreach (CopyInventoryItemPacket.InventoryDataBlock datablock in copyitem.InventoryData) @@ -3155,7 +3153,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.MoveInventoryItem: - MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket) Pack; + MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket)Pack; if (OnMoveInventoryItem != null) { foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) @@ -3166,14 +3164,14 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.RequestTaskInventory: - RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket) Pack; + RequestTaskInventoryPacket requesttask = (RequestTaskInventoryPacket)Pack; if (OnRequestTaskInventory != null) { OnRequestTaskInventory(this, requesttask.InventoryData.LocalID); } break; case PacketType.UpdateTaskInventory: - UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket) Pack; + UpdateTaskInventoryPacket updatetask = (UpdateTaskInventoryPacket)Pack; if (OnUpdateTaskInventory != null) { if (updatetask.UpdateData.Key == 0) @@ -3184,7 +3182,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.RemoveTaskInventory: - RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket) Pack; + RemoveTaskInventoryPacket removeTask = (RemoveTaskInventoryPacket)Pack; if (OnRemoveTaskItem != null) { OnRemoveTaskItem(this, removeTask.InventoryData.ItemID, removeTask.InventoryData.LocalID); @@ -3195,7 +3193,7 @@ namespace OpenSim.Region.ClientStack break; case PacketType.RezScript: //Console.WriteLine(Pack.ToString()); - RezScriptPacket rezScript = (RezScriptPacket) Pack; + RezScriptPacket rezScript = (RezScriptPacket)Pack; if (OnRezScript != null) { OnRezScript(this, rezScript.InventoryBlock.ItemID, rezScript.UpdateBlock.ObjectLocalID); @@ -3205,7 +3203,7 @@ namespace OpenSim.Region.ClientStack RequestMapLayer(); break; case PacketType.MapBlockRequest: - MapBlockRequestPacket MapRequest = (MapBlockRequestPacket) Pack; + MapBlockRequestPacket MapRequest = (MapBlockRequestPacket)Pack; if (OnRequestMapBlocks != null) { OnRequestMapBlocks(this, MapRequest.PositionData.MinX, MapRequest.PositionData.MinY, @@ -3213,7 +3211,7 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.MapNameRequest: - MapNameRequestPacket map = (MapNameRequestPacket) Pack; + MapNameRequestPacket map = (MapNameRequestPacket)Pack; string mapName = UTF8Encoding.UTF8.GetString(map.NameData.Name, 0, map.NameData.Name.Length - 1); if (OnMapNameRequest != null) @@ -3222,13 +3220,13 @@ namespace OpenSim.Region.ClientStack } break; case PacketType.TeleportLandmarkRequest: - TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket) Pack; + TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket)Pack; - TeleportStartPacket tpStart = (TeleportStartPacket) PacketPool.Instance.GetPacket(PacketType.TeleportStart); + TeleportStartPacket tpStart = (TeleportStartPacket)PacketPool.Instance.GetPacket(PacketType.TeleportStart); tpStart.Info.TeleportFlags = 8; // tp via lm OutPacket(tpStart, ThrottleOutPacketType.Task); - TeleportProgressPacket tpProgress = (TeleportProgressPacket) PacketPool.Instance.GetPacket(PacketType.TeleportProgress); + TeleportProgressPacket tpProgress = (TeleportProgressPacket)PacketPool.Instance.GetPacket(PacketType.TeleportProgress); tpProgress.Info.Message = (new ASCIIEncoding()).GetBytes("sending_landmark"); tpProgress.Info.TeleportFlags = 8; tpProgress.AgentData.AgentID = tpReq.Info.AgentID; @@ -3243,7 +3241,7 @@ namespace OpenSim.Region.ClientStack if (lm.RegionID == m_scene.RegionInfo.RegionID) { - TeleportLocalPacket tpLocal = (TeleportLocalPacket) PacketPool.Instance.GetPacket(PacketType.TeleportLocal); + TeleportLocalPacket tpLocal = (TeleportLocalPacket)PacketPool.Instance.GetPacket(PacketType.TeleportLocal); tpLocal.Info.AgentID = tpReq.Info.AgentID; tpLocal.Info.TeleportFlags = 8; // Teleport via landmark @@ -3253,7 +3251,7 @@ namespace OpenSim.Region.ClientStack } else { - TeleportCancelPacket tpCancel = (TeleportCancelPacket) PacketPool.Instance.GetPacket(PacketType.TeleportCancel); + TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); tpCancel.Info.AgentID = tpReq.Info.AgentID; tpCancel.Info.SessionID = tpReq.Info.SessionID; OutPacket(tpCancel, ThrottleOutPacketType.Task); @@ -3263,14 +3261,14 @@ namespace OpenSim.Region.ClientStack { Console.WriteLine("Cancelling Teleport - fetch asset not yet implemented"); - TeleportCancelPacket tpCancel = (TeleportCancelPacket) PacketPool.Instance.GetPacket(PacketType.TeleportCancel); + TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); tpCancel.Info.AgentID = tpReq.Info.AgentID; tpCancel.Info.SessionID = tpReq.Info.SessionID; OutPacket(tpCancel, ThrottleOutPacketType.Task); } break; case PacketType.TeleportLocationRequest: - TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket) Pack; + TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; // Console.WriteLine(tpLocReq.ToString()); if (OnTeleportLocationRequest != null) @@ -3281,30 +3279,30 @@ namespace OpenSim.Region.ClientStack else { //no event handler so cancel request - TeleportCancelPacket tpCancel = (TeleportCancelPacket) PacketPool.Instance.GetPacket(PacketType.TeleportCancel); + TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID; tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID; OutPacket(tpCancel, ThrottleOutPacketType.Task); } break; - #endregion + #endregion case PacketType.MoneyBalanceRequest: SendMoneyBalance(LLUUID.Zero, true, new byte[0], MoneyBalance); break; case PacketType.UUIDNameRequest: - UUIDNameRequestPacket incoming = (UUIDNameRequestPacket) Pack; + UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) { OnNameFromUUIDRequest(UUIDBlock.ID, this); } break; - #region Parcel related packets + #region Parcel related packets case PacketType.ParcelAccessListRequest: - ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket) Pack; + ParcelAccessListRequestPacket requestPacket = (ParcelAccessListRequestPacket)Pack; if (OnParcelAccessListRequest != null) { OnParcelAccessListRequest(requestPacket.AgentData.AgentID, requestPacket.AgentData.SessionID, @@ -3314,13 +3312,13 @@ namespace OpenSim.Region.ClientStack break; case PacketType.ParcelAccessListUpdate: - ParcelAccessListUpdatePacket updatePacket = (ParcelAccessListUpdatePacket) Pack; + ParcelAccessListUpdatePacket updatePacket = (ParcelAccessListUpdatePacket)Pack; List entries = new List(); foreach (ParcelAccessListUpdatePacket.ListBlock block in updatePacket.List) { ParcelManager.ParcelAccessEntry entry = new ParcelManager.ParcelAccessEntry(); entry.AgentID = block.ID; - entry.Flags = (ParcelManager.AccessList) block.Flags; + entry.Flags = (ParcelManager.AccessList)block.Flags; entry.Time = new DateTime(); entries.Add(entry); } @@ -3334,46 +3332,46 @@ namespace OpenSim.Region.ClientStack break; case PacketType.ParcelPropertiesRequest: - ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket) Pack; + ParcelPropertiesRequestPacket propertiesRequest = (ParcelPropertiesRequestPacket)Pack; if (OnParcelPropertiesRequest != null) { - OnParcelPropertiesRequest((int) Math.Round(propertiesRequest.ParcelData.West), - (int) Math.Round(propertiesRequest.ParcelData.South), - (int) Math.Round(propertiesRequest.ParcelData.East), - (int) Math.Round(propertiesRequest.ParcelData.North), + OnParcelPropertiesRequest((int)Math.Round(propertiesRequest.ParcelData.West), + (int)Math.Round(propertiesRequest.ParcelData.South), + (int)Math.Round(propertiesRequest.ParcelData.East), + (int)Math.Round(propertiesRequest.ParcelData.North), propertiesRequest.ParcelData.SequenceID, propertiesRequest.ParcelData.SnapSelection, this); } break; case PacketType.ParcelDivide: - ParcelDividePacket landDivide = (ParcelDividePacket) Pack; + ParcelDividePacket landDivide = (ParcelDividePacket)Pack; if (OnParcelDivideRequest != null) { - OnParcelDivideRequest((int) Math.Round(landDivide.ParcelData.West), - (int) Math.Round(landDivide.ParcelData.South), - (int) Math.Round(landDivide.ParcelData.East), - (int) Math.Round(landDivide.ParcelData.North), this); + OnParcelDivideRequest((int)Math.Round(landDivide.ParcelData.West), + (int)Math.Round(landDivide.ParcelData.South), + (int)Math.Round(landDivide.ParcelData.East), + (int)Math.Round(landDivide.ParcelData.North), this); } break; case PacketType.ParcelJoin: - ParcelJoinPacket landJoin = (ParcelJoinPacket) Pack; + ParcelJoinPacket landJoin = (ParcelJoinPacket)Pack; if (OnParcelJoinRequest != null) { - OnParcelJoinRequest((int) Math.Round(landJoin.ParcelData.West), - (int) Math.Round(landJoin.ParcelData.South), - (int) Math.Round(landJoin.ParcelData.East), - (int) Math.Round(landJoin.ParcelData.North), this); + OnParcelJoinRequest((int)Math.Round(landJoin.ParcelData.West), + (int)Math.Round(landJoin.ParcelData.South), + (int)Math.Round(landJoin.ParcelData.East), + (int)Math.Round(landJoin.ParcelData.North), this); } break; case PacketType.ParcelPropertiesUpdate: - ParcelPropertiesUpdatePacket parcelPropertiesPacket = (ParcelPropertiesUpdatePacket) Pack; + ParcelPropertiesUpdatePacket parcelPropertiesPacket = (ParcelPropertiesUpdatePacket)Pack; if (OnParcelPropertiesUpdateRequest != null) { OnParcelPropertiesUpdateRequest(parcelPropertiesPacket, this); } break; case PacketType.ParcelSelectObjects: - ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket) Pack; + ParcelSelectObjectsPacket selectPacket = (ParcelSelectObjectsPacket)Pack; if (OnParcelSelectObjects != null) { OnParcelSelectObjects(selectPacket.ParcelData.LocalID, @@ -3382,26 +3380,26 @@ namespace OpenSim.Region.ClientStack break; case PacketType.ParcelObjectOwnersRequest: //System.Console.WriteLine(Pack.ToString()); - ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket) Pack; + ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack; if (OnParcelObjectOwnerRequest != null) { OnParcelObjectOwnerRequest(reqPacket.ParcelData.LocalID, this); } break; - #endregion + #endregion - #region Estate Packets + #region Estate Packets case PacketType.EstateOwnerMessage: - EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket) Pack; + EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; if (OnEstateOwnerMessage != null) { OnEstateOwnerMessage(messagePacket, this); } break; case PacketType.RequestRegionInfo: - RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket) Pack).AgentData; + RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData; if (OnRegionInfoRequest != null) { OnRegionInfoRequest(this, mPacket.SessionID); @@ -3410,23 +3408,23 @@ namespace OpenSim.Region.ClientStack case PacketType.EstateCovenantRequest: // TODO: handle this packet EstateCovenantRequestPacket.AgentDataBlock epack = - ((EstateCovenantRequestPacket) Pack).AgentData; + ((EstateCovenantRequestPacket)Pack).AgentData; if (OnEstateCovenantRequest != null) { OnEstateCovenantRequest(this, epack.SessionID); } break; case PacketType.AgentThrottle: - AgentThrottlePacket atpack = (AgentThrottlePacket) Pack; + AgentThrottlePacket atpack = (AgentThrottlePacket)Pack; m_packetQueue.SetThrottleFromClient(atpack.Throttle.Throttles); break; - #endregion + #endregion - #region unimplemented handlers + #region unimplemented handlers case PacketType.RequestGodlikePowers: - RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket) Pack; + RequestGodlikePowersPacket rglpPack = (RequestGodlikePowersPacket)Pack; RequestGodlikePowersPacket.RequestBlockBlock rblock = rglpPack.RequestBlock; LLUUID token = rblock.Token; RequestGodlikePowersPacket.AgentDataBlock ablock = rglpPack.AgentData; @@ -3437,12 +3435,12 @@ namespace OpenSim.Region.ClientStack case PacketType.GodKickUser: MainLog.Instance.Warn("CLIENT", "unhandled GodKickUser packet"); - GodKickUserPacket gkupack = (GodKickUserPacket) Pack; + GodKickUserPacket gkupack = (GodKickUserPacket)Pack; if (gkupack.UserInfo.GodSessionID == SessionId && AgentId == gkupack.UserInfo.GodID) { OnGodKickUser(gkupack.UserInfo.GodID, gkupack.UserInfo.GodSessionID, - gkupack.UserInfo.AgentID, (uint) 0, gkupack.UserInfo.Reason); + gkupack.UserInfo.AgentID, (uint)0, gkupack.UserInfo.Reason); } else { @@ -3549,7 +3547,7 @@ namespace OpenSim.Region.ClientStack MainLog.Instance.Warn("CLIENT", "unhandled packet " + Pack.ToString()); break; - #endregion + #endregion } } @@ -3590,14 +3588,14 @@ namespace OpenSim.Region.ClientStack public void SendBlueBoxMessage(LLUUID FromAvatarID, LLUUID fromSessionID, String FromAvatarName, String Message) { if (!ChildAgentStatus()) - SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)1, (uint)Util.UnixTimeSinceEpoch()); + SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)1, (uint)Util.UnixTimeSinceEpoch()); //SendInstantMessage(FromAvatarID, fromSessionID, Message, AgentId, SessionId, FromAvatarName, (byte)21,(uint) Util.UnixTimeSinceEpoch()); } public void SendLogoutPacket() { - LogoutReplyPacket logReply = (LogoutReplyPacket) PacketPool.Instance.GetPacket(PacketType.LogoutReply); + LogoutReplyPacket logReply = (LogoutReplyPacket)PacketPool.Instance.GetPacket(PacketType.LogoutReply); // TODO: don't create new blocks if recycling an old packet logReply.AgentData.AgentID = AgentId; logReply.AgentData.SessionID = SessionId; -- cgit v1.1