I built a minimal case.
It has the same binary for client and server.
It has one Level.
It has one object with one networkView with one static Scene-allocated viewID.
In OnPlayerConnected I send a simple RPC call with a string to the client as a server message to acknowledge the connection.
The client gives the folling error message:
Could't invoke RPC function 'serverMessage' because the networkView 'SceneID: 1 Level Prefix: 0' doesn't exist
Which is strange, because there is only one level. And I never set any level prefixes. And the SceneID are both 1 on client and server, as my logging shows. The server claims it as its own, the client doesn’t. The group is the same 0.
This happens regardless of whether server or client run in the editor, or both run standalone. It also happens if I explicitely set the LevelPrefix to 0 on connect.
Is there any way to establish a server/client communication without using Network.Instantiate?
Because statically allocated IDs in the level/scene apparently don’t work.
And if you don’t have a synced viewID on both sides already, you also can’t send any ID allocated with Network.AllocateViewID, either from server to client or from client to server.
What channel does Network.Instantiate use if there are no working viewIDs yet?
Am I absolutely required to use Network.instantiate to have any chance of establishing communication?
If I have all my game object in the scene already, do I really have to delete them and recreate with Network.instantiate or reload the whole level?