aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/Assets/InventoryCache.cs17
-rw-r--r--OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs6
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs44
-rw-r--r--OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs7
-rw-r--r--OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs23
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs16
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs30
-rw-r--r--OpenSim/Region/ClientStack/ClientViewBase.cs23
-rw-r--r--OpenSim/Region/ClientStack/PacketServer.cs8
-rw-r--r--OpenSim/Region/ClientStack/RegionApplicationBase.cs23
-rw-r--r--OpenSim/Region/ClientStack/UDPServer.cs19
11 files changed, 79 insertions, 137 deletions
diff --git a/OpenSim/Region/ClientStack/Assets/InventoryCache.cs b/OpenSim/Region/ClientStack/Assets/InventoryCache.cs
index da74f85..082c0d0 100644
--- a/OpenSim/Region/ClientStack/Assets/InventoryCache.cs
+++ b/OpenSim/Region/ClientStack/Assets/InventoryCache.cs
@@ -28,13 +28,12 @@
28 28
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Text;
31using libsecondlife; 32using libsecondlife;
32using OpenSim;
33using libsecondlife.Packets; 33using libsecondlife.Packets;
34//using OpenSim.GridServers; 34using OpenSim.Framework.Interfaces;
35using OpenSim.Framework.Inventory; 35using OpenSim.Framework.Inventory;
36using OpenSim.Framework.Types; 36using OpenSim.Framework.Types;
37using OpenSim.Framework.Interfaces;
38using OpenSim.Region.ClientStack; 37using OpenSim.Region.ClientStack;
39 38
40namespace OpenSim.Assets 39namespace OpenSim.Assets
@@ -46,7 +45,7 @@ namespace OpenSim.Assets
46 { 45 {
47 private Dictionary<LLUUID, AgentInventory> _agentsInventory; 46 private Dictionary<LLUUID, AgentInventory> _agentsInventory;
48 private List<UserServerRequest> _serverRequests; //list of requests made to user server. 47 private List<UserServerRequest> _serverRequests; //list of requests made to user server.
49 private System.Text.Encoding _enc = System.Text.Encoding.ASCII; 48 private Encoding _enc = Encoding.ASCII;
50 private const uint FULL_MASK_PERMISSIONS = 2147483647; 49 private const uint FULL_MASK_PERMISSIONS = 2147483647;
51 50
52 public InventoryCache() 51 public InventoryCache()
@@ -127,7 +126,7 @@ namespace OpenSim.Assets
127 return res; 126 return res;
128 } 127 }
129 128
130 public LLUUID AddNewInventoryItem(ClientView remoteClient, LLUUID folderID, OpenSim.Framework.Types.AssetBase asset) 129 public LLUUID AddNewInventoryItem(ClientView remoteClient, LLUUID folderID, AssetBase asset)
131 { 130 {
132 LLUUID newItem = null; 131 LLUUID newItem = null;
133 if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) 132 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
@@ -163,7 +162,7 @@ namespace OpenSim.Assets
163 return res; 162 return res;
164 } 163 }
165 164
166 public bool UpdateInventoryItemAsset(ClientView remoteClient, LLUUID itemID, OpenSim.Framework.Types.AssetBase asset) 165 public bool UpdateInventoryItemAsset(ClientView remoteClient, LLUUID itemID, AssetBase asset)
167 { 166 {
168 if (this._agentsInventory.ContainsKey(remoteClient.AgentID)) 167 if (this._agentsInventory.ContainsKey(remoteClient.AgentID))
169 { 168 {
@@ -238,7 +237,7 @@ namespace OpenSim.Assets
238 Descend.ItemData[i].SalePrice = 100; 237 Descend.ItemData[i].SalePrice = 100;
239 Descend.ItemData[i].SaleType = 0; 238 Descend.ItemData[i].SaleType = 0;
240 Descend.ItemData[i].Type = Item.Type; 239 Descend.ItemData[i].Type = Item.Type;
241 Descend.ItemData[i].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, Descend.ItemData[i].InvType, Descend.ItemData[i].Type, Descend.ItemData[i].AssetID, Descend.ItemData[i].GroupID, 100, Descend.ItemData[i].OwnerID, Descend.ItemData[i].CreatorID, Descend.ItemData[i].ItemID, Descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); 240 Descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, Descend.ItemData[i].InvType, Descend.ItemData[i].Type, Descend.ItemData[i].AssetID, Descend.ItemData[i].GroupID, 100, Descend.ItemData[i].OwnerID, Descend.ItemData[i].CreatorID, Descend.ItemData[i].ItemID, Descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
242 } 241 }
243 242
244 userInfo.OutPacket(Descend); 243 userInfo.OutPacket(Descend);
@@ -286,7 +285,7 @@ namespace OpenSim.Assets
286 InventoryReply.InventoryData[0].SalePrice = 100; 285 InventoryReply.InventoryData[0].SalePrice = 100;
287 InventoryReply.InventoryData[0].SaleType = 0; 286 InventoryReply.InventoryData[0].SaleType = 0;
288 InventoryReply.InventoryData[0].Type = Item.Type; 287 InventoryReply.InventoryData[0].Type = Item.Type;
289 InventoryReply.InventoryData[0].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); 288 InventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
290 userInfo.OutPacket(InventoryReply); 289 userInfo.OutPacket(InventoryReply);
291 } 290 }
292 } 291 }
@@ -320,7 +319,7 @@ namespace OpenSim.Assets
320 InventoryReply.InventoryData[0].SalePrice = 100; 319 InventoryReply.InventoryData[0].SalePrice = 100;
321 InventoryReply.InventoryData[0].SaleType = 0; 320 InventoryReply.InventoryData[0].SaleType = 0;
322 InventoryReply.InventoryData[0].Type = Item.Type; 321 InventoryReply.InventoryData[0].Type = Item.Type;
323 InventoryReply.InventoryData[0].CRC = libsecondlife.Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); 322 InventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
324 323
325 remoteClient.OutPacket(InventoryReply); 324 remoteClient.OutPacket(InventoryReply);
326 } 325 }
diff --git a/OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs b/OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs
index f99cf79..f4e537c 100644
--- a/OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs
+++ b/OpenSim/Region/ClientStack/ClientStackNetworkHandler.cs
@@ -25,13 +25,7 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.Collections.Generic;
30using System.Text;
31using System.Net;
32using System.Net.Sockets; 28using System.Net.Sockets;
33using libsecondlife;
34
35 29
36namespace OpenSim.Region.ClientStack 30namespace OpenSim.Region.ClientStack
37{ 31{
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 51f02da..40e0021 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -27,14 +27,14 @@
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Net;
30using System.Text; 31using System.Text;
31using OpenSim.Framework.Interfaces; 32using Axiom.MathLib;
32using OpenSim.Framework.Inventory;
33using OpenSim.Framework.Types;
34
35using libsecondlife; 33using libsecondlife;
36using libsecondlife.Packets; 34using libsecondlife.Packets;
37using System.Net; 35using OpenSim.Framework.Console;
36using OpenSim.Framework.Interfaces;
37using OpenSim.Framework.Types;
38 38
39namespace OpenSim.Region.ClientStack 39namespace OpenSim.Region.ClientStack
40{ 40{
@@ -137,7 +137,7 @@ namespace OpenSim.Region.ClientStack
137 /// <param name="regionInfo"></param> 137 /// <param name="regionInfo"></param>
138 public void SendRegionHandshake(RegionInfo regionInfo) 138 public void SendRegionHandshake(RegionInfo regionInfo)
139 { 139 {
140 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 140 Encoding _enc = Encoding.ASCII;
141 RegionHandshakePacket handshake = new RegionHandshakePacket(); 141 RegionHandshakePacket handshake = new RegionHandshakePacket();
142 142
143 handshake.RegionInfo.BillableFactor = regionInfo.estateSettings.billableFactor; 143 handshake.RegionInfo.BillableFactor = regionInfo.estateSettings.billableFactor;
@@ -219,8 +219,8 @@ namespace OpenSim.Region.ClientStack
219 /// <param name="fromAgentID"></param> 219 /// <param name="fromAgentID"></param>
220 public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID) 220 public void SendChatMessage(byte[] message, byte type, LLVector3 fromPos, string fromName, LLUUID fromAgentID)
221 { 221 {
222 System.Text.Encoding enc = System.Text.Encoding.ASCII; 222 Encoding enc = Encoding.ASCII;
223 libsecondlife.Packets.ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket(); 223 ChatFromSimulatorPacket reply = new ChatFromSimulatorPacket();
224 reply.ChatData.Audible = 1; 224 reply.ChatData.Audible = 1;
225 reply.ChatData.Message = message; 225 reply.ChatData.Message = message;
226 reply.ChatData.ChatType = type; 226 reply.ChatData.ChatType = type;
@@ -260,7 +260,7 @@ namespace OpenSim.Region.ClientStack
260 } 260 }
261 catch (Exception e) 261 catch (Exception e)
262 { 262 {
263 OpenSim.Framework.Console.MainLog.Instance.Warn("ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString()); 263 MainLog.Instance.Warn("ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString());
264 } 264 }
265 } 265 }
266 266
@@ -286,7 +286,7 @@ namespace OpenSim.Region.ClientStack
286 } 286 }
287 catch (Exception e) 287 catch (Exception e)
288 { 288 {
289 OpenSim.Framework.Console.MainLog.Instance.Warn("ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString()); 289 MainLog.Instance.Warn("ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString());
290 } 290 }
291 } 291 }
292 292
@@ -298,7 +298,7 @@ namespace OpenSim.Region.ClientStack
298 /// <param name="neighbourPort"></param> 298 /// <param name="neighbourPort"></param>
299 public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint ) 299 public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint )
300 { 300 {
301 System.Net.IPAddress neighbourIP = neighbourEndPoint.Address; 301 IPAddress neighbourIP = neighbourEndPoint.Address;
302 ushort neighbourPort = (ushort) neighbourEndPoint.Port; 302 ushort neighbourPort = (ushort) neighbourEndPoint.Port;
303 303
304 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); 304 EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket();
@@ -343,7 +343,7 @@ namespace OpenSim.Region.ClientStack
343 newSimPack.Info = new CrossedRegionPacket.InfoBlock(); 343 newSimPack.Info = new CrossedRegionPacket.InfoBlock();
344 newSimPack.Info.Position = pos; 344 newSimPack.Info.Position = pos;
345 newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!! 345 newSimPack.Info.LookAt = look; // new LLVector3(0.0f, 0.0f, 0.0f); // copied from Avatar.cs - SHOULD BE DYNAMIC!!!!!!!!!!
346 newSimPack.RegionData = new libsecondlife.Packets.CrossedRegionPacket.RegionDataBlock(); 346 newSimPack.RegionData = new CrossedRegionPacket.RegionDataBlock();
347 newSimPack.RegionData.RegionHandle = newRegionHandle; 347 newSimPack.RegionData.RegionHandle = newRegionHandle;
348 byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes(); 348 byte[] byteIP = externalIPEndPoint.Address.GetAddressBytes();
349 newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24; 349 newSimPack.RegionData.SimIP = (uint)byteIP[3] << 24;
@@ -359,7 +359,7 @@ namespace OpenSim.Region.ClientStack
359 359
360 public void SendMapBlock(List<MapBlockData> mapBlocks) 360 public void SendMapBlock(List<MapBlockData> mapBlocks)
361 { 361 {
362 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 362 Encoding _enc = Encoding.ASCII;
363 363
364 MapBlockReplyPacket mapReply = new MapBlockReplyPacket(); 364 MapBlockReplyPacket mapReply = new MapBlockReplyPacket();
365 mapReply.AgentData.AgentID = this.AgentID; 365 mapReply.AgentData.AgentID = this.AgentID;
@@ -514,20 +514,20 @@ namespace OpenSim.Region.ClientStack
514 /// <param name="Pos"></param> 514 /// <param name="Pos"></param>
515 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry) 515 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, LLUUID avatarID, uint avatarLocalID, LLVector3 Pos, byte[] textureEntry)
516 { 516 {
517 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 517 Encoding _enc = Encoding.ASCII;
518 //send a objectupdate packet with information about the clients avatar 518 //send a objectupdate packet with information about the clients avatar
519 519
520 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 520 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
521 objupdate.RegionData.RegionHandle = regionHandle; 521 objupdate.RegionData.RegionHandle = regionHandle;
522 objupdate.RegionData.TimeDilation = 64096; 522 objupdate.RegionData.TimeDilation = 64096;
523 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 523 objupdate.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
524 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(textureEntry); 524 objupdate.ObjectData[0] = this.CreateDefaultAvatarPacket(textureEntry);
525 //give this avatar object a local id and assign the user a name 525 //give this avatar object a local id and assign the user a name
526 526
527 objupdate.ObjectData[0].ID = avatarLocalID; 527 objupdate.ObjectData[0].ID = avatarLocalID;
528 objupdate.ObjectData[0].FullID = avatarID; 528 objupdate.ObjectData[0].FullID = avatarID;
529 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName + " \0"); 529 objupdate.ObjectData[0].NameValue = _enc.GetBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName + " \0");
530 libsecondlife.LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z); 530 LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z);
531 byte[] pb = pos2.GetBytes(); 531 byte[] pb = pos2.GetBytes();
532 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); 532 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
533 533
@@ -716,9 +716,9 @@ namespace OpenSim.Region.ClientStack
716 ushort InternVelocityX; 716 ushort InternVelocityX;
717 ushort InternVelocityY; 717 ushort InternVelocityY;
718 ushort InternVelocityZ; 718 ushort InternVelocityZ;
719 Axiom.MathLib.Vector3 internDirec = new Axiom.MathLib.Vector3(0, 0, 0); 719 Vector3 internDirec = new Vector3(0, 0, 0);
720 720
721 internDirec = new Axiom.MathLib.Vector3(velocity.X, velocity.Y, velocity.Z); 721 internDirec = new Vector3(velocity.X, velocity.Y, velocity.Z);
722 722
723 internDirec = internDirec / 128.0f; 723 internDirec = internDirec / 128.0f;
724 internDirec.x += 1; 724 internDirec.x += 1;
@@ -961,7 +961,7 @@ namespace OpenSim.Region.ClientStack
961 /// <returns></returns> 961 /// <returns></returns>
962 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry) 962 protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket(byte[] textureEntry)
963 { 963 {
964 libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); 964 ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i);
965 965
966 SetDefaultAvatarPacketValues(ref objdata); 966 SetDefaultAvatarPacketValues(ref objdata);
967 objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); 967 objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24);
@@ -977,12 +977,12 @@ namespace OpenSim.Region.ClientStack
977 { 977 {
978 objdata.TextureEntry = textureEntry; 978 objdata.TextureEntry = textureEntry;
979 } 979 }
980 System.Text.Encoding enc = System.Text.Encoding.ASCII; 980 Encoding enc = Encoding.ASCII;
981 libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); 981 LLVector3 pos = new LLVector3(objdata.ObjectData, 16);
982 pos.X = 100f; 982 pos.X = 100f;
983 objdata.ID = 8880000; 983 objdata.ID = 8880000;
984 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); 984 objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0");
985 libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f); 985 LLVector3 pos2 = new LLVector3(100f, 100f, 23f);
986 //objdata.FullID=user.AgentID; 986 //objdata.FullID=user.AgentID;
987 byte[] pb = pos.GetBytes(); 987 byte[] pb = pos.GetBytes();
988 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length); 988 Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length);
diff --git a/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs b/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs
index bc6cc21..60cd33a 100644
--- a/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs
+++ b/OpenSim/Region/ClientStack/ClientView.AgentAssetUpload.cs
@@ -27,14 +27,13 @@
27*/ 27*/
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text; 30using libsecondlife;
31using libsecondlife.Packets;
31using OpenSim.Assets; 32using OpenSim.Assets;
32using OpenSim.Framework.Types;
33using OpenSim.Framework.Interfaces; 33using OpenSim.Framework.Interfaces;
34using OpenSim.Framework.Types;
34using OpenSim.Framework.Utilities; 35using OpenSim.Framework.Utilities;
35using OpenSim.Region.Caches; 36using OpenSim.Region.Caches;
36using libsecondlife;
37using libsecondlife.Packets;
38 37
39namespace OpenSim.Region.ClientStack 38namespace OpenSim.Region.ClientStack
40{ 39{
diff --git a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
index 0456e3c..e4512d1 100644
--- a/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
+++ b/OpenSim/Region/ClientStack/ClientView.PacketHandlers.cs
@@ -25,22 +25,9 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.Collections;
30using System.Collections.Generic;
31using libsecondlife; 28using libsecondlife;
32using libsecondlife.Packets; 29using libsecondlife.Packets;
33using Nwc.XmlRpc; 30using OpenSim.Framework.Console;
34using System.Net;
35using System.Net.Sockets;
36using System.IO;
37using System.Threading;
38using System.Timers;
39using OpenSim.Framework.Interfaces;
40using OpenSim.Framework.Types;
41using OpenSim.Framework.Inventory;
42using OpenSim.Framework.Utilities;
43using OpenSim.Assets;
44 31
45namespace OpenSim.Region.ClientStack 32namespace OpenSim.Region.ClientStack
46{ 33{
@@ -55,7 +42,7 @@ namespace OpenSim.Region.ClientStack
55 42
56 protected virtual bool Logout(ClientView simClient, Packet packet) 43 protected virtual bool Logout(ClientView simClient, Packet packet)
57 { 44 {
58 OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs:ProcessInPacket() - Got a logout request"); 45 MainLog.Instance.Verbose( "OpenSimClient.cs:ProcessInPacket() - Got a logout request");
59 //send reply to let the client logout 46 //send reply to let the client logout
60 LogoutReplyPacket logReply = new LogoutReplyPacket(); 47 LogoutReplyPacket logReply = new LogoutReplyPacket();
61 logReply.AgentData.AgentID = this.AgentID; 48 logReply.AgentData.AgentID = this.AgentID;
@@ -120,7 +107,7 @@ namespace OpenSim.Region.ClientStack
120 { 107 {
121 if (OnUpdatePrimPosition != null) 108 if (OnUpdatePrimPosition != null)
122 { 109 {
123 libsecondlife.LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0); 110 LLVector3 pos = new LLVector3(multipleupdate.ObjectData[i].Data, 0);
124 OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this); 111 OnUpdatePrimPosition(multipleupdate.ObjectData[i].ObjectLocalID, pos, this);
125 } 112 }
126 //should update stored position of the prim 113 //should update stored position of the prim
@@ -129,7 +116,7 @@ namespace OpenSim.Region.ClientStack
129 { 116 {
130 if (OnUpdatePrimRotation != null) 117 if (OnUpdatePrimRotation != null)
131 { 118 {
132 libsecondlife.LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true); 119 LLQuaternion rot = new LLQuaternion(multipleupdate.ObjectData[i].Data, 0, true);
133 OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this); 120 OnUpdatePrimRotation(multipleupdate.ObjectData[i].ObjectLocalID, rot, this);
134 } 121 }
135 } 122 }
@@ -137,7 +124,7 @@ namespace OpenSim.Region.ClientStack
137 { 124 {
138 if (OnUpdatePrimScale != null) 125 if (OnUpdatePrimScale != null)
139 { 126 {
140 libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12); 127 LLVector3 scale = new LLVector3(multipleupdate.ObjectData[i].Data, 12);
141 OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this); 128 OnUpdatePrimScale(multipleupdate.ObjectData[i].ObjectLocalID, scale, this);
142 } 129 }
143 } 130 }
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index 75d3f65..8419906 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -26,21 +26,13 @@
26* 26*
27*/ 27*/
28using System; 28using System;
29using System.Collections;
30using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Text;
31using libsecondlife; 31using libsecondlife;
32using libsecondlife.Packets; 32using libsecondlife.Packets;
33using Nwc.XmlRpc;
34using System.Net;
35using System.Net.Sockets;
36using System.IO;
37using System.Threading;
38using System.Timers;
39using OpenSim.Framework.Interfaces;
40using OpenSim.Framework.Types;
41using OpenSim.Framework.Inventory; 33using OpenSim.Framework.Inventory;
34using OpenSim.Framework.Types;
42using OpenSim.Framework.Utilities; 35using OpenSim.Framework.Utilities;
43using OpenSim.Assets;
44 36
45namespace OpenSim.Region.ClientStack 37namespace OpenSim.Region.ClientStack
46{ 38{
@@ -64,7 +56,7 @@ namespace OpenSim.Region.ClientStack
64 } 56 }
65 else 57 else
66 { 58 {
67 System.Text.Encoding _enc = System.Text.Encoding.ASCII; 59 Encoding _enc = Encoding.ASCII;
68 60
69 switch (Pack.Type) 61 switch (Pack.Type)
70 { 62 {
@@ -452,7 +444,7 @@ namespace OpenSim.Region.ClientStack
452 this.OutPacket(tpStart); 444 this.OutPacket(tpStart);
453 445
454 TeleportProgressPacket tpProgress = new TeleportProgressPacket(); 446 TeleportProgressPacket tpProgress = new TeleportProgressPacket();
455 tpProgress.Info.Message = (new System.Text.ASCIIEncoding()).GetBytes("sending_landmark"); 447 tpProgress.Info.Message = (new ASCIIEncoding()).GetBytes("sending_landmark");
456 tpProgress.Info.TeleportFlags = 8; 448 tpProgress.Info.TeleportFlags = 8;
457 tpProgress.AgentData.AgentID = tpReq.Info.AgentID; 449 tpProgress.AgentData.AgentID = tpReq.Info.AgentID;
458 this.OutPacket(tpProgress); 450 this.OutPacket(tpProgress);
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index a36eeb0..606ca1d 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -25,24 +25,22 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.Collections;
30using System.Collections.Generic; 28using System.Collections.Generic;
31using libsecondlife;
32using libsecondlife.Packets;
33using Nwc.XmlRpc;
34using System.Net; 29using System.Net;
35using System.Net.Sockets; 30using System.Text;
36using System.IO;
37using System.Threading; 31using System.Threading;
38using System.Timers; 32using System.Timers;
33using libsecondlife;
34using libsecondlife.Packets;
35using OpenSim.Assets;
39using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Framework.Console;
40using OpenSim.Framework.Interfaces; 38using OpenSim.Framework.Interfaces;
41using OpenSim.Framework.Types;
42using OpenSim.Framework.Inventory; 39using OpenSim.Framework.Inventory;
40using OpenSim.Framework.Types;
43using OpenSim.Framework.Utilities; 41using OpenSim.Framework.Utilities;
44using OpenSim.Assets;
45using OpenSim.Region.Caches; 42using OpenSim.Region.Caches;
43using Timer=System.Timers.Timer;
46 44
47namespace OpenSim.Region.ClientStack 45namespace OpenSim.Region.ClientStack
48{ 46{
@@ -79,7 +77,7 @@ namespace OpenSim.Region.ClientStack
79 private int cachedtextureserial = 0; 77 private int cachedtextureserial = 0;
80 private RegionInfo m_regionData; 78 private RegionInfo m_regionData;
81 protected AuthenticateSessionsBase m_authenticateSessionsHandler; 79 protected AuthenticateSessionsBase m_authenticateSessionsHandler;
82 private System.Text.Encoding enc = System.Text.Encoding.ASCII; 80 private Encoding enc = Encoding.ASCII;
83 81
84 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions ) 82 public ClientView(EndPoint remoteEP, UseCircuitCodePacket initialcirpack, Dictionary<uint, ClientView> clientThreads, IWorld world, AssetCache assetCache, PacketServer packServer, InventoryCache inventoryCache, AuthenticateSessionsBase authenSessions )
85 { 83 {
@@ -91,7 +89,7 @@ namespace OpenSim.Region.ClientStack
91 m_inventoryCache = inventoryCache; 89 m_inventoryCache = inventoryCache;
92 m_authenticateSessionsHandler = authenSessions; 90 m_authenticateSessionsHandler = authenSessions;
93 91
94 OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs - Started up new client thread to handle incoming request"); 92 MainLog.Instance.Verbose( "OpenSimClient.cs - Started up new client thread to handle incoming request");
95 cirpack = initialcirpack; 93 cirpack = initialcirpack;
96 userEP = remoteEP; 94 userEP = remoteEP;
97 95
@@ -100,7 +98,7 @@ namespace OpenSim.Region.ClientStack
100 PacketQueue = new BlockingQueue<QueItem>(); 98 PacketQueue = new BlockingQueue<QueItem>();
101 99
102 this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache); 100 this.UploadAssets = new AgentAssetUpload(this, m_assetCache, m_inventoryCache);
103 AckTimer = new System.Timers.Timer(500); 101 AckTimer = new Timer(500);
104 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed); 102 AckTimer.Elapsed += new ElapsedEventHandler(AckTimer_Elapsed);
105 AckTimer.Start(); 103 AckTimer.Start();
106 104
@@ -189,7 +187,7 @@ namespace OpenSim.Region.ClientStack
189 187
190 protected virtual void ClientLoop() 188 protected virtual void ClientLoop()
191 { 189 {
192 OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs:ClientLoop() - Entered loop"); 190 MainLog.Instance.Verbose( "OpenSimClient.cs:ClientLoop() - Entered loop");
193 while (true) 191 while (true)
194 { 192 {
195 QueItem nextPacket = PacketQueue.Dequeue(); 193 QueItem nextPacket = PacketQueue.Dequeue();
@@ -211,7 +209,7 @@ namespace OpenSim.Region.ClientStack
211 209
212 protected virtual void InitNewClient() 210 protected virtual void InitNewClient()
213 { 211 {
214 OpenSim.Framework.Console.MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world"); 212 MainLog.Instance.Verbose( "OpenSimClient.cs:InitNewClient() - Adding viewer agent to world");
215 this.m_world.AddNewClient(this, false); 213 this.m_world.AddNewClient(this, false);
216 } 214 }
217 215
@@ -222,12 +220,12 @@ namespace OpenSim.Region.ClientStack
222 if (!sessionInfo.Authorised) 220 if (!sessionInfo.Authorised)
223 { 221 {
224 //session/circuit not authorised 222 //session/circuit not authorised
225 OpenSim.Framework.Console.MainLog.Instance.Notice("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString()); 223 MainLog.Instance.Notice("OpenSimClient.cs:AuthUser() - New user request denied to " + userEP.ToString());
226 ClientThread.Abort(); 224 ClientThread.Abort();
227 } 225 }
228 else 226 else
229 { 227 {
230 OpenSim.Framework.Console.MainLog.Instance.Notice("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString()); 228 MainLog.Instance.Notice("OpenSimClient.cs:AuthUser() - Got authenticated connection from " + userEP.ToString());
231 //session is authorised 229 //session is authorised
232 this.AgentID = cirpack.CircuitCode.ID; 230 this.AgentID = cirpack.CircuitCode.ID;
233 this.SessionID = cirpack.CircuitCode.SessionID; 231 this.SessionID = cirpack.CircuitCode.SessionID;
diff --git a/OpenSim/Region/ClientStack/ClientViewBase.cs b/OpenSim/Region/ClientStack/ClientViewBase.cs
index 7d39405..f105978 100644
--- a/OpenSim/Region/ClientStack/ClientViewBase.cs
+++ b/OpenSim/Region/ClientStack/ClientViewBase.cs
@@ -27,17 +27,14 @@
27* 27*
28*/ 28*/
29using System; 29using System;
30using System.Collections;
31using System.Collections.Generic; 30using System.Collections.Generic;
32using libsecondlife;
33using libsecondlife.Packets;
34using System.Net; 31using System.Net;
35using System.Net.Sockets; 32using System.Net.Sockets;
36using System.IO;
37using System.Threading;
38using System.Timers; 33using System.Timers;
34using libsecondlife;
35using libsecondlife.Packets;
36using OpenSim.Framework.Console;
39using OpenSim.Framework.Utilities; 37using OpenSim.Framework.Utilities;
40using OpenSim.Framework.Interfaces;
41 38
42namespace OpenSim.Region.ClientStack 39namespace OpenSim.Region.ClientStack
43{ 40{
@@ -47,7 +44,7 @@ namespace OpenSim.Region.ClientStack
47 protected Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>(); 44 protected Dictionary<uint, uint> PendingAcks = new Dictionary<uint, uint>();
48 protected Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>(); 45 protected Dictionary<uint, Packet> NeedAck = new Dictionary<uint, Packet>();
49 46
50 protected System.Timers.Timer AckTimer; 47 protected Timer AckTimer;
51 protected uint Sequence = 0; 48 protected uint Sequence = 0;
52 protected object SequenceLock = new object(); 49 protected object SequenceLock = new object();
53 protected const int MAX_APPENDED_ACKS = 10; 50 protected const int MAX_APPENDED_ACKS = 10;
@@ -159,7 +156,7 @@ namespace OpenSim.Region.ClientStack
159 } 156 }
160 catch (Exception) 157 catch (Exception)
161 { 158 {
162 OpenSim.Framework.Console.MainLog.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread"); 159 MainLog.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread");
163 this.KillThread(); 160 this.KillThread();
164 } 161 }
165 162
@@ -195,8 +192,8 @@ namespace OpenSim.Region.ClientStack
195 else if ((NewPack.Type == PacketType.StartPingCheck)) 192 else if ((NewPack.Type == PacketType.StartPingCheck))
196 { 193 {
197 //reply to pingcheck 194 //reply to pingcheck
198 libsecondlife.Packets.StartPingCheckPacket startPing = (libsecondlife.Packets.StartPingCheckPacket)NewPack; 195 StartPingCheckPacket startPing = (StartPingCheckPacket)NewPack;
199 libsecondlife.Packets.CompletePingCheckPacket endPing = new CompletePingCheckPacket(); 196 CompletePingCheckPacket endPing = new CompletePingCheckPacket();
200 endPing.PingID.PingID = startPing.PingID.PingID; 197 endPing.PingID.PingID = startPing.PingID.PingID;
201 OutPacket(endPing); 198 OutPacket(endPing);
202 } 199 }
@@ -224,7 +221,7 @@ namespace OpenSim.Region.ClientStack
224 { 221 {
225 if (Pack.Header.Reliable) 222 if (Pack.Header.Reliable)
226 { 223 {
227 libsecondlife.Packets.PacketAckPacket ack_it = new PacketAckPacket(); 224 PacketAckPacket ack_it = new PacketAckPacket();
228 ack_it.Packets = new PacketAckPacket.PacketsBlock[1]; 225 ack_it.Packets = new PacketAckPacket.PacketsBlock[1];
229 ack_it.Packets[0] = new PacketAckPacket.PacketsBlock(); 226 ack_it.Packets[0] = new PacketAckPacket.PacketsBlock();
230 ack_it.Packets[0].ID = Pack.Header.Sequence; 227 ack_it.Packets[0].ID = Pack.Header.Sequence;
@@ -254,7 +251,7 @@ namespace OpenSim.Region.ClientStack
254 { 251 {
255 if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent)) 252 if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
256 { 253 {
257 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Resending " + packet.Type.ToString() + " packet, " + 254 MainLog.Instance.Verbose( "Resending " + packet.Type.ToString() + " packet, " +
258 (now - packet.TickCount) + "ms have passed"); 255 (now - packet.TickCount) + "ms have passed");
259 256
260 packet.Header.Resent = true; 257 packet.Header.Resent = true;
@@ -273,7 +270,7 @@ namespace OpenSim.Region.ClientStack
273 if (PendingAcks.Count > 250) 270 if (PendingAcks.Count > 250)
274 { 271 {
275 // FIXME: Handle the odd case where we have too many pending ACKs queued up 272 // FIXME: Handle the odd case where we have too many pending ACKs queued up
276 OpenSim.Framework.Console.MainLog.Instance.Verbose( "Too many ACKs queued up!"); 273 MainLog.Instance.Verbose( "Too many ACKs queued up!");
277 return; 274 return;
278 } 275 }
279 276
diff --git a/OpenSim/Region/ClientStack/PacketServer.cs b/OpenSim/Region/ClientStack/PacketServer.cs
index 6f20413..b5f0a02 100644
--- a/OpenSim/Region/ClientStack/PacketServer.cs
+++ b/OpenSim/Region/ClientStack/PacketServer.cs
@@ -25,15 +25,13 @@
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28using System;
29using System.Collections.Generic; 28using System.Collections.Generic;
30using System.Text;
31using libsecondlife.Packets;
32using OpenSim.Framework.Interfaces;
33using OpenSim.Framework;
34using System.Net; 29using System.Net;
35using System.Net.Sockets; 30using System.Net.Sockets;
31using libsecondlife.Packets;
36using OpenSim.Assets; 32using OpenSim.Assets;
33using OpenSim.Framework;
34using OpenSim.Framework.Interfaces;
37using OpenSim.Region.Caches; 35using OpenSim.Region.Caches;
38 36
39namespace OpenSim.Region.ClientStack 37namespace OpenSim.Region.ClientStack
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 94db8ee..1e99c71 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -26,27 +26,16 @@
26* 26*
27*/ 27*/
28using System; 28using System;
29using System.Text;
30using System.IO;
31using System.Threading;
32using System.Net;
33using System.Net.Sockets;
34using System.Timers;
35using System.Reflection;
36using System.Collections;
37using System.Collections.Generic; 29using System.Collections.Generic;
38using libsecondlife; 30using System.Net;
39using libsecondlife.Packets;
40using OpenSim.Region.Terrain;
41using OpenSim.Framework.Interfaces;
42using OpenSim.Framework.Types;
43using OpenSim.Framework;
44using OpenSim.Assets; 31using OpenSim.Assets;
45using OpenSim.Region.Caches; 32using OpenSim.Framework;
46using OpenSim.Framework.Console; 33using OpenSim.Framework.Console;
47using OpenSim.Physics.Manager; 34using OpenSim.Framework.Interfaces;
48using Nwc.XmlRpc;
49using OpenSim.Framework.Servers; 35using OpenSim.Framework.Servers;
36using OpenSim.Framework.Types;
37using OpenSim.Physics.Manager;
38using OpenSim.Region.Caches;
50 39
51namespace OpenSim.Region.ClientStack 40namespace OpenSim.Region.ClientStack
52{ 41{
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs
index 8ad5332..6eea524 100644
--- a/OpenSim/Region/ClientStack/UDPServer.cs
+++ b/OpenSim/Region/ClientStack/UDPServer.cs
@@ -26,26 +26,15 @@
26* 26*
27*/ 27*/
28using System; 28using System;
29using System.Text; 29using System.Collections.Generic;
30using System.IO;
31using System.Threading;
32using System.Net; 30using System.Net;
33using System.Net.Sockets; 31using System.Net.Sockets;
34using System.Timers;
35using System.Reflection;
36using System.Collections;
37using System.Collections.Generic;
38using libsecondlife;
39using libsecondlife.Packets; 32using libsecondlife.Packets;
40using OpenSim.Region.Terrain;
41using OpenSim.Framework.Interfaces;
42using OpenSim.Framework.Types;
43using OpenSim.Assets; 33using OpenSim.Assets;
44using OpenSim.Region.Caches;
45using OpenSim.Framework.Console;
46using OpenSim.Framework; 34using OpenSim.Framework;
47using Nwc.XmlRpc; 35using OpenSim.Framework.Console;
48using OpenSim.Framework.Servers; 36using OpenSim.Framework.Interfaces;
37using OpenSim.Region.Caches;
49 38
50namespace OpenSim.Region.ClientStack 39namespace OpenSim.Region.ClientStack
51{ 40{