mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-30 04:00:50 +01:00
rename stuff and add stuff
This commit is contained in:
parent
007bffbc69
commit
530abc3139
@ -27,7 +27,7 @@ public class AdminOnConnect extends Extension {
|
||||
private boolean done = true;
|
||||
|
||||
protected void initExtension() {
|
||||
intercept(HMessage.Side.TOCLIENT, message -> {
|
||||
intercept(HMessage.Direction.TOCLIENT, message -> {
|
||||
if (!done) {
|
||||
HPacket packet = message.getPacket();
|
||||
if (packet.length() == 11) {
|
||||
@ -42,7 +42,7 @@ public class AdminOnConnect extends Extension {
|
||||
}
|
||||
});
|
||||
|
||||
intercept(HMessage.Side.TOSERVER, 4000, message -> done = false);
|
||||
intercept(HMessage.Direction.TOSERVER, 4000, message -> done = false);
|
||||
}
|
||||
|
||||
// protected void onStartConnection() {
|
||||
|
@ -7,8 +7,6 @@ import gearth.protocol.HMessage;
|
||||
import gearth.protocol.HPacket;
|
||||
import gearth.ui.GEarthController;
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.InvalidationListener;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXMLLoader;
|
||||
import javafx.scene.Parent;
|
||||
@ -180,8 +178,8 @@ public class BlockAndReplacePackets extends ExtensionForm {
|
||||
}
|
||||
};
|
||||
|
||||
intercept(HMessage.Side.TOSERVER, messageListener);
|
||||
intercept(HMessage.Side.TOCLIENT, messageListener);
|
||||
intercept(HMessage.Direction.TOSERVER, messageListener);
|
||||
intercept(HMessage.Direction.TOCLIENT, messageListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,7 +1,6 @@
|
||||
package extensions.blockreplacepackets.rules;
|
||||
|
||||
import gearth.protocol.HMessage;
|
||||
import gearth.protocol.HPacket;
|
||||
|
||||
/**
|
||||
* Created by Jonas on 6/11/2018.
|
||||
@ -19,8 +18,8 @@ public class BlockPacketRule extends BlockReplaceRule{
|
||||
@Override
|
||||
public void appendRuleToMessage(HMessage message) {
|
||||
if (side == Side.ALL
|
||||
|| (message.getDestination() == HMessage.Side.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Side.TOCLIENT && side ==Side.INCOMING)) {
|
||||
|| (message.getDestination() == HMessage.Direction.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Direction.TOCLIENT && side ==Side.INCOMING)) {
|
||||
if (message.getPacket().headerId() == headerId) {
|
||||
message.setBlocked(true);
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ public class ReplaceIntegerRule extends BlockReplaceRule {
|
||||
@Override
|
||||
public void appendRuleToMessage(HMessage message) {
|
||||
if (side == Side.ALL
|
||||
|| (message.getDestination() == HMessage.Side.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Side.TOCLIENT && side ==Side.INCOMING)) {
|
||||
|| (message.getDestination() == HMessage.Direction.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Direction.TOCLIENT && side ==Side.INCOMING)) {
|
||||
message.getPacket().replaceAllIntegers(value, replacement);
|
||||
}
|
||||
}
|
||||
|
@ -21,8 +21,8 @@ public class ReplacePacketRule extends BlockReplaceRule {
|
||||
@Override
|
||||
public void appendRuleToMessage(HMessage message) {
|
||||
if (side == Side.ALL
|
||||
|| (message.getDestination() == HMessage.Side.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Side.TOCLIENT && side ==Side.INCOMING)) {
|
||||
|| (message.getDestination() == HMessage.Direction.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Direction.TOCLIENT && side ==Side.INCOMING)) {
|
||||
if (message.getPacket().headerId() == headerId) {
|
||||
message.getPacket().constructFromString(replacement.stringify());
|
||||
message.getPacket().overrideEditedField(true);
|
||||
|
@ -20,8 +20,8 @@ public class ReplaceStringRule extends BlockReplaceRule {
|
||||
@Override
|
||||
public void appendRuleToMessage(HMessage message) {
|
||||
if (side == Side.ALL
|
||||
|| (message.getDestination() == HMessage.Side.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Side.TOCLIENT && side ==Side.INCOMING)) {
|
||||
|| (message.getDestination() == HMessage.Direction.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Direction.TOCLIENT && side ==Side.INCOMING)) {
|
||||
message.getPacket().replaceAllStrings(value, replacement);
|
||||
}
|
||||
}
|
||||
|
@ -20,8 +20,8 @@ public class ReplaceSubstringRule extends BlockReplaceRule {
|
||||
@Override
|
||||
public void appendRuleToMessage(HMessage message) {
|
||||
if (side == Side.ALL
|
||||
|| (message.getDestination() == HMessage.Side.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Side.TOCLIENT && side ==Side.INCOMING)) {
|
||||
|| (message.getDestination() == HMessage.Direction.TOSERVER && side == Side.OUTGOING)
|
||||
|| (message.getDestination() == HMessage.Direction.TOCLIENT && side ==Side.INCOMING)) {
|
||||
message.getPacket().replaceAllSubstrings(value, replacement);
|
||||
}
|
||||
}
|
||||
|
@ -172,7 +172,7 @@ public abstract class Extension implements IExtension{
|
||||
HPacket habboPacket = habboMessage.getPacket();
|
||||
|
||||
Map<Integer, List<MessageListener>> listeners =
|
||||
habboMessage.getDestination() == HMessage.Side.TOCLIENT ?
|
||||
habboMessage.getDestination() == HMessage.Direction.TOCLIENT ?
|
||||
incomingMessageListeners :
|
||||
outgoingMessageListeners;
|
||||
|
||||
@ -235,7 +235,7 @@ public abstract class Extension implements IExtension{
|
||||
* @return success or failure
|
||||
*/
|
||||
public boolean sendToClient(HPacket packet) {
|
||||
return send(packet, HMessage.Side.TOCLIENT);
|
||||
return send(packet, HMessage.Direction.TOCLIENT);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -244,11 +244,11 @@ public abstract class Extension implements IExtension{
|
||||
* @return success or failure
|
||||
*/
|
||||
public boolean sendToServer(HPacket packet) {
|
||||
return send(packet, HMessage.Side.TOSERVER);
|
||||
return send(packet, HMessage.Direction.TOSERVER);
|
||||
}
|
||||
private boolean send(HPacket packet, HMessage.Side side) {
|
||||
private boolean send(HPacket packet, HMessage.Direction direction) {
|
||||
HPacket packet1 = new HPacket(Extensions.INCOMING_MESSAGES_IDS.SENDMESSAGE);
|
||||
packet1.appendByte(side == HMessage.Side.TOCLIENT ? (byte)0 : (byte)1);
|
||||
packet1.appendByte(direction == HMessage.Direction.TOCLIENT ? (byte)0 : (byte)1);
|
||||
packet1.appendInt(packet.getBytesLength());
|
||||
packet1.appendBytes(packet.toBytes());
|
||||
try {
|
||||
@ -261,13 +261,13 @@ public abstract class Extension implements IExtension{
|
||||
|
||||
/**
|
||||
* Register a listener on a specific packet Type
|
||||
* @param side ToClient or ToServer
|
||||
* @param direction ToClient or ToServer
|
||||
* @param headerId the packet header ID
|
||||
* @param messageListener the callback
|
||||
*/
|
||||
public void intercept(HMessage.Side side, int headerId, MessageListener messageListener) {
|
||||
public void intercept(HMessage.Direction direction, int headerId, MessageListener messageListener) {
|
||||
Map<Integer, List<MessageListener>> listeners =
|
||||
side == HMessage.Side.TOCLIENT ?
|
||||
direction == HMessage.Direction.TOCLIENT ?
|
||||
incomingMessageListeners :
|
||||
outgoingMessageListeners;
|
||||
|
||||
@ -283,11 +283,11 @@ public abstract class Extension implements IExtension{
|
||||
|
||||
/**
|
||||
* Register a listener on all packets
|
||||
* @param side ToClient or ToServer
|
||||
* @param direction ToClient or ToServer
|
||||
* @param messageListener the callback
|
||||
*/
|
||||
public void intercept(HMessage.Side side, MessageListener messageListener) {
|
||||
intercept(side, -1, messageListener);
|
||||
public void intercept(HMessage.Direction direction, MessageListener messageListener) {
|
||||
intercept(direction, -1, messageListener);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,13 +1,10 @@
|
||||
package gearth.extensions;
|
||||
|
||||
import javafx.application.Application;
|
||||
import javafx.application.Platform;
|
||||
import javafx.stage.Stage;
|
||||
import gearth.protocol.HMessage;
|
||||
import gearth.protocol.HPacket;
|
||||
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
/**
|
||||
* Created by Jonas on 22/09/18.
|
||||
*/
|
||||
@ -31,11 +28,11 @@ public abstract class ExtensionForm implements IExtension{
|
||||
public void writeToConsole(String s) {
|
||||
extension.writeToConsole(s);
|
||||
}
|
||||
public void intercept(HMessage.Side side, Extension.MessageListener messageListener) {
|
||||
extension.intercept(side, messageListener);
|
||||
public void intercept(HMessage.Direction direction, Extension.MessageListener messageListener) {
|
||||
extension.intercept(direction, messageListener);
|
||||
}
|
||||
public void intercept(HMessage.Side side, int headerId, Extension.MessageListener messageListener){
|
||||
extension.intercept(side, headerId, messageListener);
|
||||
public void intercept(HMessage.Direction direction, int headerId, Extension.MessageListener messageListener){
|
||||
extension.intercept(direction, headerId, messageListener);
|
||||
}
|
||||
public boolean sendToServer(HPacket packet){
|
||||
return extension.sendToServer(packet);
|
||||
|
@ -10,8 +10,8 @@ public interface IExtension {
|
||||
|
||||
boolean sendToClient(HPacket packet);
|
||||
boolean sendToServer(HPacket packet);
|
||||
void intercept(HMessage.Side side, int headerId, Extension.MessageListener messageListener);
|
||||
void intercept(HMessage.Side side, Extension.MessageListener messageListener);
|
||||
void intercept(HMessage.Direction direction, int headerId, Extension.MessageListener messageListener);
|
||||
void intercept(HMessage.Direction direction, Extension.MessageListener messageListener);
|
||||
boolean requestFlags(Extension.FlagsCheckListener flagRequestCallback);
|
||||
void writeToConsole(String s); // not implemented in g-earth yet
|
||||
void onConnect(Extension.OnConnectionListener listener);
|
||||
|
@ -45,7 +45,7 @@ public class ChatConsole {
|
||||
|
||||
extension.onConnect((s, i, s1, h1) -> doOncePerConnection[0] = true);
|
||||
|
||||
extension.intercept(HMessage.Side.TOSERVER, hMessage -> {
|
||||
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
|
||||
if (firstTime) {
|
||||
firstTime = false;
|
||||
@ -56,7 +56,7 @@ public class ChatConsole {
|
||||
}
|
||||
});
|
||||
|
||||
hashSupport.intercept(HMessage.Side.TOCLIENT, "Friends", hMessage -> {
|
||||
hashSupport.intercept(HMessage.Direction.TOCLIENT, "Friends", hMessage -> {
|
||||
if (doOncePerConnection[0]) {
|
||||
doOncePerConnection[0] = false;
|
||||
|
||||
@ -72,7 +72,7 @@ public class ChatConsole {
|
||||
}
|
||||
});
|
||||
|
||||
hashSupport.intercept(HMessage.Side.TOSERVER, "FriendPrivateMessage", hMessage -> {
|
||||
hashSupport.intercept(HMessage.Direction.TOSERVER, "FriendPrivateMessage", hMessage -> {
|
||||
HPacket packet = hMessage.getPacket();
|
||||
if (packet.readInteger() == chatid) {
|
||||
hMessage.setBlocked(true);
|
||||
|
@ -1,15 +1,11 @@
|
||||
package gearth.extensions.extra.harble;
|
||||
|
||||
import gearth.Main;
|
||||
import gearth.extensions.Extension;
|
||||
import gearth.extensions.IExtension;
|
||||
import gearth.misc.harble_api.HarbleAPI;
|
||||
import gearth.misc.harble_api.HarbleAPIFetcher;
|
||||
import gearth.protocol.HMessage;
|
||||
import gearth.protocol.HPacket;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
@ -38,9 +34,9 @@ public class HashSupport {
|
||||
// }
|
||||
});
|
||||
|
||||
extension.intercept(HMessage.Side.TOSERVER, message -> {
|
||||
extension.intercept(HMessage.Direction.TOSERVER, message -> {
|
||||
// synchronized (lock) {
|
||||
HarbleAPI.HarbleMessage haMessage = harbleAPI.getHarbleMessageFromHeaderId(HMessage.Side.TOSERVER, message.getPacket().headerId());
|
||||
HarbleAPI.HarbleMessage haMessage = harbleAPI.getHarbleMessageFromHeaderId(HMessage.Direction.TOSERVER, message.getPacket().headerId());
|
||||
if (haMessage != null) {
|
||||
List<Extension.MessageListener> listeners_hash = outgoingMessageListeners.get(haMessage.getHash());
|
||||
List<Extension.MessageListener> listeners_name = outgoingMessageListeners.get(haMessage.getName());
|
||||
@ -59,9 +55,9 @@ public class HashSupport {
|
||||
}
|
||||
// }
|
||||
});
|
||||
extension.intercept(HMessage.Side.TOCLIENT, message -> {
|
||||
extension.intercept(HMessage.Direction.TOCLIENT, message -> {
|
||||
// synchronized (lock) {
|
||||
HarbleAPI.HarbleMessage haMessage = harbleAPI.getHarbleMessageFromHeaderId(HMessage.Side.TOCLIENT, message.getPacket().headerId());
|
||||
HarbleAPI.HarbleMessage haMessage = harbleAPI.getHarbleMessageFromHeaderId(HMessage.Direction.TOCLIENT, message.getPacket().headerId());
|
||||
if (haMessage != null) {
|
||||
List<Extension.MessageListener> listeners_hash = incomingMessageListeners.get(haMessage.getHash());
|
||||
List<Extension.MessageListener> listeners_name = incomingMessageListeners.get(haMessage.getName());
|
||||
@ -82,9 +78,9 @@ public class HashSupport {
|
||||
});
|
||||
}
|
||||
|
||||
public void intercept(HMessage.Side side, String hashOrName, Extension.MessageListener messageListener) {
|
||||
public void intercept(HMessage.Direction direction, String hashOrName, Extension.MessageListener messageListener) {
|
||||
Map<String, List<Extension.MessageListener>> messageListeners =
|
||||
(side == HMessage.Side.TOSERVER
|
||||
(direction == HMessage.Direction.TOSERVER
|
||||
? outgoingMessageListeners
|
||||
: incomingMessageListeners);
|
||||
|
||||
@ -92,14 +88,14 @@ public class HashSupport {
|
||||
messageListeners.get(hashOrName).add(messageListener);
|
||||
}
|
||||
|
||||
private boolean send(HMessage.Side side, String hashOrName, Object... objects) {
|
||||
private boolean send(HMessage.Direction direction, String hashOrName, Object... objects) {
|
||||
int headerId;
|
||||
HarbleAPI.HarbleMessage fromname = harbleAPI.getHarbleMessageFromName(side, hashOrName);
|
||||
HarbleAPI.HarbleMessage fromname = harbleAPI.getHarbleMessageFromName(direction, hashOrName);
|
||||
if (fromname != null) {
|
||||
headerId = fromname.getHeaderId();
|
||||
}
|
||||
else {
|
||||
List<HarbleAPI.HarbleMessage> possibilities = harbleAPI.getHarbleMessagesFromHash(side, hashOrName);
|
||||
List<HarbleAPI.HarbleMessage> possibilities = harbleAPI.getHarbleMessagesFromHash(direction, hashOrName);
|
||||
if (possibilities.size() == 0) return false;
|
||||
headerId = possibilities.get(0).getHeaderId();
|
||||
}
|
||||
@ -107,7 +103,7 @@ public class HashSupport {
|
||||
try {
|
||||
HPacket packetToSend = new HPacket(headerId, objects);
|
||||
|
||||
return (side == HMessage.Side.TOCLIENT
|
||||
return (direction == HMessage.Direction.TOCLIENT
|
||||
? extension.sendToClient(packetToSend)
|
||||
: extension.sendToServer(packetToSend));
|
||||
}
|
||||
@ -121,7 +117,7 @@ public class HashSupport {
|
||||
* @return if no errors occurred (invalid hash/invalid parameters/connection error)
|
||||
*/
|
||||
public boolean sendToClient(String hashOrName, Object... objects) {
|
||||
return send(HMessage.Side.TOCLIENT, hashOrName, objects);
|
||||
return send(HMessage.Direction.TOCLIENT, hashOrName, objects);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,7 +125,7 @@ public class HashSupport {
|
||||
* @return if no errors occurred (invalid hash/invalid parameters/connection error)
|
||||
*/
|
||||
public boolean sendToServer(String hashOrName, Object... objects) {
|
||||
return send(HMessage.Side.TOSERVER, hashOrName, objects);
|
||||
return send(HMessage.Direction.TOSERVER, hashOrName, objects);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -19,14 +19,14 @@ import java.util.Map;
|
||||
public class HarbleAPI {
|
||||
|
||||
public class HarbleMessage {
|
||||
private HMessage.Side destination;
|
||||
private HMessage.Direction destination;
|
||||
private int headerId;
|
||||
private String hash;
|
||||
private String name;
|
||||
private String structure;
|
||||
|
||||
//name can be NULL
|
||||
public HarbleMessage(HMessage.Side destination, int headerId, String hash, String name, String structure) {
|
||||
public HarbleMessage(HMessage.Direction destination, int headerId, String hash, String name, String structure) {
|
||||
this.destination = destination;
|
||||
this.headerId = headerId;
|
||||
this.hash = hash;
|
||||
@ -42,7 +42,7 @@ public class HarbleAPI {
|
||||
return headerId;
|
||||
}
|
||||
|
||||
public HMessage.Side getDestination() {
|
||||
public HMessage.Direction getDestination() {
|
||||
return destination;
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ public class HarbleAPI {
|
||||
}
|
||||
}
|
||||
|
||||
private void addMessage(HMessage.Side side, JSONObject object) {
|
||||
private void addMessage(HMessage.Direction direction, JSONObject object) {
|
||||
String name;
|
||||
try {
|
||||
name = object.getString("Name");
|
||||
@ -134,21 +134,21 @@ public class HarbleAPI {
|
||||
}
|
||||
|
||||
|
||||
HarbleMessage message = new HarbleMessage(side, headerId, hash, name, structure);
|
||||
HarbleMessage message = new HarbleMessage(direction, headerId, hash, name, structure);
|
||||
|
||||
|
||||
Map<Integer, HarbleMessage> headerIdToMessage =
|
||||
message.getDestination() == HMessage.Side.TOCLIENT
|
||||
message.getDestination() == HMessage.Direction.TOCLIENT
|
||||
? headerIdToMessage_incoming :
|
||||
headerIdToMessage_outgoing;
|
||||
|
||||
Map<String, List<HarbleMessage>> hashToMessage =
|
||||
message.getDestination() == HMessage.Side.TOCLIENT
|
||||
message.getDestination() == HMessage.Direction.TOCLIENT
|
||||
? hashToMessage_incoming
|
||||
: hashToMessage_outgoing;
|
||||
|
||||
Map<String, HarbleMessage> nameToMessag =
|
||||
message.getDestination() == HMessage.Side.TOCLIENT
|
||||
message.getDestination() == HMessage.Direction.TOCLIENT
|
||||
? nameToMessage_incoming
|
||||
: nameToMessage_outgoing;
|
||||
|
||||
@ -169,7 +169,7 @@ public class HarbleAPI {
|
||||
for (int i = 0; i < incoming.length(); i++) {
|
||||
try {
|
||||
JSONObject message = incoming.getJSONObject(i);
|
||||
addMessage(HMessage.Side.TOCLIENT, message);
|
||||
addMessage(HMessage.Direction.TOCLIENT, message);
|
||||
}
|
||||
catch (Exception e){
|
||||
e.printStackTrace();
|
||||
@ -178,7 +178,7 @@ public class HarbleAPI {
|
||||
for (int i = 0; i < outgoing.length(); i++) {
|
||||
try{
|
||||
JSONObject message = outgoing.getJSONObject(i);
|
||||
addMessage(HMessage.Side.TOSERVER, message);
|
||||
addMessage(HMessage.Direction.TOSERVER, message);
|
||||
}
|
||||
catch (Exception e){
|
||||
e.printStackTrace();
|
||||
@ -190,18 +190,18 @@ public class HarbleAPI {
|
||||
}
|
||||
}
|
||||
|
||||
public HarbleMessage getHarbleMessageFromHeaderId(HMessage.Side side, int headerId) {
|
||||
public HarbleMessage getHarbleMessageFromHeaderId(HMessage.Direction direction, int headerId) {
|
||||
Map<Integer, HarbleMessage> headerIdToMessage =
|
||||
(side == HMessage.Side.TOSERVER
|
||||
(direction == HMessage.Direction.TOSERVER
|
||||
? headerIdToMessage_outgoing
|
||||
: headerIdToMessage_incoming);
|
||||
|
||||
return headerIdToMessage.get(headerId);
|
||||
}
|
||||
|
||||
public List<HarbleMessage> getHarbleMessagesFromHash(HMessage.Side side, String hash) {
|
||||
public List<HarbleMessage> getHarbleMessagesFromHash(HMessage.Direction direction, String hash) {
|
||||
Map<String, List<HarbleMessage>> hashToMessage =
|
||||
(side == HMessage.Side.TOSERVER
|
||||
(direction == HMessage.Direction.TOSERVER
|
||||
? hashToMessage_outgoing
|
||||
: hashToMessage_incoming);
|
||||
|
||||
@ -209,9 +209,9 @@ public class HarbleAPI {
|
||||
return result == null ? new ArrayList<>() : result;
|
||||
}
|
||||
|
||||
public HarbleMessage getHarbleMessageFromName(HMessage.Side side, String name) {
|
||||
public HarbleMessage getHarbleMessageFromName(HMessage.Direction direction, String name) {
|
||||
Map<String, HarbleMessage> nameToMessage =
|
||||
(side == HMessage.Side.TOSERVER
|
||||
(direction == HMessage.Direction.TOSERVER
|
||||
? nameToMessage_outgoing
|
||||
: nameToMessage_incoming);
|
||||
|
||||
|
@ -2,10 +2,8 @@ package gearth.misc.harble_api;
|
||||
|
||||
import gearth.misc.Cacher;
|
||||
import gearth.protocol.HMessage;
|
||||
import org.json.JSONObject;
|
||||
import org.jsoup.Connection;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@ -66,7 +64,7 @@ public class HarbleAPIFetcher {
|
||||
fetch("PRODUCTION-201901141210-114421986");
|
||||
|
||||
HarbleAPI api = HARBLEAPI;
|
||||
HarbleAPI.HarbleMessage haMessage = api.getHarbleMessageFromHeaderId(HMessage.Side.TOSERVER, 525);
|
||||
HarbleAPI.HarbleMessage haMessage = api.getHarbleMessageFromHeaderId(HMessage.Direction.TOSERVER, 525);
|
||||
System.out.println(haMessage);
|
||||
}
|
||||
}
|
@ -258,7 +258,7 @@ public class HConnection {
|
||||
if (state == State.PREPARED) {
|
||||
|
||||
setState(State.WAITING_FOR_CLIENT);
|
||||
if (!hostRedirected) {
|
||||
if (!hostRedirected && !connectionInfoOverrider.mustOverrideConnection()) {
|
||||
addToHosts();
|
||||
}
|
||||
|
||||
@ -271,7 +271,7 @@ public class HConnection {
|
||||
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
Thread.sleep(30);
|
||||
while ((state == State.WAITING_FOR_CLIENT) && !proxy_server.isClosed()) {
|
||||
try {
|
||||
Socket client = proxy_server.accept();
|
||||
@ -413,14 +413,14 @@ public class HConnection {
|
||||
}
|
||||
}
|
||||
private void onConnect() {
|
||||
if (hostRedirected) {
|
||||
if (hostRedirected && !connectionInfoOverrider.mustOverrideConnection()) {
|
||||
removeFromHosts();
|
||||
}
|
||||
|
||||
clearAllProxies();
|
||||
}
|
||||
public void abort() {
|
||||
if (hostRedirected) {
|
||||
if (hostRedirected && !connectionInfoOverrider.mustOverrideConnection()) {
|
||||
removeFromHosts();
|
||||
}
|
||||
|
||||
@ -520,11 +520,11 @@ public class HConnection {
|
||||
stateChangeListeners.remove(listener);
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
public int getServerPort() {
|
||||
if (actual_proxy == null) return -1;
|
||||
return actual_proxy.getIntercept_port();
|
||||
}
|
||||
public String getHost() {
|
||||
public String getServerHost() {
|
||||
if (actual_proxy == null) return "<auto-detect>";
|
||||
return actual_proxy.getActual_domain();
|
||||
}
|
||||
@ -557,11 +557,18 @@ public class HConnection {
|
||||
}
|
||||
}
|
||||
|
||||
public String getClientHostAndPort() {
|
||||
if (actual_proxy == null || actual_proxy.getIntercept_host() == null || actual_proxy.getIntercept_port() == -1) {
|
||||
public String getClientHost() {
|
||||
if (actual_proxy == null) {
|
||||
return "";
|
||||
}
|
||||
return actual_proxy.getIntercept_host() + ":" + actual_proxy.getIntercept_port();
|
||||
return actual_proxy.getIntercept_host();
|
||||
}
|
||||
|
||||
public int getClientPort() {
|
||||
if (actual_proxy == null) {
|
||||
return -1;
|
||||
}
|
||||
return actual_proxy.getIntercept_port();
|
||||
}
|
||||
|
||||
public String getHotelVersion() {
|
||||
|
@ -4,13 +4,13 @@ import gearth.misc.StringifyAble;
|
||||
|
||||
public class HMessage implements StringifyAble {
|
||||
|
||||
public enum Side {
|
||||
public enum Direction {
|
||||
TOSERVER,
|
||||
TOCLIENT
|
||||
}
|
||||
|
||||
private HPacket hPacket;
|
||||
private Side side;
|
||||
private Direction direction;
|
||||
private int index;
|
||||
|
||||
private boolean isBlocked;
|
||||
@ -23,8 +23,8 @@ public class HMessage implements StringifyAble {
|
||||
constructFromHMessage(message);
|
||||
}
|
||||
|
||||
public HMessage(HPacket packet, Side side, int index) {
|
||||
this.side = side;
|
||||
public HMessage(HPacket packet, Direction direction, int index) {
|
||||
this.direction = direction;
|
||||
this.hPacket = packet;
|
||||
this.index = index;
|
||||
isBlocked = false;
|
||||
@ -44,8 +44,8 @@ public class HMessage implements StringifyAble {
|
||||
public HPacket getPacket() {
|
||||
return hPacket;
|
||||
}
|
||||
public Side getDestination() {
|
||||
return side;
|
||||
public Direction getDestination() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public boolean isCorrupted() {
|
||||
@ -55,7 +55,7 @@ public class HMessage implements StringifyAble {
|
||||
|
||||
@Override
|
||||
public String stringify() {
|
||||
String s = (isBlocked ? "1" : "0") + "\t" + index + "\t" + side.name() + "\t" + hPacket.stringify();
|
||||
String s = (isBlocked ? "1" : "0") + "\t" + index + "\t" + direction.name() + "\t" + hPacket.stringify();
|
||||
return s;
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public class HMessage implements StringifyAble {
|
||||
String[] parts = str.split("\t", 4);
|
||||
this.isBlocked = parts[0].equals("1");
|
||||
this.index = Integer.parseInt(parts[1]);
|
||||
this.side = parts[2].equals("TOCLIENT") ? Side.TOCLIENT : Side.TOSERVER;
|
||||
this.direction = parts[2].equals("TOCLIENT") ? Direction.TOCLIENT : Direction.TOSERVER;
|
||||
HPacket p = new HPacket(new byte[0]);
|
||||
p.constructFromString(parts[3]);
|
||||
this.hPacket = p;
|
||||
@ -73,7 +73,7 @@ public class HMessage implements StringifyAble {
|
||||
public void constructFromHMessage(HMessage message) {
|
||||
this.isBlocked = message.isBlocked();
|
||||
this.index = message.getIndex();
|
||||
this.side = message.getDestination();
|
||||
this.direction = message.getDestination();
|
||||
this.hPacket = new HPacket(message.getPacket());
|
||||
}
|
||||
|
||||
@ -83,7 +83,7 @@ public class HMessage implements StringifyAble {
|
||||
|
||||
HMessage message = (HMessage) obj;
|
||||
|
||||
return message.hPacket.equals(hPacket) && (side == message.side) && (index == message.index);
|
||||
return message.hPacket.equals(hPacket) && (direction == message.direction) && (index == message.index);
|
||||
}
|
||||
|
||||
// public static void gearth(String[] args) {
|
||||
|
@ -719,12 +719,12 @@ public class HPacket implements StringifyAble {
|
||||
}
|
||||
}
|
||||
|
||||
public String toExpression(HMessage.Side side) {
|
||||
public String toExpression(HMessage.Direction direction) {
|
||||
if (isCorrupted()) return "";
|
||||
|
||||
HarbleAPI.HarbleMessage msg;
|
||||
if (HarbleAPIFetcher.HARBLEAPI != null &&
|
||||
((msg = HarbleAPIFetcher.HARBLEAPI.getHarbleMessageFromHeaderId(side, headerId())) != null)) {
|
||||
((msg = HarbleAPIFetcher.HARBLEAPI.getHarbleMessageFromHeaderId(direction, headerId())) != null)) {
|
||||
if (msg.getStructure() != null) {
|
||||
return toExpressionFromGivenStructure(msg.getStructure());
|
||||
}
|
||||
|
@ -19,7 +19,6 @@ import javafx.scene.web.WebView;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class Rc4Obtainer {
|
||||
|
||||
@ -119,7 +118,7 @@ public class Rc4Obtainer {
|
||||
byte[] keycpy = Arrays.copyOf(possible, possible.length);
|
||||
RC4 rc4Tryout = new RC4(keycpy, i, j);
|
||||
|
||||
if (packetHandler.getMessageSide() == HMessage.Side.TOSERVER) rc4Tryout.undoRc4(encBuffer);
|
||||
if (packetHandler.getMessageSide() == HMessage.Direction.TOSERVER) rc4Tryout.undoRc4(encBuffer);
|
||||
if (rc4Tryout.couldBeFresh()) {
|
||||
byte[] encDataCopy = Arrays.copyOf(encBuffer, encBuffer.length);
|
||||
RC4 rc4TryCopy = rc4Tryout.deepCopy();
|
||||
|
@ -23,7 +23,7 @@ public class MacOsHabboClient extends HabboClient {
|
||||
super(connection);
|
||||
|
||||
connection.addTrafficListener(0, message -> {
|
||||
if (message.getDestination() == HMessage.Side.TOSERVER && message.getPacket().headerId() == PRODUCTION_ID) {
|
||||
if (message.getDestination() == HMessage.Direction.TOSERVER && message.getPacket().headerId() == PRODUCTION_ID) {
|
||||
production = message.getPacket().readString();
|
||||
}
|
||||
});
|
||||
@ -81,9 +81,9 @@ public class MacOsHabboClient extends HabboClient {
|
||||
|
||||
String g_mem = new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParent() + "/G-Mem";
|
||||
if (!useCache)
|
||||
pb = new ProcessBuilder(g_mem, hConnection.getClientHostAndPort().substring(0, hConnection.getClientHostAndPort().indexOf(':')) , Integer.toString(hConnection.getPort()));
|
||||
pb = new ProcessBuilder(g_mem, hConnection.getClientHost() , Integer.toString(hConnection.getClientPort()));
|
||||
else
|
||||
pb = new ProcessBuilder(g_mem, hConnection.getClientHostAndPort().substring(0, hConnection.getClientHostAndPort().indexOf(':')) , Integer.toString(hConnection.getPort()), "-c" + joiner.toString());
|
||||
pb = new ProcessBuilder(g_mem, hConnection.getClientHost() , Integer.toString(hConnection.getClientPort()), "-c" + joiner.toString());
|
||||
|
||||
|
||||
Process p = pb.start();
|
||||
|
@ -26,7 +26,7 @@ public class RustHabboClient extends HabboClient {
|
||||
|
||||
try {
|
||||
String g_mem = new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParent() + "/G-Mem";
|
||||
ProcessBuilder pb = new ProcessBuilder(g_mem, hConnection.getClientHostAndPort().substring(0, hConnection.getClientHostAndPort().indexOf(':')) , Integer.toString(hConnection.getPort()));
|
||||
ProcessBuilder pb = new ProcessBuilder(g_mem, hConnection.getClientHost() , Integer.toString(hConnection.getClientPort()));
|
||||
|
||||
|
||||
Process p = pb.start();
|
||||
|
@ -23,7 +23,7 @@ public class WindowsHabboClient extends HabboClient {
|
||||
super(connection);
|
||||
|
||||
connection.addTrafficListener(0, message -> {
|
||||
if (message.getDestination() == HMessage.Side.TOSERVER && message.getPacket().headerId() == PRODUCTION_ID) {
|
||||
if (message.getDestination() == HMessage.Direction.TOSERVER && message.getPacket().headerId() == PRODUCTION_ID) {
|
||||
production = message.getPacket().readString();
|
||||
}
|
||||
});
|
||||
@ -81,9 +81,9 @@ public class WindowsHabboClient extends HabboClient {
|
||||
|
||||
String g_winmem = new File(this.getClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParent() + "\\G-Mem.exe";
|
||||
if (!useCache)
|
||||
pb = new ProcessBuilder(g_winmem, hConnection.getClientHostAndPort().substring(0, hConnection.getClientHostAndPort().indexOf(':')) , Integer.toString(hConnection.getPort()));
|
||||
pb = new ProcessBuilder(g_winmem, hConnection.getClientHost() , Integer.toString(hConnection.getClientPort()));
|
||||
else
|
||||
pb = new ProcessBuilder(g_winmem, hConnection.getClientHostAndPort().substring(0, hConnection.getClientHostAndPort().indexOf(':')) , Integer.toString(hConnection.getPort()), "-c" + joiner.toString());
|
||||
pb = new ProcessBuilder(g_winmem, hConnection.getClientHost() , Integer.toString(hConnection.getClientPort()), "-c" + joiner.toString());
|
||||
|
||||
|
||||
Process p = pb.start();
|
||||
|
@ -42,8 +42,8 @@ public class IncomingPacketHandler extends PacketHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public HMessage.Side getMessageSide() {
|
||||
return HMessage.Side.TOCLIENT;
|
||||
public HMessage.Direction getMessageSide() {
|
||||
return HMessage.Direction.TOCLIENT;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,8 +52,8 @@ public class OutgoingPacketHandler extends PacketHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public HMessage.Side getMessageSide() {
|
||||
return HMessage.Side.TOSERVER;
|
||||
public HMessage.Direction getMessageSide() {
|
||||
return HMessage.Direction.TOSERVER;
|
||||
}
|
||||
|
||||
|
||||
|
@ -156,7 +156,7 @@ public abstract class PacketHandler {
|
||||
}
|
||||
}
|
||||
|
||||
public abstract HMessage.Side getMessageSide();
|
||||
public abstract HMessage.Direction getMessageSide();
|
||||
|
||||
public List<Byte> getEncryptedBuffer() {
|
||||
return tempEncryptedBuffer;
|
||||
|
@ -91,7 +91,7 @@ public class Connection extends SubForm {
|
||||
if (newState == HConnection.State.CONNECTED) {
|
||||
lblState.setText("Connected");
|
||||
outHost.setText(getHConnection().getDomain());
|
||||
outPort.setText(getHConnection().getPort()+"");
|
||||
outPort.setText(getHConnection().getServerPort()+"");
|
||||
}
|
||||
if (newState == HConnection.State.WAITING_FOR_CLIENT) {
|
||||
lblState.setText("Waiting for connection");
|
||||
|
@ -156,7 +156,7 @@ public class Extensions extends SubForm {
|
||||
extension.sendMessage(
|
||||
new HPacket(OUTGOING_MESSAGES_IDS.CONNECTIONSTART)
|
||||
.appendString(getHConnection().getDomain())
|
||||
.appendInt(getHConnection().getPort())
|
||||
.appendInt(getHConnection().getServerPort())
|
||||
.appendString(getHConnection().getHotelVersion())
|
||||
.appendString(HarbleAPIFetcher.HARBLEAPI == null ? "null" : HarbleAPIFetcher.HARBLEAPI.getPath())
|
||||
);
|
||||
@ -293,7 +293,7 @@ public class Extensions extends SubForm {
|
||||
extension.sendMessage(
|
||||
new HPacket(OUTGOING_MESSAGES_IDS.CONNECTIONSTART)
|
||||
.appendString(getHConnection().getDomain())
|
||||
.appendInt(getHConnection().getPort())
|
||||
.appendInt(getHConnection().getServerPort())
|
||||
.appendString(getHConnection().getHotelVersion())
|
||||
.appendString(HarbleAPIFetcher.HARBLEAPI == null ? "null" : HarbleAPIFetcher.HARBLEAPI.getPath())
|
||||
);
|
||||
|
@ -37,10 +37,10 @@ public class Logger extends SubForm {
|
||||
public void onParentSet(){
|
||||
getHConnection().addStateChangeListener((oldState, newState) -> Platform.runLater(() -> {
|
||||
if (newState == HConnection.State.PREPARING) {
|
||||
miniLogText(Color.ORANGE, "Connecting to "+getHConnection().getDomain() + ":" + getHConnection().getPort());
|
||||
miniLogText(Color.ORANGE, "Connecting to "+getHConnection().getDomain() + ":" + getHConnection().getServerPort());
|
||||
}
|
||||
if (newState == HConnection.State.CONNECTED) {
|
||||
miniLogText(Color.GREEN, "Connected to "+getHConnection().getDomain() + ":" + getHConnection().getPort());
|
||||
miniLogText(Color.GREEN, "Connected to "+getHConnection().getDomain() + ":" + getHConnection().getServerPort());
|
||||
packetLogger.start();
|
||||
}
|
||||
if (newState == HConnection.State.NOT_CONNECTED) {
|
||||
@ -50,16 +50,16 @@ public class Logger extends SubForm {
|
||||
}));
|
||||
|
||||
getHConnection().addTrafficListener(2, message -> { Platform.runLater(() -> {
|
||||
if (message.getDestination() == HMessage.Side.TOCLIENT && cbx_blockIn.isSelected() ||
|
||||
message.getDestination() == HMessage.Side.TOSERVER && cbx_blockOut.isSelected()) return;
|
||||
if (message.getDestination() == HMessage.Direction.TOCLIENT && cbx_blockIn.isSelected() ||
|
||||
message.getDestination() == HMessage.Direction.TOSERVER && cbx_blockOut.isSelected()) return;
|
||||
|
||||
if (cbx_splitPackets.isSelected()) {
|
||||
packetLogger.appendSplitLine();
|
||||
}
|
||||
|
||||
int types = 0;
|
||||
if (message.getDestination() == HMessage.Side.TOCLIENT) types |= PacketLogger.MESSAGE_TYPE.INCOMING.getValue();
|
||||
else if (message.getDestination() == HMessage.Side.TOSERVER) types |= PacketLogger.MESSAGE_TYPE.OUTGOING.getValue();
|
||||
if (message.getDestination() == HMessage.Direction.TOCLIENT) types |= PacketLogger.MESSAGE_TYPE.INCOMING.getValue();
|
||||
else if (message.getDestination() == HMessage.Direction.TOSERVER) types |= PacketLogger.MESSAGE_TYPE.OUTGOING.getValue();
|
||||
if (message.getPacket().length() >= packetLimit) types |= PacketLogger.MESSAGE_TYPE.SKIPPED.getValue();
|
||||
if (message.isBlocked()) types |= PacketLogger.MESSAGE_TYPE.BLOCKED.getValue();
|
||||
if (message.getPacket().isReplaced()) types |= PacketLogger.MESSAGE_TYPE.REPLACED.getValue();
|
||||
|
@ -95,13 +95,13 @@ public class UiLoggerController implements Initializable {
|
||||
|
||||
ArrayList<Element> elements = new ArrayList<>();
|
||||
|
||||
String expr = packet.toExpression(isIncoming ? HMessage.Side.TOCLIENT : HMessage.Side.TOSERVER);
|
||||
String expr = packet.toExpression(isIncoming ? HMessage.Direction.TOCLIENT : HMessage.Direction.TOSERVER);
|
||||
|
||||
lblHarbleAPI.setText("HarbleAPI: " + (HarbleAPIFetcher.HARBLEAPI == null ? "False" : "True"));
|
||||
if ((viewMessageName || viewMessageHash) && HarbleAPIFetcher.HARBLEAPI != null) {
|
||||
HarbleAPI api = HarbleAPIFetcher.HARBLEAPI;
|
||||
HarbleAPI.HarbleMessage message = api.getHarbleMessageFromHeaderId(
|
||||
(isIncoming ? HMessage.Side.TOCLIENT : HMessage.Side.TOSERVER),
|
||||
(isIncoming ? HMessage.Direction.TOCLIENT : HMessage.Direction.TOSERVER),
|
||||
packet.headerId()
|
||||
);
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package gearth.ui.scheduler;
|
||||
|
||||
import javafx.beans.InvalidationListener;
|
||||
import javafx.beans.Observable;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleIntegerProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
@ -21,13 +20,13 @@ public class ScheduleItem implements StringifyAble {
|
||||
private SimpleBooleanProperty pausedProperty = null;
|
||||
private SimpleObjectProperty<Interval> delayProperty = null;
|
||||
private SimpleObjectProperty<HPacket> packetProperty = null;
|
||||
private SimpleObjectProperty<HMessage.Side> destinationProperty = null;
|
||||
private SimpleObjectProperty<HMessage.Direction> destinationProperty = null;
|
||||
|
||||
ScheduleItem (int index, boolean paused, Interval delay, HPacket packet, HMessage.Side destination) {
|
||||
ScheduleItem (int index, boolean paused, Interval delay, HPacket packet, HMessage.Direction destination) {
|
||||
construct(index, paused, delay, packet, destination);
|
||||
}
|
||||
|
||||
private void construct(int index, boolean paused, Interval delay, HPacket packet, HMessage.Side destination) {
|
||||
private void construct(int index, boolean paused, Interval delay, HPacket packet, HMessage.Direction destination) {
|
||||
this.indexProperty = new SimpleIntegerProperty(index);
|
||||
this.pausedProperty = new SimpleBooleanProperty(paused);
|
||||
this.delayProperty = new SimpleObjectProperty<>(delay);
|
||||
@ -55,7 +54,7 @@ public class ScheduleItem implements StringifyAble {
|
||||
return packetProperty;
|
||||
}
|
||||
|
||||
public SimpleObjectProperty<HMessage.Side> getDestinationProperty() {
|
||||
public SimpleObjectProperty<HMessage.Direction> getDestinationProperty() {
|
||||
return destinationProperty;
|
||||
}
|
||||
|
||||
@ -123,9 +122,9 @@ public class ScheduleItem implements StringifyAble {
|
||||
boolean paused = parts[1].equals("true");
|
||||
Interval delay = new Interval(parts[2]);
|
||||
HPacket packet = new HPacket(parts[3]);
|
||||
HMessage.Side side = parts[4].equals(HMessage.Side.TOSERVER.name()) ? HMessage.Side.TOSERVER : HMessage.Side.TOCLIENT;
|
||||
HMessage.Direction direction = parts[4].equals(HMessage.Direction.TOSERVER.name()) ? HMessage.Direction.TOSERVER : HMessage.Direction.TOCLIENT;
|
||||
|
||||
construct(index, paused, delay, packet, side);
|
||||
construct(index, paused, delay, packet, direction);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ import gearth.protocol.HPacket;
|
||||
import gearth.ui.SubForm;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
@ -86,7 +85,7 @@ public class Scheduler extends SubForm {
|
||||
Interval cur = item.getDelayProperty().get();
|
||||
for (int i = 0; i < changed; i++) {
|
||||
if ((t - i) % cur.getDelay() == cur.getOffset()) {
|
||||
if (item.getDestinationProperty().get() == HMessage.Side.TOSERVER) {
|
||||
if (item.getDestinationProperty().get() == HMessage.Direction.TOSERVER) {
|
||||
getHConnection().sendToServerAsync(item.getPacketProperty().get());
|
||||
}
|
||||
else {
|
||||
@ -153,7 +152,7 @@ public class Scheduler extends SubForm {
|
||||
false,
|
||||
new Interval(txt_delay.getText()),
|
||||
new HPacket(txt_packet.getText()),
|
||||
rb_incoming.isSelected() ? HMessage.Side.TOCLIENT : HMessage.Side.TOSERVER);
|
||||
rb_incoming.isSelected() ? HMessage.Direction.TOCLIENT : HMessage.Direction.TOSERVER);
|
||||
|
||||
addItem(newItem);
|
||||
}
|
||||
@ -161,7 +160,7 @@ public class Scheduler extends SubForm {
|
||||
|
||||
isBeingEdited.getPacketProperty().set(new HPacket(txt_packet.getText()));
|
||||
isBeingEdited.getDelayProperty().set(new Interval(txt_delay.getText()));
|
||||
isBeingEdited.getDestinationProperty().set(rb_incoming.isSelected() ? HMessage.Side.TOCLIENT : HMessage.Side.TOSERVER);
|
||||
isBeingEdited.getDestinationProperty().set(rb_incoming.isSelected() ? HMessage.Direction.TOCLIENT : HMessage.Direction.TOSERVER);
|
||||
isBeingEdited.isUpdatedTrigger();
|
||||
|
||||
isBeingEdited = null;
|
||||
@ -193,8 +192,8 @@ public class Scheduler extends SubForm {
|
||||
if (isBeingEdited != newItem) {
|
||||
txt_packet.setText(newItem.getPacketProperty().get().toString());
|
||||
txt_delay.setText(newItem.getDelayProperty().get().toString());
|
||||
rb_incoming.setSelected(newItem.getDestinationProperty().get() == HMessage.Side.TOCLIENT);
|
||||
rb_outgoing.setSelected(newItem.getDestinationProperty().get() == HMessage.Side.TOSERVER);
|
||||
rb_incoming.setSelected(newItem.getDestinationProperty().get() == HMessage.Direction.TOCLIENT);
|
||||
rb_outgoing.setSelected(newItem.getDestinationProperty().get() == HMessage.Direction.TOSERVER);
|
||||
|
||||
isBeingEdited = newItem;
|
||||
btn_addoredit.setText("Edit schedule item"); //Add to scheduler
|
||||
|
Loading…
Reference in New Issue
Block a user