--- deliantra/server/socket/request.C 2006/09/12 19:20:09 1.17 +++ deliantra/server/socket/request.C 2006/09/16 22:24:13 1.21 @@ -1,9 +1,3 @@ - -/* - * static char *rcsid_init_c = - * "$Id: request.C,v 1.17 2006/09/12 19:20:09 root Exp $"; - */ - /* CrossFire, A Multiplayer game for X-windows @@ -24,7 +18,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - The author can be reached via e-mail to crossfire-devel@real-time.com + The author can be reached via e-mail to */ /** @@ -52,8 +46,6 @@ * esrv_map_doneredraw finishes the map update, and ships across the * map updates. * - * esrv_map_scroll tells the client to scroll the map, and does similarily - * for the locally cached copy. */ #include @@ -268,7 +260,7 @@ buf += 8; // initial map and its origin - mapstruct *map = pl->ob->map; + maptile *map = pl->ob->map; sint16 dx, dy; int mapx = pl->socket.mapx / 2 - pl->ob->x; int mapy = pl->socket.mapy / 2 - pl->ob->y; @@ -1446,9 +1438,8 @@ { /* All of this is just accounting stuff */ if (tframes > 100) - { - tframes = tbytes = 0; - } + tframes = tbytes = 0; + tframes++; frames++; tbytes += sl.len; @@ -1457,6 +1448,7 @@ Send_With_Handling (ns, &sl); ns->sent_scroll = 0; } + free (sl.buf); } @@ -1551,7 +1543,7 @@ */ static int -update_space (SockList * sl, NewSocket * ns, mapstruct *mp, int mx, int my, int sx, int sy, int layer) +update_space (SockList * sl, NewSocket * ns, maptile *mp, int mx, int my, int sx, int sy, int layer) { object *ob, *head; uint16 face_num; @@ -1775,7 +1767,7 @@ */ static inline int -update_smooth (SockList * sl, NewSocket * ns, mapstruct *mp, int mx, int my, int sx, int sy, int layer) +update_smooth (SockList * sl, NewSocket * ns, maptile *mp, int mx, int my, int sx, int sy, int layer) { object *ob; int smoothlevel; /* old face_num; */ @@ -1863,7 +1855,7 @@ uint8 eentrysize; uint16 ewhatstart, ewhatflag; uint8 extendedinfos; - mapstruct *m; + maptile *m; NewSocket & socket = pl->contr->socket; @@ -2136,7 +2128,7 @@ } } - if (lastcell.player !=player) + if (lastcell.player != player) { lastcell.player = player; @@ -2223,17 +2215,19 @@ ewhatflag &= (~EMI_NOREDRAW); esl.buf[ewhatstart + 1] = ewhatflag & 0xff; } + if (esl.len > estartlen) - { - Send_With_Handling (&socket, &esl); - } + Send_With_Handling (&socket, &esl); + free (esl.buf); } + if (sl.len > startlen || socket.sent_scroll) { Send_With_Handling (&socket, &sl); socket.sent_scroll = 0; } + free (sl.buf); } @@ -2249,7 +2243,7 @@ New_Face *floor2; int d, mflags; struct Map newmap; - mapstruct *m, *pm; + maptile *m, *pm; if (pl->type != PLAYER) {