aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs11
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs37
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs4
-rw-r--r--OpenSim/Framework/IClientAPI.cs4
-rw-r--r--OpenSim/Framework/InventoryFolderImpl.cs8
-rw-r--r--OpenSim/Framework/PacketPool.cs17
-rw-r--r--OpenSim/Framework/TaskInventoryDictionary.cs2
-rw-r--r--OpenSim/Framework/Tests/AgentCircuitDataTest.cs2
-rw-r--r--OpenSim/Framework/Tests/AgentCircuitManagerTests.cs4
-rw-r--r--OpenSim/Framework/Util.cs15
10 files changed, 55 insertions, 49 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs
index 125910e..12c8ac0 100644
--- a/OpenSim/Framework/AgentCircuitData.cs
+++ b/OpenSim/Framework/AgentCircuitData.cs
@@ -296,11 +296,12 @@ namespace OpenSim.Framework
296 if (args["start_pos"] != null) 296 if (args["start_pos"] != null)
297 Vector3.TryParse(args["start_pos"].AsString(), out startpos); 297 Vector3.TryParse(args["start_pos"].AsString(), out startpos);
298 298
299 m_log.InfoFormat("[AGENTCIRCUITDATA] agentid={0}, child={1}, startpos={2}",AgentID,child,startpos.ToString()); 299 m_log.InfoFormat("[AGENTCIRCUITDATA]: agentid={0}, child={1}, startpos={2}", AgentID, child, startpos);
300 300
301 try { 301 try
302 {
302 // Unpack various appearance elements 303 // Unpack various appearance elements
303 Appearance = new AvatarAppearance(AgentID); 304 Appearance = new AvatarAppearance();
304 305
305 // Eventually this code should be deprecated, use full appearance 306 // Eventually this code should be deprecated, use full appearance
306 // packing in packed_appearance 307 // packing in packed_appearance
@@ -313,7 +314,9 @@ namespace OpenSim.Framework
313 m_log.InfoFormat("[AGENTCIRCUITDATA] unpacked appearance"); 314 m_log.InfoFormat("[AGENTCIRCUITDATA] unpacked appearance");
314 } 315 }
315 else 316 else
316 m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance"); 317 {
318 m_log.Warn("[AGENTCIRCUITDATA]: failed to find a valid packed_appearance");
319 }
317 } 320 }
318 catch (Exception e) 321 catch (Exception e)
319 { 322 {
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 716baab..73b068d 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -47,7 +47,6 @@ namespace OpenSim.Framework
47 public readonly static int TEXTURE_COUNT = 21; 47 public readonly static int TEXTURE_COUNT = 21;
48 public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 }; 48 public readonly static byte[] BAKE_INDICES = new byte[] { 8, 9, 10, 11, 19, 20 };
49 49
50 protected UUID m_owner;
51 protected int m_serial = 0; 50 protected int m_serial = 0;
52 protected byte[] m_visualparams; 51 protected byte[] m_visualparams;
53 protected Primitive.TextureEntry m_texture; 52 protected Primitive.TextureEntry m_texture;
@@ -56,12 +55,6 @@ namespace OpenSim.Framework
56 protected float m_avatarHeight = 0; 55 protected float m_avatarHeight = 0;
57 protected float m_hipOffset = 0; 56 protected float m_hipOffset = 0;
58 57
59 public virtual UUID Owner
60 {
61 get { return m_owner; }
62 set { m_owner = value; }
63 }
64
65 public virtual int Serial 58 public virtual int Serial
66 { 59 {
67 get { return m_serial; } 60 get { return m_serial; }
@@ -77,7 +70,11 @@ namespace OpenSim.Framework
77 public virtual Primitive.TextureEntry Texture 70 public virtual Primitive.TextureEntry Texture
78 { 71 {
79 get { return m_texture; } 72 get { return m_texture; }
80 set { m_texture = value; } 73 set
74 {
75// m_log.DebugFormat("[AVATAR APPEARANCE]: Set TextureEntry to {0}", value);
76 m_texture = value;
77 }
81 } 78 }
82 79
83 public virtual AvatarWearable[] Wearables 80 public virtual AvatarWearable[] Wearables
@@ -97,38 +94,31 @@ namespace OpenSim.Framework
97 get { return m_hipOffset; } 94 get { return m_hipOffset; }
98 } 95 }
99 96
100 public AvatarAppearance() : this(UUID.Zero) {} 97 public AvatarAppearance()
101
102 public AvatarAppearance(UUID owner)
103 { 98 {
104// m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance for {0}",owner); 99// m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance");
105 100
106 m_serial = 0; 101 m_serial = 0;
107 m_owner = owner;
108
109 SetDefaultWearables(); 102 SetDefaultWearables();
110 SetDefaultTexture(); 103 SetDefaultTexture();
111 SetDefaultParams(); 104 SetDefaultParams();
112 SetHeight(); 105 SetHeight();
113
114 m_attachments = new Dictionary<int, List<AvatarAttachment>>(); 106 m_attachments = new Dictionary<int, List<AvatarAttachment>>();
115 } 107 }
116 108
117 public AvatarAppearance(UUID avatarID, OSDMap map) 109 public AvatarAppearance(OSDMap map)
118 { 110 {
119// m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance for {0} from OSDMap",avatarID); 111// m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap");
120 112
121 m_owner = avatarID;
122 Unpack(map); 113 Unpack(map);
123 SetHeight(); 114 SetHeight();
124 } 115 }
125 116
126 public AvatarAppearance(UUID avatarID, AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams) 117 public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams)
127 { 118 {
128// m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance for {0}",avatarID); 119// m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance");
129 120
130 m_serial = 0; 121 m_serial = 0;
131 m_owner = avatarID;
132 122
133 if (wearables != null) 123 if (wearables != null)
134 m_wearables = wearables; 124 m_wearables = wearables;
@@ -161,24 +151,21 @@ namespace OpenSim.Framework
161 if (appearance == null) 151 if (appearance == null)
162 { 152 {
163 m_serial = 0; 153 m_serial = 0;
164 m_owner = UUID.Zero;
165
166 SetDefaultWearables(); 154 SetDefaultWearables();
167 SetDefaultTexture(); 155 SetDefaultTexture();
168 SetDefaultParams(); 156 SetDefaultParams();
169 SetHeight(); 157 SetHeight();
170
171 m_attachments = new Dictionary<int, List<AvatarAttachment>>(); 158 m_attachments = new Dictionary<int, List<AvatarAttachment>>();
172 159
173 return; 160 return;
174 } 161 }
175 162
176 m_serial = appearance.Serial; 163 m_serial = appearance.Serial;
177 m_owner = appearance.Owner;
178 164
179 m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES]; 165 m_wearables = new AvatarWearable[AvatarWearable.MAX_WEARABLES];
180 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) 166 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
181 m_wearables[i] = new AvatarWearable(); 167 m_wearables[i] = new AvatarWearable();
168
182 if (copyWearables && (appearance.Wearables != null)) 169 if (copyWearables && (appearance.Wearables != null))
183 { 170 {
184 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++) 171 for (int i = 0; i < AvatarWearable.MAX_WEARABLES; i++)
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index 710a57d..613db1c 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -593,7 +593,7 @@ namespace OpenSim.Framework
593 // AgentTextures[i++] = o.AsUUID(); 593 // AgentTextures[i++] = o.AsUUID();
594 //} 594 //}
595 595
596 Appearance = new AvatarAppearance(AgentID); 596 Appearance = new AvatarAppearance();
597 597
598 // The code to unpack textures, visuals, wearables and attachments 598 // The code to unpack textures, visuals, wearables and attachments
599 // should be removed; packed appearance contains the full appearance 599 // should be removed; packed appearance contains the full appearance
@@ -635,7 +635,7 @@ namespace OpenSim.Framework
635 // end of code to remove 635 // end of code to remove
636 636
637 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map) 637 if (args.ContainsKey("packed_appearance") && (args["packed_appearance"]).Type == OSDType.Map)
638 Appearance = new AvatarAppearance(AgentID,(OSDMap)args["packed_appearance"]); 638 Appearance = new AvatarAppearance((OSDMap)args["packed_appearance"]);
639 else 639 else
640 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance"); 640 m_log.WarnFormat("[CHILDAGENTDATAUPDATE] No packed appearance");
641 641
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index f6e2977..481e1bb 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -935,7 +935,7 @@ namespace OpenSim.Framework
935 event ScriptReset OnScriptReset; 935 event ScriptReset OnScriptReset;
936 event GetScriptRunning OnGetScriptRunning; 936 event GetScriptRunning OnGetScriptRunning;
937 event SetScriptRunning OnSetScriptRunning; 937 event SetScriptRunning OnSetScriptRunning;
938 event UpdateVector OnAutoPilotGo; 938 event Action<Vector3> OnAutoPilotGo;
939 939
940 event TerrainUnacked OnUnackedTerrain; 940 event TerrainUnacked OnUnackedTerrain;
941 event ActivateGesture OnActivateGesture; 941 event ActivateGesture OnActivateGesture;
@@ -1395,7 +1395,7 @@ namespace OpenSim.Framework
1395 void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt); 1395 void SendGroupTransactionsSummaryDetails(IClientAPI sender,UUID groupID, UUID transactionID, UUID sessionID,int amt);
1396 1396
1397 void SendChangeUserRights(UUID agentID, UUID friendID, int rights); 1397 void SendChangeUserRights(UUID agentID, UUID friendID, int rights);
1398 void SendTextBoxRequest(string message, int chatChannel, string objectname, string ownerFirstName, string ownerLastName, UUID objectId); 1398 void SendTextBoxRequest(string message, int chatChannel, string objectname, UUID ownerID, string ownerFirstName, string ownerLastName, UUID objectId);
1399 1399
1400 void StopFlying(ISceneEntity presence); 1400 void StopFlying(ISceneEntity presence);
1401 1401
diff --git a/OpenSim/Framework/InventoryFolderImpl.cs b/OpenSim/Framework/InventoryFolderImpl.cs
index 29c7682..139776b 100644
--- a/OpenSim/Framework/InventoryFolderImpl.cs
+++ b/OpenSim/Framework/InventoryFolderImpl.cs
@@ -27,13 +27,15 @@
27 27
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection;
31using log4net;
30using OpenMetaverse; 32using OpenMetaverse;
31 33
32namespace OpenSim.Framework 34namespace OpenSim.Framework
33{ 35{
34 public class InventoryFolderImpl : InventoryFolderBase 36 public class InventoryFolderImpl : InventoryFolderBase
35 { 37 {
36 //private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 38// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
37 39
38 public static readonly string PATH_DELIMITER = "/"; 40 public static readonly string PATH_DELIMITER = "/";
39 41
@@ -402,6 +404,10 @@ namespace OpenSim.Framework
402 { 404 {
403 foreach (InventoryItemBase item in Items.Values) 405 foreach (InventoryItemBase item in Items.Values)
404 { 406 {
407// m_log.DebugFormat(
408// "[INVENTORY FOLDER IMPL]: Returning item {0} {1}, OwnerPermissions {2:X}",
409// item.Name, item.ID, item.CurrentPermissions);
410
405 itemList.Add(item); 411 itemList.Add(item);
406 } 412 }
407 } 413 }
diff --git a/OpenSim/Framework/PacketPool.cs b/OpenSim/Framework/PacketPool.cs
index 7e2860e..41d17c5 100644
--- a/OpenSim/Framework/PacketPool.cs
+++ b/OpenSim/Framework/PacketPool.cs
@@ -144,6 +144,7 @@ namespace OpenSim.Framework
144 m_log.WarnFormat("[PACKETPOOL]: Failed to get packet of type {0}", type); 144 m_log.WarnFormat("[PACKETPOOL]: Failed to get packet of type {0}", type);
145 else 145 else
146 packet.FromBytes(bytes, ref i, ref packetEnd, zeroBuffer); 146 packet.FromBytes(bytes, ref i, ref packetEnd, zeroBuffer);
147
147 return packet; 148 return packet;
148 } 149 }
149 150
@@ -160,19 +161,18 @@ namespace OpenSim.Framework
160 case PacketType.ObjectUpdate: 161 case PacketType.ObjectUpdate:
161 ObjectUpdatePacket oup = (ObjectUpdatePacket)packet; 162 ObjectUpdatePacket oup = (ObjectUpdatePacket)packet;
162 163
163 foreach (ObjectUpdatePacket.ObjectDataBlock oupod in 164 foreach (ObjectUpdatePacket.ObjectDataBlock oupod in oup.ObjectData)
164 oup.ObjectData)
165 ReturnDataBlock<ObjectUpdatePacket.ObjectDataBlock>(oupod); 165 ReturnDataBlock<ObjectUpdatePacket.ObjectDataBlock>(oupod);
166
166 oup.ObjectData = null; 167 oup.ObjectData = null;
167 break; 168 break;
168 169
169 case PacketType.ImprovedTerseObjectUpdate: 170 case PacketType.ImprovedTerseObjectUpdate:
170 ImprovedTerseObjectUpdatePacket itoup = 171 ImprovedTerseObjectUpdatePacket itoup = (ImprovedTerseObjectUpdatePacket)packet;
171 (ImprovedTerseObjectUpdatePacket)packet;
172 172
173 foreach (ImprovedTerseObjectUpdatePacket.ObjectDataBlock 173 foreach (ImprovedTerseObjectUpdatePacket.ObjectDataBlock itoupod in itoup.ObjectData)
174 itoupod in itoup.ObjectData)
175 ReturnDataBlock<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(itoupod); 174 ReturnDataBlock<ImprovedTerseObjectUpdatePacket.ObjectDataBlock>(itoupod);
175
176 itoup.ObjectData = null; 176 itoup.ObjectData = null;
177 break; 177 break;
178 } 178 }
@@ -194,6 +194,7 @@ namespace OpenSim.Framework
194 { 194 {
195 pool[type] = new Stack<Packet>(); 195 pool[type] = new Stack<Packet>();
196 } 196 }
197
197 if ((pool[type]).Count < 50) 198 if ((pool[type]).Count < 50)
198 { 199 {
199 (pool[type]).Push(packet); 200 (pool[type]).Push(packet);
@@ -223,6 +224,7 @@ namespace OpenSim.Framework
223 { 224 {
224 DataBlocks[typeof(T)] = new Stack<Object>(); 225 DataBlocks[typeof(T)] = new Stack<Object>();
225 } 226 }
227
226 return new T(); 228 return new T();
227 } 229 }
228 } 230 }
@@ -234,6 +236,9 @@ namespace OpenSim.Framework
234 236
235 lock (DataBlocks) 237 lock (DataBlocks)
236 { 238 {
239 if (!DataBlocks.ContainsKey(typeof(T)))
240 DataBlocks[typeof(T)] = new Stack<Object>();
241
237 if (DataBlocks[typeof(T)].Count < 50) 242 if (DataBlocks[typeof(T)].Count < 50)
238 DataBlocks[typeof(T)].Push(block); 243 DataBlocks[typeof(T)].Push(block);
239 } 244 }
diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs
index 25ae6b0..421bd5d 100644
--- a/OpenSim/Framework/TaskInventoryDictionary.cs
+++ b/OpenSim/Framework/TaskInventoryDictionary.cs
@@ -59,7 +59,7 @@ namespace OpenSim.Framework
59 clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone()); 59 clone.Add(uuid, (TaskInventoryItem) this[uuid].Clone());
60 } 60 }
61 } 61 }
62 62
63 return clone; 63 return clone;
64 } 64 }
65 65
diff --git a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
index 05d8469..0dce414 100644
--- a/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
+++ b/OpenSim/Framework/Tests/AgentCircuitDataTest.cs
@@ -64,7 +64,7 @@ namespace OpenSim.Framework.Tests
64 SecureSessionId = UUID.Random(); 64 SecureSessionId = UUID.Random();
65 SessionId = UUID.Random(); 65 SessionId = UUID.Random();
66 66
67 AvAppearance = new AvatarAppearance(AgentId); 67 AvAppearance = new AvatarAppearance();
68 VisualParams = new byte[218]; 68 VisualParams = new byte[218];
69 69
70 //body 70 //body
diff --git a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs
index 6c98897..9615f1b 100644
--- a/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs
+++ b/OpenSim/Framework/Tests/AgentCircuitManagerTests.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Framework.Tests
68 68
69 m_agentCircuitData1 = new AgentCircuitData(); 69 m_agentCircuitData1 = new AgentCircuitData();
70 m_agentCircuitData1.AgentID = AgentId1; 70 m_agentCircuitData1.AgentID = AgentId1;
71 m_agentCircuitData1.Appearance = new AvatarAppearance(AgentId1); 71 m_agentCircuitData1.Appearance = new AvatarAppearance();
72 m_agentCircuitData1.BaseFolder = BaseFolder; 72 m_agentCircuitData1.BaseFolder = BaseFolder;
73 m_agentCircuitData1.CapsPath = CapsPath; 73 m_agentCircuitData1.CapsPath = CapsPath;
74 m_agentCircuitData1.child = false; 74 m_agentCircuitData1.child = false;
@@ -83,7 +83,7 @@ namespace OpenSim.Framework.Tests
83 83
84 m_agentCircuitData2 = new AgentCircuitData(); 84 m_agentCircuitData2 = new AgentCircuitData();
85 m_agentCircuitData2.AgentID = AgentId2; 85 m_agentCircuitData2.AgentID = AgentId2;
86 m_agentCircuitData2.Appearance = new AvatarAppearance(AgentId2); 86 m_agentCircuitData2.Appearance = new AvatarAppearance();
87 m_agentCircuitData2.BaseFolder = BaseFolder; 87 m_agentCircuitData2.BaseFolder = BaseFolder;
88 m_agentCircuitData2.CapsPath = CapsPath; 88 m_agentCircuitData2.CapsPath = CapsPath;
89 m_agentCircuitData2.child = false; 89 m_agentCircuitData2.child = false;
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index fce8999..984a7a8 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -1499,25 +1499,30 @@ namespace OpenSim.Framework
1499 1499
1500 public static void FireAndForget(System.Threading.WaitCallback callback, object obj) 1500 public static void FireAndForget(System.Threading.WaitCallback callback, object obj)
1501 { 1501 {
1502 // When OpenSim interacts with a database or sends data over the wire, it must send this in en_US culture
1503 // so that we don't encounter problems where, for instance, data is saved with a culture that uses commas
1504 // for decimals places but is read by a culture that treats commas as number seperators.
1505 WaitCallback realCallback = delegate(object o) { Culture.SetCurrentCulture(); callback(o); };
1506
1502 switch (FireAndForgetMethod) 1507 switch (FireAndForgetMethod)
1503 { 1508 {
1504 case FireAndForgetMethod.UnsafeQueueUserWorkItem: 1509 case FireAndForgetMethod.UnsafeQueueUserWorkItem:
1505 ThreadPool.UnsafeQueueUserWorkItem(callback, obj); 1510 ThreadPool.UnsafeQueueUserWorkItem(realCallback, obj);
1506 break; 1511 break;
1507 case FireAndForgetMethod.QueueUserWorkItem: 1512 case FireAndForgetMethod.QueueUserWorkItem:
1508 ThreadPool.QueueUserWorkItem(callback, obj); 1513 ThreadPool.QueueUserWorkItem(realCallback, obj);
1509 break; 1514 break;
1510 case FireAndForgetMethod.BeginInvoke: 1515 case FireAndForgetMethod.BeginInvoke:
1511 FireAndForgetWrapper wrapper = FireAndForgetWrapper.Instance; 1516 FireAndForgetWrapper wrapper = FireAndForgetWrapper.Instance;
1512 wrapper.FireAndForget(callback, obj); 1517 wrapper.FireAndForget(realCallback, obj);
1513 break; 1518 break;
1514 case FireAndForgetMethod.SmartThreadPool: 1519 case FireAndForgetMethod.SmartThreadPool:
1515 if (m_ThreadPool == null) 1520 if (m_ThreadPool == null)
1516 m_ThreadPool = new SmartThreadPool(2000, 15, 2); 1521 m_ThreadPool = new SmartThreadPool(2000, 15, 2);
1517 m_ThreadPool.QueueWorkItem(SmartThreadPoolCallback, new object[] { callback, obj }); 1522 m_ThreadPool.QueueWorkItem(SmartThreadPoolCallback, new object[] { realCallback, obj });
1518 break; 1523 break;
1519 case FireAndForgetMethod.Thread: 1524 case FireAndForgetMethod.Thread:
1520 Thread thread = new Thread(delegate(object o) { callback(o); }); 1525 Thread thread = new Thread(delegate(object o) { realCallback(o); });
1521 thread.Start(obj); 1526 thread.Start(obj);
1522 break; 1527 break;
1523 default: 1528 default: