forked from github/server
There is probably no good way to do this in a CR: writing out a list of missing objects in a message object.
This commit is contained in:
parent
e19a918291
commit
ba0851da7a
1 changed files with 21 additions and 2 deletions
|
@ -387,7 +387,7 @@ cr_order(variant var, char * buffer, const void * userdata)
|
||||||
char * wp = buffer;
|
char * wp = buffer;
|
||||||
char * cmd = getcommand(ord);
|
char * cmd = getcommand(ord);
|
||||||
const char * rp = cmd;
|
const char * rp = cmd;
|
||||||
|
|
||||||
*wp++ = '\"';
|
*wp++ = '\"';
|
||||||
while (*rp) {
|
while (*rp) {
|
||||||
switch (*rp) {
|
switch (*rp) {
|
||||||
|
@ -400,13 +400,31 @@ cr_order(variant var, char * buffer, const void * userdata)
|
||||||
}
|
}
|
||||||
*wp++ = '\"';
|
*wp++ = '\"';
|
||||||
*wp++ = 0;
|
*wp++ = 0;
|
||||||
|
|
||||||
free(cmd);
|
free(cmd);
|
||||||
}
|
}
|
||||||
else strcpy(buffer, "\"\"");
|
else strcpy(buffer, "\"\"");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
cr_resources(variant var, char * buffer, const void * userdata)
|
||||||
|
{
|
||||||
|
resource * rlist = (resource*)var.v;
|
||||||
|
char * wp = buffer;
|
||||||
|
if (rlist!=NULL) {
|
||||||
|
wp += sprintf(wp, "%d %s", rlist->number,
|
||||||
|
resourcename(rlist->type, rlist->number!=1));
|
||||||
|
for (;;) {
|
||||||
|
rlist = rlist->next;
|
||||||
|
if (rlist==NULL) break;
|
||||||
|
wp += sprintf(wp, ", %d %s", rlist->number,
|
||||||
|
resourcename(rlist->type, rlist->number!=1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cr_spell(variant var, char * buffer, const void * userdata)
|
cr_spell(variant var, char * buffer, const void * userdata)
|
||||||
{
|
{
|
||||||
|
@ -1483,6 +1501,7 @@ creport_init(void)
|
||||||
tsf_register("race", &cr_race);
|
tsf_register("race", &cr_race);
|
||||||
tsf_register("direction", &cr_int);
|
tsf_register("direction", &cr_int);
|
||||||
tsf_register("alliance", &cr_alliance);
|
tsf_register("alliance", &cr_alliance);
|
||||||
|
tsf_register("resources", &cr_resources);
|
||||||
|
|
||||||
register_reporttype("cr", &report_computer, 1<<O_COMPUTER);
|
register_reporttype("cr", &report_computer, 1<<O_COMPUTER);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue