I have never developed a game, I am interested in such a question, let's say there is a game client in which there is a character "archer" who shoots at a speed of 1 shot per 1 second, if using a program (for example hlapex) to catch a package that is responsible for a shot, and send it every 0.1 then the archer turns out will do 10 shots in 1 second? That is, on the server you need to check when was the last shot and if the next shot happened too quickly, then block this shot? Or I do not understand something and the shots are not sent? Generally can someone explain?
- 7In client-server applications, whenever possible, everything related to the processing of game data should be processed by the server. The client should be responsible only for graphical output and user interaction. Therefore, in addition to blocking sending on the client, checking the timer on the server is mandatory. - Alex Krass
|
2 answers
That's right. Consider the time between requests. Block if “shots” come at a smaller timeout than allowed.
|
As far as I know, it is considered good practice not to send a packet to the server with an action such as “Shot”, but to send the “Start shooting” package by pressing the key and “Finished shooting” by releasing the key. The attack speed, the number of shots and everything else will be counted on the server while shooting is in progress. At a minimum, this approach will protect against the situation described in your question.
- 2This solution, I think, is more rational. For in the case when the server catches one hit per second, you can easily use your own server for DDoS if you have enough users. Frequent calls from a single client can be dropped at the proxy level. In the presence of. - DimXenon
|