Beispiel #1
0
    public void RespondToAsyncConnectInfoEvent(NetworkManager.NetworkConnectionErrorResponse response)
    {
        // This function responds to `OnConnectedToServer()` and `OnFailedToConnect()`
        // Which definitively say if we connected and are called async after `Connect()`

        // Add the message
        this.NewServerBrowserMessage(response.message);

        // If we are able to connect, close the menus
        if (this.viewReady)
        {
            if (response.ableToConnectYet)
            {
                this.m_View.View.TriggerEvent("respondToServerConnectSuccess");                 // close menus
            }
        }
    }
Beispiel #2
0
    public void GUIConnect(string guid, string pw)
    {
        NetworkManager.NetworkConnectionErrorResponse response = this.netMan.Connect(guid, pw);

        string message = "";

        // Only show error if some error is returned
        // The response message could return "Yay, You connected" but we
        // only want error at this point
        if (!response.noErrorsYet)
        {
            message = response.message;
        }

        // Only add a message if there is a message
        if (message != "")
        {
            this.NewServerBrowserMessage(message);
        }
    }