Package org.knapper.core.roles

Examples of org.knapper.core.roles.IPlayer


  }

  private void handleChatMessageBody(IRole sender, ChatMessageBody body) {
    String playerGuid = sender.getGuid();
   
    IPlayer player = KnapperServerCore.getDefault().getMasterServer().getPlayer(playerGuid);
   
    if (player != null) {
      appendChatMessage(player.getNickName(), body.getText());
    } else {
      appendChatMessage("?unknown?", body.getText());
    }
   
   
View Full Code Here


   
  public IPlayer registerPlayer(
      IIOThread receiverThread,
      AuthRequestMessageBody armb) {
   
    IPlayer player = null;
   
    final String nickName = createNickName(armb.getNickName());
    final String guid = GuidGenerator.generate();
   
    player = new PlayerImpl(guid, nickName);
View Full Code Here

    }
  }
 
  public void send(IRole destination, IMessageBody messageBody) {
    for (int i = 0; i < serverIOThreads.size(); i++) {
      IPlayer player = serverIOThreads.get(i).getPlayer();
     
      if (player != null && player.getGuid().equals(destination.getGuid())) {
        IMessage message = MessageFactory.createMessage(
            masterServer,
            player,
            messageBody);
       
View Full Code Here

  }
 
  public IPlayer getPlayer(String guid) {
    if (getServerThread() != null) {
      for (ServerIOThread iot : getServerThread().getIOThreads()) {
        IPlayer player = iot.getPlayer();
       
        if (player != null && player.getGuid().equals(guid)) {
          return player;
        }
      }
    }
   
View Full Code Here

  public IPlayer[] getPlayers() {
    ArrayList<IPlayer> players = new ArrayList<IPlayer>();
   
    if (getServerThread() != null) {
      for (ServerIOThread iot : getServerThread().getIOThreads()) {
        IPlayer player = iot.getPlayer();
       
        if (player != null) {
          players.add(player);
        }
      }
View Full Code Here

   
    return null;
  }
 
  public IPlayer getPlayer() {
    return new IPlayer() {

      public String getGuid() {
        return getGuidLocal();
      }
View Full Code Here

TOP

Related Classes of org.knapper.core.roles.IPlayer

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.