Hello guys
I need tutorial to learn How can i create a game server for save my game from hack
Hello guys
I need tutorial to learn How can i create a game server for save my game from hack
AmirDarag
You mean anti-cheat.
Exact implementation would depend on the game, but the basic idea is that the user can modify what the client does, so the server needs to verify everything the client says and correct anything that doesn't line up. The best thing to do would be to find some libre multiplayer games and check out what they do. I think Minetest and Xonotic are good examples.
My website: https://onpon4.github.io
That depends on what kind of game you're doing.
If it's a game with well-defined rules and no real-time response, you can run the entire rule set on the server, and simply use the game client for user interface to gather commands and show results. Board games and RTS games and turn-based games will work well in this model. (RTS games may seem like they're real-time, but there's typically a significant queuing delay for each command, during which the units play a "yes sir!" animation, before the command takes effect.)
If your game is real-time, in the sense of a first-person shooter, a racing game, or a fighting game, then you need to still run the game simulation on the server, but you also need to hide the latency on the client somehow -- show an immediate outcome of the action on the player's screen, while waiting for the server to verify that the action succeeded. Then you need to figure out how to show it when the action fails (say, the person you were shooting at suddenly jumped or dodged.)
How to build the server, in code, depends entirely on what game engine and language you're using. Some game engines (such as Unreal Engine) come with server functionality built in. Others (like Unity) have some support for networking, but generally requires addition of some third party helper to get good. Most of them don't actually solve the bigger questions of "how do I find a player to play with or a game to join" which needs additional helper libraries (Steam, or Apple Game Center, or Google Play Services, or whatever.)
Consider first learning how other people's games got hacked, in particular games similar to your own. Learning how an attacker thinks and what can be exploited is invaluable if you're going to develop the kind of defensive / paranoid mindset needed to compensate for such attacks.
There's a lot that could go wrong. That is in logins, persistance, networking stuff... and what if the server isn't authoritative. These four things you can research more. Cryptography for logins, databases for persistance, packet stuff for networking (overflowing? tcp quirks maybe?)... and server architecutre (authoritative or client-side).