예제 #1
0
    /// <summary>
    /// On success -- join a channel.
    /// </summary>

    void OnNetworkConnect(bool result, string message)
    {
        if (result)
        {
            TNManager.JoinChannel(channelID, firstLevel);
        }
        else if (!string.IsNullOrEmpty(failureFunctionName))
        {
            UnityTools.Broadcast(failureFunctionName, message);
        }
        else
        {
            Debug.LogError(message);
        }
    }
예제 #2
0
    /// <summary>
    /// Joined a channel (or failed to).
    /// </summary>

    void OnNetworkJoinChannel(bool result, string message)
    {
        if (result)
        {
            if (!string.IsNullOrEmpty(successFunctionName))
            {
                UnityTools.Broadcast(successFunctionName);
            }
        }
        else
        {
            if (!string.IsNullOrEmpty(failureFunctionName))
            {
                UnityTools.Broadcast(failureFunctionName, message);
            }
            else
            {
                Debug.LogError(message);
            }

            TNManager.Disconnect();
        }
    }
예제 #3
0
    /// <summary>
    /// Notification of another player leaving the channel.
    /// </summary>

    void OnPlayerLeft(Player p)
    {
        UnityTools.Broadcast("OnNetworkPlayerLeave", p);
    }
예제 #4
0
    /// <summary>
    /// Notification of a new player joining the channel.
    /// </summary>

    void OnPlayerJoined(Player p)
    {
        UnityTools.Broadcast("OnNetworkPlayerJoin", p);
    }
예제 #5
0
    /// <summary>
    /// Notification sent when leaving a channel.
    /// Also sent just before a disconnect (if inside a channel when it happens).
    /// </summary>

    void OnLeftChannel()
    {
        UnityTools.Broadcast("OnNetworkLeaveChannel");
    }
예제 #6
0
    /// <summary>
    /// Notification sent when attempting to join a channel, indicating a success or failure.
    /// </summary>

    void OnJoinChannel(bool success, string message)
    {
        UnityTools.Broadcast("OnNetworkJoinChannel", success, message);
    }
예제 #7
0
    /// <summary>
    /// Notification that happens when the client gets disconnected from the server.
    /// </summary>

    void OnDisconnect()
    {
        UnityTools.Broadcast("OnNetworkDisconnect");
    }
예제 #8
0
    /// <summary>
    /// Connection result notification.
    /// </summary>

    void OnConnect(bool success, string message)
    {
        UnityTools.Broadcast("OnNetworkConnect", success, message);
    }
예제 #9
0
    /// <summary>
    /// Error notification.
    /// </summary>

    void OnError(string err)
    {
        UnityTools.Broadcast("OnNetworkError", err);
    }
예제 #10
0
    /// <summary>
    /// Notification of a player being renamed.
    /// </summary>

    void OnRenamePlayer(Player p, string previous)
    {
        mPlayer.name = p.name;
        UnityTools.Broadcast("OnNetworkPlayerRenamed", p, previous);
    }