PenUltima Online

It is currently Sat Sep 06, 2008 1:18 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: .set_uo_expansion and sendStats packet hook
PostPosted: Sat Mar 31, 2007 1:55 am 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 547
This is a problem I am having with the sendStats packethook 1.0 written by MuadDib. It's in the 097 distro. I am using 097 rc2.

It all works fine if .set_uo_expansion for the player is "T2A", but if I set it to "AOS" or "ML" the HandleExtended function doesn't like it.

In this function are the lines:

Quote:
var packet_mode := packet.GetInt8(42);
case(packet_mode)
0: return 0;
1: chk := 1;
3: return 0; // In case we messed up, do nothing
4: return 0; // In case we messed up, do nothing
default: return 0;
endcase

Setting set_uo_expansion to AOS or ML sets the packet_mode to 4 using a v4 client and so the function exits early.

Not being anywhere near competent in packethooks I have no clue why 4 was tested to be a bad value and exit the script. According to the statusbar packet info 0x11, this packet can legitimately have 3 or 4 or 5. Is there a reason this thought to be an error to exit the script?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 3:56 am 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
At the time that was made, 3 and 4 was never used by the core, that is why. Now it is. They are now sent by the core for the higher expansions, so that check can probably be removed (Haven't looked at the code in ages :) )

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 5:20 am 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 547
Yep, enabling 4 works fine as far as I can tell.
I also enabled 3, 4, 5 to cover all the eventualities.

So Tekproxy has another fix to put in!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 5:53 am 
Offline
Distro Developer
User avatar

Joined: Thu Apr 06, 2006 5:11 pm
Posts: 350
Location: Nederland, Texas
Yes indeedy. I'll get around to that later today I have to go to work on this saturday. I made some other mods to it so it would correctly send other stats like resistances. I'd have to dig around for a while.

Keep 'em comin guys. It keeps me busy while I can't code. :-D


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 6:51 am 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
Keep em coming eh............


Should implement a packet hook with dbl click, that disables it via a cfg setting for the cmd level. Low level staff should be walking ghosts :D

Same for pickup packet...

Mwuahahaha :x

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 12:45 pm 
Offline
Distro Developer
User avatar

Joined: Fri Feb 10, 2006 8:08 am
Posts: 313
Location: Myrtle Beach, South Carolina
MuadDib wrote:
Keep em coming eh............


Should implement a packet hook with dbl click, that disables it via a cfg setting for the cmd level. Low level staff should be walking ghosts :D

Same for pickup packet...

Mwuahahaha :x


Agreed. :evil:

Dropping, trading, lol same packet for those last three though.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 4:48 pm 
Offline
Distro Developer
User avatar

Joined: Thu Apr 06, 2006 5:11 pm
Posts: 350
Location: Nederland, Texas
How about fixing the bug mentioned in the code, here:
Code:
// These SHOULD be 1 lower for position, and using 16 not 8, but it does it wrong with core >:(
// Tithing should be a 32, position 84 also. SetInt16 will not pad the packet correctly is why.
// Instead of SetInt16(70, 5) making it 0005, it makes it 0500 if I remember right. BOOOOO


And while you're at it, fix all the other bugs too. Thanks. ;)

[edit]Added the fix OldnGrey suggested, didn't remove the check just yet. Added in sending resistances and added a little more code to make adding luck and tithing just a tad easier. Muad is so nice for commenting his code so much.[/edit]


Last edited by tekproxy on Sat Mar 31, 2007 9:34 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 31, 2007 8:52 pm 
Offline
POL Developer
User avatar

Joined: Sun Feb 12, 2006 9:50 pm
Posts: 836
Location: Indiana, USA
Those are on my list with 098 actually.

Also tek, your note in the SVN log about resistances. That's up to you, if the distro actually uses the different resistances, then it should be showable in the packet :)

_________________
POL Developer - The Penguin Scripter


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl