2 "$Id: script.c 9364 2008-06-22 21:53:03Z quinet $";
119 #include <sys/types.h>
120 #include <sys/socket.h>
121 #include <sys/wait.h>
170 static void send_map(
int i,
int x,
int y);
180 #define write(x,y,z) emulate_write(x,y,z)
181 #define read(x,y,z) emulate_read(x,y,z)
183 static int emulate_read(HANDLE fd,
char *buf,
int len)
188 FlushFileBuffers(fd);
189 rc = ReadFile(fd, buf, len, &dwBytesRead, NULL);
192 buf[dwBytesRead] =
'\0';
197 static int emulate_write(HANDLE fd,
const char *buf,
int len)
199 DWORD dwBytesWritten;
202 rc = WriteFile(fd, buf, len, &dwBytesWritten, NULL);
203 FlushFileBuffers(fd);
207 return(dwBytesWritten);
232 strncpy(params, cparams,
MAX_BUF-1);
239 while ( *args && *args!=
' ' ) ++args;
240 while ( *args && *args==
' ' ) *args++ =
'\0';
293 while (args && *args && i <
sizeof(argv)/
sizeof(*argv)-1)
296 while ( *args && *args!=
' ' ) ++args;
297 while ( *args && *args==
' ' ) *args++ =
'\0';
304 fprintf(stderr,
"Script Child: Failed to set pipe1 as stdin\n");
312 fprintf(stderr,
"Script Child: Failed to set pipe2 as stdout\n");
314 for (i=3;i<100;++i) close(i);
317 r = execvp(argv[0],argv);
327 printf(
"draw %d Script child: no error, but no execvp().\n",
NDI_RED);
329 printf(
"draw %d Script child failed to start: %s\n",
NDI_RED, strerror(errno));
341 if (fcntl(pipe1[1], F_SETFL, O_NDELAY)==-1) {
346 scripts=realloc(scripts,
sizeof(scripts[0])*(
num_scripts+1));
367 SECURITY_ATTRIBUTES saAttr;
368 PROCESS_INFORMATION piProcInfo;
369 STARTUPINFO siStartupInfo;
370 HANDLE hChildStdinRd, hChildStdinWr, hChildStdinWrDup, hChildStdoutRd;
371 HANDLE hChildStdoutWr, hChildStdoutRdDup, hSaveStdin, hSaveStdout;
379 strncpy(params, cparams,
MAX_BUF-1);
385 while ( *args && *args!=
' ' ) ++args;
386 while ( *args && *args==
' ' ) *args++ =
'\0';
392 saAttr.nLength =
sizeof(SECURITY_ATTRIBUTES);
393 saAttr.bInheritHandle =
TRUE;
394 saAttr.lpSecurityDescriptor = NULL;
396 hSaveStdout = GetStdHandle(STD_OUTPUT_HANDLE);
397 if (!CreatePipe(&hChildStdoutRd, &hChildStdoutWr, &saAttr, 0))
403 if (!SetStdHandle(STD_OUTPUT_HANDLE, hChildStdoutWr))
405 draw_info(
"Script support: failed to redirect stdout using SetStdHandle()",
NDI_RED);
409 if (!DuplicateHandle(GetCurrentProcess(), hChildStdoutRd, GetCurrentProcess(),
410 &hChildStdoutRdDup, 0,
FALSE, DUPLICATE_SAME_ACCESS))
412 draw_info(
"Script support: failed to duplicate stdout using DuplicateHandle()",
NDI_RED);
416 CloseHandle(hChildStdoutRd);
418 hSaveStdin = GetStdHandle(STD_INPUT_HANDLE);
419 if (!CreatePipe(&hChildStdinRd, &hChildStdinWr, &saAttr, 0))
425 if (!SetStdHandle(STD_INPUT_HANDLE, hChildStdinRd))
427 draw_info(
"Script support: failed to redirect stdin using SetStdHandle()",
NDI_RED);
431 if (!DuplicateHandle(GetCurrentProcess(), hChildStdinWr, GetCurrentProcess(),
432 &hChildStdinWrDup, 0,
FALSE, DUPLICATE_SAME_ACCESS))
434 draw_info(
"Script support: failed to duplicate stdin using DuplicateHandle()",
NDI_RED);
438 CloseHandle(hChildStdinWr);
440 ZeroMemory(&piProcInfo,
sizeof(PROCESS_INFORMATION));
441 ZeroMemory(&siStartupInfo,
sizeof(STARTUPINFO));
442 siStartupInfo.cb =
sizeof(STARTUPINFO);
447 if (!CreateProcess(NULL, name, NULL, NULL,
TRUE, CREATE_NEW_PROCESS_GROUP, NULL, NULL, &siStartupInfo, &piProcInfo))
453 CloseHandle(piProcInfo.hThread);
458 if (!SetStdHandle(STD_INPUT_HANDLE, hSaveStdin))
464 if (!SetStdHandle(STD_OUTPUT_HANDLE, hSaveStdout))
471 scripts=realloc(scripts,
sizeof(scripts[0])*(
num_scripts+1));
481 scripts[
num_scripts].process = piProcInfo.hProcess;
492 if (commdiff<0) commdiff +=256;
497 snprintf(buf,
sizeof(buf),
"sync %d\n",commdiff);
498 write(scripts[i].
out_fd,buf,strlen(buf));
515 snprintf(buf,
sizeof(buf),
"%d scripts currently running:",
num_scripts);
520 snprintf(buf,
sizeof(buf),
"%d %s %s",i+1,scripts[i].
name,scripts[i].params);
522 snprintf(buf,
sizeof(buf),
"%d %s",i+1,scripts[i].name);
540 kill(scripts[i].
pid,SIGHUP);
542 GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, scripts[i].pid);
549 void script_killall(
void)
553 GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, scripts[0].
pid);
566 FD_SET(scripts[i].
in_fd,set);
567 if ( scripts[i].in_fd >= *maxfd ) *maxfd = scripts[i].
in_fd+1;
577 DWORD nAvailBytes = 0;
589 if ( FD_ISSET(scripts[i].
in_fd,set) )
592 bStatus = GetExitCodeProcess(scripts[i].process,&dwStatus);
593 bRC = PeekNamedPipe(scripts[i].in_fd, &cTmp, 1, NULL, &nAvailBytes, NULL);
598 r=read(scripts[i].in_fd,scripts[i].
cmd+scripts[i].
cmd_count,
sizeof(scripts[i].
cmd)-scripts[i].cmd_count-1);
604 else if ( r==0 || errno==EBADF )
606 else if ( r==0 || GetLastError() == ERROR_BROKEN_PIPE )
615 while ( scripts[i].cmd_count ==
sizeof(scripts[i].cmd)-1
617 || strchr(scripts[i].cmd,
'\n') )
619 || strchr(scripts[i].cmd,
'\r\n') )
628 else if (!bRC || ( bStatus && ( dwStatus != STILL_ACTIVE ) ) )
648 l=strlen(scripts[i].
watch[w]);
649 if ( !l || strncmp(cmd,scripts[i].
watch[w],l)==0 )
652 if ( !len ) snprintf(buf,
sizeof(buf),
"watch %s\n",cmd);
653 else switch (format) {
655 snprintf(buf,
sizeof(buf),
"watch %s %s\n",cmd,data);
665 be=snprintf(buf,
sizeof(buf),
"watch %s",cmd);
666 for(p=0;p*2<len && p<100;++p) {
669 be+=snprintf(buf+be,
sizeof(buf)-be,
"\n");
677 be=snprintf(buf,
sizeof(buf),
"watch %s",cmd);
678 for(p=0;p*4<len;++p) {
679 be+=snprintf(buf+be,
sizeof(buf)-be,
" %d",
GetInt_String(data+p*4));
681 be+=snprintf(buf+be,
sizeof(buf)-be,
"\n");
696 be+=snprintf(buf+be,
sizeof(buf)-be,
"watch %s",cmd);
700 be+=snprintf(buf+be,
sizeof(buf)-be,
" resists %d %d\n",c,
GetShort_String(data));
703 be+=snprintf(buf+be,
sizeof(buf)-be,
" skill %d %d %" FMT64
"\n",c,*data,
GetInt64_String(data+1));
707 be+=snprintf(buf+be,
sizeof(buf)-be,
" hp %d\n",
GetShort_String(data));
708 data+=2; len-=2;
break;
710 be+=snprintf(buf+be,
sizeof(buf)-be,
" maxhp %d\n",
GetShort_String(data));
711 data+=2; len-=2;
break;
713 be+=snprintf(buf+be,
sizeof(buf)-be,
" sp %d\n",
GetShort_String(data));
714 data+=2; len-=2;
break;
716 be+=snprintf(buf+be,
sizeof(buf)-be,
" maxspp %d\n",
GetShort_String(data));
717 data+=2; len-=2;
break;
719 be+=snprintf(buf+be,
sizeof(buf)-be,
" grace %d\n",
GetShort_String(data));
720 data+=2; len-=2;
break;
722 be+=snprintf(buf+be,
sizeof(buf)-be,
" maxgrace %d\n",
GetShort_String(data));
723 data+=2; len-=2;
break;
725 be+=snprintf(buf+be,
sizeof(buf)-be,
" str %d\n",
GetShort_String(data));
726 data+=2; len-=2;
break;
728 be+=snprintf(buf+be,
sizeof(buf)-be,
" int %d\n",
GetShort_String(data));
729 data+=2; len-=2;
break;
731 be+=snprintf(buf+be,
sizeof(buf)-be,
" pow %d\n",
GetShort_String(data));
732 data+=2; len-=2;
break;
734 be+=snprintf(buf+be,
sizeof(buf)-be,
" wis %d\n",
GetShort_String(data));
735 data+=2; len-=2;
break;
737 be+=snprintf(buf+be,
sizeof(buf)-be,
" dex %d\n",
GetShort_String(data));
738 data+=2; len-=2;
break;
740 be+=snprintf(buf+be,
sizeof(buf)-be,
" con %d\n",
GetShort_String(data));
741 data+=2; len-=2;
break;
743 be+=snprintf(buf+be,
sizeof(buf)-be,
" cha %d\n",
GetShort_String(data));
744 data+=2; len-=2;
break;
746 be+=snprintf(buf+be,
sizeof(buf)-be,
" exp %d\n",
GetInt_String(data));
747 data+=4; len-=4;
break;
749 be+=snprintf(buf+be,
sizeof(buf)-be,
" exp %" FMT64
"\n",
GetInt64_String(data));
750 data+=8; len-=8;
break;
752 be+=snprintf(buf+be,
sizeof(buf)-be,
" level %d\n",
GetShort_String(data));
753 data+=2; len-=2;
break;
755 be+=snprintf(buf+be,
sizeof(buf)-be,
" wc %d\n",
GetShort_String(data));
756 data+=2; len-=2;
break;
758 be+=snprintf(buf+be,
sizeof(buf)-be,
" ac %d\n",
GetShort_String(data));
759 data+=2; len-=2;
break;
761 be+=snprintf(buf+be,
sizeof(buf)-be,
" dam %d\n",
GetShort_String(data));
762 data+=2; len-=2;
break;
764 be+=snprintf(buf+be,
sizeof(buf)-be,
" armour %d\n",
GetShort_String(data));
765 data+=2; len-=2;
break;
767 be+=snprintf(buf+be,
sizeof(buf)-be,
" speed %d\n",
GetInt_String(data));
768 data+=4; len-=4;
break;
770 be+=snprintf(buf+be,
sizeof(buf)-be,
" food %d\n",
GetShort_String(data));
771 data+=2; len-=2;
break;
773 be+=snprintf(buf+be,
sizeof(buf)-be,
" weap_sp %d\n",
GetInt_String(data));
774 data+=4; len-=4;
break;
776 be+=snprintf(buf+be,
sizeof(buf)-be,
" flags %d\n",
GetShort_String(data));
777 data+=2; len-=2;
break;
779 be+=snprintf(buf+be,
sizeof(buf)-be,
" weight_lim %d\n",
GetInt_String(data));
780 data+=4; len-=4;
break;
787 be+=snprintf(buf+be,
sizeof(buf)-be,
" skillexp %d %d\n",c,
GetInt_String(data));
788 data+=4; len-=4;
break;
795 be+=snprintf(buf+be,
sizeof(buf)-be,
" skilllevel %d %d\n",c,
GetShort_String(data));
796 data+=2; len-=2;
break;
801 be+=snprintf(buf+be,
sizeof(buf)-be,
" range %*.*s\n",rlen,rlen,data);
802 data+=rlen; len-=rlen;
break;
807 be+=snprintf(buf+be,
sizeof(buf)-be,
" title %*.*s\n",rlen,rlen,data);
808 data+=rlen; len-=rlen;
break;
811 be+=snprintf(buf+be,
sizeof(buf)-be,
" unknown %d %d bytes left\n",c,len);
840 be=snprintf(buf,
sizeof(buf),
"watch %s %d bytes unparsed:",cmd,len);
841 for(p=0;p<len && p<100;++p) {
842 be+=snprintf(buf+be,
sizeof(buf)-be,
" %02x",data[p]);
844 be+=snprintf(buf+be,
sizeof(buf)-be,
"\n");
848 write(scripts[i].
out_fd,buf,strlen(buf));
866 snprintf(buf,
sizeof(buf),
"monitor %d %d %s\n",repeat,must_send,command);
867 write(scripts[i].
out_fd,buf,strlen(buf));
884 snprintf(buf,
sizeof(buf),
"monitor %s\n",command);
885 write(scripts[i].
out_fd,buf,strlen(buf));
903 write(scripts[i].
out_fd,
"scripttell ",11);
904 write(scripts[i].out_fd,params,strlen(params));
905 write(scripts[i].out_fd,
"\n",1);
919 if ( isdigit(*name) )
928 while ( name[l] && name[l]!=
' ' ) ++l;
931 if ( strncmp(name,scripts[i].name,l)==0 )
return(i);
942 close(scripts[i].
in_fd);
945 CloseHandle(scripts[i].in_fd);
946 CloseHandle(scripts[i].out_fd);
947 CloseHandle(scripts[i].process);
949 free(scripts[i].
name);
952 free(scripts[i].
watch);
955 waitpid(-1,NULL,WNOHANG);
961 memmove(&scripts[i],&scripts[i+1],
sizeof(scripts[i])*(
num_scripts-i-1));
974 snprintf(buf,
sizeof(buf),
"request map %d %d unknown\n",x,y);
975 write(scripts[i].
out_fd,buf,strlen(buf));
978 snprintf(buf,
sizeof(buf),
"request map %d %d %d %c %c %c %c"
979 " smooth %d %d %d heads %d %d %d tails %d %d %d\n",
989 write(scripts[i].
out_fd,buf,strlen(buf));
1003 if ( scripts[i].cmd[l]==
'\n' )
break;
1006 memcpy(cmd,scripts[i].cmd,l);
1014 memmove(scripts[i].cmd,scripts[i].cmd+l,scripts[i].cmd_count-l);
1039 if ( strncmp(cmd,
"sync",4)==0 ) {
1041 while ( *c && *c!=
' ' ) ++c;
1042 while ( *c==
' ' ) ++c;
1044 if ( isdigit(*c) ) {
1049 else if ( strncmp(cmd,
"watch",5)==0 ) {
1051 while ( *c && *c!=
' ' ) ++c;
1052 while ( *c==
' ' ) ++c;
1054 scripts[i].
watch=realloc(scripts[i].
watch,(scripts[i].
num_watch+1)*
sizeof(scripts[i].watch[1]));
1058 else if ( strncmp(cmd,
"unwatch",7)==0 ) {
1062 while ( *c && *c!=
' ' ) ++c;
1063 while ( *c==
' ' ) ++c;
1065 if ( strcmp(c,scripts[i].
watch[w])==0 ) {
1066 free(scripts[i].
watch[w]);
1076 else if ( strncmp(cmd,
"request",7)==0 ) {
1078 while ( *c && *c!=
' ' ) ++c;
1079 while ( *c==
' ' ) ++c;
1109 if (strncmp(c,
"player", 6) == 0) {
1112 snprintf(buf,
sizeof(buf),
"request player %d %s\n",
cpl.
ob->
tag,
cpl.
title);
1113 write(scripts[i].
out_fd, buf, strlen(buf));
1115 else if ( strncmp(c,
"range",5)==0 ) {
1118 snprintf(buf,
sizeof(buf),
"request range %s\n",
cpl.
range);
1119 write(scripts[i].
out_fd,buf,strlen(buf));
1121 else if ( strncmp(c,
"weight",5)==0 ) {
1125 write(scripts[i].
out_fd,buf,strlen(buf));
1127 else if ( strncmp(c,
"stat ",5)==0 ) {
1129 while ( *c && *c!=
' ' ) ++c;
1130 while ( *c==
' ' ) ++c;
1139 if ( strncmp(c,
"stats",5)==0 ) {
1143 write(scripts[i].
out_fd,buf,strlen(buf));
1145 else if ( strncmp(c,
"cmbt",4)==0 ) {
1149 write(scripts[i].
out_fd,buf,strlen(buf));
1151 else if ( strncmp(c,
"hp",2)==0 ) {
1155 write(scripts[i].
out_fd,buf,strlen(buf));
1157 else if ( strncmp(c,
"xp",2)==0 ) {
1162 write(scripts[i].
out_fd,buf,strlen(buf));
1165 write(scripts[i].out_fd,buf,strlen(buf));
1167 write(scripts[i].out_fd,
"\n",1);
1169 else if ( strncmp(c,
"resists",7)==0 ) {
1173 snprintf(buf,
sizeof(buf),
"request stat resists");
1174 write(scripts[i].
out_fd,buf,strlen(buf));
1177 write(scripts[i].out_fd,buf,strlen(buf));
1179 write(scripts[i].out_fd,
"\n",1);
1181 else if (strncmp(c,
"paths", 2) == 0) {
1185 write(scripts[i].
out_fd, buf, strlen(buf));
1188 else if ( strncmp(c,
"flags",5)==0 ) {
1192 write(scripts[i].
out_fd,buf,strlen(buf));
1194 else if ( strncmp(c,
"items ",6)==0 ) {
1196 while ( *c && *c!=
' ' ) ++c;
1197 while ( *c==
' ' ) ++c;
1205 if ( strncmp(c,
"inv",3)==0 ) {
1213 buf=
"request items inv end\n";
1214 write(scripts[i].
out_fd,buf,strlen(buf));
1216 if ( strncmp(c,
"actv",4)==0 ) {
1224 buf=
"request items actv end\n";
1225 write(scripts[i].
out_fd,buf,strlen(buf));
1227 if ( strncmp(c,
"on",2)==0 ) {
1235 buf=
"request items on end\n";
1236 write(scripts[i].
out_fd,buf,strlen(buf));
1238 if ( strncmp(c,
"cont",4)==0 ) {
1246 buf=
"request items cont end\n";
1247 write(scripts[i].
out_fd,buf,strlen(buf));
1250 else if ( strncmp(c,
"map ",4)==0 ) {
1254 while ( *c && *c!=
' ' ) ++c;
1255 while ( *c==
' ' ) ++c;
1263 if ( strncmp(c,
"pos",3)==0 ) {
1266 snprintf(buf,
sizeof(buf),
"request map pos %d %d\n",
pl_pos.
x,
pl_pos.
y);
1267 write(scripts[i].
out_fd,buf,strlen(buf));
1269 else if ( strncmp(c,
"near",4)==0 ) {
1277 else if ( strncmp(c,
"all",3)==0 ) {
1283 snprintf(buf,
sizeof(buf),
"request map end\n");
1284 write(scripts[i].
out_fd,buf,strlen(buf));
1287 while ( *c && !isdigit(*c) ) ++c;
1290 while ( *c && *c!=
' ' ) ++c;
1291 while ( *c && !isdigit(*c) ) ++c;
1297 else if (strncmp(c,
"skills", 6) == 0) {
1304 write(scripts[i].
out_fd, buf, strlen(buf));
1307 sprintf(buf,
"request skills end\n");
1308 write(scripts[i].
out_fd, buf, strlen(buf));
1310 else if (strncmp(c,
"spells", 6) == 0) {
1315 sprintf(buf,
"request spells %d %d %d %d %d %d %d %d %s\n",
1319 write(scripts[i].
out_fd, buf, strlen(buf));
1321 sprintf(buf,
"request spells end\n");
1322 write(scripts[i].
out_fd, buf, strlen(buf));
1327 snprintf(buf,
sizeof(buf),
"Script %d %s malfunction; unimplemented request:",i+1,scripts[i].
name);
1332 else if ( strncmp(cmd,
"issue",5)==0 ) {
1337 while ( *c && *c==
' ' ) ++c;
1338 if ( *c && (isdigit(*c) || *c==
'-') ) {
1340 while ( *c && *c!=
' ' ) ++c;
1341 while ( *c && !isdigit(*c) && *c!=
'-' ) ++c;
1344 while ( *c && *c!=
' ' ) ++c;
1346 while ( *c==
' ' ) ++c;
1355 snprintf(buf,
sizeof(buf),
"Script %d %s malfunction; command not sent",i+1,scripts[i].
name);
1364 while ( *c && *c!=
' ' ) ++c;
1365 while ( *c==
' ' ) ++c;
1370 if ( strncmp(c,
"mark",4)==0 ) {
1377 while ( *c && !isdigit(*c) ) ++c;
1386 else if ( strncmp(c,
"lock",4)==0 ) {
1393 while ( *c && !isdigit(*c) ) ++c;
1396 while ( *c && *c!=
' ' ) ++c;
1397 while ( *c && !isdigit(*c) ) ++c;
1412 else if ( strncmp(cmd,
"localcmd",8)==0){
1415 while (*c==
' ') c++;
1417 while ( (*param!=
'\0') && (*param!=
' ')) param++;
1426 snprintf(buf,
sizeof(buf),
"Script %s malfunction; localcmd not understood",scripts[i].
name);
1428 snprintf(buf,
sizeof(buf),
"Script <<localcmd %s %s>>",c,(param==NULL)?
"":param);
1432 else if ( strncmp(cmd,
"draw",4)==0 ) {
1436 while ( *c && !isdigit(*c) ) ++c;
1439 while ( *c && *c!=
' ' ) ++c;
1441 while ( *c==
' ' ) ++c;
1444 else if ( strncmp(cmd,
"monitor",7)==0 ) scripts[i].
monitor=1;
1445 else if ( strncmp(cmd,
"unmonitor",9)==0 ) scripts[i].
monitor=0;
1449 snprintf(buf,
sizeof(buf),
"Script %d %s malfunction; invalid command:",i+1,scripts[i].
name);
1474 flags= (flags<<1)|it->
cursed;
1475 flags= (flags<<1)|it->
damned;
1476 flags= (flags<<1)|it->
unpaid;
1477 flags= (flags<<1)|it->
locked;
1478 flags= (flags<<1)|it->
applied;
1479 flags= (flags<<1)|it->
open;
1482 snprintf(buf,
sizeof(buf),
"%s%d %d %f %d %d %s\n",head,it->
tag,it->
nrof,it->
weight,flags,it->
type,it->
d_name);
1483 write(scripts[i].
out_fd,buf,strlen(buf));
void SockList_Init(SockList *sl, uint8 *buf)
static void script_process_cmd(int i)
int handle_local_command(const char *cp, const char *cpnext)
void script_monitor_str(const char *command)
#define CS_STAT_SKILLEXP_PHYSIQUE
#define CS_STAT_SKILLEXP_WISDOM
short GetShort_String(const unsigned char *data)
snd_pcm_hw_params_t * params
int SockList_Send(SockList *sl, int fd)
struct item_struct * next
#define CS_STAT_SKILLEXP_WILEVEL
static void script_dead(int i)
struct MapCellLayer tails[MAXLAYERS]
static int script_by_name(const char *name)
static void send_map(int i, int x, int y)
sint64 skill_exp[MAX_SKILL]
char * skill_names[MAX_SKILL]
void script_sync(int commdiff)
#define CS_STAT_SKILLEXP_PELEVEL
#define CS_STAT_SKILLEXP_MELEVEL
static void script_send_item(int i, const char *head, const item *it)
void SockList_AddInt(SockList *sl, uint32 data)
#define CS_STAT_SKILLEXP_MAGIC
void LOG(LogLevel level, const char *origin, const char *format,...)
void script_init(const char *cparams)
#define CS_STAT_SKILLEXP_AGILITY
#define CS_STAT_SKILLINFO
static struct script * scripts
int cs_print_string(int fd, const char *str,...)
int send_command(const char *command, int repeat, int must_send)
sint16 use_config[CONFIG_NUMS]
const char *const rcsid_common_script_c
#define CS_STAT_SKILLEXP_AGLEVEL
void SockList_AddString(SockList *sl, const char *str)
#define CS_STAT_SKILLEXP_PHLEVEL
#define CS_STAT_RESIST_END
struct Spell_struct * next
void script_watch(const char *cmd, const uint8 *data, const int data_len, const enum CmdFormat format)
void SockList_AddChar(SockList *sl, char c)
#define CS_STAT_SKILLEXP_MENTAL
void script_tell(const char *params)
#define CS_STAT_SKILLEXP_PERSONAL
void script_kill(const char *params)
void script_fdset(int *maxfd, fd_set *set)
#define CS_STAT_RESIST_START
void draw_info(const char *str, int color)
struct MapCellLayer heads[MAXLAYERS]
sint64 GetInt64_String(const unsigned char *data)
sint16 skill_level[MAX_SKILL]
#define CS_STAT_WEIGHT_LIM
#define CS_STAT_SKILLEXP_MALEVEL
void script_process(fd_set *set)
int GetInt_String(const unsigned char *data)
void script_monitor(const char *command, int repeat, int must_send)