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.169 by root, Thu Apr 8 17:36:54 2010 UTC vs.
Revision 1.170 by root, Thu Apr 8 20:05:36 2010 UTC

446 INVOKE_CLIENT (ADDME, ns, ARG_DATA (buf, len)); 446 INVOKE_CLIENT (ADDME, ns, ARG_DATA (buf, len));
447} 447}
448 448
449//+GPL 449//+GPL
450 450
451/*
452#define MSG_TYPE_BOOK 1
453#define MSG_TYPE_CARD 2
454#define MSG_TYPE_PAPER 3
455#define MSG_TYPE_SIGN 4
456#define MSG_TYPE_MONUMENT 5
457#define MSG_TYPE_SCRIPTED_DIALOG 6*/
458
459/** Reply to ExtendedInfos command */
460void
461ToggleExtendedText (char *buf, int len, client * ns)
462{
463 char cmdback[MAX_BUF];
464 char temp[10];
465 char command[50];
466 int info, nextinfo, i, flag;
467
468 cmdback[0] = '\0';
469
470 nextinfo = 0;
471 while (1)
472 {
473 /* 1. Extract an info */
474 info = nextinfo;
475
476 while ((info < len) && (buf [info] == ' '))
477 info++;
478
479 if (info >= len)
480 break;
481
482 nextinfo = info + 1;
483
484 while ((nextinfo < len) && (buf [nextinfo] != ' '))
485 nextinfo++;
486
487 if (nextinfo - info >= 49) /*Erroneous info asked */
488 continue;
489
490 memcpy (command, buf + info, nextinfo - info);
491 command [nextinfo - info] = 0;
492
493 /* 2. Interpret info */
494 i = sscanf (command, "%d", &flag);
495
496 if ((i == 1) && (flag > 0) && (flag <= MSG_TYPE_LAST))
497 ns->supported_readables |= (1 << flag);
498 /*3. Next info */
499 }
500
501 /* Send resulting state */
502 strcpy (cmdback, "ExtendedTextSet");
503
504 for (i = 0; i <= MSG_TYPE_LAST; i++)
505 if (ns->supported_readables & (1 << i))
506 {
507 strcat (cmdback, " ");
508 snprintf (temp, sizeof (temp), "%d", i);
509 strcat (cmdback, temp);
510 }
511
512 ns->send_packet (cmdback);
513}
514
515/** 451/**
516 * This handles the general commands from the client (ie, north, fire, cast, 452 * This handles the general commands from the client (ie, north, fire, cast,
517 * etc.) 453 * etc.)
518 */ 454 */
519void 455void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines