Marke137 Posted January 18, 2019 Share Posted January 18, 2019 Short question, is it possible to bind keys to commands with C#? Link to comment Share on other sites More sharing options...
Schmand Posted March 31, 2019 Share Posted March 31, 2019 I have the same question :D /push Link to comment Share on other sites More sharing options...
Division Posted March 31, 2019 Share Posted March 31, 2019 just call an event from the client via player.callRemote("server.event") when player pressed a key. Link to comment Share on other sites More sharing options...
Xabi Posted April 1, 2019 Share Posted April 1, 2019 You will have to implement a binding function by yourself, currently that bind function from JS doesn't exist on C# Link to comment Share on other sites More sharing options...
robearded Posted April 1, 2019 Share Posted April 1, 2019 (edited) 12 hours ago, Division said: just call an event from the client via player.callRemote("server.event") when player pressed a key. Don't, please, that's the worst thing you can do to your server and to your network. You're not gonna even make it hard for people to (d)dos your server when they can just spam a button and be sure that the server will trust and accept all of the packets. If you want to execute a command on a keypress, then process the key press inside your client script, do your checks and only then send the event to the server. Also I would advise to add a delay and check how much time passed since last key press (so you can limit a key press every second/2 seconds etc if you care about your server). Edited April 1, 2019 by robearded Link to comment Share on other sites More sharing options...
Division Posted April 1, 2019 Share Posted April 1, 2019 (edited) vor 6 Stunden schrieb robearded: Don't, please, that's the worst thing you can do to your server and to your network. You're not gonna even make it hard for people to (d)dos your server when they can just spam a button and be sure that the server will trust and accept all of the packets. If you want to execute a command on a keypress, then process the key press inside your client script, do your checks and only then send the event to the server. Also I would advise to add a delay and check how much time passed since last key press (so you can limit a key press every second/2 seconds etc if you care about your server). exactly what I wrote. I thought that building a "security" delay dont need to be mentioned But agree 100% highly important! Edited April 1, 2019 by Division Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now