Search in sources :

Example 11 with Export

use of net.runelite.mapping.Export in project runelite by runelite.

the class GameEngine method error.

@ObfuscatedName("ax")
@ObfuscatedSignature(signature = "(Ljava/lang/String;I)V", garbageValue = "-1241225209")
@Export("error")
protected void error(String var1) {
    if (!this.hasErrored) {
        this.hasErrored = true;
        System.out.println("error_game_" + var1);
        try {
            this.getAppletContext().showDocument(new URL(this.getCodeBase(), "error_game_" + var1 + ".ws"), "_self");
        } catch (Exception var3) {
            ;
        }
    }
}
Also used : URL(java.net.URL) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Example 12 with Export

use of net.runelite.mapping.Export in project runelite by runelite.

the class GameEngine method replaceCanvas.

@ObfuscatedName("ap")
@ObfuscatedSignature(signature = "(I)V", garbageValue = "-645526426")
@Export("replaceCanvas")
final synchronized void replaceCanvas() {
    Container var1 = this.container();
    if (this.canvas != null) {
        this.canvas.removeFocusListener(this);
        var1.remove(this.canvas);
    }
    Sequence.canvasWidth = Math.max(var1.getWidth(), this.field672);
    class45.canvasHeight = Math.max(var1.getHeight(), this.field674);
    Insets var2;
    if (this.frame != null) {
        var2 = this.frame.getInsets();
        Sequence.canvasWidth -= var2.right + var2.left;
        class45.canvasHeight -= var2.bottom + var2.top;
    }
    this.canvas = new GameCanvas(this);
    var1.add(this.canvas);
    this.canvas.setSize(Sequence.canvasWidth, class45.canvasHeight);
    this.canvas.setVisible(true);
    this.canvas.setBackground(Color.BLACK);
    if (var1 == this.frame) {
        var2 = this.frame.getInsets();
        this.canvas.setLocation(this.field660 + var2.left, this.field657 + var2.top);
    } else {
        this.canvas.setLocation(this.field660, this.field657);
    }
    this.canvas.addFocusListener(this);
    this.canvas.requestFocus();
    this.field692 = true;
    if (class324.rasterProvider != null && Sequence.canvasWidth == class324.rasterProvider.width && class45.canvasHeight == class324.rasterProvider.height) {
        ((MainBufferProvider) class324.rasterProvider).replaceComponent(this.canvas);
        class324.rasterProvider.drawFull(0, 0);
    } else {
        class324.rasterProvider = new MainBufferProvider(Sequence.canvasWidth, class45.canvasHeight, this.canvas);
    }
    this.field682 = false;
    this.field665 = ScriptVarType.method28();
}
Also used : Container(java.awt.Container) Insets(java.awt.Insets) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Example 13 with Export

use of net.runelite.mapping.Export in project runelite by runelite.

the class GameEngine method setUpKeyboard.

@ObfuscatedName("a")
@ObfuscatedSignature(signature = "(I)V", garbageValue = "1115910435")
@Export("setUpKeyboard")
protected final void setUpKeyboard() {
    if (class241.javaVendor.toLowerCase().indexOf("microsoft") != -1) {
        KeyFocusListener.KeyHandler_keyCodes[186] = 57;
        KeyFocusListener.KeyHandler_keyCodes[187] = 27;
        KeyFocusListener.KeyHandler_keyCodes[188] = 71;
        KeyFocusListener.KeyHandler_keyCodes[189] = 26;
        KeyFocusListener.KeyHandler_keyCodes[190] = 72;
        KeyFocusListener.KeyHandler_keyCodes[191] = 73;
        KeyFocusListener.KeyHandler_keyCodes[192] = 58;
        KeyFocusListener.KeyHandler_keyCodes[219] = 42;
        KeyFocusListener.KeyHandler_keyCodes[220] = 74;
        KeyFocusListener.KeyHandler_keyCodes[221] = 43;
        KeyFocusListener.KeyHandler_keyCodes[222] = 59;
        KeyFocusListener.KeyHandler_keyCodes[223] = 28;
    } else {
        KeyFocusListener.KeyHandler_keyCodes[44] = 71;
        KeyFocusListener.KeyHandler_keyCodes[45] = 26;
        KeyFocusListener.KeyHandler_keyCodes[46] = 72;
        KeyFocusListener.KeyHandler_keyCodes[47] = 73;
        KeyFocusListener.KeyHandler_keyCodes[59] = 57;
        KeyFocusListener.KeyHandler_keyCodes[61] = 27;
        KeyFocusListener.KeyHandler_keyCodes[91] = 42;
        KeyFocusListener.KeyHandler_keyCodes[92] = 74;
        KeyFocusListener.KeyHandler_keyCodes[93] = 43;
        KeyFocusListener.KeyHandler_keyCodes[192] = 28;
        KeyFocusListener.KeyHandler_keyCodes[222] = 58;
        KeyFocusListener.KeyHandler_keyCodes[520] = 59;
    }
    Canvas var1 = this.canvas;
    var1.setFocusTraversalKeysEnabled(false);
    var1.addKeyListener(KeyFocusListener.keyboard);
    var1.addFocusListener(KeyFocusListener.keyboard);
}
Also used : Canvas(java.awt.Canvas) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Example 14 with Export

