enable voicechat in danger zone

Please post any questions about developing your plugin here. Please use the search function before posting!
Speed0x
Member
Posts: 84
Joined: Sun Feb 05, 2017 4:55 pm

enable voicechat in danger zone

Postby Speed0x » Sat Jul 10, 2021 11:32 pm

is it possible to enable voice chat in danger zone via source python? i think it's disabled in the gamemode by default..
Speed0x
Member
Posts: 84
Joined: Sun Feb 05, 2017 4:55 pm

Re: enable voicechat in danger zone

Postby Speed0x » Sun Jul 11, 2021 10:55 am

when i view the netchannel traffic i can see that the clients sends the voicedata to the server when using +voicerecord, but noone else on the server can receive it. so i think the server in dangerzone gamemode somehow has it disabled.

i couldn't find any server commands to enable it, so i was wondering if source python has a way to enable it ?
decompile
Senior Member
Posts: 416
Joined: Sat Oct 10, 2015 10:37 am
Location: Germany
Contact:

Re: enable voicechat in danger zone

Postby decompile » Sun Jul 11, 2021 1:44 pm

Did you try sv_full_alltalk 1 yet?
Speed0x
Member
Posts: 84
Joined: Sun Feb 05, 2017 4:55 pm

Re: enable voicechat in danger zone

Postby Speed0x » Sun Jul 11, 2021 7:17 pm

already tried that and unfortunately didn't work :(

when i use "voice_show_mute" it lists other current active players, as if they are muted. which is strange ? if i use "voice_unmute {id}" they also still remain on the mutelist.
Speed0x
Member
Posts: 84
Joined: Sun Feb 05, 2017 4:55 pm

Re: enable voicechat in danger zone

Postby Speed0x » Sun Jul 11, 2021 11:00 pm

Syntax: Select all

import memory

from memory import DataType
from memory import Convention
from memory.hooks import PreHook
from players import Client

engine = memory.find_binary('engine')

BroadcastVoiceData = engine[b"\x55\x8B\xEC\x83\xE4\xF8\x81\xEC\xE4\x00\x00\x00\x53\x56\x57"].make_function(
Convention.THISCALL,
[DataType.POINTER, DataType.INT, DataType.CHAR, DataType.UINT],
DataType.VOID)

# IClient * cl, int nBytes, char * data, int64 xuid

@PreHook(BroadcastVoiceData)
def pre_broadcast_voice_data(args):
print(args)
client = memory.make_object(Client, args[0])
print(client.steamid)
print(client.userid)
print(client.name)


i've tried to hook this function in csgo, but it always gives me a crash after pressing +voicerecord but correctly printing the linked client properties.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: enable voicechat in danger zone

Postby Ayuto » Mon Jul 12, 2021 8:31 am

I think another DataType.POINTER (for the acual this-pointer) is missing in your BroadcastVoiceData hook:
[DataType.POINTER, DataType.POINTER, DataType.INT, DataType.CHAR, DataType.UINT]

You can also try to hook IVoiceServer::SetClientListening/GetClientListening like we did here. Maybe it always tells the server to mute all players:
https://github.com/Source-Python-Dev-Te ... ce.py#L114
Speed0x
Member
Posts: 84
Joined: Sun Feb 05, 2017 4:55 pm

Re: enable voicechat in danger zone

Postby Speed0x » Mon Jul 12, 2021 3:25 pm

Ayuto wrote:I think another DataType.POINTER (for the acual this-pointer)

When i change it like you propose, i can only receive the client object from the first pointer, while the second pointer gives me a "NULL Pointer" Error when i try to create the client object from it.

Does this mean my signature is wrong? do i have to go -4 in offset ? can i even step back "one offset" to hit the correct pointer?

Ayuto wrote:You can also try to hook IVoiceServer::SetClientListening


if i hook into SetClientListening, "args[3]" constantly broadcasts as False. Is this how it's supposed to be ? Or does this mean the Server perma-mutes the clients?

Thanks !
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: enable voicechat in danger zone

Postby Ayuto » Mon Jul 12, 2021 3:49 pm

Oh, I thought BroadcastVoiceData is part of a class, because you were using THISCALL, but I think you are hooking SV_BroadcastVoiceData, right? In that case your arguments were right, but the calling convention is CDECL.

If args[3] is always False it can either mean that there is nothing being broadcasted or that the server mutes the clients. You can try if setting it to True has an effect.

Edit: Sorry, I should have looked at the arguments more closely. CDECL and these arguments should be correct:
[DataType.POINTER, DataType.INT, DataType.POINTER, DataType.LONG_LONG]
Speed0x
Member
Posts: 84
Joined: Sun Feb 05, 2017 4:55 pm

Re: enable voicechat in danger zone

Postby Speed0x » Mon Jul 12, 2021 3:58 pm

Ayuto wrote:If args[3] is always False it can either mean that there is nothing being broadcasted or that the server mutes the clients. You can try if setting it to True has an effect.

yeah i already tested with a friend and it works :)

it seems the dangerzone mode each tick sets the listening to False in "SetClientListening" to all other players for each player. so i simply set args[3] = True in the hook to overall enable the voicechat and it works now.

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 27 guests