From 8f2c480d9bbd1cef77acf97f9b070bbb7fc1080e Mon Sep 17 00:00:00 2001 From: stpohle Date: Sat, 14 Jun 2003 15:40:40 +0000 Subject: [PATCH] Added Debug Messages --- configure.in | 4 ++-- src/packets.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index 5f3bc38..ad053fd 100644 --- a/configure.in +++ b/configure.in @@ -29,8 +29,8 @@ dnl Check for SDL AC_MSG_ERROR(SDL not found. Make sure sdl-config is in your PATH, or specify with --with-sdl-prefix) ) - CFLAGS="$SDL_CFLAGS $CFLAGS" - LIBS="$SDL_LIBS $LIBS" + CFLAGS="$SDL_CFLAGS $CFLAGS -ggdb" + LIBS="$SDL_LIBS $LIBS -ggdb" dnl Checks for header files. diff --git a/src/packets.c b/src/packets.c index f56b25c..fc44480 100644 --- a/src/packets.c +++ b/src/packets.c @@ -14,6 +14,7 @@ extern int debug_lastping; static short int pkg_lastid; /* the packet id, this will only counted up nothing more.. if we are at 0x10000 we will start at 0 */ +static signed char debug_lastpkgtyp = -1; struct _resend_cache resend_cache; struct _inpkg_index inpkg_index[PKG_IN_INDEX_NUM]; @@ -1077,6 +1078,11 @@ do_pkg (struct pkg *packet, _net_addr * addr) if (GT_MP_PTPM) fwd_pkg (packet, addr); + if (debug_lastpkgtyp != packet->h.typ && debug) { + debug_lastpkgtyp = packet->h.typ; + printf ("NEW PKGTYP (%d)\n", debug_lastpkgtyp); + } + switch (packet->h.typ) { case (PKG_error): if (do_error ((struct pkg_error *) packet, addr) < 0)