Read the .map files in on sim startup. Also clean them up when an assembly

is deleted.
0.6.5-rc1
Melanie Thielker 2009-03-26 15:06:20 +00:00
parent eb6c1ae0c1
commit 706a2df516
2 changed files with 32 additions and 1 deletions

View File

@ -309,7 +309,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
//
if (File.Exists(OutFile) && File.Exists(OutFile+".text") && File.Exists(OutFile+".map"))
{
// TODO: Read .map file here
ReadMapFile(OutFile+".map");
return OutFile;
}
@ -750,5 +750,33 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
return ret;
}
private void ReadMapFile(string filename)
{
try
{
StreamReader r = File.OpenText(filename);
m_positionMap = new Dictionary<KeyValuePair<int,int>, KeyValuePair<int, int>>();
string line;
while ((line = r.ReadLine()) != null)
{
String[] parts = line.Split(new Char[] {','});
int kk = System.Convert.ToInt32(parts[0]);
int kv = System.Convert.ToInt32(parts[1]);
int vk = System.Convert.ToInt32(parts[2]);
int vv = System.Convert.ToInt32(parts[3]);
KeyValuePair<int, int> k = new KeyValuePair<int, int>(kk, kv);
KeyValuePair<int, int> v = new KeyValuePair<int, int>(vk, vv);
m_positionMap[k] = v;
}
}
catch (Exception e)
{
}
}
}
}

View File

@ -780,6 +780,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
if (File.Exists(m_Assemblies[assetID]+".mdb"))
File.Delete(m_Assemblies[assetID]+".mdb");
if (File.Exists(m_Assemblies[assetID]+".map"))
File.Delete(m_Assemblies[assetID]+".map");
}
catch (Exception)
{