I try to run BabBot ,but the code in this function cause some error like this:
System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
the trouble line is
int n = Lua_GetTop(Lua_GetState());
Code:
public static int InputHandler(uint luaState)
{
lock (dataLock)
{
try
{
Log("InputHandler() - Calling ...");
Values.Clear();
int n = Lua_GetTop(Lua_GetState());
Log("InputHandler() - Lua_GetTop(Lua_GetState() Done!");
Log(string.Format("InputHandler() - Passed LUA_State (ignored): {0:X}", luaState));
Log(string.Format("InputHandler() - Our own LUA_State: {0:X}", Lua_GetState()));
Log("InputHandler() - Vars num: " + n);
for (int i = 1; i <= n; i++)
{
string res = Lua_ToString(Lua_GetState(), i, 0);
Log(string.Format(
"InputHandler() - Var[{0}] = {1}", i, res));
Values.Add(res);
}
Log("InputHandler() - Done");
}
catch (Exception e)
{
Log("InputHandler() exception: " + e.ToString());
}
ValueReceived = true;
}
return 0;
}
Anyone have some idea for this ?