Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Release] Simple parameter checking for GM commands (stop GMs from crashing w/cmds)

Status
Not open for further replies.
Initiate Mage
Joined
Apr 20, 2008
Messages
3
Reaction score
0
Tired of GMs crashing the server because they forgot to add a parameter? To prevent this, use this simple check.

I've used this successfully with summon, item, job & level, and I'm sure it can be added to other commands too.

Don't ask me for support, because if you can't figure this out with the steps below, you shouldn't be bothering to make changes yourself. Wait for a repack with this implemented. This is not anti-leech. I'm just anti-stupid.


Repeat steps 1-3 as many times necessary, e.g., if you want level, job, summon & item fixed, repeat 4 times.

STEP 1

In players.cpp, look for:
Code:
else if(strcmp(command, "[B][U]xxxx[/U][/B]") == 0){

where xxxx = item, job, level or summon

STEP 2

and underneath it, add:
Code:
if(strlen(next_token) == 0){
				PlayersPacket::ShowNotice(player, "Enter valid parameter.", 1);
			}
			else
			{

STEP 3

and at the bottom of each command, right before the next
Code:
else if (command, "xxxxx" == 0 )

add

Code:
}

to close off the else statement started in step 2.
 
Last edited:
Master Summoner
Joined
Apr 2, 2008
Messages
538
Reaction score
0
Re: [Release] Parameter checking for GM commands (stop GMs from crashing w/certain cm

that sucks, there must be one line you just add on top to make it work for all of the commands. -.-
 
Initiate Mage
Joined
Apr 20, 2008
Messages
3
Reaction score
0
Re: [Release] Parameter checking for GM commands (stop GMs from crashing w/certain cm

that sucks, there must be one line you just add on top to make it work for all of the commands. -.-

The way it's written, there is no one liner available as a fix, since most commands don't require parameter input at all.

The other alternative is to re-write chatHandler completely, but that's more of a pain than making these simple changes :D
 
Master Summoner
Joined
Apr 2, 2008
Messages
538
Reaction score
0
Re: [Release] Parameter checking for GM commands (stop GMs from crashing w/certain cm

True, I guess its a good script to put on certain ones that crashes.
 
Initiate Mage
Joined
Apr 20, 2008
Messages
3
Reaction score
0
Re: [Release] Parameter checking for GM commands (stop GMs from crashing w/certain cm


Had I known about yours, I probably wouldn't of bothered releasing this. This forum needs a better way to show releases.

BTW, the way you told me this was childish. You could have just said, 'I did something similar, take a look here' and I would have gotten the hint.
 
Newbie Spellweaver
Joined
Apr 11, 2008
Messages
13
Reaction score
0
Re: [Release] Parameter checking for GM commands (stop GMs from crashing w/certain cm

I just do
if(strlen(next_token) == 0){

and add a extra { at the end of the command strip
 
Elite Diviner
Joined
Jan 15, 2008
Messages
417
Reaction score
7
Re: [Release] Parameter checking for GM commands (stop GMs from crashing w/certain cm

nice quick fix
 
Status
Not open for further replies.
Back
Top