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.113 by root, Mon Jul 2 02:29:34 2007 UTC vs.
Revision 1.114 by root, Tue Jul 10 06:05:55 2007 UTC

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 */
205void 205void
206RequestInfo (char *buf, int len, client * ns) 206RequestInfo (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
244void 238void
245ExtCmd (char *buf, int len, player *pl) 239ExtCmd (char *buf, int len, player *pl)
246{ 240{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines