Пример #1
0
    public void OnResponseConfirm(ExtendedEventArgs eventArgs)
    {
        ResponseConfirmEventArgs args = eventArgs as ResponseConfirmEventArgs;

        if (Constants.USER_ID == -1)         // Haven't joined, but got confirm message
        {
            opConfirm = true;
        }
        else
        {
            if (args.user_id == Constants.OP_ID)
            {
                opConfirm = true;
            }
            else if (args.user_id == Constants.USER_ID)
            {
                confirm = true;
            }
            else
            {
                Debug.Log("ERROR: Invalid user_id in ResponseConfirm: " + args.user_id);
                messageBoxMsg.text = "Error starting game. Network returned invalid response.";
                messageBox.SetActive(true);
                return;
            }
        }

        if (confirm && opConfirm)
        {
            StartNetworkGame();
        }
    }
    public override ExtendedEventArgs process()
    {
        ResponseConfirmEventArgs args = new ResponseConfirmEventArgs
        {
            user_id = user_id
        };

        return(args);
    }