ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/request.C
(Generate patch)

Comparing deliantra/server/socket/request.C (file contents):
Revision 1.21 by root, Sat Sep 16 22:24:13 2006 UTC vs.
Revision 1.26 by pippijn, Mon Dec 11 19:46:47 2006 UTC

57#include <commands.h> 57#include <commands.h>
58 58
59/* This block is basically taken from socket.c - I assume if it works there, 59/* This block is basically taken from socket.c - I assume if it works there,
60 * it should work here. 60 * it should work here.
61 */ 61 */
62#ifndef WIN32 /* ---win32 exclude unix headers */
63# include <sys/types.h> 62#include <sys/types.h>
64# include <sys/time.h> 63#include <sys/time.h>
65# include <sys/socket.h> 64#include <sys/socket.h>
66# include <netinet/in.h> 65#include <netinet/in.h>
67# include <netdb.h> 66#include <netdb.h>
68#endif /* win32 */
69 67
70#ifdef HAVE_UNISTD_H 68#ifdef HAVE_UNISTD_H
71# include <unistd.h> 69# include <unistd.h>
72#endif 70#endif
73 71
137 for (x = 0; x < mx; x++) 135 for (x = 0; x < mx; x++)
138 { 136 {
139 for (y = 0; y < my; y++) 137 for (y = 0; y < my; y++)
140 { 138 {
141 if (x >= ns->mapx || y >= ns->mapy) 139 if (x >= ns->mapx || y >= ns->mapy)
142 {
143 /* clear cells outside the viewable area */ 140 /* clear cells outside the viewable area */
144 memset (&newmap.cells[x][y], 0, sizeof (struct MapCell)); 141 memset (&newmap.cells[x][y], 0, sizeof (struct MapCell));
145 }
146 else if ((x + dx) < 0 || (x + dx) >= ns->mapx || (y + dy) < 0 || (y + dy) >= ns->mapy) 142 else if ((x + dx) < 0 || (x + dx) >= ns->mapx || (y + dy) < 0 || (y + dy) >= ns->mapy)
147 {
148 /* clear newly visible tiles within the viewable area */ 143 /* clear newly visible tiles within the viewable area */
149 memset (&(newmap.cells[x][y]), 0, sizeof (struct MapCell)); 144 memset (&(newmap.cells[x][y]), 0, sizeof (struct MapCell));
150 }
151 else 145 else
152 {
153 memcpy (&(newmap.cells[x][y]), &(ns->lastmap.cells[x + dx][y + dy]), sizeof (struct MapCell)); 146 memcpy (&(newmap.cells[x][y]), &(ns->lastmap.cells[x + dx][y + dy]), sizeof (struct MapCell));
154 }
155 } 147 }
156 } 148 }
157 149
158 memcpy (&(ns->lastmap), &newmap, sizeof (struct Map)); 150 memcpy (&(ns->lastmap), &newmap, sizeof (struct Map));
159 151
1131 AddIfShort (pl->last_stats.Wis, pl->ob->stats.Wis, CS_STAT_WIS); 1123 AddIfShort (pl->last_stats.Wis, pl->ob->stats.Wis, CS_STAT_WIS);
1132 AddIfShort (pl->last_stats.Dex, pl->ob->stats.Dex, CS_STAT_DEX); 1124 AddIfShort (pl->last_stats.Dex, pl->ob->stats.Dex, CS_STAT_DEX);
1133 AddIfShort (pl->last_stats.Con, pl->ob->stats.Con, CS_STAT_CON); 1125 AddIfShort (pl->last_stats.Con, pl->ob->stats.Con, CS_STAT_CON);
1134 AddIfShort (pl->last_stats.Cha, pl->ob->stats.Cha, CS_STAT_CHA); 1126 AddIfShort (pl->last_stats.Cha, pl->ob->stats.Cha, CS_STAT_CHA);
1135 } 1127 }
1128
1136 if (pl->socket.exp64) 1129 if (pl->socket.exp64)
1137 { 1130 {
1138 uint8 s; 1131 uint8 s;
1139 1132
1140 for (s = 0; s < NUM_SKILLS; s++) 1133 for (s = 0; s < NUM_SKILLS; s++)
1150 SockList_AddInt64 (&sl, pl->last_skill_ob[s]->stats.exp); 1143 SockList_AddInt64 (&sl, pl->last_skill_ob[s]->stats.exp);
1151 pl->last_skill_exp[s] = pl->last_skill_ob[s]->stats.exp; 1144 pl->last_skill_exp[s] = pl->last_skill_ob[s]->stats.exp;
1152 } 1145 }
1153 } 1146 }
1154 } 1147 }
1148
1155 if (pl->socket.exp64) 1149 if (pl->socket.exp64)
1156 {
1157 AddIfInt64 (pl->last_stats.exp, pl->ob->stats.exp, CS_STAT_EXP64); 1150 { AddIfInt64 (pl->last_stats.exp, pl->ob->stats.exp, CS_STAT_EXP64) }
1158 }
1159 else 1151 else
1160 {
1161 AddIfInt (pl->last_stats.exp, (int) pl->ob->stats.exp, CS_STAT_EXP); 1152 { AddIfInt (pl->last_stats.exp, (int) pl->ob->stats.exp, CS_STAT_EXP) }
1162 } 1153
1163 AddIfShort (pl->last_level, (char) pl->ob->level, CS_STAT_LEVEL); 1154 AddIfShort (pl->last_level, (char) pl->ob->level, CS_STAT_LEVEL);
1164 AddIfShort (pl->last_stats.wc, pl->ob->stats.wc, CS_STAT_WC); 1155 AddIfShort (pl->last_stats.wc, pl->ob->stats.wc, CS_STAT_WC);
1165 AddIfShort (pl->last_stats.ac, pl->ob->stats.ac, CS_STAT_AC); 1156 AddIfShort (pl->last_stats.ac, pl->ob->stats.ac, CS_STAT_AC);
1166 AddIfShort (pl->last_stats.dam, pl->ob->stats.dam, CS_STAT_DAM); 1157 AddIfShort (pl->last_stats.dam, pl->ob->stats.dam, CS_STAT_DAM);
1167 AddIfFloat (pl->last_speed, pl->ob->speed, CS_STAT_SPEED); 1158 AddIfFloat (pl->last_speed, pl->ob->speed, CS_STAT_SPEED);
1168 AddIfShort (pl->last_stats.food, pl->ob->stats.food, CS_STAT_FOOD); 1159 AddIfShort (pl->last_stats.food, pl->ob->stats.food, CS_STAT_FOOD);
1169 AddIfFloat (pl->last_weapon_sp, pl->weapon_sp, CS_STAT_WEAP_SP); 1160 AddIfFloat (pl->last_weapon_sp, pl->weapon_sp, CS_STAT_WEAP_SP);
1170 AddIfInt (pl->last_weight_limit, (sint32) weight_limit[pl->ob->stats.Str], CS_STAT_WEIGHT_LIM); 1161 AddIfInt (pl->last_weight_limit, (sint32) weight_limit[pl->ob->stats.Str], CS_STAT_WEIGHT_LIM);
1171 flags = 0; 1162 flags = 0;
1163
1172 if (pl->fire_on) 1164 if (pl->fire_on)
1173 flags |= SF_FIREON; 1165 flags |= SF_FIREON;
1166
1174 if (pl->run_on) 1167 if (pl->run_on)
1175 flags |= SF_RUNON; 1168 flags |= SF_RUNON;
1176 1169
1177 AddIfShort (pl->last_flags, flags, CS_STAT_FLAGS); 1170 AddIfShort (pl->last_flags, flags, CS_STAT_FLAGS);
1171
1178 if (pl->socket.sc_version < 1025) 1172 if (pl->socket.sc_version < 1025)
1179 {
1180 AddIfShort (pl->last_resist[ATNR_PHYSICAL], pl->ob->resist[ATNR_PHYSICAL], CS_STAT_ARMOUR); 1173 { AddIfShort (pl->last_resist[ATNR_PHYSICAL], pl->ob->resist[ATNR_PHYSICAL], CS_STAT_ARMOUR) }
1181 }
1182 else 1174 else
1183 { 1175 {
1184 int i; 1176 int i;
1185 1177
1186 for (i = 0; i < NROFATTACKS; i++) 1178 for (i = 0; i < NROFATTACKS; i++)
1187 { 1179 {
1188 /* Skip ones we won't send */ 1180 /* Skip ones we won't send */
1189 if (atnr_cs_stat[i] == -1) 1181 if (atnr_cs_stat[i] == -1)
1190 continue; 1182 continue;
1183
1191 AddIfShort (pl->last_resist[i], pl->ob->resist[i], (char) atnr_cs_stat[i]); 1184 AddIfShort (pl->last_resist[i], pl->ob->resist[i], (char) atnr_cs_stat[i]);
1192 } 1185 }
1193 } 1186 }
1187
1194 if (pl->socket.monitor_spells) 1188 if (pl->socket.monitor_spells)
1195 { 1189 {
1196 AddIfInt (pl->last_path_attuned, pl->ob->path_attuned, CS_STAT_SPELL_ATTUNE); 1190 AddIfInt (pl->last_path_attuned, pl->ob->path_attuned, CS_STAT_SPELL_ATTUNE);
1197 AddIfInt (pl->last_path_repelled, pl->ob->path_repelled, CS_STAT_SPELL_REPEL); 1191 AddIfInt (pl->last_path_repelled, pl->ob->path_repelled, CS_STAT_SPELL_REPEL);
1198 AddIfInt (pl->last_path_denied, pl->ob->path_denied, CS_STAT_SPELL_DENY); 1192 AddIfInt (pl->last_path_denied, pl->ob->path_denied, CS_STAT_SPELL_DENY);
1199 } 1193 }
1194
1200 rangetostring (pl->ob, buf); /* we want use the new fire & run system in new client */ 1195 rangetostring (pl->ob, buf); /* we want use the new fire & run system in new client */
1201 AddIfString (pl->socket.stats.range, buf, CS_STAT_RANGE); 1196 AddIfString (pl->socket.stats.range, buf, CS_STAT_RANGE);
1202 set_title (pl->ob, buf); 1197 set_title (pl->ob, buf);
1203 AddIfString (pl->socket.stats.title, buf, CS_STAT_TITLE); 1198 AddIfString (pl->socket.stats.title, buf, CS_STAT_TITLE);
1204 1199
1208#ifdef ESRV_DEBUG 1203#ifdef ESRV_DEBUG
1209 LOG (llevDebug, "Sending stats command, %d bytes long.\n", sl.len); 1204 LOG (llevDebug, "Sending stats command, %d bytes long.\n", sl.len);
1210#endif 1205#endif
1211 Send_With_Handling (&pl->socket, &sl); 1206 Send_With_Handling (&pl->socket, &sl);
1212 } 1207 }
1208
1213 free (sl.buf); 1209 free (sl.buf);
1214} 1210}
1215
1216 1211
1217/** 1212/**
1218 * Tells the client that here is a player it should start using. 1213 * Tells the client that here is a player it should start using.
1219 */ 1214 */
1220void 1215void
1238 1233
1239 Send_With_Handling (&pl->socket, &sl); 1234 Send_With_Handling (&pl->socket, &sl);
1240 free (sl.buf); 1235 free (sl.buf);
1241 SET_FLAG (pl->ob, FLAG_CLIENT_SENT); 1236 SET_FLAG (pl->ob, FLAG_CLIENT_SENT);
1242} 1237}
1243
1244 1238
1245/** 1239/**
1246 * Need to send an animation sequence to the client. 1240 * Need to send an animation sequence to the client.
1247 * We will send appropriate face commands to the client if we haven't 1241 * We will send appropriate face commands to the client if we haven't
1248 * sent them the face yet (this can become quite costly in terms of 1242 * sent them the face yet (this can become quite costly in terms of
1458map_clearcell (struct MapCell *cell, int face0, int face1, int face2, int count) 1452map_clearcell (struct MapCell *cell, int face0, int face1, int face2, int count)
1459{ 1453{
1460 cell->faces[0] = face0; 1454 cell->faces[0] = face0;
1461 cell->faces[1] = face1; 1455 cell->faces[1] = face1;
1462 cell->faces[2] = face2; 1456 cell->faces[2] = face2;
1463 cell->count = count; 1457 cell->count = count;
1464 cell->stat_hp = 0; 1458 cell->stat_hp = 0;
1459 cell->flags = 0;
1465 cell->player = 0; 1460 cell->player = 0;
1466} 1461}
1467 1462
1468#define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y) 1463#define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y)
1469#define MAX_LAYERS 3 1464#define MAX_LAYERS 3
1470 1465
1866 strcpy ((char *) sl.buf, "map1 "); 1861 strcpy ((char *) sl.buf, "map1 ");
1867 else 1862 else
1868 strcpy ((char *) sl.buf, "map1a "); 1863 strcpy ((char *) sl.buf, "map1a ");
1869 sl.len = strlen ((char *) sl.buf); 1864 sl.len = strlen ((char *) sl.buf);
1870 startlen = sl.len; 1865 startlen = sl.len;
1866
1871 /*Extendedmapinfo structure initialisation */ 1867 /*Extendedmapinfo structure initialisation */
1872 if (socket.ext_mapinfos) 1868 if (socket.ext_mapinfos)
1873 { 1869 {
1874 esl.buf = (unsigned char *) malloc (MAXSOCKBUF); 1870 esl.buf = (unsigned char *) malloc (MAXSOCKBUF);
1875 strcpy ((char *) esl.buf, "mapextended "); 1871 strcpy ((char *) esl.buf, "mapextended ");
1876 esl.len = strlen ((char *) esl.buf); 1872 esl.len = strlen ((char *) esl.buf);
1877 extendedinfos = EMI_NOREDRAW; 1873 extendedinfos = EMI_NOREDRAW;
1874
1878 if (socket.EMI_smooth) 1875 if (socket.EMI_smooth)
1879 extendedinfos |= EMI_SMOOTH; 1876 extendedinfos |= EMI_SMOOTH;
1877
1880 ewhatstart = esl.len; 1878 ewhatstart = esl.len;
1881 ewhatflag = extendedinfos; /*The EMI_NOREDRAW bit 1879 ewhatflag = extendedinfos; /*The EMI_NOREDRAW bit
1882 could need to be taken away */ 1880 could need to be taken away */
1883 SockList_AddChar (&esl, extendedinfos); 1881 SockList_AddChar (&esl, extendedinfos);
1884 eentrysize = getExtendedMapInfoSize (&socket); 1882 eentrysize = getExtendedMapInfoSize (&socket);
1890 /* suppress compiler warnings */ 1888 /* suppress compiler warnings */
1891 ewhatstart = 0; 1889 ewhatstart = 0;
1892 ewhatflag = 0; 1890 ewhatflag = 0;
1893 estartlen = 0; 1891 estartlen = 0;
1894 } 1892 }
1893
1895 /* Init data to zero */ 1894 /* Init data to zero */
1896 memset (heads, 0, sizeof (object *) * MAX_HEAD_POS * MAX_HEAD_POS * MAX_LAYERS); 1895 memset (heads, 0, sizeof (object *) * MAX_HEAD_POS * MAX_HEAD_POS * MAX_LAYERS);
1897 1896
1898 /* x,y are the real map locations. ax, ay are viewport relative 1897 /* x,y are the real map locations. ax, ay are viewport relative
1899 * locations. 1898 * locations.
1903 /* We could do this logic as conditionals in the if statement, 1902 /* We could do this logic as conditionals in the if statement,
1904 * but that started to get a bit messy to look at. 1903 * but that started to get a bit messy to look at.
1905 */ 1904 */
1906 max_x = pl->x + (socket.mapx + 1) / 2; 1905 max_x = pl->x + (socket.mapx + 1) / 2;
1907 max_y = pl->y + (socket.mapy + 1) / 2; 1906 max_y = pl->y + (socket.mapy + 1) / 2;
1907
1908 if (socket.mapmode == Map1aCmd) 1908 if (socket.mapmode == Map1aCmd)
1909 { 1909 {
1910 max_x += MAX_HEAD_OFFSET; 1910 max_x += MAX_HEAD_OFFSET;
1911 max_y += MAX_HEAD_OFFSET; 1911 max_y += MAX_HEAD_OFFSET;
1912 } 1912 }
1945 * with no faces tells the client to blank out the 1945 * with no faces tells the client to blank out the
1946 * space. 1946 * space.
1947 */ 1947 */
1948 got_one = 0; 1948 got_one = 0;
1949 for (i = oldlen + 2; i < sl.len; i++) 1949 for (i = oldlen + 2; i < sl.len; i++)
1950 {
1951 if (sl.buf[i]) 1950 if (sl.buf[i])
1952 got_one = 1; 1951 got_one = 1;
1953 }
1954 1952
1955 if (got_one && (mask & 0xf)) 1953 if (got_one && (mask & 0xf))
1956 {
1957 sl.buf[oldlen + 1] = mask & 0xff; 1954 sl.buf[oldlen + 1] = mask & 0xff;
1958 }
1959 else 1955 else
1960 { /*either all faces blank, either no face at all */ 1956 { /*either all faces blank, either no face at all */
1961 if (mask & 0xf) /*at least 1 face, we know it's blank, only send coordinates */ 1957 if (mask & 0xf) /*at least 1 face, we know it's blank, only send coordinates */
1962 sl.len = oldlen + 2; 1958 sl.len = oldlen + 2;
1963 else 1959 else
1964 sl.len = oldlen; 1960 sl.len = oldlen;
1965 } 1961 }
1962
1966 /*What concerns extendinfos, nothing to be done for now 1963 /*What concerns extendinfos, nothing to be done for now
1967 * (perhaps effects layer later) 1964 * (perhaps effects layer later)
1968 */ 1965 */
1969 continue; /* don't do processing below */ 1966 continue; /* don't do processing below */
1970 } 1967 }
1971 1968
1972 MapCell & lastcell = socket.lastmap.cells[ax][ay]; 1969 MapCell &lastcell = socket.lastmap.cells[ax][ay];
1973 1970
1974 d = pl->contr->blocked_los[ax][ay]; 1971 d = pl->contr->blocked_los[ax][ay];
1975 1972
1976 /* If the coordinates are not valid, or it is too dark to see, 1973 /* If the coordinates are not valid, or it is too dark to see,
1977 * we tell the client as such 1974 * we tell the client as such
1978 */ 1975 */
1979 nx = x; 1976 nx = x;
1980 ny = y; 1977 ny = y;
1981 m = get_map_from_coord (pl->map, &nx, &ny); 1978 m = get_map_from_coord (pl->map, &nx, &ny);
1979
1982 if (!m) 1980 if (!m)
1983 { 1981 {
1984 /* space is out of map. Update space and clear values 1982 /* space is out of map. Update space and clear values
1985 * if this hasn't already been done. If the space is out 1983 * if this hasn't already been done. If the space is out
1986 * of the map, it shouldn't have a head 1984 * of the map, it shouldn't have a head
2000 */ 1998 */
2001 1999
2002 oldlen = sl.len; 2000 oldlen = sl.len;
2003 2001
2004 SockList_AddShort (&sl, mask); 2002 SockList_AddShort (&sl, mask);
2003
2005 if (lastcell.count != -1) 2004 if (lastcell.count != -1)
2006 need_send = 1; 2005 need_send = 1;
2006
2007 count = -1; 2007 count = -1;
2008 2008
2009 if (socket.mapmode == Map1aCmd && have_head (ax, ay)) 2009 if (socket.mapmode == Map1aCmd && have_head (ax, ay))
2010 { 2010 {
2011 /* Now check to see if any heads need to be sent */ 2011 /* Now check to see if any heads need to be sent */
2016 mask |= 0x2; 2016 mask |= 0x2;
2017 if (check_head (sl, socket, ax, ay, 0)) 2017 if (check_head (sl, socket, ax, ay, 0))
2018 mask |= 0x1; 2018 mask |= 0x1;
2019 2019
2020 lastcell.count = count; 2020 lastcell.count = count;
2021
2022 } 2021 }
2023 else 2022 else
2024 { 2023 {
2025 struct MapCell *cell = &lastcell;
2026
2027 /* properly clear a previously sent big face */ 2024 /* properly clear a previously sent big face */
2028 if (cell->faces[0] != 0 || cell->faces[1] != 0 || cell->faces[2] != 0) 2025 if (lastcell.faces[0] != 0 || lastcell.faces[1] != 0 || lastcell.faces[2] != 0
2026 || lastcell.stat_hp || lastcell.flags || lastcell.player)
2029 need_send = 1; 2027 need_send = 1;
2028
2030 map_clearcell (&lastcell, 0, 0, 0, count); 2029 map_clearcell (&lastcell, 0, 0, 0, count);
2031 } 2030 }
2032 2031
2033 if ((mask & 0xf) || need_send) 2032 if ((mask & 0xf) || need_send)
2034 {
2035 sl.buf[oldlen + 1] = mask & 0xff; 2033 sl.buf[oldlen + 1] = mask & 0xff;
2036 }
2037 else 2034 else
2038 {
2039 sl.len = oldlen; 2035 sl.len = oldlen;
2040 }
2041 } 2036 }
2042 else 2037 else
2043 { 2038 {
2044 /* In this block, the space is visible or there are head objects 2039 /* In this block, the space is visible or there are head objects
2045 * we need to send. 2040 * we need to send.
2086 2081
2087 if (socket.extmap) 2082 if (socket.extmap)
2088 { 2083 {
2089 uint8 stat_hp = 0; 2084 uint8 stat_hp = 0;
2090 uint8 stat_width = 0; 2085 uint8 stat_width = 0;
2086 uint8 flags = 0;
2091 tag_t player = 0; 2087 tag_t player = 0;
2092 2088
2093 // send hp information, if applicable 2089 // send hp information, if applicable
2094 if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0)) 2090 if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0))
2095 { 2091 {
2103 stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; 2099 stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp;
2104 stat_width = op->arch->tail_x; 2100 stat_width = op->arch->tail_x;
2105 } 2101 }
2106 } 2102 }
2107 2103
2104 if (op->msg && op->msg[0] == '@')
2105 flags |= 1;
2106
2108 if (op->type == PLAYER && op != pl) 2107 if (op->type == PLAYER && op != pl)
2109 player = op->count; 2108 player = op->count;
2110 } 2109 }
2111 2110
2112 if (lastcell.stat_hp != stat_hp) 2111 if (lastcell.stat_hp != stat_hp)
2137 last_ext = sl.buf + sl.len; 2136 last_ext = sl.buf + sl.len;
2138 SockList_AddChar (&sl, 0x47); 2137 SockList_AddChar (&sl, 0x47);
2139 SockList_AddChar (&sl, 4); 2138 SockList_AddChar (&sl, 4);
2140 SockList_AddInt (&sl, player); 2139 SockList_AddInt (&sl, player);
2141 } 2140 }
2141
2142 if (lastcell.flags != flags)
2143 {
2144 lastcell.flags = flags;
2145
2146 mask |= 0x8;
2147 *last_ext |= 0x80;
2148 last_ext = sl.buf + sl.len;
2149 SockList_AddChar (&sl, 8);
2150 SockList_AddChar (&sl, flags);
2151 }
2142 } 2152 }
2143 2153
2144 /* Floor face */ 2154 /* Floor face */
2145 if (update_space (&sl, &socket, m, nx, ny, ax, ay, 2)) 2155 if (update_space (&sl, &socket, m, nx, ny, ax, ay, 2))
2146 mask |= 0x4; 2156 mask |= 0x4;
2161 { 2171 {
2162 if (lastcell.faces[0] != pl->face->number) 2172 if (lastcell.faces[0] != pl->face->number)
2163 { 2173 {
2164 lastcell.faces[0] = pl->face->number; 2174 lastcell.faces[0] = pl->face->number;
2165 mask |= 0x1; 2175 mask |= 0x1;
2176
2166 if (!(socket.faces_sent[pl->face->number] & NS_FACESENT_FACE)) 2177 if (!(socket.faces_sent[pl->face->number] & NS_FACESENT_FACE))
2167 esrv_send_face (&socket, pl->face->number, 0); 2178 esrv_send_face (&socket, pl->face->number, 0);
2179
2168 SockList_AddShort (&sl, pl->face->number); 2180 SockList_AddShort (&sl, pl->face->number);
2169 } 2181 }
2170 } 2182 }
2171 /* Top face */
2172 else 2183 else
2173 { 2184 {
2185 /* Top face */
2174 if (update_space (&sl, &socket, m, nx, ny, ax, ay, 0)) 2186 if (update_space (&sl, &socket, m, nx, ny, ax, ay, 0))
2175 mask |= 0x1; 2187 mask |= 0x1;
2188
2176 if (socket.EMI_smooth) 2189 if (socket.EMI_smooth)
2177 if (update_smooth (&esl, &socket, m, nx, ny, ax, ay, 0)) 2190 if (update_smooth (&esl, &socket, m, nx, ny, ax, ay, 0))
2178 {
2179 emask |= 0x1; 2191 emask |= 0x1;
2180 }
2181 } 2192 }
2193
2182 /* Check to see if we are in fact sending anything for this 2194 /* Check to see if we are in fact sending anything for this
2183 * space by checking the mask. If so, update the mask. 2195 * space by checking the mask. If so, update the mask.
2184 * if not, reset the len to that from before adding the mask 2196 * if not, reset the len to that from before adding the mask
2185 * value, so we don't send those bits. 2197 * value, so we don't send those bits.
2186 */ 2198 */
2187 if (mask & 0xf) 2199 if (mask & 0xf)
2188 {
2189 sl.buf[oldlen + 1] = mask & 0xff; 2200 sl.buf[oldlen + 1] = mask & 0xff;
2190 }
2191 else 2201 else
2192 {
2193 sl.len = oldlen; 2202 sl.len = oldlen;
2194 } 2203
2195 if (emask & 0xf) 2204 if (emask & 0xf)
2196 {
2197 esl.buf[eoldlen + 1] = emask & 0xff; 2205 esl.buf[eoldlen + 1] = emask & 0xff;
2198 }
2199 else 2206 else
2200 {
2201 esl.len = eoldlen; 2207 esl.len = eoldlen;
2202 }
2203 } /* else this is a viewable space */ 2208 } /* else this is a viewable space */
2204 } /* for x loop */ 2209 } /* for x loop */
2205 } /* for y loop */ 2210 } /* for y loop */
2206 2211
2207 /* Verify that we in fact do need to send this */ 2212 /* Verify that we in fact do need to send this */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines