From 4beef91d006ed18cb7dc4a6ee8f2dc4e2a71ab6f Mon Sep 17 00:00:00 2001 From: Tedd Hansen Date: Wed, 22 Aug 2007 19:33:10 +0000 Subject: [PATCH] GC.GetTotalMemory(true) was blocking. We now support individual scripts on individual prims. Do the script dance... \o/ \o\ /o/ \o/ .o. --- .../DotNetEngine/AppDomainManager.cs | 6 ++++-- .../ScriptEngine/DotNetEngine/EventManager.cs | 9 +++------ .../DotNetEngine/EventQueueManager.cs | 3 +++ .../DotNetEngine/ScriptManager.cs | 11 +++++++---- bin/OpenSim.ini | 4 ++-- bin/inventoryStore.db | Bin 10240 -> 10240 bytes 6 files changed, 19 insertions(+), 14 deletions(-) diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs index 49f67127b0..3319783dc4 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/AppDomainManager.cs @@ -58,6 +58,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine /// Free AppDomain private AppDomainStructure GetFreeAppDomain() { + Console.WriteLine("Finding free AppDomain"); FreeAppDomains(); // Outsite lock, has its own GetLock lock (GetLock) { @@ -141,8 +142,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine // Find next available AppDomain to put it in AppDomainStructure FreeAppDomain = GetFreeAppDomain(); - if (FreeAppDomain == null) Console.WriteLine("FreeAppDomain == null"); - if (FreeAppDomain.CurrentAppDomain == null) Console.WriteLine("FreeAppDomain.CurrentAppDomain == null"); + //if (FreeAppDomain == null) Console.WriteLine("FreeAppDomain == null"); + //if (FreeAppDomain.CurrentAppDomain == null) Console.WriteLine("FreeAppDomain.CurrentAppDomain == null"); + Console.WriteLine("Loading into AppDomain: " + FileName); LSL_BaseClass mbrt = (LSL_BaseClass)FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script"); //Type mytype = mbrt.GetType(); Console.WriteLine("ScriptEngine AppDomainManager: is proxy={0}", RemotingServices.IsTransparentProxy(mbrt)); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs index 4343ea1a95..a20a95a743 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventManager.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine // TODO: ADD SERVER HOOK TO LOAD A SCRIPT THROUGH myScriptEngine.ScriptManager // Hook up a test event to our test form - //myScriptEngine.Log.Verbose("ScriptEngine", "EventManager Hooking up to server events"); + myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); myScriptEngine.World.EventManager.OnObjectGrab += new OpenSim.Region.Environment.Scenes.EventManager.ObjectGrabDelegate(touch_start); myScriptEngine.World.EventManager.OnRezScript += new OpenSim.Region.Environment.Scenes.EventManager.NewRezScript(OnRezScript); myScriptEngine.World.EventManager.OnRemoveScript += new OpenSim.Region.Environment.Scenes.EventManager.RemoveScript(OnRemoveScript); @@ -62,6 +62,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine { // Add to queue for all scripts in ObjectID object //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventManager Event: touch_start"); + Console.WriteLine("touch_start localID: " + localID); myScriptEngine.myEventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] { (int)1 }); } public void OnRezScript(uint localID, LLUUID itemID, string script) @@ -75,11 +76,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine // new OpenSim.Region.Environment.Scenes.Scripting.NullScriptHost() //); Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + script.Length); - myScriptEngine.myScriptManager.StartScript( - localID, - itemID, - script - ); + myScriptEngine.myScriptManager.StartScript(localID, itemID, script); } public void OnRemoveScript(uint localID, LLUUID itemID) diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs index 23cd4e8f57..a436bff0f4 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs @@ -241,7 +241,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine // Do we have any scripts in this object at all? If not, return if (myScriptEngine.myScriptManager.Scripts.ContainsKey(localID) == false) + { + Console.WriteLine("Event \"" + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID."); return; + } foreach (LLUUID itemID in myScriptEngine.myScriptManager.GetScriptKeys(localID)) { diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index b7a4acacd1..efd5a7f012 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs @@ -169,11 +169,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSO.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName); //OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL.LSL_BaseClass Script = LoadAndInitAssembly(FreeAppDomain, FileName, localID); - long before; - before = GC.GetTotalMemory(true); + + //long before; + //before = GC.GetTotalMemory(true); LSL_BaseClass CompiledScript = m_scriptEngine.myAppDomainManager.LoadScript(FileName); - Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before); - before = GC.GetTotalMemory(true); + //Console.WriteLine("Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before); + //before = GC.GetTotalMemory(true); + + //Script = m_scriptEngine.myAppDomainManager.LoadScript(FileName); //Console.WriteLine("Script occupies {0} bytes", GC.GetTotalMemory(true) - before); //before = GC.GetTotalMemory(true); diff --git a/bin/OpenSim.ini b/bin/OpenSim.ini index 2be850721e..6932d492fb 100644 --- a/bin/OpenSim.ini +++ b/bin/OpenSim.ini @@ -4,8 +4,8 @@ physics = basicphysics ; Prim Storage ; if you would like to use sqlite uncomment the following line (and ; comment the NullStorage line) -; storage_plugin = "OpenSim.DataStore.MonoSqlite.dll" -storage_plugin = "OpenSim.DataStore.NullStorage.dll" +storage_plugin = "OpenSim.DataStore.MonoSqlite.dll" +;storage_plugin = "OpenSim.DataStore.NullStorage.dll" startup_console_commands_file = "startup_commands.txt" serverside_object_permissions = false diff --git a/bin/inventoryStore.db b/bin/inventoryStore.db index 070db2b0f9e2ff70bea87ca952f6c19a3e0decff..d283ea1a97e2ea50a0990f7e390e1bf68e722455 100644 GIT binary patch literal 10240 zcmeHMPmdEf6raiLCXi}TFKrH}l8d?$kv7uUW6zAY2fDygZA+F?7OA(D{|y_+CShi> zOHLIPhxW*K=x5+ksg?Q-xK-lZPtgPQIAM1JSqwse5Mw3Ec;2(0-_LpW&(AlmU+v`z zB*S!{Qrwk1S$mHH3AKH zMVs{8>yCG}7V4k=TOPr`-LC6)yWKCp_m*5&hEV#51SpJS%wkCe@g>JxDvHC1L*jEN zd=w^$iZK-d6$oM>Vyt2s1U_mu2^WZlI0+Puv6K-DlnS9AgoMT_Mlukw5ICd}Bng(j zU?fU>3Q36KAl3$L@@;hpZiuuu%8~C!9Y5|M1Q1+D@j3}XKkFlq8SyFL{QUIkQ^&c_ zy)$!83Ox))NZ}*GEEG)Yk`V0@!rCD$8n@6!G0*Xt_dX=!YX1&DurMe2*ow%5oQUa1Ti8ImWuI21nm7e>63K~ zPjJ$mcTy>WDD*{uk-|udm_wO_QG#faXg3H)<2~{odQZG3Z#n*}?kfa7W&~DkTi()FUe~p48D61eTXJiKl5NRy zkK+G{SpnYm{{J!0edT+Fz^aX~n)tUVnfSLUnfSLURq}-Oajf+<|!MqHdUul9_xp{Nz zG7x(#Js*T^Fi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