… | |
… | |
190 | socket.current_y = ob->y; |
190 | socket.current_y = ob->y; |
191 | |
191 | |
192 | region *reg = ob->region (); |
192 | region *reg = ob->region (); |
193 | if (socket.current_region != reg) |
193 | if (socket.current_region != reg) |
194 | { |
194 | { |
|
|
195 | INVOKE_PLAYER (REGION_CHANGE, pl, ARG_REGION (reg), ARG_REGION (socket.current_region)); |
195 | socket.current_region = reg; |
196 | socket.current_region = reg; |
196 | socket.send_packet_printf ("drawinfo 0 You are now %s.\n(use whereami for more details)", ®->longname); |
|
|
197 | } |
197 | } |
198 | } |
198 | } |
199 | |
199 | |
200 | /** |
200 | /** |
201 | * RequestInfo is sort of a meta command. There is some specific |
201 | * RequestInfo is sort of a meta command. There is some specific |
202 | * request of information, but we call other functions to provide |
202 | * request of information, but we call other functions to provide |
203 | * that information. |
203 | * that information. |
204 | */ |
204 | */ |
205 | void |
205 | void |
206 | RequestInfo (char *buf, int len, client * ns) |
206 | RequestInfo (char *buf, int len, client *ns) |
207 | { |
207 | { |
208 | char *params = NULL, *cp; |
208 | char *params; |
209 | |
|
|
210 | /* No match */ |
|
|
211 | char bigbuf[MAX_BUF]; |
|
|
212 | int slen; |
|
|
213 | |
|
|
214 | /* Set up replyinfo before we modify any of the buffers - this is used |
|
|
215 | * if we don't find a match. |
|
|
216 | */ |
|
|
217 | strcpy (bigbuf, "replyinfo "); |
|
|
218 | slen = strlen (bigbuf); |
|
|
219 | safe_strcat (bigbuf, buf, &slen, MAX_BUF); |
|
|
220 | |
209 | |
221 | /* find the first space, make it null, and update the |
210 | /* find the first space, make it null, and update the |
222 | * params pointer. |
211 | * params pointer. |
223 | */ |
212 | */ |
224 | for (cp = buf; *cp != '\0'; cp++) |
213 | for (params = buf; *params; params++) |
225 | if (*cp == ' ') |
214 | if (*params == ' ') |
226 | { |
215 | { |
227 | *cp = '\0'; |
|
|
228 | params = cp + 1; |
216 | *params++ = 0; |
229 | break; |
217 | break; |
230 | } |
218 | } |
231 | |
219 | |
232 | if (!strcmp (buf, "image_info")) |
220 | if (!strcmp (buf, "image_info")) |
233 | send_image_info (ns, params); |
221 | send_image_info (ns, params); |
… | |
… | |
236 | else if (!strcmp (buf, "skill_info")) |
224 | else if (!strcmp (buf, "skill_info")) |
237 | send_skill_info (ns, params); |
225 | send_skill_info (ns, params); |
238 | else if (!strcmp (buf, "spell_paths")) |
226 | else if (!strcmp (buf, "spell_paths")) |
239 | send_spell_paths (ns, params); |
227 | send_spell_paths (ns, params); |
240 | else |
228 | else |
241 | ns->send_packet (bigbuf, len); |
229 | { |
|
|
230 | // undo tokenisation above and send replyinfo with the request unchanged |
|
|
231 | if (*params) |
|
|
232 | *--params = ' '; |
|
|
233 | |
|
|
234 | ns->send_packet_printf ("replyinfo %s", buf); |
|
|
235 | } |
242 | } |
236 | } |
243 | |
237 | |
244 | void |
238 | void |
245 | ExtCmd (char *buf, int len, player *pl) |
239 | ExtCmd (char *buf, int len, player *pl) |
246 | { |
240 | { |
… | |
… | |
937 | |
931 | |
938 | if (!ns.faces_sent[face_num]) |
932 | if (!ns.faces_sent[face_num]) |
939 | if (ob) |
933 | if (ob) |
940 | ns.send_faces (ob); |
934 | ns.send_faces (ob); |
941 | else |
935 | else |
942 | ns.send_face (face_num); |
936 | ns.send_face (face_num, 10); |
943 | |
937 | |
944 | sl << uint16 (face_num); |
938 | sl << uint16 (face_num); |
945 | return 1; |
939 | return 1; |
946 | } |
940 | } |
947 | |
941 | |