Package org.pokenet.server.backend.entity

Examples of org.pokenet.server.backend.entity.Char


  public boolean removePlayer(String player) {
    /* Check waiting list */
    synchronized(m_waiting) {
      Iterator<Char> it = m_waiting.iterator();
      while(it.hasNext()) {
        Char c = it.next();
        if(c.getName().equalsIgnoreCase(player)) {
          m_waiting.remove(c);
          m_pLoad--;
          return true;
        }
      }
    }
    /* Check moved list */
    synchronized(m_moved) {
      Iterator<Char> it = m_moved.iterator();
      while(it.hasNext()) {
        Char c = it.next();
        if(c.getName().equalsIgnoreCase(player)) {
          m_moved.remove(c);
          m_pLoad--;
          return true;
        }
      }
View Full Code Here


 
  /**
   * Called by m_thread.start(). Loops through all players calling PlayerChar.move() if the player requested to be moved.
   */
  public void run() {
    Char tmp = null;
    //ArrayList<Char> tmpArray = null;
    while(m_isRunning) {
      /* Pull char of highest priority */
      if(m_waiting != null && m_waiting.size() > 0) {
        synchronized(m_waiting) {
          tmp = m_waiting.poll();
        }
        /* Move character */
        tmp.move();
        /* Place him in moved array */
        synchronized(m_moved) {
          m_moved.offer(tmp);
        }
      }
View Full Code Here

TOP

Related Classes of org.pokenet.server.backend.entity.Char

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.