Information on MCServer
#11
(05-06-2015, 10:14 AM)DiamondToaster Wrote:
(05-06-2015, 10:01 AM)Shadowraix Wrote:
(05-06-2015, 09:43 AM)DiamondToaster Wrote: Also, the LuaJIT hack I put together seems to be very circumstantial. It seems to provide a noticeable boost for ARM HF platforms, but the performance increase is mucl lower on a poorly optimized bin (x86). It actually seems to be a bit better using -ofast MinGW x64.
Thebplugin interface is actually very flexible, I have made several completely different examples of plugins with the current API, ranging from a void generator to a very large plugin recreating Super Smash Bros. implementing most of the game's original features, including a sound pack. Smile The API is also super easy to learn, fairly well documented, and if it isn't yet documented, the function names are obvious, so it shouldn't be too hard to figure out.

Thanks for the information DiamondToaster! The API does seem fairly easy which is why I enjoy Lua. It's just easy and simple.

Oh, by the way, can I structure my plugins in any fashion I want? As in having folders inside the main plugin folder?

Definitely, using the API, you can create subdirectories and write files/configs within the plugin folder. The root directory is the MCServer executable. I do this by using the Plugin object that is passed when using the Initialize function at the start of the plugin.

PluginFolder = ""
ConfigFolder = ""

function Initialize(Plugin)
	Plugin:SetName("SomeName")
	Plugin:SetVersion(1)

	-- Returns "Plugins/<Name of Plugin Folder>"
	PluginFolder = Plugin:GetLocalFolder()

	-- Append /config to the end.  For example, the final result will be
	-- Plugins/SomePlugin/config (depending on the name of the plugin main folder)
	ConfigFolder = PluginFolder .. "/config"

	-- If the folder does not exist, then create one
	if not cFile:IsFolder(ConfigFolder) then
		LOG("Config folder does not exist!  Creating directory *config*...")
		cFile:CreateFolder(ConfigFolder)
	end

	LOG("Initialized " .. Plugin:GetName() .. " v0." .. tostring(Plugin:GetVersion()))

	return true
end

Thanks! What about if a plugin wants to write to a file and store information? Are there any examples for going about this such as syntax, file format, and interpreting it? I've used Lua in a restricted environment so some of Lua's functions I'm not quite used to.

it's safe if I get rid of the default plugins in the plugin folder right? I'd like to re-create a lot of stuff to be more custom-ish.
Reply
Thanks given by:


