Package com.comphenix.protocol.events

Examples of com.comphenix.protocol.events.NetworkMarker


    }
  }
 
  @Override
  public PacketEvent packetRecieved(PacketContainer packet, Player client, byte[] buffered) {
    NetworkMarker marker = buffered != null ? new LegacyNetworkMarker(ConnectionSide.CLIENT_SIDE, buffered, packet.getType()) : null;
    PacketEvent event = PacketEvent.fromClient((Object) manager, packet, marker, client);
   
    manager.invokePacketRecieving(event);
    return event;
  }
View Full Code Here


          } else if (!objectEquals(thisObj, result)) {
            override.put(thisObj, result);
          }
         
          // This is fine - received packets are enqueued in any case
          NetworkMarker marker = NetworkMarker.getNetworkMarker(event);
          processor.invokePostEvent(event, marker);
        }
       
      } catch (OutOfMemoryError e) {
        throw e;
View Full Code Here

        }
      }
     
      // Make sure we're listening
      if (id != null && hasListener(id)) {
        NetworkMarker marker = queuedMarkers.remove(packet);
       
        // A packet has been sent guys!
        PacketType type = PacketType.findLegacy(id, Sender.SERVER);
        PacketContainer container = new PacketContainer(type, packet);
        PacketEvent event = PacketEvent.fromServer(invoker, container, marker, currentPlayer);
View Full Code Here

   * @param packet - the packet that has been receieved.
   * @param sender - the client packet.
   * @return The packet event that was used.
   */
  PacketEvent packetReceived(PacketContainer packet, Player sender, byte[] buffered) {
    NetworkMarker marker = buffered != null ? new LegacyNetworkMarker(ConnectionSide.CLIENT_SIDE, buffered, packet.getType()) : null;
    PacketEvent event = PacketEvent.fromClient(this, packet, marker, sender);
   
    invoker.invokePacketRecieving(event);
    return event;
  }
View Full Code Here

          // Let the filters handle this packet
          Object original = accessor.get(instance);
         
          // See if we've been instructed not to process packets
          if (!scheduleProcessPackets.get()) {
            NetworkMarker marker = getMarker(original);
           
            if (marker != null)  {
              PacketEvent result = new PacketEvent(ChannelInjector.class);
              result.setNetworkMarker(marker);
              return result;
View Full Code Here

   * @param packet - the packet to encode to a byte array.
   * @param output - the output byte array.
   * @throws Exception If anything went wrong.
   */
  protected void encode(ChannelHandlerContext ctx, Object packet, ByteBuf output) throws Exception {
    NetworkMarker marker = null;
    PacketEvent event = currentEvent;
   
    try {
      // Skip every kind of non-filtered packet
      if (!scheduleProcessPackets.get()) {
View Full Code Here

      finishQueue.clear();
     
      for (ListIterator<Object> it = packets.listIterator(); it.hasNext(); ) {
        Object input = it.next();
        Class<?> packetClass = input.getClass();
        NetworkMarker marker = null;
       
        // Special case!
        handleLogin(packetClass, input);
       
        if (channelListener.includeBuffer(packetClass)) {
View Full Code Here

  protected void finishRead(ChannelHandlerContext ctx, Object msg) {
    // Assume same order
    PacketEvent event = finishQueue.pollFirst();
   
    if (event != null) {
      NetworkMarker marker = NetworkMarker.getNetworkMarker(event);
     
      if (marker != null) {
        processor.invokePostEvent(event, marker);
      }
    }
View Full Code Here

TOP

Related Classes of com.comphenix.protocol.events.NetworkMarker

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.