aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-30 06:18:17 +0000
committerTeravus Ovares2007-12-30 06:18:17 +0000
commit32438ab1b9a5c270e0a4a2d708f8c7730dc7e617 (patch)
tree21595ce38d7a9474c1b3f3eb71c8d50a2763039a /OpenSim/Region/ClientStack
parent* Applied Melanie's same instance IM fix. This will make IMs work within the... (diff)
downloadopensim-SC-32438ab1b9a5c270e0a4a2d708f8c7730dc7e617.zip
opensim-SC-32438ab1b9a5c270e0a4a2d708f8c7730dc7e617.tar.gz
opensim-SC-32438ab1b9a5c270e0a4a2d708f8c7730dc7e617.tar.bz2
opensim-SC-32438ab1b9a5c270e0a4a2d708f8c7730dc7e617.tar.xz
* This update rolls back the packetpool and LibSL changes. Please retest and then patch these changes back in. Currently it's not quite ready for 0.5. The down side to this action, is that we loose some performance to the garbage collector for now. Given that the target date for 0.5 is *Two days* from now, I'm taking the initiative to work towards a real stable version.
* This update also fixes scripting and some weird physics reactions
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs178
1 files changed, 88 insertions, 90 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 932414d..8bf807c 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -216,7 +216,7 @@ namespace OpenSim.Region.ClientStack
216 { 216 {
217 m_scene.RemoveClient(AgentId); 217 m_scene.RemoveClient(AgentId);
218 // Send the STOP packet 218 // Send the STOP packet
219 DisableSimulatorPacket disable = (DisableSimulatorPacket) PacketPool.Instance.GetPacket(PacketType.DisableSimulator); 219 DisableSimulatorPacket disable = new DisableSimulatorPacket();
220 OutPacket(disable, ThrottleOutPacketType.Task); 220 OutPacket(disable, ThrottleOutPacketType.Task);
221 221
222 222
@@ -257,7 +257,7 @@ namespace OpenSim.Region.ClientStack
257 257
258 public void Kick(string message) 258 public void Kick(string message)
259 { 259 {
260 KickUserPacket kupack = (KickUserPacket) PacketPool.Instance.GetPacket(PacketType.KickUser); 260 KickUserPacket kupack = new KickUserPacket();
261 kupack.UserInfo.AgentID = AgentId; 261 kupack.UserInfo.AgentID = AgentId;
262 kupack.UserInfo.SessionID = SessionId; 262 kupack.UserInfo.SessionID = SessionId;
263 kupack.TargetBlock.TargetIP = (uint) 0; 263 kupack.TargetBlock.TargetIP = (uint) 0;
@@ -596,7 +596,7 @@ namespace OpenSim.Region.ClientStack
596 /// <param name="regInfo"></param> 596 /// <param name="regInfo"></param>
597 public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look) 597 public void MoveAgentIntoRegion(RegionInfo regInfo, LLVector3 pos, LLVector3 look)
598 { 598 {
599 AgentMovementCompletePacket mov = (AgentMovementCompletePacket) PacketPool.Instance.GetPacket(PacketType.AgentMovementComplete); 599 AgentMovementCompletePacket mov = new AgentMovementCompletePacket();
600 mov.SimData.ChannelVersion = m_channelVersion; 600 mov.SimData.ChannelVersion = m_channelVersion;
601 mov.AgentData.SessionID = m_sessionId; 601 mov.AgentData.SessionID = m_sessionId;
602 mov.AgentData.AgentID = AgentId; 602 mov.AgentData.AgentID = AgentId;
@@ -631,7 +631,7 @@ namespace OpenSim.Region.ClientStack
631 631
632 public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 632 public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
633 { 633 {
634 ChatFromSimulatorPacket reply = (ChatFromSimulatorPacket) PacketPool.Instance.GetPacket(PacketType.ChatFromSimulator); 634 ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
635 reply.ChatData.Audible = 1; 635 reply.ChatData.Audible = 1;
636 reply.ChatData.Message = message; 636 reply.ChatData.Message = message;
637 reply.ChatData.ChatType = type; 637 reply.ChatData.ChatType = type;
@@ -652,7 +652,7 @@ namespace OpenSim.Region.ClientStack
652 public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, 652 public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent,
653 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) 653 LLUUID imSessionID, string fromName, byte dialog, uint timeStamp)
654 { 654 {
655 ImprovedInstantMessagePacket msg = (ImprovedInstantMessagePacket) PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage); 655 ImprovedInstantMessagePacket msg = new ImprovedInstantMessagePacket();
656 msg.AgentData.AgentID = fromAgent; 656 msg.AgentData.AgentID = fromAgent;
657 msg.AgentData.SessionID = fromAgentSession; 657 msg.AgentData.SessionID = fromAgentSession;
658 msg.MessageBlock.FromAgentName = Helpers.StringToField(fromName); 658 msg.MessageBlock.FromAgentName = Helpers.StringToField(fromName);
@@ -740,7 +740,7 @@ namespace OpenSim.Region.ClientStack
740 IPAddress neighbourIP = neighbourEndPoint.Address; 740 IPAddress neighbourIP = neighbourEndPoint.Address;
741 ushort neighbourPort = (ushort) neighbourEndPoint.Port; 741 ushort neighbourPort = (ushort) neighbourEndPoint.Port;
742 742
743 EnableSimulatorPacket enablesimpacket = (EnableSimulatorPacket) PacketPool.Instance.GetPacket(PacketType.EnableSimulator); 743 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
744 // TODO: don't create new blocks if recycling an old packet 744 // TODO: don't create new blocks if recycling an old packet
745 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); 745 enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock();
746 enablesimpacket.SimulatorInfo.Handle = neighbourHandle; 746 enablesimpacket.SimulatorInfo.Handle = neighbourHandle;
@@ -777,7 +777,7 @@ namespace OpenSim.Region.ClientStack
777 { 777 {
778 LLVector3 look = new LLVector3(lookAt.X*10, lookAt.Y*10, lookAt.Z*10); 778 LLVector3 look = new LLVector3(lookAt.X*10, lookAt.Y*10, lookAt.Z*10);
779 779
780 CrossedRegionPacket newSimPack = (CrossedRegionPacket) PacketPool.Instance.GetPacket(PacketType.CrossedRegion); 780 CrossedRegionPacket newSimPack = new CrossedRegionPacket();
781 // TODO: don't create new blocks if recycling an old packet 781 // TODO: don't create new blocks if recycling an old packet
782 newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock(); 782 newSimPack.AgentData = new CrossedRegionPacket.AgentDataBlock();
783 newSimPack.AgentData.AgentID = AgentId; 783 newSimPack.AgentData.AgentID = AgentId;
@@ -800,7 +800,7 @@ namespace OpenSim.Region.ClientStack
800 800
801 public void SendMapBlock(List<MapBlockData> mapBlocks) 801 public void SendMapBlock(List<MapBlockData> mapBlocks)
802 { 802 {
803 MapBlockReplyPacket mapReply = (MapBlockReplyPacket) PacketPool.Instance.GetPacket(PacketType.MapBlockReply); 803 MapBlockReplyPacket mapReply = new MapBlockReplyPacket();
804 // TODO: don't create new blocks if recycling an old packet 804 // TODO: don't create new blocks if recycling an old packet
805 mapReply.AgentData.AgentID = AgentId; 805 mapReply.AgentData.AgentID = AgentId;
806 mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count]; 806 mapReply.Data = new MapBlockReplyPacket.DataBlock[mapBlocks.Count];
@@ -823,7 +823,7 @@ namespace OpenSim.Region.ClientStack
823 823
824 public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags) 824 public void SendLocalTeleport(LLVector3 position, LLVector3 lookAt, uint flags)
825 { 825 {
826 TeleportLocalPacket tpLocal = (TeleportLocalPacket) PacketPool.Instance.GetPacket(PacketType.TeleportLocal); 826 TeleportLocalPacket tpLocal = new TeleportLocalPacket();
827 tpLocal.Info.AgentID = AgentId; 827 tpLocal.Info.AgentID = AgentId;
828 tpLocal.Info.TeleportFlags = flags; 828 tpLocal.Info.TeleportFlags = flags;
829 tpLocal.Info.LocationID = 2; 829 tpLocal.Info.LocationID = 2;
@@ -835,7 +835,7 @@ namespace OpenSim.Region.ClientStack
835 public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, 835 public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID,
836 uint flags, string capsURL) 836 uint flags, string capsURL)
837 { 837 {
838 TeleportFinishPacket teleport = (TeleportFinishPacket) PacketPool.Instance.GetPacket(PacketType.TeleportFinish); 838 TeleportFinishPacket teleport = new TeleportFinishPacket();
839 teleport.Info.AgentID = AgentId; 839 teleport.Info.AgentID = AgentId;
840 teleport.Info.RegionHandle = regionHandle; 840 teleport.Info.RegionHandle = regionHandle;
841 teleport.Info.SimAccess = simAccess; 841 teleport.Info.SimAccess = simAccess;
@@ -861,7 +861,7 @@ namespace OpenSim.Region.ClientStack
861 /// </summary> 861 /// </summary>
862 public void SendTeleportFailed() 862 public void SendTeleportFailed()
863 { 863 {
864 TeleportFailedPacket tpFailed = (TeleportFailedPacket) PacketPool.Instance.GetPacket(PacketType.TeleportFailed); 864 TeleportFailedPacket tpFailed = new TeleportFailedPacket();
865 tpFailed.Info.AgentID = AgentId; 865 tpFailed.Info.AgentID = AgentId;
866 tpFailed.Info.Reason = Helpers.StringToField("unknown failure of teleport"); 866 tpFailed.Info.Reason = Helpers.StringToField("unknown failure of teleport");
867 OutPacket(tpFailed, ThrottleOutPacketType.Task); 867 OutPacket(tpFailed, ThrottleOutPacketType.Task);
@@ -872,14 +872,14 @@ namespace OpenSim.Region.ClientStack
872 /// </summary> 872 /// </summary>
873 public void SendTeleportLocationStart() 873 public void SendTeleportLocationStart()
874 { 874 {
875 TeleportStartPacket tpStart = (TeleportStartPacket) PacketPool.Instance.GetPacket(PacketType.TeleportStart); 875 TeleportStartPacket tpStart = new TeleportStartPacket();
876 tpStart.Info.TeleportFlags = 16; // Teleport via location 876 tpStart.Info.TeleportFlags = 16; // Teleport via location
877 OutPacket(tpStart, ThrottleOutPacketType.Task); 877 OutPacket(tpStart, ThrottleOutPacketType.Task);
878 } 878 }
879 879
880 public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance) 880 public void SendMoneyBalance(LLUUID transaction, bool success, byte[] description, int balance)
881 { 881 {
882 MoneyBalanceReplyPacket money = (MoneyBalanceReplyPacket) PacketPool.Instance.GetPacket(PacketType.MoneyBalanceReply); 882 MoneyBalanceReplyPacket money = new MoneyBalanceReplyPacket();
883 money.MoneyData.AgentID = AgentId; 883 money.MoneyData.AgentID = AgentId;
884 money.MoneyData.TransactionID = transaction; 884 money.MoneyData.TransactionID = transaction;
885 money.MoneyData.TransactionSuccess = success; 885 money.MoneyData.TransactionSuccess = success;
@@ -890,7 +890,7 @@ namespace OpenSim.Region.ClientStack
890 890
891 public void SendStartPingCheck(byte seq) 891 public void SendStartPingCheck(byte seq)
892 { 892 {
893 StartPingCheckPacket pc = (StartPingCheckPacket) PacketPool.Instance.GetPacket(PacketType.StartPingCheck); 893 StartPingCheckPacket pc = new StartPingCheckPacket();
894 pc.PingID.PingID = seq; 894 pc.PingID.PingID = seq;
895 pc.Header.Reliable = false; 895 pc.Header.Reliable = false;
896 OutPacket(pc, ThrottleOutPacketType.Task); 896 OutPacket(pc, ThrottleOutPacketType.Task);
@@ -898,7 +898,7 @@ namespace OpenSim.Region.ClientStack
898 898
899 public void SendKillObject(ulong regionHandle, uint localID) 899 public void SendKillObject(ulong regionHandle, uint localID)
900 { 900 {
901 KillObjectPacket kill = (KillObjectPacket) PacketPool.Instance.GetPacket(PacketType.KillObject); 901 KillObjectPacket kill = new KillObjectPacket();
902 // TODO: don't create new blocks if recycling an old packet 902 // TODO: don't create new blocks if recycling an old packet
903 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1]; 903 kill.ObjectData = new KillObjectPacket.ObjectDataBlock[1];
904 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock(); 904 kill.ObjectData[0] = new KillObjectPacket.ObjectDataBlock();
@@ -1092,7 +1092,7 @@ namespace OpenSim.Region.ClientStack
1092 1092
1093 private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID) 1093 private InventoryDescendentsPacket CreateInventoryDescendentsPacket(LLUUID ownerID, LLUUID folderID)
1094 { 1094 {
1095 InventoryDescendentsPacket descend = (InventoryDescendentsPacket) PacketPool.Instance.GetPacket(PacketType.InventoryDescendents); 1095 InventoryDescendentsPacket descend = new InventoryDescendentsPacket();
1096 descend.AgentData.AgentID = AgentId; 1096 descend.AgentData.AgentID = AgentId;
1097 descend.AgentData.OwnerID = ownerID; 1097 descend.AgentData.OwnerID = ownerID;
1098 descend.AgentData.FolderID = folderID; 1098 descend.AgentData.FolderID = folderID;
@@ -1105,7 +1105,7 @@ namespace OpenSim.Region.ClientStack
1105 { 1105 {
1106 Encoding enc = Encoding.ASCII; 1106 Encoding enc = Encoding.ASCII;
1107 uint FULL_MASK_PERMISSIONS = 2147483647; 1107 uint FULL_MASK_PERMISSIONS = 2147483647;
1108 FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket) PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); 1108 FetchInventoryReplyPacket inventoryReply = new FetchInventoryReplyPacket();
1109 // TODO: don't create new blocks if recycling an old packet 1109 // TODO: don't create new blocks if recycling an old packet
1110 inventoryReply.AgentData.AgentID = AgentId; 1110 inventoryReply.AgentData.AgentID = AgentId;
1111 inventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1]; 1111 inventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1];
@@ -1147,7 +1147,7 @@ namespace OpenSim.Region.ClientStack
1147 { 1147 {
1148 Encoding enc = Encoding.ASCII; 1148 Encoding enc = Encoding.ASCII;
1149 uint FULL_MASK_PERMISSIONS = 2147483647; 1149 uint FULL_MASK_PERMISSIONS = 2147483647;
1150 UpdateCreateInventoryItemPacket InventoryReply = (UpdateCreateInventoryItemPacket) PacketPool.Instance.GetPacket(PacketType.UpdateCreateInventoryItem); 1150 UpdateCreateInventoryItemPacket InventoryReply = new UpdateCreateInventoryItemPacket();
1151 // TODO: don't create new blocks if recycling an old packet 1151 // TODO: don't create new blocks if recycling an old packet
1152 InventoryReply.AgentData.AgentID = AgentId; 1152 InventoryReply.AgentData.AgentID = AgentId;
1153 InventoryReply.AgentData.SimApproved = true; 1153 InventoryReply.AgentData.SimApproved = true;
@@ -1186,7 +1186,7 @@ namespace OpenSim.Region.ClientStack
1186 1186
1187 public void SendRemoveInventoryItem(LLUUID itemID) 1187 public void SendRemoveInventoryItem(LLUUID itemID)
1188 { 1188 {
1189 RemoveInventoryItemPacket remove = (RemoveInventoryItemPacket) PacketPool.Instance.GetPacket(PacketType.RemoveInventoryItem); 1189 RemoveInventoryItemPacket remove = new RemoveInventoryItemPacket();
1190 // TODO: don't create new blocks if recycling an old packet 1190 // TODO: don't create new blocks if recycling an old packet
1191 remove.AgentData.AgentID = AgentId; 1191 remove.AgentData.AgentID = AgentId;
1192 remove.AgentData.SessionID = m_sessionId; 1192 remove.AgentData.SessionID = m_sessionId;
@@ -1199,7 +1199,7 @@ namespace OpenSim.Region.ClientStack
1199 1199
1200 public void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName) 1200 public void SendTaskInventory(LLUUID taskID, short serial, byte[] fileName)
1201 { 1201 {
1202 ReplyTaskInventoryPacket replytask = (ReplyTaskInventoryPacket) PacketPool.Instance.GetPacket(PacketType.ReplyTaskInventory); 1202 ReplyTaskInventoryPacket replytask = new ReplyTaskInventoryPacket();
1203 replytask.InventoryData.TaskID = taskID; 1203 replytask.InventoryData.TaskID = taskID;
1204 replytask.InventoryData.Serial = serial; 1204 replytask.InventoryData.Serial = serial;
1205 replytask.InventoryData.Filename = fileName; 1205 replytask.InventoryData.Filename = fileName;
@@ -1208,7 +1208,7 @@ namespace OpenSim.Region.ClientStack
1208 1208
1209 public void SendXferPacket(ulong xferID, uint packet, byte[] data) 1209 public void SendXferPacket(ulong xferID, uint packet, byte[] data)
1210 { 1210 {
1211 SendXferPacketPacket sendXfer = (SendXferPacketPacket) PacketPool.Instance.GetPacket(PacketType.SendXferPacket); 1211 SendXferPacketPacket sendXfer = new SendXferPacketPacket();
1212 sendXfer.XferID.ID = xferID; 1212 sendXfer.XferID.ID = xferID;
1213 sendXfer.XferID.Packet = packet; 1213 sendXfer.XferID.Packet = packet;
1214 sendXfer.DataPacket.Data = data; 1214 sendXfer.DataPacket.Data = data;
@@ -1226,7 +1226,7 @@ namespace OpenSim.Region.ClientStack
1226 /// <param name="message"></param> 1226 /// <param name="message"></param>
1227 public void SendAlertMessage(string message) 1227 public void SendAlertMessage(string message)
1228 { 1228 {
1229 AlertMessagePacket alertPack = (AlertMessagePacket) PacketPool.Instance.GetPacket(PacketType.AlertMessage); 1229 AlertMessagePacket alertPack = new AlertMessagePacket();
1230 alertPack.AlertData.Message = Helpers.StringToField(message); 1230 alertPack.AlertData.Message = Helpers.StringToField(message);
1231 OutPacket(alertPack, ThrottleOutPacketType.Task); 1231 OutPacket(alertPack, ThrottleOutPacketType.Task);
1232 } 1232 }
@@ -1238,7 +1238,7 @@ namespace OpenSim.Region.ClientStack
1238 /// <param name="modal"></param> 1238 /// <param name="modal"></param>
1239 public void SendAgentAlertMessage(string message, bool modal) 1239 public void SendAgentAlertMessage(string message, bool modal)
1240 { 1240 {
1241 AgentAlertMessagePacket alertPack = (AgentAlertMessagePacket) PacketPool.Instance.GetPacket(PacketType.AgentAlertMessage); 1241 AgentAlertMessagePacket alertPack = new AgentAlertMessagePacket();
1242 alertPack.AgentData.AgentID = AgentId; 1242 alertPack.AgentData.AgentID = AgentId;
1243 alertPack.AlertData.Message = Helpers.StringToField(message); 1243 alertPack.AlertData.Message = Helpers.StringToField(message);
1244 alertPack.AlertData.Modal = modal; 1244 alertPack.AlertData.Modal = modal;
@@ -1248,7 +1248,7 @@ namespace OpenSim.Region.ClientStack
1248 public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message, 1248 public void SendLoadURL(string objectname, LLUUID objectID, LLUUID ownerID, bool groupOwned, string message,
1249 string url) 1249 string url)
1250 { 1250 {
1251 LoadURLPacket loadURL = (LoadURLPacket) PacketPool.Instance.GetPacket(PacketType.LoadURL); 1251 LoadURLPacket loadURL = new LoadURLPacket();
1252 loadURL.Data.ObjectName = Helpers.StringToField(objectname); 1252 loadURL.Data.ObjectName = Helpers.StringToField(objectname);
1253 loadURL.Data.ObjectID = objectID; 1253 loadURL.Data.ObjectID = objectID;
1254 loadURL.Data.OwnerID = ownerID; 1254 loadURL.Data.OwnerID = ownerID;
@@ -1274,7 +1274,7 @@ namespace OpenSim.Region.ClientStack
1274 1274
1275 public void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags) 1275 public void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags)
1276 { 1276 {
1277 AttachedSoundPacket sound = (AttachedSoundPacket) PacketPool.Instance.GetPacket(PacketType.AttachedSound); 1277 AttachedSoundPacket sound = new AttachedSoundPacket();
1278 sound.DataBlock.SoundID = soundID; 1278 sound.DataBlock.SoundID = soundID;
1279 sound.DataBlock.ObjectID = objectID; 1279 sound.DataBlock.ObjectID = objectID;
1280 sound.DataBlock.OwnerID = ownerID; 1280 sound.DataBlock.OwnerID = ownerID;
@@ -1286,7 +1286,7 @@ namespace OpenSim.Region.ClientStack
1286 1286
1287 public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel) 1287 public void SendSunPos(LLVector3 sunPos, LLVector3 sunVel)
1288 { 1288 {
1289 SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket) PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); 1289 SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket();
1290 viewertime.TimeInfo.SunDirection = sunPos; 1290 viewertime.TimeInfo.SunDirection = sunPos;
1291 viewertime.TimeInfo.SunAngVelocity = sunVel; 1291 viewertime.TimeInfo.SunAngVelocity = sunVel;
1292 viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch(); 1292 viewertime.TimeInfo.UsecSinceStart = (ulong) Util.UnixTimeSinceEpoch();
@@ -1296,7 +1296,7 @@ namespace OpenSim.Region.ClientStack
1296 public void SendViewerTime(int phase) 1296 public void SendViewerTime(int phase)
1297 { 1297 {
1298 Console.WriteLine("SunPhase: {0}", phase); 1298 Console.WriteLine("SunPhase: {0}", phase);
1299 SimulatorViewerTimeMessagePacket viewertime = (SimulatorViewerTimeMessagePacket) PacketPool.Instance.GetPacket(PacketType.SimulatorViewerTimeMessage); 1299 SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket();
1300 //viewertime.TimeInfo.SecPerDay = 86400; 1300 //viewertime.TimeInfo.SecPerDay = 86400;
1301 //viewertime.TimeInfo.SecPerYear = 31536000; 1301 //viewertime.TimeInfo.SecPerYear = 31536000;
1302 viewertime.TimeInfo.SecPerDay = 1000; 1302 viewertime.TimeInfo.SecPerDay = 1000;
@@ -1345,7 +1345,7 @@ namespace OpenSim.Region.ClientStack
1345 string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL, 1345 string flAbout, uint flags, LLUUID flImageID, LLUUID imageID, string profileURL,
1346 LLUUID partnerID) 1346 LLUUID partnerID)
1347 { 1347 {
1348 AvatarPropertiesReplyPacket avatarReply = (AvatarPropertiesReplyPacket) PacketPool.Instance.GetPacket(PacketType.AvatarPropertiesReply); 1348 AvatarPropertiesReplyPacket avatarReply = new AvatarPropertiesReplyPacket();
1349 avatarReply.AgentData.AgentID = AgentId; 1349 avatarReply.AgentData.AgentID = AgentId;
1350 avatarReply.AgentData.AvatarID = avatarID; 1350 avatarReply.AgentData.AvatarID = avatarID;
1351 avatarReply.PropertiesData.AboutText = Helpers.StringToField(aboutText); 1351 avatarReply.PropertiesData.AboutText = Helpers.StringToField(aboutText);
@@ -1370,7 +1370,7 @@ namespace OpenSim.Region.ClientStack
1370 /// <param name="wearables"></param> 1370 /// <param name="wearables"></param>
1371 public void SendWearables(AvatarWearable[] wearables, int serial) 1371 public void SendWearables(AvatarWearable[] wearables, int serial)
1372 { 1372 {
1373 AgentWearablesUpdatePacket aw = (AgentWearablesUpdatePacket) PacketPool.Instance.GetPacket(PacketType.AgentWearablesUpdate); 1373 AgentWearablesUpdatePacket aw = new AgentWearablesUpdatePacket();
1374 aw.AgentData.AgentID = AgentId; 1374 aw.AgentData.AgentID = AgentId;
1375 aw.AgentData.SerialNum = (uint) serial; 1375 aw.AgentData.SerialNum = (uint) serial;
1376 aw.AgentData.SessionID = m_sessionId; 1376 aw.AgentData.SessionID = m_sessionId;
@@ -1398,7 +1398,7 @@ namespace OpenSim.Region.ClientStack
1398 /// <param name="textureEntry"></param> 1398 /// <param name="textureEntry"></param>
1399 public void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry) 1399 public void SendAppearance(LLUUID agentID, byte[] visualParams, byte[] textureEntry)
1400 { 1400 {
1401 AvatarAppearancePacket avp = (AvatarAppearancePacket) PacketPool.Instance.GetPacket(PacketType.AvatarAppearance); 1401 AvatarAppearancePacket avp = new AvatarAppearancePacket();
1402 // TODO: don't create new blocks if recycling an old packet 1402 // TODO: don't create new blocks if recycling an old packet
1403 avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218]; 1403 avp.VisualParam = new AvatarAppearancePacket.VisualParamBlock[218];
1404 avp.ObjectData.TextureEntry = textureEntry; 1404 avp.ObjectData.TextureEntry = textureEntry;
@@ -1418,7 +1418,7 @@ namespace OpenSim.Region.ClientStack
1418 1418
1419 public void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) 1419 public void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId)
1420 { 1420 {
1421 AvatarAnimationPacket ani = (AvatarAnimationPacket) PacketPool.Instance.GetPacket(PacketType.AvatarAnimation); 1421 AvatarAnimationPacket ani = new AvatarAnimationPacket();
1422 // TODO: don't create new blocks if recycling an old packet 1422 // TODO: don't create new blocks if recycling an old packet
1423 ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; 1423 ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1];
1424 ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); 1424 ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock();
@@ -1453,7 +1453,7 @@ namespace OpenSim.Region.ClientStack
1453 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, 1453 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID,
1454 uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID) 1454 uint avatarLocalID, LLVector3 Pos, byte[] textureEntry, uint parentID)
1455 { 1455 {
1456 ObjectUpdatePacket objupdate = (ObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); 1456 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
1457 // TODO: don't create new blocks if recycling an old packet 1457 // TODO: don't create new blocks if recycling an old packet
1458 objupdate.RegionData.RegionHandle = regionHandle; 1458 objupdate.RegionData.RegionHandle = regionHandle;
1459 objupdate.RegionData.TimeDilation = 64096; 1459 objupdate.RegionData.TimeDilation = 64096;
@@ -1486,7 +1486,7 @@ namespace OpenSim.Region.ClientStack
1486 { 1486 {
1487 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = 1487 ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock =
1488 CreateAvatarImprovedBlock(localID, position, velocity, rotation); 1488 CreateAvatarImprovedBlock(localID, position, velocity, rotation);
1489 ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); 1489 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
1490 // TODO: don't create new blocks if recycling an old packet 1490 // TODO: don't create new blocks if recycling an old packet
1491 terse.RegionData.RegionHandle = regionHandle; 1491 terse.RegionData.RegionHandle = regionHandle;
1492 terse.RegionData.TimeDilation = timeDilation; 1492 terse.RegionData.TimeDilation = timeDilation;
@@ -1498,7 +1498,7 @@ namespace OpenSim.Region.ClientStack
1498 1498
1499 public void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations) 1499 public void SendCoarseLocationUpdate(List<LLVector3> CoarseLocations)
1500 { 1500 {
1501 CoarseLocationUpdatePacket loc = (CoarseLocationUpdatePacket) PacketPool.Instance.GetPacket(PacketType.CoarseLocationUpdate); 1501 CoarseLocationUpdatePacket loc = new CoarseLocationUpdatePacket();
1502 // TODO: don't create new blocks if recycling an old packet 1502 // TODO: don't create new blocks if recycling an old packet
1503 int total = CoarseLocations.Count; 1503 int total = CoarseLocations.Count;
1504 CoarseLocationUpdatePacket.IndexBlock ib = 1504 CoarseLocationUpdatePacket.IndexBlock ib =
@@ -1531,7 +1531,7 @@ namespace OpenSim.Region.ClientStack
1531 /// <param name="attachPoint"></param> 1531 /// <param name="attachPoint"></param>
1532 public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) 1532 public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint)
1533 { 1533 {
1534 ObjectAttachPacket attach = (ObjectAttachPacket) PacketPool.Instance.GetPacket(PacketType.ObjectAttach); 1534 ObjectAttachPacket attach = new ObjectAttachPacket();
1535 // TODO: don't create new blocks if recycling an old packet 1535 // TODO: don't create new blocks if recycling an old packet
1536 attach.AgentData.AgentID = AgentId; 1536 attach.AgentData.AgentID = AgentId;
1537 attach.AgentData.SessionID = m_sessionId; 1537 attach.AgentData.SessionID = m_sessionId;
@@ -1551,7 +1551,7 @@ namespace OpenSim.Region.ClientStack
1551 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, 1551 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
1552 LLQuaternion rotation, byte clickAction) 1552 LLQuaternion rotation, byte clickAction)
1553 { 1553 {
1554 ObjectUpdatePacket outPacket = (ObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); 1554 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
1555 // TODO: don't create new blocks if recycling an old packet 1555 // TODO: don't create new blocks if recycling an old packet
1556 outPacket.RegionData.RegionHandle = regionHandle; 1556 outPacket.RegionData.RegionHandle = regionHandle;
1557 outPacket.RegionData.TimeDilation = timeDilation; 1557 outPacket.RegionData.TimeDilation = timeDilation;
@@ -1595,7 +1595,7 @@ namespace OpenSim.Region.ClientStack
1595 { 1595 {
1596 LLVector3 velocity = new LLVector3(0f, 0f, 0f); 1596 LLVector3 velocity = new LLVector3(0f, 0f, 0f);
1597 LLVector3 rotationalvelocity = new LLVector3(0f, 0f, 0f); 1597 LLVector3 rotationalvelocity = new LLVector3(0f, 0f, 0f);
1598 ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); 1598 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
1599 // TODO: don't create new blocks if recycling an old packet 1599 // TODO: don't create new blocks if recycling an old packet
1600 terse.RegionData.RegionHandle = regionHandle; 1600 terse.RegionData.RegionHandle = regionHandle;
1601 terse.RegionData.TimeDilation = timeDilation; 1601 terse.RegionData.TimeDilation = timeDilation;
@@ -1608,7 +1608,7 @@ namespace OpenSim.Region.ClientStack
1608 public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, 1608 public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position,
1609 LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity) 1609 LLQuaternion rotation, LLVector3 velocity, LLVector3 rotationalvelocity)
1610 { 1610 {
1611 ImprovedTerseObjectUpdatePacket terse = (ImprovedTerseObjectUpdatePacket) PacketPool.Instance.GetPacket(PacketType.ImprovedTerseObjectUpdate); 1611 ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket();
1612 // TODO: don't create new blocks if recycling an old packet 1612 // TODO: don't create new blocks if recycling an old packet
1613 terse.RegionData.RegionHandle = regionHandle; 1613 terse.RegionData.RegionHandle = regionHandle;
1614 terse.RegionData.TimeDilation = timeDilation; 1614 terse.RegionData.TimeDilation = timeDilation;
@@ -1946,8 +1946,8 @@ namespace OpenSim.Region.ClientStack
1946 1946
1947 public void SendNameReply(LLUUID profileId, string firstname, string lastname) 1947 public void SendNameReply(LLUUID profileId, string firstname, string lastname)
1948 { 1948 {
1949 UUIDNameReplyPacket packet = (UUIDNameReplyPacket) PacketPool.Instance.GetPacket(PacketType.UUIDNameReply); 1949 UUIDNameReplyPacket packet = new UUIDNameReplyPacket();
1950 // TODO: don't create new blocks if recycling an old packet 1950
1951 packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1]; 1951 packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1];
1952 packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); 1952 packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
1953 packet.UUIDNameBlock[0].ID = profileId; 1953 packet.UUIDNameBlock[0].ID = profileId;
@@ -1995,7 +1995,7 @@ namespace OpenSim.Region.ClientStack
1995 { 1995 {
1996 //System.Console.WriteLine("texture cached: " + packet.ToString()); 1996 //System.Console.WriteLine("texture cached: " + packet.ToString());
1997 AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket) packet; 1997 AgentCachedTexturePacket chechedtex = (AgentCachedTexturePacket) packet;
1998 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket) PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); 1998 AgentCachedTextureResponsePacket cachedresp = new AgentCachedTextureResponsePacket();
1999 // TODO: don't create new blocks if recycling an old packet 1999 // TODO: don't create new blocks if recycling an old packet
2000 cachedresp.AgentData.AgentID = AgentId; 2000 cachedresp.AgentData.AgentID = AgentId;
2001 cachedresp.AgentData.SessionID = m_sessionId; 2001 cachedresp.AgentData.SessionID = m_sessionId;
@@ -2156,7 +2156,7 @@ namespace OpenSim.Region.ClientStack
2156 { 2156 {
2157 //should be getting the map layer from the grid server 2157 //should be getting the map layer from the grid server
2158 //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) 2158 //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area)
2159 MapLayerReplyPacket mapReply = (MapLayerReplyPacket) PacketPool.Instance.GetPacket(PacketType.MapLayerReply); 2159 MapLayerReplyPacket mapReply = new MapLayerReplyPacket();
2160 // TODO: don't create new blocks if recycling an old packet 2160 // TODO: don't create new blocks if recycling an old packet
2161 mapReply.AgentData.AgentID = AgentId; 2161 mapReply.AgentData.AgentID = AgentId;
2162 mapReply.AgentData.Flags = 0; 2162 mapReply.AgentData.Flags = 0;
@@ -2301,18 +2301,22 @@ namespace OpenSim.Region.ClientStack
2301 // Actually make the byte array and send it 2301 // Actually make the byte array and send it
2302 try 2302 try
2303 { 2303 {
2304 byte[] sendbuffer = Pack.ToBytes(); 2304 byte[] sendbuffer = Pack.ToBytes();
2305 PacketPool.Instance.ReturnPacket(Pack); 2305 if (Pack is RegionHandshakePacket)
2306 2306 {
2307 if (Pack.Header.Zerocoded) 2307 PacketPool.Instance.ReturnPacket(Pack);
2308 { 2308 }
2309 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer); 2309
2310 m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode); 2310 if (Pack.Header.Zerocoded)
2311 } 2311 {
2312 else 2312 byte[] ZeroOutBuffer = new byte[4096];
2313 { 2313 int packetsize = Helpers.ZeroEncode(sendbuffer, sendbuffer.Length, ZeroOutBuffer);
2314 m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode); 2314 m_networkServer.SendPacketTo(ZeroOutBuffer, packetsize, SocketFlags.None, m_circuitCode);
2315 } 2315 }
2316 else
2317 {
2318 m_networkServer.SendPacketTo(sendbuffer, sendbuffer.Length, SocketFlags.None, m_circuitCode);
2319 }
2316 } 2320 }
2317 catch (Exception e) 2321 catch (Exception e)
2318 { 2322 {
@@ -2358,7 +2362,7 @@ namespace OpenSim.Region.ClientStack
2358 { 2362 {
2359 //reply to pingcheck 2363 //reply to pingcheck
2360 StartPingCheckPacket startPing = (StartPingCheckPacket) NewPack; 2364 StartPingCheckPacket startPing = (StartPingCheckPacket) NewPack;
2361 CompletePingCheckPacket endPing = (CompletePingCheckPacket) PacketPool.Instance.GetPacket(PacketType.CompletePingCheck); 2365 CompletePingCheckPacket endPing = new CompletePingCheckPacket();
2362 endPing.PingID.PingID = startPing.PingID.PingID; 2366 endPing.PingID.PingID = startPing.PingID.PingID;
2363 OutPacket(endPing, ThrottleOutPacketType.Task); 2367 OutPacket(endPing, ThrottleOutPacketType.Task);
2364 } 2368 }
@@ -2387,7 +2391,7 @@ namespace OpenSim.Region.ClientStack
2387 { 2391 {
2388 if (Pack.Header.Reliable) 2392 if (Pack.Header.Reliable)
2389 { 2393 {
2390 PacketAckPacket ack_it = (PacketAckPacket) PacketPool.Instance.GetPacket(PacketType.PacketAck); 2394 PacketAckPacket ack_it = new PacketAckPacket();
2391 // TODO: don't create new blocks if recycling an old packet 2395 // TODO: don't create new blocks if recycling an old packet
2392 ack_it.Packets = new PacketAckPacket.PacketsBlock[1]; 2396 ack_it.Packets = new PacketAckPacket.PacketsBlock[1];
2393 ack_it.Packets[0] = new PacketAckPacket.PacketsBlock(); 2397 ack_it.Packets[0] = new PacketAckPacket.PacketsBlock();
@@ -2443,7 +2447,7 @@ namespace OpenSim.Region.ClientStack
2443 //MainLog.Instance.Verbose("NETWORK", "Sending PacketAck"); 2447 //MainLog.Instance.Verbose("NETWORK", "Sending PacketAck");
2444 2448
2445 int i = 0; 2449 int i = 0;
2446 PacketAckPacket acks = (PacketAckPacket) PacketPool.Instance.GetPacket(PacketType.PacketAck); 2450 PacketAckPacket acks = new PacketAckPacket();
2447 // TODO: don't create new blocks if recycling an old packet 2451 // TODO: don't create new blocks if recycling an old packet
2448 acks.Packets = new PacketAckPacket.PacketsBlock[m_pendingAcks.Count]; 2452 acks.Packets = new PacketAckPacket.PacketsBlock[m_pendingAcks.Count];
2449 2453
@@ -2540,14 +2544,6 @@ namespace OpenSim.Region.ClientStack
2540 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket) Pack; 2544 ImprovedInstantMessagePacket msgpack = (ImprovedInstantMessagePacket) Pack;
2541 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName); 2545 string IMfromName = Util.FieldToString(msgpack.MessageBlock.FromAgentName);
2542 string IMmessage = Helpers.FieldToUTF8String(msgpack.MessageBlock.Message); 2546 string IMmessage = Helpers.FieldToUTF8String(msgpack.MessageBlock.Message);
2543 //byte[] msgpack.MessageBlock.BinaryBucket;
2544 //bool msgpack.MessageBlock.FromGroup;
2545
2546 //byte msgpack.MessageBlock.Offline;
2547 //uint msgpack.MessageBlock.ParentEstateID;
2548 //LLVector3 msgpack.MessageBlock.Position;
2549 //LLUUID msgpack.MessageBlock.RegionID;
2550
2551 if (OnInstantMessage != null) 2547 if (OnInstantMessage != null)
2552 { 2548 {
2553 OnInstantMessage(msgpack.AgentData.AgentID, msgpack.AgentData.SessionID, 2549 OnInstantMessage(msgpack.AgentData.AgentID, msgpack.AgentData.SessionID,
@@ -2555,7 +2551,7 @@ namespace OpenSim.Region.ClientStack
2555 msgpack.MessageBlock.Timestamp, IMfromName, IMmessage, 2551 msgpack.MessageBlock.Timestamp, IMfromName, IMmessage,
2556 msgpack.MessageBlock.Dialog, msgpack.MessageBlock.FromGroup, 2552 msgpack.MessageBlock.Dialog, msgpack.MessageBlock.FromGroup,
2557 msgpack.MessageBlock.Offline, msgpack.MessageBlock.ParentEstateID, 2553 msgpack.MessageBlock.Offline, msgpack.MessageBlock.ParentEstateID,
2558 msgpack.MessageBlock.Position, msgpack.MessageBlock.RegionID, 2554 msgpack.MessageBlock.Position, msgpack.MessageBlock.RegionID,
2559 msgpack.MessageBlock.BinaryBucket); 2555 msgpack.MessageBlock.BinaryBucket);
2560 } 2556 }
2561 break; 2557 break;
@@ -2571,19 +2567,14 @@ namespace OpenSim.Region.ClientStack
2571 //rezPacket.RezData.RemoveItem; 2567 //rezPacket.RezData.RemoveItem;
2572 //rezPacket.RezData.RezSelected; 2568 //rezPacket.RezData.RezSelected;
2573 //rezPacket.RezData.FromTaskID; 2569 //rezPacket.RezData.FromTaskID;
2574 //rezPacket.RezData.FromTaskID;
2575 //rezPacket.RezData.EveryoneMask;
2576 //rezPacket.RezData.GroupMask;
2577 //rezPacket.RezData.NextOwnerMask;
2578
2579 //MainLog.Instance.Verbose("REZData", rezPacket.ToString()); 2570 //MainLog.Instance.Verbose("REZData", rezPacket.ToString());
2580 OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd, 2571 OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
2581 rezPacket.RezData.RayStart,rezPacket.RezData.RayTargetID, 2572 rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID,
2582 rezPacket.RezData.BypassRaycast,rezPacket.RezData.RayEndIsIntersection, 2573 rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection,
2583 rezPacket.RezData.EveryoneMask,rezPacket.RezData.GroupMask, 2574 rezPacket.RezData.EveryoneMask, rezPacket.RezData.GroupMask,
2584 rezPacket.RezData.NextOwnerMask,rezPacket.RezData.ItemFlags, 2575 rezPacket.RezData.NextOwnerMask, rezPacket.RezData.ItemFlags,
2585 rezPacket.RezData.RezSelected,rezPacket.RezData.RemoveItem, 2576 rezPacket.RezData.RezSelected, rezPacket.RezData.RemoveItem,
2586 rezPacket.RezData.FromTaskID); 2577 rezPacket.RezData.FromTaskID);
2587 } 2578 }
2588 break; 2579 break;
2589 case PacketType.DeRezObject: 2580 case PacketType.DeRezObject:
@@ -2762,6 +2753,12 @@ namespace OpenSim.Region.ClientStack
2762 { 2753 {
2763 ObjectAddPacket addPacket = (ObjectAddPacket) Pack; 2754 ObjectAddPacket addPacket = (ObjectAddPacket) Pack;
2764 PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket); 2755 PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket);
2756 MainLog.Instance.Verbose("REZData", addPacket.ToString());
2757 //BypassRaycast: 1
2758 //RayStart: <69.79469, 158.2652, 98.40343>
2759 //RayEnd: <61.97724, 141.995, 92.58341>
2760 //RayTargetID: 00000000-0000-0000-0000-000000000000
2761
2765 OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape,addPacket.ObjectData.BypassRaycast,addPacket.ObjectData.RayStart,addPacket.ObjectData.RayTargetID,addPacket.ObjectData.RayEndIsIntersection); 2762 OnAddPrim(AgentId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape,addPacket.ObjectData.BypassRaycast,addPacket.ObjectData.RayStart,addPacket.ObjectData.RayTargetID,addPacket.ObjectData.RayEndIsIntersection);
2766 } 2763 }
2767 break; 2764 break;
@@ -2884,9 +2881,10 @@ namespace OpenSim.Region.ClientStack
2884 break; 2881 break;
2885 case PacketType.ObjectPermissions: 2882 case PacketType.ObjectPermissions:
2886 MainLog.Instance.Warn("CLIENT", "unhandled packet " + PacketType.ObjectPermissions.ToString()); 2883 MainLog.Instance.Warn("CLIENT", "unhandled packet " + PacketType.ObjectPermissions.ToString());
2887 ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack; 2884 ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket) Pack;
2888 2885
2889 List<ObjectPermissionsPacket.ObjectDataBlock> permChanges = new List<ObjectPermissionsPacket.ObjectDataBlock>(); 2886 List<ObjectPermissionsPacket.ObjectDataBlock> permChanges =
2887 new List<ObjectPermissionsPacket.ObjectDataBlock>();
2890 2888
2891 for (int i = 0; i < newobjPerms.ObjectData.Length; i++) 2889 for (int i = 0; i < newobjPerms.ObjectData.Length; i++)
2892 { 2890 {
@@ -2916,7 +2914,7 @@ namespace OpenSim.Region.ClientStack
2916 2914
2917 case PacketType.RequestObjectPropertiesFamily: 2915 case PacketType.RequestObjectPropertiesFamily:
2918 //This powers the little tooltip that appears when you move your mouse over an object 2916 //This powers the little tooltip that appears when you move your mouse over an object
2919 RequestObjectPropertiesFamilyPacket packToolTip = (RequestObjectPropertiesFamilyPacket)Pack; 2917 RequestObjectPropertiesFamilyPacket packToolTip = (RequestObjectPropertiesFamilyPacket) Pack;
2920 2918
2921 2919
2922 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData; 2920 RequestObjectPropertiesFamilyPacket.ObjectDataBlock packObjBlock = packToolTip.ObjectData;
@@ -3020,7 +3018,7 @@ namespace OpenSim.Region.ClientStack
3020 case PacketType.MoveInventoryFolder: 3018 case PacketType.MoveInventoryFolder:
3021 if (OnMoveInventoryFolder != null) 3019 if (OnMoveInventoryFolder != null)
3022 { 3020 {
3023 MoveInventoryFolderPacket invFolder = (MoveInventoryFolderPacket)Pack; 3021 MoveInventoryFolderPacket invFolder = (MoveInventoryFolderPacket) Pack;
3024 for (int i = 0; i < invFolder.InventoryData.Length; i++) 3022 for (int i = 0; i < invFolder.InventoryData.Length; i++)
3025 { 3023 {
3026 OnMoveInventoryFolder(this, invFolder.InventoryData[i].FolderID, 3024 OnMoveInventoryFolder(this, invFolder.InventoryData[i].FolderID,
@@ -3127,7 +3125,7 @@ namespace OpenSim.Region.ClientStack
3127 } 3125 }
3128 break; 3126 break;
3129 case PacketType.MoveInventoryItem: 3127 case PacketType.MoveInventoryItem:
3130 MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket)Pack; 3128 MoveInventoryItemPacket moveitem = (MoveInventoryItemPacket) Pack;
3131 if (OnMoveInventoryItem != null) 3129 if (OnMoveInventoryItem != null)
3132 { 3130 {
3133 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData) 3131 foreach (MoveInventoryItemPacket.InventoryDataBlock datablock in moveitem.InventoryData)
@@ -3196,11 +3194,11 @@ namespace OpenSim.Region.ClientStack
3196 case PacketType.TeleportLandmarkRequest: 3194 case PacketType.TeleportLandmarkRequest:
3197 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket) Pack; 3195 TeleportLandmarkRequestPacket tpReq = (TeleportLandmarkRequestPacket) Pack;
3198 3196
3199 TeleportStartPacket tpStart = (TeleportStartPacket) PacketPool.Instance.GetPacket(PacketType.TeleportStart); 3197 TeleportStartPacket tpStart = new TeleportStartPacket();
3200 tpStart.Info.TeleportFlags = 8; // tp via lm 3198 tpStart.Info.TeleportFlags = 8; // tp via lm
3201 OutPacket(tpStart, ThrottleOutPacketType.Task); 3199 OutPacket(tpStart, ThrottleOutPacketType.Task);
3202 3200
3203 TeleportProgressPacket tpProgress = (TeleportProgressPacket) PacketPool.Instance.GetPacket(PacketType.TeleportProgress); 3201 TeleportProgressPacket tpProgress = new TeleportProgressPacket();
3204 tpProgress.Info.Message = (new ASCIIEncoding()).GetBytes("sending_landmark"); 3202 tpProgress.Info.Message = (new ASCIIEncoding()).GetBytes("sending_landmark");
3205 tpProgress.Info.TeleportFlags = 8; 3203 tpProgress.Info.TeleportFlags = 8;
3206 tpProgress.AgentData.AgentID = tpReq.Info.AgentID; 3204 tpProgress.AgentData.AgentID = tpReq.Info.AgentID;
@@ -3215,7 +3213,7 @@ namespace OpenSim.Region.ClientStack
3215 3213
3216 if (lm.RegionID == m_scene.RegionInfo.RegionID) 3214 if (lm.RegionID == m_scene.RegionInfo.RegionID)
3217 { 3215 {
3218 TeleportLocalPacket tpLocal = (TeleportLocalPacket) PacketPool.Instance.GetPacket(PacketType.TeleportLocal); 3216 TeleportLocalPacket tpLocal = new TeleportLocalPacket();
3219 3217
3220 tpLocal.Info.AgentID = tpReq.Info.AgentID; 3218 tpLocal.Info.AgentID = tpReq.Info.AgentID;
3221 tpLocal.Info.TeleportFlags = 8; // Teleport via landmark 3219 tpLocal.Info.TeleportFlags = 8; // Teleport via landmark
@@ -3225,7 +3223,7 @@ namespace OpenSim.Region.ClientStack
3225 } 3223 }
3226 else 3224 else
3227 { 3225 {
3228 TeleportCancelPacket tpCancel = (TeleportCancelPacket) PacketPool.Instance.GetPacket(PacketType.TeleportCancel); 3226 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
3229 tpCancel.Info.AgentID = tpReq.Info.AgentID; 3227 tpCancel.Info.AgentID = tpReq.Info.AgentID;
3230 tpCancel.Info.SessionID = tpReq.Info.SessionID; 3228 tpCancel.Info.SessionID = tpReq.Info.SessionID;
3231 OutPacket(tpCancel, ThrottleOutPacketType.Task); 3229 OutPacket(tpCancel, ThrottleOutPacketType.Task);
@@ -3235,7 +3233,7 @@ namespace OpenSim.Region.ClientStack
3235 { 3233 {
3236 Console.WriteLine("Cancelling Teleport - fetch asset not yet implemented"); 3234 Console.WriteLine("Cancelling Teleport - fetch asset not yet implemented");
3237 3235
3238 TeleportCancelPacket tpCancel = (TeleportCancelPacket) PacketPool.Instance.GetPacket(PacketType.TeleportCancel); 3236 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
3239 tpCancel.Info.AgentID = tpReq.Info.AgentID; 3237 tpCancel.Info.AgentID = tpReq.Info.AgentID;
3240 tpCancel.Info.SessionID = tpReq.Info.SessionID; 3238 tpCancel.Info.SessionID = tpReq.Info.SessionID;
3241 OutPacket(tpCancel, ThrottleOutPacketType.Task); 3239 OutPacket(tpCancel, ThrottleOutPacketType.Task);
@@ -3253,7 +3251,7 @@ namespace OpenSim.Region.ClientStack
3253 else 3251 else
3254 { 3252 {
3255 //no event handler so cancel request 3253 //no event handler so cancel request
3256 TeleportCancelPacket tpCancel = (TeleportCancelPacket) PacketPool.Instance.GetPacket(PacketType.TeleportCancel); 3254 TeleportCancelPacket tpCancel = new TeleportCancelPacket();
3257 tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID; 3255 tpCancel.Info.SessionID = tpLocReq.AgentData.SessionID;
3258 tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID; 3256 tpCancel.Info.AgentID = tpLocReq.AgentData.AgentID;
3259 OutPacket(tpCancel, ThrottleOutPacketType.Task); 3257 OutPacket(tpCancel, ThrottleOutPacketType.Task);
@@ -3561,7 +3559,7 @@ namespace OpenSim.Region.ClientStack
3561 3559
3562 public void SendLogoutPacket() 3560 public void SendLogoutPacket()
3563 { 3561 {
3564 LogoutReplyPacket logReply = (LogoutReplyPacket) PacketPool.Instance.GetPacket(PacketType.LogoutReply); 3562 LogoutReplyPacket logReply = new LogoutReplyPacket();
3565 // TODO: don't create new blocks if recycling an old packet 3563 // TODO: don't create new blocks if recycling an old packet
3566 logReply.AgentData.AgentID = AgentId; 3564 logReply.AgentData.AgentID = AgentId;
3567 logReply.AgentData.SessionID = SessionId; 3565 logReply.AgentData.SessionID = SessionId;