mcpi-0.0.1.2: Connect to MineCraft running on a Raspberry PI.

PortabilityRecordWildCards
Stabilityexperimental
MaintainerDouglas Burke
Safe HaskellNone

Network.MineCraft.Pi.Client.Internal

Description

Internal types for connecting to the Raspberry-PI version of MineCraft. Most users are expected to use Network.MineCraft.Pi.Client rather than this module, but it is provided in case the former is not sufficient.

Synopsis

Documentation

type MCPI = ReaderT ConnInfo IOSource

Represent a program that communicates with a MineCraft PI server.

TODO: run a computation without automatically opening and closing the handle.

runMCPI :: MCPI a -> IO aSource

Run a Raspberry-PI program.

An exception is raised if the server is not running, or can not be contacted.

runMCPI' :: Bool -> MCPI a -> IO aSource

Run a Raspberry-PI program. The flag determines whether the messages sent to, and received from, the server, are printed to stderr as a diagnostic.

An exception is raised if the server is not running, or can not be contacted.

query :: Query -> [Argument] -> MCPI StringSource

Run a MineCraft query, returning the response. An IOError is raised if the response is Fail (this might be due to a previous command failing, depending on the time taken by MineCraft to respond).

command :: Command -> [Argument] -> MCPI ()Source

Run a MineCraft command.