Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.applet.Applet;
- import java.applet.AppletStub;
- import java.awt.Dimension;
- import java.io.BufferedReader;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.IOException;
- import java.net.MalformedURLException;
- import java.net.URL;
- import java.util.Properties;
- import javax.swing.JDialog;
- import javax.swing.JFrame;
- import javax.swing.UIManager;
- public class Loader extends Applet implements AppletStub {
- private static final long serialVersionUID = 1670498001014004354L;
- public static final boolean RSPS = true;
- public static Loader ctx;
- private Properties parameters = new Properties();
- public static JFrame clientFrame = null;
- public static boolean disableGameTips = true;
- public static final boolean LOCAL = true;
- public static final String HOST_ADDRESS = LOCAL ? "127.0.0.1" : "127.0.0.1";// "64.62.174.144";
- public static final int PORT = 43594;// LOCAL ? 43594 : 5555;
- public static void main(String... args) throws Exception {
- Loader rsLoader = ctx = new Loader();
- rsLoader.doFrame();
- }
- private void doFrame() {
- readParameters();
- openFrame();
- startClient();
- clientFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- }
- private void startClient() {
- try {
- Class<?> client_class = Class.forName("client");
- Object v_client = client_class.getConstructor().newInstance();
- client_class.getSuperclass().getMethod("supplyApplet", Applet.class).invoke(v_client, this);
- client_class.getMethod("init").invoke(v_client);
- client_class.getMethod("start").invoke(v_client);
- client_class.getMethod("method5429").invoke(v_client);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- public static void sendCS2Message(String text) {
- Object[] params = new Object[] { 1211, text, 0, -120, 0 };
- Class91.method1735(1486415494);
- Class361_Sub39 class361_sub39 = new Class361_Sub39();
- class361_sub39.cs2Arguments = params;
- Class165.method2986(class361_sub39, (byte) 1);
- // class39.aClass241_620 = null;
- }
- private void openFrame() {
- try {
- UIManager.setLookAndFeel("org.jvnet.substance.skin.SubstanceRavenGraphiteLookAndFeel");
- } catch (Exception e) {
- e.printStackTrace();
- }
- // ParticleSlider window = new ParticleSlider();
- // window.particleSlider.setVisible(true);
- // window.particleSlider.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- JFrame.setDefaultLookAndFeelDecorated(true);
- JDialog.setDefaultLookAndFeelDecorated(true);
- clientFrame = new JFrame("Nyx 751");
- clientFrame.add(this);
- clientFrame.setVisible(true);
- clientFrame.setSize(800, 600);
- clientFrame.setLocationRelativeTo(null);
- }
- @SuppressWarnings("resource")
- private void readParameters() {
- try {
- BufferedReader reader = new BufferedReader(new FileReader("./data/params.txt"));
- String line;
- while ((line = reader.readLine()) != null) {
- if (line.contains("document.write('<param name=")) {
- String[] regex = line.split(" value=");
- String parameterName = regex[0];
- String[] parameterRegex = parameterName.split("name=");
- String finalParameter = parameterRegex[1].replaceAll("\"", "");
- String parameterValue = regex[1];
- String finalValue = parameterValue.replaceAll("\"", "").replace(">');", "");
- if (RSPS && finalValue.startsWith("lobby")) {
- finalValue = HOST_ADDRESS;
- }
- parameters.put(finalParameter, finalValue);
- }
- }
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- @Override
- public void appletResize(int dimensionX, int dimensionY) {
- super.resize(new Dimension(dimensionX, dimensionY));
- }
- @Override
- public String getParameter(String paramName) {
- return (String) parameters.get(paramName);
- }
- @Override
- public URL getDocumentBase() {
- try {
- return new URL("http://" + HOST_ADDRESS);
- } catch (MalformedURLException e) {
- e.printStackTrace();
- }
- return null;
- }
- @Override
- public URL getCodeBase() {
- return getDocumentBase();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement