Package de.creepsmash.common.messages.server

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


      throw new IllegalArgumentException("'client' was null");
    }

    Game game = findGame(gameId);
    if (game == null) {
      sender.send(new JoinGameResponseMessage(ResponseType.failed));
      return null;
    }

    synchronized (game) {
     
      int clientElopoints = AuthenticationService.getPlayer(
          sender.getUserName()).getElopoints() - 500;
     
      if ((clientElopoints < game.getMinEloPoints() && game.getMinEloPoints() != 0)
          || (clientElopoints > game.getMaxEloPoints() && game.getMaxEloPoints() != 0)) {
        sender.send(new JoinGameResponseMessage(ResponseType.failed));
        return null;
      }
      if (game.getPasswort().length() > 0) {
        if (!game.getPasswort().equals(Passwort)) {

          sender
              .send(new JoinGameResponseMessage(
                  ResponseType.failed));
          return null;
        }
      }
      if ((game.canClientJoin()) && (game.check4Multi(sender.getIPAddress(), sender.getMACAddress()))) {
        sender.send(new JoinGameResponseMessage(ResponseType.ok));
        this.clients.remove(sender);
        game.newClient(sender);
      } else {
        sender.send(new JoinGameResponseMessage(ResponseType.failed));
        return null;
      }
    }

    sendAll(playersMessage());
View Full Code Here


    } else if (HighscoreResponseMessage.PATTERN.matcher(messageString)
        .matches()) {
      messageObject = new HighscoreResponseMessage();
    } else if (JoinGameResponseMessage.PATTERN.matcher(messageString)
        .matches()) {
      messageObject = new JoinGameResponseMessage();
    } else if (LoginResponseMessage.PATTERN.matcher(messageString)
        .matches()) {
      messageObject = new LoginResponseMessage();
    } else if (MessageMessage.PATTERN.matcher(messageString).matches()) {
      messageObject = new MessageMessage();
View Full Code Here

TOP

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

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.