diff options
| author | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-03 16:38:41 -0700 |
| commit | e1e781bb2135ef78592226f1a3eaba4925702f1f (patch) | |
| tree | 8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/network | |
| download | worlds.jar-main.tar.xz worlds.jar-main.zip | |
Diffstat (limited to 'NET/worlds/network')
84 files changed, 18844 insertions, 0 deletions
diff --git a/NET/worlds/network/AnonRoomServer.java b/NET/worlds/network/AnonRoomServer.java new file mode 100644 index 0000000..6111533 --- /dev/null +++ b/NET/worlds/network/AnonRoomServer.java @@ -0,0 +1,146 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.core.IniFile; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class AnonRoomServer +/* */ extends WorldServer +/* */ { +/* */ protected sessionInitCmd buildSessionInitCmd() +/* */ { +/* 56 */ OldPropertyList props = new OldPropertyList(); +/* 57 */ String username = null; +/* */ +/* */ +/* 60 */ assert (this._galaxy.getLoginMode() != 1); +/* */ +/* 62 */ assert (this._galaxy.getPassword() == null); +/* 63 */ assert (this._galaxy.getSerialNum() == null); +/* */ +/* */ +/* 66 */ props.addProperty(new netProperty(3, +/* 67 */ String.valueOf(getVersion()))); +/* 68 */ props.addProperty(new netProperty(9, +/* 69 */ String.valueOf(this._clientVersion))); +/* */ +/* 71 */ this._firstLogon = this._galaxy.addPendingServer(this); +/* 72 */ assert (this._firstLogon); +/* */ +/* 74 */ int avatars = IniFile.gamma().getIniInt("avatars", 24); +/* 75 */ props.addProperty(new netProperty(7, +/* 76 */ Integer.toString(avatars))); +/* */ +/* 78 */ switch (this._galaxy.getLoginMode()) { +/* */ case 3: +/* 80 */ assert (this._galaxy.getGuestExpiration() != null); +/* 81 */ props.addProperty(new netProperty(14, this._galaxy +/* 82 */ .getGuestExpiration())); +/* 83 */ props.addProperty(new netProperty(12, "1")); +/* 84 */ break; +/* */ +/* */ +/* */ +/* */ case 2: +/* 89 */ assert (this._galaxy.getChatname() != null); +/* 90 */ username = this._galaxy.getChatname(); +/* */ +/* */ +/* */ +/* 94 */ regShortID(1, username); +/* */ +/* 96 */ props.addProperty(new netProperty(2, username)); +/* 97 */ break; +/* */ default: +/* 99 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ break; +/* */ } +/* 103 */ if ((getDebugLevel() & 0x4) > 0) { +/* 104 */ synchronized (System.out) { +/* 105 */ System.out.println(this._serverURL.getHost() + +/* 106 */ ": sending AnonRoomServer sessionInit."); +/* 107 */ if ((this._firstLogon) && +/* 108 */ (this._galaxy.getLoginMode() == 3)) { +/* 109 */ System.out.println(" VAR_GUEST"); +/* */ } else { +/* 111 */ assert (username != null); +/* 112 */ System.out.println(" username = \"" + username + "\""); +/* */ } +/* */ } +/* */ } +/* 116 */ return new sessionInitCmd(props); +/* */ } +/* */ +/* */ protected void state_XMIT_SI() +/* */ { +/* 121 */ if (this._requestOffline) { +/* 122 */ this._state.setState(17); +/* 123 */ return; +/* */ } +/* 125 */ sessionInitCmd SI = buildSessionInitCmd(); +/* */ +/* 127 */ if (SI != null) { +/* */ try { +/* 129 */ sendNetMsg(SI); +/* */ } catch (PacketTooLargeException e) { +/* 131 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 133 */ this._state.setState(8); +/* */ } +/* */ else { +/* 136 */ this._lastError = new VarErrorException(204); +/* 137 */ this._state.setState(17); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\AnonRoomServer.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/AnonUserServer.java b/NET/worlds/network/AnonUserServer.java new file mode 100644 index 0000000..9448a04 --- /dev/null +++ b/NET/worlds/network/AnonUserServer.java @@ -0,0 +1,143 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class AnonUserServer +/* */ extends WorldServer +/* */ { +/* */ protected sessionInitCmd buildSessionInitCmd() +/* */ { +/* 59 */ OldPropertyList props = new OldPropertyList(); +/* */ +/* */ +/* 62 */ props.addProperty(new netProperty(3, +/* 63 */ String.valueOf(getVersion()))); +/* 64 */ props.addProperty(new netProperty(9, +/* 65 */ String.valueOf(this._clientVersion))); +/* */ +/* 67 */ this._firstLogon = this._galaxy.addPendingServer(this); +/* 68 */ assert (this._firstLogon); +/* */ +/* */ +/* 71 */ assert (this._galaxy.getPassword() == null); +/* */ +/* */ +/* 74 */ assert (this._galaxy.getLoginMode() != 1); +/* 75 */ assert (this._galaxy.getLoginMode() != 4); +/* 76 */ assert (this._galaxy.getSerialNum() == null); +/* */ +/* 78 */ switch (this._galaxy.getLoginMode()) { +/* */ case 3: +/* 80 */ assert (this._galaxy.getGuestExpiration() != null); +/* 81 */ props.addProperty(new netProperty(14, this._galaxy +/* 82 */ .getGuestExpiration())); +/* 83 */ if (this._firstLogon) +/* 84 */ props.addProperty(new netProperty(12, "1")); +/* 85 */ break; +/* */ +/* */ +/* */ case 2: +/* 89 */ assert (this._galaxy.getChatname() != null); +/* */ +/* */ +/* 92 */ regShortID(1, this._galaxy.getChatname()); +/* */ +/* 94 */ props.addProperty(new netProperty(2, this._galaxy +/* 95 */ .getChatname())); +/* 96 */ if (this._firstLogon) +/* 97 */ props.addProperty(new netProperty(12, "1")); +/* 98 */ break; +/* */ default: +/* 100 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ break; +/* */ } +/* */ +/* 105 */ if ((getDebugLevel() & 0x4) > 0) { +/* 106 */ synchronized (System.out) { +/* 107 */ System.out.println(this._serverURL.getHost() + +/* 108 */ ": sending sessionInit."); +/* 109 */ System.out.println(" username = \"" + +/* 110 */ this._galaxy.getChatname() + "\""); +/* 111 */ if (this._galaxy.getPassword() != null) +/* 112 */ System.out.println(" password = " + +/* 113 */ this._galaxy.getPassword()); +/* 114 */ if (this._galaxy.getLoginMode() == 3) { +/* 115 */ System.out.println(" VAR_GUEST"); +/* */ } +/* */ } +/* */ } +/* 119 */ return new sessionInitCmd(props); +/* */ } +/* */ +/* */ protected void state_XMIT_SI() +/* */ { +/* 124 */ if (this._requestOffline) { +/* 125 */ this._state.setState(17); +/* 126 */ return; +/* */ } +/* 128 */ sessionInitCmd SI = buildSessionInitCmd(); +/* */ try +/* */ { +/* 131 */ sendNetMsg(SI); +/* */ } catch (PacketTooLargeException e) { +/* 133 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 135 */ this._state.setState(8); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\AnonUserServer.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/AutoServer.java b/NET/worlds/network/AutoServer.java new file mode 100644 index 0000000..a519706 --- /dev/null +++ b/NET/worlds/network/AutoServer.java @@ -0,0 +1,145 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class AutoServer +/* */ extends WorldServer +/* */ { +/* 36 */ private static int counter = 0; +/* */ +/* */ +/* */ +/* */ public AutoServer() +/* */ { +/* 42 */ if (counter++ > 0) { +/* 43 */ System.out.println("DEBUG: Created second AutoServer class."); +/* 44 */ Galaxy.printDebugging(); +/* 45 */ new Exception().printStackTrace(System.out); +/* */ } +/* */ } +/* */ +/* */ +/* */ public synchronized void incRefCnt(Object referrer) +/* */ { +/* 52 */ super.incRefCnt(referrer); +/* 53 */ startConnect(); +/* */ } +/* */ +/* */ protected void state_Authprompt() +/* */ { +/* 58 */ this._state.setState(3); +/* */ } +/* */ +/* */ protected void state_XMIT_SI() +/* */ { +/* 63 */ WorldServer newServer = null; +/* */ +/* */ +/* 66 */ int servType = getServerType(); +/* */ +/* 68 */ if ((getDebugLevel() & 0x20) > 0) { +/* 69 */ System.out.println(this + ": AutoServer detected server type " + +/* 70 */ servType); +/* */ } +/* */ +/* 73 */ switch (servType) { +/* */ case 1: +/* 75 */ newServer = new UserServer(); +/* 76 */ break; +/* */ case 2: +/* 78 */ newServer = new AnonUserServer(); +/* 79 */ break; +/* */ case 3: +/* 81 */ Console.println(this + Console.message("Error-in-server")); +/* 82 */ Console.println(this + Console.message("Error-user-server")); +/* 83 */ newServer = null; +/* 84 */ break; +/* */ case 4: +/* 86 */ newServer = new AnonRoomServer(); +/* 87 */ break; +/* */ default: +/* 89 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ break; +/* */ } +/* 92 */ if (newServer != null) { +/* 93 */ newServer.reuseConnection(this); +/* 94 */ newServer.initInstance(this._galaxy, this._serverURL); +/* 95 */ newServer.propertyUpdate(this._propList); +/* */ } +/* */ +/* 98 */ this._galaxy.killServer(this); +/* */ +/* */ +/* 101 */ this._galaxy.swapServer(this, newServer); +/* */ +/* */ +/* 104 */ this._galaxy.setGalaxyType(servType); +/* */ +/* */ +/* */ +/* 108 */ if (this._refCnt - this._tmpRefCnt != 0) { +/* 109 */ System.out.println(this + +/* 110 */ ": bad reference counts. DEBUG INFO:"); +/* 111 */ System.out.println("\t_refCnt = " + this._refCnt); +/* 112 */ System.out.println("\t_tmpRefCnt = " + this._tmpRefCnt); +/* 113 */ printReferrers(); +/* */ } +/* */ +/* 116 */ assert (this._refCnt - this._tmpRefCnt == 0); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 124 */ this._state.setState(17); +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 129 */ return "AutoServer(" + super.toString() + ")"; +/* */ } +/* */ +/* */ void goOnline() +/* */ { +/* 134 */ super.goOnline(); +/* */ +/* 136 */ System.out.println("DEBUG: AutoServer going online!"); +/* 137 */ new Exception().printStackTrace(System.out); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\AutoServer.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/BuddyListNotifyCmd.java b/NET/worlds/network/BuddyListNotifyCmd.java new file mode 100644 index 0000000..37ab715 --- /dev/null +++ b/NET/worlds/network/BuddyListNotifyCmd.java @@ -0,0 +1,55 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.FriendsListPart; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class BuddyListNotifyCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte BUDDYLISTNOTIFYCMD = 30; +/* */ protected String buddyName; +/* */ protected int loggedOn; +/* */ +/* */ public BuddyListNotifyCmd() +/* */ { +/* 26 */ this._commandType = 30; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 31 */ this.buddyName = data.readUTF(); +/* */ +/* */ +/* */ +/* */ +/* 36 */ this.loggedOn = data.readByte(); +/* */ } +/* */ +/* */ void process(WorldServer serv) throws Exception +/* */ { +/* 41 */ FriendsListPart.processBuddyListNotify(serv, this.buddyName, this.loggedOn); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 47 */ return "BUDDYLISTNOTIFY " + this.buddyName + " " + this.loggedOn; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\BuddyListNotifyCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/BuddyListUpdateCmd.java b/NET/worlds/network/BuddyListUpdateCmd.java new file mode 100644 index 0000000..8a26ce6 --- /dev/null +++ b/NET/worlds/network/BuddyListUpdateCmd.java @@ -0,0 +1,50 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class BuddyListUpdateCmd +/* */ extends netPacket +/* */ { +/* */ public static final byte BUDDYLISTUPDATECMD = 29; +/* */ private String buddy; +/* */ private int add; +/* */ +/* */ public BuddyListUpdateCmd(String buddy, int add) +/* */ { +/* 21 */ super(null, 29); +/* 22 */ this.buddy = buddy; +/* 23 */ this.add = add; +/* */ } +/* */ +/* */ +/* */ int packetSize() +/* */ { +/* 29 */ return super.packetSize() + ServerOutputStream.utfLength(this.buddy) + 2; +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 34 */ super.send(o); +/* 35 */ o.writeUTF(this.buddy); +/* 36 */ o.writeByte(this.add); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 42 */ return "BUDDYLISTUPDATE " + this.buddy + " " + this.add; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\BuddyListUpdateCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/Cache.java b/NET/worlds/network/Cache.java new file mode 100644 index 0000000..7a2f3e9 --- /dev/null +++ b/NET/worlds/network/Cache.java @@ -0,0 +1,955 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Gamma; +/* */ import NET.worlds.console.Main; +/* */ import NET.worlds.console.MainCallback; +/* */ import NET.worlds.console.MainTerminalCallback; +/* */ import NET.worlds.core.IniFile; +/* */ import NET.worlds.core.Std; +/* */ import java.io.File; +/* */ import java.io.FileOutputStream; +/* */ import java.io.IOException; +/* */ import java.io.InputStream; +/* */ import java.io.ObjectOutputStream; +/* */ import java.io.PrintStream; +/* */ import java.io.Serializable; +/* */ import java.util.Collection; +/* */ import java.util.Date; +/* */ import java.util.Enumeration; +/* */ import java.util.Hashtable; +/* */ import java.util.Iterator; +/* */ import java.util.Vector; +/* */ import java.util.zip.ZipEntry; +/* */ import java.util.zip.ZipFile; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class Cache +/* */ implements MainCallback, MainTerminalCallback, Serializable +/* */ { +/* */ private static final long serialVersionUID = -7557149391688293661L; +/* */ private static final long CACHE_VERSION = 0L; +/* 56 */ private static String CACHE_DIR = Gamma.earlyURLUnalias("home:cachedir/") +/* 57 */ .replace('/', '\\'); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 63 */ static final int CACHE_MIN_CHANGE = IniFile.gamma().getIniInt("NetCacheMinChange", 50); +/* */ +/* */ +/* 66 */ static final long CACHE_MAX_DELAY = IniFile.gamma().getIniInt("NetCacheMaxDelay", 5) * 1000L * 60L; +/* 67 */ private Date lastCacheSave = new Date(); +/* */ +/* */ +/* 70 */ static transient Cache cache = initLoad(); +/* */ +/* 72 */ private transient Hashtable<Object, CacheEntry> table = new Hashtable(); +/* */ +/* */ +/* */ +/* 76 */ private transient CacheEntry terminator = new CacheEntry(); +/* */ +/* */ transient long totalBytes; +/* */ +/* */ transient int hasChanged; +/* */ +/* 82 */ private int nextAvailable = 1; +/* */ +/* */ public static void ClearCustomAvatars() +/* */ { +/* 86 */ Collection<CacheEntry> c = cache.table.values(); +/* */ +/* 88 */ Iterator<CacheEntry> it = c.iterator(); +/* */ +/* 90 */ Vector<CacheEntry> tmp = new Vector(); +/* */ +/* 92 */ while (it.hasNext()) +/* */ { +/* 94 */ CacheEntry ce = (CacheEntry)it.next(); +/* 95 */ if ((ce != null) && (ce.url.toString().contains("custom"))) +/* */ { +/* 97 */ tmp.add(ce); +/* */ } +/* */ } +/* */ +/* 101 */ for (int i = 0; i < tmp.size(); i++) { +/* 102 */ removeEntry((CacheEntry)tmp.get(i)); +/* */ } +/* */ } +/* */ +/* */ /* Error */ +/* */ static Cache initLoad() +/* */ { +/* */ // Byte code: +/* */ // 0: getstatic 163 java/lang/System:out Ljava/io/PrintStream; +/* */ // 3: ldc -87 +/* */ // 5: invokevirtual 171 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 8: new 1 NET/worlds/network/Cache +/* */ // 11: dup +/* */ // 12: invokespecial 177 NET/worlds/network/Cache:<init> ()V +/* */ // 15: astore_0 +/* */ // 16: aconst_null +/* */ // 17: astore_1 +/* */ // 18: aconst_null +/* */ // 19: astore_2 +/* */ // 20: getstatic 163 java/lang/System:out Ljava/io/PrintStream; +/* */ // 23: ldc -78 +/* */ // 25: invokevirtual 171 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 28: new 180 java/io/File +/* */ // 31: dup +/* */ // 32: new 182 java/lang/StringBuilder +/* */ // 35: dup +/* */ // 36: getstatic 54 NET/worlds/network/Cache:CACHE_DIR Ljava/lang/String; +/* */ // 39: invokestatic 184 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; +/* */ // 42: invokespecial 188 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 45: ldc -66 +/* */ // 47: invokevirtual 192 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 50: invokevirtual 196 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 53: invokespecial 197 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 56: astore_3 +/* */ // 57: aload_3 +/* */ // 58: invokevirtual 198 java/io/File:exists ()Z +/* */ // 61: ifne +68 -> 129 +/* */ // 64: new 180 java/io/File +/* */ // 67: dup +/* */ // 68: new 182 java/lang/StringBuilder +/* */ // 71: dup +/* */ // 72: getstatic 54 NET/worlds/network/Cache:CACHE_DIR Ljava/lang/String; +/* */ // 75: invokestatic 184 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; +/* */ // 78: invokespecial 188 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 81: ldc -55 +/* */ // 83: invokevirtual 192 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 86: invokevirtual 196 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 89: invokespecial 197 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 92: astore_3 +/* */ // 93: aload_3 +/* */ // 94: invokevirtual 198 java/io/File:exists ()Z +/* */ // 97: ifne +32 -> 129 +/* */ // 100: new 180 java/io/File +/* */ // 103: dup +/* */ // 104: new 182 java/lang/StringBuilder +/* */ // 107: dup +/* */ // 108: getstatic 54 NET/worlds/network/Cache:CACHE_DIR Ljava/lang/String; +/* */ // 111: invokestatic 184 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; +/* */ // 114: invokespecial 188 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 117: ldc -53 +/* */ // 119: invokevirtual 192 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 122: invokevirtual 196 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 125: invokespecial 197 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 128: astore_3 +/* */ // 129: new 205 java/io/FileInputStream +/* */ // 132: dup +/* */ // 133: aload_3 +/* */ // 134: invokespecial 207 java/io/FileInputStream:<init> (Ljava/io/File;)V +/* */ // 137: astore_1 +/* */ // 138: new 210 java/io/ObjectInputStream +/* */ // 141: dup +/* */ // 142: aload_1 +/* */ // 143: invokespecial 212 java/io/ObjectInputStream:<init> (Ljava/io/InputStream;)V +/* */ // 146: astore_2 +/* */ // 147: aload_2 +/* */ // 148: invokevirtual 215 java/io/ObjectInputStream:readLong ()J +/* */ // 151: lstore 4 +/* */ // 153: lload 4 +/* */ // 155: lconst_0 +/* */ // 156: lcmp +/* */ // 157: ifeq +13 -> 170 +/* */ // 160: new 219 java/lang/Exception +/* */ // 163: dup +/* */ // 164: ldc -35 +/* */ // 166: invokespecial 223 java/lang/Exception:<init> (Ljava/lang/String;)V +/* */ // 169: athrow +/* */ // 170: aload_2 +/* */ // 171: invokevirtual 224 java/io/ObjectInputStream:readObject ()Ljava/lang/Object; +/* */ // 174: checkcast 1 NET/worlds/network/Cache +/* */ // 177: astore_0 +/* */ // 178: aload_0 +/* */ // 179: new 112 NET/worlds/network/CacheEntry +/* */ // 182: dup +/* */ // 183: invokespecial 227 NET/worlds/network/CacheEntry:<init> ()V +/* */ // 186: putfield 228 NET/worlds/network/Cache:terminator LNET/worlds/network/CacheEntry; +/* */ // 189: aload_0 +/* */ // 190: new 90 java/util/Hashtable +/* */ // 193: dup +/* */ // 194: invokespecial 230 java/util/Hashtable:<init> ()V +/* */ // 197: putfield 87 NET/worlds/network/Cache:table Ljava/util/Hashtable; +/* */ // 200: goto +55 -> 255 +/* */ // 203: aload 6 +/* */ // 205: instanceof 112 +/* */ // 208: ifeq +57 -> 265 +/* */ // 211: aload 6 +/* */ // 213: checkcast 112 NET/worlds/network/CacheEntry +/* */ // 216: getfield 114 NET/worlds/network/CacheEntry:url LNET/worlds/network/URL; +/* */ // 219: ifnull +36 -> 255 +/* */ // 222: aload 6 +/* */ // 224: checkcast 112 NET/worlds/network/CacheEntry +/* */ // 227: getfield 231 NET/worlds/network/CacheEntry:localName Ljava/lang/String; +/* */ // 230: ifnull +25 -> 255 +/* */ // 233: aload 6 +/* */ // 235: checkcast 112 NET/worlds/network/CacheEntry +/* */ // 238: getfield 234 NET/worlds/network/CacheEntry:state I +/* */ // 241: bipush 7 +/* */ // 243: if_icmplt +12 -> 255 +/* */ // 246: aload_0 +/* */ // 247: aload 6 +/* */ // 249: checkcast 112 NET/worlds/network/CacheEntry +/* */ // 252: invokevirtual 237 NET/worlds/network/Cache:add (LNET/worlds/network/CacheEntry;)V +/* */ // 255: aload_2 +/* */ // 256: invokevirtual 224 java/io/ObjectInputStream:readObject ()Ljava/lang/Object; +/* */ // 259: dup +/* */ // 260: astore 6 +/* */ // 262: ifnonnull -59 -> 203 +/* */ // 265: aload_2 +/* */ // 266: invokevirtual 239 java/io/ObjectInputStream:close ()V +/* */ // 269: aconst_null +/* */ // 270: astore_2 +/* */ // 271: aload_1 +/* */ // 272: invokevirtual 242 java/io/FileInputStream:close ()V +/* */ // 275: aconst_null +/* */ // 276: astore_1 +/* */ // 277: getstatic 163 java/lang/System:out Ljava/io/PrintStream; +/* */ // 280: ldc -13 +/* */ // 282: invokevirtual 171 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 285: goto +163 -> 448 +/* */ // 288: astore_3 +/* */ // 289: aload_2 +/* */ // 290: ifnull +14 -> 304 +/* */ // 293: aload_2 +/* */ // 294: invokevirtual 239 java/io/ObjectInputStream:close ()V +/* */ // 297: goto +5 -> 302 +/* */ // 300: astore 8 +/* */ // 302: aconst_null +/* */ // 303: astore_2 +/* */ // 304: aload_1 +/* */ // 305: ifnull +173 -> 478 +/* */ // 308: aload_1 +/* */ // 309: invokevirtual 242 java/io/FileInputStream:close ()V +/* */ // 312: goto +5 -> 317 +/* */ // 315: astore 8 +/* */ // 317: aconst_null +/* */ // 318: astore_1 +/* */ // 319: goto +159 -> 478 +/* */ // 322: astore_3 +/* */ // 323: getstatic 163 java/lang/System:out Ljava/io/PrintStream; +/* */ // 326: aload_3 +/* */ // 327: invokevirtual 245 java/io/PrintStream:println (Ljava/lang/Object;)V +/* */ // 330: getstatic 163 java/lang/System:out Ljava/io/PrintStream; +/* */ // 333: ldc -8 +/* */ // 335: invokevirtual 171 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 338: new 180 java/io/File +/* */ // 341: dup +/* */ // 342: new 182 java/lang/StringBuilder +/* */ // 345: dup +/* */ // 346: getstatic 54 NET/worlds/network/Cache:CACHE_DIR Ljava/lang/String; +/* */ // 349: invokestatic 184 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; +/* */ // 352: invokespecial 188 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 355: ldc -66 +/* */ // 357: invokevirtual 192 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 360: invokevirtual 196 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 363: invokespecial 197 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 366: astore 4 +/* */ // 368: aload 4 +/* */ // 370: invokevirtual 250 java/io/File:mkdirs ()Z +/* */ // 373: pop +/* */ // 374: aload 4 +/* */ // 376: invokevirtual 253 java/io/File:delete ()Z +/* */ // 379: pop +/* */ // 380: aload_2 +/* */ // 381: ifnull +14 -> 395 +/* */ // 384: aload_2 +/* */ // 385: invokevirtual 239 java/io/ObjectInputStream:close ()V +/* */ // 388: goto +5 -> 393 +/* */ // 391: astore 8 +/* */ // 393: aconst_null +/* */ // 394: astore_2 +/* */ // 395: aload_1 +/* */ // 396: ifnull +82 -> 478 +/* */ // 399: aload_1 +/* */ // 400: invokevirtual 242 java/io/FileInputStream:close ()V +/* */ // 403: goto +5 -> 408 +/* */ // 406: astore 8 +/* */ // 408: aconst_null +/* */ // 409: astore_1 +/* */ // 410: goto +68 -> 478 +/* */ // 413: astore 7 +/* */ // 415: aload_2 +/* */ // 416: ifnull +14 -> 430 +/* */ // 419: aload_2 +/* */ // 420: invokevirtual 239 java/io/ObjectInputStream:close ()V +/* */ // 423: goto +5 -> 428 +/* */ // 426: astore 8 +/* */ // 428: aconst_null +/* */ // 429: astore_2 +/* */ // 430: aload_1 +/* */ // 431: ifnull +14 -> 445 +/* */ // 434: aload_1 +/* */ // 435: invokevirtual 242 java/io/FileInputStream:close ()V +/* */ // 438: goto +5 -> 443 +/* */ // 441: astore 8 +/* */ // 443: aconst_null +/* */ // 444: astore_1 +/* */ // 445: aload 7 +/* */ // 447: athrow +/* */ // 448: aload_2 +/* */ // 449: ifnull +14 -> 463 +/* */ // 452: aload_2 +/* */ // 453: invokevirtual 239 java/io/ObjectInputStream:close ()V +/* */ // 456: goto +5 -> 461 +/* */ // 459: astore 8 +/* */ // 461: aconst_null +/* */ // 462: astore_2 +/* */ // 463: aload_1 +/* */ // 464: ifnull +14 -> 478 +/* */ // 467: aload_1 +/* */ // 468: invokevirtual 242 java/io/FileInputStream:close ()V +/* */ // 471: goto +5 -> 476 +/* */ // 474: astore 8 +/* */ // 476: aconst_null +/* */ // 477: astore_1 +/* */ // 478: new 180 java/io/File +/* */ // 481: dup +/* */ // 482: getstatic 54 NET/worlds/network/Cache:CACHE_DIR Ljava/lang/String; +/* */ // 485: invokespecial 197 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 488: invokevirtual 256 java/io/File:list ()[Ljava/lang/String; +/* */ // 491: astore_3 +/* */ // 492: new 90 java/util/Hashtable +/* */ // 495: dup +/* */ // 496: invokespecial 230 java/util/Hashtable:<init> ()V +/* */ // 499: astore 4 +/* */ // 501: aload_3 +/* */ // 502: ifnull +84 -> 586 +/* */ // 505: iconst_0 +/* */ // 506: istore 5 +/* */ // 508: goto +41 -> 549 +/* */ // 511: aload 4 +/* */ // 513: new 182 java/lang/StringBuilder +/* */ // 516: dup +/* */ // 517: getstatic 54 NET/worlds/network/Cache:CACHE_DIR Ljava/lang/String; +/* */ // 520: invokestatic 184 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; +/* */ // 523: invokespecial 188 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 526: aload_3 +/* */ // 527: iload 5 +/* */ // 529: aaload +/* */ // 530: invokevirtual 192 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 533: invokevirtual 196 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 536: invokevirtual 260 java/lang/String:toUpperCase ()Ljava/lang/String; +/* */ // 539: ldc_w 263 +/* */ // 542: invokevirtual 265 java/util/Hashtable:put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; +/* */ // 545: pop +/* */ // 546: iinc 5 1 +/* */ // 549: iload 5 +/* */ // 551: aload_3 +/* */ // 552: arraylength +/* */ // 553: if_icmplt -42 -> 511 +/* */ // 556: aload 4 +/* */ // 558: new 182 java/lang/StringBuilder +/* */ // 561: dup +/* */ // 562: getstatic 54 NET/worlds/network/Cache:CACHE_DIR Ljava/lang/String; +/* */ // 565: invokestatic 184 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; +/* */ // 568: invokespecial 188 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 571: ldc -66 +/* */ // 573: invokevirtual 192 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 576: invokevirtual 196 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 579: invokevirtual 260 java/lang/String:toUpperCase ()Ljava/lang/String; +/* */ // 582: invokevirtual 269 java/util/Hashtable:remove (Ljava/lang/Object;)Ljava/lang/Object; +/* */ // 585: pop +/* */ // 586: aload_0 +/* */ // 587: lconst_0 +/* */ // 588: putfield 273 NET/worlds/network/Cache:totalBytes J +/* */ // 591: aload_0 +/* */ // 592: iconst_0 +/* */ // 593: putfield 275 NET/worlds/network/Cache:hasChanged I +/* */ // 596: aload_0 +/* */ // 597: getfield 228 NET/worlds/network/Cache:terminator LNET/worlds/network/CacheEntry; +/* */ // 600: getfield 277 NET/worlds/network/CacheEntry:next LNET/worlds/network/CacheEntry; +/* */ // 603: astore 5 +/* */ // 605: goto +101 -> 706 +/* */ // 608: aload 5 +/* */ // 610: astore 6 +/* */ // 612: aload 5 +/* */ // 614: getfield 277 NET/worlds/network/CacheEntry:next LNET/worlds/network/CacheEntry; +/* */ // 617: astore 5 +/* */ // 619: aload 6 +/* */ // 621: getfield 231 NET/worlds/network/CacheEntry:localName Ljava/lang/String; +/* */ // 624: invokevirtual 260 java/lang/String:toUpperCase ()Ljava/lang/String; +/* */ // 627: astore 7 +/* */ // 629: aload 4 +/* */ // 631: aload 7 +/* */ // 633: invokevirtual 279 java/util/Hashtable:get (Ljava/lang/Object;)Ljava/lang/Object; +/* */ // 636: ifnull +7 -> 643 +/* */ // 639: iconst_1 +/* */ // 640: goto +4 -> 644 +/* */ // 643: iconst_0 +/* */ // 644: istore 8 +/* */ // 646: aload 4 +/* */ // 648: aload 7 +/* */ // 650: invokevirtual 269 java/util/Hashtable:remove (Ljava/lang/Object;)Ljava/lang/Object; +/* */ // 653: pop +/* */ // 654: aload_0 +/* */ // 655: dup +/* */ // 656: getfield 273 NET/worlds/network/Cache:totalBytes J +/* */ // 659: aload 6 +/* */ // 661: getfield 281 NET/worlds/network/CacheEntry:bytes I +/* */ // 664: i2l +/* */ // 665: ladd +/* */ // 666: putfield 273 NET/worlds/network/Cache:totalBytes J +/* */ // 669: aload 6 +/* */ // 671: invokevirtual 284 NET/worlds/network/CacheEntry:done ()Z +/* */ // 674: ifeq +8 -> 682 +/* */ // 677: iload 8 +/* */ // 679: ifne +27 -> 706 +/* */ // 682: aload_0 +/* */ // 683: aload 6 +/* */ // 685: invokevirtual 287 NET/worlds/network/Cache:remove (LNET/worlds/network/CacheEntry;)V +/* */ // 688: iload 8 +/* */ // 690: ifeq +16 -> 706 +/* */ // 693: new 180 java/io/File +/* */ // 696: dup +/* */ // 697: aload 7 +/* */ // 699: invokespecial 197 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 702: invokevirtual 253 java/io/File:delete ()Z +/* */ // 705: pop +/* */ // 706: aload 5 +/* */ // 708: aload_0 +/* */ // 709: getfield 228 NET/worlds/network/Cache:terminator LNET/worlds/network/CacheEntry; +/* */ // 712: if_acmpne -104 -> 608 +/* */ // 715: aload 4 +/* */ // 717: invokevirtual 289 java/util/Hashtable:keys ()Ljava/util/Enumeration; +/* */ // 720: astore 5 +/* */ // 722: goto +24 -> 746 +/* */ // 725: new 180 java/io/File +/* */ // 728: dup +/* */ // 729: aload 5 +/* */ // 731: invokeinterface 293 1 0 +/* */ // 736: checkcast 49 java/lang/String +/* */ // 739: invokespecial 197 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 742: invokevirtual 253 java/io/File:delete ()Z +/* */ // 745: pop +/* */ // 746: aload 5 +/* */ // 748: invokeinterface 298 1 0 +/* */ // 753: ifne -28 -> 725 +/* */ // 756: new 180 java/io/File +/* */ // 759: dup +/* */ // 760: ldc_w 301 +/* */ // 763: invokespecial 197 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 766: astore 5 +/* */ // 768: aload 5 +/* */ // 770: invokevirtual 198 java/io/File:exists ()Z +/* */ // 773: ifeq +15 -> 788 +/* */ // 776: aload_0 +/* */ // 777: putstatic 82 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 780: aload 5 +/* */ // 782: ldc_w 303 +/* */ // 785: invokestatic 305 NET/worlds/network/Cache:InjectZipFile (Ljava/io/File;Ljava/lang/String;)V +/* */ // 788: aload_0 +/* */ // 789: new 309 java/util/Date +/* */ // 792: dup +/* */ // 793: invokespecial 311 java/util/Date:<init> ()V +/* */ // 796: putfield 312 NET/worlds/network/Cache:lastCacheSave Ljava/util/Date; +/* */ // 799: aload_0 +/* */ // 800: invokestatic 314 NET/worlds/console/Main:register (LNET/worlds/console/MainCallback;)V +/* */ // 803: aload_0 +/* */ // 804: areturn +/* */ // Line number table: +/* */ // Java source line #109 -> byte code offset #0 +/* */ // Java source line #111 -> byte code offset #8 +/* */ // Java source line #112 -> byte code offset #16 +/* */ // Java source line #113 -> byte code offset #18 +/* */ // Java source line #130 -> byte code offset #20 +/* */ // Java source line #132 -> byte code offset #28 +/* */ // Java source line #133 -> byte code offset #57 +/* */ // Java source line #134 -> byte code offset #64 +/* */ // Java source line #135 -> byte code offset #93 +/* */ // Java source line #136 -> byte code offset #100 +/* */ // Java source line #139 -> byte code offset #129 +/* */ // Java source line #140 -> byte code offset #138 +/* */ // Java source line #141 -> byte code offset #147 +/* */ // Java source line #142 -> byte code offset #153 +/* */ // Java source line #143 -> byte code offset #160 +/* */ // Java source line #145 -> byte code offset #170 +/* */ // Java source line #147 -> byte code offset #178 +/* */ // Java source line #148 -> byte code offset #189 +/* */ // Java source line #152 -> byte code offset #200 +/* */ // Java source line #153 -> byte code offset #203 +/* */ // Java source line #155 -> byte code offset #211 +/* */ // Java source line #158 -> byte code offset #246 +/* */ // Java source line #152 -> byte code offset #255 +/* */ // Java source line #167 -> byte code offset #265 +/* */ // Java source line #168 -> byte code offset #269 +/* */ // Java source line #169 -> byte code offset #271 +/* */ // Java source line #170 -> byte code offset #275 +/* */ // Java source line #188 -> byte code offset #277 +/* */ // Java source line #191 -> byte code offset #285 +/* */ // Java source line #207 -> byte code offset #289 +/* */ // Java source line #209 -> byte code offset #293 +/* */ // Java source line #210 -> byte code offset #297 +/* */ // Java source line #213 -> byte code offset #302 +/* */ // Java source line #215 -> byte code offset #304 +/* */ // Java source line #217 -> byte code offset #308 +/* */ // Java source line #218 -> byte code offset #312 +/* */ // Java source line #221 -> byte code offset #317 +/* */ // Java source line #196 -> byte code offset #322 +/* */ // Java source line #197 -> byte code offset #323 +/* */ // Java source line #198 -> byte code offset #330 +/* */ // Java source line #203 -> byte code offset #338 +/* */ // Java source line #204 -> byte code offset #368 +/* */ // Java source line #205 -> byte code offset #374 +/* */ // Java source line #207 -> byte code offset #380 +/* */ // Java source line #209 -> byte code offset #384 +/* */ // Java source line #210 -> byte code offset #388 +/* */ // Java source line #213 -> byte code offset #393 +/* */ // Java source line #215 -> byte code offset #395 +/* */ // Java source line #217 -> byte code offset #399 +/* */ // Java source line #218 -> byte code offset #403 +/* */ // Java source line #221 -> byte code offset #408 +/* */ // Java source line #206 -> byte code offset #413 +/* */ // Java source line #207 -> byte code offset #415 +/* */ // Java source line #209 -> byte code offset #419 +/* */ // Java source line #210 -> byte code offset #423 +/* */ // Java source line #213 -> byte code offset #428 +/* */ // Java source line #215 -> byte code offset #430 +/* */ // Java source line #217 -> byte code offset #434 +/* */ // Java source line #218 -> byte code offset #438 +/* */ // Java source line #221 -> byte code offset #443 +/* */ // Java source line #223 -> byte code offset #445 +/* */ // Java source line #207 -> byte code offset #448 +/* */ // Java source line #209 -> byte code offset #452 +/* */ // Java source line #210 -> byte code offset #456 +/* */ // Java source line #213 -> byte code offset #461 +/* */ // Java source line #215 -> byte code offset #463 +/* */ // Java source line #217 -> byte code offset #467 +/* */ // Java source line #218 -> byte code offset #471 +/* */ // Java source line #221 -> byte code offset #476 +/* */ // Java source line #230 -> byte code offset #478 +/* */ // Java source line #231 -> byte code offset #492 +/* */ // Java source line #232 -> byte code offset #501 +/* */ // Java source line #233 -> byte code offset #505 +/* */ // Java source line #234 -> byte code offset #511 +/* */ // Java source line #233 -> byte code offset #546 +/* */ // Java source line #236 -> byte code offset #556 +/* */ // Java source line #242 -> byte code offset #586 +/* */ // Java source line #243 -> byte code offset #591 +/* */ // Java source line #244 -> byte code offset #596 +/* */ // Java source line #245 -> byte code offset #608 +/* */ // Java source line #246 -> byte code offset #612 +/* */ // Java source line #248 -> byte code offset #619 +/* */ // Java source line #249 -> byte code offset #629 +/* */ // Java source line #250 -> byte code offset #646 +/* */ // Java source line #252 -> byte code offset #654 +/* */ // Java source line #254 -> byte code offset #669 +/* */ // Java source line #255 -> byte code offset #682 +/* */ // Java source line #256 -> byte code offset #688 +/* */ // Java source line #257 -> byte code offset #693 +/* */ // Java source line #244 -> byte code offset #706 +/* */ // Java source line #263 -> byte code offset #715 +/* */ // Java source line #264 -> byte code offset #725 +/* */ // Java source line #263 -> byte code offset #746 +/* */ // Java source line #268 -> byte code offset #756 +/* */ // Java source line #269 -> byte code offset #768 +/* */ // Java source line #270 -> byte code offset #776 +/* */ // Java source line #271 -> byte code offset #780 +/* */ // Java source line #274 -> byte code offset #788 +/* */ // Java source line #275 -> byte code offset #799 +/* */ // Java source line #276 -> byte code offset #803 +/* */ // Local variable table: +/* */ // start length slot name signature +/* */ // 15 789 0 c Cache +/* */ // 17 461 1 in java.io.FileInputStream +/* */ // 19 444 2 s java.io.ObjectInputStream +/* */ // 56 78 3 fi File +/* */ // 288 1 3 localOptionalDataException java.io.OptionalDataException +/* */ // 322 5 3 e Exception +/* */ // 491 61 3 names String[] +/* */ // 151 3 4 version long +/* */ // 366 9 4 findex File +/* */ // 499 217 4 files Hashtable<String, String> +/* */ // 506 44 5 i int +/* */ // 603 104 5 p CacheEntry +/* */ // 720 27 5 e Enumeration<String> +/* */ // 766 15 5 f File +/* */ // 203 45 6 obj Object +/* */ // 260 3 6 obj Object +/* */ // 610 74 6 e CacheEntry +/* */ // 413 33 7 localObject1 Object +/* */ // 627 71 7 name String +/* */ // 300 1 8 localException1 Exception +/* */ // 315 1 8 localException2 Exception +/* */ // 391 1 8 localException3 Exception +/* */ // 406 1 8 localException4 Exception +/* */ // 426 1 8 localException5 Exception +/* */ // 441 1 8 localException6 Exception +/* */ // 459 1 8 localException7 Exception +/* */ // 474 1 8 localException8 Exception +/* */ // 644 45 8 isFile boolean +/* */ // Exception table: +/* */ // from to target type +/* */ // 20 285 288 java/io/OptionalDataException +/* */ // 293 297 300 java/lang/Exception +/* */ // 308 312 315 java/lang/Exception +/* */ // 20 285 322 java/lang/Exception +/* */ // 384 388 391 java/lang/Exception +/* */ // 399 403 406 java/lang/Exception +/* */ // 20 289 413 finally +/* */ // 322 380 413 finally +/* */ // 419 423 426 java/lang/Exception +/* */ // 434 438 441 java/lang/Exception +/* */ // 452 456 459 java/lang/Exception +/* */ // 467 471 474 java/lang/Exception +/* */ } +/* */ +/* */ public static CacheFile getFile(URL url, boolean forceRecheck) +/* */ { +/* 287 */ return cache.getAFile(url, forceRecheck); +/* */ } +/* */ +/* */ public static CacheFile getFile(URL url) { +/* 291 */ return cache.getAFile(url, false); +/* */ } +/* */ +/* */ public static CacheFile getFile(String url) { +/* 295 */ return cache.getAFile(URL.make(url), false); +/* */ } +/* */ +/* */ public static CacheEntry getEntry(URL url) { +/* 299 */ return cache.get(url); +/* */ } +/* */ +/* */ public static void removeEntry(CacheEntry ce) { +/* 303 */ cache.remove(ce); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static void InjectZipFile(File zipFile, String urlPrefix) +/* */ { +/* 313 */ long timeStamp = zipFile.lastModified(); +/* */ try +/* */ { +/* 316 */ ZipFile zf = new ZipFile(zipFile); +/* 317 */ System.out.println("Adding " + zf.size() + " entries from " + +/* 318 */ zipFile); +/* 319 */ Enumeration<?> e = zf.entries(); +/* 320 */ InputStream is; while (e.hasMoreElements()) { +/* 321 */ ZipEntry ze = (ZipEntry)e.nextElement(); +/* 322 */ is = zf.getInputStream(ze); +/* 323 */ URL remoteName = URL.make(urlPrefix + ze.getName()); +/* */ +/* */ +/* 326 */ CacheEntry ce = cache.get(remoteName); +/* 327 */ if (ce == null) +/* */ { +/* 329 */ String localName = assignLocalName(remoteName); +/* 330 */ FileOutputStream fos = new FileOutputStream(localName); +/* 331 */ byte[] buffer = new byte['က']; +/* */ try { +/* */ for (;;) { +/* 334 */ int bytesRead = is.read(buffer); +/* 335 */ if (bytesRead == -1) { +/* */ break; +/* */ } +/* 338 */ fos.write(buffer, 0, bytesRead); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 354 */ is.close(); +/* */ } +/* */ catch (IOException localIOException) +/* */ { +/* 343 */ fos.close(); +/* */ +/* */ +/* 346 */ ce = new CacheEntry(); +/* 347 */ ce.localName = new String(localName); +/* 348 */ ce.url = remoteName; +/* 349 */ ce.state = 4; +/* 350 */ ce.remoteTime = timeStamp; +/* 351 */ ce.checkTime = new Date(); +/* 352 */ cache.add(ce); +/* */ } +/* */ } +/* */ } +/* */ +/* 357 */ zf.close(); +/* */ +/* */ } +/* */ catch (Exception e) +/* */ { +/* */ +/* 363 */ System.out.println("Error processing cache zip file: " + e); +/* */ } +/* */ } +/* */ +/* */ private synchronized CacheFile getAFile(URL url, boolean forceRecheck) { +/* 368 */ CacheEntry e = null; +/* */ +/* */ +/* */ +/* 372 */ if (url.isRemote()) +/* */ { +/* 374 */ e = cache.get(url); +/* 375 */ if (e == null) +/* */ { +/* */ +/* 378 */ e = new CacheEntry(url); +/* 379 */ cache.add(e); +/* 380 */ } else if (forceRecheck) { +/* 381 */ e.forceRecheck(); +/* */ } +/* */ } +/* 384 */ return new CacheFile(url, e); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void mainCallback() {} +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void resyncIndex() +/* */ { +/* 398 */ if ((this.hasChanged >= CACHE_MIN_CHANGE) || (this.lastCacheSave.before(new Date(new Date().getTime() - CACHE_MAX_DELAY)))) { +/* 399 */ saveIndex(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public void saveIndex() +/* */ { +/* */ try +/* */ { +/* 409 */ System.out.println("Marking cache as open..."); +/* */ +/* */ +/* */ +/* 413 */ File fin = new File(CACHE_DIR + "cache.index.new"); +/* 414 */ FileOutputStream o = new FileOutputStream(fin); +/* 415 */ ObjectOutputStream s = new ObjectOutputStream(o); +/* 416 */ s.writeLong(0L); +/* 417 */ s.writeObject(this); +/* */ +/* */ +/* */ +/* 421 */ for (CacheEntry e = this.terminator.next; e != this.terminator; e = e.next) { +/* 422 */ if ((e.url != null) && (e.localName != null)) { +/* 423 */ s.writeObject(e); +/* */ } +/* */ } +/* */ +/* */ +/* 428 */ s.writeInt(0); +/* */ +/* 430 */ s.flush(); +/* 431 */ s.close(); +/* 432 */ o.close(); +/* 433 */ this.lastCacheSave = new Date(); +/* 434 */ this.hasChanged = 0; +/* */ +/* 436 */ System.out.println("Marking cache as closed..."); +/* 437 */ File fi = new File(CACHE_DIR + "cache.index"); +/* 438 */ File fio = new File(CACHE_DIR + "cache.index.old"); +/* 439 */ fi.renameTo(fio); +/* 440 */ fin.renameTo(fi); +/* 441 */ fio.delete(); +/* */ } +/* */ catch (Exception e) { +/* 444 */ System.out.println("Error writing cache index: " + e); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void terminalCallback() +/* */ { +/* 453 */ Main.unregister(this); +/* */ +/* 455 */ saveIndex(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ static String assignLocalName(URL url) +/* */ { +/* 466 */ String remoteName = url.unalias(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 473 */ String ext = ".temp"; +/* 474 */ int lastDot = remoteName.lastIndexOf('.'); +/* 475 */ if ((lastDot > remoteName.lastIndexOf('/')) && +/* 476 */ (remoteName.indexOf("?", lastDot) < 0) && +/* 477 */ (remoteName.indexOf("#", lastDot) < 0)) { +/* 478 */ ext = remoteName.substring(lastDot); +/* */ } +/* */ +/* */ +/* 482 */ if (url.endsWith(".gr2")) { +/* 483 */ return CACHE_DIR + url.getBase(); +/* */ } +/* 485 */ return CACHE_DIR + Integer.toString(cache.nextAvailable++, 36) + ext; +/* */ } +/* */ +/* */ public synchronized void add(CacheEntry e) +/* */ { +/* 490 */ this.table.put(e.url, e); +/* 491 */ CacheEntry p = this.terminator.prev; +/* 492 */ p.next = e; +/* 493 */ e.prev = p; +/* 494 */ e.next = this.terminator; +/* 495 */ this.terminator.prev = e; +/* 496 */ this.hasChanged += 1; +/* */ } +/* */ +/* */ public int numEntries() +/* */ { +/* 501 */ return this.table.size(); +/* */ } +/* */ +/* */ +/* */ public synchronized CacheEntry get(URL url) +/* */ { +/* 507 */ CacheEntry e = (CacheEntry)this.table.get(url); +/* */ +/* */ +/* 510 */ if (e != null) { +/* 511 */ markUsed(e); +/* */ } +/* */ +/* 514 */ return e; +/* */ } +/* */ +/* */ +/* */ private void markUsed(CacheEntry e) +/* */ { +/* 520 */ if ((e == null) || (e.next == this.terminator)) +/* */ { +/* 522 */ return; +/* */ } +/* 524 */ e.prev.next = e.next; +/* 525 */ e.next.prev = e.prev; +/* 526 */ this.terminator.prev.next = e; +/* 527 */ e.prev = this.terminator.prev; +/* 528 */ e.next = this.terminator; +/* 529 */ this.terminator.prev = e; +/* */ } +/* */ +/* */ +/* */ public void remove(CacheEntry e) +/* */ { +/* 535 */ this.totalBytes -= e.bytes; +/* 536 */ e.prev.next = e.next; +/* 537 */ e.next.prev = e.prev; +/* 538 */ e.prev = null; +/* 539 */ e.next = null; +/* 540 */ this.table.remove(e.url); +/* 541 */ this.hasChanged += 1; +/* */ +/* 543 */ new File(e.localName.toUpperCase()).delete(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private CacheEntry freeLRU() +/* */ { +/* 554 */ for (CacheEntry e = this.terminator.next; e != this.terminator; e = e.next) { +/* 555 */ if (!e.inUse()) { +/* 556 */ remove(e); +/* 557 */ return e; +/* */ } +/* */ } +/* 560 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void makeSpaceFor(int incomingSize) +/* */ { +/* 570 */ while (cache.numEntries() > CacheEntry.CACHE_MAX_ENTRIES) { +/* 571 */ if (freeLRU() == null) { +/* */ break; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 580 */ while ((this.totalBytes + 2L * incomingSize) / 1024L > +/* 581 */ Std.GetDiskFreeSpace()) +/* */ { +/* 583 */ if (Std.GetDiskFreeSpace() <= -1L) { +/* */ break; +/* */ } +/* */ +/* 587 */ CacheEntry freed = freeLRU(); +/* 588 */ if (freed == null) { +/* */ break; +/* */ } +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\Cache.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/CacheEntry.java b/NET/worlds/network/CacheEntry.java new file mode 100644 index 0000000..0854eaf --- /dev/null +++ b/NET/worlds/network/CacheEntry.java @@ -0,0 +1,1270 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.core.IniFile; +/* */ import java.io.FileNotFoundException; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.io.Serializable; +/* */ import java.net.HttpURLConnection; +/* */ import java.net.MalformedURLException; +/* */ import java.net.URLConnection; +/* */ import java.net.UnknownHostException; +/* */ import java.util.Date; +/* */ import java.util.Observer; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class CacheEntry +/* */ implements Runnable, Serializable +/* */ { +/* */ private static final long serialVersionUID = 4845526825815464122L; +/* 57 */ static boolean httpFaulted = (IniFile.override().getIniInt("Offline", 0) == 1) || +/* 58 */ (IniFile.gamma().getIniInt("Offline", 0) == 1); +/* */ +/* 60 */ static boolean stopOnFault = IniFile.gamma().getIniInt("StopOnHttpFault", +/* 61 */ 0) == 1; +/* */ +/* */ +/* 64 */ static final int CACHE_MAX_ENTRIES = IniFile.gamma().getIniInt( +/* 65 */ "NetCacheEntries", 1000); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 71 */ static final int MAX_THREADS = IniFile.gamma().getIniInt("NetCacheThreads", +/* 72 */ 2); +/* */ +/* */ +/* */ +/* */ +/* 77 */ static final long CACHE_MOD_TIMEOUT = 3600000L * IniFile.gamma() +/* 78 */ .getIniInt("NetCacheModifiedCheck", 8); +/* */ +/* */ +/* */ +/* */ +/* 83 */ static final long CACHE_MOD_TIMEDELAY = 60000L * IniFile.gamma() +/* 84 */ .getIniInt("NetCacheDelay", 5); +/* */ +/* 86 */ static final Date refreshStartDate = new Date(new Date().getTime() + CACHE_MOD_TIMEDELAY); +/* */ +/* 88 */ static Vector<CacheEntry> threadQueue = new Vector(); +/* */ +/* */ public static final int START = 0; +/* */ +/* */ public static final int REFRESHING = 2; +/* */ +/* */ public static final int LOADING = 3; +/* */ +/* */ public static final int DONE = 4; +/* */ +/* */ public static final int ERROR = 5; +/* */ +/* */ public static final int NOSUCHFILE = 6; +/* */ +/* */ public static final int LOADED = 7; +/* */ +/* */ public transient CacheEntry next; +/* */ +/* */ public transient CacheEntry prev; +/* */ +/* */ int state; +/* */ +/* */ private transient int count; +/* */ +/* */ URL url; +/* */ +/* */ transient int lastRefTime; +/* */ transient String encoding; +/* */ String localName; +/* */ transient Vector<Observer> observers; +/* 118 */ public long remoteTime = 0L; +/* */ public Date checkTime; +/* 120 */ public int netSize = -1; +/* */ +/* */ public int bytes; +/* */ +/* */ private transient CacheEntry nextDec; +/* */ +/* 126 */ private static CacheEntry endDec = new CacheEntry(); +/* 127 */ private static CacheEntry baseDec = endDec; +/* */ +/* */ +/* 130 */ static int refTime = 0; +/* 131 */ static int numActiveThreads = 0; +/* */ +/* */ public static int getConcurrentDownloads() { +/* 134 */ return numActiveThreads; +/* */ } +/* */ +/* */ public static synchronized void setOffline() { +/* 138 */ stopOnFault = httpFaulted = 1; +/* */ } +/* */ +/* */ public static boolean getOffline() { +/* 142 */ return httpFaulted; +/* */ } +/* */ +/* */ +/* */ +/* */ public boolean inUse() +/* */ { +/* 149 */ return (this.count > 0) || (this.state == 3) || (this.state == 2); +/* */ } +/* */ +/* */ +/* */ +/* */ private synchronized void setState(int val) +/* */ { +/* 156 */ this.state = val; +/* 157 */ if (val >= 4) { +/* 158 */ notifyAll(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ boolean done() +/* */ { +/* 166 */ return this.state >= 4; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ CacheEntry() +/* */ { +/* 174 */ this.next = this; +/* 175 */ this.prev = this; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ CacheEntry(URL u) +/* */ { +/* 189 */ this.url = u; +/* */ +/* 191 */ this.localName = Cache.assignLocalName(u); +/* */ +/* */ +/* 194 */ setState(0); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void incRef() +/* */ { +/* 205 */ synchronized (finalizeSafeLock) { +/* 206 */ this.count += 1; +/* */ } +/* 208 */ if (this.count == 1) { +/* 209 */ load(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* 215 */ private static Object finalizeSafeLock = new Object(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void safeDecRef() +/* */ { +/* 242 */ synchronized (finalizeSafeLock) +/* */ { +/* */ +/* */ +/* 246 */ if (this.nextDec == null) +/* */ { +/* 248 */ this.nextDec = baseDec; +/* 249 */ baseDec = this; +/* */ } else { +/* 251 */ this.count -= 1; +/* 252 */ this.lastRefTime = (refTime++); +/* */ } +/* */ } +/* */ } +/* */ +/* */ synchronized void fullDecRef() { +/* 258 */ notifyAll(); +/* 259 */ synchronized (Cache.cache) { +/* 260 */ synchronized (finalizeSafeLock) { +/* 261 */ this.count -= 1; +/* 262 */ this.lastRefTime = (refTime++); +/* */ } +/* */ +/* */ +/* */ +/* 267 */ if ((this.count == 0) && (this.remoteTime <= 0L) && (this.state == 7)) { +/* 268 */ Cache.cache.remove(this); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ void addObserver(Observer o) +/* */ { +/* 278 */ if (this.state >= 4) { +/* 279 */ o.update(null, this.url); +/* */ } else { +/* 281 */ synchronized (this) { +/* 282 */ if (this.observers == null) { +/* 283 */ this.observers = new Vector(); +/* */ } +/* 285 */ this.observers.addElement(o); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void notifyObservers() +/* */ { +/* 296 */ synchronized (this) { +/* 297 */ Vector<Observer> v = this.observers; +/* 298 */ this.observers = null; +/* */ } +/* */ Vector<Observer> v; +/* 301 */ if (v != null) { +/* 302 */ int len = v.size(); +/* 303 */ for (int i = 0; i < len; i++) { +/* 304 */ ((Observer)v.elementAt(i)).update(null, this.url); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ URLConnection openURL() +/* */ throws Exception +/* */ { +/* 313 */ int retryCount = IniFile.gamma().getIniInt("NetCacheRetries", 8); +/* 314 */ java.net.URL u = null; +/* 315 */ URLConnection uc = null; +/* */ +/* 317 */ while (!httpFaulted) { +/* */ try { +/* 319 */ if (u == null) { +/* 320 */ String us = this.url.unalias(); +/* */ +/* */ +/* 323 */ if (us.endsWith("upgrades.lst")) { +/* 324 */ us = us + "?" + (int)(Math.random() * 1000000.0D); +/* */ } +/* 326 */ u = DNSLookup.lookup(new java.net.URL(us)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 339 */ uc = u.openConnection(); +/* */ +/* */ +/* 342 */ uc.setRequestProperty("Accept-Encoding", "gzip,deflate"); +/* */ +/* */ +/* 345 */ if ((this.remoteTime > 0L) && (this.bytes > 0)) { +/* 346 */ uc.setIfModifiedSince(this.remoteTime); +/* */ } +/* */ +/* */ +/* */ +/* 351 */ uc.connect(); +/* */ +/* 353 */ this.encoding = uc.getContentEncoding(); +/* 354 */ if (this.encoding == null) { +/* 355 */ this.encoding = new String("none"); +/* */ } +/* */ +/* */ +/* 359 */ this.remoteTime = uc.getLastModified(); +/* 360 */ this.netSize = uc.getContentLength(); +/* */ +/* 362 */ return uc; +/* */ } catch (UnknownHostException uhe) { +/* 364 */ if ((NetUpdate.isInternalVersion()) || (stopOnFault)) { +/* 365 */ httpFaulted = true; +/* */ } +/* 367 */ throw uhe; +/* */ } catch (IOException e) { +/* 369 */ retryCount--; +/* */ +/* 371 */ if (wasHttpNoSuchFile(e, uc)) { +/* 372 */ throw new FileNotFoundException("Http " + this.url); +/* */ } +/* */ +/* 375 */ if ((retryCount <= 0) || ((e instanceof MalformedURLException))) +/* 376 */ throw e; +/* 377 */ if (this.state == 2) { +/* 378 */ throw e; +/* */ } +/* 380 */ System.out.println("Exception " + e + " opening " + this.url + +/* 381 */ ", retrying..."); +/* */ } +/* */ } +/* */ +/* 385 */ throw new FileNotFoundException("Http " + this.url); +/* */ } +/* */ +/* */ private static boolean wasHttpNoSuchFile(Exception e, URLConnection uc) { +/* */ try { +/* 390 */ if (((HttpURLConnection)uc).getResponseCode() == 404) { +/* 391 */ return true; +/* */ } +/* */ } +/* */ catch (Exception localException) {} +/* 395 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ public void forceRecheck() +/* */ { +/* 402 */ this.checkTime = null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void load() +/* */ { +/* 413 */ if ((this.state == 2) || (this.state == 3)) { +/* 414 */ return; +/* */ } +/* */ +/* 417 */ Date now = new Date(); +/* */ +/* 419 */ if ((this.state == 5) || (this.state == 0)) { +/* 420 */ setState(3); +/* 421 */ } else if (this.localName != null) +/* */ { +/* */ +/* 424 */ if ((this.checkTime != null) && (now.before(refreshStartDate))) +/* */ { +/* 426 */ notifyObservers(); +/* 427 */ return; +/* */ } +/* */ +/* 430 */ Date aWhileAgo = new Date(now.getTime() - CACHE_MOD_TIMEOUT); +/* 431 */ if ((this.checkTime != null) && (this.checkTime.after(aWhileAgo))) +/* */ { +/* 433 */ if ((this.remoteTime > 0L) || (this.state == 6)) { +/* 434 */ notifyObservers(); +/* 435 */ return; +/* */ } +/* */ } +/* 438 */ setState(2); +/* */ } +/* 440 */ this.checkTime = now; +/* */ +/* 442 */ synchronized (threadQueue) +/* */ { +/* 444 */ if (numActiveThreads < MAX_THREADS) { +/* 445 */ startThread(); +/* */ } +/* */ else +/* */ { +/* 449 */ threadQueue.addElement(this); +/* */ } +/* */ } +/* */ } +/* */ +/* 454 */ private static int nextDownloader = 0; +/* */ +/* */ +/* */ +/* */ +/* */ private void startThread() +/* */ { +/* 461 */ numActiveThreads += 1; +/* 462 */ Thread t = new Thread(this, "File Downloader " + ++nextDownloader); +/* 463 */ t.setDaemon(true); +/* 464 */ t.start(); +/* */ } +/* */ +/* */ /* Error */ +/* */ public void run() +/* */ { +/* */ // Byte code: +/* */ // 0: aconst_null +/* */ // 1: astore_1 +/* */ // 2: aconst_null +/* */ // 3: astore_2 +/* */ // 4: aload_0 +/* */ // 5: getfield 165 NET/worlds/network/CacheEntry:remoteTime J +/* */ // 8: lstore_3 +/* */ // 9: aload_0 +/* */ // 10: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 13: istore 5 +/* */ // 15: aload_0 +/* */ // 16: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 19: istore 6 +/* */ // 21: aload_0 +/* */ // 22: getfield 155 NET/worlds/network/CacheEntry:state I +/* */ // 25: iconst_2 +/* */ // 26: if_icmpne +405 -> 431 +/* */ // 29: invokestatic 418 NET/worlds/network/CacheEntry:getOffline ()Z +/* */ // 32: ifeq +45 -> 77 +/* */ // 35: aload_0 +/* */ // 36: bipush 7 +/* */ // 38: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 41: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 44: dup +/* */ // 45: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 48: aload_0 +/* */ // 49: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 52: i2l +/* */ // 53: ladd +/* */ // 54: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 57: aload_0 +/* */ // 58: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 61: ifgt +11 -> 72 +/* */ // 64: aload_0 +/* */ // 65: aload_0 +/* */ // 66: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 69: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 72: aload_0 +/* */ // 73: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 76: return +/* */ // 77: aload_0 +/* */ // 78: getfield 174 NET/worlds/network/CacheEntry:url LNET/worlds/network/URL; +/* */ // 81: invokestatic 426 NET/worlds/network/DirTimeStamp:request (LNET/worlds/network/URL;)J +/* */ // 84: lstore 7 +/* */ // 86: lload 7 +/* */ // 88: lconst_0 +/* */ // 89: lcmp +/* */ // 90: ifle +71 -> 161 +/* */ // 93: lload 7 +/* */ // 95: lload_3 +/* */ // 96: lcmp +/* */ // 97: ifgt +64 -> 161 +/* */ // 100: new 111 java/util/Date +/* */ // 103: dup +/* */ // 104: invokespecial 113 java/util/Date:<init> ()V +/* */ // 107: invokevirtual 116 java/util/Date:getTime ()J +/* */ // 110: lload_3 +/* */ // 111: lcmp +/* */ // 112: ifge +49 -> 161 +/* */ // 115: aload_0 +/* */ // 116: bipush 7 +/* */ // 118: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 121: aload_0 +/* */ // 122: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 125: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 128: dup +/* */ // 129: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 132: aload_0 +/* */ // 133: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 136: i2l +/* */ // 137: ladd +/* */ // 138: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 141: aload_0 +/* */ // 142: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 145: ifgt +11 -> 156 +/* */ // 148: aload_0 +/* */ // 149: aload_0 +/* */ // 150: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 153: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 156: aload_0 +/* */ // 157: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 160: return +/* */ // 161: aload_0 +/* */ // 162: invokevirtual 432 NET/worlds/network/CacheEntry:openURL ()Ljava/net/URLConnection; +/* */ // 165: astore_2 +/* */ // 166: aload_0 +/* */ // 167: getfield 165 NET/worlds/network/CacheEntry:remoteTime J +/* */ // 170: lconst_0 +/* */ // 171: lcmp +/* */ // 172: ifle +106 -> 278 +/* */ // 175: aload_0 +/* */ // 176: getfield 165 NET/worlds/network/CacheEntry:remoteTime J +/* */ // 179: lload_3 +/* */ // 180: lcmp +/* */ // 181: ifgt +97 -> 278 +/* */ // 184: iload 5 +/* */ // 186: iconst_m1 +/* */ // 187: if_icmpeq +29 -> 216 +/* */ // 190: aload_0 +/* */ // 191: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 194: iconst_m1 +/* */ // 195: if_icmpeq +21 -> 216 +/* */ // 198: iload 5 +/* */ // 200: aload_0 +/* */ // 201: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 204: if_icmpeq +12 -> 216 +/* */ // 207: aload_0 +/* */ // 208: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 211: iload 6 +/* */ // 213: if_icmpne +65 -> 278 +/* */ // 216: aload_2 +/* */ // 217: invokevirtual 434 java/net/URLConnection:getInputStream ()Ljava/io/InputStream; +/* */ // 220: astore 9 +/* */ // 222: aload 9 +/* */ // 224: ifnull +8 -> 232 +/* */ // 227: aload 9 +/* */ // 229: invokevirtual 438 java/io/InputStream:close ()V +/* */ // 232: aload_0 +/* */ // 233: bipush 7 +/* */ // 235: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 238: aload_0 +/* */ // 239: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 242: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 245: dup +/* */ // 246: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 249: aload_0 +/* */ // 250: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 253: i2l +/* */ // 254: ladd +/* */ // 255: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 258: aload_0 +/* */ // 259: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 262: ifgt +11 -> 273 +/* */ // 265: aload_0 +/* */ // 266: aload_0 +/* */ // 267: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 270: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 273: aload_0 +/* */ // 274: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 277: return +/* */ // 278: aload_2 +/* */ // 279: instanceof 378 +/* */ // 282: ifeq +144 -> 426 +/* */ // 285: aload_2 +/* */ // 286: checkcast 378 java/net/HttpURLConnection +/* */ // 289: invokevirtual 380 java/net/HttpURLConnection:getResponseCode ()I +/* */ // 292: istore 9 +/* */ // 294: iconst_0 +/* */ // 295: istore 10 +/* */ // 297: iload 9 +/* */ // 299: lookupswitch default:+60->359, 304:+57->356, 400:+57->356, 500:+57->356, 502:+57->356, 503:+57->356, 504:+57->356 +/* */ // 356: iconst_1 +/* */ // 357: istore 10 +/* */ // 359: iload 10 +/* */ // 361: ifeq +65 -> 426 +/* */ // 364: aload_2 +/* */ // 365: invokevirtual 434 java/net/URLConnection:getInputStream ()Ljava/io/InputStream; +/* */ // 368: astore 11 +/* */ // 370: aload 11 +/* */ // 372: ifnull +8 -> 380 +/* */ // 375: aload 11 +/* */ // 377: invokevirtual 438 java/io/InputStream:close ()V +/* */ // 380: aload_0 +/* */ // 381: bipush 7 +/* */ // 383: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 386: aload_0 +/* */ // 387: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 390: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 393: dup +/* */ // 394: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 397: aload_0 +/* */ // 398: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 401: i2l +/* */ // 402: ladd +/* */ // 403: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 406: aload_0 +/* */ // 407: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 410: ifgt +11 -> 421 +/* */ // 413: aload_0 +/* */ // 414: aload_0 +/* */ // 415: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 418: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 421: aload_0 +/* */ // 422: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 425: return +/* */ // 426: aload_0 +/* */ // 427: iconst_3 +/* */ // 428: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 431: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 434: dup +/* */ // 435: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 438: aload_0 +/* */ // 439: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 442: i2l +/* */ // 443: lsub +/* */ // 444: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 447: iconst_0 +/* */ // 448: istore 7 +/* */ // 450: goto +430 -> 880 +/* */ // 453: aload_0 +/* */ // 454: iconst_0 +/* */ // 455: putfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 458: aconst_null +/* */ // 459: astore_1 +/* */ // 460: aload_2 +/* */ // 461: ifnonnull +12 -> 473 +/* */ // 464: aload_0 +/* */ // 465: invokevirtual 432 NET/worlds/network/CacheEntry:openURL ()Ljava/net/URLConnection; +/* */ // 468: astore_2 +/* */ // 469: aload_2 +/* */ // 470: invokevirtual 312 java/net/URLConnection:connect ()V +/* */ // 473: aload_2 +/* */ // 474: instanceof 378 +/* */ // 477: ifeq +165 -> 642 +/* */ // 480: aload_2 +/* */ // 481: checkcast 378 java/net/HttpURLConnection +/* */ // 484: invokevirtual 380 java/net/HttpURLConnection:getResponseCode ()I +/* */ // 487: istore 8 +/* */ // 489: iconst_0 +/* */ // 490: istore 9 +/* */ // 492: iload 8 +/* */ // 494: lookupswitch default:+53->547, 304:+50->544, 500:+50->544, 502:+50->544, 503:+50->544, 504:+50->544 +/* */ // 544: iconst_1 +/* */ // 545: istore 9 +/* */ // 547: iload 9 +/* */ // 549: ifeq +93 -> 642 +/* */ // 552: aload_2 +/* */ // 553: invokevirtual 434 java/net/URLConnection:getInputStream ()Ljava/io/InputStream; +/* */ // 556: astore 10 +/* */ // 558: aload 10 +/* */ // 560: ifnull +8 -> 568 +/* */ // 563: aload 10 +/* */ // 565: invokevirtual 438 java/io/InputStream:close ()V +/* */ // 568: aload_0 +/* */ // 569: iload 6 +/* */ // 571: putfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 574: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 577: dup +/* */ // 578: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 581: aload_0 +/* */ // 582: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 585: i2l +/* */ // 586: ladd +/* */ // 587: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 590: aload_0 +/* */ // 591: iload 5 +/* */ // 593: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 596: aload_0 +/* */ // 597: bipush 7 +/* */ // 599: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 602: aload_0 +/* */ // 603: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 606: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 609: dup +/* */ // 610: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 613: aload_0 +/* */ // 614: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 617: i2l +/* */ // 618: ladd +/* */ // 619: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 622: aload_0 +/* */ // 623: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 626: ifgt +11 -> 637 +/* */ // 629: aload_0 +/* */ // 630: aload_0 +/* */ // 631: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 634: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 637: aload_0 +/* */ // 638: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 641: return +/* */ // 642: aload_0 +/* */ // 643: getfield 318 NET/worlds/network/CacheEntry:encoding Ljava/lang/String; +/* */ // 646: ifnull +32 -> 678 +/* */ // 649: aload_0 +/* */ // 650: getfield 318 NET/worlds/network/CacheEntry:encoding Ljava/lang/String; +/* */ // 653: ldc_w 443 +/* */ // 656: invokevirtual 445 java/lang/String:equalsIgnoreCase (Ljava/lang/String;)Z +/* */ // 659: ifeq +19 -> 678 +/* */ // 662: new 448 java/util/zip/GZIPInputStream +/* */ // 665: dup +/* */ // 666: aload_2 +/* */ // 667: invokevirtual 434 java/net/URLConnection:getInputStream ()Ljava/io/InputStream; +/* */ // 670: invokespecial 450 java/util/zip/GZIPInputStream:<init> (Ljava/io/InputStream;)V +/* */ // 673: astore 8 +/* */ // 675: goto +53 -> 728 +/* */ // 678: aload_0 +/* */ // 679: getfield 318 NET/worlds/network/CacheEntry:encoding Ljava/lang/String; +/* */ // 682: ifnull +40 -> 722 +/* */ // 685: aload_0 +/* */ // 686: getfield 318 NET/worlds/network/CacheEntry:encoding Ljava/lang/String; +/* */ // 689: ldc_w 453 +/* */ // 692: invokevirtual 445 java/lang/String:equalsIgnoreCase (Ljava/lang/String;)Z +/* */ // 695: ifeq +27 -> 722 +/* */ // 698: new 455 java/util/zip/InflaterInputStream +/* */ // 701: dup +/* */ // 702: aload_2 +/* */ // 703: invokevirtual 434 java/net/URLConnection:getInputStream ()Ljava/io/InputStream; +/* */ // 706: new 457 java/util/zip/Inflater +/* */ // 709: dup +/* */ // 710: iconst_1 +/* */ // 711: invokespecial 459 java/util/zip/Inflater:<init> (Z)V +/* */ // 714: invokespecial 461 java/util/zip/InflaterInputStream:<init> (Ljava/io/InputStream;Ljava/util/zip/Inflater;)V +/* */ // 717: astore 8 +/* */ // 719: goto +9 -> 728 +/* */ // 722: aload_2 +/* */ // 723: invokevirtual 434 java/net/URLConnection:getInputStream ()Ljava/io/InputStream; +/* */ // 726: astore 8 +/* */ // 728: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 731: aload_0 +/* */ // 732: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 735: invokevirtual 464 NET/worlds/network/Cache:makeSpaceFor (I)V +/* */ // 738: new 467 java/io/FileOutputStream +/* */ // 741: dup +/* */ // 742: aload_0 +/* */ // 743: getfield 182 NET/worlds/network/CacheEntry:localName Ljava/lang/String; +/* */ // 746: invokespecial 469 java/io/FileOutputStream:<init> (Ljava/lang/String;)V +/* */ // 749: astore_1 +/* */ // 750: sipush 4096 +/* */ // 753: newarray <illegal type> +/* */ // 755: astore 9 +/* */ // 757: goto +23 -> 780 +/* */ // 760: aload_1 +/* */ // 761: aload 9 +/* */ // 763: iconst_0 +/* */ // 764: iload 10 +/* */ // 766: invokevirtual 470 java/io/FileOutputStream:write ([BII)V +/* */ // 769: aload_0 +/* */ // 770: dup +/* */ // 771: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 774: iload 10 +/* */ // 776: iadd +/* */ // 777: putfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 780: aload 8 +/* */ // 782: aload 9 +/* */ // 784: invokevirtual 474 java/io/InputStream:read ([B)I +/* */ // 787: dup +/* */ // 788: istore 10 +/* */ // 790: ifgt -30 -> 760 +/* */ // 793: aload 8 +/* */ // 795: invokevirtual 438 java/io/InputStream:close ()V +/* */ // 798: aconst_null +/* */ // 799: astore 8 +/* */ // 801: aload_1 +/* */ // 802: invokevirtual 478 java/io/FileOutputStream:close ()V +/* */ // 805: aconst_null +/* */ // 806: astore_1 +/* */ // 807: aload_0 +/* */ // 808: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 811: iconst_m1 +/* */ // 812: if_icmpeq +40 -> 852 +/* */ // 815: aload_0 +/* */ // 816: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 819: aload_0 +/* */ // 820: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 823: if_icmpge +29 -> 852 +/* */ // 826: aload_0 +/* */ // 827: getfield 318 NET/worlds/network/CacheEntry:encoding Ljava/lang/String; +/* */ // 830: ldc_w 443 +/* */ // 833: invokevirtual 445 java/lang/String:equalsIgnoreCase (Ljava/lang/String;)Z +/* */ // 836: ifne +16 -> 852 +/* */ // 839: aload_0 +/* */ // 840: getfield 318 NET/worlds/network/CacheEntry:encoding Ljava/lang/String; +/* */ // 843: ldc_w 453 +/* */ // 846: invokevirtual 445 java/lang/String:equalsIgnoreCase (Ljava/lang/String;)Z +/* */ // 849: ifeq +12 -> 861 +/* */ // 852: aload_0 +/* */ // 853: bipush 7 +/* */ // 855: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 858: goto +28 -> 886 +/* */ // 861: iload 7 +/* */ // 863: ifne +12 -> 875 +/* */ // 866: getstatic 348 java/lang/System:out Ljava/io/PrintStream; +/* */ // 869: ldc_w 479 +/* */ // 872: invokevirtual 360 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 875: aconst_null +/* */ // 876: astore_2 +/* */ // 877: iinc 7 1 +/* */ // 880: iload 7 +/* */ // 882: iconst_2 +/* */ // 883: if_icmplt -430 -> 453 +/* */ // 886: aload_0 +/* */ // 887: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 890: iflt +87 -> 977 +/* */ // 893: aload_0 +/* */ // 894: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 897: aload_0 +/* */ // 898: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 901: if_icmpge +76 -> 977 +/* */ // 904: aload_0 +/* */ // 905: getfield 318 NET/worlds/network/CacheEntry:encoding Ljava/lang/String; +/* */ // 908: ldc_w 443 +/* */ // 911: invokevirtual 445 java/lang/String:equalsIgnoreCase (Ljava/lang/String;)Z +/* */ // 914: ifne +63 -> 977 +/* */ // 917: aload_0 +/* */ // 918: getfield 318 NET/worlds/network/CacheEntry:encoding Ljava/lang/String; +/* */ // 921: ldc_w 453 +/* */ // 924: invokevirtual 445 java/lang/String:equalsIgnoreCase (Ljava/lang/String;)Z +/* */ // 927: ifne +50 -> 977 +/* */ // 930: new 481 java/lang/InterruptedException +/* */ // 933: dup +/* */ // 934: new 256 java/lang/StringBuilder +/* */ // 937: dup +/* */ // 938: ldc_w 483 +/* */ // 941: invokespecial 262 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 944: aload_0 +/* */ // 945: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 948: invokevirtual 279 java/lang/StringBuilder:append (I)Ljava/lang/StringBuilder; +/* */ // 951: ldc_w 485 +/* */ // 954: invokevirtual 267 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 957: aload_0 +/* */ // 958: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 961: invokevirtual 279 java/lang/StringBuilder:append (I)Ljava/lang/StringBuilder; +/* */ // 964: ldc_w 487 +/* */ // 967: invokevirtual 267 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 970: invokevirtual 282 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 973: invokespecial 489 java/lang/InterruptedException:<init> (Ljava/lang/String;)V +/* */ // 976: athrow +/* */ // 977: iload 7 +/* */ // 979: ifle +12 -> 991 +/* */ // 982: getstatic 348 java/lang/System:out Ljava/io/PrintStream; +/* */ // 985: ldc_w 490 +/* */ // 988: invokevirtual 360 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 991: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 994: dup +/* */ // 995: getfield 492 NET/worlds/network/Cache:hasChanged I +/* */ // 998: iconst_1 +/* */ // 999: iadd +/* */ // 1000: putfield 492 NET/worlds/network/Cache:hasChanged I +/* */ // 1003: aload_0 +/* */ // 1004: bipush 7 +/* */ // 1006: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 1009: goto +256 -> 1265 +/* */ // 1012: astore_3 +/* */ // 1013: getstatic 348 java/lang/System:out Ljava/io/PrintStream; +/* */ // 1016: new 256 java/lang/StringBuilder +/* */ // 1019: dup +/* */ // 1020: ldc_w 495 +/* */ // 1023: invokespecial 262 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 1026: aload_0 +/* */ // 1027: getfield 174 NET/worlds/network/CacheEntry:url LNET/worlds/network/URL; +/* */ // 1030: invokevirtual 342 java/lang/StringBuilder:append (Ljava/lang/Object;)Ljava/lang/StringBuilder; +/* */ // 1033: invokevirtual 282 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 1036: invokevirtual 360 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 1039: getstatic 348 java/lang/System:out Ljava/io/PrintStream; +/* */ // 1042: new 256 java/lang/StringBuilder +/* */ // 1045: dup +/* */ // 1046: ldc_w 497 +/* */ // 1049: invokespecial 262 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 1052: aload_3 +/* */ // 1053: invokevirtual 499 java/lang/Exception:getMessage ()Ljava/lang/String; +/* */ // 1056: invokevirtual 267 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 1059: invokevirtual 282 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 1062: invokevirtual 360 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 1065: getstatic 348 java/lang/System:out Ljava/io/PrintStream; +/* */ // 1068: new 256 java/lang/StringBuilder +/* */ // 1071: dup +/* */ // 1072: ldc_w 497 +/* */ // 1075: invokespecial 262 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 1078: aload_3 +/* */ // 1079: invokevirtual 502 java/lang/Exception:toString ()Ljava/lang/String; +/* */ // 1082: invokevirtual 267 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 1085: invokevirtual 282 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 1088: invokevirtual 360 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 1091: aload_1 +/* */ // 1092: ifnull +27 -> 1119 +/* */ // 1095: aload_1 +/* */ // 1096: invokevirtual 478 java/io/FileOutputStream:close ()V +/* */ // 1099: goto +5 -> 1104 +/* */ // 1102: astore 4 +/* */ // 1104: new 503 java/io/File +/* */ // 1107: dup +/* */ // 1108: aload_0 +/* */ // 1109: getfield 182 NET/worlds/network/CacheEntry:localName Ljava/lang/String; +/* */ // 1112: invokespecial 505 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 1115: invokevirtual 506 java/io/File:delete ()Z +/* */ // 1118: pop +/* */ // 1119: aload_3 +/* */ // 1120: aload_2 +/* */ // 1121: invokestatic 334 NET/worlds/network/CacheEntry:wasHttpNoSuchFile (Ljava/lang/Exception;Ljava/net/URLConnection;)Z +/* */ // 1124: ifne +10 -> 1134 +/* */ // 1127: aload_3 +/* */ // 1128: instanceof 338 +/* */ // 1131: ifeq +17 -> 1148 +/* */ // 1134: aload_0 +/* */ // 1135: bipush 6 +/* */ // 1137: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 1140: aload_0 +/* */ // 1141: iconst_0 +/* */ // 1142: putfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 1145: goto +42 -> 1187 +/* */ // 1148: aload_0 +/* */ // 1149: getfield 155 NET/worlds/network/CacheEntry:state I +/* */ // 1152: iconst_2 +/* */ // 1153: if_icmpne +24 -> 1177 +/* */ // 1156: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 1159: dup +/* */ // 1160: getfield 492 NET/worlds/network/Cache:hasChanged I +/* */ // 1163: iconst_1 +/* */ // 1164: iadd +/* */ // 1165: putfield 492 NET/worlds/network/Cache:hasChanged I +/* */ // 1168: aload_0 +/* */ // 1169: bipush 7 +/* */ // 1171: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 1174: goto +13 -> 1187 +/* */ // 1177: aload_0 +/* */ // 1178: iconst_0 +/* */ // 1179: putfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 1182: aload_0 +/* */ // 1183: iconst_5 +/* */ // 1184: invokespecial 184 NET/worlds/network/CacheEntry:setState (I)V +/* */ // 1187: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 1190: dup +/* */ // 1191: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 1194: aload_0 +/* */ // 1195: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 1198: i2l +/* */ // 1199: ladd +/* */ // 1200: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 1203: aload_0 +/* */ // 1204: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 1207: ifgt +11 -> 1218 +/* */ // 1210: aload_0 +/* */ // 1211: aload_0 +/* */ // 1212: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 1215: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 1218: aload_0 +/* */ // 1219: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 1222: goto +78 -> 1300 +/* */ // 1225: astore 12 +/* */ // 1227: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 1230: dup +/* */ // 1231: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 1234: aload_0 +/* */ // 1235: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 1238: i2l +/* */ // 1239: ladd +/* */ // 1240: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 1243: aload_0 +/* */ // 1244: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 1247: ifgt +11 -> 1258 +/* */ // 1250: aload_0 +/* */ // 1251: aload_0 +/* */ // 1252: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 1255: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 1258: aload_0 +/* */ // 1259: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 1262: aload 12 +/* */ // 1264: athrow +/* */ // 1265: getstatic 199 NET/worlds/network/Cache:cache LNET/worlds/network/Cache; +/* */ // 1268: dup +/* */ // 1269: getfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 1272: aload_0 +/* */ // 1273: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 1276: i2l +/* */ // 1277: ladd +/* */ // 1278: putfield 420 NET/worlds/network/Cache:totalBytes J +/* */ // 1281: aload_0 +/* */ // 1282: getfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 1285: ifgt +11 -> 1296 +/* */ // 1288: aload_0 +/* */ // 1289: aload_0 +/* */ // 1290: getfield 307 NET/worlds/network/CacheEntry:bytes I +/* */ // 1293: putfield 167 NET/worlds/network/CacheEntry:netSize I +/* */ // 1296: aload_0 +/* */ // 1297: invokespecial 423 NET/worlds/network/CacheEntry:finishedLoad ()V +/* */ // 1300: return +/* */ // Line number table: +/* */ // Java source line #473 -> byte code offset #0 +/* */ // Java source line #474 -> byte code offset #2 +/* */ // Java source line #478 -> byte code offset #4 +/* */ // Java source line #479 -> byte code offset #9 +/* */ // Java source line #480 -> byte code offset #15 +/* */ // Java source line #482 -> byte code offset #21 +/* */ // Java source line #486 -> byte code offset #29 +/* */ // Java source line #487 -> byte code offset #35 +/* */ // Java source line #712 -> byte code offset #41 +/* */ // Java source line #713 -> byte code offset #57 +/* */ // Java source line #714 -> byte code offset #64 +/* */ // Java source line #718 -> byte code offset #72 +/* */ // Java source line #488 -> byte code offset #76 +/* */ // Java source line #492 -> byte code offset #77 +/* */ // Java source line #495 -> byte code offset #86 +/* */ // Java source line #496 -> byte code offset #100 +/* */ // Java source line #498 -> byte code offset #115 +/* */ // Java source line #499 -> byte code offset #121 +/* */ // Java source line #712 -> byte code offset #125 +/* */ // Java source line #713 -> byte code offset #141 +/* */ // Java source line #714 -> byte code offset #148 +/* */ // Java source line #718 -> byte code offset #156 +/* */ // Java source line #500 -> byte code offset #160 +/* */ // Java source line #504 -> byte code offset #161 +/* */ // Java source line #509 -> byte code offset #166 +/* */ // Java source line #510 -> byte code offset #175 +/* */ // Java source line #511 -> byte code offset #184 +/* */ // Java source line #512 -> byte code offset #198 +/* */ // Java source line #514 -> byte code offset #216 +/* */ // Java source line #515 -> byte code offset #222 +/* */ // Java source line #516 -> byte code offset #227 +/* */ // Java source line #518 -> byte code offset #232 +/* */ // Java source line #519 -> byte code offset #238 +/* */ // Java source line #712 -> byte code offset #242 +/* */ // Java source line #713 -> byte code offset #258 +/* */ // Java source line #714 -> byte code offset #265 +/* */ // Java source line #718 -> byte code offset #273 +/* */ // Java source line #520 -> byte code offset #277 +/* */ // Java source line #535 -> byte code offset #278 +/* */ // Java source line #536 -> byte code offset #285 +/* */ // Java source line #537 -> byte code offset #289 +/* */ // Java source line #536 -> byte code offset #292 +/* */ // Java source line #538 -> byte code offset #294 +/* */ // Java source line #542 -> byte code offset #297 +/* */ // Java source line #549 -> byte code offset #356 +/* */ // Java source line #552 -> byte code offset #359 +/* */ // Java source line #554 -> byte code offset #364 +/* */ // Java source line #555 -> byte code offset #370 +/* */ // Java source line #556 -> byte code offset #375 +/* */ // Java source line #558 -> byte code offset #380 +/* */ // Java source line #559 -> byte code offset #386 +/* */ // Java source line #712 -> byte code offset #390 +/* */ // Java source line #713 -> byte code offset #406 +/* */ // Java source line #714 -> byte code offset #413 +/* */ // Java source line #718 -> byte code offset #421 +/* */ // Java source line #560 -> byte code offset #425 +/* */ // Java source line #564 -> byte code offset #426 +/* */ // Java source line #566 -> byte code offset #431 +/* */ // Java source line #569 -> byte code offset #447 +/* */ // Java source line #570 -> byte code offset #453 +/* */ // Java source line #572 -> byte code offset #458 +/* */ // Java source line #574 -> byte code offset #460 +/* */ // Java source line #575 -> byte code offset #464 +/* */ // Java source line #576 -> byte code offset #469 +/* */ // Java source line #581 -> byte code offset #473 +/* */ // Java source line #583 -> byte code offset #480 +/* */ // Java source line #584 -> byte code offset #484 +/* */ // Java source line #583 -> byte code offset #487 +/* */ // Java source line #585 -> byte code offset #489 +/* */ // Java source line #589 -> byte code offset #492 +/* */ // Java source line #595 -> byte code offset #544 +/* */ // Java source line #598 -> byte code offset #547 +/* */ // Java source line #600 -> byte code offset #552 +/* */ // Java source line #601 -> byte code offset #558 +/* */ // Java source line #602 -> byte code offset #563 +/* */ // Java source line #605 -> byte code offset #568 +/* */ // Java source line #606 -> byte code offset #574 +/* */ // Java source line #607 -> byte code offset #590 +/* */ // Java source line #608 -> byte code offset #596 +/* */ // Java source line #609 -> byte code offset #602 +/* */ // Java source line #712 -> byte code offset #606 +/* */ // Java source line #713 -> byte code offset #622 +/* */ // Java source line #714 -> byte code offset #629 +/* */ // Java source line #718 -> byte code offset #637 +/* */ // Java source line #611 -> byte code offset #641 +/* */ // Java source line #620 -> byte code offset #642 +/* */ // Java source line #622 -> byte code offset #662 +/* */ // Java source line #623 -> byte code offset #675 +/* */ // Java source line #624 -> byte code offset #685 +/* */ // Java source line #626 -> byte code offset #698 +/* */ // Java source line #627 -> byte code offset #706 +/* */ // Java source line #626 -> byte code offset #714 +/* */ // Java source line #628 -> byte code offset #719 +/* */ // Java source line #630 -> byte code offset #722 +/* */ // Java source line #633 -> byte code offset #728 +/* */ // Java source line #634 -> byte code offset #738 +/* */ // Java source line #636 -> byte code offset #750 +/* */ // Java source line #638 -> byte code offset #757 +/* */ // Java source line #639 -> byte code offset #760 +/* */ // Java source line #641 -> byte code offset #769 +/* */ // Java source line #638 -> byte code offset #780 +/* */ // Java source line #644 -> byte code offset #793 +/* */ // Java source line #645 -> byte code offset #798 +/* */ // Java source line #647 -> byte code offset #801 +/* */ // Java source line #648 -> byte code offset #805 +/* */ // Java source line #652 -> byte code offset #807 +/* */ // Java source line #653 -> byte code offset #826 +/* */ // Java source line #654 -> byte code offset #839 +/* */ // Java source line #655 -> byte code offset #852 +/* */ // Java source line #656 -> byte code offset #858 +/* */ // Java source line #659 -> byte code offset #861 +/* */ // Java source line #660 -> byte code offset #866 +/* */ // Java source line #661 -> byte code offset #869 +/* */ // Java source line #664 -> byte code offset #875 +/* */ // Java source line #569 -> byte code offset #877 +/* */ // Java source line #667 -> byte code offset #886 +/* */ // Java source line #668 -> byte code offset #893 +/* */ // Java source line #669 -> byte code offset #904 +/* */ // Java source line #670 -> byte code offset #921 +/* */ // Java source line #671 -> byte code offset #930 +/* */ // Java source line #672 -> byte code offset #951 +/* */ // Java source line #671 -> byte code offset #973 +/* */ // Java source line #674 -> byte code offset #977 +/* */ // Java source line #675 -> byte code offset #982 +/* */ // Java source line #679 -> byte code offset #991 +/* */ // Java source line #680 -> byte code offset #1003 +/* */ // Java source line #682 -> byte code offset #1009 +/* */ // Java source line #684 -> byte code offset #1013 +/* */ // Java source line #685 -> byte code offset #1039 +/* */ // Java source line #686 -> byte code offset #1065 +/* */ // Java source line #691 -> byte code offset #1091 +/* */ // Java source line #693 -> byte code offset #1095 +/* */ // Java source line #694 -> byte code offset #1099 +/* */ // Java source line #696 -> byte code offset #1104 +/* */ // Java source line #699 -> byte code offset #1119 +/* */ // Java source line #700 -> byte code offset #1134 +/* */ // Java source line #701 -> byte code offset #1140 +/* */ // Java source line #702 -> byte code offset #1145 +/* */ // Java source line #705 -> byte code offset #1156 +/* */ // Java source line #706 -> byte code offset #1168 +/* */ // Java source line #707 -> byte code offset #1174 +/* */ // Java source line #708 -> byte code offset #1177 +/* */ // Java source line #709 -> byte code offset #1182 +/* */ // Java source line #712 -> byte code offset #1187 +/* */ // Java source line #713 -> byte code offset #1203 +/* */ // Java source line #714 -> byte code offset #1210 +/* */ // Java source line #718 -> byte code offset #1218 +/* */ // Java source line #711 -> byte code offset #1225 +/* */ // Java source line #712 -> byte code offset #1227 +/* */ // Java source line #713 -> byte code offset #1243 +/* */ // Java source line #714 -> byte code offset #1250 +/* */ // Java source line #718 -> byte code offset #1258 +/* */ // Java source line #719 -> byte code offset #1262 +/* */ // Java source line #712 -> byte code offset #1265 +/* */ // Java source line #713 -> byte code offset #1281 +/* */ // Java source line #714 -> byte code offset #1288 +/* */ // Java source line #718 -> byte code offset #1296 +/* */ // Java source line #720 -> byte code offset #1300 +/* */ // Local variable table: +/* */ // start length slot name signature +/* */ // 0 1301 0 this CacheEntry +/* */ // 1 1095 1 out java.io.FileOutputStream +/* */ // 3 1118 2 uc URLConnection +/* */ // 8 172 3 oldRemoteTime long +/* */ // 1012 116 3 e Exception +/* */ // 1102 1 4 localIOException IOException +/* */ // 13 579 5 oldsize int +/* */ // 19 551 6 oldbytes int +/* */ // 84 10 7 dirTime long +/* */ // 448 530 7 tries int +/* */ // 487 6 8 responseCode int +/* */ // 673 3 8 in java.io.InputStream +/* */ // 717 3 8 in java.io.InputStream +/* */ // 726 74 8 in java.io.InputStream +/* */ // 220 8 9 in java.io.InputStream +/* */ // 292 6 9 responseCode int +/* */ // 490 58 9 keep boolean +/* */ // 755 28 9 buf byte[] +/* */ // 295 65 10 keep boolean +/* */ // 556 8 10 in java.io.InputStream +/* */ // 760 15 10 count int +/* */ // 788 3 10 count int +/* */ // 368 8 11 in java.io.InputStream +/* */ // 1225 38 12 localObject Object +/* */ // Exception table: +/* */ // from to target type +/* */ // 4 41 1012 java/lang/Exception +/* */ // 77 125 1012 java/lang/Exception +/* */ // 161 242 1012 java/lang/Exception +/* */ // 278 390 1012 java/lang/Exception +/* */ // 426 606 1012 java/lang/Exception +/* */ // 642 1009 1012 java/lang/Exception +/* */ // 1095 1099 1102 java/io/IOException +/* */ // 4 41 1225 finally +/* */ // 77 125 1225 finally +/* */ // 161 242 1225 finally +/* */ // 278 390 1225 finally +/* */ // 426 606 1225 finally +/* */ // 642 1187 1225 finally +/* */ } +/* */ +/* */ private void finishedLoad() +/* */ { +/* 723 */ notifyObservers(); +/* */ +/* 725 */ synchronized (threadQueue) { +/* 726 */ numActiveThreads -= 1; +/* */ +/* */ do +/* */ { +/* 730 */ CacheEntry eNext = (CacheEntry)threadQueue.elementAt(0); +/* 731 */ threadQueue.removeElementAt(0); +/* 732 */ eNext.startThread(); +/* 729 */ if (numActiveThreads >= MAX_THREADS) break; } while (!threadQueue.isEmpty()); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 737 */ if ((numActiveThreads <= 0) && (threadQueue.isEmpty())) +/* */ { +/* 739 */ Cache.cache.resyncIndex(); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\CacheEntry.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/CacheFile.java b/NET/worlds/network/CacheFile.java new file mode 100644 index 0000000..6deb82c --- /dev/null +++ b/NET/worlds/network/CacheFile.java @@ -0,0 +1,221 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Cursor; +/* */ import java.util.Observer; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class CacheFile +/* */ { +/* */ private URL url; +/* */ private CacheEntry entry; +/* */ private boolean active; +/* */ +/* */ CacheFile(URL u, CacheEntry e) +/* */ { +/* 72 */ this.url = u; +/* 73 */ this.active = true; +/* 74 */ this.entry = e; +/* 75 */ if (e != null) { +/* 76 */ e.incRef(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void finalize() +/* */ { +/* 86 */ if (this.active) { +/* 87 */ this.active = false; +/* 88 */ if (this.entry != null) { +/* 89 */ this.entry.safeDecRef(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void close() +/* */ { +/* 101 */ finalize(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void markTemporary() +/* */ { +/* 109 */ if (this.entry != null) +/* */ { +/* */ +/* 112 */ this.entry.remoteTime = 0L; +/* */ } +/* */ } +/* */ +/* */ public boolean isActive() +/* */ { +/* 118 */ return this.active; +/* */ } +/* */ +/* */ +/* */ +/* */ public void load() +/* */ { +/* 125 */ this.entry.load(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void callWhenLoaded(Observer o) +/* */ { +/* 138 */ if (this.entry == null) { +/* 139 */ o.update(null, this.url); +/* */ } else { +/* 141 */ this.entry.addObserver(o); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void waitUntilLoaded() +/* */ { +/* 150 */ if (this.entry != null) { +/* 151 */ synchronized (this.entry) +/* */ { +/* 153 */ Cursor c = Cursor.getActive(); +/* 154 */ if (c == null) { +/* 155 */ c = new Cursor(URL.make("system:WAIT_CURSOR")); +/* 156 */ c.activate(); +/* */ } +/* */ +/* 159 */ URL oldCursor = c.getURL(); +/* 160 */ c.setURL(URL.make("system:WAIT_CURSOR")); +/* 161 */ while ((this.active) && (!done())) { +/* */ try { +/* 163 */ this.entry.wait(); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* */ } +/* */ +/* 168 */ c.setURL(oldCursor); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public boolean error() +/* */ { +/* 178 */ if (this.entry == null) { +/* 179 */ return false; +/* */ } +/* 181 */ return (this.entry.state == 5) || +/* 182 */ (this.entry.state == 6); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public boolean done() +/* */ { +/* 190 */ if (this.entry == null) { +/* 191 */ return true; +/* */ } +/* 193 */ return this.entry.done(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getLocalName() +/* */ { +/* 202 */ if (this.entry != null) { +/* 203 */ return this.entry.localName; +/* */ } +/* 205 */ return this.url.unalias(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public int bytesLoaded() +/* */ { +/* 213 */ return this.entry.bytes; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\CacheFile.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ChannelCmd.java b/NET/worlds/network/ChannelCmd.java new file mode 100644 index 0000000..f7e8b10 --- /dev/null +++ b/NET/worlds/network/ChannelCmd.java @@ -0,0 +1,60 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ChannelCmd +/* */ extends netPacket +/* */ { +/* */ public static final byte CHANNELCMD = 31; +/* */ protected String _channel; +/* */ +/* */ public ChannelCmd(String channel) +/* */ { +/* 33 */ super(null, 31); +/* 34 */ this._channel = channel; +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 39 */ return 1 + ServerOutputStream.utfLength(this._channel) + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 44 */ super.send(o); +/* */ +/* 46 */ o.writeUTF(this._channel); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 52 */ return "CHANNEL " + this._channel; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ChannelCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ConnectionWaiter.java b/NET/worlds/network/ConnectionWaiter.java new file mode 100644 index 0000000..efca67e --- /dev/null +++ b/NET/worlds/network/ConnectionWaiter.java @@ -0,0 +1,12 @@ +package NET.worlds.network; + +public abstract interface ConnectionWaiter +{ + public abstract void connectionCallback(Object paramObject, boolean paramBoolean); +} + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ConnectionWaiter.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/DDEMLClass.java b/NET/worlds/network/DDEMLClass.java new file mode 100644 index 0000000..fe1fe58 --- /dev/null +++ b/NET/worlds/network/DDEMLClass.java @@ -0,0 +1,41 @@ +/* */ package NET.worlds.network; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class DDEMLClass +/* */ { +/* 15 */ private int DDEMLptr = 0; +/* */ +/* */ +/* */ static {} +/* */ +/* */ +/* */ public static native void nativeInit(); +/* */ +/* */ public DDEMLClass(String service, String topic) +/* */ { +/* 25 */ create(service, topic); +/* */ } +/* */ +/* */ private native boolean create(String paramString1, String paramString2); +/* */ +/* */ public native void destroy(); +/* */ +/* */ public native boolean Request(String paramString); +/* */ +/* */ public native boolean Poke(String paramString1, String paramString2); +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\DDEMLClass.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/DNSLookup.java b/NET/worlds/network/DNSLookup.java new file mode 100644 index 0000000..026b641 --- /dev/null +++ b/NET/worlds/network/DNSLookup.java @@ -0,0 +1,244 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.net.MalformedURLException; +/* */ import java.net.URL; +/* */ import java.net.UnknownHostException; +/* */ import java.util.Hashtable; +/* */ import java.util.StringTokenizer; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class DNSLookup +/* */ implements Runnable +/* */ { +/* */ private static final int defaultTimeout = 30; +/* 69 */ private static Hashtable<String, String[]> cache = new Hashtable(); +/* */ +/* */ private String hostName; +/* */ +/* */ private String[] dottedNames; +/* */ +/* */ private int timeout; +/* */ +/* */ +/* */ public static URL lookup(URL url) +/* */ throws MalformedURLException, UnknownHostException +/* */ { +/* 81 */ return lookup(url, 30); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static URL lookupAll(URL url) +/* */ throws MalformedURLException, UnknownHostException +/* */ { +/* 90 */ return lookupAll(url, 30); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static URL lookup(URL url, int timeout) +/* */ throws MalformedURLException, UnknownHostException +/* */ { +/* 99 */ String hostName = url.getHost(); +/* 100 */ if (hostName == null) { +/* 101 */ return url; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 113 */ return new URL(url.getProtocol(), hostName, url.getPort(), url +/* 114 */ .getFile()); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static URL lookupAll(URL url, int timeout) +/* */ throws MalformedURLException, UnknownHostException +/* */ { +/* 124 */ String hostName = url.getHost(); +/* 125 */ if (hostName == null) { +/* 126 */ return url; +/* */ } +/* 128 */ String[] addresses = lookupAll(hostName, timeout); +/* 129 */ String hosts = ""; +/* 130 */ for (int i = 0; i < addresses.length; i++) { +/* 131 */ if (i != 0) +/* 132 */ hosts = hosts + ";"; +/* 133 */ hosts = hosts + addresses[i]; +/* */ } +/* 135 */ return new URL(url.getProtocol(), hosts, url.getPort(), url.getFile()); +/* */ } +/* */ +/* */ public static String lookup(String hostName) throws UnknownHostException +/* */ { +/* 140 */ return lookup(hostName, 30); +/* */ } +/* */ +/* */ public static String lookup(String hostName, int timeout) +/* */ throws UnknownHostException +/* */ { +/* 146 */ if (isDotted(hostName)) +/* 147 */ return hostName; +/* 148 */ return lookupAllCommon(hostName, timeout)[0]; +/* */ } +/* */ +/* */ public static String[] lookupAll(String hostName) +/* */ throws UnknownHostException +/* */ { +/* 154 */ return lookupAll(hostName, 30); +/* */ } +/* */ +/* */ public static String[] lookupAll(String hostName, int timeout) +/* */ throws UnknownHostException +/* */ { +/* 160 */ if (isDotted(hostName)) { +/* 161 */ String[] names = new String[1]; +/* 162 */ names[0] = hostName; +/* 163 */ return names; +/* */ } +/* 165 */ return lookupAllCommon(hostName, timeout); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ private static String[] lookupAllCommon(String hostName, int timeout) +/* */ throws UnknownHostException +/* */ { +/* 174 */ String[] dotted = (String[])cache.get(hostName); +/* 175 */ if (dotted == null) { +/* 176 */ dotted = new DNSLookup(hostName, timeout).getDottedNames(); +/* 177 */ if (dotted == null) +/* 178 */ throw new UnknownHostException(hostName); +/* 179 */ cache.put(hostName, dotted); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 185 */ return dotted; +/* */ } +/* */ +/* */ private DNSLookup(String hostName, int timeout) { +/* 189 */ this.hostName = hostName; +/* 190 */ this.timeout = timeout; +/* 191 */ if (timeout != 0) { +/* 192 */ Thread t = new Thread(this); +/* 193 */ t.setDaemon(true); +/* 194 */ t.start(); +/* */ } else { +/* 196 */ run(); +/* */ } +/* */ } +/* */ +/* */ public void run() { +/* 201 */ this.dottedNames = gethostbyname(this.hostName); +/* 202 */ if (this.timeout != 0) { +/* 203 */ synchronized (this) { +/* 204 */ notify(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ private synchronized String[] getDottedNames() { +/* 210 */ if ((this.dottedNames == null) && (this.timeout != 0)) { +/* */ try { +/* 212 */ wait(this.timeout * 1000); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* */ } +/* 216 */ return this.dottedNames; +/* */ } +/* */ +/* */ +/* */ private static boolean isDotted(String name) +/* */ { +/* 222 */ StringTokenizer tok = new StringTokenizer(name, "."); +/* 223 */ if (tok.countTokens() != 4) +/* 224 */ return false; +/* 225 */ for (int i = 0; i < 4; i++) { +/* */ try { +/* 227 */ int val = Integer.parseInt(tok.nextToken()); +/* 228 */ if ((val < 0) || (val > 255)) +/* 229 */ return false; +/* */ } catch (NumberFormatException nfe) { +/* 231 */ return false; +/* */ } +/* */ } +/* 234 */ return true; +/* */ } +/* */ +/* */ private static native String[] gethostbyname(String paramString); +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\DNSLookup.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/DirTimeStamp.java b/NET/worlds/network/DirTimeStamp.java new file mode 100644 index 0000000..d9ab2e6 --- /dev/null +++ b/NET/worlds/network/DirTimeStamp.java @@ -0,0 +1,196 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.core.IniFile; +/* */ import java.io.FileNotFoundException; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.net.URLConnection; +/* */ import java.util.Hashtable; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class DirTimeStamp +/* */ { +/* 70 */ private static Hashtable<URL, DirTimeStamp> _tsEntries = new Hashtable(); +/* */ +/* */ private URL _name; +/* */ private long _mtime; +/* 74 */ private boolean _loaded = false; +/* */ +/* */ private DirTimeStamp(URL url) { +/* 77 */ this._name = url; +/* */ +/* */ +/* 80 */ assert (url.isRemote()); +/* */ } +/* */ +/* */ private static synchronized DirTimeStamp lookup(URL url) { +/* 84 */ DirTimeStamp t = (DirTimeStamp)_tsEntries.get(url); +/* */ +/* 86 */ if (t == null) { +/* 87 */ t = new DirTimeStamp(url); +/* 88 */ _tsEntries.put(url, t); +/* */ } +/* */ +/* 91 */ return t; +/* */ } +/* */ +/* */ private void getMTime() { +/* 95 */ this._mtime = 0L; +/* */ try +/* */ { +/* 98 */ int r = (int)(Math.random() * 1000000.0D); +/* */ +/* 100 */ int retryCount = IniFile.gamma().getIniInt("NetCacheRetries", 1); +/* */ +/* 102 */ boolean offline = CacheEntry.getOffline(); +/* 103 */ boolean stopOnHttpFault = offline; +/* */ +/* 105 */ if (offline) { +/* 106 */ this._loaded = true; +/* 107 */ return; +/* */ } +/* */ +/* 110 */ if (stopOnHttpFault) { +/* 111 */ retryCount = 1; +/* */ } +/* */ +/* 114 */ java.net.URL u = DNSLookup.lookup(new java.net.URL(this._name.unalias() + +/* 115 */ "?" + r)); +/* */ for (;;) +/* */ { +/* */ try { +/* 119 */ URLConnection uc = u.openConnection(); +/* 120 */ this._mtime = uc.getLastModified(); +/* */ } +/* */ catch (IOException e) { +/* 123 */ retryCount--; +/* */ +/* 125 */ if ((retryCount <= 0) || ((e instanceof FileNotFoundException))) { +/* 126 */ throw e; +/* */ } +/* 128 */ System.out.println("Exception " + e + " querying " + +/* 129 */ this._name + ", retrying..."); +/* */ } +/* */ } +/* 132 */ this._loaded = true; +/* */ } catch (FileNotFoundException e) { +/* 134 */ System.out.println("Warning: timestamp " + this._name + " not found."); +/* 135 */ this._loaded = true; +/* */ } catch (Exception e) { +/* 137 */ System.out.println("Timestamp query error: " + e + " accessing " + +/* 138 */ this._name); +/* 139 */ this._loaded = true; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static long request(URL url) +/* */ { +/* 152 */ URL tsURL = URL.make(url, "timestamp.dir"); +/* */ +/* 154 */ String u = url.getInternal(); +/* */ +/* 156 */ int i = u.lastIndexOf('/'); +/* */ +/* 158 */ if (i > 0) { +/* 159 */ int j = u.lastIndexOf('/', i - 1) + 1; +/* 160 */ if (j > 11) +/* */ { +/* 162 */ String par = u.substring(j, i); +/* */ +/* */ +/* */ +/* */ +/* 167 */ if (url.endsWith("upgrades.lst")) { +/* 168 */ if ((!par.equals("gdkup")) && (!par.equals("newup")) && +/* 169 */ (!par.equals("3DCDup"))) { +/* 170 */ tsURL = URL.make(u.substring(0, j) + +/* 171 */ "timestamp.upgrades"); +/* */ } else { +/* 173 */ tsURL = URL.make(url, "timestamp.upgrades"); +/* */ } +/* 175 */ } else if (par.equals("cgi-bin")) { +/* 176 */ return 0L; +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* 182 */ DirTimeStamp t = lookup(tsURL); +/* */ +/* 184 */ synchronized (t) { +/* 185 */ if (!t._loaded) +/* 186 */ t.getMTime(); +/* */ } +/* 188 */ return t._mtime; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\DirTimeStamp.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ExceptionCmd.java b/NET/worlds/network/ExceptionCmd.java new file mode 100644 index 0000000..67d00c2 --- /dev/null +++ b/NET/worlds/network/ExceptionCmd.java @@ -0,0 +1,49 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class ExceptionCmd +/* */ extends receivedNetPacket +/* */ { +/* */ private Exception _exception; +/* */ +/* */ public ExceptionCmd(Exception e) +/* */ { +/* 25 */ this._exception = e; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 30 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception +/* */ { +/* 35 */ throw this._exception; +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 41 */ return "EXCEPT " + this._exception.getMessage(); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ExceptionCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/FilthFilter.java b/NET/worlds/network/FilthFilter.java new file mode 100644 index 0000000..04e590e --- /dev/null +++ b/NET/worlds/network/FilthFilter.java @@ -0,0 +1,310 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.core.IniFile; +/* */ import java.io.PrintStream; +/* */ import java.io.RandomAccessFile; +/* */ import java.util.Hashtable; +/* */ import java.util.StringTokenizer; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class FilthFilter +/* */ { +/* 44 */ private static FilthFilter theFilthFilter = null; +/* */ private String filthFile; +/* */ +/* 47 */ public static FilthFilter get() { if (theFilthFilter == null) { +/* 48 */ theFilthFilter = new FilthFilter(); +/* */ } +/* 50 */ return theFilthFilter; +/* */ } +/* */ +/* */ +/* */ +/* */ private Hashtable<String, Vector<FilthyPhrase>> naughtyPhrases; +/* */ +/* */ private Vector<String> naughtyWords; +/* */ +/* */ private boolean allowObscenities; +/* */ +/* */ private FilthFilter() +/* */ { +/* 63 */ this.filthFile = IniFile.gamma().getIniString("filthfile", "filter.dat"); +/* 64 */ if (IniFile.gamma().getIniInt("encryptfilth", 0) == 1) { +/* 65 */ encryptFilthFile(); +/* */ } +/* */ +/* 68 */ this.allowObscenities = ((IniFile.gamma().getIniInt("allowObscenities", 0) == 1) || ( +/* 69 */ IniFile.override().getIniInt("allowObscentiies", 0) == 1)); +/* */ +/* 71 */ loadFilth(); +/* */ } +/* */ +/* */ private void loadFilth() { +/* 75 */ this.naughtyPhrases = new Hashtable(); +/* 76 */ this.naughtyWords = new Vector(); +/* */ try +/* */ { +/* 79 */ RandomAccessFile fIn = new RandomAccessFile(this.filthFile, "r"); +/* 80 */ byte[] encrypted = new byte[fIn.readInt()]; +/* 81 */ fIn.readFully(encrypted); +/* 82 */ fIn.close(); +/* 83 */ String decrypted = decrypt(encrypted); +/* */ +/* 85 */ StringTokenizer st = new StringTokenizer( +/* 86 */ decrypted, +/* 87 */ "\t\n\r.,;'\"!?*:/()[]{},「」『』《》?【】。!、;:", +/* */ +/* 89 */ false); +/* */ +/* 91 */ while (st.hasMoreTokens()) { +/* 92 */ String filth = st.nextToken(); +/* */ +/* 94 */ FilthyPhrase phrase = new FilthyPhrase(filth); +/* */ +/* 96 */ String lookupValue = phrase.firstWord(); +/* 97 */ Vector<FilthyPhrase> phraseList = (Vector)this.naughtyPhrases.get(lookupValue); +/* */ +/* 99 */ if (phraseList == null) { +/* 100 */ phraseList = new Vector(); +/* 101 */ this.naughtyPhrases.put(lookupValue, phraseList); +/* */ } +/* */ +/* 104 */ phraseList.addElement(phrase); +/* 105 */ if (phrase.size() == 1L) { +/* 106 */ this.naughtyWords.addElement(phrase.firstWord()); +/* */ } +/* */ +/* */ } +/* */ +/* */ } +/* */ catch (Exception e) +/* */ { +/* 114 */ System.out.println("Error in filth file: " + e.toString()); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private byte[] encrypt(String in) +/* */ { +/* */ try +/* */ { +/* 126 */ inBytes = in.getBytes(); +/* */ } catch (Exception e) { byte[] inBytes; +/* 128 */ System.out.println("Error encoding to UTF8" + e.toString()); +/* 129 */ return null; +/* */ } +/* */ byte[] inBytes; +/* 132 */ byte[] outBytes = new byte[inBytes.length]; +/* */ +/* 134 */ int len = inBytes.length; +/* */ +/* 136 */ outBytes[0] = inBytes[0]; +/* 137 */ for (int idx = 1; idx < len; idx++) { +/* 138 */ outBytes[idx] = ((byte)(inBytes[idx] ^ outBytes[(idx - 1)])); +/* */ } +/* */ +/* 141 */ return outBytes; +/* */ } +/* */ +/* */ private String decrypt(byte[] in) { +/* 145 */ byte[] outBytes = new byte[in.length]; +/* */ +/* 147 */ int len = in.length; +/* */ +/* 149 */ outBytes[0] = in[0]; +/* 150 */ for (int idx = 1; idx < len; idx++) { +/* 151 */ outBytes[idx] = ((byte)(in[idx] ^ in[(idx - 1)])); +/* */ } +/* */ +/* */ try +/* */ { +/* 156 */ out = new String(outBytes, "UTF8"); +/* */ } catch (Exception e) { String out; +/* 158 */ System.out.println("Error encoding UTF8 " + e.toString()); +/* 159 */ return null; +/* */ } +/* */ String out; +/* 162 */ return out; +/* */ } +/* */ +/* */ private void encryptFilthFile() { +/* */ try { +/* 167 */ System.out.println("Encoding filth file..."); +/* */ +/* 169 */ RandomAccessFile inFilth = new RandomAccessFile("filth.txt", "r"); +/* 170 */ String inStr = new String(); +/* 171 */ while (inFilth.getFilePointer() < inFilth.length()) { +/* 172 */ String in = inFilth.readLine(); +/* 173 */ System.out.println(in); +/* 174 */ inStr = inStr + in + "\r\n"; +/* */ } +/* 176 */ inFilth.close(); +/* */ +/* 178 */ byte[] encrypted = encrypt(inStr); +/* */ +/* 180 */ RandomAccessFile outFilth = new RandomAccessFile(this.filthFile, "rw"); +/* 181 */ outFilth.writeInt(encrypted.length); +/* 182 */ outFilth.write(encrypted); +/* 183 */ outFilth.close(); +/* */ +/* 185 */ System.out.println("Filth file " + this.filthFile + +/* 186 */ " successfully written."); +/* */ } catch (Exception e) { +/* 188 */ System.out.println("Error encoding filth file: " + e.toString()); +/* */ } +/* */ } +/* */ +/* */ public String filter(String in) { +/* 193 */ if (this.allowObscenities) { +/* 194 */ return in; +/* */ } +/* 196 */ String out = new String(); +/* */ +/* 198 */ while (in.length() > 0) { +/* 199 */ StringTokenizer st = new StringTokenizer( +/* 200 */ in, +/* 201 */ "\t\n\r.,;'\"!?*:/()[]{} ,「」『』《》?【】。!、;:", +/* */ +/* 203 */ true); +/* */ +/* 205 */ String originalString = st.nextToken(); +/* */ +/* 207 */ String toCheck = new String(originalString.toLowerCase()); +/* */ +/* 209 */ Vector<FilthyPhrase> phraseList = (Vector)this.naughtyPhrases.get(toCheck); +/* */ +/* 211 */ if (phraseList != null) { +/* 212 */ int idx = 0; +/* 213 */ boolean replaced = false; +/* 214 */ while (idx < phraseList.size()) { +/* 215 */ FilthyPhrase phrase = +/* 216 */ (FilthyPhrase)phraseList.elementAt(idx); +/* */ +/* 218 */ if (phrase.check(in)) { +/* 219 */ String replaceWith = phrase.getReplacement(); +/* 220 */ out = out + replaceWith; +/* 221 */ in = in.substring(replaceWith.length(), in.length()); +/* 222 */ replaced = true; +/* 223 */ break; +/* */ } +/* 225 */ idx++; +/* */ } +/* 227 */ if (!replaced) { +/* 228 */ out = out + toCheck; +/* 229 */ in = in.substring(toCheck.length(), in.length()); +/* */ } +/* */ } +/* */ else { +/* 233 */ out = out + originalString; +/* 234 */ in = in.substring(toCheck.length(), in.length()); +/* */ } +/* */ } +/* */ +/* 238 */ return out; +/* */ } +/* */ +/* */ public String filterName(String in) { +/* 242 */ if (this.allowObscenities) { +/* 243 */ return in; +/* */ } +/* 245 */ String out = new String(in); +/* */ +/* 247 */ int idx = 0; +/* 248 */ while (idx < this.naughtyWords.size()) { +/* 249 */ String toCompare = (String)this.naughtyWords.elementAt(idx); +/* 250 */ int location = out.indexOf(toCompare); +/* */ +/* 252 */ if (location > -1) { +/* 253 */ String funnyChars = new String( +/* 254 */ "$!@%#@&*!%#@%!@#$%@#@!@%!@#$%*&%$!"); +/* */ +/* 256 */ String retVal = new String(); +/* */ +/* 258 */ retVal = out.substring(0, location); +/* 259 */ retVal = retVal + funnyChars.substring(0, toCompare.length()); +/* 260 */ retVal = retVal + out.substring(location + toCompare.length(), +/* 261 */ out.length()); +/* */ +/* 263 */ out = retVal; +/* */ } +/* */ +/* 266 */ idx++; +/* */ } +/* */ +/* 269 */ return out; +/* */ } +/* */ +/* */ public boolean isFilthy(String in) { +/* 273 */ if (this.allowObscenities) { +/* 274 */ return false; +/* */ } +/* */ +/* */ +/* 278 */ while (in.length() > 0) { +/* 279 */ StringTokenizer st = new StringTokenizer( +/* 280 */ in, +/* 281 */ "\t\n\r.,;'\"!?*:/()[]{} ,「」『』《》?【】。!、;:", +/* */ +/* 283 */ true); +/* */ +/* 285 */ String toCheck = st.nextToken().toLowerCase(); +/* 286 */ Vector<FilthyPhrase> phraseList = (Vector)this.naughtyPhrases.get(toCheck); +/* */ +/* 288 */ if (phraseList != null) { +/* 289 */ int idx = 0; +/* 290 */ while (idx < phraseList.size()) { +/* 291 */ FilthyPhrase phrase = +/* 292 */ (FilthyPhrase)phraseList.elementAt(idx); +/* */ +/* 294 */ if (phrase.check(in)) { +/* 295 */ return true; +/* */ } +/* 297 */ idx++; +/* */ } +/* */ } +/* */ } +/* */ +/* 302 */ return false; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\FilthFilter.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/FilthyPhrase.java b/NET/worlds/network/FilthyPhrase.java new file mode 100644 index 0000000..4ad300d --- /dev/null +++ b/NET/worlds/network/FilthyPhrase.java @@ -0,0 +1,117 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.util.StringTokenizer; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class FilthyPhrase +/* */ { +/* */ private long compareValue; +/* */ private Vector<String> filthyWords; +/* */ private String rawData; +/* */ +/* */ public FilthyPhrase(String phrase) +/* */ { +/* 25 */ this.rawData = new String(phrase); +/* 26 */ this.filthyWords = new Vector(); +/* */ +/* 28 */ StringTokenizer st = new StringTokenizer(phrase, +/* 29 */ "\t\n\r.,;'\"!?*:/()[]{} ,「」『』《》?【】。!、;:", +/* */ +/* 31 */ true); +/* */ +/* 33 */ if (st.hasMoreTokens()) { +/* 34 */ String firstToken = st.nextToken().toLowerCase(); +/* 35 */ this.compareValue = firstToken.hashCode(); +/* 36 */ this.filthyWords.addElement(firstToken); +/* */ } +/* */ +/* 39 */ while (st.hasMoreTokens()) { +/* 40 */ String nextWord = st.nextToken(); +/* 41 */ this.filthyWords.addElement(nextWord.toLowerCase()); +/* */ } +/* */ } +/* */ +/* */ public boolean check(String toCheck) { +/* 46 */ StringTokenizer st = new StringTokenizer(toCheck, +/* 47 */ "\t\n\r.,;'\"!?*:/()[]{} ,「」『』《》?【】。!、;:", +/* */ +/* 49 */ true); +/* */ +/* */ +/* */ +/* */ +/* 54 */ int idx = 0; +/* 55 */ while (idx < this.filthyWords.size()) { +/* 56 */ if (st.hasMoreTokens()) { +/* 57 */ String token = st.nextToken().toLowerCase(); +/* 58 */ String comparator = (String)this.filthyWords.elementAt(idx); +/* 59 */ if (comparator.compareTo(token) != 0) { +/* 60 */ return false; +/* */ } +/* 62 */ idx++; +/* */ } else { +/* 64 */ return false; +/* */ } +/* */ } +/* 67 */ return true; +/* */ } +/* */ +/* */ public String getReplacement() { +/* 71 */ String funnyChars = new String("$!@%#@&*!%#@%!@#$%@#@!@%!@#$%*&%$!"); +/* */ +/* 73 */ String retVal = new String(); +/* */ +/* 75 */ int idx = 0; +/* 76 */ while (idx < this.filthyWords.size()) { +/* 77 */ int numChars = ((String)this.filthyWords.elementAt(idx)).length(); +/* 78 */ String replacementWord = new String(); +/* 79 */ if (numChars > 1) { +/* 80 */ replacementWord = funnyChars.substring(0, numChars); +/* */ } else { +/* 82 */ replacementWord = (String)this.filthyWords.elementAt(idx); +/* */ } +/* */ +/* 85 */ retVal = retVal + replacementWord; +/* 86 */ idx++; +/* */ } +/* */ +/* 89 */ return retVal; +/* */ } +/* */ +/* */ public long size() { +/* 93 */ return this.filthyWords.size(); +/* */ } +/* */ +/* */ public long compareValue() { +/* 97 */ return this.compareValue; +/* */ } +/* */ +/* */ public String firstWord() { +/* 101 */ if (this.filthyWords.size() > 0) { +/* 102 */ return (String)this.filthyWords.elementAt(0); +/* */ } +/* 104 */ return new String(""); +/* */ } +/* */ +/* */ public String asString() +/* */ { +/* 109 */ return this.rawData; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\FilthyPhrase.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/FingerReplyCmd.java b/NET/worlds/network/FingerReplyCmd.java new file mode 100644 index 0000000..fe1cebc --- /dev/null +++ b/NET/worlds/network/FingerReplyCmd.java @@ -0,0 +1,54 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class FingerReplyCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte FINGERREPLYCMD = 28; +/* */ private String _user; +/* */ private PropertyList _propList; +/* */ +/* */ public FingerReplyCmd() +/* */ { +/* 29 */ this._commandType = 28; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 34 */ this._user = data.readUTF(); +/* 35 */ this._propList = new PropertyList(); +/* 36 */ this._propList.parseNetData(data); +/* */ } +/* */ +/* */ +/* */ void process(WorldServer serv) +/* */ throws Exception +/* */ {} +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 46 */ return "FINGREP " + this._user + " " + this._propList; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\FingerReplyCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/FingerReqCmd.java b/NET/worlds/network/FingerReqCmd.java new file mode 100644 index 0000000..2f65b22 --- /dev/null +++ b/NET/worlds/network/FingerReqCmd.java @@ -0,0 +1,57 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class FingerReqCmd +/* */ extends netPacket +/* */ { +/* */ public static final byte FINGERREQCMD = 27; +/* */ private String _user; +/* */ +/* */ public FingerReqCmd(String user) +/* */ { +/* 27 */ super(null, 27); +/* 28 */ this._user = user; +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 33 */ int len = super.packetSize(); +/* */ +/* 35 */ assert (this._user != null); +/* 36 */ len += 1 + ServerOutputStream.utfLength(this._user); +/* 37 */ return len; +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 42 */ super.send(o); +/* 43 */ o.writeUTF(this._user); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 49 */ return "FINGREQ " + this._user; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\FingerReqCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/Galaxy.java b/NET/worlds/network/Galaxy.java new file mode 100644 index 0000000..69324c0 --- /dev/null +++ b/NET/worlds/network/Galaxy.java @@ -0,0 +1,1246 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.DialogReceiver; +/* */ import NET.worlds.console.InternetConnectionDialog; +/* */ import NET.worlds.console.LoginWizard; +/* */ import NET.worlds.core.IniFile; +/* */ import java.io.PrintStream; +/* */ import java.util.Enumeration; +/* */ import java.util.Hashtable; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class Galaxy +/* */ implements DialogReceiver +/* */ { +/* */ private static Hashtable<String, Galaxy> _galaxyHash; +/* */ private static boolean _globalUserAllowsOnline; +/* */ +/* */ private Galaxy(ServerURL serverURL) +/* */ { +/* 153 */ this._serverURL = serverURL; +/* */ +/* 155 */ this._serverType = 0; +/* 156 */ this._nFlongID = new Hashtable(); +/* 157 */ this._worldCount = 0; +/* 158 */ this._channel = ""; +/* 159 */ this._serverTracker = new ServerTracker(this); +/* 160 */ this._waiters = new WaitList(this); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 166 */ this._username = ""; +/* 167 */ this._usernameU = ""; +/* 168 */ this._consoleList = new NetworkMulti(this._username, this); +/* 169 */ regObject(this._username, this._consoleList); +/* */ +/* 171 */ if (serverURL == null) +/* */ { +/* 173 */ this._onlineEnabled = false; +/* 174 */ this._online = false; +/* */ } else { +/* 176 */ this._onlineEnabled = true; +/* 177 */ this._online = false; +/* */ } +/* 179 */ setOnlineState(this._onlineEnabled, this._online); +/* */ } +/* */ +/* */ private synchronized void incWorldCount() { +/* 183 */ this._worldCount += 1; +/* */ } +/* */ +/* */ public synchronized void decWorldCount() { +/* 187 */ this._worldCount -= 1; +/* 188 */ assert (this._worldCount >= 0); +/* 189 */ if (this._worldCount <= 0) +/* */ { +/* */ +/* */ +/* */ +/* */ +/* 195 */ if (this._serverURL != null) { +/* 196 */ _galaxyHash.remove(this._serverURL.getHost()); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 206 */ this._waiters.clear(); +/* */ +/* */ +/* */ +/* */ +/* 211 */ this._serverTracker = new ServerTracker(this); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static Galaxy getGalaxy(String strServerURL) +/* */ throws InvalidServerURLException +/* */ { +/* 231 */ ServerURL serverURL = new ServerURL(strServerURL); +/* */ +/* 233 */ String serverHost = serverURL.getHost(); +/* */ +/* 235 */ Galaxy reqGal = (Galaxy)_galaxyHash.get(serverHost); +/* 236 */ if (reqGal == null) { +/* 237 */ reqGal = new Galaxy(serverURL); +/* 238 */ _galaxyHash.put(serverHost, reqGal); +/* */ } +/* 240 */ assert (reqGal != null); +/* 241 */ reqGal.incWorldCount(); +/* 242 */ return reqGal; +/* */ } +/* */ +/* */ +/* */ +/* */ public static Galaxy getGalaxy(URL serverURL) +/* */ throws InvalidServerURLException +/* */ { +/* 250 */ return getGalaxy(serverURL.unalias()); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static Galaxy getAnonGalaxy() +/* */ { +/* 258 */ Galaxy reqGal = new Galaxy(null); +/* 259 */ reqGal.incWorldCount(); +/* 260 */ return reqGal; +/* */ } +/* */ +/* */ public boolean isAnonymous() { +/* 264 */ return this._serverURL == null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 277 */ private boolean _localUserAllowsOnline = true; +/* */ +/* */ private ServerURL _serverURL; +/* */ +/* */ private int _serverType; +/* */ +/* */ private int _worldCount; +/* */ +/* */ private Hashtable<String, NetworkObject> _nFlongID; +/* */ +/* */ private ServerTracker _serverTracker; +/* */ +/* */ private RoomMgr _roomTable; +/* */ +/* */ private String _channel; +/* */ private String _username; +/* */ private String _usernameU; +/* */ private String _password; +/* */ private String _serial; +/* */ private String _newUsername; +/* */ private String _newPassword; +/* */ private int _mode; +/* */ private NetworkMulti _consoleList; +/* 300 */ private int _retriesLeft = 2; +/* */ +/* */ +/* */ +/* */ private InternetConnectionDialog _icd; +/* */ +/* */ +/* */ +/* */ private LoginWizard _wizard; +/* */ +/* */ +/* 311 */ private Object _wizardMutex = new Object(); +/* */ private static int _debugLevel; +/* */ private WaitList _waiters; +/* */ private boolean _relogin; +/* */ private boolean _onlineEnabled; +/* */ private boolean _online; +/* */ private boolean sentFriendsList; +/* */ private int protocolLevel; +/* */ +/* */ static +/* */ { +/* 267 */ _galaxyHash = new Hashtable(); +/* */ +/* */ +/* */ +/* */ +/* 272 */ _globalUserAllowsOnline = true; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 316 */ _debugLevel = IniFile.gamma().getIniInt("netdebug", 0); +/* 317 */ if (_debugLevel > 0) { +/* 318 */ System.out.println("NETWORK DEBUGGING LEVEL = " + _debugLevel); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public WorldServer getServer(String StrServerURL) +/* */ throws InvalidServerURLException +/* */ { +/* 351 */ if (this._serverURL == null) +/* 352 */ return null; +/* 353 */ if (!_globalUserAllowsOnline) +/* 354 */ return null; +/* 355 */ if (!this._localUserAllowsOnline) +/* 356 */ return null; +/* 357 */ if (this._icd != null) { +/* 358 */ return null; +/* */ } +/* */ +/* 361 */ synchronized (this._wizardMutex) { +/* 362 */ if ((this._wizard != null) && (!this._wizard.waitingForConnection()) && +/* 363 */ (!this._wizard.safeToQueryServer())) { +/* 364 */ return null; +/* */ } +/* */ } +/* */ +/* 368 */ return this._serverTracker.getServer(StrServerURL); +/* */ } +/* */ +/* */ public WorldServer getServer(URL serverURL) +/* */ throws InvalidServerURLException +/* */ { +/* 374 */ return getServer(serverURL.unalias()); +/* */ } +/* */ +/* */ public boolean isActive() { +/* 378 */ return this._serverTracker.isActive(); +/* */ } +/* */ +/* */ protected boolean addPendingServer(WorldServer ws) { +/* 382 */ assert (ws != null); +/* 383 */ boolean firstOnline = this._serverTracker.addPendingServer(ws); +/* 384 */ if (firstOnline) +/* */ { +/* */ +/* 387 */ this._retriesLeft = 2; +/* */ +/* 389 */ setOnlineState(true, true); +/* 390 */ synchronized (this) { +/* 391 */ this._roomTable = new RoomMgr(); +/* */ } +/* */ } +/* 394 */ return firstOnline; +/* */ } +/* */ +/* */ void addActiveServer(WorldServer ws) { +/* 398 */ boolean firstActive = this._serverTracker.addActiveServer(ws); +/* 399 */ if (firstActive) +/* */ { +/* 401 */ this._waiters.notify(true); +/* */ +/* 403 */ if (this._wizard != null) +/* */ { +/* 405 */ System.out.println("LWDB: calling " + this._wizard + " setConnected"); +/* 406 */ this._wizard.setConnected(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ boolean addClosingServer(WorldServer ws) { +/* 412 */ assert (this._nFlongID != null); +/* 413 */ assert (ws != null); +/* 414 */ boolean lastActive = this._serverTracker.addClosingServer(ws); +/* 415 */ if (lastActive) { +/* 416 */ forceDisconnect(); +/* */ } +/* 418 */ return lastActive; +/* */ } +/* */ +/* */ void markClosedServer(WorldServer ws) { +/* 422 */ this._serverTracker.markClosedServer(ws); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ void killServer(WorldServer serv) +/* */ { +/* 430 */ this._serverTracker.killServer(serv); +/* */ } +/* */ +/* */ protected void noteServerDeath(VarErrorException lastError) { +/* 434 */ synchronized (this._serverTracker) { +/* 435 */ if (this._serverTracker.isActive()) +/* */ { +/* 437 */ return; +/* */ } +/* 439 */ synchronized (this) +/* */ { +/* 441 */ this._roomTable = null; +/* */ } +/* */ +/* 444 */ setOnlineState(false, false); +/* */ +/* */ +/* */ +/* */ +/* 449 */ if (getProtocol() == 0) +/* */ { +/* */ +/* 452 */ this._icd = new InternetConnectionDialog(this, lastError); +/* 453 */ return; +/* */ } +/* */ +/* */ +/* */ +/* 458 */ if ((lastError != null) && ((!lastError.getStatusFlag()) || (this._relogin))) { +/* 459 */ _globalUserAllowsOnline = true; +/* */ +/* */ +/* 462 */ boolean tryBackup = false; +/* 463 */ synchronized (this._serverTracker) { +/* 464 */ Enumeration<WorldServer> list = this._serverTracker.getAllServers(); +/* 465 */ while (list.hasMoreElements()) { +/* 466 */ WorldServer ws = (WorldServer)list.nextElement(); +/* 467 */ if (ws.useBackupServer()) { +/* 468 */ tryBackup = true; +/* */ } +/* */ } +/* */ } +/* 472 */ if (tryBackup) { +/* 473 */ System.out.println("Server death noted, trying alternate."); +/* 474 */ setChatname(this._username); +/* 475 */ goOnline(); +/* */ } else { +/* 477 */ System.out.println("Server death noted, no more alternates. How sad."); +/* */ +/* */ +/* */ +/* */ +/* 482 */ if ((this._retriesLeft > 0) && ( +/* 483 */ (this._relogin) || (lastError.getRetryFlag()))) +/* */ { +/* */ +/* 486 */ System.out.println(this + ": doing retry on " + +/* 487 */ lastError); +/* 488 */ this._retriesLeft -= lastError.getRetryCount(); +/* */ +/* 490 */ setChatname(this._username); +/* */ +/* 492 */ goOnline(); +/* */ } +/* */ else +/* */ { +/* 496 */ setChatname(""); +/* */ +/* */ +/* */ +/* 500 */ killZombies(); +/* */ +/* */ +/* */ +/* 504 */ if (this._wizard == null) { +/* 505 */ this._wizard = new LoginWizard(this, getIniSection(), +/* 506 */ lastError.getMsg()); +/* 507 */ System.out.println("LWDB: brought up " + this._wizard + +/* 508 */ " error " + lastError.getMsg()); +/* */ +/* */ } +/* */ else +/* */ { +/* 513 */ System.out.println("LWDB: reporting error " + +/* 514 */ lastError.getMsg() + " to " + this._wizard); +/* 515 */ this._wizard.loginError(lastError.getMsg()); +/* */ } +/* */ } +/* */ } +/* 519 */ this._relogin = false; +/* */ } +/* */ else +/* */ { +/* 523 */ setOnlineState(true, false); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ public void waitForConnection(ConnectionWaiter cw) +/* */ { +/* 531 */ this._waiters.addWaiter(cw); +/* */ } +/* */ +/* */ +/* */ public void goOffline(boolean relogin) +/* */ { +/* 537 */ this._relogin = relogin; +/* */ +/* 539 */ if (!this._serverTracker.isActive()) { +/* 540 */ this._relogin = false; +/* */ } +/* */ +/* */ +/* 544 */ synchronized (this._serverTracker) { +/* 545 */ Enumeration<WorldServer> list = this._serverTracker.getAllServers(); +/* 546 */ while (list.hasMoreElements()) { +/* 547 */ WorldServer ws = (WorldServer)list.nextElement(); +/* 548 */ ws.forceOffline(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ private void killZombies() +/* */ { +/* 556 */ synchronized (this._serverTracker) { +/* 557 */ Enumeration<WorldServer> list = this._serverTracker.getAllServers(); +/* 558 */ while (list.hasMoreElements()) { +/* 559 */ ((WorldServer)list.nextElement()).killZombies(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ void goOnline() +/* */ { +/* 566 */ synchronized (this._serverTracker) { +/* 567 */ Enumeration<WorldServer> list = this._serverTracker.getAllServers(); +/* 568 */ while (list.hasMoreElements()) { +/* 569 */ WorldServer ws = (WorldServer)list.nextElement(); +/* 570 */ ws.goOnline(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* 576 */ reacquireServer(null); +/* */ } +/* */ +/* */ public static synchronized void forceOffline(boolean relogin) { +/* 580 */ if (!_globalUserAllowsOnline) +/* 581 */ return; +/* 582 */ _globalUserAllowsOnline = false; +/* 583 */ synchronized (_galaxyHash) { +/* 584 */ Enumeration<Galaxy> list = _galaxyHash.elements(); +/* 585 */ while (list.hasMoreElements()) { +/* 586 */ Galaxy g = (Galaxy)list.nextElement(); +/* 587 */ g.goOffline(relogin); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void localForceOnline() +/* */ { +/* 611 */ _globalUserAllowsOnline = true; +/* 612 */ this._relogin = false; +/* 613 */ if (isActive()) +/* 614 */ return; +/* 615 */ setOnlineState(false, false); +/* 616 */ this._localUserAllowsOnline = true; +/* 617 */ if (getGalaxyType() != 0) +/* */ { +/* */ +/* 620 */ setChatname(""); +/* 621 */ this._wizard = new LoginWizard(this, getIniSection()); +/* 622 */ System.out.println("LWDB: brought up " + this._wizard + +/* 623 */ " in localForceOnline"); +/* */ +/* */ +/* */ } +/* */ else +/* */ { +/* */ +/* */ +/* 631 */ reacquireServer(null); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static int getDebugLevel() +/* */ { +/* 640 */ return _debugLevel; +/* */ } +/* */ +/* */ +/* */ public static void printDebugging() +/* */ { +/* 646 */ System.out.println("----GALAXY DEBUGGING-------"); +/* 647 */ Enumeration<Galaxy> e = _galaxyHash.elements(); +/* 648 */ while (e.hasMoreElements()) { +/* 649 */ Galaxy g = (Galaxy)e.nextElement(); +/* 650 */ System.out.println(g + " : "); +/* 651 */ System.out.println(g._serverTracker); +/* */ } +/* 653 */ System.out.println("---------------------------"); +/* */ } +/* */ +/* */ public String getChannel() +/* */ { +/* 658 */ return this._channel; +/* */ } +/* */ +/* */ +/* */ +/* */ void setChannel(String channel) +/* */ { +/* 665 */ changeChannel(channel, false); +/* */ } +/* */ +/* */ +/* */ public void changeChannel(String channel) +/* */ { +/* 671 */ if (channel == null) +/* 672 */ channel = ""; +/* 673 */ channel = channel.replace(' ', '_'); +/* 674 */ channel = channel.replace('<', '{'); +/* 675 */ channel = channel.replace('>', '}'); +/* 676 */ changeChannel(channel, true); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ private void changeChannel(String channel, boolean sendMsg) +/* */ { +/* 684 */ if (!channel.equals(this._channel)) +/* */ { +/* */ +/* 687 */ String oldChannel = this._channel; +/* 688 */ this._channel = channel; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 695 */ Hashtable<String, NetworkObject> tmpIDtable = (Hashtable)this._nFlongID.clone(); +/* */ +/* */ +/* 698 */ Enumeration<NetworkObject> e = tmpIDtable.elements(); +/* 699 */ while (e.hasMoreElements()) { +/* 700 */ NetworkObject no = (NetworkObject)e.nextElement(); +/* 701 */ assert (no != null); +/* 702 */ no.changeChannel(this, oldChannel, this._channel); +/* */ } +/* 704 */ if (sendMsg) { +/* 705 */ WorldServer ws = this._serverTracker.getActive(this); +/* 706 */ if (ws != null) { +/* 707 */ ws.tmpRefCnt(this); +/* */ try { +/* 709 */ ws.sendNetworkMsg(new ChannelCmd(channel)); +/* */ } catch (PacketTooLargeException e1) { +/* 711 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ catch (InfiniteWaitException localInfiniteWaitException) {} +/* */ } +/* */ } +/* */ } +/* */ } +/* */ +/* */ public ServerURL getServerURL() +/* */ { +/* 721 */ return this._serverURL; +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 726 */ if (this._serverURL == null) { +/* 727 */ return "AnonGalaxy=" + super.toString(); +/* */ } +/* 729 */ return "Galaxy[" + this._serverURL + "]"; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void swapServer(WorldServer oldServ, WorldServer newServ) +/* */ { +/* 740 */ if ((_debugLevel & 0x2000) > 0) { +/* 741 */ System.out.println(this + ".swapServer(" + oldServ + ", " + +/* 742 */ newServ + ")"); +/* */ } +/* 744 */ this._serverTracker.swapServer(oldServ, newServ); +/* 745 */ reacquireServer(oldServ); +/* */ } +/* */ +/* */ void reacquireServer(WorldServer oldServ) +/* */ { +/* 750 */ if ((_debugLevel & 0x2000) > 0) { +/* 751 */ System.out.println(this + ".reacquireServer(" + oldServ + ")"); +/* */ } +/* */ +/* */ +/* 755 */ Enumeration<NetworkObject> e = this._nFlongID.elements(); +/* 756 */ while (e.hasMoreElements()) { +/* 757 */ ((NetworkObject)e.nextElement()).reacquireServer(oldServ); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void regObject(String longID, NetworkObject obj) +/* */ { +/* 770 */ if ((_debugLevel & 0x2000) > 0) { +/* 771 */ System.out.println(this + ".regObject(" + longID + ", " + obj + +/* 772 */ ")"); +/* */ } +/* */ +/* */ +/* 776 */ this._nFlongID.put(longID, obj); +/* */ } +/* */ +/* */ +/* */ +/* */ public NetworkObject getObject(String longID) +/* */ { +/* 783 */ return (NetworkObject)this._nFlongID.get(longID); +/* */ } +/* */ +/* */ public void delObject(String longID) +/* */ { +/* 788 */ if ((_debugLevel & 0x2000) > 0) { +/* 789 */ System.out.println(this + ".delObject(" + longID + ")"); +/* */ } +/* */ +/* 792 */ this._nFlongID.remove(longID); +/* */ } +/* */ +/* */ public void forceObjectRereg() +/* */ { +/* 797 */ if ((_debugLevel & 0x2000) > 0) { +/* 798 */ System.out.println(this + ".forceObjectRereg()"); +/* */ } +/* */ +/* */ +/* 802 */ Hashtable<String, NetworkObject> oldTable = this._nFlongID; +/* 803 */ this._nFlongID = new Hashtable(); +/* 804 */ Enumeration<NetworkObject> e = oldTable.elements(); +/* */ +/* 806 */ while (e.hasMoreElements()) { +/* 807 */ ((NetworkObject)e.nextElement()).register(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ private void forceDisconnect() +/* */ { +/* 816 */ if ((_debugLevel & 0x2000) > 0) { +/* 817 */ System.out.println(this + ".forceDisconnect()"); +/* */ } +/* 819 */ Enumeration<NetworkObject> e = this._nFlongID.elements(); +/* 820 */ while (e.hasMoreElements()) { +/* 821 */ NetworkObject no = (NetworkObject)e.nextElement(); +/* 822 */ assert (no != null); +/* 823 */ no.galaxyDisconnected(); +/* */ } +/* */ } +/* */ +/* */ void addRoomRequest(String roomName, NetworkRoom room) { +/* 828 */ assert (this._roomTable != null); +/* 829 */ this._roomTable.addRequest(roomName, room); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void delRoomRequest(String roomName) +/* */ { +/* 838 */ if (this._roomTable == null) +/* 839 */ return; +/* 840 */ this._roomTable.delRequest(roomName); +/* */ } +/* */ +/* */ +/* */ NetworkRoom regRoomID(int roomID, String roomName) +/* */ { +/* 846 */ assert (this._roomTable != null); +/* 847 */ NetworkRoom room = this._roomTable.getRequest(roomName); +/* */ +/* */ +/* */ +/* 851 */ if ((roomID != 0) && (room != null)) { +/* 852 */ this._roomTable.regRoomID(roomID, room); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 859 */ return room; +/* */ } +/* */ +/* */ +/* */ public void setRoomID(int roomID, NetworkRoom room) +/* */ { +/* 865 */ assert (this._roomTable != null); +/* 866 */ assert (roomID != 0); +/* 867 */ assert (room != null); +/* 868 */ this._roomTable.regRoomID(roomID, room); +/* */ } +/* */ +/* */ void delRoomID(int roomID, NetworkRoom room) +/* */ { +/* 873 */ if (this._roomTable == null) +/* 874 */ return; +/* 875 */ this._roomTable.delRoomID(roomID, room); +/* */ } +/* */ +/* */ NetworkRoom getRoom(int roomID) { +/* 879 */ if (this._roomTable == null) +/* 880 */ return null; +/* 881 */ return this._roomTable.getRoom(roomID); +/* */ } +/* */ +/* */ void setGalaxyType(int type) { +/* 885 */ this._serverType = type; +/* 886 */ if (_globalUserAllowsOnline) +/* */ { +/* */ +/* */ +/* 890 */ setOnlineState(false, this._online); +/* 891 */ setChatname(""); +/* 892 */ this._wizard = new LoginWizard(this, getIniSection()); +/* 893 */ System.out.println("LWDB: brought up " + this._wizard + +/* 894 */ " in setGalaxyType"); +/* */ } +/* */ } +/* */ +/* */ public int getGalaxyType() { +/* 899 */ return this._serverType; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void setAuthInfo(String usernm, String newUsernm, String passwd, String newPasswd, String serial, int mode) +/* */ { +/* 907 */ _globalUserAllowsOnline = true; +/* 908 */ this._localUserAllowsOnline = true; +/* */ +/* */ +/* */ +/* 912 */ assert (this._serverType != 0); +/* 913 */ setUsernameU(usernm); +/* 914 */ setChatname(usernm); +/* 915 */ this._newUsername = newUsernm; +/* 916 */ this._password = passwd; +/* 917 */ this._newPassword = newPasswd; +/* 918 */ this._serial = serial; +/* 919 */ this._mode = mode; +/* 920 */ switch (this._serverType) +/* */ { +/* */ case 1: +/* 923 */ switch (this._mode) { +/* */ case 3: +/* 925 */ this._password = null; +/* 926 */ this._serial = null; +/* 927 */ break; +/* */ case 2: +/* 929 */ this._serial = null; +/* 930 */ break; +/* */ } +/* */ +/* 933 */ if ((!$assertionsDisabled) && +/* 934 */ (this._mode == 4)) { throw new AssertionError(); +/* */ } +/* */ break; +/* */ case 3: +/* 938 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ break; +/* */ case 4: +/* 941 */ assert (this._mode == 2); +/* */ +/* */ case 2: +/* 944 */ assert (this._mode != 1); +/* 945 */ assert (this._mode != 4); +/* 946 */ if ((this._password != null) && (this._password.length() != 0)) { +/* 947 */ System.out.println(this + ": Password shouldn't be specified."); +/* */ } +/* 949 */ this._password = null; +/* 950 */ if ((this._serial != null) && (this._serial.length() != 0)) { +/* 951 */ System.out.println(this + +/* 952 */ ": Serial number shouldn't be specified."); +/* */ } +/* 954 */ this._serial = null; +/* */ } +/* */ +/* 957 */ goOnline(); +/* */ } +/* */ +/* */ public String getSerialNum() { +/* 961 */ return this._serial; +/* */ } +/* */ +/* */ public String getPassword() { +/* 965 */ return this._password; +/* */ } +/* */ +/* */ String getNewPassword() { +/* 969 */ return this._newPassword; +/* */ } +/* */ +/* */ public String getChatname() { +/* 973 */ return this._username; +/* */ } +/* */ +/* */ String getNewChatname() { +/* 977 */ return this._newUsername; +/* */ } +/* */ +/* */ String getGuestExpiration() { +/* 981 */ if (!$assertionsDisabled) throw new AssertionError(); +/* 982 */ return null; +/* */ } +/* */ +/* */ public int getLoginMode() { +/* 986 */ return this._mode; +/* */ } +/* */ +/* */ +/* */ +/* */ void setOnlineState(boolean enabled, boolean online) +/* */ { +/* 993 */ synchronized (this) { +/* 994 */ this._onlineEnabled = enabled; +/* 995 */ this._online = online; +/* */ } +/* */ +/* 998 */ synchronized (this._consoleList) { +/* 999 */ Enumeration<NetworkObject> cList = getConsoles(); +/* 1000 */ while (cList.hasMoreElements()) { +/* 1001 */ Console c = (Console)cList.nextElement(); +/* 1002 */ c.setOnlineState(enabled, online); +/* */ } +/* */ } +/* */ } +/* */ +/* */ public boolean getOnlineEnabled() { +/* 1008 */ return this._onlineEnabled; +/* */ } +/* */ +/* */ public boolean getOnline() { +/* 1012 */ return this._online; +/* */ } +/* */ +/* */ void setPassword(String password) { +/* 1016 */ this._password = password; +/* */ } +/* */ +/* */ void setNewPassword(String password) { +/* 1020 */ this._newPassword = password; +/* */ } +/* */ +/* */ void setNewChatname(String chatname) { +/* 1024 */ this._newUsername = chatname; +/* */ } +/* */ +/* */ void setSerialNum(String sn) { +/* 1028 */ this._serial = sn; +/* */ } +/* */ +/* */ public void setUsernameU(String username) { +/* 1032 */ this._usernameU = username; +/* */ } +/* */ +/* */ public String getUsernameU() { +/* 1036 */ return this._usernameU; +/* */ } +/* */ +/* */ void setChatname(String newname) { +/* 1040 */ synchronized (this) +/* */ { +/* */ +/* 1043 */ this._consoleList = new NetworkMulti(newname, this._consoleList, this); +/* */ +/* */ +/* 1046 */ if (this._username != null) { +/* 1047 */ delObject(this._username); +/* */ } +/* 1049 */ regObject(newname, this._consoleList); +/* */ +/* */ +/* 1052 */ this._username = newname; +/* */ } +/* */ +/* */ +/* 1056 */ synchronized (this._consoleList) { +/* 1057 */ Enumeration<NetworkObject> cList = getConsoles(); +/* 1058 */ while (cList.hasMoreElements()) { +/* 1059 */ Console c = (Console)cList.nextElement(); +/* 1060 */ c.setChatname(this._username); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* 1066 */ synchronized (this._serverTracker) { +/* 1067 */ Enumeration<WorldServer> list = this._serverTracker.getAllServers(); +/* 1068 */ while (list.hasMoreElements()) { +/* 1069 */ WorldServer ws = (WorldServer)list.nextElement(); +/* 1070 */ ws.regShortID(1, this._username); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public IniFile getIniSection() +/* */ { +/* 1085 */ if (this._serverURL == null) { +/* 1086 */ return new IniFile("UNSHARED"); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1096 */ return new IniFile(this._serverURL.getHost()); +/* */ } +/* */ +/* */ +/* */ public void dialogDone(Object who, boolean confirmed) +/* */ { +/* 1102 */ if ((who instanceof LoginWizard)) +/* */ { +/* */ +/* 1105 */ synchronized (this._wizardMutex) { +/* 1106 */ System.out.println("LWDB: setting who " + who + " wiz " + +/* 1107 */ this._wizard + " to null"); +/* 1108 */ this._wizard = null; +/* */ } +/* 1110 */ if (!confirmed) +/* */ { +/* 1112 */ setOnlineState(true, false); +/* 1113 */ this._localUserAllowsOnline = false; +/* */ } else { +/* 1115 */ this._localUserAllowsOnline = true; +/* 1116 */ _globalUserAllowsOnline = true; +/* */ } +/* */ } +/* 1119 */ else if ((who instanceof InternetConnectionDialog)) { +/* 1120 */ this._icd = null; +/* 1121 */ if (!confirmed) +/* */ { +/* 1123 */ setOnlineState(true, false); +/* 1124 */ this._localUserAllowsOnline = false; +/* */ } else { +/* 1126 */ this._localUserAllowsOnline = true; +/* 1127 */ _globalUserAllowsOnline = true; +/* */ +/* */ +/* */ +/* */ +/* 1132 */ reacquireServer(null); +/* */ } +/* */ } +/* 1135 */ else if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ public void addConsole(Console c) { +/* 1140 */ assert (this._consoleList != null); +/* 1141 */ this._consoleList.addObject(c); +/* 1142 */ setOnlineState(this._onlineEnabled, this._online); +/* */ } +/* */ +/* */ public void delConsole(Console c) { +/* 1146 */ assert (this._consoleList != null); +/* 1147 */ this._consoleList.delObject(c); +/* */ } +/* */ +/* */ public Enumeration<NetworkObject> getConsoles() { +/* 1151 */ return this._consoleList.elements(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void sentFriendsList(boolean state) +/* */ { +/* 1162 */ this.sentFriendsList = state; +/* */ } +/* */ +/* */ public boolean sentFriendsList() +/* */ { +/* 1167 */ return this.sentFriendsList; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public int getProtocol() +/* */ { +/* 1178 */ return this.protocolLevel; +/* */ } +/* */ +/* */ void setProtocol(int level) +/* */ { +/* 1183 */ this.protocolLevel = level; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\Galaxy.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/IPhone.java b/NET/worlds/network/IPhone.java new file mode 100644 index 0000000..d6f91da --- /dev/null +++ b/NET/worlds/network/IPhone.java @@ -0,0 +1,190 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.ConfirmDialog; +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.DialogReceiver; +/* */ import NET.worlds.core.RegKey; +/* */ import NET.worlds.core.RegKeyNotFoundException; +/* */ import java.io.IOException; +/* */ import java.net.InetAddress; +/* */ import java.net.UnknownHostException; +/* */ import java.text.MessageFormat; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class IPhone +/* */ implements DialogReceiver +/* */ { +/* 22 */ private static String _IPhoneProgPath = null; +/* 23 */ private static ConfirmDialog _dlg = null; +/* */ private String _name; +/* */ private String _ip; +/* */ +/* */ private IPhone(String name, String ip) +/* */ { +/* 29 */ this._name = name; +/* 30 */ this._ip = ip; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static synchronized boolean placeCall(String name, String text) +/* */ { +/* 45 */ if (_dlg != null) { +/* 46 */ return false; +/* */ } +/* 48 */ String s = text.trim(); +/* 49 */ if ((s.startsWith("[TALK:")) && (s.endsWith("]"))) { +/* 50 */ s = s.substring(6, s.length() - 1); +/* */ +/* 52 */ IPhone fone = new IPhone(name, s); +/* */ +/* 54 */ _dlg = new ConfirmDialog(Console.getFrame(), fone, +/* 55 */ "Internet Phone Request", name + +/* 56 */ " has requested an Internet Phone call. " + +/* 57 */ "Do you want to call them?"); +/* */ +/* 59 */ return true; +/* */ } +/* 61 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static boolean isCall(String text) +/* */ { +/* 71 */ String s = text.trim().toUpperCase(); +/* 72 */ return (s.startsWith("[TALK")) && (s.endsWith("]")); +/* */ } +/* */ +/* */ public static String initiateCall(String text) { +/* 76 */ if (_IPhoneProgPath == null) { +/* 77 */ getRegEntry(); +/* */ } +/* 79 */ if (_IPhoneProgPath.equals("")) { +/* 80 */ return "Can't initiate call -- no Internet Telephone Application found."; +/* */ } +/* 82 */ String ret = "[BAD REMOTE HOST ADDRESS]"; +/* */ try { +/* 84 */ String s = InetAddress.getLocalHost().toString(); +/* 85 */ s = s.substring(s.indexOf('/') + 1); +/* 86 */ ret = "[TALK:" + s + "]"; +/* */ +/* */ +/* 89 */ Runtime.getRuntime().exec(_IPhoneProgPath); +/* */ } +/* */ catch (SecurityException e) { +/* 92 */ ret = "Can't initiate call -- couldn't start Internet Telephone Application."; +/* */ } +/* */ catch (UnknownHostException e) { +/* 95 */ e.printStackTrace(); +/* */ } catch (IOException e) { +/* 97 */ e.printStackTrace(); +/* */ } +/* */ +/* 100 */ return ret; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static void getRegEntry() +/* */ { +/* */ try +/* */ { +/* 113 */ RegKey root = RegKey.getRootKey(2); +/* 114 */ RegKey key = new RegKey( +/* 115 */ root, +/* 116 */ "SOFTWARE\\Classes\\InternetPhoneUser\\shell\\open\\command", +/* 117 */ 0); +/* 118 */ _IPhoneProgPath = key.getStringValue(""); +/* 119 */ key.close(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 127 */ int idx = _IPhoneProgPath.indexOf('"'); +/* 128 */ if (idx == 0) { +/* 129 */ _IPhoneProgPath = _IPhoneProgPath.substring(1, +/* 130 */ _IPhoneProgPath.indexOf('"', 1)); +/* */ } else { +/* 132 */ _IPhoneProgPath = _IPhoneProgPath.substring(0, idx); +/* */ } +/* */ } +/* */ catch (RegKeyNotFoundException e) { +/* 136 */ _IPhoneProgPath = ""; +/* */ } +/* */ } +/* */ +/* */ private void talkToPhoneService() { +/* 141 */ DDEMLClass ddeml = new DDEMLClass("InternetPhone", "CallIP"); +/* 142 */ ddeml.Request("," + this._ip); +/* 143 */ ddeml.destroy(); +/* */ +/* 145 */ ddeml = new DDEMLClass("InternetPhone", "Show"); +/* 146 */ ddeml.Request("2"); +/* 147 */ ddeml.destroy(); +/* */ } +/* */ +/* */ public void dialogDone(Object who, boolean confirmed) +/* */ { +/* 152 */ if (confirmed) { +/* 153 */ Object[] arguments = { new String(this._name), new String(this._ip) }; +/* 154 */ Console.println(MessageFormat.format(Console.message("Calling-IP"), +/* 155 */ arguments)); +/* */ +/* 157 */ if (_IPhoneProgPath == null) { +/* 158 */ getRegEntry(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ try +/* */ { +/* 172 */ Runtime.getRuntime().exec(_IPhoneProgPath); +/* 173 */ talkToPhoneService(); +/* */ } +/* */ catch (SecurityException e) { +/* 176 */ Console.println(Console.message("Call-failed")); +/* */ } catch (Exception e) { +/* 178 */ e.printStackTrace(); +/* */ } +/* */ } +/* */ +/* 182 */ _dlg = null; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\IPhone.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/InfiniteWaitException.java b/NET/worlds/network/InfiniteWaitException.java new file mode 100644 index 0000000..950ab29 --- /dev/null +++ b/NET/worlds/network/InfiniteWaitException.java @@ -0,0 +1,32 @@ +/* */ package NET.worlds.network; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class InfiniteWaitException +/* */ extends Exception +/* */ { +/* */ private static final long serialVersionUID = -8872856399045515110L; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public InfiniteWaitException() {} +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public InfiniteWaitException(String msg) +/* */ { +/* 24 */ super(msg); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\InfiniteWaitException.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/InvalidServerURLException.java b/NET/worlds/network/InvalidServerURLException.java new file mode 100644 index 0000000..4ac1829 --- /dev/null +++ b/NET/worlds/network/InvalidServerURLException.java @@ -0,0 +1,32 @@ +/* */ package NET.worlds.network; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class InvalidServerURLException +/* */ extends Exception +/* */ { +/* */ private static final long serialVersionUID = 5256010949259135827L; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public InvalidServerURLException() {} +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public InvalidServerURLException(String msg) +/* */ { +/* 24 */ super(msg); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\InvalidServerURLException.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/LoginMode.java b/NET/worlds/network/LoginMode.java new file mode 100644 index 0000000..3512f5e --- /dev/null +++ b/NET/worlds/network/LoginMode.java @@ -0,0 +1,16 @@ +package NET.worlds.network; + +public abstract interface LoginMode +{ + public static final int UNKNOWN = 0; + public static final int REGISTER = 1; + public static final int AUTHENTICATE = 2; + public static final int GUESTLOGIN = 3; + public static final int ABORT = 4; +} + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\LoginMode.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/NetUpdate.java b/NET/worlds/network/NetUpdate.java new file mode 100644 index 0000000..bbf8a1b --- /dev/null +++ b/NET/worlds/network/NetUpdate.java @@ -0,0 +1,1788 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.Gamma; +/* */ import NET.worlds.console.InternetConnectionDialog; +/* */ import NET.worlds.console.LoginWizard; +/* */ import NET.worlds.console.Main; +/* */ import NET.worlds.console.ProgressBar; +/* */ import NET.worlds.console.Window; +/* */ import NET.worlds.console.WorldsMarkPart; +/* */ import NET.worlds.core.IniFile; +/* */ import NET.worlds.core.RegKey; +/* */ import NET.worlds.core.RegKeyNotFoundException; +/* */ import NET.worlds.core.ServerTableManager; +/* */ import NET.worlds.core.Std; +/* */ import NET.worlds.scape.SendURLAction; +/* */ import NET.worlds.scape.World; +/* */ import java.io.DataInputStream; +/* */ import java.io.FileInputStream; +/* */ import java.io.FileNotFoundException; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.text.MessageFormat; +/* */ import java.util.Date; +/* */ import java.util.StringTokenizer; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class NetUpdate +/* */ implements Runnable, RemoteFileConst +/* */ { +/* */ static final String VERSIONS = "upgrades.lst"; +/* */ static final String WORLDVERSIONS = "upgrades.lst"; +/* */ static final String SERVER = "upgradeServer"; +/* */ static final String RESTARTCMD = "WorldsPlayer.exe"; +/* */ static final String WORLDCURVER = "\\ver.txt"; +/* */ static final String UPGRADER = ".\\bin\\gdkup.exe"; +/* */ static final String SCRIPTFILE = "updates.lst"; +/* */ static final String LANGUAGES = "languages.lst"; +/* */ static final int UPGRADETIMEOUT; +/* */ static int TESTAUTOUPGRADE; +/* */ static final int TESTWORLDAUTOUPGRADE; +/* */ private static String uServer; +/* */ private static String overrideServer; +/* */ public static String overrideWorldServer; +/* */ private static int _today; +/* */ +/* */ static String getUpgradeServerIniEntry(IniFile ini) +/* */ { +/* 189 */ if (ini == null) { +/* 190 */ return ""; +/* */ } +/* 192 */ String s = ini.getIniString("upgradeServer", ""); +/* 193 */ return s; +/* */ } +/* */ +/* */ static +/* */ { +/* 178 */ UPGRADETIMEOUT = IniFile.gamma().getIniInt( +/* 179 */ "upgradeTimeout", 7); +/* 180 */ TESTAUTOUPGRADE = IniFile.gamma() +/* 181 */ .getIniInt("testautoupgrade", 0); +/* */ +/* 183 */ TESTWORLDAUTOUPGRADE = IniFile.gamma().getIniInt( +/* 184 */ "testworldautoupgrade", 0); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 200 */ uServer = getUpgradeServerIniEntry(IniFile.gamma()); +/* */ +/* 202 */ overrideWorldServer = null; +/* */ +/* 204 */ IniFile oini = IniFile.override(); +/* 205 */ if (oini != null) { +/* 206 */ overrideWorldServer = oini.getIniString("WorldServer", ""); +/* 207 */ if (overrideWorldServer.equals("")) +/* */ { +/* 209 */ if (Gamma.shaperEnabled()) { +/* 210 */ overrideWorldServer = "worldserver://test.3dcd.com"; +/* */ } else { +/* 212 */ overrideWorldServer = null; +/* */ } +/* */ } +/* */ } +/* 216 */ String s = getUpgradeServerIniEntry(oini); +/* 217 */ if (!s.equals("")) { +/* 218 */ overrideServer = s; +/* 219 */ uServer = s; +/* */ } +/* */ +/* */ +/* */ +/* 224 */ URL.setHttpServer(uServer.substring(0, uServer.lastIndexOf('/') + 1)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static void setUpgradeServerURL(String url) +/* */ { +/* 243 */ if (overrideServer == null) +/* */ { +/* */ +/* */ +/* */ +/* 248 */ String upgradeDir = uServer; +/* */ +/* 250 */ int start = upgradeDir.length() - 1; +/* 251 */ if (start != -1) { +/* 252 */ if (upgradeDir.charAt(start) == '/') +/* 253 */ start--; +/* 254 */ upgradeDir = upgradeDir.substring(upgradeDir.lastIndexOf('/', +/* 255 */ start)); +/* 256 */ uServer = url + upgradeDir; +/* 257 */ URL.setHttpServer(url + "/"); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ public static boolean isInternalVersion() +/* */ { +/* 265 */ String chatName = null; +/* */ +/* 267 */ Console c = Console.getActive(); +/* 268 */ Galaxy g = null; +/* 269 */ if (c != null) { +/* 270 */ g = c.getGalaxy(); +/* */ } +/* */ +/* 273 */ if ((g != null) && (g.getOnline())) { +/* 274 */ chatName = g.getChatname(); +/* */ } else { +/* 276 */ String entry = IniFile.gamma().getIniString("lastchatname", "Fred"); +/* */ +/* 278 */ if ((entry.startsWith("VIP ")) || (entry.startsWith("vip "))) { +/* 279 */ chatName = entry.substring(4); +/* */ } +/* */ } +/* */ +/* 283 */ if (chatName != null) { +/* 284 */ String[] employeeList = ServerTableManager.instance().getTable( +/* 285 */ "employeeAccounts"); +/* 286 */ if (employeeList == null) { +/* 287 */ return false; +/* */ } +/* 289 */ for (int i = 0; i < employeeList.length; i++) { +/* 290 */ if (employeeList[i].equals(chatName)) { +/* 291 */ return true; +/* */ } +/* */ } +/* */ } +/* */ +/* 296 */ return false; +/* */ } +/* */ +/* */ public static String getInfoURL() { +/* 300 */ return getInfoURL(""); +/* */ } +/* */ +/* */ public static String getInfoURL(String info) { +/* 304 */ String url = getUpgradeServerURL(); +/* 305 */ if (url == null) { +/* 306 */ return null; +/* */ } +/* 308 */ String page = IniFile.override().getIniString("InfoPage", +/* 309 */ "index" + Console.message(".html")); +/* */ +/* */ +/* 312 */ if (Console.wasHttpNoSuchFile(url + info + page)) { +/* 313 */ page = IniFile.override().getIniString("InfoPage", "index.html"); +/* */ } +/* 315 */ return url + info + page; +/* */ } +/* */ +/* */ public static String getUpgradeServerURL() { +/* 319 */ if (uServer.equals("")) { +/* 320 */ return null; +/* */ } +/* 322 */ if (!uServer.endsWith("/")) { +/* 323 */ uServer += "/"; +/* */ } +/* 325 */ return uServer; +/* */ } +/* */ +/* */ public static void showInfo() +/* */ { +/* 330 */ showInfo(""); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static void showInfo(String info) +/* */ { +/* 338 */ new SendURLAction(getInfoURL(info)).startBrowser(); +/* */ } +/* */ +/* */ +/* */ +/* */ private static boolean openPage(String browser, String destination) +/* */ { +/* 345 */ DDEMLClass ddeml = new DDEMLClass(browser, "WWW_Activate"); +/* 346 */ boolean val = ddeml.Request("-1,0"); +/* 347 */ ddeml.destroy(); +/* */ +/* 349 */ if (!val) { +/* 350 */ return false; +/* */ } +/* 352 */ ddeml = new DDEMLClass(browser, "WWW_OpenURL"); +/* 353 */ val = ddeml.Request("\"" + destination + "\",,-1,0,,,"); +/* 354 */ ddeml.destroy(); +/* */ +/* 356 */ return val; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 362 */ private static boolean beenCalled = false; +/* 363 */ static int gdkver = 0; +/* */ +/* */ private boolean _force; +/* */ private boolean forceWorldLoad; +/* */ private String worldToUpdate; +/* */ +/* */ private NetUpdate(boolean force) +/* */ { +/* 371 */ this._force = force; +/* */ } +/* */ +/* */ private NetUpdate(String w) { +/* 375 */ this.worldToUpdate = w; +/* */ } +/* */ +/* */ private NetUpdate(String w, boolean forceWorldLoad) { +/* 379 */ this.worldToUpdate = w; +/* 380 */ this.forceWorldLoad = forceWorldLoad; +/* */ } +/* */ +/* */ static void notifyUser(String msg) { +/* 384 */ Console.println(msg); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ static void warnUser(String msg) +/* */ { +/* 393 */ IniFile.gamma().setIniString("RunUpgrade", ""); +/* 394 */ notifyUser(msg); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static boolean timeToUpdate(boolean force) +/* */ { +/* 403 */ while ((Window.getMainWindow() == null) || ( +/* 404 */ (!LoginWizard.isFirstTimeDone()) && +/* 405 */ (!InternetConnectionDialog.isFirstTimeDone()))) { +/* */ try { +/* 407 */ Thread.sleep(1000L); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* */ } +/* */ +/* 412 */ if (!force) +/* */ { +/* */ +/* */ +/* */ +/* 417 */ if (IniFile.gamma().getIniInt("lastUpgradeCheck", 0) + UPGRADETIMEOUT > _today) { +/* 418 */ return false; +/* */ } +/* */ +/* */ +/* 422 */ if ((!LoginWizard.isFirstTimeDone()) && +/* 423 */ (InternetConnectionDialog.choseSingleUserMode())) { +/* 424 */ return false; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 435 */ if (getUpgradeServerURL() == null) { +/* 436 */ Object[] arguments = { new String("upgradeServer") }; +/* 437 */ notifyUser(MessageFormat.format(Console.message("upgrade-check"), +/* 438 */ arguments)); +/* */ +/* */ +/* 441 */ return false; +/* */ } +/* 443 */ return true; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 450 */ static int maxVers = IniFile.gamma().getIniInt("maxupgradeversion", +/* 451 */ 999999999); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static final String INTERNAL = "internal"; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static final String EXTERNAL = "external"; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static int getNextVers(String line, int vers, int testLevel, int[] retSize) +/* */ { +/* 474 */ StringTokenizer st = null; +/* */ try +/* */ { +/* 477 */ st = new StringTokenizer(line); +/* 478 */ if (!st.hasMoreTokens()) { +/* 479 */ return -1; +/* */ } +/* 481 */ int v = Integer.parseInt(st.nextToken()); +/* */ +/* */ +/* 484 */ if ((!st.hasMoreTokens()) || ((vers >= 0) && (v != vers)) || ( +/* 485 */ (vers < 0) && ((v > 0) || (v < vers)))) { +/* 486 */ return -1; +/* */ } +/* 488 */ int best = -1; +/* */ +/* */ +/* 491 */ while (st.hasMoreTokens()) { +/* 492 */ String s = st.nextToken(); +/* */ +/* 494 */ int colon = s.indexOf(':'); +/* 495 */ if (colon != -1) { +/* 496 */ int need = Integer.parseInt(s.substring(colon + 1)); +/* */ +/* */ +/* 499 */ if (need > 9999) { +/* 500 */ need /= 10; +/* */ } +/* 502 */ int fixedGdkVer = gdkver <= 9999 ? gdkver : gdkver / 10; +/* 503 */ int curVer = Std.getVersion(); +/* 504 */ curVer = curVer <= 9999 ? curVer : curVer / 10; +/* */ +/* */ +/* */ +/* 508 */ if ((need <= curVer) && ((gdkver == 0) || (need <= fixedGdkVer))) +/* */ { +/* */ +/* 511 */ s = s.substring(0, colon); +/* */ } +/* */ } else { +/* 514 */ int size = 160000; +/* */ +/* 516 */ int pound = s.indexOf('#'); +/* 517 */ if (pound != -1) { +/* 518 */ size = Integer.parseInt(s.substring(pound + 1)); +/* 519 */ s = s.substring(0, pound); +/* */ } +/* */ +/* 522 */ int t = Integer.parseInt(s); +/* */ +/* */ +/* 525 */ int level = 0; +/* 526 */ if (t >= 999000000) { +/* 527 */ t -= 999000000; +/* */ +/* 529 */ level = t / 100000 + 1; +/* 530 */ t %= 100000; +/* */ +/* 532 */ if (level > testLevel) {} +/* */ +/* */ +/* */ } +/* 536 */ else if ((t <= maxVers) && (t > best)) { +/* 537 */ best = t; +/* 538 */ retSize[0] = size; +/* */ } +/* */ } +/* */ } +/* 542 */ return best; +/* */ } +/* */ catch (NumberFormatException localNumberFormatException) {} +/* */ +/* */ +/* 547 */ return -1; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static String getVersions(URL remoteName, int vers, String patchRoot, Vector<Integer> numbers, Vector<String> patches, Vector<Integer> sizes, String readableName, int test) +/* */ { +/* 578 */ CacheFile cf = Cache.getFile(remoteName, true); +/* 579 */ cf.waitUntilLoaded(); +/* 580 */ if (cf.error()) { +/* 581 */ return "Network error retrieving " + remoteName; +/* */ } +/* 583 */ String localName = cf.getLocalName(); +/* */ try +/* */ { +/* 586 */ in = new FileInputStream(localName); +/* 587 */ DataInputStream dis = new DataInputStream(in); +/* */ +/* */ +/* */ +/* */ +/* 592 */ int[] size = new int[1]; +/* */ String line; +/* 594 */ while ((line = dis.readLine()) != null) { String line; +/* 595 */ int nextVersion = getNextVers(line, vers, test, size); +/* 596 */ if (nextVersion >= 0) { +/* 597 */ if (numbers != null) +/* 598 */ numbers.addElement(new Integer(nextVersion)); +/* 599 */ if (vers < 0) { +/* 600 */ patches.addElement(patchRoot + nextVersion + ".exe"); +/* */ } else +/* 602 */ patches.addElement(patchRoot + vers + "-" + nextVersion + +/* 603 */ ".exe"); +/* 604 */ sizes.addElement(new Integer(size[0])); +/* */ +/* 606 */ vers = nextVersion; +/* */ } +/* */ } +/* 609 */ dis.close(); +/* */ } catch (FileNotFoundException e) { +/* */ FileInputStream in; +/* 612 */ return "system error re-opening " + localName + ": " + e; +/* */ } catch (IOException e) { +/* 614 */ return "System I/O error during upgrade processing"; +/* */ } finally { +/* 616 */ cf.close(); } cf.close(); +/* */ +/* */ +/* 619 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static String getLanguages(URL remoteName, Vector<String> langIDs, Vector<String> subLangIDs, int[] lSizes) +/* */ { +/* 627 */ if (Gamma.loadProgress != null) +/* */ { +/* 629 */ Gamma.loadProgress.setMessage("Downloading language support information..."); +/* 630 */ Gamma.loadProgress.advance(); +/* */ } +/* */ +/* 633 */ CacheFile cf = Cache.getFile(remoteName, true); +/* */ +/* 635 */ cf.waitUntilLoaded(); +/* 636 */ if (cf.error()) { +/* 637 */ return "Network error retrieving " + remoteName; +/* */ } +/* 639 */ String localName = cf.getLocalName(); +/* */ try +/* */ { +/* 642 */ in = new FileInputStream(localName); +/* 643 */ DataInputStream dis = new DataInputStream(in); +/* */ +/* */ +/* 646 */ String lang = null; +/* 647 */ String subLang = null; +/* 648 */ int sz = 0; +/* 649 */ int i = 0; +/* */ String line; +/* 651 */ while ((line = dis.readLine()) != null) { +/* */ String line; +/* 653 */ if ((line.charAt(2) == '_') || (line.charAt(2) == ' ')) { +/* 654 */ lang = line.substring(0, 2); +/* 655 */ subLang = line.substring(3, 5); +/* 656 */ int lng = line.length(); +/* */ try { +/* 658 */ sz = Integer.parseInt(line.substring(6, lng)); +/* */ } catch (NumberFormatException e) { +/* 660 */ System.out.println(line.substring(6, lng) + +/* 661 */ " is not quite a number"); +/* */ } +/* */ +/* 664 */ langIDs.addElement(lang); +/* 665 */ subLangIDs.addElement(subLang); +/* 666 */ lSizes[(i++)] = sz; +/* */ } +/* */ else +/* */ { +/* 670 */ int lastSpace = line.lastIndexOf(' '); +/* 671 */ lang = line.substring(0, lastSpace); +/* 672 */ subLang = null; +/* 673 */ int lng = line.length(); +/* */ try +/* */ { +/* 676 */ sz = Integer.parseInt(line +/* 677 */ .substring(lastSpace + 1, lng)); +/* */ } catch (NumberFormatException e) { +/* 679 */ System.out.println(line.substring(lastSpace, lng) + +/* 680 */ " is not quite a number"); +/* */ } +/* */ +/* 683 */ langIDs.addElement(lang); +/* 684 */ subLangIDs.addElement(subLang); +/* 685 */ lSizes[(i++)] = sz; +/* */ } +/* */ } +/* 688 */ dis.close(); +/* */ } catch (FileNotFoundException e) { +/* */ FileInputStream in; +/* 691 */ return "system error re-opening " + localName + ": " + e; +/* */ } catch (IOException e) { +/* 693 */ return "System I/O error during upgrade processing"; +/* */ } finally { +/* 695 */ cf.close(); } cf.close(); +/* */ +/* */ +/* 698 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static int wantUpdate(Vector<Integer> numbers, Vector<Integer> sizes, boolean first, String name, String info) +/* */ { +/* 710 */ name = WorldsMarkPart.getExternalName(name); +/* 711 */ if (Gamma.shaperEnabled()) { +/* 712 */ Vector<String> names = new Vector(); +/* 713 */ for (int i = 0; i < sizes.size(); i++) +/* 714 */ names.addElement("Rev " + numbers.elementAt(i)); +/* 715 */ return +/* 716 */ new UpgradeDialog(names, sizes, first, name, info, true).confirmUpgradeFromList(); +/* */ } +/* 718 */ return numbers.size(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static Vector<String> needUpdate(int gdkTo, Vector<Integer> sizes, Vector<String> names) +/* */ { +/* 733 */ Vector<String> versionList = new Vector(); +/* 734 */ Vector<Integer> versionNumList = new Vector(); +/* 735 */ sizes.removeAllElements(); +/* */ +/* 737 */ int curVersion = Std.getVersion(); +/* 738 */ String err = getVersions(URL.make(uServer + "upgrades.lst"), curVersion, +/* 739 */ "gdkup", versionNumList, versionList, sizes, +/* 740 */ Std.getProductName(), TESTAUTOUPGRADE); +/* 741 */ if (err != null) { +/* 742 */ System.out.println(err); +/* 743 */ return versionList; +/* */ } +/* */ +/* 746 */ if ((versionList.size() == 0) || ( +/* 747 */ (gdkTo == 0) && +/* 748 */ ((gdkTo = wantUpdate(versionNumList, sizes, false, +/* 749 */ Std.getProductName(), "")) <= 0))) +/* */ { +/* 751 */ gdkTo = 0; +/* */ } +/* */ +/* 754 */ versionList.setSize(gdkTo); +/* 755 */ sizes.setSize(gdkTo); +/* 756 */ for (int i = 0; i < gdkTo; i++) { +/* 757 */ names.addElement(i == gdkTo - 1 ? Std.getProductName() : null); +/* */ } +/* 759 */ if (gdkTo > 0) +/* 760 */ gdkver = ((Integer)versionNumList.elementAt(gdkTo - 1)).intValue(); +/* 761 */ return versionList; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static int getCurrentVersionOfWorld(String worldDir, int curVersion) +/* */ { +/* 772 */ if (worldDir.equals("")) { +/* 773 */ return curVersion; +/* */ } +/* */ try +/* */ { +/* 777 */ DataInputStream dis = new DataInputStream(new FileInputStream( +/* 778 */ worldDir + "\\ver.txt")); +/* 779 */ String line = dis.readLine(); +/* 780 */ dis.close(); +/* 781 */ int lineStart = 0; +/* 782 */ if (line.charAt(0) == '+') { +/* 783 */ lineStart = line.indexOf(' ') + 1; +/* */ } +/* */ +/* 786 */ if (line.regionMatches(true, lineStart, "internal", 0, "internal".length())) { +/* 787 */ line = line.substring(lineStart + "internal".length()); +/* */ } +/* 789 */ else if (line.regionMatches(true, lineStart, "external", 0, "external".length())) { +/* 790 */ line = line.substring(lineStart + "external".length()); +/* */ } +/* 792 */ curVersion = Integer.parseInt(line.trim()); +/* */ } +/* */ catch (FileNotFoundException localFileNotFoundException) {}catch (IOException localIOException) {}catch (NumberFormatException nfe) +/* */ { +/* 796 */ System.out.println("Syntax error in " + worldDir + "\\ver.txt"); +/* */ } +/* 798 */ return curVersion; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private boolean listWorldUpgrades(String world, Vector<String> versionList, Vector<Integer> sizes, Vector<String> names) +/* */ { +/* 814 */ if (world.equals("")) { +/* 815 */ return true; +/* */ } +/* */ +/* 818 */ int curVersion = getCurrentVersionOfWorld(world, (!this.forceWorldLoad) && +/* 819 */ (World.isCloistered()) ? -1 : -2); +/* */ +/* 821 */ Vector<Integer> vnumlist = new Vector(); +/* 822 */ Vector<String> exelist = new Vector(); +/* 823 */ Vector<Integer> sizelist = new Vector(); +/* */ +/* 825 */ String err = getVersions( +/* 826 */ URL.make(getUpgradeServerURL() + world + "/" + "upgrades.lst"), +/* 827 */ curVersion, world + "\\" + world, vnumlist, exelist, sizelist, +/* 828 */ world, TESTWORLDAUTOUPGRADE); +/* 829 */ if (err != null) { +/* 830 */ System.out.println(err); +/* 831 */ } else if (exelist.size() != 0) { +/* 832 */ String name = WorldsMarkPart.getExternalName(world) + " world"; +/* 833 */ int verto = wantUpdate(vnumlist, sizelist, curVersion < 0, "the " + +/* 834 */ name, world + "/"); +/* 835 */ if (verto > 0) { +/* 836 */ exelist.setSize(verto); +/* 837 */ sizelist.setSize(verto); +/* 838 */ for (int i = 0; i < verto; i++) { +/* 839 */ versionList.addElement((String)exelist.elementAt(i)); +/* 840 */ sizes.addElement((Integer)sizelist.elementAt(i)); +/* 841 */ names.addElement(i == verto - 1 ? name : null); +/* */ } +/* */ } +/* */ } else { +/* 845 */ return false; +/* */ } +/* 847 */ return true; +/* */ } +/* */ +/* 850 */ private static int maxworld = -1; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static int maxInstalledWorlds() +/* */ { +/* 860 */ if (maxworld == -1) { +/* 861 */ IniFile ini = new IniFile("InstalledWorlds"); +/* 862 */ maxworld = ini.getIniInt("MaxInstalledWorlds", 0); +/* 863 */ ini.setIniInt("MaxInstalledWorlds", maxworld); +/* */ } +/* 865 */ return maxworld + 50; +/* */ } +/* */ +/* */ +/* */ +/* */ public static void maxInstalledWorld(int n) +/* */ { +/* 872 */ if (maxworld == -1) +/* */ { +/* 874 */ maxInstalledWorlds(); +/* */ } +/* 876 */ if (n > maxworld) { +/* 877 */ maxworld = n; +/* 878 */ IniFile ini = new IniFile("InstalledWorlds"); +/* 879 */ ini.setIniInt("MaxInstalledWorlds", maxworld); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static Vector<String> aboutWorlds() +/* */ { +/* 888 */ Vector<String> result = new Vector(); +/* */ +/* 890 */ IniFile ini = new IniFile("InstalledWorlds"); +/* 891 */ for (int worldNum = 0; worldNum < maxInstalledWorlds(); worldNum++) { +/* 892 */ String name = ini.getIniString("InstalledWorld" + worldNum, +/* 893 */ "").trim(); +/* 894 */ int curVersion = getCurrentVersionOfWorld(name, -1); +/* 895 */ name = WorldsMarkPart.getExternalName(name); +/* */ +/* 897 */ if (curVersion >= 0) { +/* 898 */ result.addElement(name + " version " + curVersion); +/* 899 */ maxInstalledWorld(worldNum); +/* */ } +/* */ } +/* */ +/* 903 */ return result; +/* */ } +/* */ +/* */ private static String getRestartCmd() { +/* 907 */ String restartCmd = "WorldsPlayer.exe"; +/* */ +/* 909 */ restartCmd = restartCmd + " world:restart"; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 932 */ return restartCmd; +/* */ } +/* */ +/* */ private static boolean hasString(Vector<String> v, String s) { +/* 936 */ int j = v.size(); +/* 937 */ do { j--; } while ((j >= 0) && (!s.equals((String)v.elementAt(j)))); +/* */ +/* */ +/* 940 */ return j >= 0; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static boolean loadPatchesAndUpdateScript(Vector<String> patches, String restartCmd, Vector<Integer> sizes, Vector<String> names, String worldDir) +/* */ { +/* 1046 */ Vector<String> alreadyListed = getLinesFromScriptFile(restartCmd); +/* */ +/* */ +/* 1049 */ int i = patches.size(); +/* 1050 */ do { String p = (String)patches.elementAt(i); +/* 1051 */ if (hasString(alreadyListed, p)) { +/* 1052 */ patches.removeElementAt(i); +/* 1053 */ sizes.removeElementAt(i); +/* 1054 */ names.removeElementAt(i); +/* */ } +/* 1049 */ i--; } while (i >= 0); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1058 */ Vector<URL> urls = new Vector(); +/* 1059 */ Vector<Integer> bytes = new Vector(); +/* 1060 */ Vector<String> condensedNames = new Vector(); +/* 1061 */ int entrySize = 0; +/* 1062 */ int totalSize = 0; +/* 1063 */ boolean willNeedRegistry = false; +/* 1064 */ for (int i = 0; i < sizes.size(); i++) { +/* 1065 */ String name = (String)patches.elementAt(i); +/* 1066 */ String dnld = (uServer + name).replace('\\', '/'); +/* 1067 */ urls.addElement(URL.make(dnld)); +/* */ +/* */ +/* 1070 */ if (name.indexOf('-') < 0) { +/* 1071 */ willNeedRegistry = true; +/* */ } +/* 1073 */ entrySize += ((Integer)sizes.elementAt(i)).intValue(); +/* */ +/* 1075 */ if (names.elementAt(i) != null) { +/* 1076 */ totalSize += entrySize; +/* */ +/* 1078 */ bytes.addElement(new Integer(entrySize)); +/* 1079 */ entrySize = 0; +/* 1080 */ condensedNames.addElement((String)names.elementAt(i)); +/* */ } +/* */ } +/* */ +/* 1084 */ assert (entrySize == 0); +/* */ +/* */ +/* */ +/* */ +/* 1089 */ if (totalSize == 0) { +/* 1090 */ return true; +/* */ } +/* */ +/* */ +/* 1094 */ if (!Gamma.shaperEnabled()) { +/* 1095 */ String prodName = worldDir != null ? "the " + worldDir + " world" : +/* 1096 */ Std.getProductName(); +/* 1097 */ Vector<String> rjctdList = new UpgradeDialog(condensedNames, bytes, +/* 1098 */ worldDir != null, prodName, "", false).rejectedList(); +/* */ +/* 1100 */ int i = rjctdList.size(); +/* 1101 */ do { String s = (String)rjctdList.elementAt(i); +/* 1102 */ int j = names.size(); +/* */ do { +/* 1104 */ String t = (String)names.elementAt(j); +/* 1105 */ if ((t != null) && (s.equals(t))) { +/* */ break; +/* */ } +/* 1103 */ j--; } while (j >= 0); +/* */ +/* */ +/* */ +/* */ +/* 1108 */ assert (j >= 0); +/* */ do +/* */ { +/* 1111 */ totalSize -= ((Integer)sizes.elementAt(j)).intValue(); +/* 1112 */ patches.removeElementAt(j); +/* 1113 */ urls.removeElementAt(j); +/* 1114 */ sizes.removeElementAt(j); +/* 1115 */ j--; } while ((j >= 0) && (names.elementAt(j) == null)); +/* 1100 */ i--; } while (i >= 0); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1119 */ if (totalSize == 0) { +/* 1120 */ return false; +/* */ } +/* */ try { +/* 1123 */ if (!new ProgressDialog(totalSize).loadFiles(patches, urls)) +/* 1124 */ return false; +/* */ } catch (IOException e) { +/* 1126 */ warnUser("Error creating upgrade script, upgrade failed"); +/* 1127 */ System.out.println("error creating scriptfile " + e); +/* 1128 */ return false; +/* */ } +/* */ +/* 1131 */ writeScriptFile(alreadyListed, patches, restartCmd); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1140 */ if (willNeedRegistry) +/* */ { +/* */ +/* */ try +/* */ { +/* */ +/* 1146 */ String intExt = isInternalVersion() ? "InternalGDK" : "3DCD"; +/* 1147 */ RegKey root = RegKey.getRootKey(2); +/* 1148 */ RegKey key = new RegKey(root, "SOFTWARE\\Worlds, Inc.\\" + +/* 1149 */ intExt, 0); +/* */ +/* */ +/* 1152 */ String here = URL.homeUnalias("x"); +/* 1153 */ here = here.substring(0, here.length() - 2); +/* */ +/* 1155 */ key.setStringValue("InstallDir", here, false); +/* */ +/* 1157 */ key.close(); +/* */ } +/* */ catch (RegKeyNotFoundException localRegKeyNotFoundException) {} +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 1165 */ return true; +/* */ } +/* */ +/* 1168 */ private static Object updateLoadSyncer = new Object(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static boolean getUpdates(Vector<String> patches, Vector<Integer> sizes, Vector<String> names, String wd) +/* */ { +/* 1179 */ String restartCmd = getRestartCmd(); +/* */ +/* 1181 */ if (restartCmd == null) { +/* 1182 */ notifyUser(Console.message("Automatic-restart")); +/* */ } +/* */ +/* 1185 */ synchronized (updateLoadSyncer) +/* */ { +/* 1187 */ if (!loadPatchesAndUpdateScript(patches, restartCmd, sizes, names, wd)) { +/* 1188 */ return false; +/* */ } +/* */ } +/* */ +/* 1192 */ if (new NewVersionDialog().confirmRestart()) +/* */ { +/* 1194 */ if (runUpdates("updates.lst")) { +/* 1195 */ Main.end(); +/* */ } +/* */ } +/* 1198 */ return true; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static boolean runUpdates(String upgradeScript) +/* */ { +/* 1209 */ IniFile.gamma().setIniString("RunUpgrade", ""); +/* */ +/* 1211 */ if (!CreateProcSpecial(".\\bin\\gdkup.exe", upgradeScript)) +/* */ { +/* 1213 */ System.out.println("error running .\\bin\\gdkup.exe"); +/* 1214 */ return false; +/* */ } +/* 1216 */ return true; +/* */ } +/* */ +/* */ +/* */ public void run() +/* */ { +/* 1222 */ if (this.worldToUpdate != null) { +/* 1223 */ asyncWorldCheck(this.worldToUpdate); +/* 1224 */ return; +/* */ } +/* */ +/* 1227 */ int gdkTo = 0; +/* */ +/* 1229 */ if ((TESTAUTOUPGRADE != 0) || (TESTWORLDAUTOUPGRADE != 0)) { +/* 1230 */ this._force = true; +/* */ } +/* 1232 */ if (timeToUpdate(this._force)) { +/* 1233 */ notifyUser(Console.message("Checking-network")); +/* */ +/* 1235 */ Vector<Integer> sizes = new Vector(); +/* 1236 */ Vector<String> names = new Vector(); +/* 1237 */ Vector<String> updateList = needUpdate(gdkTo, sizes, names); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1244 */ IniFile ini = new IniFile("InstalledWorlds"); +/* 1245 */ for (int i = 0; i < maxInstalledWorlds(); i++) { +/* 1246 */ String name = ini +/* 1247 */ .getIniString("InstalledWorld" + i, "").trim(); +/* 1248 */ if (name.length() > 0) { +/* 1249 */ listWorldUpgrades(name, updateList, sizes, names); +/* 1250 */ maxInstalledWorld(i); +/* */ } +/* */ } +/* */ +/* 1254 */ if ((updateList.size() != 0) && +/* 1255 */ (getUpdates(updateList, sizes, names, null))) { +/* 1256 */ notifyUser(Console.message("finished-checking")); +/* */ } else { +/* 1258 */ notifyUser(Console.message("no-updates")); +/* */ } +/* */ +/* */ +/* */ +/* 1263 */ IniFile.gamma().setIniInt("LastUpgradeCheck", _today); +/* */ } +/* */ +/* */ +/* 1267 */ beenCalled = false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static void loadWorld(String worldDir, boolean forceWorldLoad) +/* */ { +/* 1282 */ if (worldDir.equals("chaos")) { +/* 1283 */ worldDir = "Chaos"; +/* */ } +/* 1285 */ NetUpdate nu = new NetUpdate(worldDir, forceWorldLoad); +/* */ +/* 1287 */ Thread t = new Thread(nu); +/* 1288 */ t.setDaemon(true); +/* 1289 */ t.start(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void asyncWorldCheck(String worldDir) +/* */ { +/* 1298 */ if (getCurrentVersionOfWorld(worldDir, -1) < 0) { +/* 1299 */ Vector<Integer> sizes = new Vector(); +/* 1300 */ Vector<String> updateList = new Vector(); +/* 1301 */ Vector<String> names = new Vector(); +/* 1302 */ if (listWorldUpgrades(worldDir, updateList, sizes, names)) { +/* 1303 */ if ((updateList.size() != 0) && +/* 1304 */ (getUpdates(updateList, sizes, names, worldDir))) { +/* 1305 */ notifyUser( +/* 1306 */ worldDir + Console.message("download-finished")); +/* */ } +/* */ } else { +/* 1309 */ notifyUser(worldDir + Console.message("custom-world")); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ private static synchronized boolean busy() +/* */ { +/* 1317 */ if (beenCalled) { +/* 1318 */ return true; +/* */ } +/* 1320 */ beenCalled = true; +/* 1321 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ public static boolean doUpdate(boolean force) +/* */ { +/* 1328 */ if (busy()) { +/* 1329 */ if (force) +/* 1330 */ notifyUser(Console.message("Upgrade-progress")); +/* 1331 */ return false; +/* */ } +/* */ +/* 1334 */ _today = (int)(new Date().getTime() / 86400000L); +/* */ +/* 1336 */ String upgradeScript = IniFile.gamma().getIniString("RunUpgrade", ""); +/* 1337 */ if ((!force) && (!upgradeScript.equals(""))) { +/* 1338 */ if (runUpdates(upgradeScript)) +/* 1339 */ return true; +/* 1340 */ beenCalled = false; +/* 1341 */ } else { if ((InternetConnectionDialog.choseSingleUserMode()) && (!force)) +/* */ { +/* 1343 */ return false; } +/* 1344 */ if ((force) || (IniFile.gamma().getIniInt("CheckUpgrades", 1) != 0)) +/* */ { +/* */ +/* 1347 */ Thread t = new Thread(new NetUpdate(force)); +/* 1348 */ t.setDaemon(true); +/* 1349 */ t.start(); +/* */ } else { +/* 1351 */ notifyUser(Console.message("Check-for-up-opt")); +/* 1352 */ beenCalled = false; +/* */ } +/* */ } +/* 1355 */ return false; +/* */ } +/* */ +/* */ /* Error */ +/* */ private static Vector<String> getLinesFromScriptFile(String restartCmd) +/* */ { +/* */ // Byte code: +/* */ // 0: new 471 java/util/Vector +/* */ // 3: dup +/* */ // 4: invokespecial 571 java/util/Vector:<init> ()V +/* */ // 7: astore_1 +/* */ // 8: invokestatic 69 NET/worlds/core/IniFile:gamma ()LNET/worlds/core/IniFile; +/* */ // 11: ldc_w 332 +/* */ // 14: ldc 104 +/* */ // 16: invokevirtual 106 NET/worlds/core/IniFile:getIniString (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; +/* */ // 19: astore_2 +/* */ // 20: aload_2 +/* */ // 21: ldc 104 +/* */ // 23: invokevirtual 110 java/lang/String:equals (Ljava/lang/Object;)Z +/* */ // 26: ifne +108 -> 134 +/* */ // 29: aconst_null +/* */ // 30: astore_3 +/* */ // 31: new 460 java/io/DataInputStream +/* */ // 34: dup +/* */ // 35: new 457 java/io/FileInputStream +/* */ // 38: dup +/* */ // 39: aload_2 +/* */ // 40: invokespecial 459 java/io/FileInputStream:<init> (Ljava/lang/String;)V +/* */ // 43: invokespecial 462 java/io/DataInputStream:<init> (Ljava/io/InputStream;)V +/* */ // 46: astore_3 +/* */ // 47: goto +25 -> 72 +/* */ // 50: aload_0 +/* */ // 51: ifnull +12 -> 63 +/* */ // 54: aload 4 +/* */ // 56: aload_0 +/* */ // 57: invokevirtual 110 java/lang/String:equals (Ljava/lang/Object;)Z +/* */ // 60: ifne +12 -> 72 +/* */ // 63: aload_1 +/* */ // 64: aload 4 +/* */ // 66: invokevirtual 626 java/lang/String:trim ()Ljava/lang/String; +/* */ // 69: invokevirtual 470 java/util/Vector:addElement (Ljava/lang/Object;)V +/* */ // 72: aload_3 +/* */ // 73: invokevirtual 483 java/io/DataInputStream:readLine ()Ljava/lang/String; +/* */ // 76: dup +/* */ // 77: astore 4 +/* */ // 79: ifnonnull -29 -> 50 +/* */ // 82: goto +39 -> 121 +/* */ // 85: astore 4 +/* */ // 87: aload_3 +/* */ // 88: ifnull +46 -> 134 +/* */ // 91: aload_3 +/* */ // 92: invokevirtual 486 java/io/DataInputStream:close ()V +/* */ // 95: goto +39 -> 134 +/* */ // 98: astore 6 +/* */ // 100: goto +34 -> 134 +/* */ // 103: astore 5 +/* */ // 105: aload_3 +/* */ // 106: ifnull +12 -> 118 +/* */ // 109: aload_3 +/* */ // 110: invokevirtual 486 java/io/DataInputStream:close ()V +/* */ // 113: goto +5 -> 118 +/* */ // 116: astore 6 +/* */ // 118: aload 5 +/* */ // 120: athrow +/* */ // 121: aload_3 +/* */ // 122: ifnull +12 -> 134 +/* */ // 125: aload_3 +/* */ // 126: invokevirtual 486 java/io/DataInputStream:close ()V +/* */ // 129: goto +5 -> 134 +/* */ // 132: astore 6 +/* */ // 134: aload_1 +/* */ // 135: areturn +/* */ // Line number table: +/* */ // Java source line #944 -> byte code offset #0 +/* */ // Java source line #947 -> byte code offset #8 +/* */ // Java source line #948 -> byte code offset #20 +/* */ // Java source line #949 -> byte code offset #29 +/* */ // Java source line #951 -> byte code offset #31 +/* */ // Java source line #954 -> byte code offset #47 +/* */ // Java source line #955 -> byte code offset #50 +/* */ // Java source line #956 -> byte code offset #63 +/* */ // Java source line #954 -> byte code offset #72 +/* */ // Java source line #957 -> byte code offset #82 +/* */ // Java source line #959 -> byte code offset #87 +/* */ // Java source line #961 -> byte code offset #91 +/* */ // Java source line #962 -> byte code offset #95 +/* */ // Java source line #958 -> byte code offset #103 +/* */ // Java source line #959 -> byte code offset #105 +/* */ // Java source line #961 -> byte code offset #109 +/* */ // Java source line #962 -> byte code offset #113 +/* */ // Java source line #964 -> byte code offset #118 +/* */ // Java source line #959 -> byte code offset #121 +/* */ // Java source line #961 -> byte code offset #125 +/* */ // Java source line #962 -> byte code offset #129 +/* */ // Java source line #967 -> byte code offset #134 +/* */ // Local variable table: +/* */ // start length slot name signature +/* */ // 0 136 0 restartCmd String +/* */ // 7 128 1 lines Vector<String> +/* */ // 19 21 2 scrFile String +/* */ // 30 96 3 dis DataInputStream +/* */ // 50 15 4 line String +/* */ // 77 3 4 line String +/* */ // 85 1 4 localIOException IOException +/* */ // 103 16 5 localObject Object +/* */ // 98 1 6 localIOException1 IOException +/* */ // 116 1 6 localIOException2 IOException +/* */ // 132 1 6 localIOException3 IOException +/* */ // Exception table: +/* */ // from to target type +/* */ // 31 82 85 java/io/IOException +/* */ // 91 95 98 java/io/IOException +/* */ // 31 87 103 finally +/* */ // 109 113 116 java/io/IOException +/* */ // 125 129 132 java/io/IOException +/* */ } +/* */ +/* */ /* Error */ +/* */ private static void writeScriptFile(Vector<String> lines, Vector<String> patches, String restartCmd) +/* */ { +/* */ // Byte code: +/* */ // 0: ldc 28 +/* */ // 2: astore_3 +/* */ // 3: aload_1 +/* */ // 4: invokevirtual 578 java/util/Vector:size ()I +/* */ // 7: istore 4 +/* */ // 9: iconst_0 +/* */ // 10: istore 5 +/* */ // 12: goto +269 -> 281 +/* */ // 15: aload_1 +/* */ // 16: iload 5 +/* */ // 18: invokevirtual 574 java/util/Vector:elementAt (I)Ljava/lang/Object; +/* */ // 21: checkcast 111 java/lang/String +/* */ // 24: astore 6 +/* */ // 26: aload_0 +/* */ // 27: aload 6 +/* */ // 29: invokestatic 696 NET/worlds/network/NetUpdate:hasString (Ljava/util/Vector;Ljava/lang/String;)Z +/* */ // 32: ifne +246 -> 278 +/* */ // 35: aconst_null +/* */ // 36: astore 7 +/* */ // 38: iconst_0 +/* */ // 39: istore 8 +/* */ // 41: new 457 java/io/FileInputStream +/* */ // 44: dup +/* */ // 45: aload 6 +/* */ // 47: invokespecial 459 java/io/FileInputStream:<init> (Ljava/lang/String;)V +/* */ // 50: astore 7 +/* */ // 52: iconst_4 +/* */ // 53: newarray <illegal type> +/* */ // 55: astore 9 +/* */ // 57: aload 7 +/* */ // 59: aload 9 +/* */ // 61: invokevirtual 698 java/io/FileInputStream:read ([B)I +/* */ // 64: istore 10 +/* */ // 66: getstatic 67 NET/worlds/network/NetUpdate:$assertionsDisabled Z +/* */ // 69: ifne +19 -> 88 +/* */ // 72: iload 10 +/* */ // 74: aload 9 +/* */ // 76: arraylength +/* */ // 77: if_icmpeq +11 -> 88 +/* */ // 80: new 702 java/lang/AssertionError +/* */ // 83: dup +/* */ // 84: invokespecial 704 java/lang/AssertionError:<init> ()V +/* */ // 87: athrow +/* */ // 88: aload 9 +/* */ // 90: iconst_0 +/* */ // 91: baload +/* */ // 92: bipush 37 +/* */ // 94: if_icmpne +34 -> 128 +/* */ // 97: aload 9 +/* */ // 99: iconst_1 +/* */ // 100: baload +/* */ // 101: bipush 88 +/* */ // 103: if_icmpne +25 -> 128 +/* */ // 106: aload 9 +/* */ // 108: iconst_2 +/* */ // 109: baload +/* */ // 110: bipush 68 +/* */ // 112: if_icmpne +16 -> 128 +/* */ // 115: aload 9 +/* */ // 117: iconst_3 +/* */ // 118: baload +/* */ // 119: bipush 90 +/* */ // 121: if_icmpne +7 -> 128 +/* */ // 124: iconst_1 +/* */ // 125: goto +4 -> 129 +/* */ // 128: iconst_0 +/* */ // 129: istore 8 +/* */ // 131: goto +43 -> 174 +/* */ // 134: astore 9 +/* */ // 136: aload 7 +/* */ // 138: ifnull +51 -> 189 +/* */ // 141: aload 7 +/* */ // 143: invokevirtual 489 java/io/FileInputStream:close ()V +/* */ // 146: goto +43 -> 189 +/* */ // 149: astore 12 +/* */ // 151: goto +38 -> 189 +/* */ // 154: astore 11 +/* */ // 156: aload 7 +/* */ // 158: ifnull +13 -> 171 +/* */ // 161: aload 7 +/* */ // 163: invokevirtual 489 java/io/FileInputStream:close ()V +/* */ // 166: goto +5 -> 171 +/* */ // 169: astore 12 +/* */ // 171: aload 11 +/* */ // 173: athrow +/* */ // 174: aload 7 +/* */ // 176: ifnull +13 -> 189 +/* */ // 179: aload 7 +/* */ // 181: invokevirtual 489 java/io/FileInputStream:close ()V +/* */ // 184: goto +5 -> 189 +/* */ // 187: astore 12 +/* */ // 189: iload 8 +/* */ // 191: ifeq +81 -> 272 +/* */ // 194: new 177 java/lang/StringBuilder +/* */ // 197: dup +/* */ // 198: aload 6 +/* */ // 200: invokestatic 179 java/lang/String:valueOf (Ljava/lang/Object;)Ljava/lang/String; +/* */ // 203: invokespecial 183 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 206: ldc_w 705 +/* */ // 209: invokevirtual 185 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 212: invokevirtual 189 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 215: astore 9 +/* */ // 217: new 707 java/io/File +/* */ // 220: dup +/* */ // 221: aload 6 +/* */ // 223: invokespecial 709 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 226: new 707 java/io/File +/* */ // 229: dup +/* */ // 230: aload 9 +/* */ // 232: invokespecial 709 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 235: invokevirtual 710 java/io/File:renameTo (Ljava/io/File;)Z +/* */ // 238: pop +/* */ // 239: aload_0 +/* */ // 240: new 177 java/lang/StringBuilder +/* */ // 243: dup +/* */ // 244: ldc_w 714 +/* */ // 247: invokespecial 183 java/lang/StringBuilder:<init> (Ljava/lang/String;)V +/* */ // 250: aload 9 +/* */ // 252: invokevirtual 185 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 255: ldc_w 716 +/* */ // 258: invokevirtual 185 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 261: aload 6 +/* */ // 263: invokevirtual 185 java/lang/StringBuilder:append (Ljava/lang/String;)Ljava/lang/StringBuilder; +/* */ // 266: invokevirtual 189 java/lang/StringBuilder:toString ()Ljava/lang/String; +/* */ // 269: invokevirtual 470 java/util/Vector:addElement (Ljava/lang/Object;)V +/* */ // 272: aload_0 +/* */ // 273: aload 6 +/* */ // 275: invokevirtual 470 java/util/Vector:addElement (Ljava/lang/Object;)V +/* */ // 278: iinc 5 1 +/* */ // 281: iload 5 +/* */ // 283: iload 4 +/* */ // 285: if_icmplt -270 -> 15 +/* */ // 288: aload_2 +/* */ // 289: ifnull +8 -> 297 +/* */ // 292: aload_0 +/* */ // 293: aload_2 +/* */ // 294: invokevirtual 470 java/util/Vector:addElement (Ljava/lang/Object;)V +/* */ // 297: invokestatic 69 NET/worlds/core/IniFile:gamma ()LNET/worlds/core/IniFile; +/* */ // 300: ldc_w 332 +/* */ // 303: ldc 104 +/* */ // 305: invokevirtual 334 NET/worlds/core/IniFile:setIniString (Ljava/lang/String;Ljava/lang/String;)V +/* */ // 308: new 552 java/io/PrintStream +/* */ // 311: dup +/* */ // 312: new 718 java/io/FileOutputStream +/* */ // 315: dup +/* */ // 316: aload_3 +/* */ // 317: invokespecial 720 java/io/FileOutputStream:<init> (Ljava/lang/String;)V +/* */ // 320: invokespecial 721 java/io/PrintStream:<init> (Ljava/io/OutputStream;)V +/* */ // 323: astore 5 +/* */ // 325: aload_0 +/* */ // 326: invokevirtual 578 java/util/Vector:size ()I +/* */ // 329: istore 4 +/* */ // 331: iconst_0 +/* */ // 332: istore 6 +/* */ // 334: goto +20 -> 354 +/* */ // 337: aload 5 +/* */ // 339: aload_0 +/* */ // 340: iload 6 +/* */ // 342: invokevirtual 574 java/util/Vector:elementAt (I)Ljava/lang/Object; +/* */ // 345: checkcast 111 java/lang/String +/* */ // 348: invokevirtual 551 java/io/PrintStream:println (Ljava/lang/String;)V +/* */ // 351: iinc 6 1 +/* */ // 354: iload 6 +/* */ // 356: iload 4 +/* */ // 358: if_icmplt -21 -> 337 +/* */ // 361: aload 5 +/* */ // 363: invokevirtual 724 java/io/PrintStream:close ()V +/* */ // 366: invokestatic 69 NET/worlds/core/IniFile:gamma ()LNET/worlds/core/IniFile; +/* */ // 369: ldc_w 332 +/* */ // 372: ldc 28 +/* */ // 374: invokevirtual 334 NET/worlds/core/IniFile:setIniString (Ljava/lang/String;Ljava/lang/String;)V +/* */ // 377: goto +14 -> 391 +/* */ // 380: astore 5 +/* */ // 382: ldc_w 725 +/* */ // 385: invokestatic 264 NET/worlds/console/Console:message (Ljava/lang/String;)Ljava/lang/String; +/* */ // 388: invokestatic 327 NET/worlds/console/Console:println (Ljava/lang/String;)V +/* */ // 391: return +/* */ // Line number table: +/* */ // Java source line #980 -> byte code offset #0 +/* */ // Java source line #983 -> byte code offset #3 +/* */ // Java source line #984 -> byte code offset #9 +/* */ // Java source line #985 -> byte code offset #15 +/* */ // Java source line #988 -> byte code offset #26 +/* */ // Java source line #991 -> byte code offset #35 +/* */ // Java source line #992 -> byte code offset #38 +/* */ // Java source line #994 -> byte code offset #41 +/* */ // Java source line #995 -> byte code offset #52 +/* */ // Java source line #997 -> byte code offset #57 +/* */ // Java source line #998 -> byte code offset #66 +/* */ // Java source line #1000 -> byte code offset #88 +/* */ // Java source line #1001 -> byte code offset #106 +/* */ // Java source line #1000 -> byte code offset #124 +/* */ // Java source line #1002 -> byte code offset #131 +/* */ // Java source line #1004 -> byte code offset #136 +/* */ // Java source line #1006 -> byte code offset #141 +/* */ // Java source line #1007 -> byte code offset #146 +/* */ // Java source line #1003 -> byte code offset #154 +/* */ // Java source line #1004 -> byte code offset #156 +/* */ // Java source line #1006 -> byte code offset #161 +/* */ // Java source line #1007 -> byte code offset #166 +/* */ // Java source line #1009 -> byte code offset #171 +/* */ // Java source line #1004 -> byte code offset #174 +/* */ // Java source line #1006 -> byte code offset #179 +/* */ // Java source line #1007 -> byte code offset #184 +/* */ // Java source line #1011 -> byte code offset #189 +/* */ // Java source line #1014 -> byte code offset #194 +/* */ // Java source line #1015 -> byte code offset #217 +/* */ // Java source line #1016 -> byte code offset #239 +/* */ // Java source line #1017 -> byte code offset #255 +/* */ // Java source line #1016 -> byte code offset #269 +/* */ // Java source line #1020 -> byte code offset #272 +/* */ // Java source line #984 -> byte code offset #278 +/* */ // Java source line #1024 -> byte code offset #288 +/* */ // Java source line #1025 -> byte code offset #292 +/* */ // Java source line #1028 -> byte code offset #297 +/* */ // Java source line #1032 -> byte code offset #308 +/* */ // Java source line #1033 -> byte code offset #325 +/* */ // Java source line #1034 -> byte code offset #331 +/* */ // Java source line #1035 -> byte code offset #337 +/* */ // Java source line #1034 -> byte code offset #351 +/* */ // Java source line #1036 -> byte code offset #361 +/* */ // Java source line #1038 -> byte code offset #366 +/* */ // Java source line #1039 -> byte code offset #377 +/* */ // Java source line #1040 -> byte code offset #382 +/* */ // Java source line #1042 -> byte code offset #391 +/* */ // Local variable table: +/* */ // start length slot name signature +/* */ // 0 392 0 lines Vector<String> +/* */ // 0 392 1 patches Vector<String> +/* */ // 0 392 2 restartCmd String +/* */ // 2 315 3 scrFile String +/* */ // 7 350 4 count int +/* */ // 10 272 5 i int +/* */ // 323 39 5 ps PrintStream +/* */ // 380 3 5 e IOException +/* */ // 24 250 6 line String +/* */ // 332 23 6 i int +/* */ // 36 144 7 in FileInputStream +/* */ // 39 151 8 needsPatch boolean +/* */ // 55 61 9 bytes byte[] +/* */ // 134 1 9 localIOException1 IOException +/* */ // 215 36 9 tempName String +/* */ // 64 9 10 bytesRead int +/* */ // 154 18 11 localObject Object +/* */ // 149 1 12 localIOException2 IOException +/* */ // 169 1 12 localIOException3 IOException +/* */ // 187 1 12 localIOException4 IOException +/* */ // Exception table: +/* */ // from to target type +/* */ // 41 131 134 java/io/IOException +/* */ // 141 146 149 java/io/IOException +/* */ // 41 136 154 finally +/* */ // 161 166 169 java/io/IOException +/* */ // 179 184 187 java/io/IOException +/* */ // 308 377 380 java/io/IOException +/* */ } +/* */ +/* */ private static native boolean CreateProcSpecial(String paramString1, String paramString2); +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\NetUpdate.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/NetworkMulti.java b/NET/worlds/network/NetworkMulti.java new file mode 100644 index 0000000..fcfecdd --- /dev/null +++ b/NET/worlds/network/NetworkMulti.java @@ -0,0 +1,130 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.PrintStream; +/* */ import java.util.Enumeration; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class NetworkMulti +/* */ implements NetworkObject +/* */ { +/* */ String _longID; +/* */ Vector<NetworkObject> _list; +/* */ Galaxy _galaxy; +/* */ +/* */ public NetworkMulti(String longID, Galaxy g) +/* */ { +/* 27 */ this._longID = longID; +/* 28 */ this._list = new Vector(); +/* 29 */ this._galaxy = g; +/* 30 */ register(); +/* */ } +/* */ +/* */ public NetworkMulti(String longID, NetworkMulti oldObj, Galaxy g) { +/* 34 */ this._longID = longID; +/* 35 */ this._list = oldObj.getList(); +/* 36 */ this._galaxy = g; +/* 37 */ register(); +/* */ } +/* */ +/* */ Vector<NetworkObject> getList() { +/* 41 */ return this._list; +/* */ } +/* */ +/* */ public String getLongID() +/* */ { +/* 46 */ return this._longID; +/* */ } +/* */ +/* */ public WorldServer getServer() +/* */ { +/* 51 */ if (!$assertionsDisabled) throw new AssertionError(); +/* 52 */ return null; +/* */ } +/* */ +/* */ public Enumeration<NetworkObject> elements() { +/* 56 */ return this._list.elements(); +/* */ } +/* */ +/* */ void addObject(NetworkObject obj) { +/* 60 */ this._list.addElement(obj); +/* */ } +/* */ +/* */ void delObject(NetworkObject obj) { +/* 64 */ boolean exists = this._list.removeElement(obj); +/* */ +/* 66 */ if (!exists) { +/* 67 */ System.out.println("Error - network object doesn't exist."); +/* 68 */ System.out.println(" obj = " + obj); +/* 69 */ System.out.println(" longID = " + this._longID); +/* 70 */ System.out.println(" galaxy = " + this._galaxy); +/* 71 */ System.out.println(" size(list) = " + this._list.size()); +/* */ } +/* */ +/* 74 */ assert (exists); +/* */ } +/* */ +/* */ public void property(OldPropertyList propList) +/* */ { +/* 79 */ for (int i = this._list.size() - 1; i >= 0; i--) { +/* 80 */ NetworkObject obj = (NetworkObject)this._list.elementAt(i); +/* 81 */ obj.property(propList); +/* */ } +/* */ } +/* */ +/* */ public void propertyUpdate(PropertyList propList) +/* */ { +/* 87 */ for (int i = this._list.size() - 1; i >= 0; i--) { +/* 88 */ NetworkObject obj = (NetworkObject)this._list.elementAt(i); +/* 89 */ obj.propertyUpdate(propList); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void register() +/* */ { +/* 98 */ this._galaxy.regObject(this._longID, this); +/* */ } +/* */ +/* */ public void galaxyDisconnected() { +/* 102 */ for (int i = this._list.size() - 1; i >= 0; i--) { +/* 103 */ NetworkObject obj = (NetworkObject)this._list.elementAt(i); +/* 104 */ obj.galaxyDisconnected(); +/* */ } +/* */ } +/* */ +/* */ public void reacquireServer(WorldServer oldServ) +/* */ { +/* 110 */ for (int i = this._list.size() - 1; i >= 0; i--) { +/* 111 */ NetworkObject obj = (NetworkObject)this._list.elementAt(i); +/* 112 */ obj.reacquireServer(oldServ); +/* */ } +/* */ } +/* */ +/* */ +/* */ public void changeChannel(Galaxy g, String oldChannel, String newChannel) +/* */ { +/* 119 */ for (int i = this._list.size() - 1; i >= 0; i--) { +/* 120 */ NetworkObject obj = (NetworkObject)this._list.elementAt(i); +/* 121 */ obj.changeChannel(g, oldChannel, newChannel); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\NetworkMulti.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/NetworkNobody.java b/NET/worlds/network/NetworkNobody.java new file mode 100644 index 0000000..f8cd0dc --- /dev/null +++ b/NET/worlds/network/NetworkNobody.java @@ -0,0 +1,106 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.scape.Room; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class NetworkNobody +/* */ { +/* */ String _longID; +/* */ WorldServer _server; +/* */ +/* */ public NetworkNobody(String longID, WorldServer server) +/* */ { +/* 23 */ this._longID = longID; +/* 24 */ this._server = server; +/* */ } +/* */ +/* */ public WorldServer getServer() { +/* 28 */ return this._server; +/* */ } +/* */ +/* */ public String getLongID() { +/* 32 */ return this._longID; +/* */ } +/* */ +/* */ public void appear(Room rm, short x, short y, short z, short yaw) { +/* 36 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ +/* */ public void disappear() +/* */ { +/* 43 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ public void longLoc(short x, short y, short z, short yaw) +/* */ { +/* 49 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ public void roomChange(Room newRoom, short x, short y, short z, short yaw) +/* */ { +/* 55 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ +/* */ public void shortLoc(byte dx, byte dy, byte dyaw) { +/* 59 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ +/* */ public void teleport(WorldServer serv, byte exitType, byte entryType, Room newRoom, short x, short y, short z, short yaw) +/* */ { +/* 64 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void property(OldPropertyList propList) {} +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void propertyUpdate(PropertyList propList) {} +/* */ +/* */ +/* */ +/* */ +/* */ public void register() +/* */ { +/* 85 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ +/* */ public void galaxyDisconnected() { +/* 89 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ +/* */ public void reacquireServer(WorldServer oldServ) { +/* 93 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ +/* */ public void changeChannel(Galaxy g, String oldChannel, String newChannel) +/* */ { +/* 98 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\NetworkNobody.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/NetworkObject.java b/NET/worlds/network/NetworkObject.java new file mode 100644 index 0000000..f0de1f1 --- /dev/null +++ b/NET/worlds/network/NetworkObject.java @@ -0,0 +1,26 @@ +package NET.worlds.network; + +public abstract interface NetworkObject +{ + public abstract void property(OldPropertyList paramOldPropertyList); + + public abstract void propertyUpdate(PropertyList paramPropertyList); + + public abstract WorldServer getServer(); + + public abstract String getLongID(); + + public abstract void register(); + + public abstract void galaxyDisconnected(); + + public abstract void reacquireServer(WorldServer paramWorldServer); + + public abstract void changeChannel(Galaxy paramGalaxy, String paramString1, String paramString2); +} + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\NetworkObject.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/NetworkRoom.java b/NET/worlds/network/NetworkRoom.java new file mode 100644 index 0000000..d5e13b6 --- /dev/null +++ b/NET/worlds/network/NetworkRoom.java @@ -0,0 +1,711 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.core.IniFile; +/* */ import NET.worlds.core.Std; +/* */ import NET.worlds.scape.Room; +/* */ import NET.worlds.scape.RoomSubscribeInfo; +/* */ import NET.worlds.scape.Sharer; +/* */ import NET.worlds.scape.World; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class NetworkRoom +/* */ implements NetworkObject, ConnectionWaiter +/* */ { +/* */ private static final int STATE_DISCONNECTED = 0; +/* */ private static final int STATE_CONNECTING = 1; +/* */ private static final int STATE_GETTINGROOMID = 2; +/* */ private static final int STATE_CONNECTED = 3; +/* */ private static final int STATE_SUBSCRIBED = 4; +/* */ private static int _debugLevel; +/* */ Room _room; +/* */ String _worldName; +/* */ String _roomName; +/* */ String _longID; +/* */ Galaxy _galaxy; +/* */ String _debug1; +/* */ String _debug2; +/* */ +/* */ static +/* */ { +/* 50 */ _debugLevel = IniFile.gamma().getIniInt("roomdebug", 0); +/* 51 */ if (_debugLevel > 0) { +/* 52 */ System.out.println("ROOM DEBUGGING LEVEL = " + _debugLevel); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public NetworkRoom(Room room) +/* */ { +/* 75 */ this._room = room; +/* */ +/* 77 */ this._debug1 = ""; +/* 78 */ this._debug2 = ""; +/* */ +/* */ +/* 81 */ this._galaxy = room.getGalaxy(); +/* */ +/* 83 */ initNames(); +/* 84 */ register(); +/* */ } +/* */ +/* */ synchronized void initNames() +/* */ { +/* 89 */ this._roomName = this._room.getName(); +/* 90 */ World world = this._room.getWorld(); +/* 91 */ this._worldName = world.getName(); +/* 92 */ Galaxy galaxy = this._room.getGalaxy(); +/* 93 */ String channel = galaxy.getChannel(); +/* 94 */ if (channel.length() != 0) +/* 95 */ channel = "<" + channel + ">"; +/* 96 */ this._longID = (this._worldName + "#" + this._roomName + channel); +/* */ } +/* */ +/* */ public Room getRoom() { +/* 100 */ return this._room; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void setName(String newName) +/* */ { +/* 108 */ assert (newName != this._roomName); +/* */ +/* */ +/* */ +/* 112 */ unregister(); +/* */ +/* */ +/* 115 */ initNames(); +/* */ +/* */ +/* 118 */ register(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void unregister() +/* */ { +/* 132 */ Galaxy tmpGalaxy = this._room.getGalaxy(); +/* 133 */ assert (tmpGalaxy != null); +/* */ +/* */ +/* 136 */ assert (this._galaxy == tmpGalaxy); +/* */ +/* 138 */ tmpGalaxy.delObject(this._longID); +/* 139 */ if (this._roomID != 0) +/* 140 */ tmpGalaxy.delRoomID(this._roomID, this); +/* 141 */ this._debug2 = ""; +/* 142 */ this._roomID = 0; +/* */ } +/* */ +/* */ +/* */ +/* */ public synchronized void detach() +/* */ { +/* 149 */ unregister(); +/* */ +/* 151 */ this._galaxy = null; +/* */ +/* 153 */ this._room = null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public String getLongID() +/* */ { +/* 161 */ return this._longID; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public int getRoomID() +/* */ { +/* 169 */ return this._roomID; +/* */ } +/* */ +/* */ public boolean isServed() { +/* 173 */ return this._serverState == 4; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void serverRedirect(WorldServer serv, String roomName, ServerURL serverURL) +/* */ { +/* 183 */ if (this._server == null) { +/* 184 */ return; +/* */ } +/* 186 */ if (serv.getGalaxy() != this._server.getGalaxy()) +/* 187 */ return; +/* 188 */ if (!roomName.equals(this._longID)) { +/* 189 */ return; +/* */ } +/* */ +/* 192 */ if ((_debugLevel & 0x2) > 0) { +/* 193 */ System.out.println(this._room.getName() + ": serverRedirect(" + +/* 194 */ serverURL + ")"); +/* */ } +/* */ +/* */ +/* 198 */ this._serverState = 3; +/* */ +/* */ +/* 201 */ int tmpRoomID = this._roomID; +/* 202 */ disconnect(); +/* */ +/* */ +/* */ +/* */ +/* 207 */ assert (this._server == null); +/* 208 */ this._roomID = tmpRoomID; +/* 209 */ this._debug2 = +/* 210 */ (this._debug2 + "; [" + Std.getRealTime() + "]: serverDirect(" + serv + ")"); +/* 211 */ this._serverURL = URL.make(serverURL.toString()); +/* 212 */ if (this._roomID != 0) +/* 213 */ this._room.getGalaxy().setRoomID(this._roomID, this); +/* 214 */ if (this._wantsToBeSubscribed) { +/* 215 */ acquireServer(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void setRoomID(WorldServer serv, int roomID, String roomName, boolean willRedirect) +/* */ { +/* 226 */ assert (serv != null); +/* */ +/* */ +/* 229 */ if ((_debugLevel & 0x2) > 0) { +/* 230 */ System.out.println(this._longID + ": setRoomID(" + serv + ", " + +/* 231 */ roomID + ", " + roomName + ", " + willRedirect + ")"); +/* 232 */ System.out.println("last request made: " + this._debug1); +/* */ } +/* 234 */ if (serv.getGalaxy() != this._server.getGalaxy()) { +/* 235 */ System.out.println(this._longID + ": setRoomID(" + serv + ", " + +/* 236 */ roomID + ", " + roomName + ", " + willRedirect + ")"); +/* 237 */ System.out.println("\twas expecting server " + this._server); +/* 238 */ System.out.println("last request made: " + this._debug1); +/* 239 */ new Exception().printStackTrace(System.out); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 246 */ if (serv.getGalaxy() != this._server.getGalaxy()) +/* 247 */ return; +/* 248 */ if (!roomName.equals(this._longID)) +/* 249 */ return; +/* 250 */ if (roomID == 0) +/* */ { +/* */ +/* */ +/* 254 */ this._serverState = 0; +/* 255 */ reacquireServer(serv); +/* 256 */ return; +/* */ } +/* 258 */ if (this._roomID == 0) { +/* 259 */ this._roomID = roomID; +/* 260 */ this._debug2 = +/* 261 */ (this._debug2 + "; [" + Std.getRealTime() + "]: setRoomID(" + serv + ", " + willRedirect + ")"); +/* */ } +/* 263 */ assert (this._roomID == roomID); +/* 264 */ this._serverState = 3; +/* 265 */ if (!willRedirect) +/* */ { +/* */ +/* 268 */ if (this._wantsToBeSubscribed) { +/* 269 */ assert (this._lastRSInfo != null); +/* 270 */ subscribe(); +/* */ } +/* */ else { +/* 273 */ disconnect(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 292 */ private RoomSubscribeInfo _lastRSInfo = null; +/* 293 */ private URL _serverURL = null; +/* */ +/* */ +/* */ +/* */ +/* */ +/* 299 */ private WorldServer _server = null; +/* 300 */ private int _roomID = 0; +/* 301 */ private boolean _wantsToBeSubscribed = false; +/* 302 */ private int _serverState = 0; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void subscribe(RoomSubscribeInfo info) +/* */ { +/* 313 */ assert (this._galaxy == this._room.getGalaxy()); +/* */ +/* */ +/* 316 */ if ((_debugLevel & 0x1) > 0) { +/* 317 */ System.out.println(this._room.getName() + ": subscribe(Info)"); +/* */ } +/* 319 */ assert (this._room.getWorld() != null); +/* 320 */ assert (this._serverState != 4); +/* 321 */ this._lastRSInfo = info; +/* 322 */ this._wantsToBeSubscribed = true; +/* 323 */ switch (this._serverState) { +/* */ case 0: +/* 325 */ acquireServer(); +/* 326 */ break; +/* */ case 3: +/* 328 */ subscribe(); +/* */ } +/* */ +/* */ } +/* */ +/* */ private void subscribe() +/* */ { +/* 335 */ if ((_debugLevel & 0x1) > 0) { +/* 336 */ System.out.println(this._room.getName() + ": subscribe()"); +/* */ } +/* 338 */ assert (this._server != null); +/* 339 */ assert (this._wantsToBeSubscribed); +/* 340 */ assert (this._lastRSInfo != null); +/* 341 */ assert (this._roomID != 0); +/* 342 */ assert (this._serverState == 3); +/* 343 */ assert (this._room.getWorld() != null); +/* */ +/* */ +/* 346 */ this._serverState = 4; +/* 347 */ sendNetworkMsg(new SubscribeRoomCmd(this._lastRSInfo, this._roomID)); +/* */ } +/* */ +/* */ private void sendNetworkMsg(netPacket msg) +/* */ { +/* 352 */ assert (this._server != null); +/* */ try { +/* 354 */ this._server.sendNetworkMsg(msg); +/* */ } catch (InfiniteWaitException e) { +/* 356 */ disconnect(); +/* */ } catch (PacketTooLargeException e) { +/* 358 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ public synchronized void subscribeDist(RoomSubscribeInfo info) { +/* 363 */ this._lastRSInfo = info; +/* 364 */ assert (this._wantsToBeSubscribed); +/* 365 */ assert (this._room.getWorld() != null); +/* 366 */ if (this._serverState == 4) { +/* 367 */ sendNetworkMsg(new SubscribeDistCmd(info.d, this._roomID)); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void unsubscribe() +/* */ { +/* 377 */ if ((_debugLevel & 0x1) > 0) { +/* 378 */ System.out.println(this._room.getName() + ": unsubscribe()"); +/* */ } +/* 380 */ assert (this._wantsToBeSubscribed); +/* 381 */ this._wantsToBeSubscribed = false; +/* 382 */ this._lastRSInfo = null; +/* 383 */ switch (this._serverState) +/* */ { +/* */ +/* */ case 2: +/* 387 */ disconnect(); +/* 388 */ break; +/* */ case 4: +/* 390 */ sendNetworkMsg(new UnsubscribeRoomCmd(this._roomID)); +/* 391 */ disconnect(); +/* 392 */ break; +/* */ case 1: +/* 394 */ assert (this._server != null); +/* 395 */ this._server.abortWaitForConnection(this); +/* 396 */ disconnect(); +/* 397 */ break; +/* */ } +/* */ +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private synchronized void disconnect() +/* */ { +/* 409 */ if ((_debugLevel & 0x2) > 0) { +/* 410 */ System.out.println(this._room.getName() + ": disconnect()"); +/* */ } +/* */ +/* 413 */ switch (this._serverState) +/* */ { +/* */ case 2: +/* 416 */ this._server.delRoomRequest(this._longID); +/* */ +/* 418 */ if (this._debug1 == null) +/* 419 */ this._debug1 = ""; +/* 420 */ this._debug1 = +/* 421 */ (this._debug1 + "; [" + Std.getRealTime() + "]: deleted request for " + this._longID); +/* */ +/* 423 */ break; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 434 */ this._serverURL = null; +/* 435 */ if ((this._server != null) && (this._roomID != 0)) +/* 436 */ this._server.delRoomID(this._roomID, this); +/* 437 */ this._roomID = 0; +/* 438 */ this._debug2 = ""; +/* */ +/* 440 */ if (this._server != null) { +/* 441 */ this._server.decRefCnt(this); +/* 442 */ this._server = null; +/* 443 */ this._serverState = 0; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 452 */ assert (this._serverState == 0); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private synchronized void acquireServer() +/* */ { +/* 461 */ if ((_debugLevel & 0x2) > 0) { +/* 462 */ System.out.println(this._room.getName() + ": acquireServer() - " + +/* 463 */ this._serverURL); +/* */ } +/* */ +/* 466 */ assert (this._serverState == 0); +/* 467 */ if (this._server == null) { +/* 468 */ World world = this._room.getWorld(); +/* 469 */ assert (world != null); +/* 470 */ Galaxy galaxy = world.getConsole().getGalaxy(); +/* 471 */ assert (galaxy != null); +/* */ +/* 473 */ if (this._serverURL == null) +/* */ { +/* */ +/* */ +/* */ +/* */ +/* */ +/* 480 */ this._serverURL = world.getConsole().getGalaxyURL(); +/* 481 */ if (this._serverURL == null) +/* 482 */ return; +/* */ } +/* */ try { +/* 485 */ this._server = galaxy.getServer(this._serverURL); +/* */ } catch (InvalidServerURLException e) { +/* 487 */ Console.println(">> " + e.getMessage()); +/* 488 */ this._serverURL = null; +/* 489 */ return; +/* */ } +/* 491 */ if (this._server == null) +/* 492 */ return; +/* 493 */ this._server.incRefCnt(this); +/* */ } +/* 495 */ this._serverState = 1; +/* 496 */ this._server.waitForConnection(this); +/* */ } +/* */ +/* */ public void connectionCallback(Object caller, boolean connected) { +/* 500 */ if (!(caller instanceof WorldServer)) +/* 501 */ return; +/* 502 */ WorldServer serv = (WorldServer)caller; +/* */ +/* 504 */ if ((_debugLevel & 0x2) > 0) { +/* 505 */ System.out.println(this._room.getName() + ": connectionCallback(" + +/* 506 */ serv + ", connected=" + connected + ") _server=" + +/* 507 */ this._server); +/* */ } +/* 509 */ if (this._server != serv) +/* 510 */ return; +/* 511 */ if (!connected) +/* */ { +/* */ +/* 514 */ disconnect(); +/* */ +/* */ +/* */ +/* 518 */ return; +/* */ } +/* 520 */ if (this._roomID == 0) { +/* 521 */ synchronized (this) { +/* 522 */ this._serverState = 2; +/* 523 */ serv.requestRoomID(this._longID, this); +/* 524 */ this._debug1 = +/* 525 */ ("[" + Std.getRealTime() + "] " + serv + ": requested roomID for " + this._longID); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 535 */ setRoomID(serv, this._roomID, this._longID, false); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void property(OldPropertyList propList) +/* */ { +/* 547 */ for (int i = 0; i < propList.size(); i++) { +/* 548 */ netProperty p = propList.elementAt(i); +/* */ +/* */ +/* */ +/* 552 */ byte[] data = p.value().getBytes(); +/* */ +/* 554 */ this._room.getSharer().setFromNetData(p.property(), data); +/* */ } +/* */ } +/* */ +/* */ public void propertyUpdate(PropertyList propList) { +/* 559 */ for (int i = 0; i < propList.size(); i++) { +/* 560 */ net2Property p = propList.elementAt(i); +/* 561 */ this._room.getSharer().setFromNetData(p.property(), p.data()); +/* */ } +/* */ } +/* */ +/* */ public WorldServer getServer() { +/* 566 */ return this._server; +/* */ } +/* */ +/* */ public void register() +/* */ { +/* 571 */ if ((_debugLevel & 0x2) > 0) { +/* 572 */ System.out.println(this._room.getName() + ": register()"); +/* */ } +/* */ +/* */ +/* 576 */ assert (this._room.getWorld() != null); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 583 */ Galaxy tmpGalaxy = this._room.getGalaxy(); +/* 584 */ assert (tmpGalaxy != null); +/* 585 */ tmpGalaxy.regObject(this._longID, this); +/* */ +/* */ +/* 588 */ this._galaxy = tmpGalaxy; +/* */ +/* */ +/* */ +/* 592 */ if (this._serverState != 0) { +/* 593 */ disconnect(); +/* */ } +/* */ +/* 596 */ this._serverURL = null; +/* */ +/* 598 */ if (this._wantsToBeSubscribed) { +/* 599 */ acquireServer(); +/* */ } +/* */ } +/* */ +/* */ public void galaxyDisconnected() +/* */ { +/* 605 */ if ((_debugLevel & 0x2) > 0) { +/* 606 */ System.out.println(this._room.getName() + ": galaxyDisconnected()"); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 617 */ synchronized (this) +/* */ { +/* */ +/* */ +/* */ +/* */ +/* 623 */ if (this._server != null) +/* */ { +/* */ +/* */ +/* */ +/* */ +/* 629 */ reacquireServer(this._server); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void reacquireServer(WorldServer oldServ) +/* */ { +/* 642 */ if (this._debug1 == null) +/* 643 */ this._debug1 = ""; +/* 644 */ this._debug1 = +/* 645 */ (this._debug1 + "; [" + Std.getRealTime() + "]: reacquireServer(" + this._server + ", " + oldServ + ")"); +/* */ +/* */ +/* 648 */ if (this._server != oldServ) { +/* 649 */ return; +/* */ } +/* */ +/* 652 */ if ((_debugLevel & 0x2) > 0) { +/* 653 */ System.out.println(this._room.getName() + ": reacquireServer()"); +/* */ } +/* */ +/* 656 */ disconnect(); +/* 657 */ if (this._wantsToBeSubscribed) { +/* 658 */ acquireServer(); +/* */ } +/* */ } +/* */ +/* */ public synchronized void changeChannel(Galaxy tmpGalaxy, String oldChannel, String newChannel) +/* */ { +/* 664 */ if ((_debugLevel & 0x2) > 0) { +/* 665 */ System.out.println(this._room.getName() + ": changeChannel(" + +/* 666 */ oldChannel + " -> " + newChannel + ")"); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 672 */ boolean wantsToBeSubscribed = this._wantsToBeSubscribed; +/* 673 */ RoomSubscribeInfo lastRSInfo = this._lastRSInfo; +/* 674 */ if (wantsToBeSubscribed) { +/* 675 */ unsubscribe(); +/* */ } +/* */ +/* */ +/* */ +/* 680 */ tmpGalaxy.delObject(this._longID); +/* */ +/* */ +/* 683 */ initNames(); +/* */ +/* 685 */ register(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 693 */ if (wantsToBeSubscribed) { +/* 694 */ subscribe(lastRSInfo); +/* */ } +/* */ } +/* */ +/* */ public String toString() { +/* 699 */ return "NetworkRoom[" + this._room.getName() + "]"; +/* */ } +/* */ +/* */ public String debugStuff() { +/* 703 */ return this + ": debug1 = " + this._debug1 + "\n\tdebug2 = " + this._debug2; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\NetworkRoom.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/NewVersionDialog.java b/NET/worlds/network/NewVersionDialog.java new file mode 100644 index 0000000..0a99b3e --- /dev/null +++ b/NET/worlds/network/NewVersionDialog.java @@ -0,0 +1,141 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.MultiLineLabel; +/* */ import NET.worlds.console.PolledDialog; +/* */ import NET.worlds.core.Std; +/* */ import java.awt.Button; +/* */ import java.awt.Event; +/* */ import java.awt.GridBagConstraints; +/* */ import java.awt.GridBagLayout; +/* */ import java.text.MessageFormat; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class NewVersionDialog +/* */ extends PolledDialog +/* */ { +/* */ private static final long serialVersionUID = -2091867202100838097L; +/* 35 */ private Button yesButton = new Button(Console.message("Yes-Restart")); +/* 36 */ private Button noButton = new Button(Console.message("No-Keep-Playing")); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 42 */ Object[] arguments = { new String(Std.getProductName()) }; +/* 43 */ private String message = MessageFormat.format( +/* 44 */ Console.message("upgrade-is-now"), this.arguments); +/* */ +/* */ +/* 47 */ private static String title = Console.message("Download-Complete"); +/* */ +/* */ +/* */ +/* */ +/* */ public NewVersionDialog() +/* */ { +/* 54 */ super(Console.getFrame(), null, title, false); +/* 55 */ setAlignment(1); +/* 56 */ readySetGo(); +/* */ } +/* */ +/* */ +/* */ +/* */ protected void build() +/* */ { +/* 63 */ GridBagLayout gbag = new GridBagLayout(); +/* 64 */ setLayout(gbag); +/* 65 */ GridBagConstraints c = new GridBagConstraints(); +/* 66 */ c.anchor = 10; +/* 67 */ c.fill = 0; +/* 68 */ c.weightx = 1.0D; +/* 69 */ c.weighty = 1.0D; +/* 70 */ c.gridwidth = 0; +/* 71 */ c.gridheight = 1; +/* 72 */ add(gbag, new MultiLineLabel(this.message, 5, 5), c); +/* 73 */ c.gridwidth = 2; +/* 74 */ add(gbag, this.yesButton, c); +/* 75 */ add(gbag, this.noButton, c); +/* */ } +/* */ +/* */ +/* */ public void setVisible(boolean visible) +/* */ { +/* 81 */ super.setVisible(visible); +/* 82 */ if (visible) { +/* 83 */ this.yesButton.requestFocus(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized boolean confirmRestart() +/* */ { +/* 92 */ while (isActive()) { +/* */ try { +/* 94 */ wait(); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* */ } +/* 98 */ return getConfirmed(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected synchronized boolean done(boolean confirmed) +/* */ { +/* 107 */ boolean retCode = super.done(confirmed); +/* 108 */ notify(); +/* 109 */ return retCode; +/* */ } +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean action(Event event, Object what) +/* */ { +/* 116 */ if (event.target == this.yesButton) +/* 117 */ return done(true); +/* 118 */ if (event.target == this.noButton) +/* 119 */ return done(false); +/* 120 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean keyDown(Event event, int key) +/* */ { +/* 131 */ if (key == 27) +/* 132 */ return done(false); +/* 133 */ return super.keyDown(event, key); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\NewVersionDialog.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ObjID.java b/NET/worlds/network/ObjID.java new file mode 100644 index 0000000..5bbe657 --- /dev/null +++ b/NET/worlds/network/ObjID.java @@ -0,0 +1,136 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ObjID +/* */ { +/* */ private int _shortObjID; +/* */ private String _longObjID; +/* */ +/* */ public ObjID(int id) +/* */ { +/* 54 */ this._shortObjID = id; +/* 55 */ this._longObjID = null; +/* */ } +/* */ +/* */ public ObjID(String id) { +/* 59 */ this._shortObjID = 0; +/* 60 */ if (id.startsWith("!")) +/* 61 */ id = id.substring(1); +/* 62 */ this._longObjID = id; +/* */ } +/* */ +/* */ public ObjID() { +/* 66 */ this._shortObjID = 0; +/* 67 */ this._longObjID = null; +/* */ } +/* */ +/* */ public int shortID() { +/* 71 */ return this._shortObjID; +/* */ } +/* */ +/* */ public String longID() { +/* 75 */ return this._longObjID; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException { +/* 79 */ this._shortObjID = data.readUnsignedByte(); +/* 80 */ if (this._shortObjID == 0) +/* */ { +/* 82 */ this._longObjID = data.readUTF(); +/* */ } +/* */ } +/* */ +/* */ int packetSize() { +/* 87 */ if (this._longObjID != null) { +/* 88 */ return 2 + ServerOutputStream.utfLength(this._longObjID); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 95 */ return 1; +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 100 */ if (this._longObjID != null) { +/* 101 */ o.writeByte(0); +/* 102 */ o.writeUTF(this._longObjID); +/* */ +/* */ +/* */ } +/* */ else +/* */ { +/* */ +/* 109 */ assert ((this._shortObjID == 1) || (this._shortObjID >= 253)); +/* 110 */ o.writeByte(this._shortObjID); +/* */ } +/* */ } +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 116 */ if (this._longObjID != null) { +/* 117 */ return this._longObjID; +/* */ } +/* 119 */ return +/* 120 */ Integer.toString(this._shortObjID) + "[" + serv.getLongID(this) + "]"; +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 125 */ if (this._longObjID != null) { +/* 126 */ return this._longObjID; +/* */ } +/* 128 */ return "[#" + Integer.toString(this._shortObjID) + "]"; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ObjID.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ObjectMgr.java b/NET/worlds/network/ObjectMgr.java new file mode 100644 index 0000000..5ea24e7 --- /dev/null +++ b/NET/worlds/network/ObjectMgr.java @@ -0,0 +1,94 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.util.Enumeration; +/* */ import java.util.Hashtable; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class ObjectMgr +/* */ { +/* */ private Hashtable<String, NetworkObject> nFlongID; +/* */ private Hashtable<Integer, String> lFshortID; +/* */ private Galaxy _galaxy; +/* */ +/* */ ObjectMgr(Galaxy galaxy) +/* */ { +/* 31 */ this.nFlongID = new Hashtable(); +/* 32 */ this.lFshortID = new Hashtable(); +/* 33 */ this._galaxy = galaxy; +/* */ } +/* */ +/* */ void regShortID(int shortID, String longID) { +/* 37 */ this.lFshortID.put(new Integer(shortID), longID); +/* */ } +/* */ +/* */ void regObject(String longID, NetworkObject obj) { +/* 41 */ this.nFlongID.put(longID, obj); +/* */ } +/* */ +/* */ void regObject(ObjID objID, NetworkObject obj) { +/* 45 */ String longID = getLongID(objID); +/* 46 */ this.nFlongID.put(longID, obj); +/* */ } +/* */ +/* */ NetworkObject getObject(ObjID objID) { +/* 50 */ String longID = getLongID(objID); +/* */ +/* 52 */ NetworkObject obj = (NetworkObject)this.nFlongID.get(longID); +/* 53 */ if (obj == null) { +/* 54 */ assert (this._galaxy != null); +/* 55 */ obj = this._galaxy.getObject(longID); +/* */ } +/* 57 */ return obj; +/* */ } +/* */ +/* */ void delObject(ObjID objID) { +/* 61 */ String longID = getLongID(objID); +/* */ +/* 63 */ NetworkObject obj = (NetworkObject)this.nFlongID.get(longID); +/* 64 */ assert (obj != null); +/* */ +/* 66 */ this.nFlongID.remove(longID); +/* */ } +/* */ +/* */ Enumeration<NetworkObject> objects() { +/* 70 */ return this.nFlongID.elements(); +/* */ } +/* */ +/* */ void clear() { +/* 74 */ this.nFlongID.clear(); +/* 75 */ this.nFlongID = new Hashtable(); +/* 76 */ this.lFshortID.clear(); +/* 77 */ this.lFshortID = new Hashtable(); +/* */ } +/* */ +/* */ final String getLongID(ObjID objID) { String longID; +/* */ String longID; +/* 82 */ if (objID.shortID() != 0) { +/* 83 */ longID = (String)this.lFshortID.get(new Integer(objID.shortID())); +/* */ } else +/* 85 */ longID = objID.longID(); +/* 86 */ return longID; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ObjectMgr.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/OldPropertyList.java b/NET/worlds/network/OldPropertyList.java new file mode 100644 index 0000000..f1fddb4 --- /dev/null +++ b/NET/worlds/network/OldPropertyList.java @@ -0,0 +1,99 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class OldPropertyList +/* */ { +/* */ private Vector<netProperty> _propList; +/* */ +/* */ public OldPropertyList() +/* */ { +/* 25 */ this._propList = new Vector(); +/* */ } +/* */ +/* */ public void addProperty(netProperty prop) { +/* 29 */ assert (getProperty(prop.property()) == null); +/* 30 */ this._propList.addElement(prop); +/* */ } +/* */ +/* */ public int size() { +/* 34 */ return this._propList.size(); +/* */ } +/* */ +/* */ public final netProperty elementAt(int i) { +/* 38 */ return (netProperty)this._propList.elementAt(i); +/* */ } +/* */ +/* */ public netProperty getProperty(int propID) { +/* 42 */ for (int i = this._propList.size() - 1; i >= 0; i--) { +/* 43 */ if (elementAt(i).property() == propID) +/* 44 */ return elementAt(i); +/* */ } +/* 46 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ void parseNetData(ServerInputStream data) +/* */ throws IOException +/* */ { +/* 54 */ this._propList = new Vector(); +/* 55 */ while (!data.isEmpty()) { +/* 56 */ netProperty tmpProp = new netProperty(); +/* 57 */ tmpProp.parseNetData(data); +/* 58 */ this._propList.addElement(tmpProp); +/* */ } +/* */ } +/* */ +/* */ int packetSize() { +/* 63 */ int len = 0; +/* */ +/* 65 */ for (int i = this._propList.size() - 1; i >= 0; i--) { +/* 66 */ netProperty tmpProp = (netProperty)this._propList.elementAt(i); +/* 67 */ len += tmpProp.packetSize(); +/* */ } +/* 69 */ return len; +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException { +/* 73 */ int maxidx = this._propList.size(); +/* */ +/* 75 */ for (int i = 0; i < maxidx; i++) { +/* 76 */ netProperty tmpProp = (netProperty)this._propList.elementAt(i); +/* 77 */ tmpProp.send(o); +/* */ } +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 83 */ String out = "("; +/* 84 */ int maxidx = this._propList.size(); +/* */ +/* 86 */ for (int i = 0; i < maxidx; i++) { +/* 87 */ netProperty tmpProp = (netProperty)this._propList.elementAt(i); +/* 88 */ out = out + tmpProp + " "; +/* */ } +/* 90 */ out = out + ")"; +/* 91 */ return out; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\OldPropertyList.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/P17UserServer.java b/NET/worlds/network/P17UserServer.java new file mode 100644 index 0000000..7c7b69a --- /dev/null +++ b/NET/worlds/network/P17UserServer.java @@ -0,0 +1,27 @@ +/* */ package NET.worlds.network; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class P17UserServer +/* */ extends UserServer +/* */ { +/* */ protected P17UserServer() +/* */ { +/* 13 */ this._serverProtocolVersion = 17; +/* */ } +/* */ +/* */ +/* */ protected void state_XMIT_PROPREQ() +/* */ { +/* 19 */ this._state.setState(7); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\P17UserServer.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/PacketTooLargeException.java b/NET/worlds/network/PacketTooLargeException.java new file mode 100644 index 0000000..f91a5c6 --- /dev/null +++ b/NET/worlds/network/PacketTooLargeException.java @@ -0,0 +1,29 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class PacketTooLargeException +/* */ extends IOException +/* */ { +/* */ private static final long serialVersionUID = 4415549519859917790L; +/* */ +/* */ PacketTooLargeException() {} +/* */ +/* */ PacketTooLargeException(String msg) +/* */ { +/* 21 */ super(msg); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\PacketTooLargeException.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ProgressBar.java b/NET/worlds/network/ProgressBar.java new file mode 100644 index 0000000..91e389d --- /dev/null +++ b/NET/worlds/network/ProgressBar.java @@ -0,0 +1,107 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import java.awt.Canvas; +/* */ import java.awt.Color; +/* */ import java.awt.Dimension; +/* */ import java.awt.Event; +/* */ import java.awt.Font; +/* */ import java.awt.FontMetrics; +/* */ import java.awt.Graphics; +/* */ import java.awt.Toolkit; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ProgressBar +/* */ extends Canvas +/* */ { +/* */ private static final long serialVersionUID = -4391762871660491011L; +/* */ private static final int borderThickness = 1; +/* */ private static final int heightPadding = 2; +/* */ private int barWidth; +/* */ private int barHeight; +/* */ private Font font; +/* 37 */ private int fillWidth = -1; +/* */ +/* */ private int percent; +/* */ +/* */ public ProgressBar(int width) +/* */ { +/* 43 */ this.barWidth = width; +/* 44 */ this.font = new Font(Console.message("DialogFont"), 1, 14); +/* */ +/* 46 */ FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(this.font); +/* 47 */ this.barHeight = (fm.getAscent() + 4 + 2); +/* */ } +/* */ +/* */ public void setProgress(double amt) +/* */ { +/* 52 */ int visibleWidth = getSize().width; +/* 53 */ if (visibleWidth == 0) +/* 54 */ visibleWidth = this.barWidth; +/* 55 */ int width = (int)(amt * (visibleWidth - 2)); +/* 56 */ if (width != this.fillWidth) { +/* 57 */ this.fillWidth = width; +/* 58 */ this.percent = ((int)Math.round(100.0D * amt)); +/* 59 */ repaint(); +/* */ } +/* */ } +/* */ +/* */ public Dimension getPreferredSize() +/* */ { +/* 65 */ return new Dimension(this.barWidth, this.barHeight); +/* */ } +/* */ +/* */ public Dimension getMinimumSize() +/* */ { +/* 70 */ return getPreferredSize(); +/* */ } +/* */ +/* */ @Deprecated +/* */ public boolean handleEvent(Event event) +/* */ { +/* 76 */ if (event.id == 201) +/* 77 */ return true; +/* 78 */ return super.handleEvent(event); +/* */ } +/* */ +/* */ public void paint(Graphics g) +/* */ { +/* 83 */ Dimension size = getSize(); +/* 84 */ int width = size.width; +/* 85 */ int height = size.height; +/* 86 */ g.setColor(Color.lightGray); +/* 87 */ g.draw3DRect(0, 0, width - 1, height - 1, true); +/* 88 */ if (this.fillWidth > 0) { +/* 89 */ g.setColor(Color.blue); +/* 90 */ g.fillRect(1, 1, this.fillWidth, height - +/* 91 */ 2); +/* */ } +/* 93 */ String text = this.percent + "%"; +/* 94 */ g.setFont(this.font); +/* 95 */ FontMetrics fm = g.getFontMetrics(); +/* 96 */ int textWidth = fm.stringWidth(text); +/* 97 */ g.setColor(Color.black); +/* 98 */ g.drawString(text, (width - textWidth) / 2, +/* 99 */ (height + fm.getAscent()) / 2 - 1); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ProgressBar.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ProgressDialog.java b/NET/worlds/network/ProgressDialog.java new file mode 100644 index 0000000..5454c96 --- /dev/null +++ b/NET/worlds/network/ProgressDialog.java @@ -0,0 +1,361 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.GammaFrame; +/* */ import NET.worlds.console.PolledDialog; +/* */ import NET.worlds.core.Std; +/* */ import java.awt.Event; +/* */ import java.awt.GridBagConstraints; +/* */ import java.awt.GridBagLayout; +/* */ import java.awt.Insets; +/* */ import java.awt.Label; +/* */ import java.io.IOException; +/* */ import java.text.MessageFormat; +/* */ import java.text.NumberFormat; +/* */ import java.util.Locale; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ProgressDialog +/* */ extends PolledDialog +/* */ { +/* */ private static final long serialVersionUID = 7533646170494183110L; +/* 56 */ private static final String bytesMsg = Console.message("Bytes-remaining"); +/* */ private int bytesTotal; +/* */ private int bytesLoaded; +/* */ private ProgressBar progressBar; +/* */ private Label progressBytes; +/* */ private Label progressTime; +/* 62 */ private int startTime = Std.getFastTime(); +/* */ +/* */ private CacheFile cf; +/* */ +/* */ private boolean cancelled; +/* 67 */ private int wholeFileBytes = 0; +/* */ +/* */ public ProgressDialog(int totalSize) +/* */ { +/* 71 */ super(Console.getFrame(), null, Console.message("Download-Progress"), false); +/* 72 */ this.bytesTotal = totalSize; +/* 73 */ this.progressBar = new ProgressBar(240); +/* */ +/* 75 */ NumberFormat nF = NumberFormat.getNumberInstance(Locale.getDefault()); +/* 76 */ String strSize = nF.format(totalSize); +/* */ +/* 78 */ this.progressBytes = new Label(bytesMsg + strSize); +/* 79 */ this.progressTime = new Label(""); +/* 80 */ setAlignment(1); +/* */ +/* */ +/* */ +/* 84 */ readySetGo(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public boolean loadFiles(Vector<String> names, Vector<URL> urls) +/* */ throws IOException +/* */ { +/* */ try +/* */ { +/* 95 */ int count = names.size(); +/* 96 */ for (int i = 0; i < count; i++) { +/* 97 */ synchronized (this) { +/* 98 */ if (this.cancelled) { +/* 99 */ NetUpdate.warnUser("Upgrade cancelled."); +/* 100 */ return false; +/* */ } +/* */ +/* 103 */ if (this.cf != null) +/* 104 */ this.wholeFileBytes += this.cf.bytesLoaded(); +/* 105 */ this.cf = Cache.getFile((URL)urls.elementAt(i)); +/* */ } +/* 107 */ this.cf.waitUntilLoaded(); +/* */ +/* 109 */ if (!this.cf.isActive()) { +/* 110 */ this.cf.markTemporary(); +/* 111 */ NetUpdate.warnUser("Upgrade cancelled."); +/* 112 */ return false; } +/* 113 */ if (this.cf.error()) { +/* 114 */ this.cf.markTemporary(); +/* */ +/* 116 */ NetUpdate.warnUser("Error getting upgrade info, try again later"); +/* 117 */ return false; +/* */ } +/* */ +/* */ +/* 121 */ copyFile(this.cf.getLocalName(), (String)names.elementAt(i)); +/* */ +/* 123 */ this.cf.markTemporary(); +/* 124 */ this.cf.close(); +/* */ } +/* 126 */ return true; +/* */ } finally { +/* 128 */ done(true); +/* */ } +/* */ } +/* */ +/* */ /* Error */ +/* */ public static boolean copyFile(String from, String to) +/* */ { +/* */ // Byte code: +/* */ // 0: aload_1 +/* */ // 1: bipush 47 +/* */ // 3: invokevirtual 205 java/lang/String:lastIndexOf (I)I +/* */ // 6: istore_2 +/* */ // 7: aload_1 +/* */ // 8: bipush 92 +/* */ // 10: invokevirtual 205 java/lang/String:lastIndexOf (I)I +/* */ // 13: istore_3 +/* */ // 14: iload_3 +/* */ // 15: iload_2 +/* */ // 16: if_icmple +5 -> 21 +/* */ // 19: iload_3 +/* */ // 20: istore_2 +/* */ // 21: iload_2 +/* */ // 22: iflt +20 -> 42 +/* */ // 25: new 209 java/io/File +/* */ // 28: dup +/* */ // 29: aload_1 +/* */ // 30: iconst_0 +/* */ // 31: iload_2 +/* */ // 32: invokevirtual 211 java/lang/String:substring (II)Ljava/lang/String; +/* */ // 35: invokespecial 215 java/io/File:<init> (Ljava/lang/String;)V +/* */ // 38: invokevirtual 216 java/io/File:mkdirs ()Z +/* */ // 41: pop +/* */ // 42: aconst_null +/* */ // 43: astore 4 +/* */ // 45: aconst_null +/* */ // 46: astore 5 +/* */ // 48: new 219 java/io/FileInputStream +/* */ // 51: dup +/* */ // 52: aload_0 +/* */ // 53: invokespecial 221 java/io/FileInputStream:<init> (Ljava/lang/String;)V +/* */ // 56: astore 4 +/* */ // 58: new 222 java/io/FileOutputStream +/* */ // 61: dup +/* */ // 62: aload_1 +/* */ // 63: invokespecial 224 java/io/FileOutputStream:<init> (Ljava/lang/String;)V +/* */ // 66: astore 5 +/* */ // 68: sipush 1024 +/* */ // 71: newarray <illegal type> +/* */ // 73: astore 6 +/* */ // 75: aload 4 +/* */ // 77: aload 6 +/* */ // 79: invokevirtual 225 java/io/FileInputStream:read ([B)I +/* */ // 82: istore 7 +/* */ // 84: iload 7 +/* */ // 86: iconst_m1 +/* */ // 87: if_icmpne +6 -> 93 +/* */ // 90: goto +41 -> 131 +/* */ // 93: aload 5 +/* */ // 95: aload 6 +/* */ // 97: iconst_0 +/* */ // 98: iload 7 +/* */ // 100: invokevirtual 229 java/io/FileOutputStream:write ([BII)V +/* */ // 103: goto -28 -> 75 +/* */ // 106: astore 8 +/* */ // 108: aload 5 +/* */ // 110: ifnull +8 -> 118 +/* */ // 113: aload 5 +/* */ // 115: invokevirtual 233 java/io/FileOutputStream:close ()V +/* */ // 118: aload 4 +/* */ // 120: ifnull +8 -> 128 +/* */ // 123: aload 4 +/* */ // 125: invokevirtual 234 java/io/FileInputStream:close ()V +/* */ // 128: aload 8 +/* */ // 130: athrow +/* */ // 131: aload 5 +/* */ // 133: ifnull +8 -> 141 +/* */ // 136: aload 5 +/* */ // 138: invokevirtual 233 java/io/FileOutputStream:close ()V +/* */ // 141: aload 4 +/* */ // 143: ifnull +8 -> 151 +/* */ // 146: aload 4 +/* */ // 148: invokevirtual 234 java/io/FileInputStream:close ()V +/* */ // 151: iconst_1 +/* */ // 152: ireturn +/* */ // 153: astore 6 +/* */ // 155: iconst_0 +/* */ // 156: ireturn +/* */ // Line number table: +/* */ // Java source line #138 -> byte code offset #0 +/* */ // Java source line #139 -> byte code offset #7 +/* */ // Java source line #140 -> byte code offset #14 +/* */ // Java source line #141 -> byte code offset #19 +/* */ // Java source line #142 -> byte code offset #21 +/* */ // Java source line #143 -> byte code offset #25 +/* */ // Java source line #145 -> byte code offset #42 +/* */ // Java source line #146 -> byte code offset #45 +/* */ // Java source line #149 -> byte code offset #48 +/* */ // Java source line #150 -> byte code offset #58 +/* */ // Java source line #151 -> byte code offset #68 +/* */ // Java source line #153 -> byte code offset #75 +/* */ // Java source line #154 -> byte code offset #84 +/* */ // Java source line #155 -> byte code offset #90 +/* */ // Java source line #156 -> byte code offset #93 +/* */ // Java source line #152 -> byte code offset #103 +/* */ // Java source line #158 -> byte code offset #106 +/* */ // Java source line #159 -> byte code offset #108 +/* */ // Java source line #160 -> byte code offset #113 +/* */ // Java source line #161 -> byte code offset #118 +/* */ // Java source line #162 -> byte code offset #123 +/* */ // Java source line #163 -> byte code offset #128 +/* */ // Java source line #159 -> byte code offset #131 +/* */ // Java source line #160 -> byte code offset #136 +/* */ // Java source line #161 -> byte code offset #141 +/* */ // Java source line #162 -> byte code offset #146 +/* */ // Java source line #164 -> byte code offset #151 +/* */ // Java source line #165 -> byte code offset #153 +/* */ // Java source line #166 -> byte code offset #155 +/* */ // Local variable table: +/* */ // start length slot name signature +/* */ // 0 157 0 from String +/* */ // 0 157 1 to String +/* */ // 6 26 2 lastSlash int +/* */ // 13 7 3 lastBackslash int +/* */ // 43 104 4 s java.io.FileInputStream +/* */ // 46 91 5 d java.io.FileOutputStream +/* */ // 73 23 6 buffer byte[] +/* */ // 153 3 6 e IOException +/* */ // 82 17 7 got int +/* */ // 106 23 8 localObject Object +/* */ // Exception table: +/* */ // from to target type +/* */ // 48 106 106 finally +/* */ // 48 151 153 java/io/IOException +/* */ } +/* */ +/* */ protected void build() +/* */ { +/* 172 */ GridBagLayout gbag = new GridBagLayout(); +/* 173 */ setLayout(gbag); +/* 174 */ GridBagConstraints c = new GridBagConstraints(); +/* 175 */ c.anchor = 10; +/* 176 */ c.gridwidth = 0; +/* 177 */ c.weightx = 1.0D; +/* 178 */ c.weighty = 1.0D; +/* 179 */ add(gbag, new Label(Console.message("Downloading-update")), c); +/* 180 */ c.insets = new Insets(2, 2, 2, 2); +/* 181 */ add(gbag, this.progressBar, c); +/* 182 */ c.insets = new Insets(0, 2, 0, 2); +/* 183 */ c.anchor = 17; +/* 184 */ add(gbag, this.progressBytes, c); +/* 185 */ c.fill = 2; +/* 186 */ add(gbag, this.progressTime, c); +/* */ } +/* */ +/* */ +/* */ +/* */ protected synchronized void activeCallback() +/* */ { +/* 193 */ synchronized (this) { +/* 194 */ int n = this.wholeFileBytes; +/* 195 */ if (this.cf != null) +/* 196 */ n += this.cf.bytesLoaded(); +/* */ } +/* */ int n; +/* 199 */ if (n != this.bytesLoaded) { +/* 200 */ this.bytesLoaded = n; +/* 201 */ this.progressBar.setProgress(this.bytesLoaded / this.bytesTotal); +/* 202 */ int bytesRemaining = this.bytesTotal - this.bytesLoaded; +/* */ +/* 204 */ NumberFormat nF = NumberFormat.getNumberInstance( +/* 205 */ Locale.getDefault()); +/* 206 */ String strRemain = nF.format(bytesRemaining); +/* 207 */ this.progressBytes.setText(bytesMsg + strRemain); +/* */ +/* 209 */ int elapsed = (Std.getFastTime() - this.startTime) / 1000; +/* 210 */ if (elapsed > 0) { +/* 211 */ double bytesPerSec = this.bytesLoaded / elapsed; +/* 212 */ if (bytesPerSec > 0.0D) { +/* 213 */ String bps = formatTime((bytesRemaining / bytesPerSec)); +/* 214 */ Object[] arguments = { new String(bps) }; +/* */ +/* 216 */ this.progressTime.setText(MessageFormat.format( +/* 217 */ Console.message("Time-remaining"), arguments)); +/* */ } +/* */ } +/* */ } +/* */ +/* 222 */ notify(); +/* */ } +/* */ +/* */ protected boolean done(boolean confirmed) +/* */ { +/* 227 */ synchronized (this) { +/* 228 */ this.cancelled = true; +/* 229 */ if (this.cf != null) +/* 230 */ this.cf.close(); +/* */ } +/* 232 */ return super.done(confirmed); +/* */ } +/* */ +/* */ private static String fmtTwoDigit(long val) { +/* 236 */ if (val < 10L) +/* 237 */ return "0" + val; +/* 238 */ return val; +/* */ } +/* */ +/* */ private static String formatTime(long secs) { +/* 242 */ String result = ""; +/* 243 */ long hrs = secs / 3600L; +/* 244 */ secs -= hrs * 3600L; +/* 245 */ long mins = secs / 60L; +/* 246 */ secs -= mins * 60L; +/* 247 */ if (hrs > 0L) +/* 248 */ result = result + hrs + ":"; +/* 249 */ return result + fmtTwoDigit(mins) + ":" + fmtTwoDigit(secs); +/* */ } +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean handleEvent(Event event) +/* */ { +/* 256 */ if (event.id == 1004) { +/* 257 */ Console.getFrame().requestFocus(); +/* 258 */ return true; +/* */ } +/* 260 */ return super.handleEvent(event); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ProgressDialog.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/PropertyList.java b/NET/worlds/network/PropertyList.java new file mode 100644 index 0000000..4ad228d --- /dev/null +++ b/NET/worlds/network/PropertyList.java @@ -0,0 +1,108 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.io.UTFDataFormatException; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class PropertyList +/* */ { +/* */ private Vector<net2Property> _propList; +/* */ +/* */ public PropertyList() +/* */ { +/* 26 */ this._propList = new Vector(); +/* */ } +/* */ +/* */ public void addProperty(net2Property prop) { +/* 30 */ this._propList.addElement(prop); +/* */ } +/* */ +/* */ public int size() { +/* 34 */ return this._propList.size(); +/* */ } +/* */ +/* */ public net2Property elementAt(int i) { +/* 38 */ return (net2Property)this._propList.elementAt(i); +/* */ } +/* */ +/* */ public net2Property getProperty(int propID) { +/* 42 */ for (int i = this._propList.size() - 1; i >= 0; i--) { +/* 43 */ if (elementAt(i).property() == propID) +/* 44 */ return elementAt(i); +/* */ } +/* 46 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ void parseNetData(ServerInputStream data) +/* */ throws IOException +/* */ { +/* 54 */ this._propList = new Vector(); +/* 55 */ while (!data.isEmpty()) { +/* */ try { +/* 57 */ net2Property tmpProp = new net2Property(); +/* 58 */ tmpProp.parseNetData(data); +/* 59 */ this._propList.addElement(tmpProp); +/* */ } +/* */ catch (UTFDataFormatException e) { +/* 62 */ System.out.println("Property list discarded; invalid UTF property."); +/* 63 */ this._propList.removeAllElements(); +/* 64 */ data.skipBytes(data.bytesLeft()); +/* 65 */ assert (data.isEmpty()); +/* 66 */ return; +/* */ } +/* */ } +/* */ } +/* */ +/* */ int packetSize() { +/* 72 */ int len = 0; +/* */ +/* 74 */ for (int i = this._propList.size() - 1; i >= 0; i--) { +/* 75 */ net2Property tmpProp = (net2Property)this._propList.elementAt(i); +/* 76 */ len += tmpProp.packetSize(); +/* */ } +/* 78 */ return len; +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException { +/* 82 */ int maxidx = this._propList.size(); +/* */ +/* 84 */ for (int i = 0; i < maxidx; i++) { +/* 85 */ net2Property tmpProp = (net2Property)this._propList.elementAt(i); +/* 86 */ tmpProp.send(o); +/* */ } +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 92 */ String out = "("; +/* 93 */ int maxidx = this._propList.size(); +/* */ +/* 95 */ for (int i = 0; i < maxidx; i++) { +/* 96 */ net2Property tmpProp = (net2Property)this._propList.elementAt(i); +/* 97 */ out = out + tmpProp + " "; +/* */ } +/* 99 */ out = out + ")"; +/* 100 */ return out; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\PropertyList.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/PropertySetCmd.java b/NET/worlds/network/PropertySetCmd.java new file mode 100644 index 0000000..3f043bf --- /dev/null +++ b/NET/worlds/network/PropertySetCmd.java @@ -0,0 +1,102 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class PropertySetCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte PROPSETCMD = 15; +/* */ private PropertyList _propList; +/* */ private String _fromUser; +/* */ +/* */ public PropertySetCmd() +/* */ { +/* 39 */ this._commandType = 15; +/* */ } +/* */ +/* */ public PropertySetCmd(PropertyList propList) +/* */ { +/* 44 */ super(null, 15); +/* 45 */ this._propList = propList; +/* 46 */ this._fromUser = new String(""); +/* */ } +/* */ +/* */ public PropertySetCmd(ObjID objID, PropertyList propList) +/* */ { +/* 51 */ super(objID, 15); +/* 52 */ this._propList = propList; +/* 53 */ this._fromUser = new String(""); +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 58 */ this._fromUser = data.readUTF(); +/* 59 */ this._propList = new PropertyList(); +/* 60 */ this._propList.parseNetData(data); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 65 */ int len = super.packetSize(); +/* */ +/* 67 */ assert (this._fromUser != null); +/* 68 */ len += 1 + ServerOutputStream.utfLength(this._fromUser); +/* */ +/* 70 */ len += this._propList.packetSize(); +/* */ +/* 72 */ return len; +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 77 */ super.send(o); +/* */ +/* 79 */ o.writeUTF(this._fromUser); +/* 80 */ this._propList.send(o); +/* */ } +/* */ +/* */ +/* */ +/* */ void process(WorldServer _serv) +/* */ throws Exception +/* */ {} +/* */ +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 93 */ return +/* 94 */ "PROPSET \"" + this._fromUser + "\"->" + this._objID.toString(serv) + " " + this._propList; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\PropertySetCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/PropertyUpdateCmd.java b/NET/worlds/network/PropertyUpdateCmd.java new file mode 100644 index 0000000..30faf09 --- /dev/null +++ b/NET/worlds/network/PropertyUpdateCmd.java @@ -0,0 +1,81 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class PropertyUpdateCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte PROPUPDCMD = 16; +/* */ protected PropertyList _propList; +/* */ +/* */ public PropertyUpdateCmd() +/* */ { +/* 43 */ this._commandType = 16; +/* */ } +/* */ +/* */ +/* */ void parseNetData(ServerInputStream data) +/* */ throws IOException +/* */ { +/* 50 */ this._propList = new PropertyList(); +/* 51 */ this._propList.parseNetData(data); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception +/* */ { +/* 56 */ NetworkObject o = _serv.getObject(this._objID); +/* 57 */ if (o != null) { +/* 58 */ o.propertyUpdate(this._propList); +/* */ } +/* 60 */ else if ((Galaxy.getDebugLevel() & 0x20) != 0) { +/* 61 */ System.err.println("PropertyUpdateCmd.process() status: message dropped because destination object is null"); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 73 */ return "PROPUPD " + this._objID.toString(serv) + " " + this._propList; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\PropertyUpdateCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/RedirectCmd.java b/NET/worlds/network/RedirectCmd.java new file mode 100644 index 0000000..0d2fe51 --- /dev/null +++ b/NET/worlds/network/RedirectCmd.java @@ -0,0 +1,81 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class RedirectCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte REDIRECTCMD = 25; +/* */ protected int _roomNumber; +/* */ protected int _ip1; +/* */ protected int _ip2; +/* */ protected int _ip3; +/* */ protected int _ip4; +/* */ protected int _port; +/* */ +/* */ public RedirectCmd() +/* */ { +/* 35 */ this._commandType = 25; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 40 */ this._roomNumber = data.readUnsignedShort(); +/* 41 */ this._ip1 = data.readUnsignedByte(); +/* 42 */ this._ip2 = data.readUnsignedByte(); +/* 43 */ this._ip3 = data.readUnsignedByte(); +/* 44 */ this._ip4 = data.readUnsignedByte(); +/* 45 */ this._port = data.readUnsignedShort(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void process(WorldServer serv) +/* */ throws Exception +/* */ {} +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ String toStringHlpr() +/* */ { +/* 66 */ return +/* 67 */ this._roomNumber + " -> " + this._ip1 + "." + this._ip2 + "." + this._ip3 + "." + this._ip4 + ":" + this._port; +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 73 */ return "REDIRECT " + toStringHlpr(); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\RedirectCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/RedirectIDCmd.java b/NET/worlds/network/RedirectIDCmd.java new file mode 100644 index 0000000..e1a9459 --- /dev/null +++ b/NET/worlds/network/RedirectIDCmd.java @@ -0,0 +1,73 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class RedirectIDCmd +/* */ extends RedirectCmd +/* */ { +/* */ public static final byte REDIRECTIDCMD = 26; +/* */ protected String _roomName; +/* */ +/* */ public RedirectIDCmd() +/* */ { +/* 39 */ this._commandType = 26; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 44 */ this._roomName = data.readUTF(); +/* 45 */ super.parseNetData(data); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ void process(WorldServer _serv) +/* */ throws Exception +/* */ { +/* 54 */ _serv.regRoomID(this._roomNumber, this._roomName, true); +/* */ +/* 56 */ String s = "worldserver://" + this._ip1 + "." + this._ip2 + "." + this._ip3 + "." + +/* 57 */ this._ip4 + ":" + this._port + "/RoomServer"; +/* 58 */ ServerURL url = new ServerURL(s); +/* 59 */ _serv.redirectRoom(this._roomName, url); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 65 */ return "REDIRID " + this._roomName + "==" + super.toStringHlpr(); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\RedirectIDCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/RemoteFileConst.java b/NET/worlds/network/RemoteFileConst.java new file mode 100644 index 0000000..098a93b --- /dev/null +++ b/NET/worlds/network/RemoteFileConst.java @@ -0,0 +1,14 @@ +package NET.worlds.network; + +public abstract interface RemoteFileConst +{ + public static final String INI_WORLD_SECTION = "InstalledWorlds"; + public static final String INSTALLED_WORLD_TEMPLATE = "InstalledWorld"; + public static final String MAX_INSTALLED_WORLDS_TEMPLATE = "MaxInstalledWorlds"; +} + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\RemoteFileConst.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/RoomMgr.java b/NET/worlds/network/RoomMgr.java new file mode 100644 index 0000000..d3c7ef0 --- /dev/null +++ b/NET/worlds/network/RoomMgr.java @@ -0,0 +1,177 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.core.Std; +/* */ import java.io.PrintStream; +/* */ import java.util.Enumeration; +/* */ import java.util.Hashtable; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class RoomMgr +/* */ { +/* */ Hashtable<Integer, NetworkRoom> _roomFRoomID; +/* */ Hashtable<String, NetworkRoom> _requestList; +/* */ int _requestCount; +/* */ +/* */ public RoomMgr() +/* */ { +/* 67 */ this._roomFRoomID = new Hashtable(); +/* 68 */ this._requestList = null; +/* 69 */ this._requestCount = 0; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void addRequest(String roomName, NetworkRoom room) +/* */ { +/* 80 */ if (this._requestCount == 0) { +/* 81 */ this._requestList = new Hashtable(); +/* */ } +/* 83 */ assert (this._requestList.get(roomName) == null); +/* 84 */ this._requestList.put(roomName, room); +/* 85 */ this._requestCount += 1; +/* */ } +/* */ +/* */ public synchronized void delRequest(String roomName) { +/* 89 */ if (this._requestList == null) +/* */ { +/* */ +/* */ +/* */ +/* 94 */ System.out.println(this + ": delRequest() - " + roomName); +/* 95 */ new Exception().printStackTrace(System.out); +/* 96 */ return; +/* */ } +/* 98 */ this._requestCount -= 1; +/* 99 */ this._requestList.remove(roomName); +/* 100 */ if (this._requestCount == 0) { +/* 101 */ this._requestList = null; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized NetworkRoom getRequest(String roomName) +/* */ { +/* 110 */ if (this._requestList == null) +/* 111 */ return null; +/* 112 */ NetworkRoom tmpRoom = (NetworkRoom)this._requestList.get(roomName); +/* */ +/* */ +/* 115 */ if (tmpRoom != null) +/* 116 */ delRequest(roomName); +/* 117 */ return tmpRoom; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void regRoomID(int roomID, NetworkRoom room) +/* */ { +/* 126 */ NetworkRoom noRoom = (NetworkRoom)this._roomFRoomID.get(new Integer( +/* 127 */ roomID)); +/* */ +/* 129 */ if ((noRoom != null) && (noRoom != room)) +/* */ { +/* 131 */ System.out.println("[" + Std.getRealTime() + +/* 132 */ "]: Weird - room is already registered."); +/* 133 */ System.out.println("new roomID = " + roomID + ", new room = " + +/* 134 */ room); +/* 135 */ System.out.println(room.debugStuff()); +/* 136 */ System.out.println("old room is " + noRoom); +/* 137 */ System.out.println(noRoom.debugStuff()); +/* 138 */ new Exception().printStackTrace(System.out); +/* */ } +/* */ +/* 141 */ this._roomFRoomID.put(new Integer(roomID), room); +/* */ } +/* */ +/* */ public void delRoomID(int roomID, NetworkRoom delRoom) { +/* 145 */ NetworkRoom room = +/* 146 */ (NetworkRoom)this._roomFRoomID.remove(new Integer(roomID)); +/* */ +/* 148 */ if (room == null) +/* */ { +/* */ +/* 151 */ System.out.println("Error - deleting a bad roomID: " + roomID); +/* 152 */ System.out.println(delRoom.debugStuff()); +/* 153 */ new Exception().printStackTrace(System.out); +/* */ } +/* */ } +/* */ +/* */ public NetworkRoom getRoom(int roomID) +/* */ { +/* 159 */ if (roomID == 0) +/* 160 */ return null; +/* 161 */ NetworkRoom room = (NetworkRoom)this._roomFRoomID.get(new Integer(roomID)); +/* */ +/* */ +/* 164 */ return room; +/* */ } +/* */ +/* */ public Enumeration<NetworkRoom> rooms() +/* */ { +/* 169 */ return this._roomFRoomID.elements(); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\RoomMgr.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/RoomServer.java b/NET/worlds/network/RoomServer.java new file mode 100644 index 0000000..b79ecb1 --- /dev/null +++ b/NET/worlds/network/RoomServer.java @@ -0,0 +1,248 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.core.IniFile; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class RoomServer +/* */ extends AnonRoomServer +/* */ { +/* */ public synchronized void incRefCnt(Object referrer) +/* */ { +/* 105 */ super.incRefCnt(referrer); +/* 106 */ startConnect(); +/* */ } +/* */ +/* */ protected void state_Authprompt() +/* */ { +/* 111 */ this._state.setState(3); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected sessionInitCmd buildSessionInitCmd() +/* */ { +/* 129 */ OldPropertyList props = new OldPropertyList(); +/* 130 */ String username = null; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 137 */ props.addProperty(new netProperty(3, +/* 138 */ String.valueOf(getVersion()))); +/* 139 */ props.addProperty(new netProperty(9, +/* 140 */ String.valueOf(this._clientVersion))); +/* */ +/* 142 */ this._firstLogon = this._galaxy.addPendingServer(this); +/* */ +/* 144 */ if (this._firstLogon) +/* */ { +/* */ +/* 147 */ return null; +/* */ } +/* */ +/* */ +/* 151 */ int avatars = IniFile.gamma().getIniInt("avatars", 24); +/* 152 */ props.addProperty(new netProperty(7, +/* 153 */ Integer.toString(avatars))); +/* */ +/* */ +/* 156 */ assert (this._galaxy.getChatname() != null); +/* 157 */ username = this._galaxy.getChatname(); +/* */ +/* */ +/* */ +/* 161 */ regShortID(1, username); +/* */ +/* 163 */ props.addProperty(new netProperty(2, username)); +/* */ +/* 165 */ if ((this._galaxy.getLoginMode() != 3) && +/* 166 */ (this._galaxy.getPassword() != null)) { +/* 167 */ props.addProperty(new netProperty(6, this._galaxy +/* 168 */ .getPassword())); +/* */ } +/* */ +/* 171 */ if ((getDebugLevel() & 0x4) > 0) { +/* 172 */ synchronized (System.out) { +/* 173 */ System.out.println(this._serverURL.getHost() + +/* 174 */ ": sending sessionInit."); +/* 175 */ assert (username != null); +/* 176 */ System.out.println(" username = \"" + username + "\""); +/* 177 */ if (this._galaxy.getPassword() != null) { +/* 178 */ System.out.println(" password = \"" + +/* 179 */ this._galaxy.getPassword() + "\""); +/* */ } +/* */ } +/* */ } +/* 183 */ return new sessionInitCmd(props); +/* */ } +/* */ +/* */ protected void state_Sleeping(int timeNow) +/* */ { +/* 188 */ if (getGalaxy().isActive()) +/* */ { +/* */ +/* 191 */ super.state_Sleeping(timeNow); +/* */ } +/* */ else { +/* 194 */ this._state.setState(0); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void goOnline() +/* */ { +/* 240 */ this._requestOffline = false; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\RoomServer.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/SMState.java b/NET/worlds/network/SMState.java new file mode 100644 index 0000000..946c77d --- /dev/null +++ b/NET/worlds/network/SMState.java @@ -0,0 +1,93 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.core.IniFile; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class SMState +/* */ { +/* */ private int _state; +/* */ private WorldServer _ws; +/* */ private static int _debugLevel; +/* */ +/* */ static +/* */ { +/* */ try +/* */ { +/* 28 */ _debugLevel = Integer.parseInt(IniFile.gamma().getIniString( +/* 29 */ "netdebug", "0")); +/* */ } catch (NumberFormatException e) { +/* 31 */ _debugLevel = 0; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public SMState(WorldServer ws, int state) +/* */ { +/* 39 */ this._state = state; +/* 40 */ this._ws = ws; +/* */ } +/* */ +/* */ public int getState() { +/* 44 */ return this._state; +/* */ } +/* */ +/* */ public synchronized void setState(int state) +/* */ { +/* 49 */ if ((_debugLevel & 0x8) > 0) { +/* 50 */ synchronized (System.out) { +/* 51 */ System.out.println(this._ws + ": *** new state: " + state); +/* 52 */ if ((_debugLevel & 0x10) > 0) +/* */ try { +/* 54 */ throw new InterruptedException(); +/* */ } catch (InterruptedException e) { +/* 56 */ e.printStackTrace(System.out); +/* 57 */ System.out +/* 58 */ .println("******************************"); +/* */ } +/* */ } +/* */ } +/* 62 */ this._state = state; +/* 63 */ notifyAll(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized void waitForState(int state) +/* */ throws InfiniteWaitException +/* */ { +/* 74 */ while (this._state != state) { +/* */ try { +/* 76 */ wait(); +/* */ } +/* */ catch (InterruptedException e) +/* */ { +/* 80 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 82 */ if (this._state == -1) { +/* 83 */ throw new InfiniteWaitException(); +/* */ } +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\SMState.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ServerInputStream.java b/NET/worlds/network/ServerInputStream.java new file mode 100644 index 0000000..1e2123b --- /dev/null +++ b/NET/worlds/network/ServerInputStream.java @@ -0,0 +1,332 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.EOFException; +/* */ import java.io.FilterInputStream; +/* */ import java.io.IOException; +/* */ import java.io.InputStream; +/* */ import java.io.UTFDataFormatException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ServerInputStream +/* */ extends FilterInputStream +/* */ { +/* */ private int _packetSize; +/* */ private int _version; +/* */ +/* */ public ServerInputStream(InputStream in) +/* */ { +/* 70 */ super(in); +/* 71 */ assert (in != null); +/* 72 */ this._packetSize = 0; +/* 73 */ this._version = 24; +/* */ } +/* */ +/* */ public ServerInputStream(InputStream in, int vers) { +/* 77 */ super(in); +/* 78 */ assert (in != null); +/* 79 */ this._packetSize = 0; +/* 80 */ this._version = vers; +/* */ } +/* */ +/* */ public void setVersion(int vers) { +/* 84 */ this._version = vers; +/* */ } +/* */ +/* */ public int getVersion() { +/* 88 */ return this._version; +/* */ } +/* */ +/* */ public void readPacketSize() throws IOException { +/* 92 */ assert (this._packetSize == 0); +/* 93 */ this._packetSize = 1; +/* 94 */ this._packetSize = (readUnsignedByte() - 1); +/* */ +/* */ +/* 97 */ if (((this._packetSize & 0x80) != 0) && (getVersion() > 24)) { +/* 98 */ this._packetSize = +/* 99 */ ((this._packetSize & 0x80) * 256 + readUnsignedByte() - 1); +/* */ } +/* */ } +/* */ +/* */ public boolean isEmpty() { +/* 104 */ return this._packetSize == 0; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public int bytesLeft() +/* */ { +/* 113 */ return this._packetSize; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final int read(byte[] b) +/* */ throws IOException +/* */ { +/* 124 */ assert (this._packetSize >= b.length); +/* 125 */ if (b.length == 0) +/* 126 */ return 0; +/* 127 */ int bytesRead = this.in.read(b, 0, b.length); +/* 128 */ if (bytesRead < 0) +/* 129 */ throw new EOFException(); +/* 130 */ this._packetSize -= bytesRead; +/* 131 */ return bytesRead; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final int read(byte[] b, int off, int len) +/* */ throws IOException +/* */ { +/* 142 */ assert (this._packetSize >= len); +/* 143 */ int bytesRead = this.in.read(b, off, len); +/* 144 */ if (bytesRead < 0) +/* 145 */ throw new EOFException(); +/* 146 */ this._packetSize -= bytesRead; +/* 147 */ return bytesRead; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public final void readFully(byte[] b) +/* */ throws IOException +/* */ { +/* 156 */ assert (this._packetSize >= b.length); +/* 157 */ readFully(b, 0, b.length); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final void readFully(byte[] b, int off, int len) +/* */ throws IOException +/* */ { +/* 167 */ assert (this._packetSize >= len); +/* 168 */ this._packetSize -= len; +/* 169 */ InputStream in = this.in; +/* 170 */ while (len > 0) { +/* 171 */ int bytesRead = in.read(b, off, len); +/* 172 */ if (bytesRead < 0) +/* 173 */ throw new EOFException(); +/* 174 */ len -= bytesRead; +/* 175 */ off += bytesRead; +/* */ } +/* */ } +/* */ +/* */ +/* */ public void skipBytes(int n) +/* */ throws IOException +/* */ { +/* 183 */ assert (this._packetSize >= n); +/* 184 */ this._packetSize -= n; +/* 185 */ InputStream in = this.in; +/* 186 */ while (n > 0) { +/* 187 */ int bytesSkipped = (int)in.skip(n); +/* 188 */ if (bytesSkipped < 0) +/* 189 */ throw new EOFException(); +/* 190 */ n -= bytesSkipped; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final byte readByte() +/* */ throws IOException +/* */ { +/* 201 */ if (this._packetSize < 1) +/* 202 */ throw new IOException(); +/* 203 */ int ch = this.in.read(); +/* 204 */ if (ch < 0) +/* 205 */ throw new EOFException(); +/* 206 */ this._packetSize -= 1; +/* 207 */ return (byte)ch; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final int readUnsignedByte() +/* */ throws IOException +/* */ { +/* 217 */ if (this._packetSize < 1) +/* 218 */ throw new IOException(); +/* 219 */ int ch = this.in.read(); +/* 220 */ if (ch < 0) +/* 221 */ throw new EOFException(); +/* 222 */ this._packetSize -= 1; +/* 223 */ return ch; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public final short readShort() +/* */ throws IOException +/* */ { +/* 232 */ assert (this._packetSize >= 2); +/* 233 */ InputStream in = this.in; +/* 234 */ int ch1 = in.read(); +/* 235 */ int ch2 = in.read(); +/* 236 */ if ((ch1 | ch2) < 0) +/* 237 */ throw new EOFException(); +/* 238 */ this._packetSize -= 2; +/* 239 */ return (short)((ch1 << 8) + (ch2 << 0)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public final int readUnsignedShort() +/* */ throws IOException +/* */ { +/* 248 */ assert (this._packetSize >= 2); +/* 249 */ InputStream in = this.in; +/* 250 */ int ch1 = in.read(); +/* 251 */ int ch2 = in.read(); +/* 252 */ if ((ch1 | ch2) < 0) +/* 253 */ throw new EOFException(); +/* 254 */ this._packetSize -= 2; +/* 255 */ return (ch1 << 8) + (ch2 << 0); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String readUTF() +/* */ throws IOException +/* */ { +/* 267 */ if (this._packetSize < 1) { +/* 268 */ throw new IOException(); +/* */ } +/* 270 */ int utflen = readUnsignedByte(); +/* */ +/* 272 */ if (this._packetSize < utflen) { +/* 273 */ throw new UTFDataFormatException(); +/* */ } +/* */ +/* */ +/* 277 */ char[] str = new char[utflen]; +/* 278 */ int count = 0; +/* 279 */ int strlen = 0; +/* 280 */ while (count < utflen) { +/* 281 */ int c = readUnsignedByte(); +/* */ +/* 283 */ switch (c >> 4) +/* */ { +/* */ case 0: +/* */ case 1: +/* */ case 2: +/* */ case 3: +/* */ case 4: +/* */ case 5: +/* */ case 6: +/* */ case 7: +/* 293 */ count++; +/* 294 */ str[(strlen++)] = ((char)c); +/* 295 */ break; +/* */ +/* */ case 12: +/* */ case 13: +/* 299 */ count += 2; +/* 300 */ if (count > utflen) +/* 301 */ throw new UTFDataFormatException(); +/* 302 */ int char2 = readUnsignedByte(); +/* 303 */ if ((char2 & 0xC0) != 128) +/* 304 */ throw new UTFDataFormatException(); +/* 305 */ str[(strlen++)] = ((char)((c & 0x1F) << 6 | char2 & 0x3F)); +/* 306 */ break; +/* */ +/* */ case 14: +/* 309 */ count += 3; +/* 310 */ if (count > utflen) +/* 311 */ throw new UTFDataFormatException(); +/* 312 */ int char2 = readUnsignedByte(); +/* 313 */ int char3 = readUnsignedByte(); +/* 314 */ if (((char2 & 0xC0) != 128) || ((char3 & 0xC0) != 128)) +/* 315 */ throw new UTFDataFormatException(); +/* 316 */ str[(strlen++)] = +/* 317 */ ((char)((c & 0xF) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0)); +/* 318 */ break; +/* */ case 8: case 9: case 10: +/* */ case 11: default: +/* 321 */ throw new UTFDataFormatException(); +/* */ } +/* */ } +/* 324 */ return new String(str, 0, strlen); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ServerInputStream.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ServerOutputStream.java b/NET/worlds/network/ServerOutputStream.java new file mode 100644 index 0000000..3fb4270 --- /dev/null +++ b/NET/worlds/network/ServerOutputStream.java @@ -0,0 +1,171 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.FilterOutputStream; +/* */ import java.io.IOException; +/* */ import java.io.OutputStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ServerOutputStream +/* */ extends FilterOutputStream +/* */ { +/* */ private int _version; +/* */ +/* */ public ServerOutputStream(OutputStream o) +/* */ { +/* 46 */ super(o); +/* 47 */ setVersion(24); +/* */ } +/* */ +/* */ public ServerOutputStream(OutputStream o, int vers) { +/* 51 */ super(o); +/* 52 */ setVersion(vers); +/* */ } +/* */ +/* */ public void setVersion(int vers) { +/* 56 */ this._version = vers; +/* */ } +/* */ +/* */ public int getVersion() { +/* 60 */ return this._version; +/* */ } +/* */ +/* */ +/* */ public final void write(int b) +/* */ throws IOException +/* */ { +/* 67 */ this.out.write(b); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final void write(byte[] b, int off, int len) +/* */ throws IOException +/* */ { +/* 77 */ this.out.write(b, off, len); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final void writeByte(int v) +/* */ throws IOException +/* */ { +/* 92 */ this.out.write(v); +/* */ } +/* */ +/* */ +/* */ +/* */ public final void writeShort(int v) +/* */ throws IOException +/* */ { +/* 100 */ OutputStream out = this.out; +/* 101 */ out.write(v >>> 8 & 0xFF); +/* 102 */ out.write(v >>> 0 & 0xFF); +/* */ } +/* */ +/* */ +/* */ +/* */ public final void writeInt(int v) +/* */ throws IOException +/* */ { +/* 110 */ OutputStream out = this.out; +/* 111 */ out.write(v >>> 24 & 0xFF); +/* 112 */ out.write(v >>> 16 & 0xFF); +/* 113 */ out.write(v >>> 8 & 0xFF); +/* 114 */ out.write(v >>> 0 & 0xFF); +/* */ } +/* */ +/* */ +/* */ +/* */ public static int utfLength(String str) +/* */ { +/* 121 */ int strlen = str.length(); +/* 122 */ int utflen = 0; +/* */ +/* 124 */ for (int i = 0; i < strlen; i++) { +/* 125 */ int c = str.charAt(i); +/* 126 */ if ((c >= 1) && (c <= 127)) { +/* 127 */ utflen++; +/* 128 */ } else if (c > 2047) { +/* 129 */ utflen += 3; +/* */ } else { +/* 131 */ utflen += 2; +/* */ } +/* */ } +/* 134 */ return utflen; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void writeUTF(String str) +/* */ throws IOException +/* */ { +/* 144 */ OutputStream out = this.out; +/* 145 */ int strlen = str.length(); +/* 146 */ int utflen = utfLength(str); +/* */ +/* 148 */ assert (utflen < 256); +/* */ +/* 150 */ out.write(utflen >>> 0 & 0xFF); +/* 151 */ for (int i = 0; i < strlen; i++) { +/* 152 */ int c = str.charAt(i); +/* 153 */ if ((c >= 1) && (c <= 127)) { +/* 154 */ out.write(c); +/* 155 */ } else if (c > 2047) { +/* 156 */ out.write(0xE0 | c >> 12 & 0xF); +/* 157 */ out.write(0x80 | c >> 6 & 0x3F); +/* 158 */ out.write(0x80 | c >> 0 & 0x3F); +/* */ } else { +/* 160 */ out.write(0xC0 | c >> 6 & 0x1F); +/* 161 */ out.write(0x80 | c >> 0 & 0x3F); +/* */ } +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ServerOutputStream.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ServerTracker.java b/NET/worlds/network/ServerTracker.java new file mode 100644 index 0000000..7f7e36e --- /dev/null +++ b/NET/worlds/network/ServerTracker.java @@ -0,0 +1,328 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.PrintStream; +/* */ import java.util.Enumeration; +/* */ import java.util.Hashtable; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class ServerTracker +/* */ { +/* 33 */ private Hashtable<String, WorldServer> _serverHash = new Hashtable(); +/* */ +/* */ +/* 36 */ private Vector<WorldServer> _pendingOpenServers = new Vector(); +/* */ +/* */ +/* 39 */ private Vector<WorldServer> _activeServers = new Vector(); +/* */ +/* */ +/* 42 */ private Vector<WorldServer> _pendingCloseServers = new Vector(); +/* */ +/* */ private Galaxy _galaxy; +/* */ +/* */ private ServerURL _serverURL; +/* */ +/* */ +/* */ protected ServerTracker(Galaxy parent) +/* */ { +/* 51 */ this._galaxy = parent; +/* 52 */ this._serverURL = this._galaxy.getServerURL(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized WorldServer getServer(String StrServerURL) +/* */ throws InvalidServerURLException +/* */ { +/* 68 */ if ((Galaxy.getDebugLevel() & 0x20) > 0) { +/* 69 */ System.out.println("Galaxy.getServer(" + StrServerURL + +/* 70 */ ") from " + this._galaxy); +/* */ } +/* */ +/* 73 */ ServerURL serverURL = new ServerURL(StrServerURL); +/* 74 */ WorldServer ws = null; +/* 75 */ if (this._serverURL.getHost().equals(serverURL.getHost())) +/* */ { +/* 77 */ ws = getServer(this._activeServers, this); +/* 78 */ if (ws == null) +/* 79 */ ws = getServer(this._pendingOpenServers, this); +/* */ } +/* 81 */ if (ws == null) +/* */ { +/* */ +/* 84 */ ws = findOrMake(serverURL, this); +/* */ } +/* */ +/* */ +/* 88 */ ws.tmpRefCnt(this); +/* 89 */ return ws; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected WorldServer getActive(Object referrer) +/* */ { +/* 98 */ return getServer(this._activeServers, referrer); +/* */ } +/* */ +/* */ protected synchronized WorldServer getServer(Vector<WorldServer> list, Object referrer) { +/* 102 */ int lastServer = list.size() - 1; +/* 103 */ if (lastServer >= 0) { +/* 104 */ WorldServer ws = (WorldServer)list.elementAt(lastServer); +/* 105 */ ws.incRefCnt(referrer); +/* 106 */ return ws; +/* */ } +/* 108 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private synchronized WorldServer findOrMake(ServerURL serverURL, Object referrer) +/* */ throws InvalidServerURLException +/* */ { +/* 122 */ WorldServer ws = (WorldServer)this._serverHash.get(serverURL.getHost()); +/* 123 */ if (ws == null) { +/* 124 */ int _debugLevel = 0; +/* */ +/* 126 */ _debugLevel = Galaxy.getDebugLevel(); +/* 127 */ if ((_debugLevel & 0x20) > 0) { +/* 128 */ System.out.println(" Creating new server of type=" + +/* 129 */ serverURL.getType() + "."); +/* */ } +/* */ try { +/* 132 */ Class<?> wsClass = Class.forName("NET.worlds.network." + +/* 133 */ serverURL.getType()); +/* 134 */ ws = (WorldServer)wsClass.newInstance(); +/* */ } +/* */ catch (Exception e) { +/* 137 */ if ((_debugLevel & 0x20) > 0) { +/* 138 */ synchronized (System.out) +/* */ { +/* 140 */ System.out.println(" Exception during class creation."); +/* 141 */ e.printStackTrace(System.out); +/* */ } +/* */ } +/* */ +/* 145 */ throw new InvalidServerURLException("Bad class: " + +/* 146 */ serverURL.getType()); +/* */ } +/* 148 */ this._serverHash.put(serverURL.getHost(), ws); +/* 149 */ ws.initInstance(this._galaxy, serverURL); +/* */ +/* */ } +/* 152 */ else if ((Galaxy.getDebugLevel() & 0x20) > 0) { +/* 153 */ System.out.println(" Found old server."); +/* */ } +/* */ +/* 156 */ ws.incRefCnt(referrer); +/* 157 */ return ws; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected synchronized void swapServer(WorldServer oldServ, WorldServer newServ) +/* */ { +/* 170 */ String oldURL = oldServ.getServerURL().getHost(); +/* 171 */ assert (oldURL.equals(newServ.getServerURL().getHost())); +/* */ +/* 173 */ String servName = oldServ.getServerURL().getHost(); +/* 174 */ this._serverHash.put(servName, newServ); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 180 */ assert (!this._activeServers.contains(oldServ)); +/* */ } +/* */ +/* */ +/* */ protected synchronized boolean isActive() +/* */ { +/* 186 */ return (this._activeServers.size() > 0) || (this._pendingOpenServers.size() > 0) || ( +/* 187 */ this._pendingCloseServers.size() > 0); +/* */ } +/* */ +/* */ protected synchronized boolean addPendingServer(WorldServer ws) +/* */ { +/* 192 */ if ((Galaxy.getDebugLevel() & 0x8) > 0) { +/* 193 */ System.out.println(this._galaxy + ": addPendingServer(" + ws + ")"); +/* 194 */ System.out.println("\t_pendingOpen = " + this._pendingOpenServers); +/* 195 */ System.out.println("\t_activeServers = " + this._activeServers); +/* 196 */ System.out.println("\t_pendingClose = " + this._pendingCloseServers); +/* */ } +/* */ +/* 199 */ if (this._pendingOpenServers.indexOf(ws) < 0) { +/* 200 */ this._pendingOpenServers.addElement(ws); +/* */ } +/* 202 */ if ((this._pendingOpenServers.size() == 1) && (this._activeServers.size() == 0) && +/* 203 */ (this._pendingCloseServers.size() == 0)) { +/* 204 */ return true; +/* */ } +/* 206 */ return false; +/* */ } +/* */ +/* */ protected synchronized boolean addActiveServer(WorldServer ws) +/* */ { +/* 211 */ if ((Galaxy.getDebugLevel() & 0x8) > 0) { +/* 212 */ System.out.println(this._galaxy + ": addActiveServer(" + ws + ")"); +/* 213 */ System.out.println("\t_pendingOpen = " + this._pendingOpenServers); +/* 214 */ System.out.println("\t_activeServers = " + this._activeServers); +/* 215 */ System.out.println("\t_pendingClose = " + this._pendingCloseServers); +/* */ } +/* */ +/* */ +/* 219 */ this._pendingOpenServers.removeElement(ws); +/* 220 */ if (this._activeServers.indexOf(ws) < 0) { +/* 221 */ this._activeServers.addElement(ws); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 227 */ return (this._activeServers.size() == 1) && +/* 228 */ (this._pendingCloseServers.size() == 0); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected synchronized boolean addClosingServer(WorldServer ws) +/* */ { +/* 239 */ if ((Galaxy.getDebugLevel() & 0x8) > 0) { +/* 240 */ System.out.println(this._galaxy + ": addClosingServer(" + ws + ")"); +/* 241 */ System.out.println("\t_pendingOpen = " + this._pendingOpenServers); +/* 242 */ System.out.println("\t_activeServers = " + this._activeServers); +/* 243 */ System.out.println("\t_pendingClose = " + this._pendingCloseServers); +/* */ } +/* */ +/* */ +/* 247 */ this._pendingOpenServers.removeElement(ws); +/* 248 */ boolean wasActive = this._activeServers.removeElement(ws); +/* 249 */ if (this._pendingCloseServers.indexOf(ws) < 0) +/* 250 */ this._pendingCloseServers.addElement(ws); +/* 251 */ if ((wasActive) && (this._activeServers.size() == 0)) { +/* 252 */ return true; +/* */ } +/* 254 */ return false; +/* */ } +/* */ +/* */ protected synchronized void markClosedServer(WorldServer ws) +/* */ { +/* 259 */ if ((Galaxy.getDebugLevel() & 0x8) > 0) { +/* 260 */ System.out.println(this._galaxy + ": markClosedServer(" + ws + ")"); +/* 261 */ System.out.println("\t_pendingOpen = " + this._pendingOpenServers); +/* 262 */ System.out.println("\t_activeServers = " + this._activeServers); +/* 263 */ System.out.println("\t_pendingClose = " + this._pendingCloseServers); +/* */ } +/* */ +/* */ +/* 267 */ this._pendingOpenServers.removeElement(ws); +/* 268 */ this._pendingCloseServers.removeElement(ws); +/* 269 */ this._activeServers.removeElement(ws); +/* */ } +/* */ +/* */ +/* */ +/* */ protected synchronized void killServer(WorldServer ws) +/* */ { +/* 276 */ if ((Galaxy.getDebugLevel() & 0x8) > 0) { +/* 277 */ System.out.println(this._galaxy + ": killServer(" + ws + ")"); +/* 278 */ System.out.println("\t_pendingOpen = " + this._pendingOpenServers); +/* 279 */ System.out.println("\t_activeServers = " + this._activeServers); +/* 280 */ System.out.println("\t_pendingClose = " + this._pendingCloseServers); +/* */ } +/* */ +/* 283 */ this._pendingOpenServers.removeElement(ws); +/* 284 */ this._pendingCloseServers.removeElement(ws); +/* 285 */ this._activeServers.removeElement(ws); +/* 286 */ if (this._serverHash.get(ws.getServerURL().getHost()) == ws) +/* */ { +/* */ +/* */ +/* */ +/* */ +/* 292 */ this._serverHash.remove(ws.getServerURL().getHost()); +/* */ +/* */ +/* */ } +/* */ else +/* */ { +/* */ +/* */ +/* 300 */ System.out.println("DEBUG -- a server tried to murder another!"); +/* 301 */ System.out.println("Caller = " + ws); +/* 302 */ System.out.println("Victim = " + +/* 303 */ this._serverHash.get(ws.getServerURL().getHost())); +/* 304 */ new Exception().printStackTrace(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ protected Enumeration<WorldServer> getAllServers() +/* */ { +/* 313 */ return this._serverHash.elements(); +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 318 */ return +/* */ +/* 320 */ "ServerTracker[\n\t_pendingOpen = " + this._pendingOpenServers + "\n\t_activeServers = " + this._activeServers + "\n\t_pendingClose = " + this._pendingCloseServers + "\n]"; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ServerTracker.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/ServerURL.java b/NET/worlds/network/ServerURL.java new file mode 100644 index 0000000..7d6ac4a --- /dev/null +++ b/NET/worlds/network/ServerURL.java @@ -0,0 +1,101 @@ +/* */ package NET.worlds.network; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ServerURL +/* */ { +/* 38 */ private String _serverType = null; +/* 39 */ private String _serverHost = null; +/* 40 */ private String _serverOptions = null; +/* */ +/* */ public String getHost() { +/* 43 */ return this._serverHost; +/* */ } +/* */ +/* */ public String getType() { +/* 47 */ return this._serverType; +/* */ } +/* */ +/* */ public ServerURL(String serverURL) throws InvalidServerURLException +/* */ { +/* 52 */ String origServerURL = serverURL; +/* 53 */ int txtPos = serverURL.indexOf("://"); +/* 54 */ if (txtPos >= 0) { +/* 55 */ String protocol = serverURL.substring(0, txtPos); +/* 56 */ assert (protocol.equals("worldserver")); +/* 57 */ serverURL = serverURL.substring(txtPos + 3); +/* */ } +/* */ +/* 60 */ int typePos = serverURL.indexOf('/'); +/* 61 */ if (typePos >= 0) { +/* 62 */ this._serverHost = serverURL.substring(0, typePos); +/* 63 */ serverURL = serverURL.substring(typePos + 1); +/* */ } +/* */ else { +/* 66 */ this._serverHost = serverURL; +/* 67 */ serverURL = "AutoServer"; +/* */ } +/* */ +/* 70 */ int optPos = serverURL.indexOf('/'); +/* 71 */ if (optPos >= 0) { +/* 72 */ this._serverType = serverURL.substring(0, optPos); +/* 73 */ serverURL = serverURL.substring(optPos + 1); +/* */ } +/* */ else { +/* 76 */ this._serverType = serverURL; +/* 77 */ serverURL = ""; +/* */ } +/* */ +/* 80 */ this._serverOptions = serverURL; +/* */ +/* 82 */ if (this._serverHost.length() == 0) +/* 83 */ throw new InvalidServerURLException("Invalid server URL: " + +/* 84 */ origServerURL); +/* 85 */ if (this._serverType.length() == 0) { +/* 86 */ this._serverType = "AutoServer"; +/* */ } +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 92 */ return +/* 93 */ "worldserver://" + this._serverHost + "/" + this._serverType + "/" + this._serverOptions; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ServerURL.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/SubscribeDistCmd.java b/NET/worlds/network/SubscribeDistCmd.java new file mode 100644 index 0000000..934ea94 --- /dev/null +++ b/NET/worlds/network/SubscribeDistCmd.java @@ -0,0 +1,68 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class SubscribeDistCmd +/* */ extends netPacket +/* */ { +/* */ public static final byte SUBSCRIBEDISTCMD = 24; +/* */ protected short _distance; +/* */ protected short _roomNumber; +/* */ +/* */ public SubscribeDistCmd(float dist, int room) +/* */ { +/* 40 */ super(null, 24); +/* 41 */ this._distance = ((short)(int)(dist - 100.0F)); +/* 42 */ this._roomNumber = ((short)room); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 47 */ return 4 + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 52 */ super.send(o); +/* 53 */ o.writeShort(this._roomNumber); +/* 54 */ o.writeShort(this._distance); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 60 */ return "SUB-DIST " + this._roomNumber + ": " + this._distance + "cm"; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\SubscribeDistCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/SubscribeRoomCmd.java b/NET/worlds/network/SubscribeRoomCmd.java new file mode 100644 index 0000000..9d997ee --- /dev/null +++ b/NET/worlds/network/SubscribeRoomCmd.java @@ -0,0 +1,81 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.scape.RoomSubscribeInfo; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class SubscribeRoomCmd +/* */ extends netPacket +/* */ { +/* */ public static final byte SUBSCRIBEROOMCMD = 22; +/* */ protected short _distance; +/* */ protected short _x; +/* */ protected short _y; +/* */ protected short _z; +/* */ protected short _roomNumber; +/* */ +/* */ public SubscribeRoomCmd(RoomSubscribeInfo info, int room) +/* */ { +/* 45 */ super(null, 22); +/* 46 */ this._roomNumber = ((short)room); +/* 47 */ this._distance = ((short)(int)(info.d - 100.0F)); +/* 48 */ this._x = ((short)(int)info.x); +/* 49 */ this._y = ((short)(int)info.y); +/* 50 */ this._z = ((short)(int)info.z); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 55 */ return 10 + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 60 */ super.send(o); +/* */ +/* 62 */ o.writeShort(this._roomNumber); +/* 63 */ o.writeShort(this._x); +/* 64 */ o.writeShort(this._y); +/* 65 */ o.writeShort(this._z); +/* 66 */ o.writeShort(this._distance); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 72 */ return +/* 73 */ "SUBSCRIB " + this._roomNumber + ": " + this._distance + "cm @ " + this._x + "," + this._y + "," + this._z; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\SubscribeRoomCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/Timer.java b/NET/worlds/network/Timer.java new file mode 100644 index 0000000..4e280d5 --- /dev/null +++ b/NET/worlds/network/Timer.java @@ -0,0 +1,38 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.core.Std; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class Timer +/* */ { +/* */ int _startTime; +/* */ String _msg; +/* */ +/* */ public Timer(String msg) +/* */ { +/* 21 */ this._msg = msg; +/* 22 */ this._startTime = Std.getRealTime(); +/* */ } +/* */ +/* */ public void stop(int minDur) { +/* 26 */ int endTime = Std.getRealTime(); +/* 27 */ int duration = endTime - this._startTime; +/* 28 */ if (duration > minDur) { +/* 29 */ System.out.println(this._msg + ": " + duration + "ms"); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\Timer.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/URL.java b/NET/worlds/network/URL.java new file mode 100644 index 0000000..a1ab6ad --- /dev/null +++ b/NET/worlds/network/URL.java @@ -0,0 +1,1275 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.Gamma; +/* */ import NET.worlds.core.IniFile; +/* */ import NET.worlds.scape.Restorer; +/* */ import NET.worlds.scape.Saver; +/* */ import NET.worlds.scape.SuperRoot; +/* */ import java.io.File; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.io.Serializable; +/* */ import java.net.MalformedURLException; +/* */ import java.util.Hashtable; +/* */ import java.util.StringTokenizer; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class URL +/* */ implements Serializable +/* */ { +/* */ static final long serialVersionUID = 1L; +/* */ private String _url; +/* */ private static Hashtable<String, Object> psConversion; +/* */ private static IniFile protocols; +/* */ private static String currentDir; +/* */ private static URL home; +/* */ private static URL file; +/* */ private static boolean useCachedFiles; +/* */ +/* */ public URL(SuperRoot reference, String urlstr) +/* */ throws MalformedURLException +/* */ { +/* 196 */ this(getBestContainer(reference), urlstr); +/* */ } +/* */ +/* */ +/* */ +/* */ public URL(URL reference, String urlstr) +/* */ throws MalformedURLException +/* */ { +/* 204 */ if (isAbsolute(urlstr)) { +/* 205 */ this._url = normalize(urlstr); +/* */ } else { +/* 207 */ this._url = ("rel:" + reference.getAbsolute(urlstr)); +/* */ } +/* */ } +/* */ +/* */ +/* */ public URL(String urlstr) +/* */ throws MalformedURLException +/* */ { +/* 215 */ this(null, urlstr); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static URL make(String s) +/* */ { +/* 239 */ return make(getCurDir(), s); +/* */ } +/* */ +/* */ +/* */ +/* */ public static URL make(URL url, String s) +/* */ { +/* */ try +/* */ { +/* 248 */ return new URL(url, s); +/* */ } catch (MalformedURLException e) { +/* 250 */ e.printStackTrace(System.out); +/* 251 */ throw new Error("Can't make URL"); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private String getAbsolute(String urlstr) +/* */ throws MalformedURLException +/* */ { +/* 266 */ if (!isAbsolute(urlstr)) { +/* 267 */ urlstr = this._url.substring(0, getBaseIndex()) + urlstr; +/* */ } +/* 269 */ if (urlstr.startsWith("rel:")) { +/* 270 */ urlstr = urlstr.substring(4); +/* */ } +/* 272 */ return normalize(urlstr); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private int getBaseIndex() +/* */ { +/* 281 */ int i = getPackageIndex(); +/* */ +/* 283 */ if (this._url.endsWith(".class")) { +/* 284 */ int lastDot = this._url.lastIndexOf('.', this._url.length() - 7) + 1; +/* 285 */ if (lastDot > i) { +/* 286 */ i = lastDot; +/* */ } +/* */ } +/* 289 */ return i; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getAbsolute() +/* */ { +/* 303 */ if (this._url.startsWith("rel:")) +/* 304 */ return this._url.substring(4); +/* 305 */ return this._url; +/* */ } +/* */ +/* */ +/* */ public String toString() +/* */ { +/* 311 */ return getInternal(); +/* */ } +/* */ +/* */ public String getInternal() +/* */ { +/* 316 */ return this._url; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getBase() +/* */ { +/* 325 */ return this._url.substring(getBaseIndex()); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public String getBaseWithoutExt() +/* */ { +/* 333 */ int start = getBaseIndex(); +/* 334 */ int end = this._url.lastIndexOf('.'); +/* 335 */ if (end < start) +/* 336 */ end = this._url.length(); +/* 337 */ return this._url.substring(start, end); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static boolean isAbsolute(String urlstr) +/* */ { +/* 350 */ return (urlstr != null) && ( +/* 351 */ (urlstr.indexOf(':') >= 0) || +/* 352 */ (urlstr.replace('\\', '/').startsWith("//"))); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static String normalize(String url) +/* */ throws MalformedURLException +/* */ { +/* 395 */ if (url == null) { +/* 396 */ throw new MalformedURLException("null URL string"); +/* */ } +/* 398 */ url = url.replace('\\', '/').trim(); +/* */ +/* */ +/* 401 */ int pathi = url.indexOf(':') + 1; +/* */ +/* 403 */ if (pathi == 1) { +/* 404 */ throw new MalformedURLException("Missing protocol specifier"); +/* */ } +/* 406 */ boolean hasHost = url.regionMatches(pathi, "//", 0, 2); +/* */ +/* */ +/* 409 */ if (pathi <= 2) +/* */ { +/* 411 */ if ((pathi == 0) && (!hasHost)) { +/* 412 */ throw new MalformedURLException("Missing protocol specifier"); +/* */ } +/* 414 */ url = "file:" + url; +/* 415 */ pathi = 5; +/* */ } +/* */ +/* */ +/* 419 */ if (url.lastIndexOf('/', pathi - 1) >= 0) { +/* 420 */ throw new MalformedURLException("/ in protocol specifier of " + url); +/* */ } +/* */ +/* 423 */ url = url.substring(0, pathi).toLowerCase() + url.substring(pathi); +/* */ +/* */ +/* 426 */ if (hasHost) +/* */ { +/* 428 */ pathi = url.indexOf('/', pathi + 2) + 1; +/* 429 */ if (pathi == 0) { +/* 430 */ url = url + '/'; +/* 431 */ pathi = url.length(); +/* */ } +/* */ } +/* */ +/* 435 */ if (url.startsWith("rel:")) { +/* 436 */ url = normalize(url.substring(4)); +/* 437 */ if (url.startsWith("rel:")) +/* 438 */ return url; +/* 439 */ return "rel:" + url; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 447 */ if (url.startsWith("file:")) { +/* 448 */ url = "file:" + validateFile(url.substring(5)); +/* */ +/* */ +/* 451 */ if (!hasHost) { +/* 452 */ assert (url.indexOf(':', 5) == 6); +/* 453 */ assert (url.charAt(7) == '/'); +/* 454 */ pathi += 3; +/* */ } +/* 456 */ } else if ((url.startsWith("http")) && +/* 457 */ (!hasHost)) { +/* 458 */ throw new MalformedURLException("http must have //host/"); +/* */ } +/* */ +/* */ +/* 462 */ return url.substring(0, pathi) + removeDots(url.substring(pathi)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static String validateFile(String p) +/* */ throws MalformedURLException +/* */ { +/* 481 */ if (p.startsWith("//")) { +/* 482 */ int slash = p.indexOf('/', 2); +/* 483 */ if (slash < 0) +/* 484 */ p = p + "/"; +/* 485 */ return p; +/* */ } +/* */ +/* 488 */ p = p.toLowerCase(); +/* 489 */ int colon = p.indexOf(':'); +/* */ +/* */ +/* 492 */ if (colon != 1) +/* */ { +/* */ +/* */ +/* 496 */ if (p.indexOf('/') == 0) { +/* 497 */ return currentDir.substring(0, 2) + p; +/* */ } +/* 499 */ return currentDir + p; +/* */ } +/* */ +/* 502 */ if (p.indexOf('/') != 2) { +/* 503 */ throw new MalformedURLException("Slash must follow colon"); +/* */ } +/* */ +/* 506 */ char drive = Character.toLowerCase(p.charAt(0)); +/* 507 */ if (!Character.isLowerCase(drive)) { +/* 508 */ throw new MalformedURLException("Invalid drive letter"); +/* */ } +/* 510 */ return drive + p.substring(1); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getRelativeTo(URL reference) +/* */ { +/* 529 */ if ((reference == null) || (!this._url.startsWith("rel:"))) { +/* 530 */ return this._url; +/* */ } +/* 532 */ String url = unalias(); +/* 533 */ String ref = reference.unalias(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 542 */ int pathStart = ref.indexOf(':') + 1; +/* */ +/* 544 */ boolean isLocal = pathStart == 2; +/* */ +/* */ +/* */ +/* */ +/* 549 */ if (!isLocal) +/* */ { +/* */ +/* */ +/* 553 */ String hasHost = null; +/* */ +/* */ +/* 556 */ if (ref.regionMatches(pathStart, "//", 0, 2)) { +/* 557 */ hasHost = ref; +/* 558 */ } else if (url.regionMatches(pathStart, "//", 0, 2)) { +/* 559 */ hasHost = url; +/* */ } +/* 561 */ if (hasHost != null) +/* */ { +/* 563 */ pathStart = hasHost.indexOf('/', pathStart + 2) + 1; +/* */ +/* */ +/* 566 */ if (pathStart == 0) { +/* 567 */ return this._url; +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* 574 */ if (!ref.regionMatches(isLocal, 0, url, 0, pathStart)) { +/* 575 */ return this._url; +/* */ } +/* */ +/* */ +/* */ +/* 580 */ int noncommonStart = pathStart; +/* 581 */ int len = Math.min(url.length(), ref.length()); +/* 582 */ for (int common = pathStart; common < len; common++) { +/* 583 */ char c = url.charAt(common); +/* 584 */ char d = ref.charAt(common); +/* 585 */ if ((c != d) && ( +/* 586 */ (!isLocal) || +/* 587 */ (Character.toLowerCase(c) != Character.toLowerCase(d)))) { +/* */ break; +/* */ } +/* 590 */ if (c == '/') { +/* 591 */ noncommonStart = common + 1; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 599 */ url = url.substring(noncommonStart); +/* */ +/* */ +/* 602 */ int pos = noncommonStart; +/* */ +/* 604 */ while ((pos = ref.indexOf('/', pos) + 1) != 0) { +/* 605 */ url = "../" + url; +/* */ +/* */ +/* 608 */ if (this._url.startsWith("rel:home:")) { +/* 609 */ return this._url; +/* */ } +/* */ } +/* 612 */ return url; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getRelativeTo(SuperRoot r) +/* */ { +/* 624 */ return getRelativeTo(getBestContainer(r)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static URL getBestContainer(SuperRoot sr) +/* */ { +/* 633 */ URL url = null; +/* 634 */ if (sr != null) { +/* 635 */ url = sr.getContainingSourceURL(); +/* */ } +/* 637 */ return url == null ? getCurDir() : url; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static String getRelativeTo(URL u, SuperRoot r) +/* */ { +/* 652 */ if (u == null) +/* 653 */ return null; +/* 654 */ return u.getRelativeTo(r); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static URL getHome() +/* */ { +/* 689 */ return home; +/* */ } +/* */ +/* */ public static String homeUnalias(String s) +/* */ { +/* 694 */ return make("home:" + s).unalias(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static URL getContainingOrCurDir(SuperRoot t) +/* */ { +/* 702 */ URL dir = t.getContainingSourceURL(); +/* 703 */ if (dir == null) { +/* 704 */ return getCurDir(); +/* */ } +/* 706 */ return make(dir._url.substring(0, dir.getBaseIndex())); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static void setAvatarServer(String url) +/* */ { +/* 722 */ String avURL = protocols.getIniString("avatar", url); +/* */ try { +/* 724 */ psConversion.put("avatar", new URL(new URL(avURL).unalias())); +/* */ } catch (MalformedURLException e) { +/* 726 */ System.out.println("Avatar protocol is invalid."); +/* 727 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ static +/* */ { +/* 663 */ psConversion = new Hashtable(); +/* */ +/* 665 */ protocols = new IniFile("Protocol"); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 671 */ currentDir = System.getProperty("user.dir").replace('\\', '/'); +/* 672 */ assert ((currentDir.charAt(1) == ':') || (currentDir.startsWith("//"))); +/* */ try { +/* 674 */ currentDir = validateFile(currentDir); +/* */ } catch (MalformedURLException e) { +/* 676 */ e.printStackTrace(System.out); +/* 677 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* 681 */ if (!currentDir.endsWith("/")) { +/* 682 */ currentDir += "/"; +/* */ } +/* */ +/* 685 */ home = make(Gamma.getHome()); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 709 */ file = make("file:"); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 717 */ psConversion.put("home", home); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 731 */ useCachedFiles = true; +/* */ +/* */ +/* 734 */ useCachedFiles = IniFile.gamma().getIniInt("useNetworkAvatars", 1) == 1; +/* */ +/* */ +/* 737 */ int override = IniFile.override().getIniInt("useNetworkAvatars", -1); +/* */ +/* 739 */ if (override != -1) { +/* 740 */ useCachedFiles = override == 1; +/* */ } +/* */ +/* 743 */ String avatarDir = IniFile.gamma().getIniString("avatarDir", "avatar/"); +/* */ +/* 745 */ if (!avatarDir.endsWith("/")) { +/* 746 */ avatarDir = avatarDir + "/"; +/* */ } +/* */ +/* 749 */ if (useCachedFiles) { +/* 750 */ setAvatarServer(NetUpdate.getUpgradeServerURL() + avatarDir); +/* */ } else { +/* 752 */ setAvatarServer("home:avatars/"); +/* */ } +/* */ } +/* */ +/* */ public static boolean usingCachedAvatars() { +/* 757 */ return useCachedFiles; +/* */ } +/* */ +/* */ public static void setHttpServer(String url) { +/* 761 */ psConversion.put("worldshttp", make(url)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static URL getCurDir() +/* */ { +/* 769 */ return file; +/* */ } +/* */ +/* 772 */ private static URL avatar = make("avatar:"); +/* */ +/* */ public static URL getAvatar() +/* */ { +/* 776 */ return avatar; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private int getPackageIndex() +/* */ { +/* 791 */ int i = this._url.lastIndexOf('/') + 1; +/* 792 */ if (i == 0) { +/* 793 */ i = this._url.indexOf(':') + 1; +/* 794 */ if ((i == 4) && (this._url.startsWith("rel:"))) +/* 795 */ i = this._url.indexOf(':', 4) + 1; +/* */ } +/* 797 */ return i; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String unalias() +/* */ { +/* 815 */ String url = getAbsolute(); +/* */ +/* */ +/* */ +/* 819 */ if (url.endsWith(".class")) { +/* 820 */ int base = getPackageIndex(); +/* 821 */ int len = url.length(); +/* */ +/* 823 */ url = url.substring(0, base) + +/* 824 */ url.substring(base, len - 6).replace('.', '/') + ".class"; +/* */ } +/* */ +/* */ +/* 828 */ int protLen = url.indexOf(':'); +/* 829 */ String prot = url.substring(0, protLen); +/* 830 */ Object alias = psConversion.get(prot); +/* */ +/* */ +/* 833 */ if (alias == null) +/* */ { +/* */ +/* */ +/* */ +/* 838 */ psConversion.put(prot, psConversion); +/* */ +/* 840 */ String s = protocols.getIniString(prot, ""); +/* */ +/* 842 */ if ((s != null) && (!s.equals(""))) { +/* */ try { +/* 844 */ alias = new URL(new URL(s).unalias()); +/* 845 */ psConversion.put(prot, alias); +/* */ } +/* */ catch (MalformedURLException e) +/* */ { +/* 849 */ System.out.println("Invalid inifile entry for " + prot); +/* */ } +/* */ } +/* 852 */ } else if ((prot.equals("avatar")) && (url.endsWith(".rwg"))) +/* */ { +/* */ +/* 855 */ alias = null; +/* */ } +/* */ +/* */ +/* */ +/* 860 */ if ((alias instanceof URL)) { +/* 861 */ URL u = (URL)alias; +/* */ +/* 863 */ assert (!u._url.startsWith("rel:")); +/* */ +/* */ +/* */ +/* 867 */ if ((u._url.startsWith("file:")) && +/* 868 */ (url.length() > protLen + 1) && +/* 869 */ (url.charAt(protLen + 1) == '/')) { +/* 870 */ protLen++; +/* */ } +/* */ +/* 873 */ url = +/* 874 */ u._url.substring(0, u.getBaseIndex()) + url.substring(protLen + 1); +/* */ } +/* */ +/* 877 */ if (!url.startsWith("file:")) { +/* 878 */ return url; +/* */ } +/* */ +/* 881 */ url = url.substring(5); +/* */ +/* */ +/* */ try +/* */ { +/* 886 */ url = normalize(validateFile(url)); +/* */ } +/* */ catch (MalformedURLException e) { +/* 889 */ return url; +/* */ } +/* */ +/* */ +/* 893 */ assert (url.startsWith("file:")); +/* 894 */ return url.substring(5); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static String searchPath(String name, String path) +/* */ { +/* 904 */ StringTokenizer e = new StringTokenizer(path, File.pathSeparator); +/* 905 */ while (e.hasMoreTokens()) { +/* 906 */ String dir = e.nextToken(); +/* 907 */ String expandedName = name; +/* 908 */ if (!dir.equals(".")) +/* 909 */ expandedName = dir + File.separator + name; +/* 910 */ File f = new File(expandedName); +/* 911 */ if (f.exists()) +/* 912 */ return expandedName; +/* */ } +/* 914 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getClassName() +/* */ { +/* 924 */ if (!this._url.endsWith(".class")) { +/* 925 */ return null; +/* */ } +/* 927 */ int base = getPackageIndex(); +/* 928 */ int len = this._url.length(); +/* 929 */ return this._url.substring(base, len - 6); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public URL getClassDir() +/* */ { +/* 939 */ if (!this._url.endsWith(".class")) { +/* 940 */ return null; +/* */ } +/* 942 */ return make(this._url.substring(0, getPackageIndex())); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public boolean endsWith(String ext) +/* */ { +/* 951 */ return this._url.endsWith(ext); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getExt() +/* */ { +/* 960 */ int i = this._url.lastIndexOf('.'); +/* */ +/* */ +/* 963 */ if ((i == -1) || (this._url.indexOf('/', i) >= 0) || (this._url.indexOf(':', i) >= 0)) { +/* 964 */ return ""; +/* */ } +/* 966 */ return this._url.substring(i); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static String maybeAddExt(String url, String ext) +/* */ { +/* 977 */ int dot = url.lastIndexOf('.'); +/* */ +/* */ +/* 980 */ if ((dot >= 0) && (url.indexOf('/', dot) < 0) && (url.indexOf('\\', dot) < 0)) { +/* 981 */ return url; +/* */ } +/* */ +/* 984 */ return url + ext; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static URL restore(Restorer r, String defaultExt) +/* */ throws IOException +/* */ { +/* 1007 */ return restore(r, r.restoreString(), defaultExt); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static URL restore(Restorer r, String url, String defaultExt) +/* */ throws IOException +/* */ { +/* 1016 */ if (url == null) { +/* 1017 */ return null; +/* */ } +/* 1019 */ if (defaultExt != null) { +/* 1020 */ url = maybeAddExt(url, defaultExt); +/* */ } +/* 1022 */ if (isAbsolute(url)) { +/* 1023 */ return new URL(url); +/* */ } +/* */ +/* */ +/* 1027 */ URL ref = r.getReferenceURL(); +/* */ +/* */ +/* 1030 */ if (r.version() >= 6) +/* */ { +/* 1032 */ if (ref == null) { +/* 1033 */ throw new IOException("No absolute base for relative URL " + +/* 1034 */ url); +/* */ } +/* 1036 */ return new URL(ref, url); +/* */ } +/* */ +/* */ +/* */ +/* 1041 */ if (url.endsWith(".class")) { +/* 1042 */ return make((url.indexOf('/') < 0 ? "system:" : "file:") + url); +/* */ } +/* */ +/* */ +/* 1046 */ String s = searchPath(url, ".;.."); +/* */ +/* 1048 */ if (s != null) { +/* 1049 */ if (ref == null) +/* 1050 */ return new URL("file:" + s); +/* 1051 */ URL unaliasedRef = make(ref.unalias()); +/* 1052 */ String rel = new URL("rel:file:" + s).getRelativeTo(unaliasedRef); +/* 1053 */ return new URL(ref, rel); +/* */ } +/* */ +/* */ +/* */ +/* 1058 */ System.out.println(url + " doesn't exist in RWSHAPEPATH"); +/* 1059 */ return make(ref, url); +/* */ } +/* */ +/* */ public static URL restore(Restorer r) throws IOException +/* */ { +/* 1064 */ return restore(r, null); +/* */ } +/* */ +/* */ public void save(Saver s) throws IOException +/* */ { +/* 1069 */ String r = getRelativeTo(s.getReferenceURL()); +/* 1070 */ if ((r.startsWith("../")) || (r.startsWith("rel:file:")) || +/* 1071 */ (r.startsWith("file:"))) { +/* 1072 */ Console.println(Console.message("path-to-outside") + r); +/* */ } +/* 1074 */ s.saveString(r); +/* */ } +/* */ +/* */ public static void save(Saver s, URL url) throws IOException +/* */ { +/* 1079 */ if (url == null) { +/* 1080 */ s.saveString(null); +/* */ } else { +/* 1082 */ url.save(s); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public boolean equals(Object o) +/* */ { +/* 1093 */ if ((o instanceof URL)) { +/* 1094 */ URL other = (URL)o; +/* 1095 */ if (this._url.equals(other.getInternal())) +/* 1096 */ return true; +/* 1097 */ return unalias().equals(other.unalias()); +/* */ } +/* 1099 */ return false; +/* */ } +/* */ +/* */ +/* */ public int hashCode() +/* */ { +/* 1105 */ return unalias().hashCode(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public boolean isRemote() +/* */ { +/* 1114 */ String s = unalias(); +/* 1115 */ if ((s.startsWith("//")) || (s.indexOf(':') < 2)) { +/* 1116 */ return false; +/* */ } +/* 1118 */ return (!s.startsWith("system:")) && (!s.startsWith("session:")); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static String removeDots(String url) +/* */ { +/* 1139 */ url = "/" + url; +/* */ +/* */ +/* */ +/* 1143 */ int firstSubdir = 1; +/* 1144 */ int nextSearch = firstSubdir - 1; +/* */ int firstDot; +/* 1146 */ while ((firstDot = url.indexOf("/.", nextSearch) + 1) > 0) +/* */ { +/* */ int firstDot; +/* 1149 */ int endSlash = url.indexOf('/', firstDot); +/* 1150 */ if (endSlash < 0) +/* */ break; +/* 1152 */ int numDots = endSlash - firstDot; +/* */ +/* */ +/* */ +/* 1156 */ for (int i = firstDot; +/* 1157 */ i < endSlash; i++) { +/* 1158 */ if (url.charAt(i) != '.') +/* */ break; +/* */ } +/* 1161 */ if (i != endSlash) { +/* 1162 */ nextSearch = endSlash; +/* */ +/* */ } +/* */ else +/* */ { +/* */ +/* */ for (;;) +/* */ { +/* 1170 */ if (numDots == 1) { +/* 1171 */ endSlash++; +/* 1172 */ break; +/* */ } +/* */ +/* 1175 */ if (firstDot == firstSubdir) +/* */ { +/* */ +/* 1178 */ endSlash -= numDots; +/* 1179 */ firstSubdir += numDots + 1; +/* 1180 */ break; +/* */ } +/* */ +/* 1183 */ firstDot = url.lastIndexOf('/', firstDot - 2) + 1; +/* 1184 */ if (firstDot <= firstSubdir) +/* 1185 */ firstDot = firstSubdir; +/* 1186 */ numDots--; +/* */ } +/* */ +/* */ +/* 1190 */ url = url.substring(0, firstDot) + url.substring(endSlash); +/* */ +/* */ +/* 1193 */ nextSearch = firstSubdir - 1; +/* */ } +/* */ } +/* */ +/* 1197 */ return url.substring(1); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\URL.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/UnsubscribeRoomCmd.java b/NET/worlds/network/UnsubscribeRoomCmd.java new file mode 100644 index 0000000..cc449b5 --- /dev/null +++ b/NET/worlds/network/UnsubscribeRoomCmd.java @@ -0,0 +1,67 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class UnsubscribeRoomCmd +/* */ extends netPacket +/* */ { +/* */ public static final byte UNSUBSCRIBEROOMCMD = 23; +/* */ protected int _roomNumber; +/* */ +/* */ public UnsubscribeRoomCmd(int room) +/* */ { +/* 41 */ super(null, 23); +/* 42 */ this._roomNumber = ((short)room); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 47 */ return 2 + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 52 */ super.send(o); +/* 53 */ o.writeShort(this._roomNumber); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 59 */ return "UNSUBSCR " + this._roomNumber; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\UnsubscribeRoomCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/UpgradeDialog.java b/NET/worlds/network/UpgradeDialog.java new file mode 100644 index 0000000..76a99a6 --- /dev/null +++ b/NET/worlds/network/UpgradeDialog.java @@ -0,0 +1,462 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.MultiLineLabel; +/* */ import NET.worlds.console.PolledDialog; +/* */ import NET.worlds.core.IniFile; +/* */ import java.awt.Button; +/* */ import java.awt.Checkbox; +/* */ import java.awt.Component; +/* */ import java.awt.Event; +/* */ import java.awt.GridBagConstraints; +/* */ import java.awt.GridBagLayout; +/* */ import java.awt.GridLayout; +/* */ import java.awt.Insets; +/* */ import java.awt.Panel; +/* */ import java.awt.ScrollPane; +/* */ import java.text.MessageFormat; +/* */ import java.text.NumberFormat; +/* */ import java.util.Locale; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class UpgradeDialog +/* */ extends PolledDialog +/* */ { +/* */ private static final long serialVersionUID = -6015193016188781866L; +/* 78 */ private Button yesButton = new Button(Console.message("Yes-now")); +/* */ +/* */ +/* 81 */ private Button noButton = new Button(Console.message("No-later")); +/* */ +/* */ +/* 84 */ private Button moreInfo = new Button(Console.message("Show-me-more")); +/* */ +/* */ private Checkbox startupCheck; +/* */ +/* 88 */ private boolean forceUpgrades = IniFile.gamma().getIniInt("forceUpgrades", +/* 89 */ 1) == 1; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 109 */ private static String instructions = Console.message("Please-uncheck") + +/* 110 */ " \n" + " \n"; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 119 */ private static String forcedInstructions = Console.message("you-can-continue") + " \n" + " \n"; +/* */ +/* */ +/* 122 */ private static String title = Console.message("Upgrade"); +/* */ +/* */ private Vector<Checkbox> checkboxes; +/* */ +/* */ private String info; +/* */ +/* */ private Vector<String> list; +/* */ +/* */ private Vector<Integer> bytes; +/* */ +/* */ private boolean first; +/* */ +/* */ private boolean chooseOne; +/* */ +/* */ private String name; +/* */ +/* */ private Component getsFocus; +/* */ +/* */ private MultiLineLabel msgLabel; +/* */ +/* */ +/* */ public UpgradeDialog(Vector<String> list, Vector<Integer> bytes, boolean first, String name, String info, boolean chooseOne) +/* */ { +/* 145 */ super(Console.getFrame(), null, title, false); +/* 146 */ setAlignment(1); +/* 147 */ this.list = list; +/* 148 */ this.info = info; +/* 149 */ this.name = name; +/* 150 */ this.first = first; +/* 151 */ this.bytes = bytes; +/* 152 */ this.chooseOne = chooseOne; +/* */ +/* */ +/* 155 */ readySetGo(); +/* */ } +/* */ +/* */ protected void build() { +/* 159 */ this.startupCheck = new Checkbox(Console.message("Check-for-up-each"), +/* 160 */ IniFile.gamma().getIniInt("CheckUpgrades", 1) != 0); +/* */ +/* */ +/* 163 */ int count = this.list.size(); +/* */ +/* 165 */ this.checkboxes = new Vector(); +/* */ +/* 167 */ Panel p = new Panel(new GridLayout(count, 1)); +/* */ +/* 169 */ Checkbox chk = null; +/* */ +/* 171 */ for (int i = 0; i < count; i++) { +/* 172 */ int b = ((Integer)this.bytes.elementAt(i)).intValue(); +/* */ +/* 174 */ String kb = NumberFormat.getInstance().format(b / 1000); +/* 175 */ Object[] arguments = { new String(((String)this.list.elementAt(i)).toString()), +/* 176 */ new String(kb) }; +/* 177 */ String msg = MessageFormat.format(Console.message("Kbytes"), +/* 178 */ arguments); +/* 179 */ chk = new Checkbox(msg, true); +/* */ +/* 181 */ if (!this.forceUpgrades) { +/* 182 */ p.add(chk); +/* */ } else { +/* 184 */ p.add(new MultiLineLabel(msg)); +/* */ } +/* 186 */ this.checkboxes.addElement(chk); +/* */ } +/* */ +/* */ +/* 190 */ GridBagLayout gbag = new GridBagLayout(); +/* 191 */ setLayout(gbag); +/* 192 */ GridBagConstraints c = new GridBagConstraints(); +/* 193 */ c.anchor = 10; +/* 194 */ c.fill = 0; +/* 195 */ c.weightx = 1.0D; +/* 196 */ c.weighty = 1.0D; +/* 197 */ c.gridwidth = 0; +/* 198 */ c.gridheight = 1; +/* 199 */ c.insets = new Insets(0, 15, 0, 15); +/* */ +/* */ +/* */ +/* 203 */ Object[] arguments = { new String(this.name) }; +/* 204 */ String msg = this.first ? MessageFormat.format( +/* 205 */ Console.message("dont-have"), arguments) : +/* 206 */ MessageFormat.format(Console.message("update-available"), arguments); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 212 */ add(gbag, new MultiLineLabel(msg + "\n ", 5, 5), c); +/* */ +/* 214 */ if (count > 3) { +/* 215 */ ScrollPane sp = new ScrollPane(); +/* */ +/* 217 */ GridBagConstraints c2 = new GridBagConstraints(); +/* 218 */ c2.fill = 1; +/* 219 */ c2.gridwidth = 0; +/* 220 */ sp.setSize(280, 100); +/* 221 */ sp.validate(); +/* */ +/* 223 */ add(gbag, sp, c2); +/* 224 */ sp.add(p); +/* */ } else { +/* 226 */ add(gbag, p, c); +/* */ } +/* */ +/* 229 */ if (!this.forceUpgrades) { +/* 230 */ add(gbag, this.startupCheck, c); +/* */ } +/* 232 */ this.msgLabel = new MultiLineLabel(calcMsg(), 5, 5); +/* 233 */ add(gbag, this.msgLabel, c); +/* */ +/* 235 */ c.gridwidth = 2; +/* 236 */ add(gbag, this.getsFocus = this.yesButton, c); +/* */ +/* 238 */ if ((!this.forceUpgrades) || (this.first)) { +/* 239 */ c.gridwidth = 0; +/* 240 */ add(gbag, this.noButton, c); +/* */ +/* 242 */ c.insets.top = 5; +/* 243 */ c.insets.bottom = 15; +/* 244 */ add(gbag, this.moreInfo, c); +/* */ } +/* */ } +/* */ +/* */ private String calcMsg() { +/* 249 */ int totalBytes = 0; +/* 250 */ if (this.bytes != null) { +/* 251 */ for (int i = 0; i < this.bytes.size(); i++) +/* 252 */ if (((Checkbox)this.checkboxes.elementAt(i)).getState()) +/* 253 */ totalBytes += ((Integer)this.bytes.elementAt(i)).intValue(); +/* */ } +/* 255 */ String msg = ""; +/* */ +/* 257 */ String ins = this.forceUpgrades ? forcedInstructions : instructions; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 266 */ if (totalBytes == 0) { +/* 267 */ msg = Console.message("no-entries"); +/* */ +/* */ +/* */ +/* */ +/* 272 */ return "\n" + msg + " \n \n \n \n" + ins; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 280 */ int modemMins = 10 * totalBytes / 288000 + 1; +/* */ +/* 282 */ String modemMinutes = +/* 283 */ modemMins / +/* 284 */ 10 + +/* 285 */ "." + +/* 286 */ modemMins % +/* 287 */ 10 + +/* 288 */ " " + ( +/* 289 */ modemMins == 10 ? Console.message("minute") : +/* 290 */ Console.message("minutes")); +/* */ +/* */ +/* */ +/* */ +/* 295 */ int cableMins = 10 * totalBytes / 1000000 + 1; +/* */ +/* 297 */ String cableMinutes = +/* 298 */ cableMins / +/* 299 */ 10 + +/* 300 */ "." + +/* 301 */ cableMins % +/* 302 */ 10 + +/* 303 */ " " + ( +/* 304 */ cableMins == 10 ? Console.message("minute") : +/* 305 */ Console.message("minutes")); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 311 */ NumberFormat nF = NumberFormat.getNumberInstance(Locale.getDefault()); +/* 312 */ String kb = nF.format(totalBytes / 1000); +/* */ +/* 314 */ Object[] arguments = { new String(kb), new String(cableMinutes), +/* 315 */ new String(modemMinutes) }; +/* 316 */ msg = MessageFormat.format(Console.message("entries-total"), arguments); +/* */ +/* 318 */ return msg + ins; +/* */ } +/* */ +/* */ +/* */ +/* */ public void setVisible(boolean visible) +/* */ { +/* 325 */ super.setVisible(visible); +/* 326 */ if (visible) { +/* 327 */ this.getsFocus.requestFocus(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public synchronized boolean confirmUpgrade() +/* */ { +/* 340 */ while (isActive()) { +/* */ try { +/* 342 */ wait(); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* */ } +/* 346 */ return getConfirmed(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public int confirmUpgradeFromList() +/* */ { +/* 359 */ if (!confirmUpgrade()) { +/* 360 */ return 0; +/* */ } +/* */ +/* 363 */ for (int i = 0; i < this.bytes.size(); i++) +/* 364 */ if (!((Checkbox)this.checkboxes.elementAt(i)).getState()) +/* */ break; +/* 366 */ return i; +/* */ } +/* */ +/* */ +/* */ +/* */ public Vector<String> rejectedList() +/* */ { +/* 373 */ if (!confirmUpgrade()) { +/* 374 */ return this.list; +/* */ } +/* 376 */ Vector<String> v = new Vector(); +/* */ +/* 378 */ for (int i = 0; i < this.bytes.size(); i++) +/* 379 */ if (!((Checkbox)this.checkboxes.elementAt(i)).getState()) +/* 380 */ v.addElement((String)this.list.elementAt(i)); +/* 381 */ return v; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected synchronized boolean done(boolean confirmed) +/* */ { +/* 390 */ boolean retCode = super.done(confirmed); +/* 391 */ notify(); +/* 392 */ return retCode; +/* */ } +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean action(Event event, Object what) +/* */ { +/* 399 */ if (event.target == this.yesButton) +/* 400 */ return done(true); +/* 401 */ if (event.target == this.noButton) +/* 402 */ return done(false); +/* 403 */ if (event.target == this.moreInfo) { +/* 404 */ NetUpdate.showInfo(this.info); +/* 405 */ } else if (event.target == this.startupCheck) { +/* 406 */ IniFile.gamma().setIniInt("CheckUpgrades", +/* 407 */ this.startupCheck.getState() ? 1 : 0); +/* 408 */ } else if ((event.target instanceof Checkbox)) +/* */ { +/* 410 */ if (this.chooseOne) +/* */ { +/* 412 */ int i = this.checkboxes.indexOf(event.target); +/* 413 */ if (((Checkbox)event.target).getState()) { +/* */ do { +/* 415 */ ((Checkbox)this.checkboxes.elementAt(i)).setState(true);i--; +/* 414 */ } while (i >= 0); +/* */ } else { +/* */ do +/* */ { +/* 418 */ ((Checkbox)this.checkboxes.elementAt(i)).setState(false);i++; +/* 417 */ } while (i < this.checkboxes.size()); +/* */ } +/* */ } +/* */ +/* 421 */ this.msgLabel.setLabel(calcMsg()); +/* 422 */ return true; +/* */ } +/* 424 */ return false; +/* */ } +/* */ +/* */ @Deprecated +/* */ public boolean handleEvent(Event event) +/* */ { +/* 430 */ if ((this.forceUpgrades) && (event.id == 201)) { +/* 431 */ return done(true); +/* */ } +/* 433 */ return super.handleEvent(event); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ @Deprecated +/* */ public boolean keyDown(Event event, int key) +/* */ { +/* 446 */ if ((!this.forceUpgrades) && +/* 447 */ (key == 27)) { +/* 448 */ return done(false); +/* */ } +/* 450 */ return super.keyDown(event, key); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\UpgradeDialog.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/UserServer.java b/NET/worlds/network/UserServer.java new file mode 100644 index 0000000..caaf1d2 --- /dev/null +++ b/NET/worlds/network/UserServer.java @@ -0,0 +1,154 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class UserServer +/* */ extends AnonUserServer +/* */ { +/* */ protected sessionInitCmd buildSessionInitCmd() +/* */ { +/* 52 */ OldPropertyList props = new OldPropertyList(); +/* */ +/* 54 */ String name = this._galaxy.getChatname(); +/* 55 */ this._galaxy.setChatname(Console.parseUnicode(name)); +/* */ +/* */ +/* 58 */ props.addProperty(new netProperty(3, +/* 59 */ String.valueOf(getVersion()))); +/* 60 */ props.addProperty(new netProperty(9, +/* 61 */ String.valueOf(this._clientVersion))); +/* */ +/* 63 */ this._firstLogon = this._galaxy.addPendingServer(this); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 75 */ switch (getGalaxy().getLoginMode()) { +/* */ case 3: +/* 77 */ assert (this._galaxy.getGuestExpiration() != null); +/* 78 */ props.addProperty(new netProperty(14, this._galaxy +/* 79 */ .getGuestExpiration())); +/* 80 */ if (this._firstLogon) +/* 81 */ props.addProperty(new netProperty(12, "1")); +/* 82 */ break; +/* */ +/* */ +/* */ case 1: +/* */ case 2: +/* 87 */ assert (this._galaxy.getChatname() != null); +/* */ +/* */ +/* 90 */ regShortID(1, +/* 91 */ Console.parseUnicode(this._galaxy.getChatname())); +/* */ +/* 93 */ props.addProperty(new netProperty(2, +/* 94 */ Console.parseUnicode(this._galaxy.getChatname()))); +/* */ +/* */ +/* 97 */ if (this._galaxy.getNewChatname() != null) { +/* 98 */ props.addProperty(new netProperty(28, +/* 99 */ this._galaxy.getNewChatname())); +/* */ } +/* 101 */ if (this._galaxy.getPassword() != null) { +/* 102 */ props.addProperty(new netProperty(6, +/* 103 */ this._galaxy.getPassword())); +/* */ } +/* */ +/* 106 */ if (this._galaxy.getNewPassword() != null) { +/* 107 */ props.addProperty(new netProperty(20, +/* 108 */ this._galaxy.getNewPassword())); +/* */ } +/* 110 */ if (this._galaxy.getLoginMode() == 1) +/* */ { +/* 112 */ if (this._galaxy.getSerialNum() != null) { +/* 113 */ props.addProperty(new netProperty(10, +/* 114 */ this._galaxy.getSerialNum())); +/* */ } +/* 116 */ } else if (this._firstLogon) { +/* 117 */ props.addProperty(new netProperty(12, +/* 118 */ "1")); +/* */ } +/* 120 */ break; +/* */ default: +/* 122 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ break; +/* */ } +/* */ +/* 127 */ if ((getDebugLevel() & 0x4) > 0) { +/* 128 */ synchronized (System.out) { +/* 129 */ System.out.println(this._serverURL.getHost() + +/* 130 */ ": sending sessionInit."); +/* 131 */ System.out.println(" username = \"" + +/* 132 */ this._galaxy.getChatname() + "\""); +/* 133 */ if (this._galaxy.getPassword() != null) +/* 134 */ System.out.println(" password = " + +/* 135 */ this._galaxy.getPassword()); +/* 136 */ if ((this._galaxy.getLoginMode() == 1) && +/* 137 */ (this._galaxy.getSerialNum() != null)) { +/* 138 */ System.out.println(" serial # = " + +/* 139 */ this._galaxy.getSerialNum()); +/* */ } +/* 141 */ if (this._galaxy.getLoginMode() == 3) { +/* 142 */ System.out.println(" VAR_GUEST"); +/* */ } +/* */ } +/* */ } +/* 146 */ return new sessionInitCmd(props); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\UserServer.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/VarErrorException.java b/NET/worlds/network/VarErrorException.java new file mode 100644 index 0000000..ec7db42 --- /dev/null +++ b/NET/worlds/network/VarErrorException.java @@ -0,0 +1,248 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.core.Std; +/* */ import java.text.MessageFormat; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class VarErrorException +/* */ extends Exception +/* */ { +/* */ private static final long serialVersionUID = 4544550603845669010L; +/* */ String _msg; +/* */ String _altMsg; +/* */ int _varError; +/* */ int _RetryTimeout; +/* */ int _RetryCount; +/* */ boolean _retry; +/* */ boolean _isStatus; +/* */ +/* */ public boolean getRetryFlag() +/* */ { +/* 74 */ return this._retry; +/* */ } +/* */ +/* */ public boolean getStatusFlag() { +/* 78 */ return this._isStatus; +/* */ } +/* */ +/* */ public int getRetryCount() { +/* 82 */ return this._RetryCount; +/* */ } +/* */ +/* */ public int getTimeout() { +/* 86 */ return this._RetryTimeout; +/* */ } +/* */ +/* */ public int getErrorNum() { +/* 90 */ return this._varError; +/* */ } +/* */ +/* */ public String getMsg() { +/* 94 */ return this._msg; +/* */ } +/* */ +/* */ public String getAltMsg() { +/* 98 */ if (this._altMsg != null) { +/* 99 */ return this._altMsg; +/* */ } +/* 101 */ return this._msg; +/* */ } +/* */ +/* 104 */ Object[] arguments = { new String(Std.getProductName()) }; +/* */ +/* */ VarErrorException(int varError) { +/* 107 */ this._varError = varError; +/* */ +/* 109 */ this._msg = ""; +/* 110 */ this._altMsg = null; +/* 111 */ this._retry = false; +/* 112 */ this._RetryCount = 1; +/* 113 */ this._RetryTimeout = 60; +/* 114 */ this._isStatus = false; +/* */ +/* 116 */ assert (this._varError > 0); +/* 117 */ switch (this._varError) { +/* */ case 1: +/* 119 */ this._msg = Console.message("NAK_BAD_USER"); +/* 120 */ break; +/* */ case 2: +/* 122 */ this._msg = Console.message("NAK_MAX_ORDINARY"); +/* 123 */ break; +/* */ case 3: +/* 125 */ this._msg = Console.message("NAK_MAX_PRIORITY"); +/* 126 */ break; +/* */ case 4: +/* 128 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ break; +/* */ case 5: +/* 131 */ this._msg = Console.message("NAK_FATAL"); +/* 132 */ this._retry = true; +/* 133 */ this._RetryTimeout = (8 + (int)(Math.random() * 10.0D)); +/* 134 */ break; +/* */ case 6: +/* 136 */ this._msg = +/* 137 */ (Console.message("NAK_BAD_PROTOCOL1") + Console.message("NAK_BAD_PROTOCOL2")); +/* 138 */ break; +/* */ case 7: +/* 140 */ this._msg = Console.message("NAK_BAD_CLIENTSW"); +/* 141 */ break; +/* */ case 8: +/* 143 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ break; +/* */ case 9: +/* 146 */ this._msg = Console.message("NAK_BAD_SERIAL"); +/* 147 */ break; +/* */ case 10: +/* 149 */ this._msg = +/* 150 */ (Console.message("NAK_TAKEN_SERIAL1") + Console.message("NAK_TAKEN_SERIAL2")); +/* 151 */ break; +/* */ case 11: +/* 153 */ this._msg = Console.message("NAK_TAKEN_USER"); +/* 154 */ break; +/* */ case 12: +/* 156 */ this._msg = Console.message("NAK_NO_SUCH_USER"); +/* 157 */ break; +/* */ case 13: +/* 159 */ this._msg = Console.message("NAK_BAD_PASSWORD"); +/* 160 */ break; +/* */ case 14: +/* 162 */ this._msg = Console.message("NAK_BAD_ACCOUNT"); +/* */ +/* 164 */ break; +/* */ case 15: +/* 166 */ this._msg = Console.message("NAK_NOT_LOGGEDON"); +/* 167 */ break; +/* */ case 16: +/* 169 */ this._msg = Console.message("NAK_BAD_IPADDRESS"); +/* 170 */ break; +/* */ case 17: +/* 172 */ this._msg = Console.message("NAK_LOGGEDON"); +/* 173 */ break; +/* */ case 100: +/* */ case 101: +/* */ case 102: +/* */ case 103: +/* 178 */ this._msg = +/* 179 */ (MessageFormat.format(Console.message("NAK_UNEXPECTED1"), this.arguments) + Console.message("NAK_UNEXPECTED2")); +/* 180 */ this._altMsg = MessageFormat.format(Console.message("NAK_UNEXPECTED3"), +/* 181 */ this.arguments); +/* 182 */ this._retry = true; +/* 183 */ this._RetryTimeout = (5 + (int)(Math.random() * 15.0D)); +/* 184 */ break; +/* */ case 104: +/* */ case 105: +/* */ case 106: +/* */ case 107: +/* 189 */ this._msg = +/* */ +/* */ +/* */ +/* 193 */ (MessageFormat.format(Console.message("NAK_UNREACHABLE1"), this.arguments) + Console.message("NAK_UNREACHABLE2") + Console.message("NAK_UNREACHABLE3") + Console.message("NAK_UNREACHABLE4")); +/* 194 */ this._altMsg = MessageFormat.format(Console.message("NAK_UNREACHABLE5"), +/* 195 */ this.arguments); +/* 196 */ this._retry = true; +/* 197 */ this._RetryTimeout = (30 + (int)(Math.random() * 15.0D)); +/* 198 */ break; +/* */ case 21: +/* 200 */ this._altMsg = "A room server is full. People might \nnot be visible nearby."; +/* */ +/* 202 */ this._msg = "The set of rooms you are in are quite full.\nPlease wait several minutes and try again."; +/* */ +/* 204 */ this._retry = true; +/* 205 */ this._RetryTimeout = (15 + (int)(Math.random() * 15.0D)); +/* 206 */ break; +/* */ case 200: +/* 208 */ this._msg = "Connected."; +/* 209 */ this._isStatus = true; +/* 210 */ break; +/* */ case 201: +/* 212 */ this._msg = "Shutting down server."; +/* 213 */ this._isStatus = true; +/* 214 */ break; +/* */ case 202: +/* 216 */ this._msg = "Automatically attempting to reconnect."; +/* 217 */ this._isStatus = true; +/* 218 */ break; +/* */ case 203: +/* 220 */ this._msg = "Server has disconnected normally."; +/* 221 */ this._isStatus = true; +/* 222 */ break; +/* */ case 204: +/* 224 */ this._msg = "Server has disconnected abnormally."; +/* 225 */ this._isStatus = true; +/* 226 */ break; +/* */ case 205: +/* 228 */ this._msg = "Going into single user mode."; +/* 229 */ this._isStatus = true; +/* 230 */ break; +/* */ default: +/* 232 */ this._msg = ("Login error #" + this._varError); +/* */ } +/* */ +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 239 */ return +/* 240 */ "VarErrorException[#" + this._varError + " retry=" + this._retry + " retryCount=" + this._RetryCount + " isStatus=" + this._isStatus + "]"; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\VarErrorException.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/WSConnecting.java b/NET/worlds/network/WSConnecting.java new file mode 100644 index 0000000..c1af509 --- /dev/null +++ b/NET/worlds/network/WSConnecting.java @@ -0,0 +1,217 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.net.NoRouteToHostException; +/* */ import java.net.Socket; +/* */ import java.net.UnknownHostException; +/* */ import java.util.StringTokenizer; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class WSConnecting +/* */ implements Runnable +/* */ { +/* */ private WorldServer _serv; +/* */ private String _host; +/* */ private Vector<String> _hosts; +/* */ private int _unresolvedHosts; +/* */ private int _port; +/* */ private int _timeout; +/* */ private int _error; +/* */ private boolean _calledBack; +/* */ private Vector<String> _resolvedHosts; +/* */ +/* */ public WSConnecting(WorldServer serv, String host, int port, int timeout) +/* */ { +/* 40 */ this._serv = serv; +/* 41 */ this._host = host; +/* 42 */ this._hosts = new Vector(); +/* 43 */ this._port = port; +/* 44 */ this._timeout = timeout; +/* 45 */ this._error = 0; +/* */ +/* */ +/* 48 */ makeThread(-1); +/* */ +/* */ +/* */ +/* 52 */ StringTokenizer tok = new StringTokenizer(host, ";"); +/* 53 */ while (tok.hasMoreTokens()) +/* 54 */ this._hosts.addElement(tok.nextToken()); +/* 55 */ this._unresolvedHosts = this._hosts.size(); +/* */ +/* */ +/* 58 */ for (int i = 0; i < this._unresolvedHosts; i++) +/* */ { +/* */ +/* 61 */ makeThread(i); +/* */ } +/* */ } +/* */ +/* */ private void makeThread(int index) { +/* 66 */ Thread t = new Thread(this, Integer.toString(index)); +/* 67 */ t.setDaemon(true); +/* 68 */ t.start(); +/* */ } +/* */ +/* */ public void run() +/* */ { +/* 73 */ int index = Integer.parseInt(Thread.currentThread().getName()); +/* */ +/* */ +/* 76 */ if (index == -1) { +/* */ try { +/* 78 */ Thread.sleep(this._timeout * 1000); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* 81 */ synchronized (this) { +/* 82 */ if (!this._calledBack) { +/* 83 */ this._calledBack = true; +/* 84 */ if (this._error == 0) +/* 85 */ this._error = 106; +/* 86 */ this._serv.setSocket(null, new VarErrorException(this._error), null); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* 93 */ if (index < this._unresolvedHosts) { +/* */ try { +/* 95 */ String host = (String)this._hosts.elementAt(index); +/* 96 */ String[] addresses = DNSLookup.lookupAll(host); +/* 97 */ if (addresses.length > 1) +/* */ { +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 116 */ for (int i = 0; i < addresses.length; i++) +/* */ { +/* 118 */ synchronized (this._hosts) { +/* 119 */ int newIndex = this._hosts.size(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 125 */ this._hosts.addElement(addresses[i]); +/* */ } +/* */ +/* */ int newIndex; +/* */ +/* 130 */ makeThread(newIndex); +/* */ } +/* */ +/* */ } else +/* 134 */ connectTo(addresses[0], false); +/* */ } catch (UnknownHostException uhe) { +/* 136 */ synchronized (this) { +/* 137 */ if (this._error == 0) { +/* 138 */ this._error = 107; +/* */ +/* */ } +/* */ +/* */ +/* */ } +/* */ +/* */ +/* */ } +/* */ +/* */ +/* */ } +/* */ else +/* */ { +/* */ +/* 153 */ connectTo((String)this._hosts.elementAt(index), false); +/* */ } +/* */ } +/* */ +/* */ public Vector<String> getBackupHosts() +/* */ { +/* 159 */ this._resolvedHosts = new Vector(); +/* 160 */ for (int i = this._unresolvedHosts; i < this._hosts.size(); i++) { +/* 161 */ this._resolvedHosts.addElement((String)this._hosts.elementAt(i)); +/* */ } +/* 163 */ return this._resolvedHosts; +/* */ } +/* */ +/* */ private void connectTo(String host, boolean delay) { +/* 167 */ Socket sock = null; +/* */ +/* */ try +/* */ { +/* 171 */ sock = new Socket(host, this._port); +/* */ +/* 173 */ synchronized (this) +/* */ { +/* */ +/* */ +/* 177 */ if (delay) { +/* */ try { +/* 179 */ wait(this._timeout * 1000 * 2 / 3); +/* */ } +/* */ catch (InterruptedException localInterruptedException) {} +/* */ } +/* */ +/* 184 */ System.out.println("Connected to " + host); +/* */ +/* 186 */ if (!this._calledBack) { +/* 187 */ this._calledBack = true; +/* 188 */ this._serv.setSocket(sock, null, host); +/* */ } else { +/* */ try { +/* 191 */ sock.close(); +/* */ } +/* */ catch (IOException localIOException1) {} +/* */ } +/* 195 */ notifyAll(); +/* */ } +/* */ } +/* */ catch (IOException e) { +/* 199 */ synchronized (this) { +/* 200 */ if (this._error == 0) { +/* 201 */ if (((e instanceof NoRouteToHostException)) || +/* 202 */ ((e instanceof UnknownHostException))) { +/* 203 */ this._error = 107; +/* */ } else +/* 205 */ this._error = 104; +/* */ } +/* 207 */ notifyAll(); +/* */ } +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\WSConnecting.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/WaitList.java b/NET/worlds/network/WaitList.java new file mode 100644 index 0000000..580a149 --- /dev/null +++ b/NET/worlds/network/WaitList.java @@ -0,0 +1,69 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.PrintStream; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class WaitList +/* */ { +/* 21 */ private Vector<ConnectionWaiter> _waitList = new Vector(); +/* */ private Object _parent; +/* */ +/* */ protected WaitList(Object parent) +/* */ { +/* 26 */ this._parent = parent; +/* */ } +/* */ +/* */ protected synchronized void addWaiter(ConnectionWaiter cw) +/* */ { +/* 31 */ if ((Galaxy.getDebugLevel() & 0x4000) > 0) { +/* 32 */ System.out.println(this._parent + ": waitForConnection(" + cw + ")"); +/* */ } +/* 34 */ if (this._waitList.indexOf(cw) < 0) +/* 35 */ this._waitList.addElement(cw); +/* */ } +/* */ +/* */ protected synchronized void abortWait(ConnectionWaiter cw) { +/* 39 */ assert (this._waitList.indexOf(cw) != -1); +/* 40 */ this._waitList.removeElement(cw); +/* */ } +/* */ +/* */ protected synchronized void clear() { +/* 44 */ this._waitList = new Vector(); +/* */ } +/* */ +/* */ protected synchronized void notify(boolean connected) +/* */ { +/* 49 */ if (((Galaxy.getDebugLevel() & 0x4000) > 0) && +/* 50 */ (this._waitList.size() > 0)) { +/* 51 */ System.out.println(this._parent + ": notify(" + connected + ")"); +/* */ } +/* 53 */ for (int i = this._waitList.size() - 1; i >= 0; i--) { +/* 54 */ ConnectionWaiter cw = (ConnectionWaiter)this._waitList.elementAt(i); +/* */ +/* 56 */ if ((Galaxy.getDebugLevel() & 0x4000) > 0) { +/* 57 */ System.out.println("\tnotifying " + cw); +/* */ } +/* 59 */ cw.connectionCallback(this._parent, connected); +/* 60 */ this._waitList.removeElementAt(i); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\WaitList.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/WorldServer.java b/NET/worlds/network/WorldServer.java new file mode 100644 index 0000000..02f567d --- /dev/null +++ b/NET/worlds/network/WorldServer.java @@ -0,0 +1,1922 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.Main; +/* */ import NET.worlds.console.MainCallback; +/* */ import NET.worlds.console.MainTerminalCallback; +/* */ import NET.worlds.core.Std; +/* */ import NET.worlds.scape.Drone; +/* */ import NET.worlds.scape.WObject; +/* */ import java.io.ByteArrayOutputStream; +/* */ import java.io.EOFException; +/* */ import java.io.IOException; +/* */ import java.io.OutputStream; +/* */ import java.io.PrintStream; +/* */ import java.net.InetAddress; +/* */ import java.net.Socket; +/* */ import java.text.MessageFormat; +/* */ import java.util.Enumeration; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class WorldServer +/* */ implements MainCallback, MainTerminalCallback, NetworkObject +/* */ { +/* */ protected int _serverProtocolVersion; +/* 238 */ protected ServerURL _serverURL = null; +/* 239 */ protected String _clientVersion = Std.getJavaBuildDate(); +/* */ +/* */ protected WSConnecting _connectThread; +/* */ +/* 243 */ protected OutputStream _ostr = null; +/* 244 */ protected Socket _sock = null; +/* 245 */ protected netPacketReader _reader = null; +/* */ +/* */ +/* */ private WaitList _waiters; +/* */ +/* 250 */ protected int _refCnt = 0; +/* 251 */ protected int _tmpRefCnt = 0; +/* 252 */ protected boolean _isMainRegistered = false; +/* 253 */ protected ObjectMgr _objTable = null; +/* 254 */ protected Galaxy _galaxy = null; +/* */ protected SMState _state; +/* 256 */ protected boolean _firstLogon = false; +/* 257 */ protected boolean _requestOffline = false; +/* 258 */ private int _lastAccessTime = 0; +/* */ +/* 260 */ protected int _retriesLeft = 5; +/* 261 */ protected VarErrorException _lastError = null; +/* 262 */ protected int _retryTimeout = 60000; +/* */ +/* 264 */ private int _lastMsgProcCnt = 5; +/* 265 */ protected PropertyList _propList = null; +/* 266 */ protected int _updateTime = 2000; +/* */ Vector<BackupServer> _backupServers; +/* */ String _currentBackupServer; +/* */ private static final int STATE_DEAD = -1; +/* */ protected static final int STATE_PRECONNECTED = 0; +/* */ private static final int STATE_AUTHPROMPT = 1; +/* */ +/* */ protected class BackupServer { +/* 274 */ public BackupServer() { this.hostName = ""; +/* 275 */ this.tries = 0; +/* */ } +/* */ +/* */ public BackupServer(String host) { +/* 279 */ this.hostName = host; +/* 280 */ this.tries = 0; +/* */ } +/* */ +/* */ public String GetHost() { +/* 284 */ return this.hostName; +/* */ } +/* */ +/* */ public void IncTries() +/* */ { +/* 289 */ this.tries += 1; +/* */ } +/* */ +/* */ +/* */ protected String hostName; +/* */ +/* */ protected int tries; +/* */ } +/* */ +/* */ +/* */ private static final int STATE_AUTHREPLY = 2; +/* */ +/* */ protected static final int STATE_INITIALIZING = 3; +/* */ +/* */ private static final int STATE_CONNECTING = 4; +/* */ +/* */ private static final int STATE_XMIT_PROPREQ = 5; +/* */ +/* */ private static final int STATE_RCV_PROPS = 6; +/* */ +/* */ protected static final int STATE_XMIT_SI = 7; +/* */ +/* */ static final int STATE_RCV_SI_ACK = 8; +/* */ +/* */ static final int STATE_XMIT_AI = 9; +/* */ +/* */ static final int STATE_RCV_AI_ACK = 10; +/* */ +/* */ static final int STATE_XMIT_PROPS = 11; +/* */ +/* */ static final int STATE_MAINLOOP = 12; +/* */ +/* */ private static final int STATE_XMIT_AE = 13; +/* */ +/* */ private static final int STATE_RCV_AE_ACK = 14; +/* */ private static final int STATE_XMIT_SE = 15; +/* */ static final int STATE_RCV_SE_ACK = 16; +/* */ static final int STATE_DETACHING = 17; +/* */ static final int STATE_DISCONNECTED = 18; +/* */ static final int STATE_SLEEPING = 19; +/* */ protected WorldServer() +/* */ { +/* 331 */ this._serverProtocolVersion = 24; +/* */ +/* 333 */ this._state = new SMState(this, 0); +/* 334 */ this._currentBackupServer = null; +/* 335 */ this._backupServers = new Vector(); +/* */ } +/* */ +/* */ +/* */ +/* */ public void regShortID(int shortObjID, String longObjID) +/* */ { +/* 342 */ assert (shortObjID < 253); +/* 343 */ this._objTable.regShortID(shortObjID, longObjID); +/* */ } +/* */ +/* */ public NetworkObject getObject(ObjID objID) { +/* 347 */ return this._objTable.getObject(objID); +/* */ } +/* */ +/* */ public void delObject(ObjID objID) { +/* 351 */ this._objTable.delObject(objID); +/* */ } +/* */ +/* */ public void regObject(ObjID objID, NetworkObject obj) { +/* 355 */ this._objTable.regObject(objID, obj); +/* */ } +/* */ +/* */ +/* */ public void regObject(String longid, NetworkObject obj) +/* */ { +/* 361 */ this._objTable.regObject(new ObjID(longid), obj); +/* */ } +/* */ +/* */ public String getLongID(ObjID objID) { +/* 365 */ return this._objTable.getLongID(objID); +/* */ } +/* */ +/* */ public InetAddress getLocalAddress() { +/* 369 */ if (this._sock != null) +/* 370 */ return this._sock.getLocalAddress(); +/* 371 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public Galaxy getGalaxy() +/* */ { +/* 379 */ return this._galaxy; +/* */ } +/* */ +/* */ ServerURL getServerURL() { +/* 383 */ return this._serverURL; +/* */ } +/* */ +/* */ void initInstance(Galaxy galaxy, ServerURL serverURL) { +/* 387 */ this._galaxy = galaxy; +/* 388 */ this._serverURL = serverURL; +/* 389 */ this._objTable = new ObjectMgr(this._galaxy); +/* 390 */ this._waiters = new WaitList(this); +/* */ } +/* */ +/* */ public net2Property getProperty(int propID) { +/* 394 */ return this._propList.getProperty(propID); +/* */ } +/* */ +/* */ public int getUpdateTime() { +/* 398 */ return this._updateTime; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void setUsername(String newUsername) +/* */ { +/* 407 */ if ((getDebugLevel() & 0x4) > 0) { +/* 408 */ System.out.println(this + +/* 409 */ ": Server requested username change to " + +/* 410 */ newUsername); +/* */ } +/* 412 */ this._galaxy.setChatname(newUsername); +/* 413 */ regShortID(1, newUsername); +/* */ } +/* */ +/* 416 */ private Vector<Object> _referrerList = new Vector(); +/* */ private String _scriptServer; +/* */ +/* 419 */ public synchronized void printReferrers() { System.out.println("[" + Std.getRealTime() + "] " + this + +/* 420 */ ": Referrer list -"); +/* 421 */ for (int i = this._referrerList.size() - 1; i >= 0; i--) { +/* 422 */ Object ref = this._referrerList.elementAt(i); +/* 423 */ System.out.println("\t" + ref); +/* */ } +/* 425 */ System.out.println(this + ": Referrer list complete."); +/* */ } +/* */ +/* */ public synchronized Vector<String> printDroneReferrers() { +/* 429 */ Vector<String> list = new Vector(); +/* 430 */ for (int i = this._referrerList.size() - 1; i >= 0; i--) { +/* 431 */ Object ref = this._referrerList.elementAt(i); +/* 432 */ if (ref.toString().startsWith("!")) +/* 433 */ list.addElement(ref.toString()); +/* */ } +/* 435 */ return list; +/* */ } +/* */ +/* */ public synchronized void incRefCnt(Object referrer) { +/* 439 */ if ((this._refCnt == 0) && (!this._isMainRegistered)) { +/* 440 */ Main.register(this); +/* 441 */ this._isMainRegistered = true; +/* */ } +/* 443 */ this._lastAccessTime = Std.getFastTime(); +/* 444 */ this._refCnt += 1; +/* */ +/* */ +/* 447 */ assert (!this._referrerList.removeElement(referrer)); +/* */ +/* 449 */ this._referrerList.addElement(referrer); +/* */ +/* 451 */ if ((getDebugLevel() & 0x1000) > 0) { +/* 452 */ System.out.println(this + ": incRefCnt to " + this._refCnt + " by " + +/* 453 */ referrer); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public synchronized void tmpRefCnt(Object referrer) +/* */ { +/* 461 */ this._tmpRefCnt += 1; +/* 462 */ boolean existed = this._referrerList.removeElement(referrer); +/* 463 */ assert (existed); +/* */ } +/* */ +/* */ public synchronized void decRefCnt(Object referrer) { +/* 467 */ this._refCnt -= 1; +/* 468 */ boolean existed = this._referrerList.removeElement(referrer); +/* 469 */ assert (existed); +/* */ +/* 471 */ if ((getDebugLevel() & 0x1000) > 0) { +/* 472 */ System.out.println(this + ": decRefCnt to " + this._refCnt + " by " + +/* 473 */ referrer); +/* */ } +/* 475 */ assert (this._refCnt >= 0); +/* */ } +/* */ +/* */ int getRefCnt() { +/* 479 */ return this._refCnt; +/* */ } +/* */ +/* */ public int getVersion() { +/* 483 */ return this._serverProtocolVersion; +/* */ } +/* */ +/* */ public void setVersion(int ver) { +/* 487 */ this._galaxy.setProtocol(ver); +/* 488 */ this._serverProtocolVersion = ver; +/* 489 */ if (this._reader != null) { +/* 490 */ this._reader.setVersion(ver); +/* */ } +/* */ +/* 493 */ if (ver < 18) { +/* 494 */ System.out.println(this + +/* 495 */ ": WARNING: Old server running protocol #17!"); +/* */ } +/* */ } +/* */ +/* */ +/* */ public static int getDebugLevel() +/* */ { +/* 502 */ return Galaxy.getDebugLevel(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ private String _smtpServer; +/* */ +/* */ +/* */ +/* */ private String _mailDomain; +/* */ +/* */ +/* */ public void sendNetworkMsg(netPacket msg) +/* */ throws InfiniteWaitException, PacketTooLargeException +/* */ { +/* 518 */ synchronized (this._state) { +/* 519 */ assert ((this._refCnt != 0) || (this._state.getState() != -1)); +/* 520 */ if (this._state.getState() != 12) +/* 521 */ throw new InfiniteWaitException(); +/* 522 */ sendNetMsg(msg); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public int getServerType() +/* */ { +/* 532 */ if (this._propList == null) +/* 533 */ return 1; +/* 534 */ net2Property stProp = this._propList.getProperty(15); +/* 535 */ int servType = 0; +/* */ try { +/* 537 */ servType = Integer.parseInt(stProp.value()); +/* */ } catch (NumberFormatException e) { +/* 539 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 541 */ return servType; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private void setScriptServer(String server) +/* */ { +/* 551 */ if (!server.endsWith("/")) +/* 552 */ server = server + "/"; +/* 553 */ this._scriptServer = server; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getScriptServer() +/* */ { +/* 562 */ return this._scriptServer; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private void setSmtpServer(String server) +/* */ { +/* 573 */ this._smtpServer = server; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public String getSmtpServer() +/* */ { +/* 581 */ return this._smtpServer; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private void setMailDomain(String domain) +/* */ { +/* 591 */ this._mailDomain = domain; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public String getMailDomain() +/* */ { +/* 599 */ return this._mailDomain; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ void sendNetMsg(netPacket msg) +/* */ throws PacketTooLargeException +/* */ { +/* 608 */ assert (msg != null); +/* */ +/* 610 */ if ((getDebugLevel() & 0x80) > 0) { +/* 611 */ System.out.println("[" + Std.getRealTime() + "] " + this + +/* 612 */ ": send(" + msg.toString(this) + ")"); +/* */ } +/* 614 */ if (this._ostr == null) +/* 615 */ return; +/* */ try { +/* 617 */ ByteArrayOutputStream rostr = new ByteArrayOutputStream(256); +/* 618 */ ServerOutputStream ostr = new ServerOutputStream(rostr, getVersion()); +/* 619 */ msg.send(ostr); +/* 620 */ ostr.close(); +/* */ +/* 622 */ if ((getDebugLevel() & 0x400) > 0) { +/* 623 */ byte[] byteArray = rostr.toByteArray(); +/* 624 */ int size = byteArray[0] & 0xFF; +/* 625 */ synchronized (System.out) { +/* 626 */ System.out.print(this + ": send["); +/* 627 */ for (int i = 0; i < size; i++) +/* 628 */ System.out.print(Integer.toString( +/* 629 */ byteArray[i] & 0xFF, 16) + " "); +/* 630 */ System.out.println("]"); +/* */ } +/* */ } +/* */ +/* */ +/* 635 */ synchronized (this._ostr) { +/* 636 */ rostr.writeTo(this._ostr); +/* */ } +/* 638 */ this._lastAccessTime = Std.getFastTime(); +/* */ } +/* */ catch (PacketTooLargeException ptle) { +/* 641 */ throw ptle; +/* */ } catch (IOException e) { +/* 643 */ VarErrorException ve = new VarErrorException( +/* 644 */ 101); +/* 645 */ if (this._lastError == null) +/* 646 */ this._lastError = ve; +/* 647 */ assert (this._connectThread == null); +/* 648 */ this._state.setState(17); +/* */ } +/* */ } +/* */ +/* */ public void sendText(String input) { +/* 653 */ sendText(null, input); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 662 */ private int _lastWhisperTick = 0; +/* 663 */ private int _whisperCnt = 0; +/* */ private Vector<NetworkObject> zombies; +/* */ +/* 666 */ private void _sendText(String who, String msg) { if (msg.length() > 200) { +/* 667 */ Object[] arguments = { new Integer(msg.length()) }; +/* 668 */ Console.println(MessageFormat.format( +/* 669 */ Console.message("msg-too-long"), arguments)); +/* 670 */ msg = msg.substring(0, 199); +/* */ } +/* */ +/* */ +/* 674 */ msg.trim(); +/* 675 */ if (msg.length() < 1) +/* */ { +/* 677 */ return; +/* */ } +/* */ +/* 680 */ if (who == null) { +/* */ try { +/* 682 */ sendNetworkMsg(new textCmd(msg)); +/* */ } +/* */ catch (InfiniteWaitException e) { +/* 685 */ if (msg.startsWith("&|+")) return; +/* 686 */ Console.println(Console.message("not-connected")); +/* */ } +/* */ catch (PacketTooLargeException e) { +/* 689 */ if ($assertionsDisabled) return; } throw new AssertionError(); +/* */ } +/* */ else { +/* 692 */ if (!msg.startsWith("&|+")) { +/* 693 */ Console.printOwnWhisper(who, msg); +/* */ } +/* 695 */ if ((!msg.startsWith("&|+trade>")) && (!who.equalsIgnoreCase("trade"))) +/* */ { +/* */ +/* 698 */ int timeNow = Std.getRealTime(); +/* 699 */ if (timeNow - this._lastWhisperTick > 60000) { +/* 700 */ this._whisperCnt = 0; +/* 701 */ this._lastWhisperTick = timeNow; +/* */ } +/* 703 */ this._whisperCnt += 1; +/* 704 */ if (this._whisperCnt > 15) +/* */ { +/* 706 */ Console.println(Console.message("whisper-too-fast")); +/* 707 */ return; +/* */ } +/* */ } +/* */ try +/* */ { +/* 712 */ sendNetworkMsg(new whisperCmd(who, msg)); +/* */ } catch (PacketTooLargeException e) { +/* 714 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ catch (InfiniteWaitException e2) { +/* 717 */ if (!msg.startsWith("&|+")) { +/* 718 */ Console.println(Console.message("not-connected")); +/* */ } +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void sendText(String who, String msg) +/* */ { +/* 730 */ if ((getDebugLevel() & 0x1) > 0) { +/* 731 */ System.out.println("[" + Std.getRealTime() + "] " + this + +/* 732 */ ": sendText(" + msg + ")"); +/* */ } +/* */ +/* 735 */ msg = msg.trim(); +/* */ +/* 737 */ if (msg.length() > 200) +/* */ { +/* */ +/* 740 */ Console.println(Console.message("converting-long")); +/* */ +/* */ +/* */ +/* 744 */ int i1 = 0; +/* 745 */ int i2 = 0; +/* */ +/* 747 */ while (msg.length() - i1 > 200) { +/* 748 */ i2 = msg.lastIndexOf(' ', i1 + 200); +/* */ +/* */ +/* 751 */ if (i2 <= i1) { +/* 752 */ i2 = i1 + 200; +/* */ } +/* 754 */ _sendText(who, msg.substring(i1, i2)); +/* 755 */ i1 = i2 + 1; +/* */ } +/* */ +/* 758 */ _sendText(who, msg.substring(i1)); +/* */ } else { +/* 760 */ _sendText(who, msg); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public int getState() +/* */ { +/* 768 */ return this._state.getState(); +/* */ } +/* */ +/* */ void setState(int state) { +/* 772 */ this._state.setState(state); +/* */ } +/* */ +/* */ public void waitForConnection() throws InfiniteWaitException { +/* 776 */ this._state.waitForState(12); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void requestRoomID(String roomName, NetworkRoom room) +/* */ { +/* 792 */ this._galaxy.addRoomRequest(roomName, room); +/* 793 */ if (this._state.getState() != 12) +/* */ { +/* */ +/* */ +/* */ +/* */ +/* 799 */ return; +/* */ } +/* */ try { +/* 802 */ sendNetworkMsg(new roomIDReqCmd(roomName)); +/* */ } catch (PacketTooLargeException e) { +/* 804 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ catch (InfiniteWaitException localInfiniteWaitException) {} +/* */ } +/* */ +/* */ +/* */ public void delRoomRequest(String roomName) +/* */ { +/* 813 */ this._galaxy.delRoomRequest(roomName); +/* */ } +/* */ +/* */ public void delRoomID(int roomID, NetworkRoom room) { +/* 817 */ this._galaxy.delRoomID(roomID, room); +/* */ } +/* */ +/* */ void regRoomID(int roomID, String roomName, boolean willRedirect) { +/* 821 */ NetworkRoom room = this._galaxy.regRoomID(roomID, roomName); +/* 822 */ if (room != null) +/* */ { +/* */ +/* 825 */ room.setRoomID(this, roomID, roomName, willRedirect); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void redirectRoom(String roomName, ServerURL serverURL) +/* */ { +/* 836 */ NetworkRoom room = (NetworkRoom)this._galaxy.getObject(roomName); +/* 837 */ if (room != null) { +/* 838 */ room.serverRedirect(this, roomName, serverURL); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ NetworkRoom getNetworkRoom(int roomID) +/* */ { +/* 855 */ return this._galaxy.getRoom(roomID); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public final boolean isConnected() +/* */ { +/* 863 */ return this._state.getState() == 12; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ void startConnect() +/* */ { +/* 871 */ synchronized (this._state) { +/* 872 */ int state = this._state.getState(); +/* 873 */ switch (state) { +/* */ case 0: +/* 875 */ assert (this._connectThread == null); +/* 876 */ this._state.setState(3); +/* 877 */ break; +/* */ case 18: +/* 879 */ this._retriesLeft = 5; +/* 880 */ assert (this._connectThread == null); +/* 881 */ this._state.setState(3); +/* */ } +/* */ +/* */ } +/* */ +/* */ +/* */ +/* 888 */ this._lastAccessTime = Std.getFastTime(); +/* */ } +/* */ +/* */ +/* */ +/* */ void forceOffline() +/* */ { +/* 895 */ this._retriesLeft = 0; +/* 896 */ this._lastError = new VarErrorException(205); +/* 897 */ this._requestOffline = true; +/* */ } +/* */ +/* */ void goOnline() +/* */ { +/* 902 */ this._requestOffline = false; +/* */ +/* 904 */ startConnect(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void perFrame(int timeNow) +/* */ { +/* 914 */ synchronized (this._state) +/* */ { +/* */ +/* 917 */ int ServerState = this._state.getState(); +/* 918 */ switch (ServerState) { +/* */ case 12: +/* 920 */ state_Mainloop(timeNow); +/* 921 */ break; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ case 1: +/* */ case 2: +/* 929 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ break; +/* */ case 0: +/* */ break; +/* */ case -1: +/* 935 */ state_Dead(timeNow); +/* 936 */ break; +/* */ case 18: +/* 938 */ state_Disconnected(timeNow); +/* 939 */ break; +/* */ case 10: +/* 941 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ break; +/* */ case 14: +/* 944 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ break; +/* */ case 6: +/* */ case 8: +/* */ case 16: +/* 949 */ if (timeNow - this._lastAccessTime > 30000) +/* */ { +/* */ +/* 952 */ if (getDebugLevel() > 0) { +/* 953 */ System.out.println("[" + timeNow + "] " + this + +/* 954 */ ": Messaging timeout. (state=" + +/* 955 */ ServerState + ")"); +/* */ } +/* 957 */ if (this._lastError == null) +/* 958 */ this._lastError = new VarErrorException(106); +/* 959 */ switch (ServerState) { +/* */ case 8: +/* 961 */ this._state.setState(15); +/* 962 */ break; +/* */ case 6: +/* */ case 16: +/* 965 */ this._state.setState(17); +/* */ } +/* */ } +/* */ else { +/* */ try { +/* 970 */ processMsgs(ServerState, timeNow); +/* */ } +/* */ catch (VarErrorException ve) { +/* 973 */ if (getDebugLevel() > 0) { +/* 974 */ System.out.println("[" + timeNow + "] " + this + +/* 975 */ ": VarError#" + ve.getErrorNum()); +/* 976 */ System.out.println(this + ": " + ve.getMsg()); +/* */ } +/* */ +/* 979 */ if (this._lastError == null) +/* 980 */ this._lastError = ve; +/* 981 */ this._state.setState(17); +/* */ } catch (EOFException e) { +/* 983 */ VarErrorException ve = new VarErrorException( +/* 984 */ 100); +/* 985 */ if (this._lastError == null) { +/* 986 */ this._lastError = ve; +/* */ } +/* 988 */ if (getDebugLevel() > 0) { +/* 989 */ synchronized (System.out) { +/* 990 */ e.printStackTrace(System.out); +/* */ } +/* */ } +/* 993 */ this._state.setState(17); +/* */ } catch (IOException e) { +/* 995 */ VarErrorException ve = new VarErrorException( +/* 996 */ 102); +/* 997 */ if (this._lastError == null) { +/* 998 */ this._lastError = ve; +/* */ } +/* 1000 */ synchronized (System.out) { +/* 1001 */ System.out.println("[" + timeNow + "] " + this + +/* 1002 */ ": Read error:"); +/* 1003 */ if (getDebugLevel() > 0) { +/* 1004 */ e.printStackTrace(System.out); +/* */ } +/* */ } +/* 1007 */ this._state.setState(17); +/* */ } catch (Exception e) { +/* 1009 */ VarErrorException ve = new VarErrorException( +/* 1010 */ 103); +/* 1011 */ if (this._lastError == null) { +/* 1012 */ this._lastError = ve; +/* */ } +/* 1014 */ synchronized (System.out) { +/* 1015 */ System.out.println("[" + timeNow + "] " + this + +/* 1016 */ ": Unexpected error:"); +/* 1017 */ e.printStackTrace(System.out); +/* */ } +/* */ +/* 1020 */ this._state.setState(17); +/* */ } +/* */ } +/* */ break; +/* */ case 19: +/* 1025 */ state_Sleeping(timeNow); +/* 1026 */ break; +/* */ case 3: +/* 1028 */ state_Initializing(); +/* 1029 */ break; +/* */ case 4: +/* */ break; +/* */ case 5: +/* 1033 */ state_XMIT_PROPREQ(); +/* 1034 */ break; +/* */ case 7: +/* 1036 */ state_XMIT_SI(); +/* 1037 */ break; +/* */ case 9: +/* 1039 */ state_XMIT_AI(); +/* 1040 */ break; +/* */ case 11: +/* 1042 */ state_XMIT_Props(); +/* 1043 */ break; +/* */ case 13: +/* 1045 */ state_XMIT_AE(); +/* 1046 */ break; +/* */ case 15: +/* 1048 */ state_XMIT_SE(); +/* 1049 */ break; +/* */ case 17: +/* 1051 */ state_Detaching(); +/* */ } +/* */ +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private void processMsgs(int state, int timeNow) +/* */ throws Exception +/* */ { +/* 1067 */ int msgsInQueue = this._reader.count(); +/* 1068 */ if (msgsInQueue <= 0) { +/* 1069 */ return; +/* */ } +/* 1071 */ int msgsToProcess = (int)Math.sqrt(this._lastMsgProcCnt * msgsInQueue); +/* */ +/* 1073 */ if (((getDebugLevel() & 0x2) > 0) && (msgsInQueue > 30)) { +/* 1074 */ synchronized (System.out) { +/* 1075 */ System.out.println(this + ": msgs on incoming queue = " + +/* 1076 */ msgsInQueue); +/* 1077 */ System.out.println(" processed approx " + +/* 1078 */ this._lastMsgProcCnt + " messages on last round."); +/* 1079 */ System.out.println(" processing " + msgsToProcess + +/* 1080 */ " messages."); +/* */ } +/* */ } +/* 1083 */ if (5 > msgsToProcess) { +/* 1084 */ this._lastMsgProcCnt = 5; +/* */ } else +/* 1086 */ this._lastMsgProcCnt = msgsToProcess; +/* 1087 */ if (msgsInQueue < msgsToProcess) +/* 1088 */ msgsToProcess = msgsInQueue; +/* 1089 */ msgsToProcess = Math.min(msgsToProcess, msgsInQueue); +/* 1090 */ while (this._state.getState() == state) { +/* 1091 */ if (msgsToProcess-- == 0) +/* */ break; +/* 1093 */ receivedNetPacket p = this._reader.get(); +/* 1094 */ assert (p != null); +/* */ +/* 1096 */ if ((getDebugLevel() & 0x40) > 0) { +/* 1097 */ System.out.println(this + ": recv(" + p.toString(this) + +/* 1098 */ ")"); +/* */ } +/* 1100 */ p.process(this); +/* */ } +/* */ +/* 1103 */ this._lastAccessTime = timeNow; +/* */ } +/* */ +/* */ protected void state_Initializing() { +/* 1107 */ if (this._requestOffline) { +/* 1108 */ this._state.setState(-1); +/* 1109 */ return; +/* */ } +/* 1111 */ if (this._serverURL.getHost().equals("0.0.0.0:0")) +/* */ { +/* 1113 */ System.out.println(this + ": DOA"); +/* */ +/* */ +/* */ +/* 1117 */ this._state.setState(-1); +/* 1118 */ return; +/* */ } +/* */ +/* */ +/* 1122 */ this._objTable.regShortID(255, getLongID()); +/* 1123 */ this._objTable.regObject(getLongID(), this); +/* */ +/* 1125 */ this._lastError = null; +/* */ +/* 1127 */ this._firstLogon = false; +/* */ +/* 1129 */ String host = this._serverURL.getHost(); +/* 1130 */ int port = 5100; +/* 1131 */ assert (host != null); +/* 1132 */ int cindx = this._serverURL.getHost().lastIndexOf(':'); +/* 1133 */ if (cindx >= 0) { +/* */ try { +/* 1135 */ port = Integer.parseInt(this._serverURL.getHost().substring( +/* 1136 */ cindx + 1)); +/* */ } +/* */ catch (NumberFormatException e) { +/* 1139 */ synchronized (System.out) { +/* 1140 */ System.out.println("######DEBUGGING######"); +/* 1141 */ System.out.println(" server: " + +/* 1142 */ this._serverURL.getHost()); +/* 1143 */ System.out.println(" message: " + e.getMessage()); +/* 1144 */ e.printStackTrace(System.out); +/* 1145 */ System.out.println("#####################"); +/* */ } +/* */ +/* 1148 */ VarErrorException ve = new VarErrorException( +/* 1149 */ 103); +/* 1150 */ if (this._lastError == null) { +/* 1151 */ this._lastError = ve; +/* */ } +/* 1153 */ System.out.println("Error in server URL format: " + +/* 1154 */ this._serverURL.getHost()); +/* */ +/* 1156 */ this._state.setState(17); +/* 1157 */ return; +/* */ } +/* 1159 */ host = this._serverURL.getHost().substring(0, cindx); +/* */ } +/* */ +/* */ +/* 1163 */ this._lastAccessTime = Std.getFastTime(); +/* */ +/* */ +/* 1166 */ if (this._currentBackupServer != null) { +/* 1167 */ if (this._sock != null) { +/* */ try { +/* 1169 */ this._sock.close(); +/* */ } +/* */ catch (Exception localException) {} +/* 1172 */ this._sock = null; +/* */ } +/* 1174 */ host = this._currentBackupServer; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1182 */ if (this._sock == null) { +/* 1183 */ this._state.setState(4); +/* 1184 */ assert (this._connectThread == null); +/* 1185 */ this._connectThread = new WSConnecting(this, host, port, 15); +/* */ +/* */ +/* */ +/* */ } +/* 1190 */ else if (this._propList == null) { +/* 1191 */ this._state.setState(5); +/* */ } else { +/* 1193 */ this._state.setState(7); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ protected void setSocket(Socket sock, VarErrorException ve, String host) +/* */ { +/* 1202 */ Vector<String> resolvedHosts = this._connectThread.getBackupHosts(); +/* 1203 */ Enumeration<String> en = resolvedHosts.elements(); +/* 1204 */ while (en.hasMoreElements()) { +/* 1205 */ BackupServer bs = new BackupServer((String)en.nextElement()); +/* */ +/* 1207 */ Enumeration<BackupServer> en2 = this._backupServers.elements(); +/* 1208 */ boolean unique = true; +/* 1209 */ while (en2.hasMoreElements()) +/* */ { +/* 1211 */ if (((BackupServer)en2.nextElement()).GetHost().equals(bs.GetHost())) { +/* 1212 */ unique = false; +/* 1213 */ break; +/* */ } +/* */ } +/* */ +/* 1217 */ if (unique) { +/* 1218 */ this._backupServers.addElement(bs); +/* */ } +/* 1220 */ if ((host != null) && +/* 1221 */ (host.equals(bs.GetHost()))) { +/* 1222 */ bs.IncTries(); +/* */ } +/* */ } +/* */ +/* 1226 */ this._connectThread = null; +/* 1227 */ if (this._state.getState() != 4) +/* */ { +/* 1229 */ return; +/* */ } +/* 1231 */ if (sock == null) { +/* 1232 */ assert (ve != null); +/* 1233 */ if (this._lastError == null) +/* 1234 */ this._lastError = ve; +/* 1235 */ this._state.setState(17); +/* 1236 */ return; +/* */ } +/* 1238 */ this._sock = sock; +/* */ try +/* */ { +/* 1241 */ this._ostr = this._sock.getOutputStream(); +/* */ +/* */ +/* 1244 */ this._reader = new netPacketReader(this, new ServerInputStream( +/* 1245 */ this._sock.getInputStream())); +/* */ +/* */ +/* */ +/* */ +/* 1250 */ this._reader.setVersion(getVersion()); +/* */ } catch (Exception e) { +/* 1252 */ ve = new VarErrorException(105); +/* 1253 */ if (this._lastError == null) { +/* 1254 */ this._lastError = ve; +/* */ } +/* 1256 */ System.out.println(this + ": Error opening I/O streams."); +/* */ +/* 1258 */ this._state.setState(17); +/* 1259 */ return; +/* */ } +/* 1261 */ this._reader.setDaemon(true); +/* */ +/* 1263 */ this._reader.start(); +/* 1264 */ this._state.setState(5); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void state_XMIT_PROPREQ() +/* */ { +/* 1273 */ if (this._requestOffline) { +/* 1274 */ this._state.setState(17); +/* 1275 */ return; +/* */ } +/* 1277 */ propReqCmd propReq = new propReqCmd(new ObjID(255)); +/* 1278 */ if (NetUpdate.isInternalVersion()) +/* */ { +/* */ +/* */ +/* 1282 */ propReq.addProp(1); +/* 1283 */ propReq.addProp(3); +/* 1284 */ propReq.addProp(15); +/* 1285 */ propReq.addProp(29); +/* 1286 */ propReq.addProp(25); +/* 1287 */ propReq.addProp(26); +/* 1288 */ propReq.addProp(27); +/* */ } +/* */ try { +/* 1291 */ sendNetMsg(propReq); +/* */ } catch (PacketTooLargeException p) { +/* 1293 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 1295 */ this._state.setState(6); +/* */ } +/* */ +/* */ protected void state_XMIT_SI() +/* */ { +/* 1300 */ if (!$assertionsDisabled) throw new AssertionError(); +/* 1301 */ if (this._requestOffline) { +/* 1302 */ this._state.setState(17); +/* 1303 */ return; +/* */ } +/* 1305 */ this._galaxy.addPendingServer(this); +/* 1306 */ this._state.setState(8); +/* */ } +/* */ +/* */ +/* */ +/* */ protected void state_XMIT_AI() +/* */ { +/* 1313 */ if (!$assertionsDisabled) throw new AssertionError(); +/* 1314 */ if (this._requestOffline) { +/* 1315 */ this._state.setState(17); +/* 1316 */ return; +/* */ } +/* 1318 */ this._state.setState(11); +/* */ } +/* */ +/* */ protected void state_XMIT_Props() { +/* 1322 */ if (this._requestOffline) { +/* 1323 */ this._state.setState(15); +/* 1324 */ return; +/* */ } +/* 1326 */ this._state.setState(12); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1332 */ this._galaxy.addActiveServer(this); +/* */ } +/* */ +/* */ +/* */ +/* */ protected void state_Mainloop(int timeNow) +/* */ { +/* 1339 */ killZombies(); +/* */ +/* 1341 */ if (this._requestOffline) { +/* 1342 */ this._state.setState(15); +/* 1343 */ return; +/* */ } +/* 1345 */ if (timeNow - this._lastAccessTime > 120000) +/* */ { +/* 1347 */ if (getDebugLevel() > 0) { +/* 1348 */ System.out.println(this + ": Timeout during connection."); +/* */ } +/* 1350 */ System.out.println("[" + timeNow + "] " + this + +/* 1351 */ ": Timeout during connection."); +/* 1352 */ System.out.println("\t_lastAccessTime = " + this._lastAccessTime); +/* 1353 */ System.out.println("\t timeNow = " + timeNow); +/* 1354 */ this._retriesLeft = 0; +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1360 */ this._state.setState(15); +/* 1361 */ return; +/* */ } +/* */ +/* */ +/* 1365 */ this._waiters.notify(true); +/* */ try +/* */ { +/* 1368 */ processMsgs(12, timeNow); +/* */ } catch (VarErrorException ve) { +/* 1370 */ if (!$assertionsDisabled) throw new AssertionError(); +/* 1371 */ this._state.setState(17); +/* */ } catch (EOFException e) { +/* 1373 */ VarErrorException ve = new VarErrorException(100); +/* 1374 */ if (this._lastError == null) { +/* 1375 */ this._lastError = ve; +/* */ } +/* 1377 */ synchronized (System.out) { +/* 1378 */ System.out.println("[" + timeNow + "] " + this + +/* 1379 */ ": Server has shut down connection."); +/* 1380 */ if (getDebugLevel() > 0) { +/* 1381 */ e.printStackTrace(System.out); +/* */ } +/* */ } +/* 1384 */ this._state.setState(17); +/* */ } catch (IOException e) { +/* 1386 */ VarErrorException ve = new VarErrorException(100); +/* 1387 */ if (this._lastError == null) { +/* 1388 */ this._lastError = ve; +/* */ } +/* 1390 */ synchronized (System.out) { +/* 1391 */ System.out.println("[" + timeNow + "] " + this + +/* 1392 */ ": Error reading from network."); +/* 1393 */ if (getDebugLevel() > 0) { +/* 1394 */ e.printStackTrace(System.out); +/* */ } +/* */ } +/* 1397 */ this._state.setState(17); +/* */ } catch (Exception e) { +/* 1399 */ VarErrorException ve = new VarErrorException( +/* 1400 */ 103); +/* 1401 */ if (this._lastError == null) { +/* 1402 */ this._lastError = ve; +/* */ } +/* 1404 */ synchronized (System.out) { +/* 1405 */ System.out.println("[" + timeNow + "] " + this + +/* 1406 */ ": Unexpected error."); +/* 1407 */ e.printStackTrace(System.out); +/* */ } +/* */ +/* 1410 */ this._state.setState(17); +/* */ } +/* */ } +/* */ +/* */ protected void state_XMIT_AE() { +/* 1415 */ if (!$assertionsDisabled) throw new AssertionError(); +/* 1416 */ this._state.setState(14); +/* */ +/* 1418 */ this._state.setState(15); +/* */ } +/* */ +/* */ protected void state_XMIT_SE() { +/* 1422 */ boolean sendVAR_LOGONOFF = this._galaxy.addClosingServer(this); +/* 1423 */ OldPropertyList propList = new OldPropertyList(); +/* 1424 */ if (sendVAR_LOGONOFF) { +/* 1425 */ propList.addProperty(new netProperty(12, "1")); +/* */ } +/* */ try { +/* 1428 */ sendNetMsg(new sessionExitCmd(propList)); +/* */ } catch (PacketTooLargeException e) { +/* 1430 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 1432 */ this._state.setState(16); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void reuseConnection(WorldServer src) +/* */ { +/* 1441 */ this._reader = src._reader; +/* 1442 */ src._reader = null; +/* 1443 */ this._ostr = src._ostr; +/* 1444 */ src._ostr = null; +/* 1445 */ this._sock = src._sock; +/* 1446 */ src._sock = null; +/* */ +/* */ +/* 1449 */ this._backupServers = ((Vector)src._backupServers.clone()); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public boolean useBackupServer() +/* */ { +/* 1458 */ Enumeration<BackupServer> enums = this._backupServers.elements(); +/* 1459 */ while (enums.hasMoreElements()) { +/* 1460 */ BackupServer bs = (BackupServer)enums.nextElement(); +/* 1461 */ if (bs.tries == 0) { +/* 1462 */ bs.IncTries(); +/* 1463 */ this._currentBackupServer = bs.GetHost(); +/* 1464 */ return true; +/* */ } +/* */ } +/* */ +/* 1468 */ this._currentBackupServer = null; +/* 1469 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private void addZombies() +/* */ { +/* 1484 */ Enumeration<NetworkObject> enums = this._objTable.objects(); +/* 1485 */ while (enums.hasMoreElements()) { +/* 1486 */ NetworkObject no = (NetworkObject)enums.nextElement(); +/* 1487 */ if ((no instanceof WObject)) { +/* 1488 */ if (this.zombies == null) { +/* 1489 */ this.zombies = new Vector(); +/* */ } +/* 1491 */ this.zombies.addElement(no); +/* 1492 */ } else if ((no instanceof Drone)) { +/* 1493 */ ((Drone)no).disappear(); +/* */ } +/* */ } +/* 1496 */ this._objTable.clear(); +/* */ } +/* */ +/* */ public void killZombies() { +/* 1500 */ if (this.zombies != null) { +/* 1501 */ int i = this.zombies.size(); +/* */ do { +/* 1503 */ NetworkObject no = (NetworkObject)this.zombies.elementAt(i); +/* */ +/* */ +/* */ +/* 1507 */ this._objTable.regObject(no.getLongID(), no); +/* 1508 */ if ((no instanceof Drone)) { +/* 1509 */ ((Drone)no).disappear(); +/* */ } +/* 1502 */ i--; } while (i >= 0); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1512 */ this.zombies = null; +/* */ } +/* */ } +/* */ +/* */ private void cleanup() { +/* 1517 */ assert (this._objTable != null); +/* */ +/* */ +/* 1520 */ if ((this._lastError == null) || (this._lastError.getStatusFlag())) +/* */ { +/* 1522 */ killZombies(); +/* 1523 */ Enumeration<NetworkObject> enums = this._objTable.objects(); +/* 1524 */ while (enums.hasMoreElements()) { +/* 1525 */ NetworkObject no = (NetworkObject)enums.nextElement(); +/* 1526 */ if ((no instanceof Drone)) { +/* 1527 */ ((Drone)no).disappear(); +/* */ } +/* */ } +/* 1530 */ this._objTable.clear(); +/* */ } +/* */ else { +/* 1533 */ addZombies(); +/* */ } +/* */ +/* 1536 */ if (this._reader != null) { +/* 1537 */ if (this._reader.isAlive()) { +/* 1538 */ this._reader.stop(); +/* */ } +/* 1540 */ this._reader = null; +/* */ } +/* */ +/* 1543 */ if (this._ostr != null) { +/* */ try { +/* 1545 */ this._ostr.close(); +/* */ } +/* */ catch (Exception localException) {} +/* */ +/* 1549 */ this._ostr = null; +/* */ } +/* */ +/* 1552 */ if (this._sock != null) { +/* */ try { +/* 1554 */ this._sock.close(); +/* */ } +/* */ catch (Exception localException1) {} +/* */ +/* 1558 */ this._sock = null; +/* */ } +/* */ +/* 1561 */ assert (this._connectThread == null); +/* */ } +/* */ +/* */ protected void state_Detaching_helper() { +/* 1565 */ if (this._galaxy != null) { +/* 1566 */ this._galaxy.addClosingServer(this); +/* 1567 */ this._galaxy.markClosedServer(this); +/* */ } +/* */ +/* 1570 */ cleanup(); +/* */ +/* 1572 */ this._retryTimeout = 60000; +/* */ +/* 1574 */ if (this._galaxy != null) +/* */ { +/* */ +/* 1577 */ this._galaxy.noteServerDeath(this._lastError); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void state_Detaching() +/* */ { +/* 1592 */ this._state.setState(18); +/* */ +/* 1594 */ state_Detaching_helper(); +/* */ +/* 1596 */ if (this._lastError != null) +/* */ { +/* 1598 */ System.out.println("[" + Std.getRealTime() + "] " + this + +/* 1599 */ ": lastError=" + this._lastError); +/* */ +/* 1601 */ this._lastError = null; +/* */ +/* */ +/* */ +/* */ +/* 1606 */ this._galaxy.reacquireServer(this); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ } +/* 1645 */ else if (this._refCnt - this._tmpRefCnt > 0) { +/* 1646 */ startConnect(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void state_Sleeping(int timeNow) +/* */ { +/* 1657 */ if (this._requestOffline) { +/* 1658 */ this._state.setState(-1); +/* 1659 */ return; +/* */ } +/* 1661 */ if (timeNow - this._lastAccessTime > this._retryTimeout) { +/* 1662 */ if (this._refCnt == 0) { +/* 1663 */ this._state.setState(18); +/* */ +/* */ } +/* */ else +/* */ { +/* 1668 */ this._state.setState(3); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ protected void state_Disconnected(int timeNow) +/* */ { +/* 1677 */ this._waiters.notify(false); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1688 */ if (timeNow - this._lastAccessTime > 1800000) { +/* 1689 */ synchronized (this) +/* */ { +/* */ +/* 1692 */ if (this._refCnt == 0) +/* */ { +/* */ +/* */ +/* */ +/* 1697 */ assert (this._isMainRegistered); +/* 1698 */ Main.unregister(this); +/* 1699 */ this._isMainRegistered = false; +/* */ +/* 1701 */ if (this._galaxy != null) { +/* 1702 */ this._galaxy.killServer(this); +/* */ } +/* */ } +/* */ } +/* */ } +/* 1707 */ this._lastAccessTime = timeNow; +/* */ } +/* */ +/* */ protected void state_Dead(int timeNow) +/* */ { +/* 1712 */ killZombies(); +/* */ +/* */ +/* */ +/* */ +/* 1717 */ state_Disconnected(timeNow); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void mainCallback() +/* */ { +/* 1725 */ int t = Std.getRealTime(); +/* 1726 */ perFrame(t); +/* */ +/* */ +/* */ +/* 1730 */ if (((getDebugLevel() & 0x1000) > 0) && (this._tmpRefCnt > 0)) { +/* 1731 */ System.out.println(this + ": tmpRefCnt cleanup of " + +/* 1732 */ this._tmpRefCnt + " refs."); +/* */ } +/* 1734 */ synchronized (this) { +/* 1735 */ this._refCnt -= this._tmpRefCnt; +/* 1736 */ this._tmpRefCnt = 0; +/* */ } +/* 1738 */ assert (this._refCnt >= 0); +/* */ } +/* */ +/* */ public void terminalCallback() +/* */ { +/* 1743 */ synchronized (this) { +/* 1744 */ if (this._isMainRegistered) { +/* 1745 */ Main.unregister(this); +/* */ } +/* */ +/* */ +/* 1749 */ Galaxy.forceOffline(false); +/* */ +/* */ +/* 1752 */ if (this._lastError == null) { +/* 1753 */ this._lastError = new VarErrorException(201); +/* */ } +/* 1755 */ this._retriesLeft = 0; +/* 1756 */ int state = this._state.getState(); +/* */ +/* 1758 */ this._state.setState(-1); +/* 1759 */ switch (state) +/* */ { +/* */ case 8: +/* */ case 9: +/* */ case 10: +/* */ case 11: +/* */ case 12: +/* */ case 15: +/* 1767 */ if ((getDebugLevel() & 0x200) > 0) { +/* 1768 */ System.out.println(this + +/* 1769 */ ": terminalCallback(): XMIT_SE, Detach"); +/* */ } +/* 1771 */ state_XMIT_SE(); +/* 1772 */ state_Detaching(); +/* 1773 */ break; +/* */ case 4: +/* 1775 */ this._connectThread = null; +/* */ +/* */ +/* */ case 7: +/* */ case 16: +/* */ case 17: +/* 1781 */ if ((getDebugLevel() & 0x200) > 0) { +/* 1782 */ System.out.println(this + +/* 1783 */ ": terminalCallback(): Detach"); +/* */ } +/* 1785 */ state_Detaching(); +/* 1786 */ break; +/* */ case 5: case 6: case 13: +/* */ case 14: default: +/* 1789 */ if ((getDebugLevel() & 0x200) > 0) { +/* 1790 */ System.out.println(this + +/* 1791 */ ": terminalCallback(): no operation"); +/* */ } +/* */ +/* */ break; +/* */ } +/* */ +/* */ } +/* */ } +/* */ +/* */ public void waitForConnection(ConnectionWaiter cw) +/* */ { +/* 1802 */ this._waiters.addWaiter(cw); +/* */ } +/* */ +/* */ public void abortWaitForConnection(ConnectionWaiter cw) { +/* 1806 */ this._waiters.abortWait(cw); +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 1811 */ return getLongID(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void property(OldPropertyList propList) +/* */ { +/* 1820 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ public void propertyUpdate(PropertyList propList) +/* */ { +/* 1826 */ this._propList = propList; +/* 1827 */ net2Property protocol = this._propList.getProperty(3); +/* 1828 */ if (protocol != null) { +/* */ int ver; +/* */ try { +/* 1831 */ ver = Integer.parseInt(protocol.value()); +/* */ } catch (NumberFormatException e) { int ver; +/* 1833 */ System.err.println(this + ": Error converting protocol value: " + +/* 1834 */ protocol.value()); +/* 1835 */ ver = 18; +/* */ } +/* 1837 */ int oldVer = getVersion(); +/* */ +/* 1839 */ setVersion(ver < oldVer ? ver : oldVer); +/* */ } +/* 1841 */ net2Property update = this._propList.getProperty(8); +/* 1842 */ if (update != null) { +/* */ try { +/* 1844 */ this._updateTime = Integer.parseInt(update.value()); +/* 1845 */ this._updateTime /= 1000; +/* */ } catch (NumberFormatException e) { +/* 1847 */ System.err.println(this + ": Error converting update value: " + +/* 1848 */ update.value()); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1859 */ net2Property http = this._propList.getProperty(24); +/* 1860 */ if (http == null) +/* 1861 */ http = this._propList.getProperty(29); +/* 1862 */ if (http != null) { +/* 1863 */ NetUpdate.setUpgradeServerURL(http.value()); +/* */ } +/* */ +/* */ +/* */ +/* 1868 */ net2Property script = this._propList.getProperty(25); +/* 1869 */ if (script != null) +/* 1870 */ setScriptServer(script.value()); +/* 1871 */ net2Property smtp = this._propList.getProperty(26); +/* 1872 */ if (smtp != null) +/* 1873 */ setSmtpServer(smtp.value()); +/* 1874 */ net2Property domain = this._propList.getProperty(27); +/* 1875 */ if (domain != null) { +/* 1876 */ setMailDomain(domain.value()); +/* */ } +/* 1878 */ if (this._state.getState() == 6) { +/* 1879 */ this._state.setState(7); +/* */ } +/* */ } +/* */ +/* */ public WorldServer getServer() { +/* 1884 */ return this; +/* */ } +/* */ +/* */ public String getLongID() +/* */ { +/* 1889 */ return this._serverURL.getHost(); +/* */ } +/* */ +/* */ +/* */ +/* */ public void register() +/* */ { +/* 1896 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ +/* */ public void galaxyDisconnected() +/* */ { +/* 1901 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ +/* */ public void reacquireServer(WorldServer oldServer) {} +/* */ +/* */ public void changeChannel(Galaxy g, String oldChannel, String newChannel) {} +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\WorldServer.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/appInitCmd.java b/NET/worlds/network/appInitCmd.java new file mode 100644 index 0000000..60b4eb3 --- /dev/null +++ b/NET/worlds/network/appInitCmd.java @@ -0,0 +1,81 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class appInitCmd +/* */ extends propCmd +/* */ { +/* */ public static final byte APPINITCMD = 8; +/* */ +/* */ public appInitCmd() +/* */ { +/* 46 */ this._commandType = 8; +/* */ } +/* */ +/* */ public appInitCmd(String s) +/* */ { +/* 51 */ this._commandType = 8; +/* 52 */ this._propList.addProperty(new netProperty(1, s)); +/* */ } +/* */ +/* */ void process(WorldServer serv) throws Exception +/* */ { +/* 57 */ assert (serv.getState() == 10); +/* 58 */ netProperty _error = this._propList.elementAt(0); +/* */ try { +/* 60 */ int errorval = Integer.parseInt(_error.value()); +/* 61 */ if (errorval != 0) +/* 62 */ throw new VarErrorException(errorval); +/* */ } catch (NumberFormatException e) { +/* 64 */ System.err.println("appInitCmd: couldn't parse VAR_ERROR = " + +/* 65 */ _error.value()); +/* */ +/* 67 */ serv.setState(11); +/* */ } +/* */ } +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 73 */ return "APPINIT " + this._propList; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\appInitCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/appearActorCmd.java b/NET/worlds/network/appearActorCmd.java new file mode 100644 index 0000000..5777dd4 --- /dev/null +++ b/NET/worlds/network/appearActorCmd.java @@ -0,0 +1,91 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.scape.Drone; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class appearActorCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte APPEARACTORCMD = 12; +/* */ protected int _roomID; +/* */ protected short _x; +/* */ protected short _y; +/* */ protected short _z; +/* */ protected short _direction; +/* */ +/* */ public appearActorCmd() +/* */ { +/* 53 */ this._commandType = 12; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 58 */ this._roomID = data.readUnsignedShort(); +/* 59 */ this._x = data.readShort(); +/* 60 */ this._y = data.readShort(); +/* 61 */ this._z = data.readShort(); +/* 62 */ this._direction = data.readShort(); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception +/* */ { +/* 67 */ Drone d = Drone.make(this._objID, _serv); +/* */ +/* */ +/* 70 */ this._direction = ((short)(90 - this._direction)); +/* */ +/* 72 */ this._direction = ((short)(360 - this._direction)); +/* */ +/* 74 */ NetworkRoom netroom = _serv.getNetworkRoom(this._roomID); +/* 75 */ if (netroom != null) { +/* 76 */ d.appear(netroom.getRoom(), this._x, this._y, this._z, this._direction); +/* */ } +/* */ } +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 82 */ return +/* 83 */ "APPRACTR " + this._objID.toString(serv) + " in " + this._roomID + " @ " + this._x + "," + this._y + "," + this._z + "," + this._direction; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\appearActorCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/disappearActorCmd.java b/NET/worlds/network/disappearActorCmd.java new file mode 100644 index 0000000..23576ad --- /dev/null +++ b/NET/worlds/network/disappearActorCmd.java @@ -0,0 +1,76 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.scape.Drone; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class disappearActorCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte DISAPPEARACTORCMD = 11; +/* */ +/* */ public disappearActorCmd() +/* */ { +/* 48 */ this._commandType = 11; +/* */ } +/* */ +/* */ +/* */ void parseNetData(ServerInputStream data) +/* */ throws IOException +/* */ {} +/* */ +/* */ void process(WorldServer _serv) +/* */ throws Exception +/* */ { +/* 59 */ NetworkObject o = _serv.getObject(this._objID); +/* 60 */ if ((o instanceof Drone)) { +/* 61 */ ((Drone)o).disappear(); +/* */ } +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 68 */ return "DISAPPR " + this._objID.toString(serv); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\disappearActorCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/longLocCmd.java b/NET/worlds/network/longLocCmd.java new file mode 100644 index 0000000..01df714 --- /dev/null +++ b/NET/worlds/network/longLocCmd.java @@ -0,0 +1,116 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.scape.Drone; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class longLocCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte LONGLOCCMD = 1; +/* */ protected short _x; +/* */ protected short _y; +/* */ protected short _z; +/* */ protected short _dir; +/* */ +/* */ public longLocCmd() +/* */ { +/* 50 */ this._commandType = 1; +/* */ } +/* */ +/* */ public longLocCmd(short x, short y, short z, short dir) { +/* 54 */ super(null, 1); +/* */ +/* 56 */ this._x = x; +/* 57 */ this._y = y; +/* 58 */ this._z = z; +/* 59 */ this._dir = dir; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 64 */ this._x = data.readShort(); +/* 65 */ this._y = data.readShort(); +/* 66 */ this._z = data.readShort(); +/* 67 */ this._dir = data.readShort(); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 72 */ return 8 + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 77 */ super.send(o); +/* 78 */ o.writeShort(this._x); +/* 79 */ o.writeShort(this._y); +/* 80 */ o.writeShort(this._z); +/* 81 */ o.writeShort(this._dir); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception +/* */ { +/* 86 */ NetworkObject o = _serv.getObject(this._objID); +/* 87 */ if ((o instanceof Drone)) { +/* 88 */ this._dir = ((short)(90 - this._dir)); +/* 89 */ this._dir = ((short)(360 - this._dir)); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 95 */ ((Drone)o).longLoc(this._x, this._y, this._z, this._dir); +/* */ } +/* */ +/* 98 */ if (o == null) { +/* 99 */ System.out.println("error in message: " + toString(_serv)); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 107 */ return +/* 108 */ "LONGLOC " + this._objID.toString(serv) + " @ " + this._x + "," + this._y + "," + this._z + "," + this._dir; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\longLocCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/net2Property.java b/NET/worlds/network/net2Property.java new file mode 100644 index 0000000..8e5fad9 --- /dev/null +++ b/NET/worlds/network/net2Property.java @@ -0,0 +1,201 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ import java.io.UTFDataFormatException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class net2Property +/* */ { +/* */ private int _propID; +/* */ protected int _flags; +/* */ protected int _access; +/* */ protected String _stringValue; +/* */ protected byte[] _binValue; +/* */ +/* */ public net2Property(int p, int flags, int access, byte[] data) +/* */ { +/* 52 */ this._propID = p; +/* 53 */ this._flags = flags; +/* 54 */ this._access = access; +/* 55 */ assert ((flags & 0x10) > 0); +/* 56 */ this._binValue = data; +/* 57 */ this._stringValue = null; +/* */ } +/* */ +/* */ public net2Property(int p, int flags, int access, String data) { +/* 61 */ this._propID = p; +/* 62 */ this._flags = flags; +/* 63 */ this._access = access; +/* 64 */ assert ((flags & 0x10) == 0); +/* 65 */ this._stringValue = data; +/* 66 */ this._binValue = null; +/* */ } +/* */ +/* */ public net2Property() { +/* 70 */ this._propID = 0; +/* 71 */ this._flags = 0; +/* 72 */ this._access = 0; +/* 73 */ this._stringValue = null; +/* 74 */ this._binValue = null; +/* */ } +/* */ +/* */ public int property() { +/* 78 */ return this._propID; +/* */ } +/* */ +/* */ public int flags() { +/* 82 */ return this._flags; +/* */ } +/* */ +/* */ public int access() { +/* 86 */ return this._access; +/* */ } +/* */ +/* */ public byte[] data() { +/* 90 */ if ((this._flags & 0x10) > 0) { +/* 91 */ return this._binValue; +/* */ } +/* */ +/* */ +/* 95 */ byte[] data = this._stringValue.getBytes(); +/* 96 */ return data; +/* */ } +/* */ +/* */ public String value() +/* */ { +/* 101 */ if ((this._flags & 0x10) == 0) { +/* 102 */ return this._stringValue; +/* */ } +/* 104 */ return new String(this._binValue); +/* */ } +/* */ +/* */ +/* */ +/* */ int packetSize() +/* */ { +/* 111 */ if ((this._flags & 0x10) > 0) { +/* 112 */ assert (this._binValue != null); +/* 113 */ return 4 + this._binValue.length; +/* */ } +/* 115 */ assert (this._stringValue != null); +/* 116 */ return 4 + ServerOutputStream.utfLength(this._stringValue); +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) +/* */ throws IOException, UTFDataFormatException +/* */ { +/* 122 */ this._propID = data.readUnsignedByte(); +/* 123 */ this._flags = data.readUnsignedByte(); +/* 124 */ this._access = data.readUnsignedByte(); +/* */ +/* 126 */ if ((this._flags & 0x10) > 0) { +/* 127 */ int size = data.readUnsignedByte(); +/* 128 */ this._binValue = new byte[size]; +/* 129 */ data.readFully(this._binValue); +/* 130 */ this._stringValue = null; +/* */ } +/* */ else { +/* */ try { +/* 134 */ this._stringValue = data.readUTF(); +/* */ } catch (UTFDataFormatException e) { +/* 136 */ this._stringValue = ""; +/* */ +/* 138 */ throw e; +/* */ } +/* 140 */ this._binValue = null; +/* */ } +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException { +/* 145 */ o.writeByte(this._propID); +/* 146 */ o.writeByte(this._flags); +/* 147 */ o.writeByte(this._access); +/* 148 */ if ((this._flags & 0x10) > 0) { +/* 149 */ o.writeByte(this._binValue.length); +/* 150 */ o.write(this._binValue); +/* */ } else { +/* 152 */ o.writeUTF(this._stringValue); +/* */ } +/* */ } +/* */ +/* 156 */ private String flagString() { String out = ""; +/* 157 */ if ((this._flags & 0x80) > 0) +/* 158 */ out = out + "DBSTORE "; +/* 159 */ if ((this._flags & 0x40) > 0) +/* 160 */ out = out + "AUTOUPDATE "; +/* 161 */ if ((this._flags & 0x20) > 0) +/* 162 */ out = out + "FINGER "; +/* 163 */ if ((this._flags & 0x10) > 0) +/* 164 */ out = out + "BINARY "; +/* 165 */ if (out.length() == 0) +/* 166 */ out = "NONE"; +/* 167 */ return out; +/* */ } +/* */ +/* */ private String accessString() { +/* 171 */ String out = ""; +/* 172 */ if ((this._access & 0x1) > 0) +/* 173 */ out = out + "POSSESS "; +/* 174 */ if ((this._access & 0x2) > 0) +/* 175 */ out = out + "PRIVATE "; +/* 176 */ if (out.length() == 0) +/* 177 */ out = "NONE"; +/* 178 */ return out; +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 183 */ String tmp = "#" + this._propID + " [" + flagString() + "/" + accessString() + +/* 184 */ "] "; +/* 185 */ if ((this._flags & 0x10) == 0) { +/* 186 */ return tmp + this._stringValue; +/* */ } +/* */ +/* 189 */ tmp = tmp + "val=["; +/* 190 */ for (int i = 0; i < this._binValue.length; i++) { +/* 191 */ tmp = tmp + Integer.toString(this._binValue[i], 16) + " "; +/* */ } +/* 193 */ return tmp + "] (" + this._binValue + ")"; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\net2Property.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/netCmds.java b/NET/worlds/network/netCmds.java new file mode 100644 index 0000000..c0d87cf --- /dev/null +++ b/NET/worlds/network/netCmds.java @@ -0,0 +1,102 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.util.Hashtable; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class netCmds +/* */ { +/* */ private Vector<String> _recvNetPacket; +/* */ +/* */ public netCmds() +/* */ { +/* 32 */ this._recvNetPacket = new Vector(); +/* 33 */ this._recvNetPacket.addElement("appInitCmd"); +/* 34 */ this._recvNetPacket.addElement("appearActorCmd"); +/* 35 */ this._recvNetPacket.addElement("disappearActorCmd"); +/* 36 */ this._recvNetPacket.addElement("longLocCmd"); +/* 37 */ this._recvNetPacket.addElement("propCmd"); +/* 38 */ this._recvNetPacket.addElement("regObjIDCmd"); +/* 39 */ this._recvNetPacket.addElement("roomChangeCmd"); +/* 40 */ this._recvNetPacket.addElement("sessionExitCmd"); +/* 41 */ this._recvNetPacket.addElement("sessionInitCmd"); +/* 42 */ this._recvNetPacket.addElement("shortLocCmd"); +/* 43 */ this._recvNetPacket.addElement("teleportCmd"); +/* 44 */ this._recvNetPacket.addElement("textCmd"); +/* 45 */ this._recvNetPacket.addElement("whisperCmd"); +/* 46 */ this._recvNetPacket.addElement("roomIDCmd"); +/* 47 */ this._recvNetPacket.addElement("PropertySetCmd"); +/* 48 */ this._recvNetPacket.addElement("PropertyUpdateCmd"); +/* 49 */ this._recvNetPacket.addElement("FingerReplyCmd"); +/* 50 */ this._recvNetPacket.addElement("RedirectCmd"); +/* 51 */ this._recvNetPacket.addElement("RedirectIDCmd"); +/* 52 */ this._recvNetPacket.addElement("BuddyListNotifyCmd"); +/* */ } +/* */ +/* */ Vector<String> recvCmdList() { +/* 56 */ return this._recvNetPacket; +/* */ } +/* */ +/* */ +/* 60 */ private static Hashtable<Integer, String> _propList = new Hashtable(); +/* */ +/* */ static +/* */ { +/* 64 */ _propList.put(new Integer(1), "VAR_APPNAME"); +/* 65 */ _propList.put(new Integer(2), "VAR_USERNAME"); +/* 66 */ _propList.put(new Integer(3), "VAR_PROTOCOL"); +/* 67 */ _propList.put(new Integer(4), "VAR_ERROR"); +/* 68 */ _propList.put(new Integer(5), "VAR_CHANNEL"); +/* 69 */ _propList.put(new Integer(6), "VAR_PASSWORD"); +/* 70 */ _propList.put(new Integer(7), "VAR_AVATARS"); +/* 71 */ _propList.put(new Integer(8), "VAR_UPDATETIME"); +/* 72 */ _propList.put(new Integer(9), "VAR_CLIENT"); +/* 73 */ _propList.put(new Integer(10), "VAR_SERIAL"); +/* 74 */ _propList.put(new Integer(11), "VAR_EMAIL"); +/* 75 */ _propList.put(new Integer(12), "VAR_LOGONOFF"); +/* 76 */ _propList.put(new Integer(13), "VAR_DURATION"); +/* 77 */ _propList.put(new Integer(14), "VAR_GUEST"); +/* 78 */ _propList.put(new Integer(15), "VAR_SERVERTYPE"); +/* 79 */ _propList.put(new Integer(16), "VAR_BIZCARD"); +/* 80 */ _propList.put(new Integer(22), "VAR_PRIV"); +/* 81 */ _propList.put(new Integer(20), "VAR_NEW_PASSWD"); +/* 82 */ _propList.put(new Integer(23), "VAR_ASLEEP"); +/* 83 */ _propList.put(new Integer(24), "VAR_EXTERNAL_HTTP_SERVER"); +/* 84 */ _propList.put(new Integer(25), "VAR_SCRIPT_SERVER"); +/* 85 */ _propList.put(new Integer(26), "VAR_SMTP_SERVER"); +/* 86 */ _propList.put(new Integer(27), "VAR_MAIL_DOMAIN"); +/* 87 */ _propList.put(new Integer(28), "VAR_NEW_USERNAME"); +/* 88 */ _propList.put(new Integer(29), "VAR_INTERNAL_HTTP_SERVER"); +/* */ } +/* */ +/* */ +/* */ static String getPropName(int id) +/* */ { +/* 94 */ return (String)_propList.get(new Integer(id)); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\netCmds.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/netConst.java b/NET/worlds/network/netConst.java new file mode 100644 index 0000000..674483e --- /dev/null +++ b/NET/worlds/network/netConst.java @@ -0,0 +1,101 @@ +package NET.worlds.network; + +public abstract interface netConst +{ + public static final byte PROTOCOL_VERSION = 24; + public static final byte STATECMD = 2; + public static final int MAXCMD = 255; + public static final int CURRENT_ROOM = 253; + public static final int CLIENT = 1; + public static final int CO = 254; + public static final int PO = 255; + public static final byte VAR_APPNAME = 1; + public static final byte VAR_USERNAME = 2; + public static final byte VAR_PROTOCOL = 3; + public static final byte VAR_ERROR = 4; + public static final byte VAR_CHANNEL = 5; + public static final byte VAR_BITMAP = 5; + public static final byte VAR_PASSWORD = 6; + public static final byte VAR_AVATARS = 7; + public static final byte VAR_UPDATETIME = 8; + public static final byte VAR_CLIENT = 9; + public static final int VAR_SERIAL = 10; + public static final int VAR_EMAIL = 11; + public static final int VAR_LOGONOFF = 12; + public static final int VAR_DURATION = 13; + public static final int VAR_GUEST = 14; + public static final int VAR_SERVERTYPE = 15; + public static final int VAR_BIZCARD = 16; + public static final int VAR_NEW_PASSWD = 20; + public static final int VAR_PRIV = 22; + public static final byte VAR_ASLEEP = 23; + public static final byte VAR_EXTERNAL_HTTP_SERVER = 24; + public static final byte VAR_SCRIPT_SERVER = 25; + public static final byte VAR_SMTP_SERVER = 26; + public static final byte VAR_MAIL_DOMAIN = 27; + public static final byte VAR_NEW_USERNAME = 28; + public static final byte VAR_INTERNAL_HTTP_SERVER = 29; + public static final byte VAR_INVENTORY = 32; + public static final int ACK = 0; + public static final int NAK_BAD_USER = 1; + public static final int NAK_MAX_ORDINARY = 2; + public static final int NAK_MAX_PRIORITY = 3; + public static final int NAK_BAD_WORLD = 4; + public static final int NAK_FATAL = 5; + public static final int NAK_BAD_PROTOCOL = 6; + public static final int NAK_BAD_CLIENTSW = 7; + public static final int NAK_BAD_ROOM = 8; + public static final int NAK_BAD_SERIAL = 9; + public static final int NAK_TAKEN_SERIAL = 10; + public static final int NAK_TAKEN_USER = 11; + public static final int NAK_NO_SUCH_USER = 12; + public static final int NAK_BAD_PASSWORD = 13; + public static final int NAK_BAD_ACCOUNT = 14; + public static final int NAK_NOT_LOGGEDON = 15; + public static final int NAK_BAD_IPADDRESS = 16; + public static final int NAK_LOGGEDON = 17; + public static final int NAK_CRYPT_METHOD = 18; + public static final int NAK_CRYPT_ERROR = 19; + public static final int NAK_SESSIONINIT = 20; + public static final int NAK_ROOM_FULL = 21; + public static final int NAK_SHUTDOWN = 100; + public static final int NAK_WRITE_ERROR = 101; + public static final int NAK_READ_ERROR = 102; + public static final int NAK_UNEXPECTED = 103; + public static final int NAK_CONNECTION = 104; + public static final int NAK_IOSTREAMS = 105; + public static final int NAK_TIMEOUT = 106; + public static final int NAK_UNREACHABLE = 107; + public static final int STATUS_CONNECTED = 200; + public static final int STATUS_DETACHING = 201; + public static final int STATUS_WILLRETRY = 202; + public static final int STATUS_DISCONNECTED = 203; + public static final int STATUS_DEAD = 204; + public static final int STATUS_OFFLINE = 205; + public static final int STATUS_GALAXY_ONLINE = 206; + public static final int STATUS_GALAXY_OFFLINE = 206; + public static final int PROPFLAG_BINARY = 16; + public static final int PROPFLAG_FINGER = 32; + public static final int PROPFLAG_AUTOUPDATE = 64; + public static final int PROPFLAG_DBSTORE = 128; + public static final int PROPACCESS_POSSESS = 1; + public static final int PROPACCESS_PRIVATE = 2; + public static final int SERVER_UNKNOWN = 0; + public static final int USER_SERVER_DB = 1; + public static final int USER_SERVER_ANON = 2; + public static final int ROOM_SERVER_US = 3; + public static final int ROOM_SERVER_ANON = 4; + public static final int PRIV_NONE = 0; + public static final int PRIV_BUILD = 1; + public static final int PRIV_BROADCAST = 2; + public static final int PRIV_PROPERTY = 4; + public static final int PRIV_VIP = 8; + public static final int PRIV_VIP2 = 16; + public static final int PRIV_SPECIALGUEST = 64; +} + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\netConst.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/netData.java b/NET/worlds/network/netData.java new file mode 100644 index 0000000..9ba603e --- /dev/null +++ b/NET/worlds/network/netData.java @@ -0,0 +1,132 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.DataInputStream; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.io.UTFDataFormatException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ class netData +/* */ { +/* */ private byte[] _data; +/* */ private int _packetSize; +/* */ private int _offset; +/* */ +/* */ public netData(DataInputStream in) +/* */ { +/* */ try +/* */ { +/* 24 */ this._packetSize = in.readUnsignedByte(); +/* 25 */ this._data = new byte['Ā']; +/* 26 */ in.readFully(this._data, 1, this._packetSize - 1); +/* 27 */ this._data[0] = ((byte)this._packetSize); +/* */ +/* */ +/* */ } +/* */ catch (Exception e) +/* */ { +/* */ +/* 34 */ this._data = null; +/* 35 */ this._packetSize = 0; +/* */ } +/* 37 */ this._offset = 1; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public final int packetSize() +/* */ { +/* 46 */ return this._packetSize; +/* */ } +/* */ +/* */ public final boolean isEmpty() { +/* 50 */ return this._offset >= this._packetSize; +/* */ } +/* */ +/* */ public final byte getByte() { +/* 54 */ assert (this._offset < this._packetSize); +/* 55 */ return this._data[(this._offset++)]; +/* */ } +/* */ +/* */ public final short getShort() { +/* 59 */ assert (this._offset < this._packetSize); +/* 60 */ assert (this._offset + 1 < this._packetSize); +/* */ +/* 62 */ short retVal = (short)(this._data[this._offset] << 8 | this._data[(this._offset + 1)] & 0xFF); +/* 63 */ this._offset += 2; +/* 64 */ return retVal; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public String getUTFString(int utflen) +/* */ { +/* 72 */ char[] str = new char[utflen]; +/* 73 */ int count = 0; +/* 74 */ int strlen = 0; +/* */ try { +/* 76 */ while (count < utflen) { +/* 77 */ int c = getByte() & 0xFF; +/* */ +/* 79 */ switch (c >> 4) +/* */ { +/* */ case 0: +/* */ case 1: +/* */ case 2: +/* */ case 3: +/* */ case 4: +/* */ case 5: +/* */ case 6: +/* */ case 7: +/* 89 */ count++; +/* 90 */ str[(strlen++)] = ((char)c); +/* 91 */ break; +/* */ +/* */ case 12: +/* */ case 13: +/* 95 */ count += 2; +/* 96 */ if (count > utflen) +/* 97 */ throw new UTFDataFormatException(); +/* 98 */ int char2 = getByte() & 0xFF; +/* 99 */ if ((char2 & 0xC0) != 128) +/* 100 */ throw new UTFDataFormatException(); +/* 101 */ str[(strlen++)] = ((char)((c & 0x1F) << 6 | char2 & 0x3F)); +/* 102 */ break; +/* */ +/* */ case 14: +/* 105 */ count += 3; +/* 106 */ if (count > utflen) +/* 107 */ throw new UTFDataFormatException(); +/* 108 */ int char2 = getByte() & 0xFF; +/* 109 */ int char3 = getByte() & 0xFF; +/* 110 */ if (((char2 & 0xC0) != 128) || ((char3 & 0xC0) != 128)) +/* 111 */ throw new UTFDataFormatException(); +/* 112 */ str[(strlen++)] = +/* 113 */ ((char)((c & 0xF) << 12 | (char2 & 0x3F) << 6 | (char3 & 0x3F) << 0)); +/* */ case 8: case 9: case 10: +/* */ case 11: default: +/* 116 */ throw new UTFDataFormatException(); +/* */ } +/* */ } +/* */ } catch (IOException e) { +/* 120 */ System.err.println("Exception: " + e.getMessage()); +/* 121 */ e.printStackTrace(); +/* 122 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 124 */ return new String(str, 0, strlen); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\netData.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/netPacket.java b/NET/worlds/network/netPacket.java new file mode 100644 index 0000000..14afa2f --- /dev/null +++ b/NET/worlds/network/netPacket.java @@ -0,0 +1,124 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.StatNetMUNode; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public abstract class netPacket +/* */ { +/* */ protected ObjID _objID; +/* */ protected int _commandType; +/* */ +/* */ public netPacket(ObjID id, int cmd) +/* */ { +/* 62 */ if (id != null) { +/* 63 */ this._objID = id; +/* */ } else +/* 65 */ this._objID = new ObjID(1); +/* 66 */ this._commandType = cmd; +/* */ } +/* */ +/* */ public netPacket() { +/* 70 */ this._objID = new ObjID(1); +/* */ } +/* */ +/* */ public int msgID() { +/* 74 */ return this._commandType; +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 79 */ return 2 + this._objID.packetSize(); +/* */ } +/* */ +/* */ public String toString(WorldServer serv) { +/* 83 */ return new Integer(this._commandType).toString(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ void send(ServerOutputStream o) +/* */ throws IOException +/* */ { +/* 92 */ int packetsize = packetSize(); +/* */ +/* 94 */ if ((packetsize >= 256) && (o.getVersion() <= 24)) { +/* 95 */ throw new PacketTooLargeException(); +/* */ } +/* */ +/* */ +/* */ +/* 100 */ StatNetMUNode netStat = StatNetMUNode.getNode(); +/* 101 */ netStat.addBytesSent(packetsize); +/* 102 */ netStat.addPacketsSent(1); +/* */ +/* 104 */ assert (this._commandType > 0); +/* */ +/* 106 */ if ((packetsize >= 128) && (o.getVersion() > 24)) +/* */ { +/* */ +/* 109 */ o.writeByte(128 + packetsize / 256); +/* 110 */ o.writeByte(packetsize & 0xFF); +/* */ } +/* */ else { +/* 113 */ o.writeByte(packetsize); +/* */ } +/* 115 */ this._objID.send(o); +/* 116 */ o.writeByte(this._commandType); +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\netPacket.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/netPacketReader.java b/NET/worlds/network/netPacketReader.java new file mode 100644 index 0000000..4d7a479 --- /dev/null +++ b/NET/worlds/network/netPacketReader.java @@ -0,0 +1,357 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.StatNetMUNode; +/* */ import java.io.ByteArrayInputStream; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class netPacketReader +/* */ extends Thread +/* */ { +/* */ private Vector<receivedNetPacket> _msgQ; +/* */ private ServerInputStream _in; +/* */ private WorldServer _serv; +/* */ private static Class<receivedNetPacket>[] msgTable; +/* */ +/* */ public netPacketReader(ServerInputStream in) +/* */ { +/* 95 */ this._in = in; +/* 96 */ this._msgQ = new Vector(); +/* */ } +/* */ +/* */ public netPacketReader(WorldServer serv, ServerInputStream in) { +/* 100 */ this._serv = serv; +/* 101 */ this._in = in; +/* 102 */ this._msgQ = new Vector(); +/* 103 */ this._in.setVersion(getVersion()); +/* */ } +/* */ +/* */ +/* */ +/* */ public void setVersion(int vers) +/* */ { +/* 110 */ this._in.setVersion(vers); +/* */ } +/* */ +/* */ +/* */ +/* */ public int getVersion() +/* */ { +/* 117 */ return this._serv.getVersion(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void put(receivedNetPacket pkt) +/* */ { +/* 126 */ this._msgQ.addElement(pkt); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public receivedNetPacket get() +/* */ { +/* 139 */ assert (this._msgQ != null); +/* 140 */ if (this._msgQ.isEmpty()) { +/* 141 */ return null; +/* */ } +/* 143 */ receivedNetPacket packet = (receivedNetPacket)this._msgQ.firstElement(); +/* 144 */ this._msgQ.removeElement(packet); +/* 145 */ return packet; +/* */ } +/* */ +/* */ public int count() +/* */ { +/* 150 */ return this._msgQ.size(); +/* */ } +/* */ +/* */ +/* */ static +/* */ { +/* 156 */ msgTable = new Class['ÿ']; +/* */ +/* 158 */ String basePath = "NET.worlds.network."; +/* */ +/* 160 */ Vector<String> cmdList = new netCmds().recvCmdList(); +/* */ +/* */ +/* */ +/* */ +/* 165 */ for (int i = 0; i < cmdList.size(); i++) { +/* 166 */ String cmdName = basePath + (String)cmdList.elementAt(i); +/* */ +/* */ try +/* */ { +/* 170 */ Class<receivedNetPacket> tmpCmdClass = Class.forName(cmdName); +/* 171 */ receivedNetPacket tmpInstance = (receivedNetPacket)tmpCmdClass.newInstance(); +/* 172 */ int indx = tmpInstance.msgID(); +/* 173 */ assert (indx > -1); +/* 174 */ assert (msgTable[indx] == null); +/* 175 */ msgTable[indx] = tmpCmdClass; +/* */ +/* */ } +/* */ catch (NoSuchMethodError e) +/* */ { +/* */ +/* 181 */ synchronized (System.out) { +/* 182 */ System.out.println("netPacketReader:: " + +/* 183 */ e.getClass().getName() + " creating " + cmdName); +/* 184 */ System.out.println("netPacketReader:: Exception: " + +/* 185 */ e.getMessage()); +/* 186 */ e.printStackTrace(System.out); +/* */ } +/* 188 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ catch (Exception e) { +/* 191 */ synchronized (System.out) { +/* 192 */ System.out.println("netPacketReader:: " + +/* 193 */ e.getClass().getName() + " creating " + +/* 194 */ cmdName); +/* 195 */ System.out.println("netPacketReader:: Exception: " + +/* 196 */ e.getMessage()); +/* 197 */ e.printStackTrace(System.out); +/* */ } +/* */ +/* 200 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private final void buildMsg() +/* */ throws IOException +/* */ { +/* 245 */ this._in.readPacketSize(); +/* */ +/* */ +/* */ +/* 249 */ byte[] packetData = new byte[this._in.bytesLeft() + 1]; +/* */ +/* 251 */ packetData[0] = ((byte)(this._in.bytesLeft() + 1)); +/* 252 */ this._in.readFully(packetData, 1, this._in.bytesLeft()); +/* */ +/* */ +/* 255 */ StatNetMUNode netStat = StatNetMUNode.getNode(); +/* 256 */ netStat.addBytesRcvd(packetData.length); +/* 257 */ netStat.addPacketsRcvd(1); +/* */ +/* */ +/* 260 */ ServerInputStream in = new ServerInputStream(new ByteArrayInputStream( +/* 261 */ packetData)); +/* 262 */ in.readPacketSize(); +/* */ +/* 264 */ if ((WorldServer.getDebugLevel() & 0x800) > 0) { +/* 265 */ synchronized (System.out) { +/* 266 */ System.out.print(this._serv + ": recv["); +/* 267 */ for (int i = 0; i < packetData.length; i++) +/* 268 */ System.out.print(Integer.toString( +/* 269 */ packetData[i] & 0xFF, 16) + " "); +/* 270 */ System.out.println("]"); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* 276 */ receivedNetPacket packet = null; +/* 277 */ ObjID objID = new ObjID(); +/* */ +/* 279 */ objID.parseNetData(in); +/* */ +/* 281 */ boolean isCO = objID.shortID() == 254; +/* */ +/* 283 */ int cmdType = in.readUnsignedByte(); +/* */ +/* 285 */ if ((cmdType >= msgTable.length) || (msgTable[cmdType] == null)) +/* */ { +/* 287 */ System.out.println("UNKNOWN SERVER MSG#" + String.valueOf(cmdType)); +/* */ +/* 289 */ in.skipBytes(in.bytesLeft()); +/* 290 */ assert (in.isEmpty()); +/* */ } +/* */ else +/* */ { +/* */ do { +/* 295 */ if (isCO) +/* */ { +/* 297 */ objID = new ObjID(); +/* 298 */ objID.parseNetData(in); +/* */ } +/* */ try { +/* 301 */ packet = (receivedNetPacket)msgTable[cmdType].newInstance(); +/* */ } catch (Exception e) { +/* 303 */ System.out.println(e + ": " + e.getMessage()); +/* 304 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* 306 */ packet.init(objID); +/* */ +/* 308 */ packet.parseNetData(in); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 314 */ this._msgQ.addElement(packet); +/* 315 */ yield(); +/* */ } +/* 317 */ while ((!in.isEmpty()) && (isCO)); +/* 318 */ assert (in.isEmpty()); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void run() +/* */ { +/* */ try +/* */ { +/* */ for (;;) +/* */ { +/* 342 */ buildMsg(); +/* */ } +/* */ +/* */ } +/* */ catch (IOException e) +/* */ { +/* 348 */ this._msgQ.addElement(new ExceptionCmd(e)); +/* */ } +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\netPacketReader.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/netProperty.java b/NET/worlds/network/netProperty.java new file mode 100644 index 0000000..fa2f0bb --- /dev/null +++ b/NET/worlds/network/netProperty.java @@ -0,0 +1,83 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class netProperty +/* */ { +/* */ protected int _propID; +/* */ protected String _value; +/* */ +/* */ public netProperty() +/* */ { +/* 29 */ this._propID = 0; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public netProperty(int p) +/* */ { +/* 37 */ this._propID = p; +/* */ } +/* */ +/* */ public netProperty(int p, String val) { +/* 41 */ assert (val != null); +/* 42 */ this._propID = p; +/* 43 */ this._value = val; +/* */ } +/* */ +/* */ public int property() { +/* 47 */ return this._propID; +/* */ } +/* */ +/* */ public String value() { +/* 51 */ return this._value; +/* */ } +/* */ +/* */ int packetSize() { +/* 55 */ if (this._value != null) +/* */ { +/* 57 */ return 2 + ServerOutputStream.utfLength(this._value); +/* */ } +/* 59 */ return 0; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException { +/* 63 */ this._propID = data.readUnsignedByte(); +/* 64 */ this._value = data.readUTF(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException { +/* 68 */ o.writeByte(this._propID); +/* 69 */ o.writeUTF(this._value); +/* */ } +/* */ +/* */ +/* */ public String toString() +/* */ { +/* 75 */ return netCmds.getPropName(this._propID) + "=" + this._value; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\netProperty.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/propCmd.java b/NET/worlds/network/propCmd.java new file mode 100644 index 0000000..95f166b --- /dev/null +++ b/NET/worlds/network/propCmd.java @@ -0,0 +1,133 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class propCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte PROPCMD = 3; +/* */ protected OldPropertyList _propList; +/* */ +/* */ public propCmd() +/* */ { +/* 60 */ this._commandType = 3; +/* */ +/* 62 */ this._propList = new OldPropertyList(); +/* */ } +/* */ +/* */ public propCmd(OldPropertyList propList) +/* */ { +/* 67 */ super(null, 3); +/* 68 */ this._propList = propList; +/* */ } +/* */ +/* */ public propCmd(ObjID objID, OldPropertyList propList) +/* */ { +/* 73 */ super(objID, 3); +/* 74 */ this._propList = propList; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 79 */ this._propList = new OldPropertyList(); +/* 80 */ this._propList.parseNetData(data); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 85 */ return super.packetSize() + this._propList.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 90 */ super.send(o); +/* 91 */ assert (this._propList != null); +/* 92 */ this._propList.send(o); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ void process(WorldServer _serv) +/* */ throws Exception +/* */ { +/* 111 */ NetworkObject o = _serv.getObject(this._objID); +/* */ +/* 113 */ if (o == null) { +/* 114 */ System.err.println("propCmd::process() error: cannot find object with name " + +/* 115 */ this._objID); +/* 116 */ return; +/* */ } +/* */ +/* 119 */ o.property(this._propList); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 125 */ return "PROP " + this._objID.toString(serv) + " " + this._propList; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\propCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/propReqCmd.java b/NET/worlds/network/propReqCmd.java new file mode 100644 index 0000000..c59a333 --- /dev/null +++ b/NET/worlds/network/propReqCmd.java @@ -0,0 +1,84 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class propReqCmd +/* */ extends netPacket +/* */ { +/* */ public static final byte PROPREQCMD = 10; +/* */ protected Vector<Integer> _varids; +/* */ +/* */ public propReqCmd(ObjID id, int varid) +/* */ { +/* 38 */ super(id, 10); +/* 39 */ this._varids = new Vector(); +/* 40 */ addProp(varid); +/* */ } +/* */ +/* */ public propReqCmd(ObjID id) { +/* 44 */ super(id, 10); +/* 45 */ this._varids = new Vector(); +/* */ } +/* */ +/* */ public void addProp(int varid) { +/* 49 */ this._varids.addElement(new Integer(varid)); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 54 */ return this._varids.size() + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 59 */ super.send(o); +/* 60 */ int maxidx = this._varids.size(); +/* */ +/* 62 */ for (int i = 0; i < maxidx; i++) { +/* 63 */ Integer tmpInt = (Integer)this._varids.elementAt(i); +/* 64 */ o.writeByte(tmpInt.intValue()); +/* */ } +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 71 */ String out = "PROPREQ " + this._objID.toString(serv) + " "; +/* 72 */ int maxidx = this._varids.size(); +/* 73 */ for (int i = 0; i < maxidx; i++) { +/* 74 */ out = out + " #" + (Integer)this._varids.elementAt(i); +/* */ } +/* 76 */ return out; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\propReqCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/receivedNetPacket.java b/NET/worlds/network/receivedNetPacket.java new file mode 100644 index 0000000..c60e912 --- /dev/null +++ b/NET/worlds/network/receivedNetPacket.java @@ -0,0 +1,47 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public abstract class receivedNetPacket +/* */ extends netPacket +/* */ { +/* */ public receivedNetPacket(ObjID id, int cmd) +/* */ { +/* 26 */ super(id, cmd); +/* */ } +/* */ +/* */ public receivedNetPacket() {} +/* */ +/* */ public final void init(ObjID objID) +/* */ { +/* 33 */ this._objID = objID; +/* */ } +/* */ +/* */ abstract void parseNetData(ServerInputStream paramServerInputStream) +/* */ throws IOException; +/* */ +/* */ abstract void process(WorldServer paramWorldServer) +/* */ throws Exception; +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\receivedNetPacket.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/regObjIDCmd.java b/NET/worlds/network/regObjIDCmd.java new file mode 100644 index 0000000..8d5099c --- /dev/null +++ b/NET/worlds/network/regObjIDCmd.java @@ -0,0 +1,69 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class regObjIDCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte REGOBJIDCMD = 13; +/* */ private String _longObjID; +/* */ private int _shortObjID; +/* */ +/* 48 */ public regObjIDCmd() { this._commandType = 13; } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException { +/* 51 */ this._longObjID = data.readUTF(); +/* 52 */ this._shortObjID = data.readByte(); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception { +/* 56 */ _serv.regShortID(this._shortObjID, this._longObjID); +/* */ } +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 61 */ return "REGOBJID " + this._shortObjID + " --> " + this._longObjID; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\regObjIDCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/roomChangeCmd.java b/NET/worlds/network/roomChangeCmd.java new file mode 100644 index 0000000..7aaa490 --- /dev/null +++ b/NET/worlds/network/roomChangeCmd.java @@ -0,0 +1,127 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.scape.Drone; +/* */ import NET.worlds.scape.Room; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class roomChangeCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte ROOMCHNGCMD = 5; +/* */ protected int _roomID; +/* */ protected short _x; +/* */ protected short _y; +/* */ protected short _z; +/* */ protected short _direction; +/* */ +/* */ public roomChangeCmd() +/* */ { +/* 58 */ this._commandType = 5; +/* */ } +/* */ +/* */ public roomChangeCmd(Room room, short x, short y, short z, short direction) { +/* 62 */ super(null, 5); +/* 63 */ this._roomID = room.getNetworkRoom().getRoomID(); +/* 64 */ assert (this._roomID != 0); +/* 65 */ this._x = x; +/* 66 */ this._y = y; +/* 67 */ this._z = z; +/* 68 */ this._direction = direction; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 73 */ this._roomID = data.readUnsignedShort(); +/* 74 */ this._x = data.readShort(); +/* 75 */ this._y = data.readShort(); +/* 76 */ this._z = data.readShort(); +/* 77 */ this._direction = data.readShort(); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 82 */ return 10 + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 87 */ super.send(o); +/* 88 */ o.writeShort(this._roomID); +/* 89 */ o.writeShort(this._x); +/* 90 */ o.writeShort(this._y); +/* 91 */ o.writeShort(this._z); +/* 92 */ o.writeShort(this._direction); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception +/* */ { +/* 97 */ NetworkObject o = _serv.getObject(this._objID); +/* 98 */ if ((o instanceof Drone)) { +/* 99 */ assert (this._roomID != 0); +/* 100 */ Room newroom = null; +/* 101 */ NetworkRoom netroom = _serv.getNetworkRoom(this._roomID); +/* 102 */ if (netroom != null) { +/* 103 */ newroom = netroom.getRoom(); +/* */ } +/* */ +/* 106 */ this._direction = ((short)(90 - this._direction)); +/* */ +/* 108 */ this._direction = ((short)(360 - this._direction)); +/* */ +/* */ +/* 111 */ ((Drone)o).roomChange(newroom, this._x, this._y, this._z, this._direction); +/* */ } +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 118 */ return +/* 119 */ "ROOMCHNG " + this._objID.toString(serv) + " in " + this._roomID + " @ " + this._x + "," + this._y + "," + this._z + "," + this._direction; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\roomChangeCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/roomIDCmd.java b/NET/worlds/network/roomIDCmd.java new file mode 100644 index 0000000..b33b715 --- /dev/null +++ b/NET/worlds/network/roomIDCmd.java @@ -0,0 +1,76 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class roomIDCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte ROOMIDCMD = 21; +/* */ protected String _roomName; +/* */ protected int _roomNumber; +/* */ +/* */ public roomIDCmd() +/* */ { +/* 48 */ this._commandType = 21; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 53 */ this._roomName = data.readUTF(); +/* 54 */ this._roomNumber = data.readUnsignedShort(); +/* */ } +/* */ +/* */ +/* */ +/* */ void process(WorldServer serv) +/* */ throws Exception +/* */ { +/* 62 */ serv.regRoomID(this._roomNumber, this._roomName, false); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 68 */ return "ROOMID " + this._roomName + " <--> " + this._roomNumber; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\roomIDCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/roomIDReqCmd.java b/NET/worlds/network/roomIDReqCmd.java new file mode 100644 index 0000000..0744e47 --- /dev/null +++ b/NET/worlds/network/roomIDReqCmd.java @@ -0,0 +1,68 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class roomIDReqCmd +/* */ extends netPacket +/* */ { +/* */ public static final byte ROOMIDREQCMD = 20; +/* */ protected String _roomName; +/* */ +/* */ public roomIDReqCmd(String name) +/* */ { +/* 42 */ super(null, 20); +/* 43 */ this._roomName = name; +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 48 */ return ServerOutputStream.utfLength(this._roomName) + 1 + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 53 */ super.send(o); +/* 54 */ o.writeUTF(this._roomName); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 60 */ return "ROOMIDRQ " + this._roomName; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\roomIDReqCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/sessionExitCmd.java b/NET/worlds/network/sessionExitCmd.java new file mode 100644 index 0000000..edf4e69 --- /dev/null +++ b/NET/worlds/network/sessionExitCmd.java @@ -0,0 +1,76 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class sessionExitCmd +/* */ extends propCmd +/* */ { +/* */ public static final byte SESSIONEXITCMD = 7; +/* */ +/* */ public sessionExitCmd() +/* */ { +/* 42 */ this._commandType = 7; +/* */ } +/* */ +/* */ public sessionExitCmd(OldPropertyList propList) { +/* 46 */ this._commandType = 7; +/* 47 */ this._propList = propList; +/* */ } +/* */ +/* */ void process(WorldServer serv) throws Exception +/* */ { +/* 52 */ assert (serv.getState() == 16); +/* 53 */ netProperty _error = this._propList.elementAt(0); +/* */ try { +/* 55 */ int errorval = Integer.parseInt(_error.value()); +/* 56 */ if (errorval != 0) +/* 57 */ throw new VarErrorException(errorval); +/* */ } catch (NumberFormatException e) { +/* 59 */ System.err.println("appInitCmd: couldn't parse VAR_ERROR = " + +/* 60 */ _error.value()); +/* */ +/* 62 */ serv.setState(17); +/* */ } +/* */ } +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 68 */ return "SESSEXIT " + this._propList; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\sessionExitCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/sessionInitCmd.java b/NET/worlds/network/sessionInitCmd.java new file mode 100644 index 0000000..1bdaeab --- /dev/null +++ b/NET/worlds/network/sessionInitCmd.java @@ -0,0 +1,199 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import java.io.PrintStream; +/* */ import java.util.Enumeration; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class sessionInitCmd +/* */ extends propCmd +/* */ { +/* */ public static final byte SESSIONINITCMD = 6; +/* */ +/* */ public sessionInitCmd() +/* */ { +/* 75 */ this._commandType = 6; +/* */ } +/* */ +/* */ +/* */ public sessionInitCmd(String user, String pass, String proto, String avatars, String ver) +/* */ { +/* 81 */ this._commandType = 6; +/* */ +/* 83 */ assert (user != null); +/* 84 */ this._propList.addProperty(new netProperty(2, user)); +/* 85 */ if (pass != null) +/* 86 */ this._propList.addProperty(new netProperty(6, pass)); +/* 87 */ this._propList.addProperty(new netProperty(3, proto)); +/* 88 */ this._propList.addProperty(new netProperty(7, avatars)); +/* 89 */ this._propList.addProperty(new netProperty(9, ver)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public sessionInitCmd(OldPropertyList props) +/* */ { +/* 99 */ this._commandType = 6; +/* 100 */ this._propList = props; +/* */ } +/* */ +/* */ void process(WorldServer serv) throws Exception +/* */ { +/* 105 */ if (serv.getState() != 8) { +/* 106 */ return; +/* */ } +/* */ +/* 109 */ for (int i = 0; i < this._propList.size(); i++) { +/* 110 */ netProperty tmpProp = this._propList.elementAt(i); +/* 111 */ switch (tmpProp.property()) { +/* */ case 4: +/* */ try { +/* 114 */ int errorval = Integer.parseInt(tmpProp.value()); +/* 115 */ if (errorval != 0) +/* 116 */ throw new VarErrorException(errorval); +/* */ } catch (NumberFormatException e) { +/* 118 */ System.err.println("sessionInitCmd: couldn't parse VAR_ERROR = " + +/* 119 */ tmpProp.value()); +/* */ } +/* */ +/* */ case 1: +/* */ case 3: +/* */ case 13: +/* */ case 15: +/* */ break; +/* */ +/* */ case 8: +/* */ break; +/* */ +/* */ case 10: +/* 132 */ serv.getGalaxy().setSerialNum(tmpProp.value()); +/* 133 */ break; +/* */ case 2: +/* 135 */ serv.setUsername(tmpProp.value()); +/* */ +/* */ +/* */ +/* */ +/* 140 */ serv.getGalaxy().setNewChatname(null); +/* 141 */ break; +/* */ case 6: +/* 143 */ serv.getGalaxy().setPassword(tmpProp.value()); +/* */ +/* 145 */ serv.getGalaxy().setNewPassword(null); +/* 146 */ break; +/* */ +/* */ case 5: +/* 149 */ serv.getGalaxy().setChannel(tmpProp.value()); +/* 150 */ break; +/* */ case 22: +/* */ try { +/* 153 */ int priv = Integer.parseInt(tmpProp.value()); +/* */ +/* */ +/* */ +/* 157 */ Enumeration<NetworkObject> list = serv.getGalaxy().getConsoles(); +/* 158 */ while (list.hasMoreElements()) { +/* 159 */ Console c = (Console)list.nextElement(); +/* 160 */ c.setVIP((priv & 0x8) != 0); +/* 161 */ c.setFullVIP((priv & 0x10) != 0); +/* 162 */ c.setSpecialGuest((priv & 0x40) != 0); +/* */ } +/* */ +/* 165 */ list = serv.getGalaxy().getConsoles(); +/* 166 */ while (list.hasMoreElements()) { +/* 167 */ Console c = (Console)list.nextElement(); +/* 168 */ c.enableBroadcast((priv & 0x2) != 0); +/* */ } +/* */ } catch (NumberFormatException localNumberFormatException1) {} +/* */ case 7: case 9: case 11: case 12: +/* */ case 14: case 16: case 17: case 18: +/* */ case 19: case 20: case 21: default: +/* 174 */ System.out.println("sessionInitCmd: received unknown property: " + +/* 175 */ tmpProp.property()); +/* 176 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ break; +/* */ } +/* */ +/* */ } +/* 182 */ if (serv.getVersion() < 18) { +/* 183 */ serv.setState(9); +/* */ } else { +/* 185 */ serv.setState(11); +/* */ } +/* */ } +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 191 */ return "SESSINIT " + this._propList; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\sessionInitCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/shortLocCmd.java b/NET/worlds/network/shortLocCmd.java new file mode 100644 index 0000000..5f1eee8 --- /dev/null +++ b/NET/worlds/network/shortLocCmd.java @@ -0,0 +1,90 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.scape.Drone; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class shortLocCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte SHORTLOCCMD = 4; +/* */ protected byte _dx; +/* */ protected byte _dy; +/* */ protected byte _ddirection; +/* */ +/* */ public shortLocCmd() +/* */ { +/* 47 */ this._commandType = 4; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 52 */ this._dx = data.readByte(); +/* 53 */ this._dy = data.readByte(); +/* 54 */ this._ddirection = data.readByte(); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception +/* */ { +/* 59 */ NetworkObject o = _serv.getObject(this._objID); +/* 60 */ if (o == null) +/* */ { +/* 62 */ System.out.println("Unknown short id: " + toString(_serv)); +/* 63 */ new Exception().printStackTrace(System.out); +/* 64 */ return; +/* */ } +/* */ +/* 67 */ if ((o instanceof Drone)) { +/* 68 */ ((Drone)o).shortLoc(this._dx, this._dy, this._ddirection); +/* */ } +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 75 */ return +/* 76 */ "SHORTLOC " + this._objID.toString(serv) + " delta=" + this._dx + "," + this._dy + "," + this._ddirection; +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 81 */ return +/* 82 */ "SHORTLOC " + this._objID + " delta=" + this._dx + "," + this._dy + "," + this._ddirection; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\shortLocCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/teleportCmd.java b/NET/worlds/network/teleportCmd.java new file mode 100644 index 0000000..d6fec64 --- /dev/null +++ b/NET/worlds/network/teleportCmd.java @@ -0,0 +1,147 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.scape.Drone; +/* */ import NET.worlds.scape.Room; +/* */ import java.io.IOException; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class teleportCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte TELEPORTCMD = 18; +/* */ protected int _roomID; +/* */ protected byte _exittype; +/* */ protected byte _entrytype; +/* */ protected short _x; +/* */ protected short _y; +/* */ protected short _z; +/* */ protected short _direction; +/* */ +/* */ public teleportCmd() +/* */ { +/* 64 */ this._commandType = 18; +/* */ } +/* */ +/* */ public teleportCmd(Room room, byte exittype, byte entrytype, short x, short y, short z, short direction) +/* */ { +/* 69 */ super(null, 18); +/* 70 */ this._roomID = 0; +/* 71 */ if (room != null) { +/* 72 */ this._roomID = room.getNetworkRoom().getRoomID(); +/* */ } +/* 74 */ this._exittype = exittype; +/* 75 */ this._entrytype = entrytype; +/* 76 */ this._x = x; +/* 77 */ this._y = y; +/* 78 */ this._z = z; +/* 79 */ this._direction = direction; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 84 */ this._roomID = data.readUnsignedShort(); +/* 85 */ this._exittype = data.readByte(); +/* 86 */ this._entrytype = data.readByte(); +/* 87 */ this._x = data.readShort(); +/* 88 */ this._y = data.readShort(); +/* 89 */ this._z = data.readShort(); +/* 90 */ this._direction = data.readShort(); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception +/* */ { +/* 95 */ NetworkObject o = _serv.getObject(this._objID); +/* 96 */ if (o == null) { +/* 97 */ o = Drone.make(this._objID, _serv); +/* */ } +/* */ +/* 100 */ NetworkRoom netroom = _serv.getNetworkRoom(this._roomID); +/* 101 */ Room newroom = null; +/* 102 */ if (netroom != null) { +/* 103 */ newroom = netroom.getRoom(); +/* */ } +/* */ +/* */ +/* 107 */ this._direction = ((short)(90 - this._direction)); +/* */ +/* 109 */ this._direction = ((short)(360 - this._direction)); +/* 110 */ if ((o instanceof Drone)) { +/* 111 */ ((Drone)o).teleport(_serv, this._exittype, this._entrytype, newroom, this._x, this._y, +/* 112 */ this._z, this._direction); +/* */ } +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 118 */ return 12 + super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 123 */ super.send(o); +/* */ +/* 125 */ o.writeShort(this._roomID); +/* 126 */ o.writeByte(this._exittype); +/* 127 */ o.writeByte(this._entrytype); +/* 128 */ o.writeShort(this._x); +/* 129 */ o.writeShort(this._y); +/* 130 */ o.writeShort(this._z); +/* 131 */ o.writeShort(this._direction); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 137 */ return +/* */ +/* 139 */ "TELEPORT " + this._objID.toString(serv) + " <" + this._exittype + " >" + this._entrytype + " in " + this._roomID + " @ " + this._x + "," + this._y + "," + this._z + "," + this._direction; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\teleportCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/textCmd.java b/NET/worlds/network/textCmd.java new file mode 100644 index 0000000..531bf78 --- /dev/null +++ b/NET/worlds/network/textCmd.java @@ -0,0 +1,233 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.BBChatCommand; +/* */ import NET.worlds.console.BlackBox; +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.GammaTextArea; +/* */ import NET.worlds.console.MuteListPart; +/* */ import NET.worlds.core.IniFile; +/* */ import NET.worlds.scape.Drone; +/* */ import NET.worlds.scape.Pilot; +/* */ import NET.worlds.scape.PosableDrone; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class textCmd +/* */ extends receivedNetPacket +/* */ { +/* */ public static final byte TEXTCMD = 14; +/* */ protected ObjID _senderID; +/* */ protected String _text; +/* */ +/* */ public textCmd() +/* */ { +/* 79 */ this._commandType = 14; +/* */ } +/* */ +/* */ public textCmd(String text) { +/* 83 */ super(null, 14); +/* */ +/* 85 */ this._senderID = new ObjID(""); +/* 86 */ this._text = text; +/* */ } +/* */ +/* */ void parseNetData(ServerInputStream data) throws IOException +/* */ { +/* 91 */ this._senderID = new ObjID(); +/* 92 */ this._senderID.parseNetData(data); +/* 93 */ this._text = data.readUTF(); +/* */ } +/* */ +/* */ int packetSize() +/* */ { +/* 98 */ return ServerOutputStream.utfLength(this._text) + 1 + this._senderID.packetSize() + +/* 99 */ super.packetSize(); +/* */ } +/* */ +/* */ void send(ServerOutputStream o) throws IOException +/* */ { +/* 104 */ super.send(o); +/* 105 */ this._senderID.send(o); +/* 106 */ o.writeUTF(this._text); +/* */ } +/* */ +/* */ void process(WorldServer _serv) throws Exception { +/* */ String name; +/* */ String name; +/* 112 */ if (this._senderID.longID() == null) { +/* 113 */ name = +/* 114 */ "[Unknown Name (#" + String.valueOf(this._senderID.shortID()) + ")]"; +/* */ } else { +/* 116 */ name = this._senderID.longID(); +/* 117 */ if (MuteListPart.isMuted(_serv, name)) { +/* 118 */ return; +/* */ } +/* */ } +/* 121 */ handleActionText(_serv, this._text, name, this._senderID); +/* */ +/* 123 */ if (!this._text.startsWith("&|+")) { +/* 124 */ displayText(name, this._text); +/* */ } +/* */ } +/* */ +/* */ protected void displayText(String name, String text) { +/* 129 */ String filteredName = FilthFilter.get().filterName(name); +/* 130 */ String line = ""; +/* */ +/* 132 */ if (IniFile.gamma().getIniInt("classicChatBox", 1) == 1) { +/* 133 */ line = filteredName + "> "; +/* 134 */ line = line + FilthFilter.get().filter(text); +/* 135 */ BlackBox.getInstance().submitEvent(new BBChatCommand(line)); +/* 136 */ Console.println(line); +/* 137 */ return; +/* */ } +/* */ +/* */ +/* 141 */ boolean colored = false; +/* */ +/* 143 */ if (Drone.isEmployeeAccount(name)) { +/* 144 */ line = GammaTextArea.colorStartBlueTag + " "; +/* 145 */ colored = true; +/* 146 */ } else if (name.toLowerCase().startsWith(Console.message("host"))) { +/* 147 */ line = GammaTextArea.colorStartRedTag + " "; +/* 148 */ colored = true; +/* 149 */ } else if (name.toLowerCase().startsWith(Console.message("guest-"))) { +/* 150 */ line = GammaTextArea.colorStartMagentaTag + " "; +/* 151 */ colored = true; +/* */ } +/* */ +/* */ +/* 155 */ line = line + "<b> " + filteredName + "> </b> "; +/* */ +/* 157 */ if (colored) { +/* 158 */ line = line + " " + GammaTextArea.colorEndTag + " "; +/* */ } +/* */ +/* 161 */ line = line + FilthFilter.get().filter(text); +/* */ +/* 163 */ BlackBox.getInstance().submitEvent(new BBChatCommand(line)); +/* */ +/* 165 */ Console.println(line); +/* */ } +/* */ +/* */ +/* */ public static void handleActionText(WorldServer _serv, String msg, String name, ObjID senderID) +/* */ { +/* 171 */ if (msg.startsWith("&|+action>")) { +/* 172 */ NetworkObject o = _serv.getObject(senderID); +/* 173 */ if (o == null) +/* */ { +/* 175 */ return; +/* */ } +/* */ +/* 178 */ String act = msg.substring(10); +/* */ +/* 180 */ if (!(o instanceof PosableDrone)) { +/* 181 */ return; +/* */ } +/* */ +/* 184 */ ((PosableDrone)o).animate(act); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 190 */ if (msg.startsWith("&|+action2>")) +/* */ { +/* */ +/* */ +/* */ +/* 195 */ int idx = msg.indexOf("|sender|"); +/* 196 */ String senderAction = null; +/* 197 */ String receiverAction = null; +/* 198 */ if (idx != -1) { +/* 199 */ senderAction = msg.substring(idx); +/* 200 */ receiverAction = msg.substring(11, idx); +/* */ +/* 202 */ NetworkObject o = _serv.getObject(senderID); +/* 203 */ if ((o != null) && +/* 204 */ ((o instanceof PosableDrone))) { +/* 205 */ ((PosableDrone)o).animate(senderAction); +/* 206 */ Pilot.sendText("&|+action>" + senderAction); +/* */ } +/* */ } +/* */ else { +/* 210 */ receiverAction = msg.substring(11); +/* */ } +/* */ try +/* */ { +/* 214 */ Console.getActive().getPilot().animate(receiverAction); +/* */ } +/* */ catch (Exception e) { +/* 217 */ System.out.println("Error animating pilot " + e.toString()); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 225 */ return "TEXT " + this._senderID.toString(serv) + ": " + this._text; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\textCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file diff --git a/NET/worlds/network/whisperCmd.java b/NET/worlds/network/whisperCmd.java new file mode 100644 index 0000000..20fe839 --- /dev/null +++ b/NET/worlds/network/whisperCmd.java @@ -0,0 +1,125 @@ +/* */ package NET.worlds.network; +/* */ +/* */ import NET.worlds.console.Console; +/* */ import NET.worlds.console.FriendsListPart; +/* */ import NET.worlds.console.MuteListPart; +/* */ import NET.worlds.scape.WorldScriptManager; +/* */ import java.text.MessageFormat; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class whisperCmd +/* */ extends textCmd +/* */ { +/* */ public static final byte WHISPERCMD = 17; +/* */ +/* */ public whisperCmd() +/* */ { +/* 58 */ this._commandType = 17; +/* */ } +/* */ +/* */ public whisperCmd(String who, String text) { +/* 62 */ super(text); +/* */ +/* 64 */ WorldScriptManager.getInstance().onConversation(who, text); +/* */ +/* 66 */ this._commandType = 17; +/* 67 */ this._objID = new ObjID(who); +/* */ } +/* */ +/* 70 */ private static String rejectMsg = Console.message("not-whispers"); +/* */ +/* */ void process(WorldServer _serv) throws Exception +/* */ { +/* */ String name; +/* */ String name; +/* 76 */ if (this._senderID.longID() == null) { +/* 77 */ Object[] arguments = { new String(String.valueOf(this._senderID +/* 78 */ .shortID())) }; +/* 79 */ name = MessageFormat.format(Console.message("Unknown-Name"), +/* 80 */ arguments); +/* */ } else { +/* 82 */ name = this._senderID.longID(); +/* 83 */ if (MuteListPart.isMuted(_serv, name)) { +/* */ try { +/* 85 */ _serv.sendNetworkMsg(new whisperCmd(name, +/* 86 */ Console.message("have-you-muted"))); +/* */ } +/* */ catch (InfiniteWaitException localInfiniteWaitException) {}catch (PacketTooLargeException localPacketTooLargeException) {} +/* */ +/* 90 */ return; +/* */ } +/* 92 */ if ((!this._text.startsWith("&|+")) && (MuteListPart.isRejecting(_serv))) { +/* */ try { +/* 94 */ if (!this._text.equals(rejectMsg)) { +/* 95 */ Object[] arguments = { new String(name) }; +/* 96 */ Console.println(MessageFormat.format( +/* 97 */ Console.message("You-rejected"), arguments)); +/* 98 */ _serv.sendNetworkMsg(new whisperCmd(name, rejectMsg)); +/* */ } +/* */ } +/* */ catch (InfiniteWaitException localInfiniteWaitException1) {}catch (PacketTooLargeException localPacketTooLargeException1) {} +/* */ +/* 103 */ return; +/* */ } +/* */ } +/* */ +/* 107 */ FriendsListPart.processWhisper(_serv, name, this._text); +/* 108 */ handleActionText(_serv, this._text, name, this._senderID); +/* */ +/* 110 */ Console.printWhisper(name, FilthFilter.get().filter(this._text)); +/* */ } +/* */ +/* */ +/* */ public String toString(WorldServer serv) +/* */ { +/* 116 */ return +/* 117 */ Console.message("WHISPER") + " " + this._senderID.toString(serv) + " --> " + this._objID.toString(serv) + ": " + this._text; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\whisperCmd.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |