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.112 by root, Sun Jul 1 05:00:20 2007 UTC vs.
Revision 1.115 by root, Wed Jul 11 15:57:31 2007 UTC

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)", &reg->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 */
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{
511void 505void
512NewPlayerCmd (char *buf, int len, player *pl) 506NewPlayerCmd (char *buf, int len, player *pl)
513{ 507{
514 if (len <= 6) 508 if (len <= 6)
515 { 509 {
516 LOG (llevDebug, "Corrupt ncom command <%s> not long enough - discarding\n", buf); 510 LOG (llevDebug, "%s: corrupt ncom command <%s>: not long enough (%d) - discarding\n", pl->ns->host, buf, len);
517 return; 511 return;
518 } 512 }
519 513
520 uint16 cmdid = net_uint16 ((uint8 *)buf); 514 uint16 cmdid = net_uint16 ((uint8 *)buf);
521 sint32 repeat = net_sint32 ((uint8 *)buf + 2); 515 sint32 repeat = net_sint32 ((uint8 *)buf + 2);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines