mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 08:50:52 +01:00
grtgrtgrg
This commit is contained in:
parent
170f1b4760
commit
50fc4b4107
@ -155,6 +155,7 @@ public abstract class Extension extends ExtensionBase {
|
|||||||
flagRequestCallback = null;
|
flagRequestCallback = null;
|
||||||
}
|
}
|
||||||
else if (packet.headerId() == NetworkExtensionInfo.OUTGOING_MESSAGES_IDS.INIT) {
|
else if (packet.headerId() == NetworkExtensionInfo.OUTGOING_MESSAGES_IDS.INIT) {
|
||||||
|
// boolean isConnected = packet.readBoolean(); - don't read since not relevant here
|
||||||
initExtension();
|
initExtension();
|
||||||
writeToConsole("green","Extension \"" + getInfoAnnotations().Title() + "\" successfully initialized", false);
|
writeToConsole("green","Extension \"" + getInfoAnnotations().Title() + "\" successfully initialized", false);
|
||||||
}
|
}
|
||||||
|
@ -118,9 +118,9 @@ public class InternalExtensionBuilder extends GEarthExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init(boolean isConnected) {
|
||||||
extension.initExtension();
|
extension.initExtension();
|
||||||
}
|
} // not implementing isConnected, only relevant for g-python
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
|
@ -40,7 +40,7 @@ public class HPacket implements StringifyAble {
|
|||||||
} catch (InvalidPacketException e) {
|
} catch (InvalidPacketException e) {
|
||||||
packetInBytes = new byte[0];
|
packetInBytes = new byte[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public HPacket(int header) {
|
public HPacket(int header) {
|
||||||
packetInBytes = new byte[]{0,0,0,2,0,0};
|
packetInBytes = new byte[]{0,0,0,2,0,0};
|
||||||
replaceShort(4, (short)header);
|
replaceShort(4, (short)header);
|
||||||
|
@ -237,7 +237,7 @@ public class ExtensionHandler {
|
|||||||
};
|
};
|
||||||
|
|
||||||
extension.getExtensionObservable().addListener(listener);
|
extension.getExtensionObservable().addListener(listener);
|
||||||
extension.init();
|
extension.init(hConnection.getState() == HState.CONNECTED);
|
||||||
|
|
||||||
if (hConnection.getState() == HState.CONNECTED) {
|
if (hConnection.getState() == HState.CONNECTED) {
|
||||||
extension.connectionStart(
|
extension.connectionStart(
|
||||||
|
@ -40,7 +40,7 @@ public abstract class GEarthExtension {
|
|||||||
public abstract void provideFlags(String[] flags);
|
public abstract void provideFlags(String[] flags);
|
||||||
public abstract void connectionStart(String host, int port, String hotelVersion, String clientIdentifier, HClient clientType, PacketInfoManager packetInfoManager);
|
public abstract void connectionStart(String host, int port, String hotelVersion, String clientIdentifier, HClient clientType, PacketInfoManager packetInfoManager);
|
||||||
public abstract void connectionEnd();
|
public abstract void connectionEnd();
|
||||||
public abstract void init();
|
public abstract void init(boolean isConnected);
|
||||||
public abstract void close();
|
public abstract void close();
|
||||||
public abstract void packetToStringResponse(String string, String expression);
|
public abstract void packetToStringResponse(String string, String expression);
|
||||||
public abstract void stringToPacketResponse(HPacket packet);
|
public abstract void stringToPacketResponse(HPacket packet);
|
||||||
|
@ -213,9 +213,9 @@ public class NetworkExtension extends GEarthExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init(boolean isConnected) {
|
||||||
sendMessage(
|
sendMessage(
|
||||||
new HPacket(NetworkExtensionInfo.OUTGOING_MESSAGES_IDS.INIT)
|
new HPacket(NetworkExtensionInfo.OUTGOING_MESSAGES_IDS.INIT, isConnected)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ public class ExampleExtension extends GEarthExtension {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() {
|
public void init(boolean isConnected) {
|
||||||
System.out.println("Example extension is connected to G-Earth");
|
System.out.println("Example extension is connected to G-Earth");
|
||||||
// the extension is now connected with G-Earth
|
// the extension is now connected with G-Earth
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user