--- deliantra/server/socket/request.C 2006/12/14 20:39:54 1.37 +++ deliantra/server/socket/request.C 2006/12/15 03:53:44 1.39 @@ -62,13 +62,8 @@ #include #include -#ifdef HAVE_UNISTD_H -# include -#endif - -#ifdef HAVE_SYS_TIME_H -# include -#endif +#include +#include #include "sounds.h" @@ -776,7 +771,7 @@ * can throttle. */ void -NewPlayerCmd (uint8 * buf, int len, player *pl) +NewPlayerCmd (char *buf, int len, player *pl) { int time, repeat; char command[MAX_BUF]; @@ -788,8 +783,8 @@ return; } - pktlen = net_uint16 (buf); - repeat = net_uint32 (buf + 2); + pktlen = net_uint16 ((uint8 *)buf); + repeat = net_uint32 ((uint8 *)buf + 2); /* -1 is special - no repeat, but don't update */ if (repeat != -1) @@ -799,18 +794,7 @@ len = MAX_BUF - 5; strncpy ((char *) command, (char *) buf + 6, len - 4); - command[len - 4] = '\0'; - - /* The following should never happen with a proper or honest client. - * Therefore, the error message doesn't have to be too clear - if - * someone is playing with a hacked/non working client, this gives them - * an idea of the problem, but they deserve what they get - */ - if (pl->state != ST_PLAYING) - { - new_draw_info_format (NDI_UNIQUE, 0, pl->ob, "You can not issue commands - state is not ST_PLAYING (%s)", buf); - return; - } + command[len - 4] = 0; /* This should not happen anymore. */ if (pl->ob->speed_left < -1.0)