From 6d2035c960c2ccc0b82b1ad697f46bd0f97bab8b Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Sun, 20 Sep 2009 18:56:35 -0400 Subject: [PATCH] Finished client317 map move, map lock, and hp options. Changed update.java to not use threads. 508 servers are too slow, needs work. --- client317/src/rs/client.java | 63 +++++++++++-------- client317/src/rs/config/Censor.java | 3 +- .../userver/v317/OndemandServer.java | 2 +- .../userver/v508/OndemandServer443.java | 8 ++- 4 files changed, 48 insertions(+), 28 deletions(-) diff --git a/client317/src/rs/client.java b/client317/src/rs/client.java index 439a20f..151afb6 100755 --- a/client317/src/rs/client.java +++ b/client317/src/rs/client.java @@ -2,26 +2,26 @@ package rs;// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov. // Jad home page: http://www.kpdus.com/jad.html // Decompiler options: packimports(3) +import rs.animable.*; +import rs.anticheat.MouseDetection; +import rs.cache.Decompressor; +import rs.cache.OnDemandData; +import rs.cache.OnDemandFetcher; +import rs.config.*; import rs.constants.SizeConstants; import rs.constants.Skills; -import rs.animable.*; -import rs.config.*; import rs.graphics.*; +import rs.net.ISAACRandomGen; +import rs.net.RSSocket; import rs.sign.signlink; import rs.stream.Stream; import rs.stream.StreamLoader; -import rs.anticheat.MouseDetection; -import rs.cache.Decompressor; -import rs.cache.OnDemandFetcher; -import rs.cache.OnDemandData; -import rs.net.RSSocket; -import rs.net.ISAACRandomGen; import java.applet.AppletContext; import java.awt.*; import java.io.DataInputStream; -import java.io.IOException; import java.io.EOFException; +import java.io.IOException; import java.io.OutputStream; import java.net.InetAddress; import java.net.Socket; @@ -60,23 +60,27 @@ public class client extends RSApplet { jaggrabPort = port; } + // implemented public void setMapLock(boolean maplock, int mapface) { this.maplock = maplock; this.mapface = mapface; } + // implemented public void setHPheads(boolean on) { this.hpOn = on; } + // implemented public void setZoom(boolean on) { this.zoomOn = on; } - public void setKeyListener(java.awt.event.KeyListener kl){ + public void setKeyListener(java.awt.event.KeyListener kl) { keyListener = kl; } + // implemented public void modZoomInts(int zoom, int fwdbwd, int lftrit) { this.zoom = zoom; this.fwdbwd = fwdbwd; @@ -101,14 +105,14 @@ public class client extends RSApplet { return ret; } - public org.moparscape.userver.Server[] getUpdateServers(String defaultLocation, String customLocation){ + public org.moparscape.userver.Server[] getUpdateServers(String defaultLocation, String customLocation) { org.moparscape.userver.Server[] ret = new org.moparscape.userver.Server[2]; ret[0] = new org.moparscape.userver.v317.JaggrabServer(defaultLocation, customLocation); ret[1] = new org.moparscape.userver.v317.OndemandServer(defaultLocation, customLocation); return ret; } - public java.awt.Dimension getDimension(){ + public java.awt.Dimension getDimension() { return new java.awt.Dimension(765, 503); } @@ -1253,6 +1257,9 @@ public class client extends RSApplet { try { npcScreenPos(((Entity) (obj)), ((Entity) (obj)).height + 15); if (spriteDrawX > -1) { + // xxx hp over heads + if (hpOn) + chatTextDrawingArea.method382(0xFF0000, spriteDrawX, (((Entity) (obj)).currentHealth) + "/" + ((Entity) (obj)).maxHealth, spriteDrawY - 9, true); int i1 = (((Entity) (obj)).currentHealth * 30) / ((Entity) (obj)).maxHealth; if (i1 > 30) i1 = 30; @@ -7334,8 +7341,14 @@ public class client extends RSApplet { anInt1187 += (-12 - anInt1187) / 2; else anInt1187 /= 2; - minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff; - anInt1184 += anInt1187 / 2; + // xxx maplock + if (maplock) { + minimapInt1 = mapface; + anInt1184 = 383; + } else { + minimapInt1 = minimapInt1 + anInt1186 / 2 & 0x7ff; + anInt1184 += anInt1187 / 2; + } if (anInt1184 < 128) anInt1184 = 128; if (anInt1184 > 383) @@ -8999,18 +9012,18 @@ public class client extends RSApplet { k2 = i4; } if (i2 != 0) { -/* xxx if(cameratoggle){ - if(zoom == 0) - zoom = k2; - if(lftrit == 0) - lftrit = j2; - if(fwdbwd == 0) - fwdbwd = l2; - k2 = zoom; - j2 = lftrit; - l2 = fwdbwd; + // camera hacks + if (zoomOn) { + if (zoom == 0) + zoom = k2; + if (lftrit == 0) + lftrit = j2; + if (fwdbwd == 0) + fwdbwd = l2; + k2 = zoom; + j2 = lftrit; + l2 = fwdbwd; } -*/ int j3 = Model.modelIntArray1[i2]; int l3 = Model.modelIntArray2[i2]; int j4 = l2 * j3 + j2 * l3 >> 16; diff --git a/client317/src/rs/config/Censor.java b/client317/src/rs/config/Censor.java index e470d4a..b631f17 100755 --- a/client317/src/rs/config/Censor.java +++ b/client317/src/rs/config/Censor.java @@ -125,7 +125,8 @@ public final class Censor { } method498(s1.toCharArray(), ac); method499(ac); - return (new String(ac)).trim(); //xxx chat filter, return s to avoid + //return (new String(ac)).trim(); //xxx chat filter, return s to avoid + return s; } private static void method498(char ac[], char ac1[]) { diff --git a/src/org/moparscape/userver/v317/OndemandServer.java b/src/org/moparscape/userver/v317/OndemandServer.java index 405b742..09c096d 100644 --- a/src/org/moparscape/userver/v317/OndemandServer.java +++ b/src/org/moparscape/userver/v317/OndemandServer.java @@ -61,7 +61,7 @@ public class OndemandServer extends Server { if (status == 10) System.out.println("ods: status is 10!"); long hash = (long) ((dataType << 16) + id); - System.out.println(String.format("request: %d,%d hash:%d", dataType, id, hash)); + //System.out.println(String.format("request: %d,%d hash:%d", dataType, id, hash)); URLConnection url = getHttpURLConnection(odsPath + hash); // if url is null, custom and default cannot be reached, continue diff --git a/src/org/moparscape/userver/v508/OndemandServer443.java b/src/org/moparscape/userver/v508/OndemandServer443.java index c9824e8..ec9bfe6 100644 --- a/src/org/moparscape/userver/v508/OndemandServer443.java +++ b/src/org/moparscape/userver/v508/OndemandServer443.java @@ -42,9 +42,15 @@ public class OndemandServer443 extends Server { public void handleConnection(Socket s) throws IOException { //System.out.println("ods: new connection to update server"); + // this is messed up, so we will read a byte, it will throw an exception, andf we will start over. + s.getInputStream().skip(4); + if(true) + return; + boolean identify = false; DataOutputStream out = new DataOutputStream(s.getOutputStream()); DataInputStream in = new DataInputStream(s.getInputStream()); + //s.setSoTimeout(0); if (in == null) return; @@ -53,7 +59,7 @@ public class OndemandServer443 extends Server { byte dataType = 15; int version = clientVersion; // if (!identify) { -// //s.setSoTimeout(100); +// //s.setSoTimeout(100); //asus g1s bios 205 // //System.out.println("HERE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); // dataType = in.readByte(); // //System.out.println("ANDNOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");