MinoMino / minqlx

Extends Quake Live's dedicated server with extra functionality and scripting.
GNU General Public License v3.0
112 stars 42 forks source link

Some client actions don't trigger client_command? #77

Closed f0oster closed 5 years ago

f0oster commented 6 years ago

I am looking to make a coaching plugin for CA clan matches to allow clans to have members in spec without needing to worry about clans ghosting or cheating.

The intention is to allow specs to assign themselves as a coach to a specific team and then they would only be able to spec that team for the game.

I created a hook for client_command so I could catch whenever players sent the "follow" command so I could implement some logic to restrict who they can spectate, but it seems that swapping between players in spec (using left/right click on the mouse) doesn't actually trigger a client_command event...on the contrary, if you type the command (follow userid) in the console the event is obviously triggered but this is not really useful as players don't tend to do this...

Does anyone know if there's a way to achieve this?

Thanks

em92 commented 6 years ago

it seems that swapping between players in spec (using left/right click on the mouse) doesn't actually trigger a client_command event

Right. Probably this is being executed in qlds, but it is not captured by current versions by minqlx: https://github.com/id-Software/Quake-III-Arena/blob/dbe4ddb10315479fc00086f08e25d968b4b43c49/code/game/g_active.c#L356-L359

Does anyone know if there's a way to achieve this?

Let coach join his team and before round starts - kill him. He will spectate his team.

tjone270 commented 6 years ago

Workaround:

You can check who is following who by comparing positions between players, if someone is spectating someone else, their coordinates will be identical.

You could have a polling loop to detect this.

Please excuse brevity as this message was sent from my iPhone

On 9 Oct 2018, at 12:50 pm, Eugene Molotov notifications@github.com wrote:

it seems that swapping between players in spec (using left/right click on the mouse) doesn't actually trigger a client_command event

Right. Probably this is being executed in qlds, but it is not captured by current versions by minqlx: https://github.com/id-Software/Quake-III-Arena/blob/dbe4ddb10315479fc00086f08e25d968b4b43c49/code/game/g_active.c#L356-L359

Does anyone know if there's a way to achieve this?

Let coach join his team and before round starts - kill him. He will spectate his team.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

f0oster commented 6 years ago

@em92 Thanks for the info. I am not overly familiar with QLDS or the minqlx core - do you have any advice on where to start if I wanted to capture these actions?

Your suggestion is a really good idea but means the player will receive a pretty heavy penalty for being coach (elo/qlstats ratings) unless I disable the stat reporting for clan games.

@tjone270 I had considered this as well but I think it would be too expensive to poll regularly enough to be effective.

em92 commented 6 years ago

do you have any advice on where to start if I wanted to capture these actions?

tldr: you have to make some additions to minqlx core.

More detailed steps probably looks like this: