Getting closer. Now catches a .NET exception in user code.

This commit is contained in:
kylethomson 2012-01-23 01:10:56 +00:00
parent 5c2587ecfb
commit 33ca14a344
1 changed files with 14 additions and 3 deletions

View File

@ -13,7 +13,7 @@ namespace BizHawk.MultiClient
{
public class LuaImplementation
{
Lua lua = new Lua();
Lua lua = new Lua();
LuaConsole Caller;
public String LuaLibraryList = "";
public EventWaitHandle LuaWait;
@ -23,9 +23,13 @@ namespace BizHawk.MultiClient
public LuaImplementation(LuaConsole passed)
{
EventWaitHandle LuaWait = new AutoResetEvent(false);
LuaWait = new AutoResetEvent(false);
LuaLibraryList = "";
Caller = passed.get();
LuaRegister(lua);
}
public void LuaRegister(Lua lua)
{
lua.RegisterFunction("print", this, this.GetType().GetMethod("print"));
//Register libraries
@ -82,7 +86,14 @@ namespace BizHawk.MultiClient
{
string F = File.ToString();
isRunning = true;
lua.DoFile(F);
try
{
lua.DoFile(F);
}
catch (Exception e)
{
MessageBox.Show("Exception caught. " + e.ToString());
}
isRunning = false;
LuaWait.Set();
}