Hello, i started to create my master server/game server using uNet and i would like to know what should be on the game server and client side ? Different scene with different script or sharing the same script with an isServer bool, i don’t know if the server should have all the game content or only the rpc and data transfer ? I would like to be able to build one scene for the game server do you think its possible ? Thanks for your help
generally:
- scene should be the same on client server with unet
- script can be the same, its going to simplify your code
- your client send commands like click here, press key 1, the server receive command useskill(1) and send the result for animation fx and damage done you can update syncvar on your server for health for exemple but never on client
- you should build your server as headless
Thanks, and after looking at some open source project, some people directly use some db like SQLite for storing client data on game server side like inventory and stuff like that, is that a good idea or its slow and not really secure ? Because receiving data for a dedicated server about inventory is not a real problem, i mean you just send message to the server to store data locally and you ask him to send you data from his local db without have to directly acces to that database.
The Database should ALWAYS be on the server side NEVER on the Client side unless you don’t care about hacking.
Of course that what im talking about, but on a dedicated server side hosted by player, after looking some cheating forum for see how these manage to cheat, they can access to mono c# and do alot of stuff, by executing and even create their own function. If you have an function in server side for giving to player an item for example, you will need to have a function on client side for receiving it right ? What avoiding cheater to execute this function on the client side ? I try to learn about security stuff before starting dev my game for including security everywhere. The only good thing i see its the cheater can maybe change the server code in his own game but not in the server is connected to, im a little bit out of the initial question here but i don’t really see how i can receive stuff only from the server, i always gonna have a variable or function for receiving it on client side, sorry for my terrible english btw its not my mother tongue
Have a nice day !
If the server stores and maintains player inventory contents, and is also responsible for adding and determining quantity of new items added, and it is this information that is displayed on all clients, then it doesn’t matter what a user does on their local PC; other players will only see what’s on the server, and once the cheating player gets a server refresh of his inventory it will also revert to the server values.
I see, but i think i need to find a sample project about a simple method client-server secured, i really need one for see what happen in client and server side.Also its not too much for the server to handle like 100 player with that way for a whole game like Rust (Obviously headless or nographic for windows can made this result possible i tough, and have the cpu used only for game logic) ? Because as i understand the server have the logic of all player in one instance class per player ? Also tell me if im wrong but with that for all the game logic, the connection of the client is really reduced wich is a good point. Thanks you really help me to understand networking system.
So in a secure setup the client doesn’t have a function that receives an item that can just be called repeatedly. The client doesn’t actually store what items the player has outside of use for displaying this to the user. Calling the function on the client that would add an additional item displayed to the user doesn’t actually adjust what the server says the player has, so won’t actually benefit the player nor will it affect other players.
I have some extra questions who don’t need to create another posts i believe i just don’t know if im doing the system in a clean way. the game server use NetworkServer.Listen so if i want to send to the master that a new server was created i need to have one networkserver and one networkclient right ? Also the client need to have 2 NetworkClient active, one for the master server and another for the game server if i want to ban or doing stuff for the client during a game session he need to stay connected to the master. Am i in the right way ? I don’t use NetworkManager btw but im still using the hlapi. Thanks again guys