+static void answer_query(char * answer)
+{
+ try_fwrite(answer, strlen(answer), 1, world.file_out, __func__);
+ fflush(world.file_out);
+}
+
+
+
+static uint8_t meta_commands(char * msg)
+{
+ if (!strcmp("QUIT", msg))
+ {
+ free(msg);
+ return 2;
+ }
+ if (!strcmp("PING", msg))
+ {
+ free(msg);
+ answer_query("PONG\n");
+ return 1;
+ }
+ if (!strcmp("STACK", msg))
+ {
+ free(msg);
+ answer_query("THINGS_BELOW_PLAYER START\n");
+ struct Thing * player = get_player();
+ struct Thing * t;
+ for (t = world.things; t; t = t->next)
+ {
+ if ( t->pos.y == player->pos.y && t->pos.x == player->pos.x
+ && t != player)
+ {
+ struct ThingType * tt = get_thing_type(t->type);
+ answer_query(tt->name);
+ answer_query("\n");
+ }
+ }
+ answer_query("THINGS_BELOW_PLAYER END\n");
+ return 1;
+ }
+ return 0;
+}
+
+
+