void SaveActivated() { if (matchmaker.isConnected) { if ((bool)over13Toggle.data) { saveButton.Hide(); saveIndicator.Show(); title.UseDefaultStyle(); JSONObject data = new JSONObject(); data.AddField("email", emailInput.text); data.AddField("screenName", screenNameInput.text); matchmaker.Send("saveAccount", data); app.notificationCenter.NewObservation() .SetNotificationName(MatchmakerState.MatchmakerSaveAccountNotification) .SetAction(MatchmakerSavedAccount) .Add(); } else { title.text = "You must be 13 or older to save your account."; title.UseAlertStyle(); } } else { title.text = "Can't connect to server"; title.UseAlertStyle(); } }
void SubmitCode() { submitCodeIndicator.Show(); submitCodeButton.Hide(); titleText.UseDefaultStyle(); var messageName = "credentialsForCode"; app.notificationCenter.NewObservation() .SetAction(ReceiveCredentialsForCode) .SetNotificationName(matchmaker.ReceivedMessageNotificationName(messageName)) .SetSender(matchmaker) .Add(); JSONObject data = new JSONObject(); data.AddField("authCode", codeInput.text); matchmaker.Send(messageName, data); }
void RequestLoginCode() { requestCodeIndicator.Show(); requestCodeButton.Hide(); titleText.UseDefaultStyle(); var messageName = "requestLoginCode"; app.notificationCenter.NewObservation() .SetAction(ReceiveLoginCode) .SetNotificationName(matchmaker.ReceivedMessageNotificationName(messageName)) .SetSender(matchmaker) .Add(); email = emailInput.text; JSONObject data = new JSONObject(); data.AddField("email", email); matchmaker.Send(messageName, data); }