Messages In This Thread
Information on MCServer - by Shadowraix - 05-06-2015, 08:14 AM
RE: Information on MCServer - by NiLSPACE - 05-06-2015, 08:43 AM
RE: Information on MCServer - by Shadowraix - 05-06-2015, 08:51 AM
RE: Information on MCServer - by NiLSPACE - 05-06-2015, 09:26 AM
RE: Information on MCServer - by Shadowraix - 05-06-2015, 09:43 AM
RE: Information on MCServer - by DiamondToaster - 05-06-2015, 09:43 AM
RE: Information on MCServer - by NiLSPACE - 05-06-2015, 09:54 AM
RE: Information on MCServer - by Shadowraix - 05-06-2015, 10:01 AM
RE: Information on MCServer - by DiamondToaster - 05-06-2015, 10:14 AM
RE: Information on MCServer - by Shadowraix - 05-06-2015, 10:32 AM
RE: Information on MCServer - by NiLSPACE - 05-06-2015, 10:09 AM
RE: Information on MCServer - by DiamondToaster - 05-06-2015, 10:47 AM
RE: Information on MCServer - by Shadowraix - 05-06-2015, 10:56 AM
RE: Information on MCServer - by DiamondToaster - 05-06-2015, 10:59 AM
RE: Information on MCServer - by Shadowraix - 05-06-2015, 11:24 AM
RE: Information on MCServer - by DiamondToaster - 05-06-2015, 11:58 AM
RE: Information on MCServer - by Shadowraix - 05-06-2015, 01:19 PM
RE: Information on MCServer - by LogicParrot - 05-06-2015, 03:51 PM
RE: Information on MCServer - by bearbin - 05-06-2015, 04:36 PM
RE: Information on MCServer - by Shadowraix - 05-07-2015, 11:25 AM
RE: Information on MCServer - by bearbin - 05-07-2015, 04:10 PM
RE: Information on MCServer - by worktycho - 05-07-2015, 07:30 PM
RE: Information on MCServer - by Shadowraix - 05-08-2015, 05:19 AM
RE: Information on MCServer - by Shadowraix - 05-08-2015, 06:46 AM
RE: Information on MCServer - by worktycho - 05-08-2015, 06:50 AM
RE: Information on MCServer - by Shadowraix - 05-08-2015, 06:53 AM
RE: Information on MCServer - by worktycho - 05-08-2015, 06:55 AM
RE: Information on MCServer - by jan64 - 05-08-2015, 07:05 AM
RE: Information on MCServer - by worktycho - 05-08-2015, 07:23 AM
RE: Information on MCServer - by NiLSPACE - 05-08-2015, 07:27 AM
RE: Information on MCServer - by worktycho - 05-08-2015, 07:32 AM
RE: Information on MCServer - by Shadowraix - 05-08-2015, 07:35 AM
RE: Information on MCServer - by jan64 - 05-08-2015, 07:41 AM
RE: Information on MCServer - by falkseidl - 05-08-2015, 09:10 PM
RE: Information on MCServer - by worktycho - 05-08-2015, 07:47 AM
RE: Information on MCServer - by Shadowraix - 05-08-2015, 07:55 AM
RE: Information on MCServer - by worktycho - 05-08-2015, 07:56 AM
RE: Information on MCServer - by Shadowraix - 05-08-2015, 07:58 AM
RE: Information on MCServer - by worktycho - 05-08-2015, 10:05 PM
RE: Information on MCServer - by falkseidl - 05-08-2015, 10:17 PM
RE: Information on MCServer - by bearbin - 05-08-2015, 10:26 PM
RE: Information on MCServer - by falkseidl - 05-08-2015, 10:43 PM
RE: Information on MCServer - by worktycho - 05-08-2015, 10:57 PM
RE: Information on MCServer - by xoft - 05-09-2015, 12:36 AM
RE: Information on MCServer - by worktycho - 05-09-2015, 06:10 AM
RE: Information on MCServer - by xoft - 05-09-2015, 07:32 AM
RE: Information on MCServer - by Seadragon91 - 05-09-2015, 07:42 AM
RE: Information on MCServer - by worktycho - 05-09-2015, 07:41 AM
RE: Information on MCServer - by worktycho - 05-09-2015, 07:55 AM
RE: Information on MCServer - by worktycho - 05-09-2015, 09:38 PM
RE: Information on MCServer - by Shadowraix - 05-10-2015, 12:20 AM
RE: Information on MCServer - by worktycho - 05-10-2015, 12:25 AM
RE: Information on MCServer - by worktycho - 05-10-2015, 08:54 PM
RE: Information on MCServer - by xoft - 05-11-2015, 12:46 AM
RE: Information on MCServer - by worktycho - 05-11-2015, 12:51 AM
RE: Information on MCServer - by xoft - 05-11-2015, 04:45 AM
RE: Information on MCServer - by worktycho - 05-11-2015, 05:28 AM
RE: Information on MCServer - by xoft - 05-11-2015, 07:24 AM
RE: Information on MCServer - by worktycho - 05-11-2015, 07:38 AM
RE: Information on MCServer - by tigerw - 05-11-2015, 08:41 AM
RE: Information on MCServer - by worktycho - 05-11-2015, 09:04 AM
RE: Information on MCServer - by worktycho - 05-11-2015, 07:33 PM
RE: Information on MCServer - by worktycho - 05-11-2015, 09:48 PM
RE: Information on MCServer - by NiLSPACE - 05-11-2015, 09:58 PM
RE: Information on MCServer - by worktycho - 05-11-2015, 10:25 PM
RE: Information on MCServer - by Shadowraix - 06-07-2015, 10:02 AM



Users browsing this thread: 12 Guest(s)