-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
inputPressed doesn't exist serverside, despite PlayerButtonDown being shared. #1514
Comments
I'm pretty sure PlayerButtonDown/Up doesn't work serverside in dedicated servers |
I can probably throw up a server and test, but I remember it originally was shared and was moved to clientside only because it didn't work. |
Okay, I tried it out and it looks like the gmod devs might've fixed it. I guess the problem now is we need to make sure player's aren't able to see all of everyone's keypresses without permission |
can't e2 already do that with event keyPressed with zero perms? just allow it by default and let clients choose |
Fairly sure that only works for IN_KEY enum keys |
the IN_KEY's have dedicated functions but it works on any keys |
Can you give an example? |
E2 doesn't have a permission system, so you can always get states and update triggers for any player's keys, at any time. As for the dedicated IN_KEY functions, E2 has |
Starfall already has the However, it's also used for stuff like |
Right, but clients are able to disable the input permission if they wish, whereas that wouldn't be possible with a serverside hook. |
If we can sync the input permission from client to server, then I think we can add it. |
Suggest adding a new option Then this permission will send a net message to the opposite realm it's created on and apply whatever setting changes it gets. The server realm will contain an EntityTable of players with their replicated settings. This will allow server settings to be replicated on the client as well which I remember was needed for something else a while ago. |
For the serverside, will need a new check permission function too that takes a player arg, since different players will have different settings. |
Maybe a replicated provider would be able to handle checking the replicated setting. if SERVER then
registerprivilege("input", "Input", "Allows a user to see what buttons players are pressing", { replicated = {} })
else
registerprivilege("input", "Input", "Allows the user to see what buttons you're pressing.", { client = {replicated = true} })
end |
Actually just putting the realm that its replicated on would work. |
Then it will be true for server and false for clients and the table index will exist on both. |
Another problem is that the client provider can't be invoked on the server because there's a 'Friends Only' option that only works clientside. |
Will need a server version of the client provider. |
Starfall's
inputPressed
andinputReleased
hooks currently only exist on client, even though the equivalent glua hooksPlayerButtonDown
andPlayerButtonUp
are in the shared realm.Because of this, any time someone wants to have arbitrary key press/release events (i.e. any keys, not just the limited IN_KEY list) on serverside, they have to network the button presses themselves. Not only is this incredibly tedious, but it bloats network traffic with tons of redundant messages.
The text was updated successfully, but these errors were encountered: