Page 1 of 1

block scoreboard

Posted: Sat Jun 04, 2016 4:27 am
by D3CEPTION
right now im trying to find a way to block the scoreboard from being viewed from players on a server( clicking tab ).
my guess is, that it isnt possible at all, as the function might merely run on the client, yet considering that hud visibility can be effected via the playerobject. anybody knows specifics?
thanks in advance

Re: block scoreboard

Posted: Sat Jun 04, 2016 5:55 am
by L'In20Cible

Syntax: Select all

from entities.entity import BaseEntity
from entities.hooks import EntityCondition
from entities.hooks import EntityPreHook
from memory import make_object
from messages import VGUIMenu
from players import UserCmd
from players.constants import PlayerButtons

hidden_scores = VGUIMenu('scores', show=False)

@EntityPreHook(EntityCondition.is_human_player, 'run_command')
def pre_player_run_command(stack_data):
ucmd = make_object(UserCmd, stack_data[1])
if not ucmd.buttons & PlayerButtons.SCORE:
return
hidden_scores.send(make_object(BaseEntity, stack_data[0]).index)

Re: block scoreboard

Posted: Sat Jun 04, 2016 6:37 am
by D3CEPTION
thanks for sending code, but ive already tried blocking the command, but the scoreboard still pops up , thats why my question mainly regarded if the client has a separate launch or if its pure serverside

Re: block scoreboard

Posted: Sat Jun 04, 2016 6:44 am
by iPlayer
Well, there're at least 2 approaches: blocking the command and sending hidden scoreboard every time the command is executed.

If the code above doesn't work, my guess is that client is showing the scoreboard AFTER we have hidden it in run_command. Maybe a posthook or a delay?

Re: block scoreboard

Posted: Sat Jun 04, 2016 6:52 am
by D3CEPTION
i havent tried any further code yet, but im sure ill find a way. BUT i need to know if the scoreboard ONLY gets called "from the server". if the client has its own "preopen" function ( first tick ), thered be no need of approaching this matter anyway for me.

Re: block scoreboard

Posted: Sat Jun 04, 2016 6:55 am
by Ayuto
I just tested L'In20Cible's code and it's working fine for me. Note that it doesn't block the command, but tells the client to hide the scoreboard when he wants to open it.

Re: block scoreboard

Posted: Sat Jun 04, 2016 7:00 am
by L'In20Cible
*just saw last replies but I'm posting this anyways.

Actually, this code is not blocking the display itself, it send the signals to hide the panel once displayed. I tested this code on windows and it is working. The scoreboard is already displayed when run_command is executed so it get rendered for a frame (the time we send our own signal to hide it). Next step would be to hook the usermessage itself and see if the server is sending the initial signal to show it but I'm fairly sure this is predicted client-side and from a server-side plugin, you won't get any better results.

Re: block scoreboard

Posted: Sat Jun 04, 2016 7:04 am
by D3CEPTION
yes sorry, the code is ofc working, but my goal is to completly hide the scoreboard for clients , no blinking etc.

edit: using the vgui hide in ontick wrapper almost never makes it pop, which makes it probable, that the server ALWAYS gives some sort of callback, so blocking all remote functions (maybe with NOP's) would do the job?

Re: block scoreboard

Posted: Sat Jun 04, 2016 7:15 am
by L'In20Cible
I don't think so. My guess is that since you constantly send the signal to hide it, it does hide it faster since it doesn't have to wait the server to reply once the panel is already displayed.

Re: block scoreboard

Posted: Sat Jun 04, 2016 7:17 am
by Ayuto
Just hooked IVEngineServer::UserMessageBegin() to see if it gets called when opening the scoreboard. But it has never been called, so that part is handled by the client.

Re: block scoreboard

Posted: Sat Jun 04, 2016 7:24 am
by D3CEPTION
okay, makes more sense anyway, but is unfortunate for me :/ im wondering though how vgui hide gets called within the client. it must somehow have a function there that blocks the clients scoreboard call for x time/x press times. i might take a look at how that works, otherwise i guess i have to dismiss any solutions here

edit: i guess the server sends a "valid" scoreboard, but one that is "hidden"/invisible. ( only one scoreboard call can run parrallely on client ) therefor the only way would be to constantly send a hidden scoreboard, but i doubt that will be fully what i want. but thanks for everyones suggestions !

Re: block scoreboard

Posted: Sun Apr 02, 2017 8:17 am
by PhantomDancer
https://github.com/Source-Python-Dev-Te ... t.cpp#L118

does "@ClientCommand" here use an inbuilt filter for some commands before the hooks passes? and is this inbuilt filter only filtering usercmd initiated commands or/and anything else? if so,is this filter even suitable here?

im looking into this, as i am wondering if a solution could be to intercept "+score" before this filter escapes the clientcommand hook on sps endpoint and insert a vguimenu (scoreboard hidden) send for that case. i kinda assume that usermsgs are more tickreliable than usercmds. thats why i want to test it. but am not really sure about that. other than that this is the same as the first proposed solution.

maybe someone knows this off head. otherwise ill test it later. thanks!

Re: block scoreboard

Posted: Sun Apr 02, 2017 3:13 pm
by satoon101
I doubt "+score" is sent to the server to be intercepted as a ClientCommand, but you can certainly test.

Re: block scoreboard

Posted: Mon Apr 03, 2017 1:52 am
by PhantomDancer
it seems the server cant control turning off the scoreboard at all. not even natively. ( i couldnt find it ) so i have to send it every tick. which is a bad solution. but sending it after reading the usercmd, is slightly too late. even in ontick a brief popup of the unwanted scoreboard occurs. which is already an inconvenience. anyway, ill keep the thread updated in case i find a workaround as ill keep being on the lookout