Package de.creepsmash.common.messages.server

Examples of de.creepsmash.common.messages.server.RegistrationResponseMessage


        RegistrationRequestMessage registrationRequestMessage = (RegistrationRequestMessage) message;
        IConstants.ResponseType responseType = AuthenticationService
            .create(registrationRequestMessage.getUsername(),
                registrationRequestMessage.getPassword(),
                registrationRequestMessage.getEmail());
        RegistrationResponseMessage registrationResponseMessage = new RegistrationResponseMessage();
        registrationResponseMessage.setResponseType(responseType);
        this.sendMessage(registrationResponseMessage);
      } else if (message instanceof PasswordResetRequestMessage) {
        PasswordResetRequestMessage passwordResetRequestMessage = (PasswordResetRequestMessage) message;
        boolean result = this.authenticationService
            .resetPassword(passwordResetRequestMessage
View Full Code Here


      messageObject = new PlayerQuitMessage();
    } else if (PlayersMessage.PATTERN.matcher(messageString).matches()) {
      messageObject = new PlayersMessage();
    } else if (RegistrationResponseMessage.PATTERN.matcher(
        messageString).matches()) {
      messageObject = new RegistrationResponseMessage();
    } else if (RoundMessage.PATTERN.matcher(messageString).matches()) {
      messageObject = new RoundMessage();
    } else if (SellTowerRoundMessage.PATTERN.matcher(messageString)
        .matches()) {
      messageObject = new SellTowerRoundMessage();
View Full Code Here

   * {@inheritDoc}
   */
  public void update(ServerMessage m) {

    if (m instanceof RegistrationResponseMessage) {
      RegistrationResponseMessage response
      = (RegistrationResponseMessage) m;
      if (response.getResponseType()
          == IConstants.ResponseType.username) {

        errorDialog("Username already exists!");
        register.setEnabled(true);
        lName.requestFocus();
      }
      if (response.getResponseType() == IConstants.ResponseType.ok) {
        UIManager.put("OptionPane.background", Color.BLACK);
        UIManager.put("Panel.background", Color.BLACK);
        UIManager.put("OptionPane.messageForeground", Color.GREEN);
        JOptionPane.showMessageDialog(this, "Registration Successful",
            "Thank You", 2);
        getCore().popScreen();
        // login
        LoginRequestMessage loginMessage = new LoginRequestMessage();
        loginMessage.setVersion(Core.getVersion());
        loginMessage.setUsername(lName.getText());
        loginMessage.setPassword(String
            .valueOf(lPassword.getPassword()));
        loginMessage.setMacaddress(getCore().getNetwork().getMACAddress());
        getCore().getNetwork().sendMessage(loginMessage);
      }
      if (response.getResponseType() == IConstants.ResponseType.failed) {
        errorDialog("Unknown error");
        register.setEnabled(true);
        lName.requestFocus();
      }

View Full Code Here

TOP

Related Classes of de.creepsmash.common.messages.server.RegistrationResponseMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.