Jump to content
  • 0

password for all commands


Question

5 answers to this question

Recommended Posts

Posted (edited)

damn ... 2 hours on this single topic

my source coding knowledge totally gone

 

 src/map/atcommand.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/map/atcommand.c b/src/map/atcommand.c
index a5232f4..0a475b8 100644
--- a/src/map/atcommand.c
+++ b/src/map/atcommand.c
@@ -9750,6 +9750,19 @@ bool is_atcommand(const int fd, struct map_session_data* sd, const char* message
 	if( sscanf(atcmd_msg, "%99s %99[^\n]", command, params) < 2 )
 		params[0] = '\0';
 
+	{
+		char aaa[100], bbb[100];
+		if ( sscanf( params, "%30s %99[^\n]", aaa, bbb ) != 2 ) {
+			clif_displaymessage( fd, "Input the password !" );
+			return false;
+		}
+		if ( strcmp( aaa, "qwer" ) ) {
+			clif_displaymessage( fd, "Wrong password" );
+			return false;
+		}
+		strcpy( params, bbb );
+	}
+
 	// @commands (script based)
 	if((type == 1 || type == 3) && atcmd_binding_count > 0) {
 		struct atcmd_binding_data * binding;
change the qwer into your desire password

although seriously, you should've limit your GM to use which command by setting in rathena\conf\groups.conf

EDIT: I made this for password into all command <.<

you mean just 1 single command ?

Edited by AnnieRuru
Posted

.... anti hack for commands :D

now this is interesting

in which cases that you want to be anti-hack ?

I don't think a simple source code like this can achieve "anti-hack"

... level 2 gm up to 99

just add if ( pc_get_group_level(sd) >= 2 && pc_get_group_level(sd) < 99 ) at the beginning there
Posted (edited)

+ if ( pc_get_group_level(sd) >= 2 && pc_get_group_level(sd) < 99 )
+    {
+        char aaa[100], bbb[100];
+        if ( sscanf( params, "%30s %99[^\n]", aaa, bbb ) != 2 ) {
+            clif_displaymessage( fd, "Input the password !" );
+            return false;
+        }

like this?

sorry madam im using eathena sql

if (getgmlevel() == "2")

i try to change the

+ if ( pc_get_group_level(sd) >= 2 && pc_get_group_level(sd) < 99 )

but is error

post-20646-0-77084700-1387814244_thumb.jpg

Edited by Blue Jem
Posted

there is no pc_get_group_level in the patch provided in this topic :blink:

 

achivement.c  .... what can be the error ... hm ?

I don't think I have ever touch achievement.c in rathena board before

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...