PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
.set_uo_expansion and sendStats packet hook

 
Post new topic   Reply to topic    PenUltima Online Forum Index -> Development Discussion
Display posts from previous:   

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 500

PostPosted: Sat Mar 31, 2007 5:55 am    Post subject: .set_uo_expansion and sendStats packet hook Reply with quote

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?

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Sat Mar 31, 2007 7:56 am    Post subject: Reply with quote

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 Smile )

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 500

PostPosted: Sat Mar 31, 2007 9:20 am    Post subject: Reply with quote

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!

Author Message
tekproxy
Distro Developer


Joined: 06 Apr 2006
Posts: 350
Location: Nederland, Texas

PostPosted: Sat Mar 31, 2007 9:53 am    Post subject: Reply with quote

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. Very Happy

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Sat Mar 31, 2007 10:51 am    Post subject: Reply with quote

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 Very Happy

Same for pickup packet...

Mwuahahaha Mad

Author Message
MontuZ
Distro Developer


Joined: 10 Feb 2006
Posts: 286
Location: Myrtle Beach, South Carolina

PostPosted: Sat Mar 31, 2007 4:45 pm    Post subject: Reply with quote

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 Very Happy

Same for pickup packet...

Mwuahahaha Mad


Agreed. Evil or Very Mad

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

Author Message
tekproxy
Distro Developer


Joined: 06 Apr 2006
Posts: 350
Location: Nederland, Texas

PostPosted: Sat Mar 31, 2007 8:48 pm    Post subject: Reply with quote

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. Wink

[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 Sun Apr 01, 2007 1:34 am; edited 1 time in total

Author Message
MuadDib
POL Developer


Joined: 13 Feb 2006
Posts: 830
Location: Indiana, USA

PostPosted: Sun Apr 01, 2007 12:52 am    Post subject: Reply with quote

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 Smile

Post new topic   Reply to topic    PenUltima Online Forum Index -> Development Discussion All times are GMT - 4 Hours
Page 1 of 1

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty