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:
#12
You can throw out mostly everything except Core and ChatLog. The server barely functions without those. And as for structured file formats, the server supports a very easy to use Ini interface and Lua bindings for SQLite3. If you want some pretty basic sample code on how to use cIniFile, there's some in my GitHub repo under stuff like MCSmash2, VoidGenerator, MCArena. https://github.com/DevToaster
Reply
Thanks given by: Shadowraix
#13
(05-06-2015, 10:47 AM)DiamondToaster Wrote: You can throw out mostly everything except Core and ChatLog. The server barely functions without those. And as for structured file formats, the server supports a very easy to use Ini interface and Lua bindings for SQLite3. If you want some pretty basic sample code on how to use cIniFile, there's some in my GitHub repo under stuff like MCSmash2, VoidGenerator, MCArena. https://github.com/DevToaster

Alright. Thanks a lot for your help. You and NiLSPACE have definitely made the introduction into the MCServer community a lot easier. I appreciate helpful people such as yourself for helping newcomers. I'll be trying to work on something for the next few days and hopefully I might have something to show.
Reply
Thanks given by: DiamondToaster
#14
Thanks, it's nice to know that my advice can be of some help. Smile Can't wait to see what you come up with eventually.
Reply
Thanks given by: Shadowraix
#15
(05-06-2015, 10:59 AM)DiamondToaster Wrote: Thanks, it's nice to know that my advice can be of some help. Smile Can't wait to see what you come up with eventually.

I can't wait either. xD

On a side-note. Server Hosting solutions. Got any recommendations? Most dedicated MC hosts don't allow custom server software.
Reply
Thanks given by:
#16
Almost all of us use home-hosted servers. I believe there is one company that allows MCServer, but I forgot what it was. Due to the lightweight nature of MCServer, it actually runs well on just about anything. It's very easy to install in on a Raspberry Pi 2, port-forward, and use something like ddns.org to register a host name. Hopefully, more companies will allow MCServer to run on their machines. If you're looking into some cheap hardware, I'd recommend the Odroid-C1 or the Raspberry Pi 2. I believe that there's even an auto install script on the GitHub page to do the work for you.
Reply
Thanks given by:
#17
(05-06-2015, 11:58 AM)DiamondToaster Wrote: Almost all of us use home-hosted servers. I believe there is one company that allows MCServer, but I forgot what it was. Due to the lightweight nature of MCServer, it actually runs well on just about anything. It's very easy to install in on a Raspberry Pi 2, port-forward, and use something like ddns.org to register a host name. Hopefully, more companies will allow MCServer to run on their machines. If you're looking into some cheap hardware, I'd recommend the Odroid-C1 or the Raspberry Pi 2. I believe that there's even an auto install script on the GitHub page to do the work for you.

I'm trying to look for a host to have a reliable option to make sure I get good up-time and stability. I'm bothering a few hosts right now to see if they would support it for me. I'll report back with any hosts that will accept it.
Reply
Thanks given by:
#18
Regarding survival:
I should mention that the survival experience received a boost a day or two (or three?) ago thanks to the newly implemented PathFinding, if you've downloaded MCServer a few days back, I strongly suggest you re-download to get the best out of survival.
I'm pushing mob-related commits almost daily, so mobs, and hence survival, are getting better by the day. In a day or two you'll be seeing proper livestock escaping mechanism, mob swimming is getting better, mob door handling is coming soon, etc.
For the mob/Pathfinder features and to-do list, check out these:
Mob status
PathFinder status
Reply
Thanks given by:
#19
DigitalOcean works for a more manage-it-yourself installation, but gamocosm (search for it) has a more complete support for MCS.
Reply
Thanks given by:
#20
(05-06-2015, 04:36 PM)bearbin Wrote: DigitalOcean works for a more manage-it-yourself installation, but gamocosm (search for it) has a more complete support for MCS.

Thanks for the DigitalOcean and Pathfinding information.

I would like to inquire about software dependencies.

Hosts are asking me this. What would they be for the windows and linux versions?

One host said GLib was one.
Reply
Thanks given by:




Users browsing this thread: 4 Guest(s)