Examples of clearEvents()


Examples of games.stendhal.server.entity.player.Player.clearEvents()

    action.put("slot", "bag");
    action.put("item", "dagger");

    CommandCenter.execute(player, action);
    assertEquals("Player \"noone\" not found.", player.events().get(0).get("text"));
    player.clearEvents();
  }
}
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

      assertEquals("active", accountDAO.getAccountStatus(transaction, admin.getName()));

      TransactionPool.get().commit(transaction);

      assertFalse(CommandCenter.execute(admin , action));
      admin.clearEvents();
      admin.setAdminLevel(5000);
      assertTrue(CommandCenter.execute(admin , action));
     
      transaction = TransactionPool.get().beginWork();
      System.out.println(admin.events().get(0).toString());
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

   * Tests for onInvalidAction.
   */
  @Test
  public void testOnInvalidAction() {
    final Player bob = PlayerTestHelper.createPlayer("bob");
    bob.clearEvents();
    final RPAction action = new RPAction();
    action.put("type", "bla");
    action.put("message", "bla");
    final AwayAction aa = new AwayAction();
    aa.onAction(bob, action);
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

    final RPAction action = new RPAction();
    action.put("type", "wrap");
    action.put("args", "");
    wrap.onAction(player, action);
    assertThat(player.events().get(0).get("text"), is("You don't have any null"));
    player.clearEvents();

    action.put("args", "blabla");
    wrap.onAction(player, action);
    assertThat(player.events().get(0).get("text"), is("You don't have any null blabla"));
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

    action.put("args", "blabla");
    wrap.onAction(player, action);
    assertThat(player.events().get(0).get("text"), is("You don't have any null blabla"));

    player.clearEvents();

    action.put("target", "what");
    action.put("args", "blabla");
    wrap.onAction(player, action);
    assertThat(player.events().get(0).get("text"), is("You don't have any what blabla"));
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

    action.put("type", "spell");
    // no target
    assertTrue(CommandCenter.execute(pl, action));
    assertEquals(1, pl.events().size());
    assertEquals("Usage: #/spell <spellname>", pl.events().get(0).get("text"));
    pl.clearEvents();

    action = new RPAction();
    action.put("type", "spell");
    action.put("target", "");
    assertTrue(CommandCenter.execute(pl, action));
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

    action.put("type", "spell");
    action.put("target", "");
    assertTrue(CommandCenter.execute(pl, action));
    assertEquals(1, pl.events().size());
    assertEquals("You did not enter a spell to cast.", pl.events().get(0).get("text"));
    pl.clearEvents();
  }

  /**
   * Tests for wrong action.
   */
 
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

    action.put("target", "spell");
    assertTrue(CommandCenter.execute(pl, action));
    assertEquals(2, pl.events().size());
    assertEquals("Trying to cast a spell...", pl.events().get(0).get("text"));
    assertEquals("You can not cast this spell.", pl.events().get(1).get("text"));
    pl.clearEvents();
  }

  /**
   * Tests for wrong spell name.
   */
 
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

    assertTrue(CommandCenter.execute(pl, action));
    assertEquals(2, pl.events().size());
    int idx = 0;
    assertEquals("Trying to cast a spell...", pl.events().get(idx++).get("text"));
    assertEquals("You can not cast this spell.", pl.events().get(idx++).get("text"));
    pl.clearEvents();
  }

  /**
   * Tests for correct, but unhandled spell.
   */
 
View Full Code Here

Examples of games.stendhal.server.entity.player.Player.clearEvents()

    assertTrue(CommandCenter.execute(pl, action));
    assertEquals(2, pl.events().size());
    int idx = 0;
    assertEquals("Trying to cast a spell...", pl.events().get(idx++).get("text"));
    assertEquals("The spell you tried to cast doesn't exist!", pl.events().get(idx++).get("text"));
    pl.clearEvents();
  }

  /**
   * Tests for "heal" spell.
   */
 
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.