From a6d421f99e90739e60a60232dbe5b09a53545978 Mon Sep 17 00:00:00 2001 From: David Härdeman Date: Fri, 26 Jun 2020 15:33:47 +0200 Subject: Rename shortname to name...to make it shorter --- minecctl/minecctl-rcon.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'minecctl/minecctl-rcon.c') diff --git a/minecctl/minecctl-rcon.c b/minecctl/minecctl-rcon.c index f074f3c..27c586c 100644 --- a/minecctl/minecctl-rcon.c +++ b/minecctl/minecctl-rcon.c @@ -112,13 +112,13 @@ rcon_login(struct cfg *cfg, struct server *server) assert_die(cfg && server, "invalid arguments"); if (list_empty(&server->rcon_addrs)) { - error("%s: rcon address unknown", server->shortname); + error("%s: rcon address unknown", server->name); goto error; } fd = connect_any(&server->rcon_addrs, true); if (fd < 0) { - error("%s: unable to connect", server->shortname); + error("%s: unable to connect", server->name); goto error; } @@ -126,7 +126,7 @@ rcon_login(struct cfg *cfg, struct server *server) server->rcon_password = ask_password(); if (!server->rcon_password) { - error("%s: can't login - password missing", server->shortname); + error("%s: can't login - password missing", server->name); goto error; } @@ -140,14 +140,12 @@ rcon_login(struct cfg *cfg, struct server *server) server->rcon_password = NULL; if (rtype == RCON_PACKET_LOGIN_OK) - verbose("%s: login ok", server->shortname); + verbose("%s: login ok", server->name); else if (rtype == RCON_PACKET_LOGIN_FAIL) { - info("%s: login failure, invalid password?", - server->shortname); + info("%s: login failure, invalid password?", server->name); goto error; } else { - error("%s: invalid return code: %" PRIi32, - server->shortname, rtype); + error("%s: invalid return code: %" PRIi32, server->name, rtype); goto error; } @@ -224,7 +222,7 @@ get_one_status(int fd, char *buf, size_t len, const char *cmd, va_list ap; int r; - send_msg(fd, buf, buflen, RCON_PACKET_COMMAND, cmd, &rtype, reply); + send_msg(fd, buf, len, RCON_PACKET_COMMAND, cmd, &rtype, reply); if (rtype != RCON_PACKET_RESPONSE) die("Invalid return code: %" PRIi32, rtype); @@ -358,16 +356,16 @@ stop_one_server(struct cfg *cfg, struct server *server) if (!get_player_count(fd, ¤t, NULL)) { error("%s: unable to get player count, not stopping", - server->shortname); + server->name); return; } else if (current > 0) { error("%s: has active players (use -f to force)", - server->shortname); + server->name); return; } } - info("%s: sending stop command", server->shortname); + info("%s: sending stop command", server->name); send_cmd(fd, "stop"); close(fd); } @@ -421,8 +419,9 @@ do_console(struct cfg *cfg) return; prompt = alloca(strlen(program_invocation_short_name) + - STRLEN(" (") + strlen(server->shortname) + STRLEN("): ") + 1); - sprintf(prompt, "%s (%s): ", program_invocation_short_name, server->shortname); + STRLEN(" (") + strlen(server->name) + STRLEN("): ") + 1); + sprintf(prompt, "%s (%s): ", program_invocation_short_name, + server->name); while (true) { char *tmp; -- cgit v1.2.3