block scoreboard

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

block scoreboard

Postby D3CEPTION » Sat Jun 04, 2016 4:27 am

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
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: block scoreboard

Postby L'In20Cible » Sat Jun 04, 2016 5:55 am

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)
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Re: block scoreboard

Postby D3CEPTION » Sat Jun 04, 2016 6:37 am

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
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Re: block scoreboard

Postby iPlayer » Sat Jun 04, 2016 6:44 am

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?
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Re: block scoreboard

Postby D3CEPTION » Sat Jun 04, 2016 6:52 am

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.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: block scoreboard

Postby Ayuto » Sat Jun 04, 2016 6:55 am

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.
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: block scoreboard

Postby L'In20Cible » Sat Jun 04, 2016 7:00 am

*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.
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Re: block scoreboard

Postby D3CEPTION » Sat Jun 04, 2016 7:04 am

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?
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: block scoreboard

Postby L'In20Cible » Sat Jun 04, 2016 7:15 am

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.
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: block scoreboard

Postby Ayuto » Sat Jun 04, 2016 7:17 am

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.
User avatar
D3CEPTION
Senior Member
Posts: 129
Joined: Tue Jan 26, 2016 1:24 pm
Location: Switzerland

Re: block scoreboard

Postby D3CEPTION » Sat Jun 04, 2016 7:24 am

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 !
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: block scoreboard

Postby PhantomDancer » Sun Apr 02, 2017 8:17 am

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!
User avatar
satoon101
Project Leader
Posts: 2697
Joined: Sat Jul 07, 2012 1:59 am

Re: block scoreboard

Postby satoon101 » Sun Apr 02, 2017 3:13 pm

I doubt "+score" is sent to the server to be intercepted as a ClientCommand, but you can certainly test.
Image
User avatar
PhantomDancer
Member
Posts: 42
Joined: Wed Mar 15, 2017 10:39 am
Location: The Great Arctic Hemispheres

Re: block scoreboard

Postby PhantomDancer » Mon Apr 03, 2017 1:52 am

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

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 45 guests