]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/gamecommand.qc
RPN: offer the digest_hex command
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / gamecommand.qc
index 518cf74971a645dde3c412c1a1eaabee9b5ae1b8..c2b986bb889a9ebd3afb64a87cd2bd325f9f92ba 100644 (file)
@@ -191,6 +191,8 @@ float GameCommand_Generic(string command)
                print("    s localtime -----------------------> s   : formats the current local time\n");
                print("    s gmtime --------------------------> s   : formats the current UTC time\n");
                print("    time ------------------------------> f   : seconds since VM start\n");
+               print("    s /MD4 digest ---------------------> s   : MD4 digest\n");
+               print("    s /SHA256 digest ------------------> s   : SHA256 digest\n");
                print("    Set operations operate on 'such''strings'.\n");
                print("    Unknown tokens insert their cvar value.\n");
                print("  maplist add map\n");
@@ -790,6 +792,9 @@ float GameCommand_Generic(string command)
                                        rpn_set(strftime(FALSE, rpn_get()));
                                } else if(rpncmd == "time") {
                                        rpn_pushf(time);
+                               } else if(rpncmd == "digest") {
+                                       s = rpn_pop();
+                                       rpn_set(digest_hex(s, rpn_get()));
                                } else {
                                        rpn_push(cvar_string(rpncmd));
                                }