pastebin - collaborative debugging tool
kpaste.net RSS


strcharinfo(4)
Posted by Anonymous on Sat 22nd Jan 2011 22:17
raw | new post

  1. Index: src/map/script.c
  2. ===================================================================
  3. --- src/map/script.c    (revision 14393)
  4. +++ src/map/script.c    (working copy)
  5. @@ -13,6 +13,7 @@
  6.  #include "../common/lock.h"
  7.  #include "../common/nullpo.h"
  8.  #include "../common/showmsg.h"
  9. +#include "../common/socket.h"
  10.  #include "../common/strlib.h"
  11.  #include "../common/timer.h"
  12.  #include "../common/utils.h"
  13. @@ -6089,12 +6090,14 @@
  14.         TBL_PC *sd;
  15.         int num;
  16.         char *buf;
  17. +       uint32 ip;
  18.  
  19.         sd=script_rid2sd(st);
  20.         if (!sd) { //Avoid crashing....
  21.                 script_pushconststr(st,"");
  22.                 return 0;
  23.         }
  24. +       ip = session[sd->fd]->client_addr;
  25.         num=script_getnum(st,2);
  26.         switch(num){
  27.                 case 0:
  28. @@ -6117,6 +6120,11 @@
  29.                 case 3:
  30.                         script_pushconststr(st,map[sd->bl.m].name);
  31.                         break;
  32. +               case 4:
  33. +                       buf = (char *)aMallocA((15+1)*sizeof(char));
  34. +                       sprintf(buf, "%d.%d.%d.%d", CONVIP(ip));
  35. +                       script_pushstr(st,buf);
  36. +                       break;
  37.                 default:
  38.                         ShowWarning("buildin_strcharinfo: unknown parameter.\n");
  39.                         script_pushconststr(st,"");

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at