예제 #1
0
 public void OnConnectFailed(NetworkRunner runner, NetAddress remoteAddress, NetConnectFailedReason reason)
 {
     Util.Log($"Connect Failed {reason}");
     LeaveSession();
     SetConnectionStatus(Enum.ConnectionStatus.Failed);
     (string status, string msg) = ConnectFailedReasonToHuman(reason);
     //TODO : UI에 뿌려주자 status msg
 }
예제 #2
0
        private static (string, string) ConnectFailedReasonToHuman(NetConnectFailedReason reason)
        {
            switch (reason)
            {
            case NetConnectFailedReason.Timeout:
                return("Timed Out", "");

            case NetConnectFailedReason.ServerRefused:
                return("Connection Refused", "The lobby may be currently in-game");

            case NetConnectFailedReason.ServerFull:
                return("Server Full", "");

            default:
                Debug.LogWarning($"Unknown NetConnectFailedReason {reason}");
                return("Unknown Connection Failure", $"{(int)reason}");
            }
        }
예제 #3
0
 public void OnConnectFailed(NetworkRunner runner, NetAddress remoteAddress, NetConnectFailedReason reason)
 {
     Debug.Log($"Connect failed {reason}");
     SetConnectionStatus(ConnectionStatus.Failed, reason.ToString());
 }