How to work with dedicated server

Hi guys,
i’m looking for a way to make a dedicated authoritative server, i already worked with socket.io but i’m not sure about the security…
I’m actually looking for the UNET and HLAPI, i want to use a totally different code between client and server and i’m not sure it’s possible with RPC and COMMAND (or maybe can you help me to use it?), maybe the best way to do it is to use messages … I’m not enought documented…
Do you have any link for me guys about the best way to do it or any exemples?

Thanks

here is a good free open source start: Home · alvyxaz/barebones-masterserver Wiki · GitHub

This can absolutley be done with Command and RPC. If you want different code base for client and server you could do it in separate projects. But if you want it in one project but hide server code from client and virse versa I would go for Conditional Compiling. Command calls would look like this
void Cmd_MyCommand()
{
#if SERVER
//Server logic
#endif
}
And #if CLIENT on the client code. Then when compiling you define your compile conditions in Player Settings.

1 Like