--- deliantra/server/socket/request.C 2006/08/19 03:54:23 1.6 +++ deliantra/server/socket/request.C 2006/08/21 07:13:32 1.7 @@ -1,6 +1,6 @@ /* * static char *rcsid_init_c = - * "$Id: request.C,v 1.6 2006/08/19 03:54:23 root Exp $"; + * "$Id: request.C,v 1.7 2006/08/21 07:13:32 root Exp $"; */ /* @@ -165,6 +165,20 @@ ns->sent_scroll = 1; } +static void +clear_map (player *pl) +{ + NewSocket &socket = pl->socket; + + memset (&socket.lastmap, 0, sizeof (socket.lastmap)); + + if (socket.newmapcmd == 1) + Write_String_To_Socket (&socket, "newmap", 6); + + socket.update_look = 1; + socket.look_position = 0; +} + /** check for map change and send new map data */ static void check_map_change (player *pl) @@ -176,13 +190,8 @@ if (socket.current_map != ob->map) { socket.current_map = ob->map; - memset (&socket.lastmap, 0, sizeof(socket.lastmap)); - - if (socket.newmapcmd == 1) - Write_String_To_Socket (&socket, "newmap", 6); - socket.update_look = 1; - socket.look_position =0; + clear_map (pl); if (socket.mapinfocmd) { @@ -207,9 +216,17 @@ } else if (socket.current_x != ob->x || socket.current_y != ob->y) { - socket_map_scroll (&socket, ob->x - socket.current_x, ob->y - socket.current_y); - socket.update_look = 1; - socket.look_position = 0; + int dx = ob->x - socket.current_x; + int dy = ob->y - socket.current_y; + + if (socket.buggy_mapscroll && (abs (dx) > 8 || abs (dy) > 8)) + clear_map (pl); // current (<= 1.9.1) clients have unchecked buffer overflows + else + { + socket_map_scroll (&socket, ob->x - socket.current_x, ob->y - socket.current_y); + socket.update_look = 1; + socket.look_position = 0; + } } socket.current_x = ob->x; @@ -825,6 +842,8 @@ if (cp) { LOG(llevDebug,"CS: connection from client of type <%s>, ip %s\n", cp, ns->host); + snprintf (ns->client, sizeof (ns->client), "%s", cp + 1); + /* This is first implementation - i skip all beta DX clients with it * Add later stuff here for other clients */