[Plugin] mcmd Command Engine - Plugin based command processing
#21

@Slash : Then give us a logical explaination to the fact mcmd is slower than zcmd for example :

• mcmd skips a huge part of SAMP's default command processing
• mcmd doesn't interact with the pawn but directly with the server
• zcmd uses OnPlayerCommandText when mcmd doesn't

If you can give me one which could be correct, then I'd start to believe what you say.
Reply
#22

Quote:
Originally Posted by S4t3K
Посмотреть сообщение
@Slash : Then give us a logical explaination to the fact mcmd is slower than zcmd for example :

• mcmd skips a huge part of SAMP's default command processing
• mcmd doesn't interact with the pawn but directly with the server
• zcmd uses OnPlayerCommandText when mcmd doesn't

If you can give me one which could be correct, then I'd start to believe what you say.
I'm no expert, but
"mcmd doesn't interact with the pawn but directly with the server" is bullshit. This plugin is supposed to do something with the user's input, right? Which means it is interaction with the amx runtime.
"zcmd uses OnPlayerCommandText when mcmd doesn't": so what? It's still accessing the runtime.
"mcmd skips a huge part of SAMP's default command processing": samp doesn't do anything but call a single callback; this isn't heavy or very time-consuming.
Reply
#23

Never seen this before.


I'll use it if ****** and Kalcor approve of it.

But as far as im concerned isnt Memory hacking banned for samp?
Reply
#24

Quote:
Originally Posted by ikkentim
Посмотреть сообщение
I'm no expert, but
"mcmd doesn't interact with the pawn but directly with the server" is bullshit. This plugin is supposed to do something with the user's input, right? Which means it is interaction with the amx runtime.
"zcmd uses OnPlayerCommandText when mcmd doesn't": so what? It's still accessing the runtime.
"mcmd skips a huge part of SAMP's default command processing": samp doesn't do anything but call a single callback; this isn't heavy or very time-consuming.
+1 This is a total defect
Reply
#25

Quote:
Originally Posted by SlashPT
Посмотреть сообщение
No.. The speed must be measured by the run time it takes until pawn can call the next function.. and it seems that it's slower than other command processors..
It does. The speedtest by ****** creates a hook to OnPlayerCommandText which will then call the zcmd code. This does not work with mcmd as OnPlayerCommandText was erased. So to test the speed I've created a native function to call the internal detour. There is no other way to measure mcmd, so saying it's slower is wrong.

Quote:
Originally Posted by ikkentim
Посмотреть сообщение
I'm no expert, but
"mcmd doesn't interact with the pawn but directly with the server" is bullshit. This plugin is supposed to do something with the user's input, right? Which means it is interaction with the amx runtime.
"zcmd uses OnPlayerCommandText when mcmd doesn't": so what? It's still accessing the runtime.
"mcmd skips a huge part of SAMP's default command processing": samp doesn't do anything but call a single callback; this isn't heavy or very time-consuming.
1. It means that mcmd doesn't need OnPlayerCommandText be called in order to retrieve playerid and cmdtext like other plugin based cmd processors. Please read the thread carefully before calling it bullshit.
2. I'm not sure what you mean by runtime but mcmd skips all that and just calls OnPlayerRequestCommand and afterwards the command itself; less than zcmd does.
3. You can't see it that way. When SA-MP calls OnPlayerCommandText, no command processing has been done yet, just the callback was called, nothing else.

Quote:
Originally Posted by sammp
Посмотреть сообщение
I'll use it if ****** and Kalcor approve of it.
Why do you need their approval? As long as it runs stable you should decide by facts. But at it's current state nobody should use mcmd for other than testing.

Quote:
Originally Posted by Ciandlah
Посмотреть сообщение
+1 This is a total defect
Why don't you guys read the thread or check the source? I haven't even created this to reveal a "better" cmd processor to you. y_commands is already perfect with it's speed and functions.
So please don't see mcmd as a competitor; it's just my work I wanted to show.
Reply
#26

Quote:
Originally Posted by Mellnik
Посмотреть сообщение
1. It means that mcmd doesn't need OnPlayerCommandText be called in order to retrieve playerid and cmdtext like other plugin based cmd processors. Please read the thread carefully before calling it bullshit.
2. I'm not sure what you mean by runtime but mcmd skips all that and just calls OnPlayerRequestCommand and afterwards the command itself; less than zcmd does.
3. You can't see it that way. When SA-MP calls OnPlayerCommandText, no command processing has been done yet, just the callback was called, nothing else.
1. Yes, as it injects right into the servers command processing, it's a layer right on/in the server process. No, it still touches the amx machine when a command is entered to execute logic. Please read S4t3k's statement before you call my bullshit bullshit
2. What I mean is that it still touches the amx machine, it still executes logic. The only moment the amx machine isn't touched is when an invalid command is entered (unless OnPlayerRequestCommand is called; idk, didn't test).
3. He says samp's default command processing and as you just kindly explained, there is no default processing, only processing scripted in pawn (which is none by default).

