Package de.creepsmash.server

Examples of de.creepsmash.server.Client.handleError()


    int towerId = message.getTowerId();

    // sanity checks on the id
    Client client = sender.getClient();
    if (towerId <= 0) {
      client.handleError(ErrorType.Error,
          "Invalid tower id (tried to change strategy " + towerId + ")");
      return;
    } else if (towerId >= this.nextTowerId) {
      client.handleError(ErrorType.Error,
          "No such tower (tried to change strategy " + towerId + ")");
View Full Code Here


    if (towerId <= 0) {
      client.handleError(ErrorType.Error,
          "Invalid tower id (tried to change strategy " + towerId + ")");
      return;
    } else if (towerId >= this.nextTowerId) {
      client.handleError(ErrorType.Error,
          "No such tower (tried to change strategy " + towerId + ")");
      return;
    }

    ChangeStrategyRoundMessage csm = new ChangeStrategyRoundMessage();
View Full Code Here

    int towerId = m.getTowerId();

    // sanity checks on the id
    Client client = sender.getClient();
    if (towerId <= 0) {
      client.handleError(ErrorType.Error,
          "Invalid tower id (tried to upgrade tower " + towerId + ")");
      return;
    } else if (towerId >= this.nextTowerId) {
      client.handleError(ErrorType.Error,
          "No such tower (tried to upgrade tower " + towerId + ")");
View Full Code Here

    if (towerId <= 0) {
      client.handleError(ErrorType.Error,
          "Invalid tower id (tried to upgrade tower " + towerId + ")");
      return;
    } else if (towerId >= this.nextTowerId) {
      client.handleError(ErrorType.Error,
          "No such tower (tried to upgrade tower " + towerId + ")");
      return;
    }

    UpgradeTowerRoundMessage n = new UpgradeTowerRoundMessage();
View Full Code Here

    int towerId = m.getTowerId();

    // sanity checks on the id
    Client client = sender.getClient();
    if (towerId <= 0) {
      client.handleError(ErrorType.Error,
          "Invalid tower id (tried to sell tower " + towerId + ")");
      return;
    } else if (towerId >= this.nextTowerId) {
      client.handleError(ErrorType.Error,
          "No such tower (tried to sell tower " + towerId + ")");
View Full Code Here

    if (towerId <= 0) {
      client.handleError(ErrorType.Error,
          "Invalid tower id (tried to sell tower " + towerId + ")");
      return;
    } else if (towerId >= this.nextTowerId) {
      client.handleError(ErrorType.Error,
          "No such tower (tried to sell tower " + towerId + ")");
      return;
    }

    SellTowerRoundMessage n = new SellTowerRoundMessage();
View Full Code Here

  private GameState handle(GameOverMessage m, PlayerInGame sender) {
    int position = m.getPosition();
    Client client = sender.getClient();

    if (position < 1) {
      client.handleError(ErrorType.Error, "position in GAME_OVER must be > 0");   
      return this;
    }

    this.playerNamePositionMap.put(client.getUserName(), position);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.