I’m playing with Netcode and I have a thing I didn’t understand.
I have a project A, server_build.
This project contain only the network manager and a script to startup the networkmanager.
The name scene is “main_scene”.
This project is build under “Dedicated server” build option. No flaws, no graphics, just a command line console.
I have a project B, client_build
This project contain the network manager, a script to start as client and pretty much that’s it.
The name scene is “main_menu” and I have another scene called “world” to eventually add things there.
When I connect my client to server, I got an error in debug log.
I understand that I’m supposed to have two exact same project, clone #1 will be the server and clone #2 will be the client.
In a way that the server will run on dedicated server, only with build option for dedicated server, what’s the purpose to this build to have all the scenes, scripts, prefab, … and never see it ?
Maybe I do something not correctly ? I would like to learn that !
Do you really have two separate projects? If so, make it one. It won‘t work with two projects because everything, scenes prefabs etc. will be considered as incompatible objects by Netcode. Both builds need to have the same scenes, specifically launch the NetworkManager from the same startup scene.
Alternatively, Fish-Networking has automated code stripping.
Regardless of that, this isn’t an issue unless your game sports thousands of daily active users for a longer period of time, at which point you can easily add a couple defines here and there where it’s most important to remove the most crucial server code to make that slightly more difficult. You certainly needn’t strip every server code from client builds, especially any trivial code.
However, once you get to a certain level of success, you will find have dedicated servers no matter what. MMOs are mainly getting hacked this way because it’s a matter of not having to pay a monthly fee. Second most hacked are games that require some account/registration (EA, Epic, Steam, etc) because not everyone can or wants to get one.
But none of this really matters if you’re solo or a small team because statistically speaking, you have maybe a 0.1% chance of that happening to you, and when it does, you’re already making way more money than you’d ever hoped for.
I found it out, If your scene name in the server build is different than the client build or the client build does not contain the scene the server is running then you will see this error.