Bug in Pushthrough hook?

Here you can post threads specific to the current release of the core (099)

Moderator: POL Developer

Post Reply
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Bug in Pushthrough hook?

Post by bodom »

Hi again,

I am trying to setup a simple Pushthrough hook, following the docs. Here is what i do.

1. In syshook.cfg, i add the following:

Code: Select all

SystemHookScript pushthrough.ecl
{
	Pushthrough Pushthrough
}
2. I create a pushthrough.src in the same package, with the following code:

Code: Select all

program PushthroughHook()
	Print( "Using PushthroughHook..." );
	return 1;
endprogram

exported function Pushthrough(walker, obstructors)
	print("Push " + walker.name);
	return 1;
endfunction
What the docs says:
Pushthrough:

params: CharRef character, Array of CharRefs in destination tile. When called: on EVERY move of EVERY character. Return: true if walk ok, false to block walk. Used to override core behavior for walking through tiles with other mobiles on them. Since this critical script is called so often, it is a very CPU expensive one to impliment.
What happens:
When the POL starts up, it says "Using PushthroughHook..." to confirm me the hook has been loaded correctly. When a character tries to push through a mobile, the POL still does standard checks, THEN calls my hook only if the check succeedes.
1. The character tries to push through
2a. If he's full stamina, the core will call my hook and use the return value
2b. If he's not full stamina, the core will just ignore my hook and prevent the character to move

What i would expect to happen:
I would expect the core to just skip the builting pushthrough checks and directly call my hook, in this way:
1. The character tries to push through
2. The core calls my hook and uses the return value
or even call the hook before every single move, just like the doc says.

I had a look the the related source code (charactr.cpp:3820) and concluded this could probably be a long-time bug that has never been reported because, by looking at the most famous distro scripts, it looks like nobody is using this feature.
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Bug in Pushthrough hook?

Post by bodom »

I've just realized that I've posted in the wrong section. My apologies.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Bug in Pushthrough hook?

Post by Turley »

Mmmh I looked into the code and I see no check for full stamina. The push through hook gets called as long as mobiles are on the spot. Please correct me if I'm wrong and you found the code line.
My guess is that the client itself disallows movement, at least if I remember correctly. You could verify it by attaching a pktlogger or by the internal .startlog. If no movement pkts get send you know that the client is the reason.
Tomi
POL Developer
Posts: 478
Joined: Tue Feb 21, 2006 5:08 pm

Re: Bug in Pushthrough hook?

Post by Tomi »

The problem with pushthrough hook is that is mostly unusable outside the trammel facet due to the current stamina >= max stamina check you found ( its in the client thats why Turley didnt find it in the core )

UOCH is capable to remove the stamina check from the client up to clients 7.0.0.0 iirc
Without the stamina patch all other facets than trammel are checking for stamina in the client.
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Bug in Pushthrough hook?

Post by bodom »

I confirm you it's a problem in the client preventing movement, the client needs to be patched and now everything works as expected.

Maybe you could add this info to the docs to prevent more newbies like me to fall on it?

Thank you!
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Bug in Pushthrough hook?

Post by Harley »

I have this problem too!
Tell me please, how did you patch your client?
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Bug in Pushthrough hook?

Post by bodom »

I've found a tool called "SUMP" by googling. I am sorry but i no longer have the download link. If you can't find it, PM me and I'll be happy to forward it to you,

It's like the client's swiss army knife, our flag is "-s":
Simple Ultima Multi Patcher .4
Currently supported UO clients: 4.x - 7.x
Note: wildcards are supported for filename. For example: *.exe

Usage: SUMP.exe <filename> <options>
Example: SUMP.exe client.exe -m -l -s -b -g -e -h

Options:
-m : Apply multi-uo patch which allows you to run multiple clients.
-l : Apply always light patch.
-s : Remove stamina check when pushing through mobiles.
-b : Apply Batlin's sleep patch to reduce CPU usage.
-g : Apply Garret's patch to display no-draw items.
-e : Remove protocol encryption (and decryption).
-h : Apply hifi's global sound patch which enables sound for minimized client.
blckfire
Apprentice Poster
Posts: 54
Joined: Thu Feb 26, 2015 10:28 am

Re: Bug in Pushthrough hook?

Post by blckfire »

Interesting tool I shall use this one later on my project. Here's a link for the lazy ones SUMP.
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Bug in Pushthrough hook?

Post by Harley »

Unfortunately, I didn't resolve that issue with client 7.0.3
When I tried to remove stamina check, it gave me:

Code: Select all

J:\Games\MULs\SUMP>SUMP.exe client.exe -s
Simple Ultima Multi Patcher .4
Currently supported UO clients: 4.x - 7.x
Attempting to patch "J:\Games\MULs\SUMP\client.exe"...

Stamina patch is unsuccessful, aborting...
I will be very greateful, if you know, how to remove that check from 7.0.3 client version.
With best regards!
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Bug in Pushthrough hook?

Post by RusseL »

Use britannia_alt as default realm and move all of your items and characters (edit data).
Client has no stamina check there and u will be able to run through peoples.
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Bug in Pushthrough hook?

Post by Harley »

RusseL, thanks for ur answer.

Yesterdat I tested with client 6.0.1 (with SUMP I can remove stamina check from client), and at britannia realm it works!
So, I suppose that there is a problem not in realm, but in client version.

I'll try your convenience and tell here.
Harley
Forum Regular
Posts: 360
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Bug in Pushthrough hook?

Post by Harley »

Yes, you were right, realm britannia_alt allows to push through npcs & pcs.
But with SUMP I removed from 6.0.1 stamina check and can in realm britannia push them too.

Anybody knows some prog to remove stamina check from clients >7.x...

With best regards!
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Bug in Pushthrough hook?

Post by RusseL »

Harley wrote:Yes, you were right, realm britannia_alt allows to push through npcs & pcs.
But with SUMP I removed from 6.0.1 stamina check and can in realm britannia push them too.
I use britannia_alt as default realm already for 5 years and dont care about client patches ;)
Post Reply