Skip to content
Snippets Groups Projects
Commit 6dd33529 authored by rswindell's avatar rswindell
Browse files

Added MATCHUSER function to get the number of a user by name.

parent dc8152d1
No related branches found
No related tags found
No related merge requests found
......@@ -2236,6 +2236,11 @@ void compile(char *src)
if(!stricmp(p,"FINDUSER")) {
fprintf(out,"%c",CS_FINDUSER);
continue; }
if(!stricmp(p,"MATCHUSER")) {
fprintf(out,"%c%c",CS_VAR_INSTRUCTION,MATCHUSER);
writecrc(src,arg);
writecrc(src,arg2);
continue; }
if(!stricmp(p,"LOG")) {
if(!(*arg)) break;
......@@ -3367,7 +3372,7 @@ void compile(char *src)
}
char *banner= "\n"
"BAJA v2.31 - Synchronet Shell/Module Compiler - "
"BAJA v2.32 - Synchronet Shell/Module Compiler - "
"Copyright 2001 Rob Swindell\n";
char *usage= "\n"
......
......@@ -463,6 +463,7 @@ enum {
,COPY_CHAR // Copy cmdkey to int var or str var
,SHIFT_TO_FIRST_CHAR // Shift str var to first occurance of static char
,SHIFT_TO_LAST_CHAR // Shift str var to last occurance of static char
,MATCHUSER // Set int var to user number of user name (str var)
};
/* Preceeded by CS_STR_FUNCTION */
......
......@@ -987,6 +987,19 @@ int sbbs_t::exec_misc(csi_t* csi, char *path)
csi->logic=LOGIC_TRUE;
return(0);
case MATCHUSER:
lp=getintvar(csi,*(long *)csi->ip);
csi->ip+=4;
pp=getstrvar(csi,*(long *)csi->ip);
csi->ip+=4;
if(lp) {
if(pp && *pp)
*lp=matchuser(&cfg, *pp);
else
*lp=0;
}
return(0);
default:
errormsg(WHERE,ERR_CHK,"var sub-instruction",*(csi->ip-1));
return(0); }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment