Bug in Pushthrough hook?

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

Moderator: POL Developer

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

Bug in Pushthrough hook?

Post by bodom » Mon May 04, 2015 10:11 pm

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
POL Developer
Posts: 136
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Bug in Pushthrough hook?

Post by bodom » Mon May 04, 2015 10:18 pm

I've just realized that I've posted in the wrong section. My apologies.

Turley
POL Developer
Posts: 644
Joined: Sun Feb 05, 2006 4:45 am

Re: Bug in Pushthrough hook?

Post by Turley » Tue May 05, 2015 2:22 am

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: 475
Joined: Tue Feb 21, 2006 5:08 pm

Re: Bug in Pushthrough hook?

Post by Tomi » Tue May 05, 2015 11:23 am

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
POL Developer
Posts: 136
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Bug in Pushthrough hook?

Post by bodom » Wed May 06, 2015 12:49 am

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: 311
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Bug in Pushthrough hook?

Post by Harley » Wed May 06, 2015 3:58 pm

I have this problem too!
Tell me please, how did you patch your client?

bodom
POL Developer
Posts: 136
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Bug in Pushthrough hook?

Post by bodom » Sun May 10, 2015 12:12 am

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 » Sun May 17, 2015 2:06 am

Interesting tool I shall use this one later on my project. Here's a link for the lazy ones SUMP.

Harley
Forum Regular
Posts: 311
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Bug in Pushthrough hook?

Post by Harley » Mon Oct 24, 2016 12:09 pm

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: 348
Joined: Fri Feb 20, 2009 8:30 pm

Re: Bug in Pushthrough hook?

Post by RusseL » Tue Oct 25, 2016 6:55 am

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: 311
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Bug in Pushthrough hook?

Post by Harley » Tue Oct 25, 2016 7:50 am

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: 311
Joined: Sat Mar 18, 2006 1:41 am
Location: Germany

Re: Bug in Pushthrough hook?

Post by Harley » Tue Oct 25, 2016 12:56 pm

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: 348
Joined: Fri Feb 20, 2009 8:30 pm

Re: Bug in Pushthrough hook?

Post by RusseL » Wed Oct 26, 2016 3:25 am

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