summaryrefslogtreecommitdiff
path: root/minecctl/rcon-commands.c
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-30 08:10:04 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-30 08:10:04 +0200
commita89a0f918925a662503c1bcb28bdb06ab9b7ef25 (patch)
tree733b4c1ff841f99eeb3840c5948fef6c5bf76109 /minecctl/rcon-commands.c
parent8f29a4d23dd13a80aa26951b17e2a71f4e651cb1 (diff)
Share config parsing fully between server and cmdline tool
Diffstat (limited to 'minecctl/rcon-commands.c')
-rw-r--r--minecctl/rcon-commands.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/minecctl/rcon-commands.c b/minecctl/rcon-commands.c
index 5f98b72..2f1687b 100644
--- a/minecctl/rcon-commands.c
+++ b/minecctl/rcon-commands.c
@@ -110,30 +110,30 @@ static int rcon_login(struct cfg *cfg, struct server *server)
assert_die(cfg && server, "invalid arguments");
- if (list_empty(&server->rcon_addrs)) {
+ if (list_empty(&server->scfg.rcons)) {
error("%s: rcon address unknown", server->name);
goto error;
}
- fd = connect_any(&server->rcon_addrs, true);
+ fd = connect_any(&server->scfg.rcons, true);
if (fd < 0) {
error("%s: unable to connect", server->name);
goto error;
}
- if (!server->rcon_password)
- server->rcon_password = ask_password();
+ if (!server->scfg.rcon_password)
+ server->scfg.rcon_password = ask_password();
- if (!server->rcon_password) {
+ if (!server->scfg.rcon_password) {
error("%s: can't login - password missing", server->name);
goto error;
}
- send_msg(fd, buf, sizeof(buf), RCON_PACKET_LOGIN, server->rcon_password,
+ send_msg(fd, buf, sizeof(buf), RCON_PACKET_LOGIN, server->scfg.rcon_password,
&rtype, &reply);
explicit_bzero(buf, sizeof(buf));
- free_password(&server->rcon_password);
+ free_password(&server->scfg.rcon_password);
if (rtype == RCON_PACKET_LOGIN_OK)
verbose("%s: login ok", server->name);