Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Bugs

Archive::Bugs Archive area for Bugs's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 06-09-2003, 02:15 AM
Merth
Dragon
 
Join Date: May 2003
Location: Seattle, WA
Posts: 609
Default 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){
...
if ((strcasecmp(sep->arg[0], "#level") == 0)) {
	int16 level = atoi(sep->arg[1]);
	if ((level <= 0) || ((level > 65) && (this->admin < 100)) ) {
		Message(0, "Error: #Level: Invalid Level");
	}
	else if (admin < 100) {
		this->SetLevel(level, true);
	}
	else if (!target) {
		Message(0, "Error: #Level: No target");
	}
	else {
		if (!target->IsNPC() && ((this->admin < 200) && (level > 65))) {
			Message(0, "Error: #Level: Invalid Level");
		}
		else
		{
			target->SetLevel(level, true);
		}
	}

...
Reply With Quote
  #2  
Old 06-09-2003, 08:33 PM
Zern
Sarnak
 
Join Date: Nov 2002
Posts: 35
Default

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)~
Reply With Quote
  #3  
Old 06-10-2003, 01:53 AM
Merth
Dragon
 
Join Date: May 2003
Location: Seattle, WA
Posts: 609
Default

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
Reply With Quote
  #4  
Old 06-10-2003, 04:37 AM
Zern
Sarnak
 
Join Date: Nov 2002
Posts: 35
Default

OK I see what your intentions are, forgive me as I have this legit server mentality going on and seen it as a flaw
Reply With Quote
  #5  
Old 06-10-2003, 05:42 AM
gej302
Sarnak
 
Join Date: May 2003
Location: Silverfist
Posts: 42
Default 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) {
      this->SetLevel(level, true);
Reply With Quote
  #6  
Old 06-10-2003, 06:00 AM
kathgar
Discordant
 
Join Date: May 2002
Posts: 434
Default

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
__________________
++[>++++++<-]>[<++++++>-]<.>++++[>+++++<-]>[<
+++++>-]<+.+++++++..+++.>>+++++[<++++++>-]<+
+.<<+++++++++++++++.>.+++.------.--------.>+.
Reply With Quote
  #7  
Old 06-10-2003, 06:14 AM
gej302
Sarnak
 
Join Date: May 2003
Location: Silverfist
Posts: 42
Default 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
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 07:35 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3