use of net.runelite.mapping.Export in project runelite by runelite.

the class GameEngine method drawLoadingScreen.

@ObfuscatedName("af")
@ObfuscatedSignature(signature = "(ILjava/lang/String;ZI)V", garbageValue = "1952519462")
@Export("drawLoadingScreen")
protected final void drawLoadingScreen(int var1, String var2, boolean var3) {
    try {
        Graphics var4 = this.canvas.getGraphics();
        if (IndexFile.field2249 == null) {
            IndexFile.field2249 = new java.awt.Font("Helvetica", 1, 13);
            CacheFile.field1676 = this.canvas.getFontMetrics(IndexFile.field2249);
        }
        if (var3) {
            var4.setColor(Color.black);
            var4.fillRect(0, 0, Sequence.canvasWidth, class45.canvasHeight);
        }
        Color var5 = new Color(140, 17, 17);
        try {
            if (Size.field348 == null) {
                Size.field348 = this.canvas.createImage(304, 34);
            }
            Graphics var6 = Size.field348.getGraphics();
            var6.setColor(var5);
            var6.drawRect(0, 0, 303, 33);
            var6.fillRect(2, 2, var1 * 3, 30);
            var6.setColor(Color.black);
            var6.drawRect(1, 1, 301, 31);
            var6.fillRect(var1 * 3 + 2, 2, 300 - var1 * 3, 30);
            var6.setFont(IndexFile.field2249);
            var6.setColor(Color.white);
            var6.drawString(var2, (304 - CacheFile.field1676.stringWidth(var2)) / 2, 22);
            var4.drawImage(Size.field348, Sequence.canvasWidth / 2 - 152, class45.canvasHeight / 2 - 18, (ImageObserver) null);
        } catch (Exception var9) {
            int var7 = Sequence.canvasWidth / 2 - 152;
            int var8 = class45.canvasHeight / 2 - 18;
            var4.setColor(var5);
            var4.drawRect(var7, var8, 303, 33);
            var4.fillRect(var7 + 2, var8 + 2, var1 * 3, 30);
            var4.setColor(Color.black);
            var4.drawRect(var7 + 1, var8 + 1, 301, 31);
            var4.fillRect(var1 * 3 + var7 + 2, var8 + 2, 300 - var1 * 3, 30);
            var4.setFont(IndexFile.field2249);
            var4.setColor(Color.white);
            var4.drawString(var2, var7 + (304 - CacheFile.field1676.stringWidth(var2)) / 2, var8 + 22);
        }
    } catch (Exception var10) {
        this.canvas.repaint();
    }
}
Also used : Graphics(java.awt.Graphics) Color(java.awt.Color) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Example 15 with Export

use of net.runelite.mapping.Export in project runelite by runelite.

the class Fonts method encodeClassVerifier.

@ObfuscatedName("c")
@ObfuscatedSignature(signature = "(Lgf;I)V", garbageValue = "-604031072")
@Export("encodeClassVerifier")
public static void encodeClassVerifier(PacketBuffer var0) {
    ClassInfo var1 = (ClassInfo) class326.classInfos.last();
    if (var1 != null) {
        int var2 = var0.offset;
        var0.putInt(var1.field3948);
        for (int var3 = 0; var3 < var1.count; ++var3) {
            if (var1.errorIdentifiers[var3] != 0) {
                var0.putByte(var1.errorIdentifiers[var3]);
            } else {
                try {
                    int var4 = var1.type[var3];
                    Field var5;
                    int var6;
                    if (var4 == 0) {
                        var5 = var1.fields[var3];
                        var6 = Reflection.getInt(var5, (Object) null);
                        var0.putByte(0);
                        var0.putInt(var6);
                    } else if (var4 == 1) {
                        var5 = var1.fields[var3];
                        Reflection.setInt(var5, (Object) null, var1.field3947[var3]);
                        var0.putByte(0);
                    } else if (var4 == 2) {
                        var5 = var1.fields[var3];
                        var6 = var5.getModifiers();
                        var0.putByte(0);
                        var0.putInt(var6);
                    }
                    Method var25;
                    if (var4 != 3) {
                        if (var4 == 4) {
                            var25 = var1.methods[var3];
                            var6 = var25.getModifiers();
                            var0.putByte(0);
                            var0.putInt(var6);
                        }
                    } else {
                        var25 = var1.methods[var3];
                        byte[][] var10 = var1.args[var3];
                        Object[] var7 = new Object[var10.length];
                        for (int var8 = 0; var8 < var10.length; ++var8) {
                            ObjectInputStream var9 = new ObjectInputStream(new ByteArrayInputStream(var10[var8]));
                            var7[var8] = var9.readObject();
                        }
                        Object var11 = Reflection.invoke(var25, (Object) null, var7);
                        if (var11 == null) {
                            var0.putByte(0);
                        } else if (var11 instanceof Number) {
                            var0.putByte(1);
                            var0.putLong(((Number) var11).longValue());
                        } else if (var11 instanceof String) {
                            var0.putByte(2);
                            var0.putString((String) var11);
                        } else {
                            var0.putByte(4);
                        }
                    }
                } catch (ClassNotFoundException var13) {
                    var0.putByte(-10);
                } catch (InvalidClassException var14) {
                    var0.putByte(-11);
                } catch (StreamCorruptedException var15) {
                    var0.putByte(-12);
                } catch (OptionalDataException var16) {
                    var0.putByte(-13);
                } catch (IllegalAccessException var17) {
                    var0.putByte(-14);
                } catch (IllegalArgumentException var18) {
                    var0.putByte(-15);
                } catch (InvocationTargetException var19) {
                    var0.putByte(-16);
                } catch (SecurityException var20) {
                    var0.putByte(-17);
                } catch (IOException var21) {
                    var0.putByte(-18);
                } catch (NullPointerException var22) {
                    var0.putByte(-19);
                } catch (Exception var23) {
                    var0.putByte(-20);
                } catch (Throwable var24) {
                    var0.putByte(-21);
                }
            }
        }
        var0.putCrc(var2);
        var1.unlink();
    }
}
Also used : InvalidClassException(java.io.InvalidClassException) Method(java.lang.reflect.Method) IOException(java.io.IOException) OptionalDataException(java.io.OptionalDataException) InvocationTargetException(java.lang.reflect.InvocationTargetException) StreamCorruptedException(java.io.StreamCorruptedException) OptionalDataException(java.io.OptionalDataException) IOException(java.io.IOException) InvocationTargetException(java.lang.reflect.InvocationTargetException) InvalidClassException(java.io.InvalidClassException) Field(java.lang.reflect.Field) ByteArrayInputStream(java.io.ByteArrayInputStream) StreamCorruptedException(java.io.StreamCorruptedException) ObjectInputStream(java.io.ObjectInputStream) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Aggregations

Export (net.runelite.mapping.Export)23 ObfuscatedName (net.runelite.mapping.ObfuscatedName)23 ObfuscatedSignature (net.runelite.mapping.ObfuscatedSignature)22 Iterator (java.util.Iterator)8 IOException (java.io.IOException)4 ByteArrayInputStream (java.io.ByteArrayInputStream)2 File (java.io.File)2 URL (java.net.URL)2 Entry (java.util.Map.Entry)2 Canvas (java.awt.Canvas)1 Color (java.awt.Color)1 Container (java.awt.Container)1 Graphics (java.awt.Graphics)1 Insets (java.awt.Insets)1 Shape (java.awt.Shape)1 BufferedImage (java.awt.image.BufferedImage)1 PixelGrabber (java.awt.image.PixelGrabber)1 BufferedReader (java.io.BufferedReader)1 DataInputStream (java.io.DataInputStream)1 InvalidClassException (java.io.InvalidClassException)1