#include "PatchedClonkControl.hpp" #define CMD_SIGN "/" PatchedClonkControl::PatchedClonkControl() { } void PatchedClonkControl::abortCountdown() { rawCommand("abort"); } void PatchedClonkControl::alert() { rawCommand("alert"); } void PatchedClonkControl::kick(const ClientInfo& client, const QString& reason) { rawCommand("kick " + client.pcName + (reason.isEmpty() ? "" : " " + reason)); } void PatchedClonkControl::rawCommand(const QString& command) { controller->writeToServer(CMD_SIGN + command + "\n"); } void PatchedClonkControl::serverMessage(const QString& msg, bool action) { if(action) { rawCommand("me " + msg); } else { if(msg.startsWith(CMD_SIGN)) { controller->writeToServer(" " + msg + "\n"); } else { controller->writeToServer(msg + "\n"); } } } void PatchedClonkControl::setCommand(const QString& command) { rawCommand("set " + command); } void PatchedClonkControl::setCountdown(unsigned int countdown) { rawCommand("start " + QString::number(countdown)); } void PatchedClonkControl::watchdog(const QString& id) { rawCommand("watchdog " + id); }