diff options
author | brianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-04 08:22:53 +0000 |
---|---|---|
committer | brianluau <brianluau@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-05-04 08:22:53 +0000 |
commit | 1c5e4a6caf2e70592c80202e7222e895a67b5f10 (patch) | |
tree | 1de75be79bf2539b1bb55e460dc8d4b3504624d1 /src/map/script.c | |
parent | 5a0c79ee6c863ffeed86c325d4ecd7708cc12b58 (diff) | |
download | hercules-1c5e4a6caf2e70592c80202e7222e895a67b5f10.tar.gz hercules-1c5e4a6caf2e70592c80202e7222e895a67b5f10.tar.bz2 hercules-1c5e4a6caf2e70592c80202e7222e895a67b5f10.tar.xz hercules-1c5e4a6caf2e70592c80202e7222e895a67b5f10.zip |
* Added the md5() script command. (follow up to r13719)
- Changed kafra storage password to be stored as md5 hash in #kafra_code$.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13728 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r-- | src/map/script.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c index 0bd5bbb35..a29b08423 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -9,6 +9,7 @@ #include "../common/cbasetypes.h" #include "../common/malloc.h" +#include "../common/md5calc.h" #include "../common/lock.h" #include "../common/nullpo.h" #include "../common/showmsg.h" @@ -11900,6 +11901,7 @@ BUILDIN_FUNC(pow) script_pushint(st,(int)i); return 0; } + BUILDIN_FUNC(distance) { int x0, y0, x1, y1; @@ -11914,6 +11916,19 @@ BUILDIN_FUNC(distance) } // <--- [zBuffer] List of mathematics commands + +BUILDIN_FUNC(md5) +{ + const char *tmpstr; + char *md5str; + + tmpstr = script_getstr(st,2); + md5str = (char *)aMallocA((32+1)*sizeof(char)); + MD5_String(tmpstr, md5str); + script_pushstr(st, md5str); + return 0; +} + // [zBuffer] List of dynamic var commands ---> BUILDIN_FUNC(setd) @@ -13900,6 +13915,7 @@ struct script_function buildin_func[] = { BUILDIN_DEF(pow,"ii"), BUILDIN_DEF(distance,"iiii"), // <--- [zBuffer] List of mathematics commands + BUILDIN_DEF(md5,"s"), // [zBuffer] List of dynamic var commands ---> BUILDIN_DEF(getd,"*"), BUILDIN_DEF(setd,"*"), |