void write_mud(struct session *ses, char *command, int flags) { char output[BUFFER_SIZE]; int size; size = substitute(ses, command, output, flags); if (HAS_BIT(ses->flags, SES_FLAG_MAPPING)) { if (ses->map == NULL || ses->map->nofollow == 0) { check_insert_path(command, ses); } } if (ses->map && ses->map->in_room && ses->map->nofollow == 0) { if (!HAS_BIT(ses->map->flags, MAP_FLAG_NOFOLLOW)) { if (follow_map(ses, command)) { return; } } } write_line_mud(ses, output, size); }
void write_com_arg_mud(char* command, char* argument) { char outtext[BUFFER_SIZE]; int i; check_insert_path(command); strncpy(outtext, command, BUFFER_SIZE); if(*argument) { strncat(outtext, " ", BUFFER_SIZE-strlen(command)-1); strncat(outtext, argument, BUFFER_SIZE-strlen(command)-2); } write_line_mud(outtext); i=strlen(outtext); outtext[i++]='\r'; outtext[i++]='\n'; }