I am passing a List from the server to the client, the UNET listener on the client is being triggers, if I pass a message with an int and a List, the int value is correct but the List is null.
Are List types supported in UNET messages?
EG send code (not passing number in this example):
var response = new MasterMsgTypes.DataServerReturnListOfGameServersMessage
{
GameServers = gameServers
};
netMsg.conn.Send(MasterMsgTypes.DataServerReturnListOfGameServersId, response);
EG of receive code:
void OnDataServerReturnListOfGameServers(NetworkMessage netMsg)
{
var msg = netMsg.ReadMessage<MasterMsgTypes.DataServerReturnListOfGameServersMessage>();
LobbyManager.Instance.GameServers = msg.GameServers;
}
Even though the send response contains a List of class values, the receiving netMsg has a null value in msg.GameServers
It may be the List is being initiated with blank values as I had a similar issue when using DLL’s with the message ID and structures
thanks!