mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2025-01-31 12:52:36 +01:00
addition extensions
This commit is contained in:
parent
455d30e045
commit
8f5b59c97d
@ -11,6 +11,7 @@ import gearth.services.extensionhandler.extensions.GEarthExtension;
|
||||
import gearth.services.extensionhandler.extensions.extensionproducers.ExtensionProducer;
|
||||
import gearth.services.extensionhandler.extensions.extensionproducers.ExtensionProducerFactory;
|
||||
import gearth.services.extensionhandler.extensions.extensionproducers.ExtensionProducerObserver;
|
||||
import gearth.services.packet_info.PacketInfoManager;
|
||||
import javafx.util.Pair;
|
||||
|
||||
import java.io.IOException;
|
||||
@ -230,6 +231,13 @@ public class ExtensionHandler {
|
||||
@Override
|
||||
protected void stringToPacketRequest(String string) {
|
||||
HPacket packet = new HPacket(string);
|
||||
PacketInfoManager packetInfoManager = hConnection.getPacketInfoManager();
|
||||
if (packet.canComplete(HMessage.Direction.TOCLIENT, packetInfoManager) && !packet.canComplete(HMessage.Direction.TOSERVER, packetInfoManager)) {
|
||||
packet.completePacket(HMessage.Direction.TOCLIENT, packetInfoManager);
|
||||
}
|
||||
else if (!packet.canComplete(HMessage.Direction.TOCLIENT, packetInfoManager) && packet.canComplete(HMessage.Direction.TOSERVER, packetInfoManager)) {
|
||||
packet.completePacket(HMessage.Direction.TOSERVER, packetInfoManager);
|
||||
}
|
||||
extension.stringToPacketResponse(packet);
|
||||
}
|
||||
};
|
||||
|
@ -51,7 +51,6 @@ public abstract class GEarthExtension {
|
||||
|
||||
|
||||
// ----------------- listen to the extension ---------------------
|
||||
|
||||
protected final Observable<ExtensionListener> extensionObservable = new SynchronizedObservable<>();
|
||||
public Observable<ExtensionListener> getExtensionObservable() {
|
||||
return extensionObservable;
|
||||
|
Loading…
x
Reference in New Issue
Block a user