aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs44
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs4
2 files changed, 45 insertions, 3 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 5d8f445..5b3dce7 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -343,7 +343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
343 343
344 // Check this late so the map is generated on sim start 344 // Check this late so the map is generated on sim start
345 // 345 //
346 if (File.Exists(OutFile)) 346 if (File.Exists(OutFile) && File.Exists(OutFile+".text"))
347 { 347 {
348// m_scriptEngine.Log.DebugFormat("[Compiler] Returning existing assembly for {0}", asset); 348// m_scriptEngine.Log.DebugFormat("[Compiler] Returning existing assembly for {0}", asset);
349 return OutFile; 349 return OutFile;
@@ -579,6 +579,48 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
579 } 579 }
580// m_scriptEngine.Log.DebugFormat("[Compiler] Compiled new assembly "+ 580// m_scriptEngine.Log.DebugFormat("[Compiler] Compiled new assembly "+
581// "for {0}", asset); 581// "for {0}", asset);
582
583 // Because windows likes to perform exclusive locks, we simply
584 // write out a textual representation of the file here
585 //
586 // Read the binary file into a buffer
587 //
588 FileInfo fi = new FileInfo(OutFile);
589
590 if (fi == null)
591 {
592 string errtext = String.Empty;
593 errtext += "No compile error. But not able to stat file.";
594 throw new Exception(errtext);
595 }
596
597 Byte[] data = new Byte[fi.Length];
598
599 try
600 {
601 FileStream fs = File.Open(OutFile, FileMode.Open, FileAccess.Read);
602 fs.Read(data, 0, data.Length);
603 fs.Close();
604 }
605 catch (Exception e)
606 {
607 string errtext = String.Empty;
608 errtext += "No compile error. But not able to open file.";
609 throw new Exception(errtext);
610 }
611
612 // Convert to base64
613 //
614 string filetext = System.Convert.ToBase64String(data);
615
616 System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
617
618 Byte[] buf = enc.GetBytes(filetext);
619
620 FileStream sfs = File.Create(OutFile+".text");
621 sfs.Write(buf, 0, buf.Length);
622 sfs.Close();
623
582 return OutFile; 624 return OutFile;
583 } 625 }
584 626
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index a5570b3..7a36bc2 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -744,8 +744,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
744 if (File.Exists(m_Assemblies[assetID])) 744 if (File.Exists(m_Assemblies[assetID]))
745 File.Delete(m_Assemblies[assetID]); 745 File.Delete(m_Assemblies[assetID]);
746 746
747 if (File.Exists(m_Assemblies[assetID]+".state")) 747 if (File.Exists(m_Assemblies[assetID]+".text"))
748 File.Delete(m_Assemblies[assetID]+".state"); 748 File.Delete(m_Assemblies[assetID]+".text");
749 749
750 if (File.Exists(m_Assemblies[assetID]+".mdb")) 750 if (File.Exists(m_Assemblies[assetID]+".mdb"))
751 File.Delete(m_Assemblies[assetID]+".mdb"); 751 File.Delete(m_Assemblies[assetID]+".mdb");