Level 255 bug
Some people on my server found themselves to be level 255, even though #level is built to prevent > 65 as an argument. The bug happens when a lower priveleged user targets an NPC and types #level 255.
The bug is in client.cpp, and here's the fix if you want it. (Note, I decided to make it so server ops can set level > 65 on a target) Code:
bool Client::PrivUser(const Seperator* sep){ |
Hmm with the code you posted any GM/Statused people specifically those with or over 100 status or those with or over 200 for the if(!target->IsNPC() && ((this->admin < 200) && (level>65))) command wont be able to set the levels of PC/NPCS.
o.O Might want to reverse that " < " sign to " > " :0)~ |
The code posted above does:
* Users (< 100 status) can only set levels on themselves * Users (< 100 status) can only set their level to 0 < level < 66 * GM's (< 200 status) can set level on any PC to 0 < level < 66 * GM's (< 200 status) can set level to be anything in range on an NPC * Server Ops can set any level on any target |
OK I see what your intentions are, forgive me as I have this legit server mentality going on and seen it as a flaw :)
|
hmm
Is admin different from this->admin?
you use both in that snippet, I figure it would be better to use one or the other for consistency if not for bug prevention. I would recommend: Code:
else if (this->admin < 100) { |
admin are this->admin are always the same, unless you do something very wrong.
this is a pointer to current object(in this case the Client class that sent the message) since their isn't a local variable named admin in the function, it goes to the class to look and there is a variable, boom uses it this->admin basically does the same thing, but would work if someone made a local varible admin |
Exactly
I know in this case they end up equivalent, but I feel safer without assuming the compiler knows what I'm thinking, especially in multi-dev projects ;)
|
All times are GMT -4. The time now is 08:15 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.