… | |
… | |
46 | */ |
46 | */ |
47 | |
47 | |
48 | #include <global.h> |
48 | #include <global.h> |
49 | #include <sproto.h> |
49 | #include <sproto.h> |
50 | |
50 | |
51 | #include <newclient.h> |
|
|
52 | #include <newserver.h> |
|
|
53 | #include <living.h> |
51 | #include <living.h> |
54 | #include <commands.h> |
52 | #include <commands.h> |
55 | |
53 | |
56 | /* This block is basically taken from socket.c - I assume if it works there, |
54 | /* This block is basically taken from socket.c - I assume if it works there, |
57 | * it should work here. |
55 | * it should work here. |
… | |
… | |
60 | #include <sys/time.h> |
58 | #include <sys/time.h> |
61 | #include <sys/socket.h> |
59 | #include <sys/socket.h> |
62 | #include <netinet/in.h> |
60 | #include <netinet/in.h> |
63 | #include <netdb.h> |
61 | #include <netdb.h> |
64 | |
62 | |
65 | #ifdef HAVE_UNISTD_H |
|
|
66 | # include <unistd.h> |
63 | #include <unistd.h> |
67 | #endif |
|
|
68 | |
|
|
69 | #ifdef HAVE_SYS_TIME_H |
|
|
70 | # include <sys/time.h> |
64 | #include <sys/time.h> |
71 | #endif |
|
|
72 | |
65 | |
73 | #include "sounds.h" |
66 | #include "sounds.h" |
74 | |
67 | |
75 | /** |
68 | /** |
76 | * This table translates the attack numbers as used within the |
69 | * This table translates the attack numbers as used within the |
… | |
… | |
93 | -1, /* life stealing */ |
86 | -1, /* life stealing */ |
94 | -1 /* Disease - not fully done yet */ |
87 | -1 /* Disease - not fully done yet */ |
95 | }; |
88 | }; |
96 | |
89 | |
97 | static void |
90 | static void |
98 | socket_map_scroll (client_socket * ns, int dx, int dy) |
91 | socket_map_scroll (client *ns, int dx, int dy) |
99 | { |
92 | { |
100 | struct Map newmap; |
93 | struct Map newmap; |
101 | int x, y, mx, my; |
94 | int x, y, mx, my; |
102 | |
95 | |
103 | { |
|
|
104 | packet sl; |
|
|
105 | |
|
|
106 | sl.printf ("map_scroll %d %d", dx, dy); |
96 | ns->send_packet_printf ("map_scroll %d %d", dx, dy); |
107 | ns->send_packet (sl); |
|
|
108 | } |
|
|
109 | |
97 | |
110 | /* If we are using the Map1aCmd, we may in fact send |
98 | /* If we are using the Map1aCmd, we may in fact send |
111 | * head information that is outside the viewable map. |
99 | * head information that is outside the viewable map. |
112 | * So set the mx,my to the max value we want to |
100 | * So set the mx,my to the max value we want to |
113 | * look for. Removed code to do so - it caused extra |
101 | * look for. Removed code to do so - it caused extra |
… | |
… | |
153 | } |
141 | } |
154 | |
142 | |
155 | static void |
143 | static void |
156 | clear_map (player *pl) |
144 | clear_map (player *pl) |
157 | { |
145 | { |
158 | client_socket &socket = *pl->socket; |
146 | client &socket = *pl->socket; |
159 | |
147 | |
160 | memset (&socket.lastmap, 0, sizeof (socket.lastmap)); |
148 | memset (&socket.lastmap, 0, sizeof (socket.lastmap)); |
161 | |
149 | |
162 | if (socket.newmapcmd == 1) |
150 | if (socket.newmapcmd == 1) |
163 | socket.send_packet ("newmap"); |
151 | socket.send_packet ("newmap"); |
… | |
… | |
168 | |
156 | |
169 | /** check for map change and send new map data */ |
157 | /** check for map change and send new map data */ |
170 | static void |
158 | static void |
171 | check_map_change (player *pl) |
159 | check_map_change (player *pl) |
172 | { |
160 | { |
173 | client_socket &socket = *pl->socket; |
161 | client &socket = *pl->socket; |
174 | object *ob = pl->ob; |
162 | object *ob = pl->ob; |
175 | char buf[MAX_BUF]; /* eauugggh */ |
163 | char buf[MAX_BUF]; /* eauugggh */ |
176 | |
164 | |
177 | if (socket.current_map != ob->map) |
165 | if (socket.current_map != ob->map) |
178 | { |
166 | { |
… | |
… | |
219 | } |
207 | } |
220 | } |
208 | } |
221 | |
209 | |
222 | socket.current_x = ob->x; |
210 | socket.current_x = ob->x; |
223 | socket.current_y = ob->y; |
211 | socket.current_y = ob->y; |
|
|
212 | } |
|
|
213 | |
|
|
214 | /** |
|
|
215 | * RequestInfo is sort of a meta command. There is some specific |
|
|
216 | * request of information, but we call other functions to provide |
|
|
217 | * that information. |
|
|
218 | */ |
|
|
219 | void |
|
|
220 | RequestInfo (char *buf, int len, client * ns) |
|
|
221 | { |
|
|
222 | char *params = NULL, *cp; |
|
|
223 | |
|
|
224 | /* No match */ |
|
|
225 | char bigbuf[MAX_BUF]; |
|
|
226 | int slen; |
|
|
227 | |
|
|
228 | /* Set up replyinfo before we modify any of the buffers - this is used |
|
|
229 | * if we don't find a match. |
|
|
230 | */ |
|
|
231 | strcpy (bigbuf, "replyinfo "); |
|
|
232 | slen = strlen (bigbuf); |
|
|
233 | safe_strcat (bigbuf, buf, &slen, MAX_BUF); |
|
|
234 | |
|
|
235 | /* find the first space, make it null, and update the |
|
|
236 | * params pointer. |
|
|
237 | */ |
|
|
238 | for (cp = buf; *cp != '\0'; cp++) |
|
|
239 | if (*cp == ' ') |
|
|
240 | { |
|
|
241 | *cp = '\0'; |
|
|
242 | params = cp + 1; |
|
|
243 | break; |
|
|
244 | } |
|
|
245 | |
|
|
246 | if (!strcmp (buf, "image_info")) |
|
|
247 | send_image_info (ns, params); |
|
|
248 | else if (!strcmp (buf, "image_sums")) |
|
|
249 | send_image_sums (ns, params); |
|
|
250 | else if (!strcmp (buf, "skill_info")) |
|
|
251 | send_skill_info (ns, params); |
|
|
252 | else if (!strcmp (buf, "spell_paths")) |
|
|
253 | send_spell_paths (ns, params); |
|
|
254 | else |
|
|
255 | ns->send_packet (bigbuf, len); |
224 | } |
256 | } |
225 | |
257 | |
226 | void |
258 | void |
227 | ExtCmd (char *buf, int len, player *pl) |
259 | ExtCmd (char *buf, int len, player *pl) |
228 | { |
260 | { |
… | |
… | |
316 | pl->socket->send_packet (bigbuf); |
348 | pl->socket->send_packet (bigbuf); |
317 | } |
349 | } |
318 | |
350 | |
319 | /** This is the Setup cmd - easy first implementation */ |
351 | /** This is the Setup cmd - easy first implementation */ |
320 | void |
352 | void |
321 | SetUp (char *buf, int len, client_socket * ns) |
353 | SetUp (char *buf, int len, client * ns) |
322 | { |
354 | { |
323 | int s, slen; |
355 | int s, slen; |
324 | char *cmd, *param, cmdback[HUGE_BUF]; |
356 | char *cmd, *param, cmdback[HUGE_BUF]; |
325 | |
357 | |
326 | /* run through the cmds of setup |
358 | /* run through the cmds of setup |
… | |
… | |
536 | * This is what takes care of it. We tell the client how things worked out. |
568 | * This is what takes care of it. We tell the client how things worked out. |
537 | * I am not sure if this file is the best place for this function. however, |
569 | * I am not sure if this file is the best place for this function. however, |
538 | * it either has to be here or init_sockets needs to be exported. |
570 | * it either has to be here or init_sockets needs to be exported. |
539 | */ |
571 | */ |
540 | void |
572 | void |
541 | AddMeCmd (char *buf, int len, client_socket * ns) |
573 | AddMeCmd (char *buf, int len, client * ns) |
542 | { |
574 | { |
543 | Settings oldsettings; |
|
|
544 | |
|
|
545 | oldsettings = settings; |
|
|
546 | if (ns->status != Ns_Add || add_player (ns)) |
575 | if (ns->status != Ns_Add || add_player (ns)) |
547 | ns->send_packet ("addme_failed"); |
576 | ns->send_packet ("addme_failed"); |
548 | else |
577 | else |
549 | ns->send_packet ("addme_success"); |
578 | ns->send_packet ("addme_success"); |
550 | |
|
|
551 | settings = oldsettings; |
|
|
552 | } |
579 | } |
553 | |
580 | |
554 | /** Reply to ExtendedInfos command */ |
581 | /** Reply to ExtendedInfos command */ |
555 | void |
582 | void |
556 | ToggleExtendedInfos (char *buf, int len, client_socket * ns) |
583 | ToggleExtendedInfos (char *buf, int len, client * ns) |
557 | { |
584 | { |
558 | char cmdback[MAX_BUF]; |
585 | char cmdback[MAX_BUF]; |
559 | char command[50]; |
586 | char command[50]; |
560 | int info, nextinfo; |
587 | int info, nextinfo; |
561 | |
588 | |
… | |
… | |
612 | #define MSG_TYPE_MONUMENT 5 |
639 | #define MSG_TYPE_MONUMENT 5 |
613 | #define MSG_TYPE_SCRIPTED_DIALOG 6*/ |
640 | #define MSG_TYPE_SCRIPTED_DIALOG 6*/ |
614 | |
641 | |
615 | /** Reply to ExtendedInfos command */ |
642 | /** Reply to ExtendedInfos command */ |
616 | void |
643 | void |
617 | ToggleExtendedText (char *buf, int len, client_socket * ns) |
644 | ToggleExtendedText (char *buf, int len, client * ns) |
618 | { |
645 | { |
619 | char cmdback[MAX_BUF]; |
646 | char cmdback[MAX_BUF]; |
620 | char temp[10]; |
647 | char temp[10]; |
621 | char command[50]; |
648 | char command[50]; |
622 | int info, nextinfo, i, flag; |
649 | int info, nextinfo, i, flag; |
… | |
… | |
673 | * a piece of data from us that we know the client wants. So |
700 | * a piece of data from us that we know the client wants. So |
674 | * if we know the client wants it, might as well push it to the |
701 | * if we know the client wants it, might as well push it to the |
675 | * client. |
702 | * client. |
676 | */ |
703 | */ |
677 | static void |
704 | static void |
678 | SendSmooth (client_socket * ns, uint16 face) |
705 | SendSmooth (client * ns, uint16 face) |
679 | { |
706 | { |
680 | uint16 smoothface; |
707 | uint16 smoothface; |
681 | |
708 | |
682 | /* If we can't find a face, return and set it so we won't try to send this |
709 | /* If we can't find a face, return and set it so we won't try to send this |
683 | * again. |
710 | * again. |
… | |
… | |
707 | /** |
734 | /** |
708 | * Tells client the picture it has to use |
735 | * Tells client the picture it has to use |
709 | * to smooth a picture number given as argument. |
736 | * to smooth a picture number given as argument. |
710 | */ |
737 | */ |
711 | void |
738 | void |
712 | AskSmooth (char *buf, int len, client_socket * ns) |
739 | AskSmooth (char *buf, int len, client * ns) |
713 | { |
740 | { |
714 | uint16 facenbr; |
741 | uint16 facenbr; |
715 | |
742 | |
716 | facenbr = atoi (buf); |
743 | facenbr = atoi (buf); |
717 | SendSmooth (ns, facenbr); |
744 | SendSmooth (ns, facenbr); |
… | |
… | |
774 | * etc.). It is a lot like PlayerCmd above, but is called with the |
801 | * etc.). It is a lot like PlayerCmd above, but is called with the |
775 | * 'ncom' method which gives more information back to the client so it |
802 | * 'ncom' method which gives more information back to the client so it |
776 | * can throttle. |
803 | * can throttle. |
777 | */ |
804 | */ |
778 | void |
805 | void |
779 | NewPlayerCmd (uint8 * buf, int len, player *pl) |
806 | NewPlayerCmd (char *buf, int len, player *pl) |
780 | { |
807 | { |
781 | int time, repeat; |
808 | int time, repeat; |
782 | char command[MAX_BUF]; |
809 | char command[MAX_BUF]; |
783 | int pktlen; |
810 | int pktlen; |
784 | |
811 | |
… | |
… | |
786 | { |
813 | { |
787 | LOG (llevDebug, "Corrupt ncom command <%s> not long enough - discarding\n", buf); |
814 | LOG (llevDebug, "Corrupt ncom command <%s> not long enough - discarding\n", buf); |
788 | return; |
815 | return; |
789 | } |
816 | } |
790 | |
817 | |
791 | pktlen = net_uint16 (buf); |
818 | pktlen = net_uint16 ((uint8 *)buf); |
792 | repeat = net_uint32 (buf + 2); |
819 | repeat = net_uint32 ((uint8 *)buf + 2); |
793 | |
820 | |
794 | /* -1 is special - no repeat, but don't update */ |
821 | /* -1 is special - no repeat, but don't update */ |
795 | if (repeat != -1) |
822 | if (repeat != -1) |
796 | pl->count = repeat; |
823 | pl->count = repeat; |
797 | |
824 | |
798 | if ((len - 4) >= MAX_BUF) |
825 | if ((len - 4) >= MAX_BUF) |
799 | len = MAX_BUF - 5; |
826 | len = MAX_BUF - 5; |
800 | |
827 | |
801 | strncpy ((char *) command, (char *) buf + 6, len - 4); |
828 | strncpy ((char *) command, (char *) buf + 6, len - 4); |
802 | command[len - 4] = '\0'; |
829 | command[len - 4] = 0; |
803 | |
|
|
804 | /* The following should never happen with a proper or honest client. |
|
|
805 | * Therefore, the error message doesn't have to be too clear - if |
|
|
806 | * someone is playing with a hacked/non working client, this gives them |
|
|
807 | * an idea of the problem, but they deserve what they get |
|
|
808 | */ |
|
|
809 | if (pl->state != ST_PLAYING) |
|
|
810 | { |
|
|
811 | new_draw_info_format (NDI_UNIQUE, 0, pl->ob, "You can not issue commands - state is not ST_PLAYING (%s)", buf); |
|
|
812 | return; |
|
|
813 | } |
|
|
814 | |
830 | |
815 | /* This should not happen anymore. */ |
831 | /* This should not happen anymore. */ |
816 | if (pl->ob->speed_left < -1.0) |
832 | if (pl->ob->speed_left < -1.0) |
817 | LOG (llevError, "Player has negative time - shouldn't do command.\n"); |
833 | LOG (llevError, "Player has negative time - shouldn't do command.\n"); |
818 | |
834 | |
… | |
… | |
909 | * something older than the server. If we assume the client will be |
925 | * something older than the server. If we assume the client will be |
910 | * backwards compatible, having it be a later version should not be a |
926 | * backwards compatible, having it be a later version should not be a |
911 | * problem. |
927 | * problem. |
912 | */ |
928 | */ |
913 | void |
929 | void |
914 | VersionCmd (char *buf, int len, client_socket * ns) |
930 | VersionCmd (char *buf, int len, client * ns) |
915 | { |
931 | { |
916 | char *cp; |
932 | char *cp; |
917 | char version_warning[256]; |
933 | char version_warning[256]; |
918 | |
934 | |
919 | if (!buf) |
935 | if (!buf) |
… | |
… | |
943 | cp = strchr (cp + 1, ' '); |
959 | cp = strchr (cp + 1, ' '); |
944 | if (cp) |
960 | if (cp) |
945 | { |
961 | { |
946 | LOG (llevDebug, "CS: connection from client of type <%s>, ip %s\n", cp, ns->host); |
962 | LOG (llevDebug, "CS: connection from client of type <%s>, ip %s\n", cp, ns->host); |
947 | |
963 | |
948 | snprintf (ns->client, sizeof (ns->client), "%s", cp + 1); |
964 | assign (ns->version, cp + 1); |
949 | |
965 | |
950 | /* This is first implementation - i skip all beta DX clients with it |
|
|
951 | * Add later stuff here for other clients |
|
|
952 | */ |
|
|
953 | |
|
|
954 | /* these are old dxclients */ |
|
|
955 | /* Version 1024 added support for singular + plural name values - |
|
|
956 | * requiing this minimal value reduces complexity of that code, and it |
|
|
957 | * has been around for a long time. |
|
|
958 | */ |
|
|
959 | if (ns->sc_version < 1026) |
966 | if (ns->sc_version < 1026) |
960 | { |
967 | { |
961 | sprintf (version_warning, "drawinfo %d %s", NDI_RED, |
968 | sprintf (version_warning, "drawinfo %d %s", NDI_RED, |
962 | "**** VERSION WARNING ****\n**** CLIENT IS TOO OLD!! UPDATE THE CLIENT!! ****"); |
969 | "**** VERSION WARNING ****\n**** CLIENT IS TOO OLD!! UPDATE THE CLIENT!! ****"); |
963 | ns->send_packet (version_warning); |
970 | ns->send_packet (version_warning); |
… | |
… | |
965 | |
972 | |
966 | } |
973 | } |
967 | } |
974 | } |
968 | |
975 | |
969 | /** sound related functions. */ |
976 | /** sound related functions. */ |
970 | |
|
|
971 | void |
977 | void |
972 | SetSound (char *buf, int len, client_socket * ns) |
978 | SetSound (char *buf, int len, client * ns) |
973 | { |
979 | { |
974 | ns->sound = atoi (buf); |
980 | ns->sound = atoi (buf); |
975 | } |
981 | } |
976 | |
982 | |
977 | /** client wants the map resent */ |
983 | /** client wants the map resent */ |
… | |
… | |
1035 | /** |
1041 | /** |
1036 | * Asks the client to query the user. This way, the client knows |
1042 | * Asks the client to query the user. This way, the client knows |
1037 | * it needs to send something back (vs just printing out a message) |
1043 | * it needs to send something back (vs just printing out a message) |
1038 | */ |
1044 | */ |
1039 | void |
1045 | void |
1040 | send_query (client_socket * ns, uint8 flags, char *text) |
1046 | send_query (client * ns, uint8 flags, char *text) |
1041 | { |
1047 | { |
1042 | char buf[MAX_BUF]; |
1048 | char buf[MAX_BUF]; |
1043 | |
1049 | |
1044 | sprintf (buf, "query %d %s", flags, text ? text : ""); |
1050 | sprintf (buf, "query %d %s", flags, text ? text : ""); |
1045 | ns->send_packet (buf); |
1051 | ns->send_packet (buf); |
… | |
… | |
1204 | * sent them the face yet (this can become quite costly in terms of |
1210 | * sent them the face yet (this can become quite costly in terms of |
1205 | * how much we are sending - on the other hand, this should only happen |
1211 | * how much we are sending - on the other hand, this should only happen |
1206 | * when the player logs in and picks stuff up. |
1212 | * when the player logs in and picks stuff up. |
1207 | */ |
1213 | */ |
1208 | void |
1214 | void |
1209 | esrv_send_animation (client_socket * ns, short anim_num) |
1215 | esrv_send_animation (client * ns, short anim_num) |
1210 | { |
1216 | { |
1211 | int i; |
1217 | int i; |
1212 | |
1218 | |
1213 | /* Do some checking on the anim_num we got. Note that the animations |
1219 | /* Do some checking on the anim_num we got. Note that the animations |
1214 | * are added in contigous order, so if the number is in the valid |
1220 | * are added in contigous order, so if the number is in the valid |
… | |
… | |
1251 | /** |
1257 | /** |
1252 | * This adds face_num to a map cell at x,y. If the client doesn't have |
1258 | * This adds face_num to a map cell at x,y. If the client doesn't have |
1253 | * the face yet, we will also send it. |
1259 | * the face yet, we will also send it. |
1254 | */ |
1260 | */ |
1255 | static void |
1261 | static void |
1256 | esrv_map_setbelow (client_socket * ns, int x, int y, short face_num, struct Map *newmap) |
1262 | esrv_map_setbelow (client * ns, int x, int y, short face_num, struct Map *newmap) |
1257 | { |
1263 | { |
1258 | if (newmap->cells[x][y].count >= MAP_LAYERS) |
1264 | if (newmap->cells[x][y].count >= MAP_LAYERS) |
1259 | { |
1265 | { |
1260 | LOG (llevError, "Too many faces in map cell %d %d\n", x, y); |
1266 | LOG (llevError, "Too many faces in map cell %d %d\n", x, y); |
1261 | return; |
1267 | return; |
… | |
… | |
1281 | struct LayerCell lcells[MAP_CLIENT_X * MAP_CLIENT_Y]; |
1287 | struct LayerCell lcells[MAP_CLIENT_X * MAP_CLIENT_Y]; |
1282 | }; |
1288 | }; |
1283 | |
1289 | |
1284 | /** Checkes if map cells have changed */ |
1290 | /** Checkes if map cells have changed */ |
1285 | static int |
1291 | static int |
1286 | mapcellchanged (client_socket * ns, int i, int j, struct Map *newmap) |
1292 | mapcellchanged (client * ns, int i, int j, struct Map *newmap) |
1287 | { |
1293 | { |
1288 | int k; |
1294 | int k; |
1289 | |
1295 | |
1290 | if (ns->lastmap.cells[i][j].count != newmap->cells[i][j].count) |
1296 | if (ns->lastmap.cells[i][j].count != newmap->cells[i][j].count) |
1291 | return 1; |
1297 | return 1; |
… | |
… | |
1304 | * cnum is the client number, cur is the the buffer we put all of |
1310 | * cnum is the client number, cur is the the buffer we put all of |
1305 | * this data into. we return the end of the data. layers is |
1311 | * this data into. we return the end of the data. layers is |
1306 | * how many layers of data we should back. |
1312 | * how many layers of data we should back. |
1307 | */ |
1313 | */ |
1308 | static uint8 * |
1314 | static uint8 * |
1309 | compactlayer (client_socket * ns, unsigned char *cur, int numlayers, struct Map *newmap) |
1315 | compactlayer (client * ns, unsigned char *cur, int numlayers, struct Map *newmap) |
1310 | { |
1316 | { |
1311 | int x, y, k; |
1317 | int x, y, k; |
1312 | int face; |
1318 | int face; |
1313 | unsigned char *fcur; |
1319 | unsigned char *fcur; |
1314 | struct MapLayer layers[MAP_LAYERS]; |
1320 | struct MapLayer layers[MAP_LAYERS]; |
… | |
… | |
1422 | * needs to get sent - if so, it adds the data, sending the head |
1428 | * needs to get sent - if so, it adds the data, sending the head |
1423 | * if needed, and returning 1. If this no data needs to get |
1429 | * if needed, and returning 1. If this no data needs to get |
1424 | * sent, it returns zero. |
1430 | * sent, it returns zero. |
1425 | */ |
1431 | */ |
1426 | static int |
1432 | static int |
1427 | check_head (packet &sl, client_socket &ns, int ax, int ay, int layer) |
1433 | check_head (packet &sl, client &ns, int ax, int ay, int layer) |
1428 | { |
1434 | { |
1429 | short face_num; |
1435 | short face_num; |
1430 | |
1436 | |
1431 | if (heads[(ay * MAX_HEAD_POS + ax) * MAX_LAYERS + layer]) |
1437 | if (heads[(ay * MAX_HEAD_POS + ax) * MAX_LAYERS + layer]) |
1432 | face_num = heads[(ay * MAX_HEAD_POS + ax) * MAX_LAYERS + layer]->face->number; |
1438 | face_num = heads[(ay * MAX_HEAD_POS + ax) * MAX_LAYERS + layer]->face->number; |
… | |
… | |
1466 | * the case, it seems to make more sense to have these layer values |
1472 | * the case, it seems to make more sense to have these layer values |
1467 | * actually match. |
1473 | * actually match. |
1468 | */ |
1474 | */ |
1469 | |
1475 | |
1470 | static int |
1476 | static int |
1471 | update_space (packet &sl, client_socket &ns, maptile *mp, int mx, int my, int sx, int sy, int layer) |
1477 | update_space (packet &sl, client &ns, maptile *mp, int mx, int my, int sx, int sy, int layer) |
1472 | { |
1478 | { |
1473 | object *ob, *head; |
1479 | object *ob, *head; |
1474 | uint16 face_num; |
1480 | uint16 face_num; |
1475 | int bx, by, i; |
1481 | int bx, by, i; |
1476 | |
1482 | |
… | |
… | |
1689 | * top layer (this matches what the GET_MAP_FACE and GET_MAP_FACE_OBJ |
1695 | * top layer (this matches what the GET_MAP_FACE and GET_MAP_FACE_OBJ |
1690 | * take. |
1696 | * take. |
1691 | */ |
1697 | */ |
1692 | |
1698 | |
1693 | static inline int |
1699 | static inline int |
1694 | update_smooth (packet &sl, client_socket &ns, maptile *mp, int mx, int my, int sx, int sy, int layer) |
1700 | update_smooth (packet &sl, client &ns, maptile *mp, int mx, int my, int sx, int sy, int layer) |
1695 | { |
1701 | { |
1696 | object *ob; |
1702 | object *ob; |
1697 | int smoothlevel; /* old face_num; */ |
1703 | int smoothlevel; /* old face_num; */ |
1698 | |
1704 | |
1699 | ob = GET_MAP_FACE_OBJ (mp, mx, my, layer); |
1705 | ob = GET_MAP_FACE_OBJ (mp, mx, my, layer); |
… | |
… | |
1733 | * Returns the size of a data for a map square as returned by |
1739 | * Returns the size of a data for a map square as returned by |
1734 | * mapextended. There are CLIENTMAPX*CLIENTMAPY*LAYERS entries |
1740 | * mapextended. There are CLIENTMAPX*CLIENTMAPY*LAYERS entries |
1735 | * available. |
1741 | * available. |
1736 | */ |
1742 | */ |
1737 | int |
1743 | int |
1738 | getExtendedMapInfoSize (client_socket * ns) |
1744 | getExtendedMapInfoSize (client * ns) |
1739 | { |
1745 | { |
1740 | int result = 0; |
1746 | int result = 0; |
1741 | |
1747 | |
1742 | if (ns->ext_mapinfos) |
1748 | if (ns->ext_mapinfos) |
1743 | { |
1749 | { |
… | |
… | |
1779 | uint8 eentrysize; |
1785 | uint8 eentrysize; |
1780 | uint16 ewhatstart, ewhatflag; |
1786 | uint16 ewhatstart, ewhatflag; |
1781 | uint8 extendedinfos; |
1787 | uint8 extendedinfos; |
1782 | maptile *m; |
1788 | maptile *m; |
1783 | |
1789 | |
1784 | client_socket &socket = *pl->contr->socket; |
1790 | client &socket = *pl->contr->socket; |
1785 | |
1791 | |
1786 | check_map_change (pl->contr); |
1792 | check_map_change (pl->contr); |
1787 | |
1793 | |
1788 | packet sl; |
1794 | packet sl; |
1789 | packet esl; |
1795 | packet esl; |
… | |
… | |
2232 | /** |
2238 | /** |
2233 | * This sends the skill number to name mapping. We ignore |
2239 | * This sends the skill number to name mapping. We ignore |
2234 | * the params - we always send the same info no matter what. |
2240 | * the params - we always send the same info no matter what. |
2235 | */ |
2241 | */ |
2236 | void |
2242 | void |
2237 | send_skill_info (client_socket *ns, char *params) |
2243 | send_skill_info (client *ns, char *params) |
2238 | { |
2244 | { |
2239 | packet sl; |
2245 | packet sl; |
2240 | sl << "replyinfo skill_info\n"; |
2246 | sl << "replyinfo skill_info\n"; |
2241 | |
2247 | |
2242 | for (int i = 1; i < NUM_SKILLS; i++) |
2248 | for (int i = 1; i < NUM_SKILLS; i++) |
… | |
… | |
2254 | /** |
2260 | /** |
2255 | * This sends the spell path to name mapping. We ignore |
2261 | * This sends the spell path to name mapping. We ignore |
2256 | * the params - we always send the same info no matter what. |
2262 | * the params - we always send the same info no matter what. |
2257 | */ |
2263 | */ |
2258 | void |
2264 | void |
2259 | send_spell_paths (client_socket * ns, char *params) |
2265 | send_spell_paths (client * ns, char *params) |
2260 | { |
2266 | { |
2261 | packet sl; |
2267 | packet sl; |
2262 | |
2268 | |
2263 | sl << "replyinfo spell_paths\n"; |
2269 | sl << "replyinfo spell_paths\n"; |
2264 | |
2270 | |