aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/CodeTools
diff options
context:
space:
mode:
authorMelanie Thielker2009-03-26 15:06:20 +0000
committerMelanie Thielker2009-03-26 15:06:20 +0000
commit706a2df5169fa72fb87f38858d4672c8ff26695a (patch)
treeda1dad724c7ead9edc07c245689d18fd7fd020bb /OpenSim/Region/ScriptEngine/Shared/CodeTools
parentAvoid preprocessing scripts on region restart just to generate the line (diff)
downloadopensim-SC_OLD-706a2df5169fa72fb87f38858d4672c8ff26695a.zip
opensim-SC_OLD-706a2df5169fa72fb87f38858d4672c8ff26695a.tar.gz
opensim-SC_OLD-706a2df5169fa72fb87f38858d4672c8ff26695a.tar.bz2
opensim-SC_OLD-706a2df5169fa72fb87f38858d4672c8ff26695a.tar.xz
Read the .map files in on sim startup. Also clean them up when an assembly
is deleted.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/CodeTools')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs30
1 files changed, 29 insertions, 1 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 5215b90..5cf7a06 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -309,7 +309,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
309 // 309 //
310 if (File.Exists(OutFile) && File.Exists(OutFile+".text") && File.Exists(OutFile+".map")) 310 if (File.Exists(OutFile) && File.Exists(OutFile+".text") && File.Exists(OutFile+".map"))
311 { 311 {
312 // TODO: Read .map file here 312 ReadMapFile(OutFile+".map");
313 return OutFile; 313 return OutFile;
314 } 314 }
315 315
@@ -750,5 +750,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
750 750
751 return ret; 751 return ret;
752 } 752 }
753
754 private void ReadMapFile(string filename)
755 {
756 try
757 {
758 StreamReader r = File.OpenText(filename);
759
760 m_positionMap = new Dictionary<KeyValuePair<int,int>, KeyValuePair<int, int>>();
761
762 string line;
763 while ((line = r.ReadLine()) != null)
764 {
765 String[] parts = line.Split(new Char[] {','});
766 int kk = System.Convert.ToInt32(parts[0]);
767 int kv = System.Convert.ToInt32(parts[1]);
768 int vk = System.Convert.ToInt32(parts[2]);
769 int vv = System.Convert.ToInt32(parts[3]);
770
771 KeyValuePair<int, int> k = new KeyValuePair<int, int>(kk, kv);
772 KeyValuePair<int, int> v = new KeyValuePair<int, int>(vk, vv);
773
774 m_positionMap[k] = v;
775 }
776 }
777 catch (Exception e)
778 {
779 }
780 }
753 } 781 }
754} 782}