--- deliantra/server/socket/request.C 2006/12/15 03:53:44 1.39 +++ deliantra/server/socket/request.C 2006/12/15 04:21:29 1.40 @@ -218,6 +218,50 @@ socket.current_y = ob->y; } +/** + * RequestInfo is sort of a meta command. There is some specific + * request of information, but we call other functions to provide + * that information. + */ +void +RequestInfo (char *buf, int len, client_socket * ns) +{ + char *params = NULL, *cp; + + /* No match */ + char bigbuf[MAX_BUF]; + int slen; + + /* Set up replyinfo before we modify any of the buffers - this is used + * if we don't find a match. + */ + strcpy (bigbuf, "replyinfo "); + slen = strlen (bigbuf); + safe_strcat (bigbuf, buf, &slen, MAX_BUF); + + /* find the first space, make it null, and update the + * params pointer. + */ + for (cp = buf; *cp != '\0'; cp++) + if (*cp == ' ') + { + *cp = '\0'; + params = cp + 1; + break; + } + + if (!strcmp (buf, "image_info")) + send_image_info (ns, params); + else if (!strcmp (buf, "image_sums")) + send_image_sums (ns, params); + else if (!strcmp (buf, "skill_info")) + send_skill_info (ns, params); + else if (!strcmp (buf, "spell_paths")) + send_spell_paths (ns, params); + else + ns->send_packet (bigbuf, len); +} + void ExtCmd (char *buf, int len, player *pl) {