https://github.com/webfreak001/mcrcd
A tiny Minecraft Rcon library for D
https://github.com/webfreak001/mcrcd
Last synced: 4 months ago
JSON representation
A tiny Minecraft Rcon library for D
- Host: GitHub
- URL: https://github.com/webfreak001/mcrcd
- Owner: WebFreak001
- License: unlicense
- Created: 2015-06-09T20:39:46.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-01-09T21:32:15.000Z (over 2 years ago)
- Last Synced: 2025-01-11T04:13:22.838Z (over 1 year ago)
- Language: D
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# McRcD
A tiny Minecraft Rcon library for D.
## Usage
```D
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](http://mcrcd.webfreak.org/)
generated using [MaterialDoc](https://github.com/WebFreak001/MaterialDoc)