aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
diff options
context:
space:
mode:
authorTedd Hansen2008-11-27 13:41:26 +0000
committerTedd Hansen2008-11-27 13:41:26 +0000
commit1eeffcd89e5ef30ccfe7bbefc98d362ebfae6a89 (patch)
treef6c4e909aeaa2a6e73b9dae484b1ec51cf0ecf58 /OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
parent* Adds texture download requests to pcampbot to more accurately represent load. (diff)
downloadopensim-SC-1eeffcd89e5ef30ccfe7bbefc98d362ebfae6a89.zip
opensim-SC-1eeffcd89e5ef30ccfe7bbefc98d362ebfae6a89.tar.gz
opensim-SC-1eeffcd89e5ef30ccfe7bbefc98d362ebfae6a89.tar.bz2
opensim-SC-1eeffcd89e5ef30ccfe7bbefc98d362ebfae6a89.tar.xz
Test commit.. just contains div trace and other stuff.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs24
1 files changed, 17 insertions, 7 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
index 06307bb..15604dc 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/ScriptBase.cs
@@ -39,7 +39,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
39{ 39{
40 public partial class ScriptBaseClass : MarshalByRefObject, IScript 40 public partial class ScriptBaseClass : MarshalByRefObject, IScript
41 { 41 {
42 private Dictionary<string,MethodInfo> inits = new Dictionary<string,MethodInfo>(); 42 private Dictionary<string, MethodInfo> inits = new Dictionary<string, MethodInfo>();
43 43
44 // Object expires if we don't keep it alive 44 // Object expires if we don't keep it alive
45 // sponsor will be added on object load 45 // sponsor will be added on object load
@@ -50,25 +50,35 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
50 ILease lease = (ILease)base.InitializeLifetimeService(); 50 ILease lease = (ILease)base.InitializeLifetimeService();
51 if (lease.CurrentState == LeaseState.Initial) 51 if (lease.CurrentState == LeaseState.Initial)
52 { 52 {
53 //lease.InitialLeaseTime = TimeSpan.Zero;
53 lease.InitialLeaseTime = TimeSpan.FromMinutes(1); 54 lease.InitialLeaseTime = TimeSpan.FromMinutes(1);
54 lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); 55 lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
55 lease.RenewOnCallTime = TimeSpan.FromSeconds(2); 56 lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
56 } 57 }
57 return lease; 58 return lease;
58 } 59 }
60#if DEBUG
61 // For tracing GC while debugging
62 public static bool GCDummy = false;
63 ~ScriptBaseClass()
64 {
65 GCDummy = true;
66 }
67#endif
68
59 69
60 public ScriptBaseClass() 70 public ScriptBaseClass()
61 { 71 {
62 m_Executor = new Executor(this); 72 m_Executor = new Executor(this);
63 73
64 MethodInfo[] myArrayMethodInfo = GetType().GetMethods(BindingFlags.Public|BindingFlags.Instance); 74 MethodInfo[] myArrayMethodInfo = GetType().GetMethods(BindingFlags.Public | BindingFlags.Instance);
65 75
66 foreach (MethodInfo mi in myArrayMethodInfo) 76 foreach (MethodInfo mi in myArrayMethodInfo)
67 { 77 {
68 if (mi.Name.Length > 7 && mi.Name.Substring(0, 7) == "ApiType") 78 if (mi.Name.Length > 7 && mi.Name.Substring(0, 7) == "ApiType")
69 { 79 {
70 string type=mi.Name.Substring(7); 80 string type = mi.Name.Substring(7);
71 inits[type]=mi; 81 inits[type] = mi;
72 } 82 }
73 } 83 }
74 } 84 }
@@ -130,7 +140,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
130 140
131 foreach (FieldInfo field in fields) 141 foreach (FieldInfo field in fields)
132 { 142 {
133 m_Fields[field.Name]=field; 143 m_Fields[field.Name] = field;
134 144
135 if (field.FieldType == typeof(LSL_Types.list)) // ref type, copy 145 if (field.FieldType == typeof(LSL_Types.list)) // ref type, copy
136 { 146 {
@@ -141,7 +151,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
141 c.Data = data; 151 c.Data = data;
142 vars[field.Name] = c; 152 vars[field.Name] = c;
143 } 153 }
144 else if (field.FieldType == typeof(LSL_Types.LSLInteger) || 154 else if (field.FieldType == typeof(LSL_Types.LSLInteger) ||
145 field.FieldType == typeof(LSL_Types.LSLString) || 155 field.FieldType == typeof(LSL_Types.LSLString) ||
146 field.FieldType == typeof(LSL_Types.LSLFloat) || 156 field.FieldType == typeof(LSL_Types.LSLFloat) ||
147 field.FieldType == typeof(Int32) || 157 field.FieldType == typeof(Int32) ||
@@ -174,7 +184,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
174 Array.Copy(data, 0, v.Data, 0, data.Length); 184 Array.Copy(data, 0, v.Data, 0, data.Length);
175 m_Fields[var.Key].SetValue(this, v); 185 m_Fields[var.Key].SetValue(this, v);
176 } 186 }
177 else if (m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLInteger) || 187 else if (m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLInteger) ||
178 m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLString) || 188 m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLString) ||
179 m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLFloat) || 189 m_Fields[var.Key].FieldType == typeof(LSL_Types.LSLFloat) ||
180 m_Fields[var.Key].FieldType == typeof(Int32) || 190 m_Fields[var.Key].FieldType == typeof(Int32) ||