Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Tiberian Technologies / Blackhand Studios » Tiberian Technologies Forum » Hooking
Hooking [message #453653] Thu, 08 September 2011 20:49 Go to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
Besides what is provided in the default ssgm plugin, what other things are able to be hooked?

I see things such as AddKeyHook, addConnectionAcceptanceFilter,
from dllmain.cpp... Are there others such as hooking when the client is downloading resources?

and can someone explain how to use addConnectionAcceptanceFilter?


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*

[Updated on: Thu, 08 September 2011 20:54]

Report message to a moderator

Re: Hooking [message #453704 is a reply to message #453653] Fri, 09 September 2011 06:28 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

The SSGM plugin interface (see example plugin) basically contains all hooks that are available. You should use that instead of the Add...Hook functions, because contrary to what the name suggests, they support only a single hook, and SSGM is already using it. Calling the Add...Hook functions will often break SSGM or plugin functionality.

If there is any hook you think would be useful, let us know, so that we can implement it.

As for addConnectionAcceptanceFilter, best look at ConnectionAcceptanceFilter.h and BanSystem.cpp. A connection acceptance filter is basically used to check whether a user can join or not, and makes it possible to do some relatively time consuming background checking asynchronously without stalling the server and causing lag for all players ingame. This allows for "nice" banning of the player, instead of the join-and-kick behavior that was used before TT.

The ban system currently handles serial validation, and waits for the serial to be fetched before allowing the player to join. For example, this may be useful to implement route-based/"localnode" banning nicely without the join-and-kick bahavior.


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Hooking [message #453767 is a reply to message #453704] Fri, 09 September 2011 10:28 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
StealthEye wrote on Fri, 09 September 2011 09:28

For example, this may be useful to implement route-based/"localnode" banning nicely without the join-and-kick bahavior.


It has been detected that your a wanker from the UK and your ping would be too high to play with. Entrance denied.

Jk lol.

But I could see us onlly or uk only servers using this Smile

And the offer of you guys adding more hooks is a bad idea...I have a long list.

Direct connect detected hook. (I know how in ssgm 2..just not 4)
Resource download hook ( I was kicked off xwis yesterday because packages didn't download)
All the hooks from hooks.dll
Key hooks. All keys (or a good precentage of )

Thanks.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: Hooking [message #453815 is a reply to message #453653] Fri, 09 September 2011 12:24 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

How did you detect DC in SSGM 2?
What's the purpose of the ersource download hook? When would it trigger?
Can you list the hooks that are contained in hooks.dll?
As far as I know you can hook keys much like in previous versions of SSGM.


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Hooking [message #453862 is a reply to message #453815] Fri, 09 September 2011 18:17 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
	HMODULE hooks = LoadLibrary("hooks.dll");
	LoadHook(hooks, (void **)&RequestSerial, "RequestSerial");
	LoadHook(hooks, (void **)&AddSerialHook, "AddSerialHook");
	LoadHook(hooks, (void **)&AddLoadingEHook, "AddLoadingEHook");
	LoadHook(hooks, (void **)&AddDamageHook, "AddDamageHook");
	LoadHook(hooks, (void **)&AddChatEHook, "AddChatHook");
	LoadHook(hooks, (void **)&AddPingHook, "AddPingHook");
	LoadHook(hooks, (void **)&AddSuicideHook, "AddSuicideHook");
	LoadHook(hooks, (void **)&AddRadioHook, "AddRadioHook");



"As far as I know you can hook keys much like in previous versions of SSGM."

Its flakey, and doesnt hook most keys at all.. just things defined in keys.cfg. , and keys.cfg is a pain in the ass to deal with server and client wise.

"What's the purpose of the ersource download hook? When would it trigger?"
it would trigger the moment a player starts downloading the server's resources. if I am not mistaken this is before the player even joins... As it would be nice to see who is lagged behind waiting for there download to finish.

Daniel had some other hooks that were awesome, such as a player joined the channel and is debating joining the game. I will try to find his private source that I have to see what they were.

"How did you detect DC in SSGM 2?"
It was a combination of the player loading game event.. if there was only one event, it was a direct connect.

Also onbodydamage would be nice, as thne old headshot code was messed up and we couldnt detect shots properly.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*

[Updated on: Fri, 09 September 2011 18:18]

Report message to a moderator

Re: Hooking [message #453864 is a reply to message #453653] Fri, 09 September 2011 18:26 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
If I remember correctly that's the LoadingEHook.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Fri, 09 September 2011 18:28]

Report message to a moderator

Re: Hooking [message #453980 is a reply to message #453653] Sat, 10 September 2011 15:58 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

The connection acceptance filter runs before a player really joins. You can use it to detect when a client is joining the game. RequestSerial and SerialHook became obsolete. Radio hook is implemented as far as I know, as is a chat hook.

So the things remaining are:
- OnDamage
- OnPing (what does this do exactly?)
- OnSuicide
- OnDownloadStart
- direct connect (I still have no idea how this should be done properly without hooking wolapi, which may be a lot of work.)

The on body damage thing cannot be done; the server does not have that information.

I think these are low priority though; we will focus on fixing bugs first.


BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/

[Updated on: Sat, 10 September 2011 16:04]

Report message to a moderator

Re: Hooking [message #453982 is a reply to message #453653] Sat, 10 September 2011 16:16 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
If the onbodydamage cannot be hooked then how does the client know you been shot in the head or leg? And damage armor accordingly.

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: Hooking [message #453993 is a reply to message #453653] Sat, 10 September 2011 16:51 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

It doesn't. Smile Before TT, only the damager knew about this information. With TT, the server actually gets informed about this. So the hook would be possible for TT players only, but it is questionable whether it is useful if it is only known for TT clients. The server and other clients locally simulate the game and approximate if it would be a miss, body, neck, or headshot. This is also why you can visually get hit but lose no health, or vice versa.

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Hooking [message #454029 is a reply to message #453993] Sun, 11 September 2011 00:40 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
StealthEye wrote on Sat, 10 September 2011 19:51

This is also why you can visually get hit but lose no health, or vice versa.


That's kinda stupid.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: Hooking [message #454054 is a reply to message #453653] Sun, 11 September 2011 04:42 Go to previous messageGo to next message
EvilWhiteDragon is currently offline  EvilWhiteDragon
Messages: 3751
Registered: October 2005
Location: The Netherlands
Karma: 0
General (3 Stars)

You found out about this just now? Renegade has been like this since the first release.

http://www.blackintel.org/usr/evilwhitedragon/pointfix.gif
BlackIntel admin/founder/PR dude (not a coder)
Please visit http://www.blackintel.org/

V, V for Vendetta

People should not be afraid of their governments.
Governments should be afraid of their people.
Re: Hooking [message #454123 is a reply to message #453653] Sun, 11 September 2011 11:18 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
Yes, I was never told. Kind of like the SSGM TCP logging... idk if it was intentional or not but the delivery method looks exactly like what I made 1 year prior. FDSComm. all my events are labeled with numbers such as 001, 002.

I will be upgrading this for 4.0 some day soon, so if you haven't seen it you will.


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: Hooking [message #454140 is a reply to message #454029] Sun, 11 September 2011 12:28 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
halo2pac wrote on Sun, 11 September 2011 01:40

StealthEye wrote on Sat, 10 September 2011 19:51

This is also why you can visually get hit but lose no health, or vice versa.


That's kinda stupid.

Shooter's computer detects and does the damage, otherwise it'd be a real pain in the ass to kill people.

Basically it would give your target Ping+Ping delay time to move(a ping of 100 is equal to a second, which would mean they have 2 seconds to move).

IE: You unload a whole clip where a person is, but on the server they're over 10m and by the time your update gets to the server they've moved another 10m, so you miss. Hell, under those conditions even instant hit weapons like the sniper rifle would miss if the server did the detection.

Yes, this way does make it easier for people to cheat, but Westwood would have had to have made a much better on-line system if they wanted players to be able to kill each other otherwise.


Re: Hooking [message #454154 is a reply to message #453653] Sun, 11 September 2011 13:22 Go to previous messageGo to next message
EvilWhiteDragon is currently offline  EvilWhiteDragon
Messages: 3751
Registered: October 2005
Location: The Netherlands
Karma: 0
General (3 Stars)

Actually you can "fix" this by putting "uselagreduction=0" in the server.ini afaik. But trust me, you DO NOT WANT this.

http://www.blackintel.org/usr/evilwhitedragon/pointfix.gif
BlackIntel admin/founder/PR dude (not a coder)
Please visit http://www.blackintel.org/

V, V for Vendetta

People should not be afraid of their governments.
Governments should be afraid of their people.
Re: Hooking [message #454182 is a reply to message #454154] Sun, 11 September 2011 17:04 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3809
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
EvilWhiteDragon wrote on Sun, 11 September 2011 14:22

Actually you can "fix" this by putting "uselagreduction=0" in the server.ini afaik. But trust me, you DO NOT WANT this.

I'd assume that'd just make the clients not slide smoothly into their spots, but the damage detection would still be done client side correct?


Re: Hooking [message #454203 is a reply to message #453653] Sun, 11 September 2011 19:14 Go to previous messageGo to next message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
I have another hook like idea..
Idk if it is already implemented, but a Yes/No dialog box, and an htmlviewer that you can call to show ingame. (that ignores javascript, of course to prevent viruses.)


http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Re: Hooking [message #454228 is a reply to message #454182] Sun, 11 September 2011 23:53 Go to previous messageGo to next message
EvilWhiteDragon is currently offline  EvilWhiteDragon
Messages: 3751
Registered: October 2005
Location: The Netherlands
Karma: 0
General (3 Stars)

Jerad Gray wrote on Mon, 12 September 2011 02:04

EvilWhiteDragon wrote on Sun, 11 September 2011 14:22

Actually you can "fix" this by putting "uselagreduction=0" in the server.ini afaik. But trust me, you DO NOT WANT this.

I'd assume that'd just make the clients not slide smoothly into their spots, but the damage detection would still be done client side correct?

No that would move all damage detection serverside, not just for buildings but also for players. Will cause EPIC lag though. Well, not lag, but you're likely to not damage anything anyway...


http://www.blackintel.org/usr/evilwhitedragon/pointfix.gif
BlackIntel admin/founder/PR dude (not a coder)
Please visit http://www.blackintel.org/

V, V for Vendetta

People should not be afraid of their governments.
Governments should be afraid of their people.
Re: Hooking [message #454268 is a reply to message #453653] Mon, 12 September 2011 04:31 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

Indeed; uselagreduction moves damage calculation to the server. There is no setting to disable latency interpolation (what you are taking about) as far as I am aware, and it would be even more unplayable than when you disable uselagreduction. Razz

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Hooking [message #454288 is a reply to message #454203] Mon, 12 September 2011 07:30 Go to previous messageGo to next message
sla.ro(master) is currently offline  sla.ro(master)
Messages: 610
Registered: September 2010
Location: Romania
Karma: 0
Colonel
halo2pac wrote on Mon, 12 September 2011 05:14

I have another hook like idea..
Idk if it is already implemented, but a Yes/No dialog box, and an htmlviewer that you can call to show ingame. (that ignores javascript, of course to prevent viruses.)


htmlviewer is good idea, Counter-Strike/Half-Life has it
in CS, server sends the html code to client and client views it. i think is possible to have this with IE API


Creator of Mutant Co-Op
Developer of LuaTT
Re: Hooking [message #454303 is a reply to message #453653] Mon, 12 September 2011 08:22 Go to previous messageGo to next message
StealthEye is currently offline  StealthEye
Messages: 2518
Registered: May 2006
Location: The Netherlands
Karma: 0
General (2 Stars)

It's likely a lot of work and out of scope for 4.0.

BlackIntel admin/founder/coder
Please visit http://www.blackintel.org/
Re: Hooking [message #455020 is a reply to message #453653] Sun, 18 September 2011 07:34 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
Could a suicide hook like the one from jnz' Hooks.dll be added? Also would it be possible to allow kill messages to be disabled server-side? I know there's a client-side option in tt.ini. Could logic be added to only disable the vehicle flip kill logic on flying vehicles? At the moment this logic in tt.ini is applied to all vehicles.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Sun, 18 September 2011 07:39]

Report message to a moderator

Re: Hooking [message #455095 is a reply to message #453653] Sun, 18 September 2011 17:20 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

Those are also things that we probably wont be doing for 4.0, we have enough to fix as it is.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Hooking [message #455102 is a reply to message #455095] Sun, 18 September 2011 18:11 Go to previous message
halo2pac is currently offline  halo2pac
Messages: 659
Registered: December 2006
Location: Near Cleveland, Ohio
Karma: 0
Colonel
Well the refill hook doesnt work, so that should be a focus.

http://img339.imageshack.us/img339/1991/nefobbygenyunoreleasere.jpg
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
Previous Topic: Reduce Arty screen shake feature
Next Topic: Missing textures on fan maps
Goto Forum:
  


Current Time: Mon Nov 11 04:25:15 MST 2024

Total time taken to generate the page: 0.01274 seconds