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.150 by root, Mon Oct 12 14:00:59 2009 UTC vs.
Revision 1.153 by root, Wed Nov 4 13:46:37 2009 UTC

237 { 237 {
238 *params++ = 0; 238 *params++ = 0;
239 break; 239 break;
240 } 240 }
241 241
242 if (!strcmp (buf, "image_info"))
243 send_image_info (ns, params);
244 else if (!strcmp (buf, "image_sums"))
245 send_image_sums (ns, params);
246 else if (!strcmp (buf, "skill_info")) 242 if (!strcmp (buf, "skill_info"))
247 send_skill_info (ns, params); 243 send_skill_info (ns, params);
248 else if (!strcmp (buf, "spell_paths")) 244 else if (!strcmp (buf, "spell_paths"))
249 send_spell_paths (ns, params); 245 send_spell_paths (ns, params);
250 else 246 else
251 { 247 {
425 while (1) 421 while (1)
426 { 422 {
427 /* 1. Extract an info */ 423 /* 1. Extract an info */
428 info = nextinfo; 424 info = nextinfo;
429 425
430 while ((info < len) && (buf[info] == ' ')) 426 while ((info < len) && (buf [info] == ' '))
431 info++; 427 info++;
432 428
433 if (info >= len) 429 if (info >= len)
434 break; 430 break;
435 431
436 nextinfo = info + 1; 432 nextinfo = info + 1;
437 433
438 while ((nextinfo < len) && (buf[nextinfo] != ' ')) 434 while ((nextinfo < len) && (buf [nextinfo] != ' '))
439 nextinfo++; 435 nextinfo++;
440 436
441 if (nextinfo - info >= 49) /*Erroneous info asked */ 437 if (nextinfo - info >= 49) /*Erroneous info asked */
442 continue; 438 continue;
443 439
444 strncpy (command, &(buf[info]), nextinfo - info); 440 memcpy (command, buf + info, nextinfo - info);
445 command[nextinfo - info] = '\0'; 441 command [nextinfo - info] = 0;
442
446 /* 2. Interpret info */ 443 /* 2. Interpret info */
447 i = sscanf (command, "%d", &flag); 444 i = sscanf (command, "%d", &flag);
448 445
449 if ((i == 1) && (flag > 0) && (flag <= MSG_TYPE_LAST)) 446 if ((i == 1) && (flag > 0) && (flag <= MSG_TYPE_LAST))
450 ns->supported_readables |= (1 << flag); 447 ns->supported_readables |= (1 << flag);
484 return; 481 return;
485 482
486 buf++; 483 buf++;
487 } 484 }
488 485
489 execute_newserver_command (pl->ob, (char *) buf); 486 execute_newserver_command (pl->ob, (char *)buf);
490 487
491 /* Perhaps something better should be done with a left over count. 488 /* Perhaps something better should be done with a left over count.
492 * Cleaning up the input should probably be done first - all actions 489 * Cleaning up the input should probably be done first - all actions
493 * for the command that issued the count should be done before any other 490 * for the command that issued the count should be done before any other
494 * commands. 491 * commands.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines