2022-07-20 13:18:57 +02:00
|
|
|
package fr.pandacube.lib.net;
|
2020-02-08 15:43:19 +01:00
|
|
|
|
2022-07-20 13:18:57 +02:00
|
|
|
import com.google.common.annotations.Beta;
|
|
|
|
|
|
|
|
@Beta
|
2020-02-08 15:43:19 +01:00
|
|
|
@FunctionalInterface
|
|
|
|
public interface PPacketListener<P extends PPacket> {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Called when we receive a packet (except responses)
|
|
|
|
* @param connection the connection from where the packet comes
|
|
|
|
* @param packet the received packet
|
|
|
|
*/
|
2022-07-10 00:55:56 +02:00
|
|
|
void onPacketReceive(PSocket connection, P packet);
|
2020-02-08 15:43:19 +01:00
|
|
|
|
|
|
|
}
|