aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorAdam Frisby2008-11-08 16:22:36 +0000
committerAdam Frisby2008-11-08 16:22:36 +0000
commitb0a90642ded3607c3b8448547bc020261c68f324 (patch)
treeb8644cbc023d7c8a6c2f981b44e1679c8d73e28e /OpenSim/Region/ClientStack
parent* Implementing first of the 0.6 IClientAPI Changes (diff)
downloadopensim-SC_OLD-b0a90642ded3607c3b8448547bc020261c68f324.zip
opensim-SC_OLD-b0a90642ded3607c3b8448547bc020261c68f324.tar.gz
opensim-SC_OLD-b0a90642ded3607c3b8448547bc020261c68f324.tar.bz2
opensim-SC_OLD-b0a90642ded3607c3b8448547bc020261c68f324.tar.xz
* Made ClientLoop non-infinite, ClientLoop will now disengage when the client has logged out.
* Cleaned up a section of LLClientView * Removed unused 'using' from HTTPServer * Please test this patch.
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs49
1 files changed, 19 insertions, 30 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index ff11dff..d63933d 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -263,7 +263,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
263 263
264 private MapItemRequest handlerMapItemRequest; 264 private MapItemRequest handlerMapItemRequest;
265 265
266 private IGroupsModule m_GroupsModule; 266 private readonly IGroupsModule m_GroupsModule;
267 267
268 //private TerrainUnacked handlerUnackedTerrain = null; 268 //private TerrainUnacked handlerUnackedTerrain = null;
269 269
@@ -600,7 +600,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
600 protected virtual bool ProcessPacketMethod(Packet packet) 600 protected virtual bool ProcessPacketMethod(Packet packet)
601 { 601 {
602 bool result = false; 602 bool result = false;
603 bool found;
604 PacketMethod method; 603 PacketMethod method;
605 if (m_packetHandlers.TryGetValue(packet.Type, out method)) 604 if (m_packetHandlers.TryGetValue(packet.Type, out method))
606 { 605 {
@@ -610,6 +609,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
610 else 609 else
611 { 610 {
612 //there is not a local handler so see if there is a Global handler 611 //there is not a local handler so see if there is a Global handler
612 bool found;
613 lock (PacketHandlers) 613 lock (PacketHandlers)
614 { 614 {
615 found = PacketHandlers.TryGetValue(packet.Type, out method); 615 found = PacketHandlers.TryGetValue(packet.Type, out method);
@@ -661,7 +661,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
661 m_log.DebugFormat( 661 m_log.DebugFormat(
662 "[CLIENT]: Entered main packet processing loop for {0} {1}", FirstName, LastName); 662 "[CLIENT]: Entered main packet processing loop for {0} {1}", FirstName, LastName);
663 663
664 while (true) 664 while (IsActive)
665 { 665 {
666 LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue(); 666 LLQueItem nextPacket = m_PacketHandler.PacketQueue.Dequeue();
667 667
@@ -1076,8 +1076,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1076 /// <summary> 1076 /// <summary>
1077 /// Send an instant message to this client 1077 /// Send an instant message to this client
1078 /// </summary> 1078 /// </summary>
1079 /// <param name="message"></param>
1080 /// <param name="target"></param>
1081 public void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent, 1079 public void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent,
1082 UUID imSessionID, string fromName, byte dialog, uint timeStamp) 1080 UUID imSessionID, string fromName, byte dialog, uint timeStamp)
1083 { 1081 {
@@ -1089,13 +1087,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1089 /// <summary> 1087 /// <summary>
1090 /// Send an instant message to this client 1088 /// Send an instant message to this client
1091 /// </summary> 1089 /// </summary>
1092 /// <param name="message"></param>
1093 /// <param name="target"></param>
1094 public void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent, 1090 public void SendInstantMessage(UUID fromAgent, UUID fromAgentSession, string message, UUID toAgent,
1095 UUID imSessionID, string fromName, byte dialog, uint timeStamp, 1091 UUID imSessionID, string fromName, byte dialog, uint timeStamp,
1096 bool fromGroup, byte[] binaryBucket) 1092 bool fromGroup, byte[] binaryBucket)
1097 { 1093 {
1098 if (((Scene)(this.m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent)) 1094 if (((Scene)(m_scene)).ExternalChecks.ExternalChecksCanInstantMessage(fromAgent, toAgent))
1099 { 1095 {
1100 ImprovedInstantMessagePacket msg 1096 ImprovedInstantMessagePacket msg
1101 = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage); 1097 = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage);
@@ -1530,6 +1526,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1530 /// <param name="ownerID">The owner of the folder</param> 1526 /// <param name="ownerID">The owner of the folder</param>
1531 /// <param name="folderID">The id of the folder</param> 1527 /// <param name="folderID">The id of the folder</param>
1532 /// <param name="items">The items contained in the folder identified by folderID</param> 1528 /// <param name="items">The items contained in the folder identified by folderID</param>
1529 /// <param name="folders"></param>
1533 /// <param name="fetchFolders">Do we need to send folder information?</param> 1530 /// <param name="fetchFolders">Do we need to send folder information?</param>
1534 /// <param name="fetchItems">Do we need to send item information?</param> 1531 /// <param name="fetchItems">Do we need to send item information?</param>
1535 public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items, 1532 public void SendInventoryFolderDetails(UUID ownerID, UUID folderID, List<InventoryItemBase> items,
@@ -2272,12 +2269,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2272 /// <summary> 2269 /// <summary>
2273 /// send a objectupdate packet with information about the clients avatar 2270 /// send a objectupdate packet with information about the clients avatar
2274 /// </summary> 2271 /// </summary>
2275 /// <param name="regionInfo"></param>
2276 /// <param name="firstName"></param>
2277 /// <param name="lastName"></param>
2278 /// <param name="avatarID"></param>
2279 /// <param name="avatarLocalID"></param>
2280 /// <param name="Pos"></param>
2281 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID, 2272 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID,
2282 uint avatarLocalID, Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation) 2273 uint avatarLocalID, Vector3 Pos, byte[] textureEntry, uint parentID, Quaternion rotation)
2283 { 2274 {
@@ -2295,7 +2286,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2295 objupdate.ObjectData[0].NameValue = 2286 objupdate.ObjectData[0].NameValue =
2296 Utils.StringToBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName + "\nTitle STRING RW SV " + grouptitle); 2287 Utils.StringToBytes("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName + "\nTitle STRING RW SV " + grouptitle);
2297 2288
2298 Vector3 pos2 = new Vector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z); 2289 Vector3 pos2 = new Vector3(Pos.X, Pos.Y, Pos.Z);
2299 byte[] pb = pos2.GetBytes(); 2290 byte[] pb = pos2.GetBytes();
2300 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); 2291 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
2301 2292
@@ -2401,7 +2392,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2401 SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel, 2392 SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, vel,
2402 acc, rotation, rvel, flags, 2393 acc, rotation, rvel, flags,
2403 objectID, ownerID, text, color, parentID, particleSystem, 2394 objectID, ownerID, text, color, parentID, particleSystem,
2404 clickAction, material, textureanim, false, (uint)0, UUID.Zero, UUID.Zero, 0, 0, 0); 2395 clickAction, material, textureanim, false, 0, UUID.Zero, UUID.Zero, 0, 0, 0);
2405 } 2396 }
2406 2397
2407 public void SendPrimitiveToClient( 2398 public void SendPrimitiveToClient(
@@ -3409,9 +3400,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3409 3400
3410 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack) 3401 private bool HandleMoneyTransferRequest(IClientAPI sender, Packet Pack)
3411 { 3402 {
3412 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket)Pack; 3403 MoneyTransferRequestPacket money = (MoneyTransferRequestPacket) Pack;
3413 // validate the agent owns the agentID and sessionID 3404 // validate the agent owns the agentID and sessionID
3414 if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId && money.AgentData.SessionID == sender.SessionId) 3405 if (money.MoneyData.SourceID == sender.AgentId && money.AgentData.AgentID == sender.AgentId &&
3406 money.AgentData.SessionID == sender.SessionId)
3415 { 3407 {
3416 handlerMoneyTransferRequest = OnMoneyTransferRequest; 3408 handlerMoneyTransferRequest = OnMoneyTransferRequest;
3417 if (handlerMoneyTransferRequest != null) 3409 if (handlerMoneyTransferRequest != null)
@@ -3423,30 +3415,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3423 3415
3424 return true; 3416 return true;
3425 } 3417 }
3426 else 3418
3427 { 3419 return false;
3428 return false;
3429 }
3430 } 3420 }
3431 3421
3432 private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack) 3422 private bool HandleParcelBuyRequest(IClientAPI sender, Packet Pack)
3433 { 3423 {
3434 ParcelBuyPacket parcel = (ParcelBuyPacket)Pack; 3424 ParcelBuyPacket parcel = (ParcelBuyPacket) Pack;
3435 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == this.SessionId) 3425 if (parcel.AgentData.AgentID == AgentId && parcel.AgentData.SessionID == SessionId)
3436 { 3426 {
3437 handlerParcelBuy = OnParcelBuy; 3427 handlerParcelBuy = OnParcelBuy;
3438 if (handlerParcelBuy != null) 3428 if (handlerParcelBuy != null)
3439 { 3429 {
3440 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final, parcel.Data.IsGroupOwned, 3430 handlerParcelBuy(parcel.AgentData.AgentID, parcel.Data.GroupID, parcel.Data.Final,
3441 parcel.Data.RemoveContribution, parcel.Data.LocalID, parcel.ParcelData.Area, parcel.ParcelData.Price, 3431 parcel.Data.IsGroupOwned,
3432 parcel.Data.RemoveContribution, parcel.Data.LocalID, parcel.ParcelData.Area,
3433 parcel.ParcelData.Price,
3442 false); 3434 false);
3443 } 3435 }
3444 return true; 3436 return true;
3445 } 3437 }
3446 else 3438 return false;
3447 {
3448 return false;
3449 }
3450 } 3439 }
3451 3440
3452 private bool HandleUUIDGroupNameRequest(IClientAPI sender, Packet Pack) 3441 private bool HandleUUIDGroupNameRequest(IClientAPI sender, Packet Pack)