how can I get the error text and code in unity networking,?
I did the following:
1- subscribe to the Handler : Client.RegisterHandler(MsgType.Error, OnError);
2- create the handler
void OnError(NetworkMessage netMsg)
{
how can I print the ERROR message here
}
Usually you would do something like:
ErrorMessageType errorMsg = netMsg.ReadMessage();
And then you could get at the information in that message. Though I can’t find any reference to the class Unity would associate with MsgType.Error. It’s possibly something they haven’t exposed. Other kinds of messages use a class we define ourselves ontop of MessageBase. Hopefully someone else knows more, as it sure would be useful to get at
I have been trying to implement a function which upon failing to connect to the server takes the user to a different scene.
I have managed to implement the above code, and everything works fine, i can get the messages upon failing to connect.
But i just can’t make my code to do anything else(change the scene) instead of just delivering messages.