Hooking [message #453653] |
Thu, 08 September 2011 20:49 |
|
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?
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 |
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 #453862 is a reply to message #453815] |
Fri, 09 September 2011 18:17 |
|
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.
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 #453980 is a reply to message #453653] |
Sat, 10 September 2011 15:58 |
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 #454140 is a reply to message #454029] |
Sun, 11 September 2011 12:28 |
|
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.
Visit Jerad's deer sweat shop
|
|
|
|
|
|
|
|
Re: Hooking [message #454288 is a reply to message #454203] |
Mon, 12 September 2011 07:30 |
|
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 #455020 is a reply to message #453653] |
Sun, 18 September 2011 07:34 |
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 |
|
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 |
|
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.
Rene-Buddy | Renegade X
Join the fight against Obsessive-Compulsive Posting Disorder. Cancel is ur friend.
*Renegade X Dev Team Member*
|
|
|