Package org.pokenet.server.network.message

Examples of org.pokenet.server.network.message.ItemMessage


        new Thread(new ItemProcessor(p, details)).start();
        break;
      case 'i':
        //Drop item
        if(p.getBag().removeItem(Integer.parseInt(message.substring(1)), 1)) {
          TcpProtocolHandler.writeMessage(p.getTcpSession(), new ItemMessage(false,
              Integer.parseInt(message.substring(1)), 1));
        }
        break;
      case 'T':
        //Trade packets
View Full Code Here


          this.updateClientMoney();
          //Let player know he bought the item
          TcpProtocolHandler.writeMessage(m_tcpSession,
              new ShopBuyMessage(GameServer.getServiceManager().getItemDatabase().getItem(id).getId()));
          //Update player inventory
          TcpProtocolHandler.writeMessage(m_tcpSession, new ItemMessage(true,
              GameServer.getServiceManager().getItemDatabase().getItem(id).getId(), 1));
        }
      }else{
        //Return You have no money, fool!
        TcpProtocolHandler.writeMessage(m_tcpSession, new ShopNoMoneyMessage());
View Full Code Here

      return;
    if(m_bag.containsItem(id) > -1) { //Guy does have the item he's selling.
      m_money = m_money + m_currentShop.sellItem(id, q);
      m_bag.removeItem(id, q);
      //Tell the client to remove the item from the player's inventory
      TcpProtocolHandler.writeMessage(m_tcpSession, new ItemMessage(false,
          GameServer.getServiceManager().getItemDatabase().getItem(id).getId(), q));
      //Update the client's money
      this.updateClientMoney();
      //Let player know he sold the item.
      TcpProtocolHandler.writeMessage(m_tcpSession,
View Full Code Here

   * Updates the client for a specific Item
   * @param index
   */
  public void updateClientBag(int i) {
    if(this.getBag().getItems().get(i) != null) {
      TcpProtocolHandler.writeMessage(m_tcpSession, new ItemMessage(true,
          getBag().getItems().get(i).getItemNumber(),
          getBag().getItems().get(i).getQuantity()));
    }
  }
View Full Code Here

TOP

Related Classes of org.pokenet.server.network.message.ItemMessage

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.