--- deliantra/server/socket/request.C 2008/12/26 10:36:42 1.144 +++ deliantra/server/socket/request.C 2008/12/26 10:44:17 1.145 @@ -406,59 +406,6 @@ INVOKE_CLIENT (ADDME, ns, ARG_DATA (buf, len)); } -/** Reply to ExtendedInfos command */ -void -ToggleExtendedInfos (char *buf, int len, client * ns) -{ - char cmdback[MAX_BUF]; - char command[50]; - int info, nextinfo; - - cmdback[0] = '\0'; - nextinfo = 0; - - while (1) - { - /* 1. Extract an info */ - info = nextinfo; - - while ((info < len) && (buf[info] == ' ')) - info++; - - if (info >= len) - break; - - nextinfo = info + 1; - - while ((nextinfo < len) && (buf[nextinfo] != ' ')) - nextinfo++; - - if (nextinfo - info >= 49) /*Erroneous info asked */ - continue; - - strncpy (command, &(buf[info]), nextinfo - info); - - /* 2. Interpret info */ - if (!strcmp ("smooth", command)) - /* Toggle smoothing */ - ns->EMI_smooth = !ns->EMI_smooth; - else - /*bad value */; - - /*3. Next info */ - } - - strcpy (cmdback, "ExtendedInfoSet"); - - if (ns->EMI_smooth) - { - strcat (cmdback, " "); - strcat (cmdback, "smoothing"); - } - - ns->send_packet (cmdback); -} - /* #define MSG_TYPE_BOOK 1 #define MSG_TYPE_CARD 2 @@ -986,25 +933,6 @@ return 0; } -/** - * Returns the size of a data for a map square as returned by - * mapextended. There are CLIENTMAPX*CLIENTMAPY*LAYERS entries - * available. - */ -int -getExtendedMapInfoSize (client * ns) -{ - int result = 0; - - if (ns->ext_mapinfos) - { - if (ns->EMI_smooth) - result += 1; /*One byte for smoothlevel */ - } - - return result; -} - // prefetch (and touch) all maps within a specific distancd static void prefetch_surrounding_maps (maptile *map, int distance) @@ -1045,10 +973,6 @@ return; int startlen, oldlen; - int estartlen, eoldlen; - uint8 eentrysize; - uint16 ewhatstart, ewhatflag; - uint8 extendedinfos; check_map_change (pl); prefetch_surrounding_maps (pl->ob); @@ -1087,29 +1011,9 @@ client &socket = *pl->ns; packet sl (socket.mapmode == Map1Cmd ? "map1" : "map1a"); - packet esl; startlen = sl.length (); - /*Extendedmapinfo structure initialisation */ - if (socket.ext_mapinfos) - { - extendedinfos = EMI_NOREDRAW; - - if (socket.EMI_smooth) - extendedinfos |= EMI_SMOOTH; - - ewhatstart = esl.length (); - ewhatflag = extendedinfos; /*The EMI_NOREDRAW bit - could need to be taken away */ - eentrysize = getExtendedMapInfoSize (&socket); - esl << "mapextended " - << uint8 (extendedinfos) - << uint8 (eentrysize); - - estartlen = esl.length (); - } - int hx = socket.mapx / 2; int hy = socket.mapy / 2; @@ -1117,9 +1021,7 @@ int ax = dx + hx; int ay = dy + hy; - int emask, mask; - emask = mask = (ax << 10) | (ay << 4); - + int mask = (ax << 10) | (ay << 4); MapCell &lastcell = socket.lastmap.cells[ax][ay]; /* If the coordinates are not valid, or it is too dark to see, @@ -1175,7 +1077,6 @@ * doing those checks again to add the real data. */ oldlen = sl.length (); - eoldlen = esl.length (); sl << uint16 (mask); @@ -1312,56 +1213,11 @@ sl[oldlen + 1] = mask & 0xff; else sl.reset (oldlen); - - if (socket.ext_mapinfos) - esl << uint16 (emask); - - if (socket.EMI_smooth) - { - for (int layer = 2+1; layer--; ) - { - object *ob = ms.faces_obj [layer]; - - // If there is no object for this space, or if the face for the object - // is the blank face, set the smoothlevel to zero. - int smoothlevel = ob && ob->face != blank_face ? ob->smoothlevel : 0; - - // We've gotten what face we want to use for the object. Now see if - // if it has changed since we last sent it to the client. - if (lastcell.smooth[layer] != smoothlevel) - { - lastcell.smooth[layer] = smoothlevel; - esl << uint8 (smoothlevel); - emask |= 1 << layer; - } - } - - if (emask & 0xf) - esl[eoldlen + 1] = emask & 0xff; - else - esl.reset (eoldlen); - } } /* else this is a viewable space */ ordered_mapwalk_end socket.flush_fx (); - /* Verify that we in fact do need to send this */ - if (socket.ext_mapinfos) - { - if (!(sl.length () > startlen || socket.sent_scroll)) - { - /* No map data will follow, so don't say the client - * it doesn't need draw! - */ - ewhatflag &= ~EMI_NOREDRAW; - esl[ewhatstart + 1] = ewhatflag & 0xff; - } - - if (esl.length () > estartlen) - socket.send_packet (esl); - } - if (sl.length () > startlen || socket.sent_scroll) { socket.send_packet (sl);