aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorlbsa712008-02-10 14:27:21 +0000
committerlbsa712008-02-10 14:27:21 +0000
commite0424254bd843737d171caadabfa5d6d1ff76fd9 (patch)
tree1f3fb9dc9aee8bee596120f8494c70594dff31ce /OpenSim/Region/ClientStack
parent* Adding more broken objectflags to the list here. Touch was also broken. I... (diff)
downloadopensim-SC-e0424254bd843737d171caadabfa5d6d1ff76fd9.zip
opensim-SC-e0424254bd843737d171caadabfa5d6d1ff76fd9.tar.gz
opensim-SC-e0424254bd843737d171caadabfa5d6d1ff76fd9.tar.bz2
opensim-SC-e0424254bd843737d171caadabfa5d6d1ff76fd9.tar.xz
* Refactored permissions handling to extract info out of permisisons block in ClientView
* Changed some uint constants to Enum values
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs68
1 files changed, 36 insertions, 32 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index d4af98c..a35c83c 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -51,11 +51,11 @@ namespace OpenSim.Region.ClientStack
51 /// </summary> 51 /// </summary>
52 public class ClientView : IClientAPI 52 public class ClientView : IClientAPI
53 { 53 {
54// ~ClientView() 54 // ~ClientView()
55// { 55 // {
56// System.Console.WriteLine("[CLIENTVIEW]: Destructor called"); 56 // System.Console.WriteLine("[CLIENTVIEW]: Destructor called");
57// } 57 // }
58 58
59 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 59 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
60 60
61 /* static variables */ 61 /* static variables */
@@ -239,10 +239,10 @@ namespace OpenSim.Region.ClientStack
239 private void CloseCleanup() 239 private void CloseCleanup()
240 { 240 {
241 m_scene.RemoveClient(AgentId); 241 m_scene.RemoveClient(AgentId);
242 242
243 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false)); 243 //m_log.InfoFormat("[CLIENTVIEW] Memory pre GC {0}", System.GC.GetTotalMemory(false));
244 //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true)); 244 //m_log.InfoFormat("[CLIENTVIEW] Memory post GC {0}", System.GC.GetTotalMemory(true));
245 245
246 // Send the STOP packet 246 // Send the STOP packet
247 DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator); 247 DisableSimulatorPacket disable = (DisableSimulatorPacket)PacketPool.Instance.GetPacket(PacketType.DisableSimulator);
248 OutPacket(disable, ThrottleOutPacketType.Task); 248 OutPacket(disable, ThrottleOutPacketType.Task);
@@ -368,7 +368,7 @@ namespace OpenSim.Region.ClientStack
368 if (m_debug > 0) 368 if (m_debug > 0)
369 { 369 {
370 string info = String.Empty; 370 string info = String.Empty;
371 371
372 if (m_debug < 255 && packet.Type == PacketType.AgentUpdate) 372 if (m_debug < 255 && packet.Type == PacketType.AgentUpdate)
373 return; 373 return;
374 if (m_debug < 254 && packet.Type == PacketType.ViewerEffect) 374 if (m_debug < 254 && packet.Type == PacketType.ViewerEffect)
@@ -1006,7 +1006,7 @@ namespace OpenSim.Region.ClientStack
1006 int MAX_ITEMS_PER_PACKET = 6; 1006 int MAX_ITEMS_PER_PACKET = 6;
1007 1007
1008 Encoding enc = Encoding.ASCII; 1008 Encoding enc = Encoding.ASCII;
1009 uint FULL_MASK_PERMISSIONS = 2147483647; 1009 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;
1010 InventoryDescendentsPacket descend; 1010 InventoryDescendentsPacket descend;
1011 int i; 1011 int i;
1012 int count; 1012 int count;
@@ -1179,7 +1179,7 @@ namespace OpenSim.Region.ClientStack
1179 public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item) 1179 public void SendInventoryItemDetails(LLUUID ownerID, InventoryItemBase item)
1180 { 1180 {
1181 Encoding enc = Encoding.ASCII; 1181 Encoding enc = Encoding.ASCII;
1182 uint FULL_MASK_PERMISSIONS = 2147483647; 1182 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;
1183 FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply); 1183 FetchInventoryReplyPacket inventoryReply = (FetchInventoryReplyPacket)PacketPool.Instance.GetPacket(PacketType.FetchInventoryReply);
1184 // TODO: don't create new blocks if recycling an old packet 1184 // TODO: don't create new blocks if recycling an old packet
1185 inventoryReply.AgentData.AgentID = AgentId; 1185 inventoryReply.AgentData.AgentID = AgentId;
@@ -1221,7 +1221,7 @@ namespace OpenSim.Region.ClientStack
1221 public void SendInventoryItemCreateUpdate(InventoryItemBase Item) 1221 public void SendInventoryItemCreateUpdate(InventoryItemBase Item)
1222 { 1222 {
1223 Encoding enc = Encoding.ASCII; 1223 Encoding enc = Encoding.ASCII;
1224 uint FULL_MASK_PERMISSIONS = 2147483647; 1224 uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All;
1225 UpdateCreateInventoryItemPacket InventoryReply = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket(PacketType.UpdateCreateInventoryItem); 1225 UpdateCreateInventoryItemPacket InventoryReply = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket(PacketType.UpdateCreateInventoryItem);
1226 // TODO: don't create new blocks if recycling an old packet 1226 // TODO: don't create new blocks if recycling an old packet
1227 InventoryReply.AgentData.AgentID = AgentId; 1227 InventoryReply.AgentData.AgentID = AgentId;
@@ -1601,9 +1601,9 @@ namespace OpenSim.Region.ClientStack
1601 terse.RegionData.TimeDilation = timeDilation; 1601 terse.RegionData.TimeDilation = timeDilation;
1602 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; 1602 terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1];
1603 terse.ObjectData[0] = terseBlock; 1603 terse.ObjectData[0] = terseBlock;
1604 1604
1605 terse.Header.Reliable = false; 1605 terse.Header.Reliable = false;
1606 1606
1607 1607
1608 OutPacket(terse, ThrottleOutPacketType.Task); 1608 OutPacket(terse, ThrottleOutPacketType.Task);
1609 } 1609 }
@@ -1695,7 +1695,7 @@ namespace OpenSim.Region.ClientStack
1695 outPacket.ObjectData[0].PSBlock = particleSystem; 1695 outPacket.ObjectData[0].PSBlock = particleSystem;
1696 outPacket.ObjectData[0].ClickAction = clickAction; 1696 outPacket.ObjectData[0].ClickAction = clickAction;
1697 //outPacket.ObjectData[0].Flags = 0; 1697 //outPacket.ObjectData[0].Flags = 0;
1698 1698
1699 // Sound Radius 1699 // Sound Radius
1700 outPacket.ObjectData[0].Radius = 20; 1700 outPacket.ObjectData[0].Radius = 20;
1701 1701
@@ -1707,7 +1707,7 @@ namespace OpenSim.Region.ClientStack
1707 1707
1708 if (textureanim.Length > 0) 1708 if (textureanim.Length > 0)
1709 outPacket.ObjectData[0].TextureAnim = textureanim; 1709 outPacket.ObjectData[0].TextureAnim = textureanim;
1710 1710
1711 1711
1712 OutPacket(outPacket, ThrottleOutPacketType.Task); 1712 OutPacket(outPacket, ThrottleOutPacketType.Task);
1713 } 1713 }
@@ -1978,7 +1978,7 @@ namespace OpenSim.Region.ClientStack
1978 objectData.PathTwistBegin = primData.PathTwistBegin; 1978 objectData.PathTwistBegin = primData.PathTwistBegin;
1979 objectData.ExtraParams = primData.ExtraParams; 1979 objectData.ExtraParams = primData.ExtraParams;
1980 } 1980 }
1981 1981
1982 /// <summary> 1982 /// <summary>
1983 /// Set some default values in a ObjectUpdatePacket 1983 /// Set some default values in a ObjectUpdatePacket
1984 /// </summary> 1984 /// </summary>
@@ -3100,15 +3100,25 @@ namespace OpenSim.Region.ClientStack
3100 } 3100 }
3101 break; 3101 break;
3102 case PacketType.ObjectPermissions: 3102 case PacketType.ObjectPermissions:
3103 m_log.Warn("[CLIENT]: unhandled packet " + PacketType.ObjectPermissions.ToString()); 3103 if (OnObjectPermissions != null)
3104 ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack; 3104 {
3105 ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack;
3105 3106
3106 List<ObjectPermissionsPacket.ObjectDataBlock> permChanges = 3107 LLUUID AgentID = newobjPerms.AgentData.AgentID;
3107 new List<ObjectPermissionsPacket.ObjectDataBlock>(); 3108 LLUUID SessionID = newobjPerms.AgentData.SessionID;
3108 3109
3109 for (int i = 0; i < newobjPerms.ObjectData.Length; i++) 3110 for (int i = 0; i < newobjPerms.ObjectData.Length; i++)
3110 { 3111 {
3111 permChanges.Add(newobjPerms.ObjectData[i]); 3112 ObjectPermissionsPacket.ObjectDataBlock permChanges = newobjPerms.ObjectData[i];
3113
3114
3115 byte field = permChanges.Field;
3116 uint localID = permChanges.ObjectLocalID;
3117 uint mask = permChanges.Mask;
3118 byte set = permChanges.Set;
3119
3120 OnObjectPermissions(this, AgentID, SessionID, field, localID, mask, set);
3121 }
3112 } 3122 }
3113 3123
3114 // Here's our data, 3124 // Here's our data,
@@ -3123,12 +3133,6 @@ namespace OpenSim.Region.ClientStack
3123 // Unfortunately, we have to pass the event the packet because objData is an array 3133 // Unfortunately, we have to pass the event the packet because objData is an array
3124 // That means multiple object perms may be updated in a single packet. 3134 // That means multiple object perms may be updated in a single packet.
3125 3135
3126 LLUUID AgentID = newobjPerms.AgentData.AgentID;
3127 LLUUID SessionID = newobjPerms.AgentData.SessionID;
3128 if (OnObjectPermissions != null)
3129 {
3130 OnObjectPermissions(this, AgentID, SessionID, permChanges);
3131 }
3132 3136
3133 break; 3137 break;
3134 3138
@@ -3481,8 +3485,8 @@ namespace OpenSim.Region.ClientStack
3481 { 3485 {
3482 OnMoneyBalanceRequest(this, moneybalancerequestpacket.AgentData.AgentID, moneybalancerequestpacket.AgentData.SessionID, moneybalancerequestpacket.MoneyData.TransactionID); 3486 OnMoneyBalanceRequest(this, moneybalancerequestpacket.AgentData.AgentID, moneybalancerequestpacket.AgentData.SessionID, moneybalancerequestpacket.MoneyData.TransactionID);
3483 } 3487 }
3484 3488
3485 3489
3486 break; 3490 break;
3487 case PacketType.UUIDNameRequest: 3491 case PacketType.UUIDNameRequest:
3488 UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; 3492 UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack;