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.7 by root, Mon Aug 21 07:13:32 2006 UTC vs.
Revision 1.10 by root, Fri Aug 25 17:11:54 2006 UTC

1/* 1/*
2 * static char *rcsid_init_c = 2 * static char *rcsid_init_c =
3 * "$Id: request.C,v 1.7 2006/08/21 07:13:32 root Exp $"; 3 * "$Id: request.C,v 1.10 2006/08/25 17:11:54 root Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
233 socket.current_y = ob->y; 233 socket.current_y = ob->y;
234} 234}
235 235
236void ExtCmd (char *buf, int len, player *pl) 236void ExtCmd (char *buf, int len, player *pl)
237{ 237{
238 execute_global_event (EVENT_EXTCMD, pl, buf, len); 238 INVOKE_PLAYER (EXTCMD, pl, ARG_DATA (buf, len));
239} 239}
240 240
241void MapInfoCmd (char *buf, int len, player *pl) 241void MapInfoCmd (char *buf, int len, player *pl)
242{ 242{
243 // <mapinfo tag spatial tile-path 243 // <mapinfo tag spatial tile-path
1292 cell->faces[0] = face0; 1292 cell->faces[0] = face0;
1293 cell->faces[1] = face1; 1293 cell->faces[1] = face1;
1294 cell->faces[2] = face2; 1294 cell->faces[2] = face2;
1295 cell->count = count; 1295 cell->count = count;
1296 cell->stat_hp = 0; 1296 cell->stat_hp = 0;
1297 cell->player = 0;
1297} 1298}
1298 1299
1299#define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y) 1300#define MAX_HEAD_POS MAX(MAX_CLIENT_X, MAX_CLIENT_Y)
1300#define MAX_LAYERS 3 1301#define MAX_LAYERS 3
1301 1302
1847 1848
1848 lastcell.count = d; 1849 lastcell.count = d;
1849 1850
1850 if (socket.extmap) 1851 if (socket.extmap)
1851 { 1852 {
1852 uint8 stat_hp = 0; 1853 uint8 stat_hp = 0;
1853 uint8 stat_width = 0; 1854 uint8 stat_width = 0;
1855 tag_t player = 0;
1854 1856
1855 // send hp information, if applicable 1857 // send hp information, if applicable
1856 if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0)) 1858 if (object *op = GET_MAP_FACE_OBJ (m, nx, ny, 0))
1859 {
1857 if (!op->head 1860 if (op->head || op->invisible)
1858 && op->stats.maxhp > 0 1861 ; // do not show
1859 && (unsigned)op->stats.maxhp > (unsigned)op->stats.hp 1862 else if (op->type == PLAYER
1860 && IS_LIVE (op)) 1863 || QUERY_FLAG (op, FLAG_MONSTER)
1864 || QUERY_FLAG (op, FLAG_ALIVE)
1865 || QUERY_FLAG (op, FLAG_GENERATOR))
1861 { 1866 {
1867 if (op->stats.maxhp > 0
1868 && (unsigned)op->stats.maxhp > (unsigned)op->stats.hp)
1869 {
1862 stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp; 1870 stat_hp = 255 - (op->stats.hp * 255 + 254) / op->stats.maxhp;
1863 stat_width = op->arch->tail_x; 1871 stat_width = op->arch->tail_x;
1872 }
1864 } 1873 }
1865 1874
1875 if (op->type == PLAYER && op != pl)
1876 player = op->count;
1877 }
1878
1866 if (lastcell.stat_hp != stat_hp) 1879 if (lastcell.stat_hp != stat_hp && 0)
1867 { 1880 {
1868 lastcell.stat_hp = stat_hp; 1881 lastcell.stat_hp = stat_hp;
1869 1882
1870 mask |= 0x8; 1883 mask |= 0x8;
1871 *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 5); 1884 *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 5);
1874 if (stat_width > 1) 1887 if (stat_width > 1)
1875 { 1888 {
1876 *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 6); 1889 *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 6);
1877 SockList_AddChar (&sl, stat_width); 1890 SockList_AddChar (&sl, stat_width);
1878 } 1891 }
1892 }
1893
1894 if (lastcell.player != player && 0)
1895 {
1896 lastcell.player = player;
1897 mask |= 0x8;
1898 *last_ext |= 0x80; last_ext = sl.buf + sl.len; SockList_AddChar (&sl, 0x47);
1899 SockList_AddChar (&sl, 4);
1900 SockList_AddInt (&sl, player);
1879 } 1901 }
1880 } 1902 }
1881 1903
1882 /* Floor face */ 1904 /* Floor face */
1883 if (update_space(&sl, &socket, m, nx, ny, ax, ay, 2)) 1905 if (update_space(&sl, &socket, m, nx, ny, ax, ay, 2))

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines