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/NetUpdate.java | |
| download | worlds.jar-main.tar.xz worlds.jar-main.zip | |
Diffstat (limited to 'NET/worlds/network/NetUpdate.java')
| -rw-r--r-- | NET/worlds/network/NetUpdate.java | 1788 |
1 files changed, 1788 insertions, 0 deletions
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 |