Lower case is still full of fail.

This commit is contained in:
Lucas Nicodemus 2012-01-04 04:18:21 -07:00
parent b6a8b8221d
commit 1425a80ed6

View file

@ -11,7 +11,7 @@ namespace TShockAPI.LuaSystem
{ {
public class LuaLoader public class LuaLoader
{ {
private Lua Lua = null; private readonly Lua _lua = null;
public string LuaPath = ""; public string LuaPath = "";
public string LuaAutorunPath = ""; public string LuaAutorunPath = "";
public LuaHookBackend HookBackend = new LuaHookBackend(); public LuaHookBackend HookBackend = new LuaHookBackend();
@ -20,7 +20,7 @@ namespace TShockAPI.LuaSystem
<string, KeyValuePair<string, LuaFunction>>(); <string, KeyValuePair<string, LuaFunction>>();
public LuaLoader(string path) public LuaLoader(string path)
{ {
Lua = new Lua(); _lua = new Lua();
LuaPath = path; LuaPath = path;
LuaAutorunPath = Path.Combine(LuaPath, "autorun"); LuaAutorunPath = Path.Combine(LuaPath, "autorun");
SendLuaDebugMsg("Lua 5.1 (serverside) initialized."); SendLuaDebugMsg("Lua 5.1 (serverside) initialized.");
@ -70,7 +70,7 @@ Hook(""doesntmatter"", ""hookmeee"", hookme)");
{ {
try try
{ {
Lua.DoString(s); _lua.DoString(s);
} }
catch (LuaException e) catch (LuaException e)
{ {
@ -82,7 +82,7 @@ Hook(""doesntmatter"", ""hookmeee"", hookme)");
{ {
try try
{ {
Lua.DoFile(s); _lua.DoFile(s);
} }
catch (LuaException e) catch (LuaException e)
{ {
@ -101,9 +101,9 @@ Hook(""doesntmatter"", ""hookmeee"", hookme)");
public void RegisterLuaFunctions() public void RegisterLuaFunctions()
{ {
LuaFunctions LuaFuncs = new LuaFunctions(this); LuaFunctions LuaFuncs = new LuaFunctions(this);
Lua.RegisterFunction("Print", LuaFuncs, LuaFuncs.GetType().GetMethod("Print")); _lua.RegisterFunction("Print", LuaFuncs, LuaFuncs.GetType().GetMethod("Print"));
Lua.RegisterFunction("HookAdd", LuaFuncs, LuaFuncs.GetType().GetMethod("HookAdd")); _lua.RegisterFunction("HookAdd", LuaFuncs, LuaFuncs.GetType().GetMethod("HookAdd"));
Lua.RegisterFunction("HookRemove", LuaFuncs, LuaFuncs.GetType().GetMethod("HookRemove")); _lua.RegisterFunction("HookRemove", LuaFuncs, LuaFuncs.GetType().GetMethod("HookRemove"));
} }
} }