summaryrefslogtreecommitdiff
path: root/minecctl/misc-commands.c
blob: f20cac57c5903dda08f6d32e0eb876c8cf9da9ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "utils.h"
#include "minecctl.h"
#include "server.h"
#include "misc-commands.h"
#include "rcon-commands.h"
#include "mc-commands.h"

bool do_list(struct cfg *cfg)
{
	struct server *server;

	/* server->scfg.filename check excludes servers created from cmdline */
	list_for_each_entry(server, &cfg->servers, list)
		if (server->scfg.filename)
			info("%s", server->name);

	return true;
}

bool do_pcount(struct cfg *cfg)
{
	unsigned x, y;

	if (do_rcon_pcount(cfg, &y, &x))
		error("Rcon says %u/%u", y, x);

	if (do_mc_pcount(cfg, &y, &x))
		error("MC says %u/%u", y, x);

	return true;
}