1 | /* |
1 | /* |
2 | * static char *rcsid_init_c = |
2 | * static char *rcsid_init_c = |
3 | * "$Id: request.c,v 1.8 2006/05/01 12:22:03 root Exp $"; |
3 | * "$Id: request.c,v 1.10 2006/06/19 10:15:44 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 | |
… | |
… | |
137 | else |
137 | else |
138 | snprintf (buf, MAX_BUF, "mapinfo current"); |
138 | snprintf (buf, MAX_BUF, "mapinfo current"); |
139 | |
139 | |
140 | Write_String_To_Socket (&pl->socket, buf, strlen (buf)); |
140 | Write_String_To_Socket (&pl->socket, buf, strlen (buf)); |
141 | } |
141 | } |
|
|
142 | } |
|
|
143 | |
|
|
144 | void ExtCmd (char *buf, int len, player *pl) |
|
|
145 | { |
|
|
146 | execute_global_event (EVENT_EXTCMD, pl, buf, len); |
142 | } |
147 | } |
143 | |
148 | |
144 | void MapInfoCmd (char *buf, int len, player *pl) |
149 | void MapInfoCmd (char *buf, int len, player *pl) |
145 | { |
150 | { |
146 | // <mapinfo tag spatial tile-path |
151 | // <mapinfo tag spatial tile-path |
… | |
… | |
284 | // } else if (!strcmp(cmd,"plugincmd")) { |
289 | // } else if (!strcmp(cmd,"plugincmd")) { |
285 | // ns->plugincmd = atoi(param); |
290 | // ns->plugincmd = atoi(param); |
286 | // safe_strcat(cmdback, param, &slen, HUGE_BUF); |
291 | // safe_strcat(cmdback, param, &slen, HUGE_BUF); |
287 | } else if (!strcmp(cmd,"mapinfocmd")) { |
292 | } else if (!strcmp(cmd,"mapinfocmd")) { |
288 | ns->mapinfocmd = atoi(param); |
293 | ns->mapinfocmd = atoi(param); |
289 | safe_strcat(cmdback, param, &slen, HUGE_BUF); |
294 | safe_strcat(cmdback, "1", &slen, HUGE_BUF); |
|
|
295 | } else if (!strcmp(cmd,"extcmd")) { |
|
|
296 | ns->extcmd = atoi(param); |
|
|
297 | safe_strcat(cmdback, "1", &slen, HUGE_BUF); |
290 | } else if (!strcmp(cmd,"facecache")) { |
298 | } else if (!strcmp(cmd,"facecache")) { |
291 | ns->facecache = atoi(param); |
299 | ns->facecache = atoi(param); |
292 | safe_strcat(cmdback, param, &slen, HUGE_BUF); |
300 | safe_strcat(cmdback, param, &slen, HUGE_BUF); |
293 | } else if (!strcmp(cmd,"faceset")) { |
301 | } else if (!strcmp(cmd,"faceset")) { |
294 | char tmpbuf[20]; |
302 | char tmpbuf[20]; |
… | |
… | |
1603 | |
1611 | |
1604 | for(y=pl->y-pl->contr->socket.mapy/2; y<max_y; y++,ay++) { |
1612 | for(y=pl->y-pl->contr->socket.mapy/2; y<max_y; y++,ay++) { |
1605 | ax=0; |
1613 | ax=0; |
1606 | for(x=pl->x-pl->contr->socket.mapx/2;x<max_x;x++,ax++) { |
1614 | for(x=pl->x-pl->contr->socket.mapx/2;x<max_x;x++,ax++) { |
1607 | |
1615 | |
1608 | mask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4; |
|
|
1609 | emask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4; |
1616 | emask = mask = (ax & 0x3f) << 10 | (ay & 0x3f) << 4; |
1610 | |
1617 | |
1611 | /* If this space is out of the normal viewable area, we only check |
1618 | /* If this space is out of the normal viewable area, we only check |
1612 | * the heads value ax or ay will only be greater than what |
1619 | * the heads value ax or ay will only be greater than what |
1613 | * the client wants if using the map1a command - this is because |
1620 | * the client wants if using the map1a command - this is because |
1614 | * if the map1a command is not used, max_x and max_y will be |
1621 | * if the map1a command is not used, max_x and max_y will be |