Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2013, 07:13 PM
Envisage
Sarnak
 
Join Date: Mar 2010
Posts: 45
Default

Actually after doing some further research on the skill system, I've found and I'm almost ready to call it a bug. I'm going to put something in that logs so I can actually see the data thats being sent, and whats actually being loaded.

The reason it appears to be a bug. Logged in with different clients each producing different results for instance brass instruments and other skills I set in the db in skill_caps are trainable at different levels depending on what client your using. Same with a lot of other skills. It appears as if the server is trusting the client to handle what level all the skills are trained at and never checking to see if the client can actually train them by level.

Something is getting lost in translation. I actually believe its the server loading the skills. Bards to my knowledge have never gained pick lock at level 10. Even on live today still don't. Caps are correct unless you have them 0'd out till X level so when skills are loaded they are set to that level to train. Then they are using (5+(level*5)).

So far titanium is the least bugged client with only 4 skills out of wack. SoD it gets a lot worse.

Odd thing is this line in the code.

Code:
//you can only use your own trainer, client enforces this, but why trust it
I know its just a comment, but it appears we are trusting the client with the whole skill system. Thats bad. I'm not the best coder in the world but I can't find a check anywhere to make sure client can train at x level. There should be something somewhere storing level data a skill can be trained at but I can't find it, or this would be easy to fix. Looks like the skill system got overlooked. Or there is a valid reason why its like this.

If I had a bit more knowledge I'd try to write a hook client side to set the level down I bet I could train every skill at level 1. Well 5 of them at least.

The way skills are loaded looks to need redone.

Really though in titanium its not that bad its only 4 skills. meditate, sense traps, pick lock, and disarm traps. But maybe a dev wants to look into it cause it just seems highly exploitable.
Reply With Quote
  #2  
Old 08-20-2013, 09:40 PM
Mariomario
Hill Giant
 
Join Date: Jul 2004
Posts: 143
Default

Skills handled by client are what I posted about in your other thread. Within the resource folder for SoD+ clients there is a SkillCaps.txt file which holds literally your entire skill_caps table full of data. If something is changed around in that text file it is seen client side when you load in game. If you remove all of say skill_id 1 from paladins, in game you would no longer see them as being able to train 2 Hand Slashing.
__________________
Wrath - Lead Admin and Owner of Enlightened Dark: Ascension

Enlightened Dark: Ascension
Reply With Quote
  #3  
Old 08-21-2013, 12:36 AM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

These aren't 100% related.

In terms of the verification server side see:
Code:
		if(!CanHaveSkill(skill)) {
			mlog(CLIENT__ERROR, "Tried to train skill %d, which is not allowed.", skill);
			return;
		}

		uint16 skilllevel = GetRawSkill(skill);
		if(skilllevel == 0) {
			//this is a new skill..
			uint16 t_level = SkillTrainLevel(skill, GetClass());
			if (t_level == 0)
			{
				return;
			}
			SetSkill(skill, t_level);
		}
It appears that it will bail out if you can't learn the skill. It will also bail out if SkillTrainLevel() is zero (never can train the skill). Though that doesn't appear to be good enough so I'll take a look at it.


The other bug you're talking about is a client bug that appears because sony's skillcaps does not play nice with the client.

The following script is one that's been tossed around a bit for creating a non-buggy skillcaps file from the current DB.
Code:
use DBI;

my $db = "eqdb";
my $user = "user";
my $pass = "password";
my $host = "localhost";
my $skill_caps_file = "SkillCaps.txt";
my $source = "DBI:mysql:database=$db;host=$host";
my $dbh = DBI->connect($source, $user, $pass) || die "Could not create db handle\n";

sub skill_usable {
    my $skill_id = shift;
    my $class = shift;
    
    my $sth = $dbh->prepare("SELECT max(`cap`) FROM skill_caps WHERE `class`=$class and `skillID`=$skill_id");
    $sth->execute();
    if(my $val = $sth->fetch()) {
        if(@$val[0] == 0) {
            return 0;
        } else {
            return 1;
        }
    }
    
    return 0;
}

sub get_skill {
    my $skill_id = shift;
    my $class = shift;
    my $level = shift;
    
    my $sth = $dbh->prepare("SELECT cap FROM skill_caps WHERE `class`=$class and `skillID`=$skill_id and `level`=$level");
    $sth->execute();
    if(my $val = $sth->fetch()) {
        return @$val[0];
    }
    
    return 0;
}

open(SKILLS, ">$skill_caps_file") or die "Unable to open skills file for export: $skill_caps_file\n";

for($class_i = 1; $class_i <= 16; $class_i++) {
    for($skill_i = 0; $skill_i <= 77; $skill_i++) {
        print "($class_i, $skill_i)\n";
        if(skill_usable($skill_i, $class_i) == 1) {
            for($level_i = 1; $level_i <= 90; $level_i++) {
                my $cap = get_skill($skill_i, $class_i, $level_i);
                my $line = $class_i . "^" . $skill_i . "^" . $level_i . "^" . $cap . "^0\n";
                print SKILLS $line;
            }
        }
    }
}

close (SKILLS);
Reply With Quote
  #4  
Old 03-22-2024, 10:06 PM
DevaDestroyer
Fire Beetle
 
Join Date: Mar 2024
Location: Bible Belt
Posts: 1
Default

is this still not fixed?
Reply With Quote
Reply

Thread Tools
Display Modes

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 01:18 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