Description

A tiny Minecraft Rcon library for D

Package Information

Version1.0.2 (2016-Jan-06)
Repositoryhttps://github.com/WebFreak001/mcrcd
Licensepublic domain
CopyrightCopyright © 2016, WebFreak001
AuthorsWebFreak001
Registered byWebFreak
Dependenciesnone

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

McRcD

A tiny Minecraft Rcon library for D.

Usage


import mcrcd;
import std.stdio;

// Interactive Rcon console
void main(string[] args)
{
	auto rcon = new MCRcon();

	try
	{
		// Will connect to localhost:25575 or throw an exception if an error occurs
		rcon.connect("localhost", 25575);
	}
	catch(Exception e)
	{
		writeln("Couldn't connect!");
		writeln(e);
		return;
	}
	scope(exit) rcon.disconnect();

	// Login to Rcon
	rcon.login("password");

	while(true)
	{
		write("> ");
		MCRconResponse response = rcon.command(readln().strip());
		// MCRconResponse.unformatted automatically removes all text formatting/color codes (§code)
		writeln("  ", response.unformatted);
	}
}

Documentation

generated using MaterialDoc

Available versions

1.0.2 1.0.1 1.0.0 ~master