private bool lua_ReloadPlugin(string name) { Plugin oldplugin = pluginmanager[name]; if (oldplugin == null) return false; oldplugin.Call("Unload", null); pluginmanager.RemovePlugin(oldplugin); Plugin p = new Plugin(lua); if (!p.Load(oldplugin.Filename)) return false; pluginmanager.AddPlugin(p); p.Call("Init", null); p.Call("PostInit", null); p.Call("ServerStart", null); p.Call("OnDatablocksLoaded", null); p.Call("OnServerInitialized", null); return true; }
private bool lua_LoadPlugin(string name) { Logger.Message("lua_LoadPlugin: " + name ); Plugin oldplugin = pluginmanager[name]; if (oldplugin != null) return false; Plugin p = new Plugin(lua); if (!p.Load(string.Format("{0}\\{1}.lua", GetPath("plugins"),name))) return false; pluginmanager.AddPlugin(p); p.Call("Init", null); p.Call("PostInit", null); p.Call("ServerStart", null); p.Call("OnDatablocksLoaded", null); p.Call("OnServerInitialized", null); return true; }