[CODE] [ORPHEU] How to hook when player use +voicerecord
1 Attachment(s)
I'll try to show you guys how to detect when some player use +voicerecord command.
This code will run using Orpheu and, at this time, will run only on linux because I don't have the windows signature but I can't test on windows too. Download the file attached and install signatures in configs/orpheu/functions (only linux engine 4883) First of all, lets talk about how messages from client will be processed by server. Each time a client sends information to servers, it uses CL messages. They are handled server side using SV_ExecuteClientMessage function (engine library). This function will check which command was sent by client and then run the associated function (listed sv_clcfuncs structure) These are the available messages with their associated engine functions: PHP Code:
All I know about that structure for HL1 engine is it's 20200 bytes long (for linux at least) So, for +voicerecord command we are going to work with SV_ParseVoiceData When the client holds +voicerecord bind, SV_ParseVoiceData repeatedly is called until it stops using it. Here's the code to make a plugin that register 2 forwards: client_voicerecord_on Called from Voice_SetClientListening (from fakemeta) when sender is using +voicerecord and receiver is the lowest id connected to server.client_voicerecord_off Called from Voice_SetClientListening (from fakemeta) after client_voicerecord_on and sender is the same as previus forward and receiver is the highest id connected to server. PHP Code:
The problem is how to know which player is using +voicerecord. Well, we receive a pointer to the current player client_t structure. At offset 4 of svs structure we have the pointer to the first player client_t structure and we know it's 20200 bytes long for each client, so we can do some math and get which player is using the command. PHP Code:
PHP Code:
|
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
Hehe, nice. :)
As suggestion about the package, try to keep the directory structure. /configs/etc. And you could provide the plugin in the package too. |
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
Omg, you killed Kenny, you bastards!
Very nice job joro! |
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
I would like to update this to work on windows.
All I need is: - someone who can tell me this offsets for windows - someone can test it on windows :) |
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
0xAB34F ; you are lazy, I find it in less 10 seconds. :p Also, it would be nice to make signatures of bytes, but I can understand it's boring as hell.
|
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
nice work!
|
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
Quote:
|
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
Quote:
|
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
if you don't know you don't have to write some random stuff back just to answer something
|
Re: [CODE] [ORPHEU] How to hook when player use +voicerecord
Look the first post and hook the function related to the message... :roll:
|
All times are GMT -4. The time now is 11:06. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.