- Started with WebServer
This commit is contained in:
@@ -50,8 +50,11 @@ public class UnsupportedClassicPacket extends OACPacket {
|
||||
}
|
||||
|
||||
if (ProtocolBridge.getInstance().isRunningAsDNSServer())
|
||||
ProtocolBridge.getInstance().getClassicHandlerServer().unsupportedClassicPacket(className, content, ProtocolBridge.getInstance().getProtocolDNSServer().getClientByID(clientID));
|
||||
ProtocolBridge.getInstance().getClassicHandlerDNSServer().unsupportedClassicPacket(className, content, ProtocolBridge.getInstance().getProtocolDNSServer().getClientByID(clientID));
|
||||
else if (ProtocolBridge.getInstance().isRunningAsClient())
|
||||
ProtocolBridge.getInstance().getClassicHandlerClient().unsupportedClassicPacket(className, content);
|
||||
else if (ProtocolBridge.getInstance().isRunningAsWebServer())
|
||||
ProtocolBridge.getInstance().getClassicHandlerWebServer().unsupportedClassicPacket(className, content, ProtocolBridge.getInstance().getProtocolDNSServer().getClientByID(clientID));
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -56,7 +56,7 @@ public class Classic_DomainPacket extends OACPacket {
|
||||
Classic_ProtocolVersion protocolVersion = (Classic_ProtocolVersion) objectInputStream.readObject();
|
||||
|
||||
try {
|
||||
domain = ProtocolBridge.getInstance().getClassicHandlerServer().getDomain(requestDomain);
|
||||
domain = ProtocolBridge.getInstance().getClassicHandlerDNSServer().getDomain(requestDomain);
|
||||
} catch (SQLException exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
@@ -74,6 +74,12 @@ public class Classic_DomainPacket extends OACPacket {
|
||||
Classic_ProtocolVersion protocolVersion = (Classic_ProtocolVersion) objectInputStream.readObject();
|
||||
|
||||
ProtocolBridge.getInstance().getProtocolClient().getClientDNSConnection().getEventManager().executeEvent(new Classic_DomainPacketReceivedEvent(protocolVersion, domain, requestDomain, clientID));
|
||||
} else if (ProtocolBridge.getInstance().isRunningAsWebServer()) {
|
||||
clientID = objectInputStream.readInt();
|
||||
requestDomain = (Classic_RequestDomain) objectInputStream.readObject();
|
||||
Classic_ProtocolVersion protocolVersion = (Classic_ProtocolVersion) objectInputStream.readObject();
|
||||
|
||||
ProtocolBridge.getInstance().getProtocolWebServer().getPipelineServer().getConnectionHandlerByID(clientID).sendPacket(new UnsupportedClassicPacket(Classic_PingPacket.class, new Object[]{clientID, requestDomain, domain}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ public class Classic_MessagePacket extends OACPacket {
|
||||
|
||||
@Override
|
||||
public void onWrite(PacketHandler packetHandler, ObjectOutputStream objectOutputStream) throws IOException, ClassNotFoundException {
|
||||
if (ProtocolBridge.getInstance().isRunningAsDNSServer()) objectOutputStream.writeInt(clientID);
|
||||
if (ProtocolBridge.getInstance().isRunningAsDNSServer() || ProtocolBridge.getInstance().isRunningAsWebServer()) objectOutputStream.writeInt(clientID);
|
||||
else if (ProtocolBridge.getInstance().isRunningAsClient()) {
|
||||
clientID = ProtocolBridge.getInstance().getProtocolClient().getClientDNSConnection().getClientID();
|
||||
objectOutputStream.writeInt(clientID);
|
||||
@@ -44,13 +44,19 @@ public class Classic_MessagePacket extends OACPacket {
|
||||
String message = objectInputStream.readUTF();
|
||||
Classic_ProtocolVersion protocolVersion = (Classic_ProtocolVersion) objectInputStream.readObject();
|
||||
|
||||
ProtocolBridge.getInstance().getClassicHandlerServer().handleMessage(ProtocolBridge.getInstance().getProtocolDNSServer().getClientByID(clientID), message, protocolVersion);
|
||||
ProtocolBridge.getInstance().getClassicHandlerDNSServer().handleMessage(ProtocolBridge.getInstance().getProtocolDNSServer().getClientByID(clientID), message, protocolVersion);
|
||||
} else if (ProtocolBridge.getInstance().isRunningAsClient()) {
|
||||
clientID = objectInputStream.readInt();
|
||||
String message = objectInputStream.readUTF();
|
||||
Classic_ProtocolVersion protocolVersion = (Classic_ProtocolVersion) objectInputStream.readObject();
|
||||
|
||||
ProtocolBridge.getInstance().getClassicHandlerClient().handleMessage(message);
|
||||
ProtocolBridge.getInstance().getClassicHandlerClient().handleMessage(message, protocolVersion);
|
||||
} else if (ProtocolBridge.getInstance().isRunningAsWebServer()) {
|
||||
clientID = objectInputStream.readInt();
|
||||
String message = objectInputStream.readUTF();
|
||||
Classic_ProtocolVersion protocolVersion = (Classic_ProtocolVersion) objectInputStream.readObject();
|
||||
|
||||
ProtocolBridge.getInstance().getClassicHandlerWebServer().handleMessage(ProtocolBridge.getInstance().getProtocolDNSServer().getClientByID(clientID), message, protocolVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ public class Classic_PingPacket extends OACPacket {
|
||||
protocolVersion = (Classic_ProtocolVersion) objectInputStream.readObject();
|
||||
|
||||
try {
|
||||
domain = ProtocolBridge.getInstance().getClassicHandlerServer().ping(requestDomain);
|
||||
domain = ProtocolBridge.getInstance().getClassicHandlerDNSServer().ping(requestDomain);
|
||||
} catch (SQLException exception) {
|
||||
exception.printStackTrace();
|
||||
}
|
||||
@@ -80,6 +80,12 @@ public class Classic_PingPacket extends OACPacket {
|
||||
|
||||
ProtocolBridge.getInstance().getProtocolClient().validationCompleted(domain.getDomain(), reachable ? DNSResponseCode.RESPONSE_DOMAIN_FULLY_EXIST : DNSResponseCode.RESPONSE_DOMAIN_FULLY_NOT_EXIST);
|
||||
ProtocolBridge.getInstance().getProtocolClient().getClientDNSConnection().getEventManager().executeEvent(new Classic_PingPacketReceivedEvent(protocolVersion, domain, requestDomain, reachable, clientID));
|
||||
} else if (ProtocolBridge.getInstance().isRunningAsWebServer()) {
|
||||
clientID = objectInputStream.readInt();
|
||||
requestDomain = (Classic_RequestDomain) objectInputStream.readObject();
|
||||
protocolVersion = (Classic_ProtocolVersion) objectInputStream.readObject();
|
||||
|
||||
ProtocolBridge.getInstance().getProtocolWebServer().getPipelineServer().getConnectionHandlerByID(clientID).sendPacket(new UnsupportedClassicPacket(Classic_PingPacket.class, new Object[]{requestDomain}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user