void Update()
{
if (connector.message != Connector.RCV_JOIN_GGM)
{
// Check if the response has changed
if (connector.res != lastMessage)
{
Debug.Log(connector.res);
lastMessage = connector.res;
// Check if command received is port
if (connector.message.StartsWith(Connector.RCV_PORT))
{
// Determine if a port was sent
int portNum;
if (int.TryParse(connector.res, out portNum))
{
// Try to join the game on the given port
Debug.Log("IP: " + gameManagerIP + " Port: " + portNum);
networkManager.JoinDirect(gameManagerIP, portNum);
}
}
}
}
}