//-------------------------------------------------------------------------------- // ClickRegister //-------------------------------------------------------------------------------- public void ClickRegister() { if (inputUsername != null && inputEmail != null && inputPassword != null) { // We validate the input now: // - Name // - Password // - eMail (only if account confirm is required, otherwise its optional) if (inputUsername.text.validateName() && (inputEmail.text.validateEmail() || !clientManager.bConfirmAccountCreate) && inputPassword.text.validatePassword() ) { string[] fields = new string[] { inputUsername.text, inputPassword.text, inputEmail.text, Tools.GetDeviceId }; TemporaryDisable(buttonRegister); clientManager.ReqRegisterAccount(fields, CallbackRegisterAccount); } else { panelMessage.Show(Constants.STR_ERROR); } } else { Debug.LogWarning(Constants.STR_ERROR_MISSING_UI + this.name); } }
// ------------------------------------------------------------------------------- // ClickActorCreate // ------------------------------------------------------------------------------- public void ClickActorCreate() { if (actorName.validateName() && dictAspects.Count > 0) { string[] fields = dictAspects.Select(x => x.Value.GetId.ToString()).ToArray(); clientManager.ReqActorPlayerCreate(actorName, fields, CallbackActorCreate); } else { panelMessage.Show(Constants.STR_ERROR); } }
// ------------------------------------------------------------------------------- // ClickForgotPassword // ------------------------------------------------------------------------------- public void ClickForgotPassword() { if (inputAccountName != null) { if (inputAccountName.text.validateName()) { CallbackConfirmAccountForgotPassword(); } else { panelMessage.Show(msgError); } } else { Debug.LogWarning(Constants.STR_ERROR_MISSING_UI + this.name); } }
//-------------------------------------------------------------------------------- // ClickResendConfirmation //-------------------------------------------------------------------------------- public void ClickResendConfirmation() { if (inputAccountName != null) { if (inputAccountName.text.validateName()) { string[] fields = new string[] { inputAccountName.text }; TemporaryDisable(buttonResend); clientManager.ReqAccountResendConfirmation(fields, CallbackResendConfirmation); } else { panelMessage.Show(msgError); } } else { Debug.LogWarning(Constants.STR_ERROR_MISSING_UI + this.name); } }
//-------------------------------------------------------------------------------- // ClickLogin //-------------------------------------------------------------------------------- public void ClickLogin() { if (inputUsername != null && inputPassword != null ) { if (inputUsername.text.validateName() && inputPassword.text.validatePassword()) { CallbackConfirmLogin(); } else { panelMessage.Show(msgError); } } else { Debug.LogWarning(Constants.STR_ERROR_MISSING_UI + this.name); } }
//-------------------------------------------------------------------------------- // CallbackCheckVersion //-------------------------------------------------------------------------------- private void CallbackCheckVersion(string[] result) { if (result[0] != Constants.INT_FAILURE.ToString()) { Hide(); panelMain.Show(); } else { panelMessage.Show(msgVersionFail); } }
// ------------------------------------------------------------------------------- // ClickChangeMail // ------------------------------------------------------------------------------- public void ClickChangeMail() { if (inputEmail != null && inputPassword != null) { if (inputEmail.text.validateEmail() && inputPassword.text.validatePassword() && inputEmail.text != sCurrentMail ) { CallbackConfirmAccountChangeMail(); } else { panelMessage.Show(msgError); } } else { Debug.LogWarning(Constants.STR_ERROR_MISSING_UI + this.name); } }
//-------------------------------------------------------------------------------- // ClickConfirmCode //-------------------------------------------------------------------------------- public void ClickConfirmCode() { if (inputCode != null) { if (inputCode.text.validateName() ) { string[] fields = new string[] { clientManager.clientAccount.sName, inputCode.text, nAction.ToString() }; TemporaryDisable(buttonConfirm); clientManager.ReqCodeConfirm(fields, CallbackConfirmCode); } else { panelMessage.Show(msgConfirmError); } } else { Debug.LogWarning(Constants.STR_ERROR_MISSING_UI + this.name); } }
//-------------------------------------------------------------------------------- // CallbackDeleteActor //-------------------------------------------------------------------------------- public void CallbackDeleteActor(string[] result) { if (result[0] == Constants.INT_FAILURE.ToString()) { panelMessage.Show(msgDeleteFail); } else { foreach (GameObject go in _actorObject) { if (go && go.name == _selectedActorName) { Destroy(go); } } _selectedActorName = ""; } }