Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature : makes impossible to receive messages before all the scene NetworkIdentity have been activated back. #3606

Open
Paradoks-Studio opened this issue Sep 16, 2023 · 4 comments

Comments

@Paradoks-Studio
Copy link
Contributor

Paradoks-Studio commented Sep 16, 2023

This feature request is related to this :
#3601

It looks like mirror client side is trying to receive message before the scene NetworkIdentities are activated back via:
NetworkClient.ApplySpawnPayload()

I tried to track the message with :
RemoteCalls.RemoteProcedureCalls.GetDelegate(msgType)
it returns me "Null"

As a result the client is disconnected.

In NetworkClient.OnTransportData() i commented out:
connection.Disconnect(); - line 350
and added to my GameObject a debug utilitie with:
public void OnEnable(){Debug.Log("WhoActivated - OnEnable: " + gameObject.name, gameObject);}

i receive:
Unknown message id: 46251. This can happen if no handler was registered for this message. from NetworkClient.UnpackAndInvoke()
until the GameObject is activated back, then never anymore.

So the request is:
Can mirror prevent message receive until all NetworkIdentities are activated back ?

@MrGadget1024
Copy link
Collaborator

Is this related to scene changes? If so, how are you changing scenes on clients?

@Paradoks-Studio
Copy link
Contributor Author

i change scene like this:
SceneManager.LoadScene()
the bug was not present in v66

@MrGadget1024
Copy link
Collaborator

If you send a SceneMessage from server to clients, or use Network Manager's ServerChangeScene method, then clients will suspend msg processing until the scene is loaded. Mirror has always been designed like this.

@Paradoks-Studio
Copy link
Contributor Author

Paradoks-Studio commented Oct 30, 2023

Frankly i don't remember exactly, it was a little while ago.
But, there was a problem with Mirror enabling/disabling/enabling again the scene objects.
So the gameobjects were enabled - ready to get message, disabled ( here comes the error ), enabled again.
and again, i did not touch anything between my v66 and my actual version ( maybe 81 or 82).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants