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/console/Console.java | |
| download | worlds.jar-main.tar.xz worlds.jar-main.zip | |
Diffstat (limited to 'NET/worlds/console/Console.java')
| -rw-r--r-- | NET/worlds/console/Console.java | 3897 |
1 files changed, 3897 insertions, 0 deletions
diff --git a/NET/worlds/console/Console.java b/NET/worlds/console/Console.java new file mode 100644 index 0000000..d6b0b5e --- /dev/null +++ b/NET/worlds/console/Console.java @@ -0,0 +1,3897 @@ +/* */ package NET.worlds.console; +/* */ +/* */ import NET.worlds.core.IniFile; +/* */ import NET.worlds.core.Std; +/* */ import NET.worlds.network.ConnectionWaiter; +/* */ import NET.worlds.network.DNSLookup; +/* */ import NET.worlds.network.Galaxy; +/* */ import NET.worlds.network.InfiniteWaitException; +/* */ import NET.worlds.network.InvalidServerURLException; +/* */ import NET.worlds.network.NetworkObject; +/* */ import NET.worlds.network.OldPropertyList; +/* */ import NET.worlds.network.PacketTooLargeException; +/* */ import NET.worlds.network.PropertyList; +/* */ import NET.worlds.network.PropertySetCmd; +/* */ import NET.worlds.network.VarErrorException; +/* */ import NET.worlds.network.WorldServer; +/* */ import NET.worlds.network.net2Property; +/* */ import NET.worlds.scape.Attribute; +/* */ import NET.worlds.scape.BooleanPropertyEditor; +/* */ import NET.worlds.scape.Drone; +/* */ import NET.worlds.scape.FrameEvent; +/* */ import NET.worlds.scape.FrameHandler; +/* */ import NET.worlds.scape.HoloDrone; +/* */ import NET.worlds.scape.HoloPilot; +/* */ import NET.worlds.scape.InventoryManager; +/* */ import NET.worlds.scape.LoadedURLSelf; +/* */ import NET.worlds.scape.NoSuchPropertyException; +/* */ import NET.worlds.scape.Pilot; +/* */ import NET.worlds.scape.ProgressiveAdder; +/* */ import NET.worlds.scape.PropAdder; +/* */ import NET.worlds.scape.Property; +/* */ import NET.worlds.scape.Restorer; +/* */ import NET.worlds.scape.Room; +/* */ import NET.worlds.scape.Saver; +/* */ import NET.worlds.scape.Sharer; +/* */ import NET.worlds.scape.StringPropertyEditor; +/* */ import NET.worlds.scape.SuperRoot; +/* */ import NET.worlds.scape.TeleportStatus; +/* */ import NET.worlds.scape.TooNewException; +/* */ import NET.worlds.scape.URLPropertyEditor; +/* */ import NET.worlds.scape.URLSelf; +/* */ import NET.worlds.scape.URLSelfLoader; +/* */ import NET.worlds.scape.VectorProperty; +/* */ import NET.worlds.scape.WObject; +/* */ import NET.worlds.scape.WobLoaded; +/* */ import NET.worlds.scape.WobLoader; +/* */ import NET.worlds.scape.World; +/* */ import java.awt.CardLayout; +/* */ import java.awt.CheckboxMenuItem; +/* */ import java.awt.Container; +/* */ import java.awt.Event; +/* */ import java.awt.Font; +/* */ import java.awt.Menu; +/* */ import java.awt.MenuBar; +/* */ import java.awt.MenuItem; +/* */ import java.awt.MenuShortcut; +/* */ import java.awt.Panel; +/* */ import java.awt.PopupMenu; +/* */ import java.io.File; +/* */ import java.io.IOException; +/* */ import java.io.PrintStream; +/* */ import java.net.HttpURLConnection; +/* */ import java.net.MalformedURLException; +/* */ import java.net.URLConnection; +/* */ import java.text.MessageFormat; +/* */ import java.util.Enumeration; +/* */ import java.util.Hashtable; +/* */ import java.util.Locale; +/* */ import java.util.MissingResourceException; +/* */ import java.util.ResourceBundle; +/* */ import java.util.Vector; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public abstract class Console +/* */ extends SuperRoot +/* */ implements URLSelf, MainCallback, NetworkObject, WobLoaded, DialogDisabled, ConnectionWaiter +/* */ { +/* */ private static Vector<String> storedLines; +/* */ +/* */ public static synchronized void println(String msg) +/* */ { +/* 269 */ if (active != null) { +/* 270 */ active.printLine(msg); +/* */ } else { +/* 272 */ storedLines.addElement(msg); +/* */ } +/* */ } +/* */ +/* */ public static void printWhisper(String from, String msg) +/* */ { +/* 278 */ if (active != null) { +/* 279 */ active.printWhisperFrom(from, msg); +/* */ } +/* */ } +/* */ +/* */ +/* */ public static void printOwnWhisper(String to, String msg) +/* */ { +/* 286 */ if (active != null) { +/* 287 */ active.printWhisperTo(to, msg); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ public static void startWhispering(String to) +/* */ { +/* 295 */ if (active != null) { +/* 296 */ active.startWhisperingTo(to); +/* */ } +/* */ } +/* */ +/* */ public static synchronized String message(String Id) +/* */ { +/* 302 */ Locale currentLocale = Locale.getDefault(); +/* */ try +/* */ { +/* 305 */ String bundlePrefix = IniFile.override().getIniString( +/* 306 */ "BundlePrefix", "MessagesBundle"); +/* */ +/* 308 */ ResourceBundle messages = ResourceBundle.getBundle(bundlePrefix, +/* 309 */ currentLocale); +/* */ +/* 311 */ String mess = messages.getString(Id); +/* */ +/* 313 */ if ((mess.indexOf('{') == -1) && (mess.indexOf('}') == -1)) { +/* 314 */ mess = Std.replaceStr(mess, "''", "'"); +/* */ } +/* */ +/* 317 */ if ((mess.lastIndexOf(".gif") > 0) || (mess.lastIndexOf(".jpg") > 0) || +/* 318 */ (mess.lastIndexOf(".bmp") > 0)) { +/* 319 */ File f = new File(mess); +/* 320 */ if (!f.exists()) { +/* 321 */ return Id; +/* */ } +/* */ } +/* 324 */ return mess; +/* */ } +/* */ catch (MissingResourceException e) { +/* 327 */ if (Galaxy.getDebugLevel() != 0) { +/* 328 */ System.out.println("MRE: " + e.getClassName() + " " + +/* 329 */ e.getKey()); +/* 330 */ System.out.println("NO MESSAGE for " + Id); +/* */ } +/* */ } +/* 333 */ return Id; +/* */ } +/* */ +/* */ +/* */ +/* */ public static synchronized String parseUnicode(String s) +/* */ { +/* 340 */ if (s == null) { +/* 341 */ return s; +/* */ } +/* */ int idx; +/* 344 */ while ((idx = s.indexOf("\\u")) != -1) { int idx; +/* 345 */ if (idx >= s.length() - 5) +/* 346 */ return s; +/* 347 */ String x = s.substring(idx + 2, idx + 6); +/* 348 */ char p = (char)Integer.parseInt(x, 16); +/* 349 */ String tmp = s.substring(0, idx) + p + s.substring(idx + 6); +/* 350 */ s = tmp; +/* */ } +/* */ +/* 353 */ return s; +/* */ } +/* */ +/* */ public static synchronized Vector<String> parseUnicode(Vector<String> cc) { +/* 357 */ for (int i = 0; i < cc.size(); i++) { +/* 358 */ String s = (String)cc.elementAt(i); +/* */ +/* 360 */ String s2 = parseUnicode(s); +/* */ +/* */ +/* 363 */ cc.setElementAt(s2, i); +/* */ } +/* 365 */ return cc; +/* */ } +/* */ +/* */ +/* */ public static synchronized String parseExtended(String s) +/* */ { +/* 371 */ String uc = ""; +/* 372 */ for (int i = 0; i < s.length(); i++) { +/* 373 */ char c = s.charAt(i); +/* 374 */ if (c > 'ΓΏ') { +/* 375 */ int ii = c; +/* */ try { +/* 377 */ uc = uc + "\\u" + Integer.toHexString(ii); +/* */ } catch (NumberFormatException e) { +/* 379 */ uc = uc + "?"; +/* */ } +/* */ } +/* */ else { +/* 383 */ uc = uc + c; +/* */ } } +/* 385 */ return uc; +/* */ } +/* */ +/* */ public static boolean wasHttpNoSuchFile(String us) { +/* 389 */ java.net.URL u = null; +/* 390 */ URLConnection uc = null; +/* */ try { +/* 392 */ u = DNSLookup.lookup(new java.net.URL(us)); +/* 393 */ uc = u.openConnection(); +/* */ } catch (Exception ex) { +/* 395 */ return true; +/* */ } +/* */ try { +/* 398 */ if (((HttpURLConnection)uc).getResponseCode() == 404) { +/* 399 */ return true; +/* */ } +/* */ } catch (Exception ex) { +/* 402 */ return true; +/* */ } +/* 404 */ return false; +/* */ } +/* */ +/* */ protected void printWhisperFrom(String from, String msg) +/* */ { +/* 409 */ if (!msg.startsWith("&|+")) { +/* 410 */ Object[] arguments = { new String(from), new String(msg) }; +/* 411 */ println(MessageFormat.format(message("whispered"), +/* 412 */ arguments)); +/* */ } +/* */ } +/* */ +/* */ protected void printWhisperTo(String to, String msg) +/* */ { +/* 418 */ if (!msg.startsWith("&|+")) { +/* 419 */ Object[] arguments = { new String(to), new String(msg) }; +/* 420 */ println(MessageFormat.format(message("You-whispered"), +/* 421 */ arguments)); +/* */ } +/* */ } +/* */ +/* */ protected void startWhisperingTo(String to) +/* */ { +/* 427 */ Object[] arguments = { new String(to) }; +/* 428 */ println(MessageFormat.format(message("You-want-whisp"), +/* 429 */ arguments)); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void printLine(String msg) +/* */ { +/* 437 */ System.out.println(msg); +/* */ } +/* */ +/* 440 */ protected boolean disableShaperAccess = false; +/* */ +/* */ public boolean isShaperAccessDisabled() { +/* 443 */ return this.disableShaperAccess; +/* */ } +/* */ +/* 446 */ protected boolean disableSingleUserAccess = false; +/* */ private static Console active; +/* */ +/* 449 */ public boolean isSingleUserAccessDisabled() { return this.disableSingleUserAccess; } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static Console getActive() +/* */ { +/* 458 */ return active; +/* */ } +/* */ +/* */ +/* */ +/* */ private Panel myCard; +/* */ +/* */ +/* */ private static int nameCounter; +/* */ +/* */ +/* */ private static Font font; +/* */ +/* */ +/* */ private NET.worlds.network.URL targetAv; +/* */ +/* */ private static String activeTeleportURL; +/* */ +/* */ private static String lastTeleportURL; +/* */ +/* */ private static FrameEvent frameEvent; +/* */ +/* */ private static int freezeFrameEvents; +/* */ +/* */ public void forPilotOnlyActivate() +/* */ { +/* 484 */ if (active == this) { +/* 485 */ return; +/* */ } +/* */ +/* 488 */ this.myCard = new Panel(); +/* 489 */ String myCardName = nameCounter++; +/* */ +/* 491 */ Container consoleTile = frame.getConsoleTile(); +/* 492 */ consoleTile.add(myCardName, this.myCard); +/* */ +/* */ +/* 495 */ Console prev = active; +/* 496 */ activate(this.myCard); +/* 497 */ ((CardLayout)consoleTile.getLayout()).show(consoleTile, myCardName); +/* 498 */ getFrame().validate(); +/* */ +/* */ +/* 501 */ if (prev != null) { +/* 502 */ consoleTile.remove(prev.myCard); +/* 503 */ prev.myCard.removeAll(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ protected void setEnableMenu(boolean enable) +/* */ { +/* 511 */ this.enableMenu = enable; +/* 512 */ if (this == active) +/* */ { +/* */ +/* 515 */ enable |= Gamma.shaper != null; +/* 516 */ boolean enabled = (frame.getMenuBar() == menuBar) && (menuBar != null); +/* 517 */ if (enable != enabled) { +/* 518 */ frame.setMenuBar(enable ? menuBar : null); +/* */ +/* */ +/* */ +/* 522 */ frame.pack(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ private static synchronized void setActive(Console active) +/* */ { +/* 533 */ active = active; +/* */ +/* 535 */ int sz = storedLines.size(); +/* 536 */ if (sz > 0) { +/* 537 */ for (int i = 0; i < sz; i++) { +/* 538 */ active.printLine((String)storedLines.elementAt(i)); +/* */ } +/* 540 */ storedLines.removeAllElements(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void activate(Container c) +/* */ { +/* 553 */ assert (this.pilot != null); +/* */ +/* 555 */ Console prev = active; +/* */ +/* */ +/* 558 */ if (active != null) { +/* 559 */ active.deactivate(); +/* */ } +/* 561 */ setActive(this); +/* */ +/* 563 */ Main.register(this); +/* */ +/* 565 */ this.menus.clear(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 593 */ menuBar = new MenuBar(); +/* */ +/* */ +/* 596 */ getMenu("File"); +/* */ +/* 598 */ if (Gamma.shaper != null) { +/* 599 */ Gamma.shaper.activate(this, c, prev); +/* */ } +/* 601 */ int len = this.parts.size(); +/* 602 */ for (int i = 0; i < len; i++) { +/* 603 */ ((FramePart)this.parts.elementAt(i)).activate(this, c, prev); +/* */ } +/* */ +/* 606 */ this.exitItem = addMenuItem(message("Exit"), "File"); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 614 */ if (activeTeleportURL != null) { +/* 615 */ teleportNotification("", activeTeleportURL); +/* */ } +/* 617 */ this.cursor.activate(); +/* */ } +/* */ +/* */ +/* */ protected void menuDone() +/* */ { +/* 623 */ setEnableMenu(this.enableMenu); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void deactivate() +/* */ { +/* 635 */ if (active != this) { +/* 636 */ return; +/* */ } +/* 638 */ setActive(null); +/* */ +/* 640 */ Main.unregister(this); +/* */ +/* 642 */ int len = this.parts.size(); +/* 643 */ for (int i = 0; i < len; i++) { +/* 644 */ ((FramePart)this.parts.elementAt(i)).deactivate(); +/* */ } +/* 646 */ if (Gamma.shaper != null) { +/* 647 */ Gamma.shaper.deactivate(); +/* */ } +/* 649 */ this.cursor.deactivate(); +/* */ +/* 651 */ frame.deactivate(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getActiveTeleportURL() +/* */ { +/* 663 */ return lastTeleportURL == null ? "" : lastTeleportURL; +/* */ } +/* */ +/* */ +/* */ +/* */ public static void teleportNotification(String err, String url) +/* */ { +/* 670 */ if ((err != null) && (err.length() == 0)) { +/* 671 */ activeTeleportURL = url; +/* 672 */ lastTeleportURL = url.toString(); +/* */ } +/* */ else { +/* 675 */ activeTeleportURL = null; +/* */ } +/* 677 */ if (active == null) { +/* 678 */ return; +/* */ } +/* 680 */ if ((active instanceof TeleportStatus)) { +/* 681 */ ((TeleportStatus)active).teleportStatus(err, url); +/* */ } +/* 683 */ int len = active.parts.size(); +/* 684 */ for (int i = 0; i < len; i++) { +/* 685 */ Object fp = active.parts.elementAt(i); +/* 686 */ if ((fp instanceof TeleportStatus)) { +/* 687 */ ((TeleportStatus)fp).teleportStatus(err, url); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static void setFreezeFrameEvents(boolean x) +/* */ { +/* 710 */ if (x) { +/* 711 */ freezeFrameEvents += 1; +/* */ } else { +/* 713 */ freezeFrameEvents -= 1; +/* 714 */ assert (freezeFrameEvents >= 0); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void mainCallback() +/* */ { +/* 725 */ if (frameEvent == null) { +/* 726 */ frameEvent = new FrameEvent(null, null); +/* */ } +/* */ +/* 729 */ if (freezeFrameEvents > 0) { +/* 730 */ return; +/* */ } +/* 732 */ frameEvent.newFrameTime(); +/* */ +/* 734 */ frameEvent.source = this; +/* */ +/* 736 */ generateFrameEvents(frameEvent); +/* */ +/* 738 */ frameEvent.target = null; +/* 739 */ frameEvent.receiver = null; +/* 740 */ frameEvent.source = null; +/* */ } +/* */ +/* 743 */ private String sleepMode = ""; +/* */ +/* */ +/* */ private int lastUserAction; +/* */ +/* */ +/* */ +/* */ public void generateFrameEvents(FrameEvent f) +/* */ { +/* 752 */ World.generateFrameEvents(f); +/* */ +/* 754 */ int now = Std.getFastTime(); +/* 755 */ if (Window.getAndResetUserActionCount() != 0) { +/* 756 */ setSleepMode(null); +/* 757 */ this.lastUserAction = now; +/* */ +/* */ } +/* 760 */ else if (now > this.lastUserAction + 300000) { +/* 761 */ if (this.lastUserAction == 0) { +/* 762 */ this.lastUserAction = now; +/* */ } else { +/* 764 */ goToSleep(); +/* */ } +/* */ } +/* */ +/* 768 */ int len = this.parts.size(); +/* 769 */ if (Main.profile != 0) { +/* 770 */ for (int i = 0; i < len; i++) { +/* 771 */ FramePart fp = (FramePart)this.parts.elementAt(i); +/* 772 */ int start = Std.getRealTime(); +/* 773 */ long startBytes = Runtime.getRuntime().freeMemory(); +/* 774 */ fp.handle(f); +/* 775 */ int dur = Std.getRealTime() - start; +/* 776 */ long used = startBytes - Runtime.getRuntime().freeMemory(); +/* 777 */ if (dur > Main.profile) +/* 778 */ System.out.println("Took " + dur + "ms and " + used + +/* 779 */ " bytes to call framePart " + fp); +/* */ } +/* */ } else { +/* 782 */ for (int i = 0; i < len; i++) +/* 783 */ ((FramePart)this.parts.elementAt(i)).handle(f); +/* */ } +/* 785 */ ProgressiveAdder.get().handle(f); +/* */ +/* 787 */ if ((this instanceof FrameHandler)) { +/* 788 */ ((FrameHandler)this).handle(f); +/* */ } +/* */ +/* */ +/* 792 */ if (this.pilot != null) { +/* 793 */ this.pilot.generateFrameEvents(f); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* 800 */ private Vector<FramePart> parts = new Vector(); +/* */ +/* */ private static MenuBar menuBar; +/* */ +/* */ public void addPart(FramePart p) +/* */ { +/* 806 */ this.parts.addElement(p); +/* */ } +/* */ +/* */ public Enumeration<FramePart> getParts() { +/* 810 */ return this.parts.elements(); +/* */ } +/* */ +/* */ +/* */ +/* */ public boolean action(Event event, Object what) +/* */ { +/* 817 */ if (event.target == this.exitItem) { +/* 818 */ return maybeQuit(); +/* */ } +/* 820 */ if ((Gamma.shaper != null) && (Gamma.shaper.action(event, what))) { +/* 821 */ return true; +/* */ } +/* 823 */ int len = this.parts.size(); +/* 824 */ for (int i = 0; i < len; i++) { +/* 825 */ if (((FramePart)this.parts.elementAt(i)).action(event, what)) +/* 826 */ return true; +/* */ } +/* 828 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ public boolean handleEvent(Event e) +/* */ { +/* 835 */ if (e.id == 201) +/* 836 */ return maybeQuit(); +/* 837 */ return false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public boolean okToQuit() +/* */ { +/* 845 */ return true; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public static void quit() +/* */ { +/* 853 */ if (Gamma.getShaper() != null) { +/* 854 */ Gamma.getShaper().maybeQuit(); +/* */ } else { +/* 856 */ GammaFrameState.saveBorder(); +/* 857 */ Main.end(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static boolean maybeQuit() +/* */ { +/* 867 */ Console c = getActive(); +/* 868 */ if ((c == null) || (c.okToQuit())) +/* 869 */ quit(); +/* 870 */ return true; +/* */ } +/* */ +/* */ +/* */ +/* */ public static MenuBar getMenuBar() +/* */ { +/* 877 */ return menuBar; +/* */ } +/* */ +/* 880 */ protected boolean enableMenu = false; +/* */ +/* */ protected MenuItem exitItem; +/* */ +/* 884 */ private Hashtable<String, Menu> menus = new Hashtable(); +/* */ protected static boolean autoFullVIP; +/* */ protected static boolean isRedLightWorld; +/* */ protected static int vip; +/* */ protected static int spguest; +/* */ +/* 890 */ public Menu getMenu(String name) { Menu menu = (Menu)this.menus.get(name); +/* 891 */ if (menu == null) { +/* 892 */ if ((name.equals("Help")) || (name.equals("Options")) || +/* 893 */ (name.equals("VIP"))) { +/* 894 */ menu = new PopupMenu(); +/* */ } else { +/* 896 */ menu = new Menu(name); +/* 897 */ menuBar.add(menu); +/* */ } +/* 899 */ this.menus.put(name, menu); +/* */ } +/* */ +/* 902 */ return menu; +/* */ } +/* */ +/* */ public void addMenuItem(MenuItem item, String menuName) { +/* 906 */ getMenu(menuName).add(item); +/* 907 */ item.setFont(font); +/* */ } +/* */ +/* */ public MenuItem addMenuItem(String itemName, String menuName) { +/* 911 */ MenuItem item = new MenuItem(itemName); +/* */ +/* 913 */ getMenu(menuName).add(item); +/* 914 */ item.setFont(font); +/* 915 */ return item; +/* */ } +/* */ +/* */ public MenuItem addMenuItem(String itemName, String menuName, int keyCode, boolean shiftKey) +/* */ { +/* 920 */ MenuItem item = new MenuItem(itemName); +/* 921 */ MenuShortcut shortcut = new MenuShortcut(keyCode, shiftKey); +/* */ +/* 923 */ item.setShortcut(shortcut); +/* 924 */ getMenu(menuName).add(item); +/* 925 */ item.setFont(font); +/* */ +/* 927 */ return item; +/* */ } +/* */ +/* */ public CheckboxMenuItem addMenuCheckbox(String itemName, String menuName) { +/* 931 */ CheckboxMenuItem item = new CheckboxMenuItem(itemName); +/* */ +/* 933 */ getMenu(menuName).add(item); +/* 934 */ item.setFont(font); +/* */ +/* 936 */ return item; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void dialogDisable(boolean disable) +/* */ { +/* 952 */ int len = this.parts.size(); +/* 953 */ for (int i = 0; i < len; i++) { +/* 954 */ FramePart part = (FramePart)this.parts.elementAt(i); +/* 955 */ if ((part instanceof DialogDisabled)) { +/* 956 */ ((DialogDisabled)part).dialogDisable(disable); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static String encode(String password) +/* */ { +/* 988 */ String coded = ""; +/* 989 */ if (password != null) { +/* 990 */ char[] cryptChars = encrypt(password).toCharArray(); +/* 991 */ for (int i = 0; i < cryptChars.length; i++) { +/* 992 */ String hex = Integer.toHexString(cryptChars[i]); +/* 993 */ if (hex.length() == 1) +/* 994 */ hex = "0" + hex; +/* 995 */ coded = coded + hex; +/* */ } +/* */ } +/* 998 */ return coded; +/* */ } +/* */ +/* */ public static String decode(String password) { +/* */ try { +/* 1003 */ int length = password.length(); +/* 1004 */ if ((length != 0) && ((length & 0x1) == 0)) { +/* 1005 */ char[] cryptChars = new char[length / 2]; +/* 1006 */ int j = 0; +/* 1007 */ for (int i = 0; i < cryptChars.length; j += 2) { +/* 1008 */ cryptChars[i] = ((char)Integer.parseInt( +/* 1009 */ password.substring(j, j + 2), 16));i++; +/* */ } +/* 1010 */ String ret = decrypt(new String(cryptChars)); +/* 1011 */ if ((ret != null) && (ret.length() != 0)) { +/* 1012 */ return ret; +/* */ } +/* */ } +/* */ } catch (NumberFormatException localNumberFormatException) {} +/* 1016 */ return null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public boolean getVIPAvatars() +/* */ { +/* 1037 */ return (vip > 0) || (isRedLightWorld); +/* */ } +/* */ +/* */ public boolean getVIP() { +/* 1041 */ return vip > 0; +/* */ } +/* */ +/* */ public void setVIP(boolean vip) { +/* 1045 */ vip = vip ? 1 : 0; +/* 1046 */ checkCourtesyVIP(); +/* 1047 */ IniFile.gamma().setIniInt("VIP", vip); +/* 1048 */ if ((autoFullVIP) && (vip)) +/* 1049 */ vip = 2; +/* */ } +/* */ +/* */ public boolean getFullVIP() { +/* 1053 */ return vip == 2; +/* */ } +/* */ +/* */ public void setFullVIP(boolean fullVIP) { +/* 1057 */ if (fullVIP) +/* 1058 */ vip = 2; +/* 1059 */ IniFile.gamma().setIniInt("VIP", vip); +/* */ } +/* */ +/* */ +/* */ +/* */ public boolean getSpecialGuest() +/* */ { +/* 1066 */ return spguest > 0; +/* */ } +/* */ +/* */ public void setSpecialGuest(boolean spguest) { +/* 1070 */ if (spguest > 1 != spguest) { +/* 1071 */ spguest = spguest ? 1 : 0; +/* */ +/* 1073 */ IniFile.gamma().setIniInt("SPGUEST", spguest); +/* 1074 */ spguest += spguest; +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void checkCourtesyVIP() +/* */ { +/* 1083 */ int oldVIP = vip; +/* */ +/* */ +/* 1086 */ if (vip < 1) { +/* 1087 */ World w = getPilot().getWorld(); +/* */ +/* 1089 */ vip = (w != null) && (w.isHomeWorld()) && (w.getCourtesyVIP()) ? 1 : 0; +/* */ } +/* */ +/* 1092 */ if (vip != oldVIP) { +/* 1093 */ if (vip == 1) { +/* 1094 */ println(message("You-VIP")); +/* */ } else { +/* 1096 */ println(message("You-no-VIP")); +/* */ } +/* */ } +/* 1099 */ NET.worlds.network.URL av = getDefaultAvatarURL(); +/* */ +/* 1101 */ if (!av.equals(getAvatarName())) +/* 1102 */ setAvatar(av); +/* */ } +/* */ +/* 1105 */ private boolean canBroadcast = false; +/* */ protected NET.worlds.network.URL lastPilotRequested; +/* */ +/* 1108 */ public boolean broadcastEnabled() { return this.canBroadcast; } +/* */ +/* */ public void enableBroadcast(boolean enabled) +/* */ { +/* 1112 */ this.canBroadcast = enabled; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void serverStatus(WorldServer serv, VarErrorException ve) +/* */ { +/* 1124 */ System.out.println("status-- " + serv + ": " + ve.getMsg()); +/* */ } +/* */ +/* */ +/* */ +/* */ public void property(OldPropertyList propList) +/* */ { +/* 1131 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void propertyUpdate(PropertyList propList) +/* */ { +/* 1146 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public WorldServer getServer() +/* */ { +/* 1159 */ NET.worlds.network.URL url = getGalaxyURL(); +/* */ +/* 1161 */ if ((url == null) || (this.galaxy == null)) { +/* 1162 */ return null; +/* */ } +/* */ try +/* */ { +/* 1166 */ return getGalaxy().getServer(url); +/* */ } catch (InvalidServerURLException e) { +/* 1168 */ println(">>" + e.getMessage()); } +/* 1169 */ return null; +/* */ } +/* */ +/* */ public WorldServer getServerNew() +/* */ { +/* 1174 */ NET.worlds.network.URL url = getGalaxyURL(); +/* */ +/* 1176 */ if ((url == null) || (this.galaxy == null)) { +/* 1177 */ return null; +/* */ } +/* */ try +/* */ { +/* 1181 */ return getGalaxy().getServer(url); +/* */ } catch (InvalidServerURLException e) { +/* 1183 */ println(">>" + e.getMessage()); } +/* 1184 */ return null; +/* */ } +/* */ +/* */ public String getLongID() +/* */ { +/* 1189 */ return this.galaxy.getChatname(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void galaxyDisconnected() +/* */ { +/* 1197 */ setChatname(""); +/* */ +/* 1199 */ this.galaxy.waitForConnection(this); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void changeChannel(Galaxy g, String oldChannel, String newChannel) +/* */ { +/* 1209 */ this.pilot.changeChannel(g, oldChannel, newChannel); +/* */ } +/* */ +/* */ protected void handleVAR_BITMAP(String s) +/* */ { +/* 1214 */ if (s.charAt(0) == 0) { +/* 1215 */ s = s.substring(2); +/* */ } +/* */ try +/* */ { +/* 1219 */ loadPilot(new NET.worlds.network.URL(NET.worlds.network.URL.getAvatar(), s)); +/* */ } catch (MalformedURLException e) { +/* 1221 */ loadPilot(NET.worlds.network.URL.make("error:\"" + s + '"')); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1235 */ public String pendingPilot = ""; +/* */ +/* 1237 */ protected boolean setFromMenu = false; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1244 */ private String postFix = ""; +/* */ +/* */ public static boolean selfCustom; +/* */ +/* */ protected void loadPilot(NET.worlds.network.URL url) +/* */ { +/* 1250 */ if (url.equals(this.lastPilotRequested)) { +/* 1251 */ return; +/* */ } +/* */ +/* 1254 */ this.lastPilotRequested = url; +/* 1255 */ this.pendingPilot = url.toString(); +/* 1256 */ Pilot.load(url, this); +/* 1257 */ this.setFromMenu = false; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1264 */ protected Vector<LoadedURLSelf> callbacks = new Vector(); +/* */ +/* */ +/* */ +/* */ +/* */ public void wobLoaded(WobLoader loader, SuperRoot w) +/* */ { +/* 1271 */ String err = null; +/* 1272 */ if (w == null) { +/* 1273 */ err = message("no-load-pilot"); +/* 1274 */ println(err + " " + loader.getWobName()); +/* 1275 */ } else if (!(w instanceof Pilot)) { +/* 1276 */ err = message("not-pilot"); +/* 1277 */ println(loader.getWobName().toString() + " " + err); +/* */ } else { +/* */ try { +/* 1280 */ setPilot((Pilot)w); +/* */ } catch (IllegalPilotException e) { +/* 1282 */ err = e.getMessage(); +/* */ } +/* */ } +/* */ +/* */ +/* 1287 */ if ((this.pilot == null) && (err != null) && (!this.disableSingleUserAccess)) { +/* 1288 */ useDefaultPilot(); +/* 1289 */ err = null; +/* */ } +/* */ +/* 1292 */ int end = this.callbacks.size(); +/* 1293 */ for (int i = 0; i < end; i++) { +/* 1294 */ LoadedURLSelf callback = (LoadedURLSelf)this.callbacks.elementAt(i); +/* 1295 */ if (err == null) { +/* 1296 */ callback.loadedURLSelf(this, getSourceURL(), null); +/* */ } else { +/* 1298 */ decRef(); +/* 1299 */ callback.loadedURLSelf(null, getSourceURL(), err); +/* */ } +/* */ } +/* 1302 */ this.callbacks.removeAllElements(); +/* */ } +/* */ +/* */ public static NET.worlds.network.URL getDefaultURL() +/* */ { +/* 1307 */ String defaultAvatar = IniFile.override().getIniString("DefaultAvatar", +/* 1308 */ "avatar:pengo.mov"); +/* 1309 */ return NET.worlds.network.URL.make(defaultAvatar); +/* */ } +/* */ +/* */ protected void useDefaultPilot() +/* */ { +/* */ try { +/* 1315 */ setPilot(new HoloPilot(getDefaultURL())); +/* */ } +/* */ catch (IllegalPilotException e) +/* */ { +/* 1319 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ public void connectionCallback(Object caller, boolean connected) +/* */ { +/* 1326 */ if ((caller instanceof Galaxy)) { +/* 1327 */ if (caller != this.galaxy) +/* 1328 */ return; +/* 1329 */ if (!connected) { +/* 1330 */ return; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1338 */ setAvatar(this.lastPilotRequested); +/* */ +/* 1340 */ displayAds(); +/* */ } +/* */ } +/* */ +/* */ +/* */ public void displayAds() +/* */ { +/* 1347 */ Pilot p = Pilot.getActive(); +/* 1348 */ if (p != null) { +/* 1349 */ World w = p.getWorld(); +/* 1350 */ if (w != null) { +/* 1351 */ w.setupAdBanner(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* 1357 */ private String defaultAction = ""; +/* */ +/* */ public void setDefaultAction(String newda) { +/* 1360 */ this.defaultAction = newda; +/* */ } +/* */ +/* */ public String getDefaultAction() { +/* 1364 */ return this.defaultAction; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1373 */ protected String tempCarAvatar = ""; +/* */ protected static String defaultConsole; +/* */ private static Hashtable<NET.worlds.network.URL, Console> defConsoles; +/* */ private static Console defaultUnshared; +/* */ +/* */ public NET.worlds.network.URL getDefaultAvatarURL() +/* */ { +/* 1380 */ String defAv = getDefaultURL().toString(); +/* 1381 */ String av = IniFile.gamma().getIniString("AVATAR", defAv); +/* 1382 */ String vav = IniFile.gamma().getIniString("VIPAVATAR", ""); +/* 1383 */ boolean isVIPAv = av.toLowerCase().endsWith(".rwg"); +/* 1384 */ if (vav.equals("")) { +/* 1385 */ vav = av; +/* 1386 */ if (isVIPAv) { +/* 1387 */ IniFile.gamma().setIniString("VIPAVATAR", vav); +/* */ } +/* */ } +/* 1390 */ if (this.tempCarAvatar != "") { +/* 1391 */ av = this.tempCarAvatar; +/* 1392 */ } else if (getVIPAvatars()) +/* */ { +/* */ +/* */ +/* 1396 */ av = vav; +/* 1397 */ } else if (isVIPAv) { +/* 1398 */ av = defAv; +/* */ } +/* 1400 */ return NET.worlds.network.URL.make(av); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public Console() +/* */ { +/* 1409 */ add(this.cursor); +/* 1410 */ this.galaxy = Galaxy.getAnonGalaxy(); +/* 1411 */ regWithGalaxy(); +/* 1412 */ setServerURL(null); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public Console(NET.worlds.network.URL serverURL) +/* */ { +/* 1420 */ add(this.cursor); +/* 1421 */ this.galaxy = Galaxy.getAnonGalaxy(); +/* 1422 */ regWithGalaxy(); +/* 1423 */ setServerURL(serverURL); +/* 1424 */ templateInit(); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void loadInit() +/* */ { +/* 1433 */ templateInit(); +/* 1434 */ add(this.cursor); +/* */ } +/* */ +/* */ public void addCursor(Cursor c) { +/* 1438 */ add(c); +/* */ } +/* */ +/* */ private void templateInit() { +/* 1442 */ this.pilotSoulTemplate = new HoloPilot(); +/* 1443 */ this.droneSoulTemplate = new HoloDrone(); +/* */ +/* 1445 */ add(this.pilotSoulTemplate); +/* 1446 */ add(this.droneSoulTemplate); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static void load(NET.worlds.network.URL url, LoadedURLSelf callback) +/* */ { +/* 1469 */ if ((url != null) && (url.endsWith(".console"))) { +/* 1470 */ new ConsoleLoader(url, callback); +/* */ } else { Console c; +/* */ Console c; +/* 1473 */ if (url == null) { +/* 1474 */ c = defaultUnshared; +/* */ } else { +/* 1476 */ c = (Console)defConsoles.get(url); +/* */ } +/* 1478 */ if ((c != null) && (c.galaxy == null)) +/* */ { +/* 1480 */ if (c.getGalaxyURL() == null) { +/* 1481 */ c.galaxy = Galaxy.getAnonGalaxy(); +/* */ } else { +/* */ try { +/* 1484 */ c.galaxy = Galaxy.getGalaxy(c.getGalaxyURL()); +/* */ } +/* */ catch (InvalidServerURLException e) { +/* 1487 */ System.out.println("Illegal ServerURL = " + +/* 1488 */ c.getGalaxyURL()); +/* */ +/* 1490 */ c.galaxy = Galaxy.getAnonGalaxy(); +/* */ +/* 1492 */ c.setServerURL(null); +/* */ } +/* */ } +/* 1495 */ c.regWithGalaxy(); +/* 1496 */ c.regPilot(); +/* */ } +/* 1498 */ assert ((c == null) || (c.galaxy != null)); +/* */ +/* 1500 */ if (c == null) { +/* */ try { +/* 1502 */ Class<?> cl = Class.forName(defaultConsole); +/* 1503 */ c = (Console)cl.newInstance(); +/* */ } catch (Exception e) { +/* 1505 */ System.out.println("Can't use class " + defaultConsole + +/* 1506 */ ", using DefaultConsole instead."); +/* 1507 */ e.printStackTrace(System.out); +/* 1508 */ c = new DefaultConsole(); +/* */ } +/* 1510 */ assert (c != null); +/* 1511 */ if (c.galaxy == null) +/* */ { +/* */ +/* 1514 */ c.galaxy = Galaxy.getAnonGalaxy(); +/* 1515 */ c.regWithGalaxy(); +/* 1516 */ c.regPilot(); +/* */ } +/* 1518 */ assert (c.galaxy != null); +/* 1519 */ c.loadInit(); +/* */ +/* 1521 */ c.setServerURL(url); +/* */ +/* 1523 */ if (url == null) { +/* 1524 */ c.setName("unshared"); +/* 1525 */ defaultUnshared = c; +/* */ } else { +/* 1527 */ defConsoles.put(c.getGalaxyURL(), c); +/* */ } +/* */ } +/* 1530 */ c.incRef(); +/* 1531 */ c.initPilot(url, callback); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ protected void initPilot(NET.worlds.network.URL pilotURL, LoadedURLSelf callback) +/* */ { +/* 1549 */ loadPilot(getDefaultAvatarURL()); +/* */ +/* */ +/* */ +/* 1553 */ if (this.pilot == null) { +/* 1554 */ useDefaultPilot(); +/* */ } +/* 1556 */ callback.loadedURLSelf(this, pilotURL, null); +/* */ } +/* */ +/* */ +/* */ +/* 1561 */ private int refcnt = 0; +/* */ protected Pilot pilotSoulTemplate; +/* */ +/* 1564 */ public void incRef() { this.refcnt += 1; } +/* */ +/* */ +/* */ protected Drone droneSoulTemplate; +/* */ +/* */ protected Pilot pilot; +/* */ public void decRef() +/* */ { +/* 1572 */ if (--this.refcnt == 0) +/* */ { +/* */ +/* 1575 */ if (this.galaxy != null) { +/* 1576 */ unregWithGalaxy(); +/* 1577 */ unregPilot(); +/* */ +/* */ +/* 1580 */ this.galaxy.decWorldCount(); +/* */ +/* 1582 */ Galaxy oldGalaxy = this.galaxy; +/* 1583 */ this.galaxy = null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1594 */ this.pilot = null; +/* */ +/* 1596 */ NET.worlds.network.URL url = getSourceURL(); +/* 1597 */ if (url != null) +/* 1598 */ if (url.endsWith(".console")) { +/* 1599 */ URLSelfLoader.unload(this); +/* */ } else +/* 1601 */ defConsoles.remove(url); +/* */ } +/* */ } +/* */ +/* */ public String toString() { +/* 1606 */ return super.toString() + "[" + getSourceURL() + "]"; +/* */ } +/* */ +/* */ +/* */ +/* */ public Pilot getPilotSoulTemplate() +/* */ { +/* 1613 */ return this.pilotSoulTemplate; +/* */ } +/* */ +/* */ public Drone getDroneSoulTemplate() { +/* 1617 */ return this.droneSoulTemplate; +/* */ } +/* */ +/* */ +/* */ +/* */ public Pilot getPilot() +/* */ { +/* 1624 */ return this.pilot; +/* */ } +/* */ +/* */ +/* 1628 */ public boolean targetValid = false; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public boolean isValidAv() +/* */ { +/* 1637 */ if (this.targetAv == null) { +/* 1638 */ return false; +/* */ } +/* 1640 */ if (!InventoryManager.getInventoryManager().inventoryInitialized()) { +/* 1641 */ return true; +/* */ } +/* 1643 */ String av = this.targetAv.getAbsolute(); +/* 1644 */ int len = av.length(); +/* 1645 */ for (int i = 1; i < len; i++) { +/* 1646 */ if (av.charAt(i - 1) == '_') { +/* 1647 */ char firstChar = av.charAt(i); +/* */ +/* 1649 */ if (Character.isLowerCase(firstChar)) +/* */ { +/* 1651 */ StringBuffer item = new StringBuffer(); +/* 1652 */ item.append(Character.toUpperCase(firstChar)); +/* */ do +/* */ { +/* 1655 */ char c = av.charAt(i); +/* */ +/* 1657 */ if (!Character.isLowerCase(c)) +/* */ break; +/* 1659 */ item.append(c);i++; +/* 1654 */ } while (i < len); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1664 */ if (InventoryManager.getInventoryManager().checkInventoryFor(item.toString()) <= 0) { +/* 1665 */ return false; +/* */ } +/* */ } +/* */ } +/* */ } +/* 1670 */ return true; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void resetAvatar() +/* */ { +/* 1679 */ setAvatar(this.targetAv); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void setAvatar(NET.worlds.network.URL url) +/* */ { +/* 1693 */ if (url == null) { +/* 1694 */ return; +/* */ } +/* */ +/* */ +/* 1698 */ BlackBox.getInstance().submitEvent( +/* 1699 */ new BBDroneBitmapCommand("@Pilot", url.toString())); +/* */ +/* 1701 */ this.targetAv = url; +/* 1702 */ this.targetValid = true; +/* */ +/* */ +/* */ +/* 1706 */ if (url.getAbsolute().length() > 220) { +/* 1707 */ println(message("av-too-complex")); +/* 1708 */ url = NET.worlds.network.URL.make("avatar:holden.mov"); +/* 1709 */ this.targetValid = false; +/* 1710 */ } else if (!isValidAv()) { +/* 1711 */ println(message("av-has-inventory")); +/* 1712 */ url = NET.worlds.network.URL.make("avatar:holden.mov"); +/* 1713 */ this.targetValid = false; +/* */ } +/* */ +/* */ +/* */ +/* 1718 */ loadPilot(url); +/* */ +/* 1720 */ WorldServer serv = getServerNew(); +/* 1721 */ if (serv == null) { +/* 1722 */ return; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1729 */ assert (serv.getVersion() >= 18); +/* */ +/* 1731 */ PropertyList propList = new PropertyList(); +/* */ +/* */ +/* */ +/* 1735 */ propList.addProperty(new net2Property(5, +/* 1736 */ 64, 1, url +/* 1737 */ .getAbsolute())); +/* */ try +/* */ { +/* 1740 */ serv.sendNetworkMsg(new PropertySetCmd(propList)); +/* */ +/* */ +/* */ } +/* */ catch (PacketTooLargeException e) +/* */ { +/* */ +/* 1747 */ assert (url.getAbsolute().length() < 220); +/* 1748 */ if (!$assertionsDisabled) throw new AssertionError(); +/* */ } +/* */ catch (InfiniteWaitException localInfiniteWaitException) {} +/* */ } +/* */ +/* */ public static void wake() { +/* 1754 */ if (active != null) +/* 1755 */ active.setSleepMode(null); +/* */ } +/* */ +/* 1758 */ private String sleepStr = message("asleep"); +/* */ protected static GammaFrame frame; +/* */ +/* 1761 */ public void goToSleep() { setSleepMode(this.sleepStr); +/* */ +/* */ +/* 1764 */ Window.getAndResetUserActionCount(); +/* */ } +/* */ +/* */ public boolean isSleeping() { +/* 1768 */ return !this.sleepMode.equals(""); +/* */ } +/* */ +/* */ protected void setSleepMode(String mode) +/* */ { +/* 1773 */ if (mode == null) { +/* 1774 */ mode = ""; +/* 1775 */ this.lastUserAction = Std.getFastTime(); +/* */ } +/* */ +/* 1778 */ if (this.pilot != null) { +/* 1779 */ this.pilot.setSleepMode(mode); +/* */ } +/* 1781 */ if (mode.equals(this.sleepMode)) { +/* 1782 */ return; +/* */ } +/* 1784 */ WorldServer serv = getServerNew(); +/* 1785 */ if (serv == null) { +/* 1786 */ return; +/* */ } +/* */ +/* 1789 */ PropertyList propList = new PropertyList(); +/* 1790 */ propList.addProperty(new net2Property(23, +/* 1791 */ 64, 1, mode)); +/* */ try { +/* 1793 */ serv.sendNetworkMsg(new PropertySetCmd(propList)); +/* */ } catch (PacketTooLargeException e) { +/* 1795 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ } +/* */ catch (InfiniteWaitException localInfiniteWaitException) {} +/* 1799 */ this.sleepMode = mode; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ public void setPilot(Pilot a) +/* */ throws IllegalPilotException +/* */ { +/* 1808 */ assert (a != null); +/* */ +/* 1810 */ Room prevRoom = null; +/* */ +/* */ +/* 1813 */ if (this.pilot != null) { +/* 1814 */ prevRoom = this.pilot.getRoom(); +/* 1815 */ unregPilot(); +/* */ } +/* */ +/* */ +/* 1819 */ this.pilot = a; +/* 1820 */ this.pilot.getSharer().createDynamicFromNet(); +/* 1821 */ this.pilot.setConsole(this); +/* 1822 */ regPilot(); +/* */ +/* */ +/* */ +/* 1826 */ if (active == this) { +/* 1827 */ Pilot.changeActiveRoom(prevRoom); +/* */ } +/* 1829 */ this.pilot.setSleepMode(this.sleepMode); +/* */ +/* */ +/* 1832 */ if ((this instanceof DefaultConsole)) { +/* 1833 */ ((DefaultConsole)this).resetCamera(); +/* */ } +/* */ } +/* */ +/* */ static +/* */ { +/* 275 */ storedLines = new Vector(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 467 */ font = new Font(message("MenuFont"), +/* 468 */ 0, 12); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 701 */ freezeFrameEvents = 0; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 873 */ menuBar = new MenuBar(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1024 */ autoFullVIP = IniFile.override().getIniInt( +/* 1025 */ "tieredVIP", 0) == 0; +/* */ +/* */ +/* 1028 */ if (!IniFile.override().getIniString("ProductName", "").equalsIgnoreCase("RedLightWorld")) {} +/* 1027 */ isRedLightWorld = +/* */ +/* */ +/* 1030 */ IniFile.override().getIniString("ProductName", "").equalsIgnoreCase("RedLightCenter"); +/* */ +/* 1032 */ vip = IniFile.gamma().getIniInt("VIP", 0) != 0 ? +/* 1033 */ 1 : autoFullVIP ? 2 : +/* 1034 */ 0; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1062 */ spguest = IniFile.gamma().getIniInt("SPGUEST", 0) != 0 ? 2 : +/* 1063 */ 0; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1246 */ selfCustom = false; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1403 */ defaultConsole = IniFile.gamma().getIniString( +/* 1404 */ "DEFAULTCONSOLE", "NET.worlds.console.DefaultConsole"); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1449 */ defConsoles = new Hashtable(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1837 */ frame = new GammaFrame(); +/* */ +/* */ +/* 1840 */ WhisperManager.whisperManager().setParent(frame); +/* */ } +/* */ +/* */ public static GammaFrame getFrame() { +/* 1844 */ return frame; +/* */ } +/* */ +/* 1847 */ protected Galaxy galaxy = null; +/* */ protected NET.worlds.network.URL _galaxyURL; +/* */ +/* 1850 */ public Galaxy getGalaxy() { assert (this.galaxy != null); +/* */ +/* 1852 */ return this.galaxy; +/* */ } +/* */ +/* */ +/* */ public NET.worlds.network.URL getGalaxyURL() +/* */ { +/* 1858 */ return this._galaxyURL; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public void setServerURL(NET.worlds.network.URL serverURL) +/* */ { +/* */ try +/* */ { +/* 1881 */ if (serverURL != null) { +/* 1882 */ this._galaxyURL = NET.worlds.network.URL.make("worldserver://" + +/* 1883 */ getServerHost(serverURL) + "/"); +/* */ } +/* */ } +/* */ catch (InvalidServerURLException e) { +/* 1887 */ println(">>" + e.getMessage()); +/* */ +/* */ +/* */ +/* 1891 */ if (!$assertionsDisabled) { throw new AssertionError(); +/* */ } +/* */ +/* 1894 */ this._galaxyURL = null; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1902 */ Galaxy oldGalaxy = this.galaxy; +/* */ +/* 1904 */ unregWithGalaxy(); +/* 1905 */ unregPilot(); +/* */ +/* */ +/* */ +/* 1909 */ if (this._galaxyURL != null) { +/* */ try { +/* 1911 */ this.galaxy = Galaxy.getGalaxy(this._galaxyURL); +/* */ } +/* */ catch (InvalidServerURLException e) { +/* 1914 */ println(">>" + e.getMessage()); +/* */ +/* */ +/* 1917 */ this.galaxy = Galaxy.getAnonGalaxy(); +/* */ } +/* */ } else { +/* 1920 */ this.galaxy = Galaxy.getAnonGalaxy(); +/* */ } +/* 1922 */ assert (this.galaxy != null); +/* 1923 */ regWithGalaxy(); +/* 1924 */ regPilot(); +/* */ +/* */ +/* 1927 */ if (oldGalaxy != null) { +/* 1928 */ oldGalaxy.decWorldCount(); +/* */ +/* */ +/* */ +/* */ +/* */ +/* 1934 */ if (oldGalaxy != this.galaxy) { +/* 1935 */ oldGalaxy.forceObjectRereg(); +/* */ } +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ private void regWithGalaxy() +/* */ { +/* 1944 */ assert (this.galaxy != null); +/* 1945 */ this.galaxy.addConsole(this); +/* 1946 */ this.galaxy.waitForConnection(this); +/* */ } +/* */ +/* */ private void unregWithGalaxy() { +/* 1950 */ assert (this.galaxy != null); +/* 1951 */ this.galaxy.delConsole(this); +/* */ } +/* */ +/* */ +/* */ +/* */ protected void regPilot() +/* */ { +/* 1958 */ if (this.pilot != null) { +/* 1959 */ this.pilot.getSharer().adjustShare(); +/* */ } +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public static String getServerHost(NET.worlds.network.URL url) +/* */ throws InvalidServerURLException +/* */ { +/* 1976 */ String s = url.unalias(); +/* 1977 */ int len = s.length(); +/* 1978 */ if ((len > 14) && (s.startsWith("worldserver://"))) +/* */ { +/* 1980 */ if (s.charAt(len - 1) == '/') { +/* 1981 */ len--; +/* */ } +/* 1983 */ s = s.substring(14, len); +/* */ +/* */ +/* 1986 */ if (s.equals("209.67.68.214:6650")) { +/* 1987 */ s = "www.3dcd.com:6650"; +/* */ } +/* 1989 */ return s; +/* */ } +/* */ +/* 1992 */ throw new InvalidServerURLException("Bad worldserver:// URL format"); +/* */ } +/* */ +/* */ +/* */ public static NET.worlds.network.URL makeServerURL(String host) +/* */ { +/* 1998 */ assert ((host != null) && (host.length() > 0)); +/* 1999 */ return NET.worlds.network.URL.make("worldserver://" + host + "/"); +/* */ } +/* */ +/* */ +/* */ +/* */ protected void unregPilot() +/* */ { +/* 2006 */ if (this.pilot != null) +/* 2007 */ this.pilot.getSharer().adjustShare(); +/* */ } +/* */ +/* 2010 */ private Cursor cursor = new Cursor(NET.worlds.network.URL.make("system:WAIT_CURSOR")); +/* */ +/* */ public Cursor getCursor() +/* */ { +/* 2014 */ return this.cursor; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getScriptServer() +/* */ { +/* 2023 */ String Fred = "Fred"; +/* 2024 */ String override = IniFile.override().getIniString("ScriptServer", Fred); +/* 2025 */ if (!override.equals(Fred)) { +/* 2026 */ return new String(override); +/* */ } +/* 2028 */ WorldServer server = getServerNew(); +/* 2029 */ if (server != null) { +/* 2030 */ String sname = server.getScriptServer(); +/* 2031 */ if (sname != null) +/* 2032 */ return new String(sname); +/* */ } +/* 2034 */ return new String("http://www-dynamic.us.worlds.net/cgi-bin/"); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public String getSmtpServer() +/* */ { +/* 2043 */ WorldServer server = getServerNew(); +/* 2044 */ if (server != null) { +/* 2045 */ String sname = server.getSmtpServer(); +/* 2046 */ if (sname != null) +/* 2047 */ return sname; +/* */ } +/* 2049 */ return "www.3dcd.com:25"; +/* */ } +/* */ +/* */ public String getMailDomain() +/* */ { +/* 2054 */ WorldServer server = getServerNew(); +/* 2055 */ if (server != null) { +/* 2056 */ String dname = server.getMailDomain(); +/* 2057 */ if (dname != null) +/* 2058 */ return dname; +/* */ } +/* 2060 */ return "3dcd.com"; +/* */ } +/* */ +/* */ public Object properties(int index, int offset, int mode, Object value) +/* */ throws NoSuchPropertyException +/* */ { +/* 2066 */ Object ret = null; +/* */ +/* 2068 */ switch (index - offset) { +/* */ case 0: +/* 2070 */ if (mode == 0) { +/* 2071 */ ret = URLPropertyEditor.make(new Property(this, index, +/* 2072 */ "Server URL").allowSetNull(), null); +/* 2073 */ } else if (mode == 1) { +/* 2074 */ ret = getGalaxyURL(); +/* 2075 */ } else if (mode == 2) +/* 2076 */ if (value == null) { +/* 2077 */ setServerURL(null); +/* */ +/* */ +/* */ +/* */ } +/* */ else +/* */ { +/* */ +/* */ +/* */ +/* 2087 */ NET.worlds.network.URL u = (NET.worlds.network.URL)value; +/* 2088 */ if ((u == null) || (u.unalias().startsWith("worldserver:"))) { +/* 2089 */ setServerURL(u); +/* */ } else +/* 2091 */ println(message("server-URL")); +/* */ } +/* 2093 */ break; +/* */ +/* */ case 1: +/* 2096 */ if (mode == 0) { +/* 2097 */ ret = BooleanPropertyEditor.make(new Property(this, index, +/* 2098 */ "Enable Menu Bar"), "No", "Yes"); +/* 2099 */ } else if (mode == 1) { +/* 2100 */ ret = new Boolean(this.enableMenu); +/* 2101 */ } else if (mode == 2) +/* 2102 */ setEnableMenu(((Boolean)value).booleanValue()); +/* 2103 */ break; +/* */ +/* */ case 2: +/* 2106 */ if (mode == 0) { +/* 2107 */ ret = BooleanPropertyEditor.make(new Property(this, index, +/* 2108 */ "Disable Shaper Access (irreversible!)"), "No", "Yes"); +/* 2109 */ } else if (mode == 1) { +/* 2110 */ ret = new Boolean(this.disableShaperAccess); +/* 2111 */ } else if (mode == 2) +/* 2112 */ this.disableShaperAccess = ((Boolean)value).booleanValue(); +/* 2113 */ break; +/* */ +/* */ case 3: +/* 2116 */ if (mode == 0) { +/* 2117 */ ret = BooleanPropertyEditor.make(new Property(this, index, +/* 2118 */ "Disable Single-user Access"), "No", "Yes"); +/* 2119 */ } else if (mode == 1) { +/* 2120 */ ret = new Boolean(this.disableSingleUserAccess); +/* 2121 */ } else if (mode == 2) +/* 2122 */ this.disableSingleUserAccess = ((Boolean)value).booleanValue(); +/* 2123 */ break; +/* */ +/* */ case 4: +/* 2126 */ if (mode == 0) { +/* 2127 */ ret = new Property(this, index, "Pilot Soul Template"); +/* 2128 */ } else if (mode == 1) +/* 2129 */ ret = this.pilotSoulTemplate; +/* 2130 */ break; +/* */ +/* */ case 5: +/* 2133 */ if (mode == 0) { +/* 2134 */ ret = new Property(this, index, "Drone Soul Template"); +/* 2135 */ } else if (mode == 1) +/* 2136 */ ret = this.droneSoulTemplate; +/* 2137 */ break; +/* */ +/* */ case 6: +/* 2140 */ if (mode == 0) { +/* 2141 */ ret = new Property(this, index, "Cursor"); +/* 2142 */ } else if (mode == 1) +/* 2143 */ ret = getCursor(); +/* 2144 */ break; +/* */ +/* */ case 7: +/* 2147 */ if (mode == 0) { +/* 2148 */ ret = PropAdder.make(new VectorProperty(this, index, +/* 2149 */ "Temporary Area")); +/* 2150 */ } else if (mode == 1) { +/* 2151 */ ret = this.tempArea.clone(); +/* 2152 */ } else if (mode == 4) { +/* 2153 */ this.tempArea.removeElement(value); +/* 2154 */ ((SuperRoot)value).detach(); +/* 2155 */ } else if (mode == 3) { +/* 2156 */ this.tempArea.addElement(value); +/* 2157 */ add((SuperRoot)value); +/* 2158 */ if ((value instanceof Console)) { +/* 2159 */ Console c = (Console)value; +/* 2160 */ if (c.pilotSoulTemplate == null) +/* 2161 */ c.loadInit(); +/* */ } +/* 2163 */ } else if ((mode == 5) && ((value instanceof SuperRoot)) && +/* 2164 */ (!(value instanceof Room))) { +/* 2165 */ ret = value; } +/* 2166 */ break; +/* */ +/* */ case 8: +/* 2169 */ if (mode == 0) { +/* 2170 */ ret = StringPropertyEditor.make(new Property(this, index, +/* 2171 */ "Default Action")); +/* 2172 */ } else if (mode == 1) { +/* 2173 */ ret = getDefaultAction(); +/* 2174 */ } else if (mode == 2) +/* 2175 */ setDefaultAction((String)value); +/* 2176 */ break; +/* */ +/* */ default: +/* 2179 */ ret = super.properties(index, offset + 9, mode, value); +/* */ } +/* 2181 */ return ret; +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* 2189 */ private Vector<Object> tempArea = new Vector(); +/* */ +/* */ +/* 2192 */ private static Object classCookie = new Object(); +/* */ +/* */ public void saveState(Saver s) throws IOException { +/* 2195 */ s.saveVersion(4, classCookie); +/* 2196 */ super.saveState(s); +/* */ +/* 2198 */ NET.worlds.network.URL.save(s, getGalaxyURL()); +/* 2199 */ s.saveBoolean(this.enableMenu); +/* 2200 */ s.saveBoolean(this.disableShaperAccess); +/* 2201 */ s.saveString(this.defaultAction); +/* 2202 */ s.save(this.pilotSoulTemplate); +/* 2203 */ s.save(this.droneSoulTemplate); +/* 2204 */ s.save(this.cursor); +/* */ } +/* */ +/* */ +/* */ +/* */ +/* */ private static NET.worlds.network.URL restoreOldURL(Restorer r) +/* */ throws IOException +/* */ { +/* 2213 */ String s = r.restoreString(); +/* 2214 */ if ((s == null) || (s.equals("UNSHARED"))) { +/* 2215 */ return null; +/* */ } +/* 2217 */ return makeServerURL(s); +/* */ } +/* */ +/* */ public void restoreState(Restorer r) throws IOException, TooNewException { +/* 2221 */ int vers = r.restoreVersion(classCookie); +/* 2222 */ switch (vers) +/* */ { +/* */ +/* */ case 0: +/* */ case 1: +/* 2227 */ WObject w = new WObject(); +/* 2228 */ w.restoreState(r); +/* 2229 */ setName(w.getName()); +/* */ +/* 2231 */ templateInit(); +/* */ +/* */ +/* 2234 */ Enumeration<Attribute> e = w.getAttributes(); +/* 2235 */ while (e.hasMoreElements()) { +/* 2236 */ Attribute a = (Attribute)e.nextElement(); +/* 2237 */ a.setAttrID(a.getForwardAttrID()); +/* */ } +/* */ +/* */ +/* 2241 */ Pilot.copySoul(w, this.pilotSoulTemplate); +/* */ +/* */ +/* 2244 */ setServerURL(restoreOldURL(r)); +/* 2245 */ this.enableMenu = r.restoreBoolean(); +/* 2246 */ this.disableShaperAccess = r.restoreBoolean(); +/* */ +/* 2248 */ if (vers == 1) { +/* 2249 */ this.cursor = ((Cursor)r.restore()); +/* */ } +/* 2251 */ break; +/* */ +/* */ case 2: +/* 2254 */ super.restoreState(r); +/* 2255 */ setServerURL(restoreOldURL(r)); +/* 2256 */ this.enableMenu = r.restoreBoolean(); +/* 2257 */ this.disableShaperAccess = r.restoreBoolean(); +/* 2258 */ this.pilotSoulTemplate = ((Pilot)r.restore()); +/* 2259 */ add(this.pilotSoulTemplate); +/* 2260 */ this.droneSoulTemplate = ((Drone)r.restore()); +/* 2261 */ add(this.droneSoulTemplate); +/* 2262 */ this.cursor = ((Cursor)r.restore()); +/* 2263 */ break; +/* */ +/* */ case 3: +/* 2266 */ super.restoreState(r); +/* 2267 */ setServerURL(restoreOldURL(r)); +/* 2268 */ this.enableMenu = r.restoreBoolean(); +/* 2269 */ this.disableShaperAccess = r.restoreBoolean(); +/* 2270 */ this.defaultAction = r.restoreString(); +/* 2271 */ this.pilotSoulTemplate = ((Pilot)r.restore()); +/* 2272 */ add(this.pilotSoulTemplate); +/* 2273 */ this.droneSoulTemplate = ((Drone)r.restore()); +/* 2274 */ add(this.droneSoulTemplate); +/* 2275 */ this.cursor = ((Cursor)r.restore()); +/* 2276 */ break; +/* */ +/* */ case 4: +/* 2279 */ super.restoreState(r); +/* */ +/* */ +/* */ +/* 2283 */ setServerURL(NET.worlds.network.URL.restore(r)); +/* 2284 */ this.enableMenu = r.restoreBoolean(); +/* 2285 */ this.disableShaperAccess = r.restoreBoolean(); +/* 2286 */ this.defaultAction = r.restoreString(); +/* 2287 */ this.pilotSoulTemplate = ((Pilot)r.restore()); +/* 2288 */ add(this.pilotSoulTemplate); +/* 2289 */ this.droneSoulTemplate = ((Drone)r.restore()); +/* 2290 */ add(this.droneSoulTemplate); +/* 2291 */ this.cursor = ((Cursor)r.restore()); +/* 2292 */ break; +/* */ +/* */ default: +/* 2295 */ throw new TooNewException(); +/* */ } +/* */ +/* 2298 */ add(this.cursor); +/* */ } +/* */ +/* */ public void inventoryChanged() {} +/* */ +/* */ public static final native String encrypt(String paramString); +/* */ +/* */ public static final native String decrypt(String paramString); +/* */ +/* */ public static final native int getVolumeInfo(); +/* */ +/* */ public abstract NET.worlds.network.URL getAvatarName(); +/* */ +/* */ public abstract void setChatname(String paramString); +/* */ +/* */ public void register() {} +/* */ +/* */ public void reacquireServer(WorldServer oldServ) {} +/* */ +/* */ public abstract void setOnlineState(boolean paramBoolean1, boolean paramBoolean2); +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\console\Console.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */
\ No newline at end of file |