diff --git a/Extensions/AdminOnConnect/pom.xml b/Extensions/AdminOnConnect/pom.xml
index b82ef61..c343d60 100644
--- a/Extensions/AdminOnConnect/pom.xml
+++ b/Extensions/AdminOnConnect/pom.xml
@@ -13,7 +13,7 @@
G-Earth
G-Earth-Parent
- 1.3.2
+ 1.3.3
../../
@@ -106,7 +106,7 @@
G-Earth
G-Earth
- 1.3.2
+ 1.3.3
diff --git a/Extensions/BlockReplacePackets/pom.xml b/Extensions/BlockReplacePackets/pom.xml
index e089bb8..d1d5aa0 100644
--- a/Extensions/BlockReplacePackets/pom.xml
+++ b/Extensions/BlockReplacePackets/pom.xml
@@ -13,7 +13,7 @@
G-Earth
G-Earth-Parent
- 1.3.2
+ 1.3.3
../../
@@ -106,7 +106,7 @@
G-Earth
G-Earth
- 1.3.2
+ 1.3.3
diff --git a/G-Earth/pom.xml b/G-Earth/pom.xml
index c6e8ae9..81f86c7 100644
--- a/G-Earth/pom.xml
+++ b/G-Earth/pom.xml
@@ -8,7 +8,7 @@
jar
- 1.3.2
+ 1.3.3
1.8
@@ -18,7 +18,7 @@
G-Earth
G-Earth-Parent
- 1.3.2
+ 1.3.3
diff --git a/G-Earth/src/main/java/gearth/Main.java b/G-Earth/src/main/java/gearth/Main.java
index 43cdac3..1b7014a 100644
--- a/G-Earth/src/main/java/gearth/Main.java
+++ b/G-Earth/src/main/java/gearth/Main.java
@@ -28,7 +28,7 @@ import java.util.Set;
public class Main extends Application {
public static Application main;
- public static String version = "1.3.2";
+ public static String version = "1.3.3";
private static String gitApi = "https://api.github.com/repos/sirjonasxx/G-Earth/releases/latest";
@Override
diff --git a/G-Earth/src/main/java/gearth/extensions/Extension.java b/G-Earth/src/main/java/gearth/extensions/Extension.java
index 89d668f..c987633 100644
--- a/G-Earth/src/main/java/gearth/extensions/Extension.java
+++ b/G-Earth/src/main/java/gearth/extensions/Extension.java
@@ -3,6 +3,7 @@ package gearth.extensions;
import gearth.misc.listenerpattern.Observable;
import gearth.protocol.HMessage;
import gearth.protocol.HPacket;
+import gearth.services.Constants;
import gearth.services.extensionhandler.extensions.implementations.network.NetworkExtensionInfo;
import java.io.*;
@@ -140,7 +141,9 @@ public abstract class Extension implements IExtension {
int connectionPort = packet.readInteger();
String hotelVersion = packet.readString();
String harbleMessagesPath = packet.readString();
- onConnectionObservable.fireEvent(l -> l.onConnection(host, connectionPort, hotelVersion, harbleMessagesPath));
+ String clientType = packet.readString();
+ Constants.UNITY_PACKETS = clientType.toLowerCase().contains("unity");
+ onConnectionObservable.fireEvent(l -> l.onConnection(host, connectionPort, hotelVersion, clientType, harbleMessagesPath));
onStartConnection();
}
else if (packet.headerId() == NetworkExtensionInfo.OUTGOING_MESSAGES_IDS.CONNECTIONEND) {
diff --git a/G-Earth/src/main/java/gearth/extensions/OnConnectionListener.java b/G-Earth/src/main/java/gearth/extensions/OnConnectionListener.java
index fdd0256..cbb63b0 100644
--- a/G-Earth/src/main/java/gearth/extensions/OnConnectionListener.java
+++ b/G-Earth/src/main/java/gearth/extensions/OnConnectionListener.java
@@ -1,5 +1,5 @@
package gearth.extensions;
public interface OnConnectionListener {
- void onConnection(String host, int port, String hotelversion, String harbleMessagesPath);
+ void onConnection(String host, int port, String hotelversion, String clientType, String harbleMessagesPath);
}
diff --git a/G-Earth/src/main/java/gearth/extensions/extra/harble/ChatConsole.java b/G-Earth/src/main/java/gearth/extensions/extra/harble/ChatConsole.java
index ae20790..ece2e9d 100644
--- a/G-Earth/src/main/java/gearth/extensions/extra/harble/ChatConsole.java
+++ b/G-Earth/src/main/java/gearth/extensions/extra/harble/ChatConsole.java
@@ -42,7 +42,7 @@ public class ChatConsole {
this.infoMessage = infoMessage;
final boolean[] doOncePerConnection = {false};
- extension.onConnect((s, i, s1, h1) -> doOncePerConnection[0] = true);
+ extension.onConnect((s, i, s1, ct, h1) -> doOncePerConnection[0] = true);
extension.intercept(HMessage.Direction.TOSERVER, hMessage -> {
// if the first packet on init is not 4000, the extension was already running, so we open the chat instantly
diff --git a/G-Earth/src/main/java/gearth/extensions/extra/harble/HashSupport.java b/G-Earth/src/main/java/gearth/extensions/extra/harble/HashSupport.java
index f507f44..c4dd705 100644
--- a/G-Earth/src/main/java/gearth/extensions/extra/harble/HashSupport.java
+++ b/G-Earth/src/main/java/gearth/extensions/extra/harble/HashSupport.java
@@ -29,7 +29,7 @@ public class HashSupport {
public HashSupport(IExtension extension) {
this.extension = extension;
- extension.onConnect((host, port, hotelversion, cachePath) -> {
+ extension.onConnect((host, port, hotelversion, clientType, cachePath) -> {
// synchronized (lock) {
harbleAPI = new HarbleAPI(new File(cachePath));
// }
diff --git a/G-Earth/src/main/java/gearth/misc/harble_api/HarbleAPIFetcher.java b/G-Earth/src/main/java/gearth/misc/harble_api/HarbleAPIFetcher.java
index 08beed3..4c54684 100644
--- a/G-Earth/src/main/java/gearth/misc/harble_api/HarbleAPIFetcher.java
+++ b/G-Earth/src/main/java/gearth/misc/harble_api/HarbleAPIFetcher.java
@@ -38,9 +38,9 @@ public class HarbleAPIFetcher {
//latest fetched
public static HarbleAPI HARBLEAPI = null;
- public synchronized static void fetch(String hotelversion) {
+ public synchronized static void fetch(String hotelversion, String clientType) {
// if unity
- if (!(hotelversion.toLowerCase().contains("production") || hotelversion.toLowerCase().contains("release"))) {
+ if (clientType.toLowerCase().contains("unity")) {
try {
HARBLEAPI = new HarbleAPI(
new File(new File(Main.class.getProtectionDomain().getCodeSource().getLocation().toURI())
@@ -77,12 +77,4 @@ public class HarbleAPIFetcher {
}
}
-
- public static void main(String[] args) {
- fetch("PRODUCTION-201901141210-114421986");
-
- HarbleAPI api = HARBLEAPI;
- HarbleAPI.HarbleMessage haMessage = api.getHarbleMessageFromHeaderId(HMessage.Direction.TOSERVER, 525);
- System.out.println(haMessage);
- }
}
\ No newline at end of file
diff --git a/G-Earth/src/main/java/gearth/protocol/HConnection.java b/G-Earth/src/main/java/gearth/protocol/HConnection.java
index 97ed7d4..511494d 100644
--- a/G-Earth/src/main/java/gearth/protocol/HConnection.java
+++ b/G-Earth/src/main/java/gearth/protocol/HConnection.java
@@ -172,6 +172,13 @@ public class HConnection {
return proxy.getHotelVersion();
}
+ public String getClientType() {
+ if (proxy == null) {
+ return "";
+ }
+ return proxy.getClientType();
+ }
+
public boolean isRawIpMode() {
return proxyProvider != null && proxyProvider instanceof LinuxRawIpFlashProxyProvider;
// WindowsRawIpProxyProvider extends LinuxRawIpProxyProvider
diff --git a/G-Earth/src/main/java/gearth/protocol/connection/HProxy.java b/G-Earth/src/main/java/gearth/protocol/connection/HProxy.java
index e5f1147..530556d 100644
--- a/G-Earth/src/main/java/gearth/protocol/connection/HProxy.java
+++ b/G-Earth/src/main/java/gearth/protocol/connection/HProxy.java
@@ -21,6 +21,7 @@ public class HProxy {
private volatile PacketHandler outHandler = null; //connection with server (only initialized when verified habbo connection)
private volatile String hotelVersion = "";
+ private volatile String clientType = "";
private volatile AsyncPacketSender asyncPacketSender = null;
public HProxy(HClient hClient, String input_domain, String actual_domain, int actual_port, int intercept_port, String intercept_host) {
@@ -36,13 +37,18 @@ public class HProxy {
this.proxy_server = socket;
}
- public void verifyProxy(PacketHandler incomingHandler, PacketHandler outgoingHandler, String hotelVersion) {
+ public void verifyProxy(PacketHandler incomingHandler, PacketHandler outgoingHandler, String hotelVersion, String clientType) {
this.inHandler = incomingHandler;
this.outHandler = outgoingHandler;
this.hotelVersion = hotelVersion;
+ this.clientType = clientType;
this.asyncPacketSender = new AsyncPacketSender(this);
}
+ public String getClientType() {
+ return clientType;
+ }
+
public int getActual_port() {
return actual_port;
}
diff --git a/G-Earth/src/main/java/gearth/protocol/connection/proxy/flash/FlashProxyProvider.java b/G-Earth/src/main/java/gearth/protocol/connection/proxy/flash/FlashProxyProvider.java
index 5e61dd8..b06c431 100644
--- a/G-Earth/src/main/java/gearth/protocol/connection/proxy/flash/FlashProxyProvider.java
+++ b/G-Earth/src/main/java/gearth/protocol/connection/proxy/flash/FlashProxyProvider.java
@@ -51,9 +51,9 @@ public abstract class FlashProxyProvider implements ProxyProvider {
Semaphore abort = new Semaphore(0);
- outgoingHandler.addOnDatastreamConfirmedListener(hotelVersion -> {
+ outgoingHandler.addOnDatastreamConfirmedListener((hotelVersion, clientType) -> {
incomingHandler.setAsDataStream();
- proxy.verifyProxy(incomingHandler, outgoingHandler, hotelVersion);
+ proxy.verifyProxy(incomingHandler, outgoingHandler, hotelVersion, clientType);
proxySetter.setProxy(proxy);
datastream[0] = true;
abortSemaphore = abort;
diff --git a/G-Earth/src/main/java/gearth/protocol/connection/proxy/unity/UnityCommunicator.java b/G-Earth/src/main/java/gearth/protocol/connection/proxy/unity/UnityCommunicator.java
index 985239b..c59ef92 100644
--- a/G-Earth/src/main/java/gearth/protocol/connection/proxy/unity/UnityCommunicator.java
+++ b/G-Earth/src/main/java/gearth/protocol/connection/proxy/unity/UnityCommunicator.java
@@ -58,10 +58,13 @@ public class UnityCommunicator {
HPacket maybe = new HPacket(packet);
if (maybe.getBytesLength() > 6 && maybe.headerId() == 4000) {
hProxy = new HProxy(HClient.UNITY, "", "", -1, -1, "");
+ String ignore = maybe.readString();
+ String clientType = maybe.readString();
hProxy.verifyProxy(
new UnityPacketHandler(hConnection.getExtensionHandler(), hConnection.getTrafficObservables(), session, HMessage.Direction.TOCLIENT),
new UnityPacketHandler(hConnection.getExtensionHandler(), hConnection.getTrafficObservables(), session, HMessage.Direction.TOSERVER),
- revision
+ revision,
+ clientType
);
proxySetter.setProxy(hProxy);
stateSetter.setState(HState.CONNECTED);
diff --git a/G-Earth/src/main/java/gearth/protocol/packethandler/flash/OnDatastreamConfirmedListener.java b/G-Earth/src/main/java/gearth/protocol/packethandler/flash/OnDatastreamConfirmedListener.java
index 4b09343..6e13dab 100644
--- a/G-Earth/src/main/java/gearth/protocol/packethandler/flash/OnDatastreamConfirmedListener.java
+++ b/G-Earth/src/main/java/gearth/protocol/packethandler/flash/OnDatastreamConfirmedListener.java
@@ -2,6 +2,6 @@ package gearth.protocol.packethandler.flash;
public interface OnDatastreamConfirmedListener {
- void confirm(String hotelVersion);
+ void confirm(String hotelVersion, String clientType);
}
diff --git a/G-Earth/src/main/java/gearth/protocol/packethandler/flash/OutgoingFlashPacketHandler.java b/G-Earth/src/main/java/gearth/protocol/packethandler/flash/OutgoingFlashPacketHandler.java
index 26467f6..a2775e6 100644
--- a/G-Earth/src/main/java/gearth/protocol/packethandler/flash/OutgoingFlashPacketHandler.java
+++ b/G-Earth/src/main/java/gearth/protocol/packethandler/flash/OutgoingFlashPacketHandler.java
@@ -27,7 +27,8 @@ public class OutgoingFlashPacketHandler extends FlashPacketHandler {
isDataStream = (hpacket.getBytesLength() > 6 && hpacket.length() < 100);
if (isDataStream) {
String version = hpacket.readString();
- datastreamConfirmedObservable.fireEvent(l -> l.confirm(version));
+ String clientType = hpacket.readString();
+ datastreamConfirmedObservable.fireEvent(l -> l.confirm(version, clientType));
}
}
}
diff --git a/G-Earth/src/main/java/gearth/services/extensionhandler/ExtensionHandler.java b/G-Earth/src/main/java/gearth/services/extensionhandler/ExtensionHandler.java
index a7253ee..3d12d3a 100644
--- a/G-Earth/src/main/java/gearth/services/extensionhandler/ExtensionHandler.java
+++ b/G-Earth/src/main/java/gearth/services/extensionhandler/ExtensionHandler.java
@@ -48,13 +48,14 @@ public class ExtensionHandler {
hConnection.getStateObservable().addListener((oldState, newState) -> {
if (newState == HState.CONNECTED) {
- HarbleAPIFetcher.fetch(hConnection.getHotelVersion());
+ HarbleAPIFetcher.fetch(hConnection.getHotelVersion(), hConnection.getClientType());
synchronized (gEarthExtensions) {
for (GEarthExtension extension : gEarthExtensions) {
extension.connectionStart(
hConnection.getDomain(),
hConnection.getServerPort(),
hConnection.getHotelVersion(),
+ hConnection.getClientType(),
HarbleAPIFetcher.HARBLEAPI == null ? "null" : HarbleAPIFetcher.HARBLEAPI.getPath()
);
}
@@ -243,6 +244,7 @@ public class ExtensionHandler {
hConnection.getDomain(),
hConnection.getServerPort(),
hConnection.getHotelVersion(),
+ hConnection.getClientType(),
HarbleAPIFetcher.HARBLEAPI == null ? "null" : HarbleAPIFetcher.HARBLEAPI.getPath()
);
}
diff --git a/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/GEarthExtension.java b/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/GEarthExtension.java
index 61bfc32..ce52885 100644
--- a/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/GEarthExtension.java
+++ b/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/GEarthExtension.java
@@ -38,7 +38,7 @@ public abstract class GEarthExtension {
public abstract void doubleclick();
public abstract void packetIntercept(HMessage hMessage);
public abstract void provideFlags(String[] flags);
- public abstract void connectionStart(String host, int port, String hotelVersion, String harbleMessagesPath);
+ public abstract void connectionStart(String host, int port, String hotelVersion, String clientType, String harbleMessagesPath);
public abstract void connectionEnd();
public abstract void init();
public abstract void close();
diff --git a/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/implementations/network/NetworkExtension.java b/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/implementations/network/NetworkExtension.java
index 209dc4f..707a3d2 100644
--- a/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/implementations/network/NetworkExtension.java
+++ b/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/implementations/network/NetworkExtension.java
@@ -190,13 +190,14 @@ public class NetworkExtension extends GEarthExtension {
}
@Override
- public void connectionStart(String host, int port, String hotelVersion, String harbleMessagesPath) {
+ public void connectionStart(String host, int port, String hotelVersion, String clientType, String harbleMessagesPath) {
sendMessage(
new HPacket(NetworkExtensionInfo.OUTGOING_MESSAGES_IDS.CONNECTIONSTART)
.appendString(host)
.appendInt(port)
.appendString(hotelVersion)
.appendString(harbleMessagesPath)
+ .appendString(clientType)
);
}
diff --git a/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/implementations/simple/ExampleExtension.java b/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/implementations/simple/ExampleExtension.java
index e04b043..909deae 100644
--- a/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/implementations/simple/ExampleExtension.java
+++ b/G-Earth/src/main/java/gearth/services/extensionhandler/extensions/implementations/simple/ExampleExtension.java
@@ -83,7 +83,7 @@ public class ExampleExtension extends GEarthExtension {
}
@Override
- public void connectionStart(String host, int port, String hotelVersion, String harbleMessagesPath) {
+ public void connectionStart(String host, int port, String hotelVersion, String clientType, String harbleMessagesPath) {
// a new habbo client has connected
System.out.println("Connected to " + host);
}
diff --git a/pom.xml b/pom.xml
index abd26ca..f12df7b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,7 +7,7 @@
G-Earth
G-Earth-Parent
pom
- 1.3.2
+ 1.3.3
G-Earth-Parent
https://github.com/sirjonasxx/G-Earth