Should i change the command processor?
#1

Right now i'm having the old processor ...

if(strcmp(cmd, "/help", true) == 0)



Ok so i'm asking you: Would the change of all commands boost the performance of gamemode ? Right now
i'm having 398 commands with this processor.

The problem is i'm starting to 'see' a small delay between commands sometimes when the server is full ?



So

1. An guide about how to change the commands ? i mean to see some examples, i'm not stupid.
2. Is gonna make a boost of performance ?
3. What other things should i start 'change' right now i'm using Mysql R39 on the LARP Gamemode (Edited)
Reply
#2

I haven't been super active in a long while so I'm not sure if there's anything better than ZCMD/YCMD but I would use one of those with sscanf (unless as I say there's a faster method these days that I am not aware of).

You wouldn't really notice the difference using an older system like strtok if you had an empty server. However since players using those commands the server is having to process a lot of requests especially if a lot of users are using commands at the same time. Therefor I would say you are wise to think about upgrading to a better command processor.

Here's a wiki link that might help you a little. It shows the differences between using strtok and sscanf. There's a fair bit of information here so it should help you wish conversion of your commands system although it'll probably take you a while with that many commands :P
https://sampwiki.blast.hk/wiki/Fast_Commands
Reply
#3

The main difference is that strcmp commands are tested sequentially until the right one is found. But string comparisons are pretty slow. As such it will take longer to reach and execute commands that are at the bottom of the list compared to those that are at the top of the list. ZCMD or YCMD commands (but not DCMD) however call the function directly through CallLocalFunction.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)