Quote:

Why don't you guys read the thread or check the source? I haven't even created this to reveal a "better" cmd processor to you. y_commands is already perfect with it's speed and functions.
So please don't see mcmd as a competitor; it's just my work I wanted to show.

I'm not saying this to blame your performance. I agree with you that trying to create an extremely fast command processor is unnecessary. In no situation more than 1000 commands are called in one second. Creating the most efficient command processor is just somewhat of a tournament on these forums. I totally like what you made and it is a creative way of doing it. I was merely stating that S4t3k's post is wrong.
Reply
#27

You deserve a cookie, just cuz of this: http://i.imgur.com/veUXSa2.png
Did you really printed and used a pen? haven't seen it for a while in the PC world.
Reply
#28

@ikkentim : I don't think it was completely wrong. Have to say that I run to express myself without really thinking. If I discredited Mellnik work in any way, I ask to both of you to excuse me.
Reply
#29

Nice job Mellnik. Can you tell how can i compile it for linux?
Reply
#30

Oh man you released it too late :/ . My gamemode is already using ZCMD and converting to mcmd is impossible! Because it have too many cmds........

Anyways Great Work. Keep it up!

+REP [You will receive within 24 hours, just ran out of giving reps]
Reply
#31

Quote:
Originally Posted by ikey07
View Post
You deserve a cookie, just cuz of this: http://i.imgur.com/veUXSa2.png
Did you really printed and used a pen? haven't seen it for a while in the PC world.
Haha yeah, helped me to understand it better.

Quote:
Originally Posted by nGen.SoNNy
View Post
Nice job Mellnik. Can you tell how can i compile it for linux?
It won't work on Linux yet anways so don't even try...

Quote:
Originally Posted by FahadKing07
View Post
Oh man you released it too late :/ . My gamemode is already using ZCMD and converting to mcmd is impossible! Because it have too many cmds........
Are you aware of CTRL + H? Makes life easier a lot :P
Reply
#32

Mellnik : There's actually a faster way than CTRL + H.

PHP Code:

#define CMD:%0(%1, %2) mcmd:%0(%1, %2) 
Reply
#33

Quote:
Originally Posted by S4t3K
View Post
Mellnik : There's actually a faster way than CTRL + H.

PHP Code:

#define CMD:%0(%1, %2) mcmd:%0(%1, %2) 
Oh yea. Thats a good idea. I will try it
Reply
#34

you could just ctrl + h
CMD:
mcmd:
Reply
#35

Got a Linux version up. The -03 optimization (on gcc 4.8.2?) made my hook function naked..

Would love some feedback
mcmd.so
Reply
#36

Now that there is a linux version, I may finally test, I think I have already repped you fro this, don't remember... But I love the idea...

Also I want to recommend something, just to make this look better!
pawn Code:
public OnPlayerRequestCommand(playerid, cmdtext[], exists)
{
     if(!exists)
     {
          SendClientMessage(playerid, 0xFFFFFFFF, "This command does not exist!");
          return 0;
     }
     return 1;
}
I think you should change this to...
pawn Code:
public OnPlayerRequestCommand(playerid, cmdtext[], exists)
{
     if(!exists)
     {
          new Tmp[55];
          format(Tmp, sizeof(Tmp), "The command <%s> does not exist, please check /cmds!", cmdtext);
          SendClientMessage(playerid, 0xFFFFFFFF, Tmp);
          return 0;
     }
     return 1;
}
It just makes your callback look really fancy...

EDIT: If there are mistakes in my example it's because i'm on my phone.
Reply
#37

Well, what does change between your example and Mellnik's one ?

It's the same callback with the same parameters. It's just an efficient way to use all the parameters of the callback.

Most servers (based on old GF/LARP) have just a "This command doesn't exist. Please check /help" when a command doesn't exist. It's just to show how to do instead of using OnPlayerCommandText (because you don't here).
Reply
#38

Great, So this is better or zcmd or ycmd
Reply
#39

And what should i do with things like:
pawn Code:
cmd_claninfo( playerid, inputtext );
?

And also.. can i change this.. with something better?
pawn Code:
format( gsString, 56, "/setrank %d %d", InvitedClanID[ playerid ], liRank );
return CallRemoteFunction( "OnPlayerCommandText", "is", playerid, gsString );
Reply
#40

Wow! Amazing!
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)