From f06ff46151c38b2259c5ee4ae83d38c6f6fc0c8c Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Sun, 12 Jul 2020 02:30:31 +0200 Subject: Teach minecctl to create proper mcserver files, auto-generate systemd service names as necessary --- minecproxy/server-rcon.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'minecproxy/server-rcon.c') diff --git a/minecproxy/server-rcon.c b/minecproxy/server-rcon.c index c8a91c3..a728bab 100644 --- a/minecproxy/server-rcon.c +++ b/minecproxy/server-rcon.c @@ -32,14 +32,14 @@ static bool rcon_check_reply(struct uring_task *task, int res, int32_t *id, const char *error; if (res < 0) { - error("rcon(%s): reading reply failed, res: %i", server->name, - res); + error("rcon(%s): reading reply failed, res: %i", + server->scfg.name, res); goto error; } if (!rcon_protocol_read_packet(task->tbuf->buf, task->tbuf->len, id, type, msg, &error)) { - error("rcon(%s): failed to parse packet: %s", server->name, + error("rcon(%s): failed to parse packet: %s", server->scfg.name, error); goto error; } @@ -66,10 +66,10 @@ static void rcon_stop_reply(struct uring_task *task, int res) if (!rcon_protocol_verify_response(2, id, RCON_PACKET_COMMAND, type, &error)) - error("rcon(%s): stop cmd failed - %s", server->name, error); + error("rcon(%s): stop cmd failed - %s", server->scfg.name, error); else verbose("rcon(%s): stop command sent, reply: %s", - server->name, msg); + server->scfg.name, msg); uring_task_close_fd(task); } @@ -83,12 +83,12 @@ static void rcon_stop_sent(struct uring_task *task, int res) if (res != task->tbuf->len) { error("rcon(%s): sending stop cmd failed, res: %i", - server->name, res); + server->scfg.name, res); uring_task_close_fd(task); return; } - debug(DBG_RCON, "rcon(%s): stop cmd sent", server->name); + debug(DBG_RCON, "rcon(%s): stop cmd sent", server->scfg.name); uring_tbuf_read_until(task, rcon_packet_complete, rcon_stop_reply); } @@ -107,11 +107,11 @@ static void rcon_login_reply(struct uring_task *task, int res) if (!rcon_protocol_verify_response(1, id, RCON_PACKET_LOGIN, type, &error)) { - error("rcon(%s): login failed - %s", server->name, error); + error("rcon(%s): login failed - %s", server->scfg.name, error); goto error; } - debug(DBG_RCON, "rcon(%s): login successful", server->name); + debug(DBG_RCON, "rcon(%s): login successful", server->scfg.name); rcon_protocol_create_packet(task->tbuf->buf, sizeof(task->tbuf->buf), &task->tbuf->len, 2, RCON_PACKET_COMMAND, "stop"); @@ -130,13 +130,13 @@ static void rcon_login_sent(struct uring_task *task, int res) assert_task_alive(DBG_RCON, task); if (res != task->tbuf->len) { - error("rcon(%s): sending login failed, res: %i", server->name, + error("rcon(%s): sending login failed, res: %i", server->scfg.name, res); uring_task_close_fd(task); return; } - debug(DBG_RCON, "rcon(%s): login sent", server->name); + debug(DBG_RCON, "rcon(%s): login sent", server->scfg.name); uring_tbuf_read_until(task, rcon_packet_complete, rcon_login_reply); } @@ -148,7 +148,7 @@ static void rcon_connected_cb(struct connection *conn, bool connected) assert_task_alive(DBG_RCON, &server->rcon_task); if (!connected) { - error("rcon (%s): connection failed", server->name); + error("rcon (%s): connection failed", server->scfg.name); return; } @@ -166,7 +166,7 @@ static void rcon_free(struct uring_task *task) assert_return(task); - debug(DBG_RCON, "task %p, server %s (%p)", task, server->name, server); + debug(DBG_RCON, "task %p, server %s (%p)", task, server->scfg.name, server); } void rcon_stop(struct server *server) -- cgit v1.2.3