예제 #1
0
char *
do_parse_mesg(int descr, dbref player, dbref what, const char *inbuf, const char *abuf, char *outbuf, int outbuflen, int mesgtyp)
{
	if (tp_do_mpi_parsing) {
		char *tmp = NULL;
		struct timeval st, et;

		/* Quickie additions to do rough per-object MPI profiling */
		gettimeofday(&st,NULL);
		tmp = do_parse_mesg_2(descr, player, what, what, inbuf, abuf, outbuf, outbuflen, mesgtyp);
		gettimeofday(&et,NULL);
		if (strcmp(tmp,inbuf)) {
			if (st.tv_usec > et.tv_usec) {
				et.tv_usec += 1000000;
				et.tv_sec -= 1;
			}
			et.tv_usec -= st.tv_usec;
			et.tv_sec -= st.tv_sec;
			DBFETCH(what)->mpi_proftime.tv_sec += et.tv_sec;
			DBFETCH(what)->mpi_proftime.tv_usec += et.tv_usec;
			if (DBFETCH(what)->mpi_proftime.tv_usec >= 1000000) {
				DBFETCH(what)->mpi_proftime.tv_usec -= 1000000;
				DBFETCH(what)->mpi_proftime.tv_sec += 1;
			}
			DBFETCH(what)->mpi_prof_use++;
		}
		return(tmp);
	} else {
		strcpyn(outbuf, outbuflen, inbuf);
	}
	return outbuf;
}
예제 #2
0
char *
do_parse_mesg(int descr, dbref player, dbref what, const char *inbuf, const char *abuf, char *outbuf, int mesgtyp)
{
#ifdef MPI
#ifdef MPI_NEEDFLAG
    if (tp_do_mpi_parsing && (Meeper(what))) {
#else
    if (tp_do_mpi_parsing) {
#endif
	return do_parse_mesg_2(descr, player, what, what, inbuf, abuf, outbuf, mesgtyp);
    } else
#endif
	strcpy(outbuf, inbuf);
    return outbuf;
}