Advertisement
ipwxy

Unused Code in Client class

Jul 4th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 14.00 KB | None | 0 0
  1.     /**
  2.      * Drawing of exp counter drops
  3.      */
  4.     @SuppressWarnings("unused")
  5.     private int digits;
  6.     @SuppressWarnings("unused")
  7.     private static int anInt1290;
  8.     @SuppressWarnings("unused")
  9.     private final int[] orbX = { 0, 0, 24 };
  10.     @SuppressWarnings("unused")
  11.     private final int[] orbY = { 41, 85, 122 };
  12.     @SuppressWarnings("unused")
  13.     private final int[] orbTextX = { 15, 16, 40 };
  14.     @SuppressWarnings("unused")
  15.     private final int[] orbTextY = { 67, 111, 148 };
  16.     @SuppressWarnings("unused")
  17.     private final int[] coloredOrbX = { 27, 27, 51 };
  18.     @SuppressWarnings("unused")
  19.     private final int[] coloredOrbY = { 45, 89, 126 };
  20.     @SuppressWarnings("unused")
  21.     private final int[] currentInterface = { 4016, 4012, 149 };
  22.     @SuppressWarnings("unused")
  23.     private final int[] maximumInterface = { 4017, 4013, 149 };
  24.     @SuppressWarnings("unused")
  25.     private final int[] orbIconX = { 33, 30, 58 };
  26.     @SuppressWarnings("unused")
  27.     private final int[] orbIconY = { 51, 92, 130 };
  28.  
  29.     @SuppressWarnings("unused")
  30.     private int currentTrackLoop;
  31.     @SuppressWarnings("unused")
  32.     private FileArchive mediaStreamLoader;
  33.     @SuppressWarnings("unused")
  34.     private int anInt1279;
  35.     @SuppressWarnings("unused")
  36.     private int anInt1264;
  37.     @SuppressWarnings("unused")
  38.     private final int anInt1239 = 100;
  39.     @SuppressWarnings("unused")
  40.     private int anInt1210;
  41.     @SuppressWarnings("unused")
  42.     private int anInt1171;
  43.     @SuppressWarnings("unused")
  44.     private int anInt1132;
  45.     @SuppressWarnings("unused")
  46.     private int member;
  47.     @SuppressWarnings("unused")
  48.     private int anInt988;
  49.     @SuppressWarnings("unused")
  50.     private int anInt897;
  51.     @SuppressWarnings("unused")
  52.     private String prayerBook;
  53.     @SuppressWarnings("unused")
  54.     private String clanname;
  55.     @SuppressWarnings("unused")
  56.     private int currentTrackPlaying;
  57.  
  58.     @SuppressWarnings("unused")
  59.     private static final byte[] ReadFile(String fileName) {
  60.         try {
  61.             byte abyte0[];
  62.             File file = new File(fileName);
  63.             int i = (int) file.length();
  64.             abyte0 = new byte[i];
  65.             DataInputStream datainputstream = new DataInputStream(new BufferedInputStream(new FileInputStream(fileName)));
  66.             datainputstream.readFully(abyte0, 0, i);
  67.             datainputstream.close();
  68.             return abyte0;
  69.         } catch (Exception e) {
  70.             System.out.println((new StringBuilder()).append("Read Error: ").append(fileName).toString());
  71.             return null;
  72.         }
  73.     }
  74.  
  75.     @SuppressWarnings("unused")
  76.     private static AbstractMap.SimpleEntry<Integer, Integer> getNextInteger(ArrayList<Integer> values) {
  77.         ArrayList<AbstractMap.SimpleEntry<Integer, Integer>> frequencies = new ArrayList<>();
  78.         int maxIndex = 0;
  79.         main: for (int i = 0; i < values.size(); ++i) {
  80.             int value = values.get(i);
  81.             for (int j = 0; j < frequencies.size(); ++j) {
  82.                 if (frequencies.get(j).getKey() == value) {
  83.                     frequencies.get(j).setValue(frequencies.get(j).getValue() + 1);
  84.                     if (frequencies.get(maxIndex).getValue() < frequencies.get(j).getValue()) {
  85.                         maxIndex = j;
  86.                     }
  87.                     continue main;
  88.                 }
  89.             }
  90.             frequencies.add(new AbstractMap.SimpleEntry<Integer, Integer>(value, 1));
  91.         }
  92.         return frequencies.get(maxIndex);
  93.     }
  94.  
  95.     @SuppressWarnings("unused")
  96.     private int getOrbFill(int statusInt) {
  97.         if (statusInt <= Integer.MAX_VALUE && statusInt >= 97)
  98.             return 0;
  99.         else if (statusInt <= 96 && statusInt >= 93)
  100.             return 1;
  101.         else if (statusInt <= 92 && statusInt >= 89)
  102.             return 2;
  103.         else if (statusInt <= 88 && statusInt >= 85)
  104.             return 3;
  105.         else if (statusInt <= 84 && statusInt >= 81)
  106.             return 4;
  107.         else if (statusInt <= 80 && statusInt >= 77)
  108.             return 5;
  109.         else if (statusInt <= 76 && statusInt >= 73)
  110.             return 6;
  111.         else if (statusInt <= 72 && statusInt >= 69)
  112.             return 7;
  113.         else if (statusInt <= 68 && statusInt >= 65)
  114.             return 8;
  115.         else if (statusInt <= 64 && statusInt >= 61)
  116.             return 9;
  117.         else if (statusInt <= 60 && statusInt >= 57)
  118.             return 10;
  119.         else if (statusInt <= 56 && statusInt >= 53)
  120.             return 11;
  121.         else if (statusInt <= 52 && statusInt >= 49)
  122.             return 12;
  123.         else if (statusInt <= 48 && statusInt >= 45)
  124.             return 13;
  125.         else if (statusInt <= 44 && statusInt >= 41)
  126.             return 14;
  127.         else if (statusInt <= 40 && statusInt >= 37)
  128.             return 15;
  129.         else if (statusInt <= 36 && statusInt >= 33)
  130.             return 16;
  131.         else if (statusInt <= 32 && statusInt >= 29)
  132.             return 17;
  133.         else if (statusInt <= 28 && statusInt >= 25)
  134.             return 18;
  135.         else if (statusInt <= 24 && statusInt >= 21)
  136.             return 19;
  137.         else if (statusInt <= 20 && statusInt >= 17)
  138.             return 20;
  139.         else if (statusInt <= 16 && statusInt >= 13)
  140.             return 21;
  141.         else if (statusInt <= 12 && statusInt >= 9)
  142.             return 22;
  143.         else if (statusInt <= 8 && statusInt >= 7)
  144.             return 23;
  145.         else if (statusInt <= 6 && statusInt >= 5)
  146.             return 24;
  147.         else if (statusInt <= 4 && statusInt >= 3)
  148.             return 25;
  149.         else if (statusInt <= 2 && statusInt >= 1)
  150.             return 26;
  151.         else if (statusInt <= 0)
  152.             return 27;
  153.         return 0;
  154.     }
  155.  
  156.     /**
  157.      * Draws the exp counter
  158.      */
  159.     @SuppressWarnings("unused")
  160.     private void drawExpCounter() {
  161.  
  162.         final boolean wilderness = openWalkableInterface == 23300;
  163.  
  164.         int width = 138;
  165.         int xPos = wilderness && frameMode != ScreenMode.FIXED ? frameWidth - 383 : frameWidth - 395;
  166.         int yPos = wilderness ? (frameMode != ScreenMode.FIXED ? 114 : 100) : 2;
  167.  
  168.         // Draw box ..
  169.         // Rasterizer2D.drawTransparentBox(xPos, yPos, width, height, 0x5a5245,
  170.         // 150);
  171.         cacheSprite[337].drawAdvancedSprite(xPos, yPos);
  172.  
  173.         // Draw skill info..
  174.         if (currentSkill != -1) {
  175.  
  176.             // Draw sprite icon..
  177.             cacheSprite[73 + currentSkill].drawAdvancedSprite(xPos + 6, yPos + 7);
  178.  
  179.             // Draw black
  180.             // Rasterizer2D.drawBox(xPos + 5, yPos + 30, width - 8, 10, 00000);
  181.             cacheSprite[338].drawAdvancedSprite(xPos + 5, yPos + 30);
  182.  
  183.             // Draw green
  184.             int currentLevel = maximumLevels[currentSkill];
  185.             int percent = (width - 11);
  186.  
  187.             // Attempt to calculate percent...
  188.             if (currentLevel != 99) {
  189.                 try {
  190.                     int initExp = getXPForLevel(currentLevel);
  191.                     int newExp = getXPForLevel(currentLevel + 1);
  192.                     int gained = currentExp[currentSkill] - initExp;
  193.                     int remainder = newExp - initExp;
  194.                     percent = (int) (((double) gained / (double) remainder) * (width - 11));
  195.                     if (percent > (width - 11)) {
  196.                         percent = (width - 11);
  197.                     }
  198.                 } catch (ArithmeticException e) {
  199.                     e.printStackTrace();
  200.                 }
  201.             }
  202.  
  203.             Rasterizer2D.drawBox(xPos + 6, yPos + 32, percent, 8, getProgressColor(percent));
  204.         }
  205.  
  206.         // Draw total exp..
  207.         String totalExpString = "+" + StringUtils.insertCommasToNumber("" + totalExp + "");
  208.         int textDrawX = totalExp < 1000 ? xPos + 120 : totalExp < 10000 ? xPos + 110 : xPos + 100 - totalExpString.length();
  209.         newBoldFont.drawCenteredString(totalExpString, textDrawX, yPos + 14, 16777215, 0);
  210.     }
  211.  
  212.     @SuppressWarnings("unused")
  213.     private void sendButtonClick(int button, int toggle, int type) {
  214.         Widget widget = Widget.interfaceCache[button];
  215.         switch (type) {
  216.         case 135:
  217.             boolean flag8 = true;
  218.  
  219.             if (widget.contentType > 0) {
  220.                 flag8 = promptUserForInput(widget);
  221.             }
  222.  
  223.             if (flag8) {
  224.                 sendPacket(new ClickButton(button));
  225.             }
  226.             break;
  227.  
  228.         // case reset setting widget
  229.         case 646:
  230.             sendPacket(new ClickButton(button));
  231.  
  232.             if (widget.valueIndexArray != null && widget.valueIndexArray[0][0] == 5) {
  233.                 if (settings[toggle] != widget.requiredValues[0]) {
  234.                     settings[toggle] = widget.requiredValues[0];
  235.                     updateVarp(toggle);
  236.                 }
  237.             }
  238.             break;
  239.  
  240.         case 169:
  241.             sendPacket(new ClickButton(button));
  242.             if (widget.valueIndexArray != null && widget.valueIndexArray[0][0] == 5) {
  243.                 settings[toggle] = 1 - settings[toggle];
  244.                 updateVarp(toggle);
  245.             }
  246.             break;
  247.  
  248.         default:
  249.             System.out.println("button: " + button + " - toggle: " + toggle + " - type: " + type);
  250.             break;
  251.         }
  252.     }
  253.  
  254.     /**
  255.      * Sets button configurations on interfaces.
  256.      */
  257.     @SuppressWarnings("unused")
  258.     private void sendConfiguration(int id, int state) {
  259.         anIntArray1045[id] = state;
  260.         if (settings[id] != state) {
  261.             settings[id] = state;
  262.             updateVarp(id);
  263.             if (dialogueId != -1)
  264.                 updateChatbox = true;
  265.         }
  266.     }
  267.  
  268.     /**
  269.      * Clears the screen of all open interfaces.
  270.      */
  271.     @SuppressWarnings("unused")
  272.     private void clearScreen() {
  273.         if (overlayInterfaceId != -1) {
  274.             overlayInterfaceId = -1;
  275.             tabAreaAltered = true;
  276.         }
  277.         if (backDialogueId != -1) {
  278.             backDialogueId = -1;
  279.             updateChatbox = true;
  280.         }
  281.         if (inputDialogState != 0) {
  282.             inputDialogState = 0;
  283.             updateChatbox = true;
  284.         }
  285.         openInterfaceId = -1;
  286.         continuedDialogue = false;
  287.     }
  288.  
  289.     /**
  290.      * This method updates default messages upon login to the desired text of the interface text.
  291.      */
  292.     @SuppressWarnings("unused")
  293.     private void updateStrings(String message, int index) {
  294.         switch (index) {
  295.         case 1675:
  296.             sendString(message, 17508);
  297.             break;// Stab
  298.         case 1676:
  299.             sendString(message, 17509);
  300.             break;// Slash
  301.         case 1677:
  302.             sendString(message, 17510);
  303.             break;// Crush
  304.         case 1678:
  305.             sendString(message, 17511);
  306.             break;// Magic
  307.         case 1679:
  308.             sendString(message, 17512);
  309.             break;// Range
  310.         case 1680:
  311.             sendString(message, 17513);
  312.             break;// Stab
  313.         case 1681:
  314.             sendString(message, 17514);
  315.             break;// Slash
  316.         case 1682:
  317.             sendString(message, 17515);
  318.             break;// Crush
  319.         case 1683:
  320.             sendString(message, 17516);
  321.             break;// Magic
  322.         case 1684:
  323.             sendString(message, 17517);
  324.             break;// Range
  325.         case 1686:
  326.             sendString(message, 17518);
  327.             break;// Strength
  328.         case 1687:
  329.             sendString(message, 17519);
  330.             break;// Prayer
  331.         }
  332.     }
  333.  
  334.     @SuppressWarnings("unused")
  335.     private void loginScreenAccessories() {
  336.         /**
  337.          * World-selection
  338.          */
  339.         setupLoginScreen();
  340.  
  341.         loginScreenAccessories.drawGraphics(400, super.graphics, 0);
  342.         loginScreenAccessories.initDrawingArea();
  343.         cacheSprite[57].drawSprite(6, 63);
  344.         if (!Configuration.worldSwitch) {
  345.             boldText.method382(0xffffff, 55, "World 301", 78, true);
  346.             smallText.method382(0xffffff, 55, "Click to switch", 92, true);
  347.             Configuration.server_address = "localhost";
  348.             Configuration.server_port = 43594;
  349.         }
  350.  
  351.         loginMusicImageProducer.drawGraphics(265, super.graphics, 562);
  352.         loginMusicImageProducer.initDrawingArea();
  353.         if (Configuration.enableMusic) {
  354.             cacheSprite[58].drawSprite(158, 196);
  355.         } else {
  356.             cacheSprite[59].drawSprite(158, 196);
  357.             stopMidi();
  358.         }
  359.  
  360.     }
  361.  
  362.     @SuppressWarnings("unused")
  363.     private void drawMusicSprites() {
  364.  
  365.         int musicState = 0;
  366.         bottomRightImageProducer.initDrawingArea();
  367.         switch (musicState) {
  368.         case 0:
  369.             cacheSprite[58].drawSprite(158, 196);
  370.             break;
  371.  
  372.         case 1:
  373.             cacheSprite[59].drawSprite(158, 196);
  374.             break;
  375.         }
  376.     }
  377.  
  378.     @SuppressWarnings("unused")
  379.     private void drawOnBankInterface() {
  380.         /*
  381.          * if(openInterfaceId == 5292 && Widget.interfaceCache[27000].defaultText.equals("1")) { int total_tabs = Integer.parseInt(Widget.interfaceCache[27001].defaultText); currentBankTab = Integer.parseInt(Widget.interfaceCache[27002].defaultText); for(int k = 0; k <= total_tabs; k++) { Widget.interfaceCache[27014 + k].disabledSprite = cacheSprite[123]; if(k == 0) { Widget.interfaceCache[27014 + k].actions = new String[]{"Main Tab"}; } else { Widget.interfaceCache[27014 + k].actions = new String[]{ "Select Tab", "Collapse Tab"}; } } for(int l = total_tabs + 1; l <= 8; l++) { Widget.interfaceCache[27014+ l].disabledSprite = null; Widget.interfaceCache[27014 + l].tooltip = null; Widget.interfaceCache[27014 + l].defaultText = null; } if(total_tabs != 8) { Widget.interfaceCache[27015 +
  382.          * total_tabs].disabledSprite = cacheSprite[122]; Widget.interfaceCache[27015 + total_tabs].actions = new String[]{"Create Tab"}; } if(currentBankTab == -1) { Widget.interfaceCache[27013].disabledSprite = cacheSprite[124]; } else if(currentBankTab > 0) { Widget.interfaceCache[27014 + currentBankTab].disabledSprite = cacheSprite[126]; Widget.interfaceCache[27014].disabledSprite = cacheSprite[124]; } else { Widget.interfaceCache[27014].disabledSprite = cacheSprite[121]; } Widget.interfaceCache[27000].defaultText = "0"; }
  383.          */
  384.     }
  385.  
  386.     @SuppressWarnings("unused")
  387.     private int getLevelForXP(int exp) {
  388.         int points = 0;
  389.         int output = 0;
  390.  
  391.         if (exp > 13034430) {
  392.             return 99;
  393.         }
  394.  
  395.         for (int lvl = 1; lvl <= 99; lvl++) {
  396.             points += Math.floor(lvl + 300.0 * Math.pow(2.0, lvl / 7.0));
  397.             output = (int) Math.floor(points / 4);
  398.  
  399.             if (output >= exp) {
  400.                 return lvl;
  401.             }
  402.         }
  403.  
  404.         return 0;
  405.     }
  406.  
  407.     @SuppressWarnings("unused")
  408.     private boolean isSelectingQuickPrayers() {
  409.         return tabInterfaceIDs[5] == 17200;
  410.     }
  411.  
  412.     @SuppressWarnings("unused")
  413.     private void playSong(int id) {
  414.         if (id != currentSong && Configuration.enableMusic && !lowMemory && prevSong == 0) {
  415.             nextSong = id;
  416.             fadeMusic = true;
  417.             resourceProvider.provide(2, nextSong);
  418.             currentSong = id;
  419.         }
  420.     }
  421.  
  422.     @SuppressWarnings("unused")
  423.     private String getNameForTab(int tab) {
  424.         switch (tab) {
  425.         case 0:
  426.             return "Combat";
  427.         case 1:
  428.             return "Stats";
  429.         case 2:
  430.             return "Spawn tab";
  431.         case 3:
  432.             return "Inventory";
  433.         case 4:
  434.             return "Equipment";
  435.         case 5:
  436.             return "Prayer";
  437.         case 6:
  438.             return "Magic";
  439.         case 7:
  440.             return "Clan chat";
  441.         case 8:
  442.             return "Friends";
  443.         case 9:
  444.             return "Ignores";
  445.         case 10:
  446.             return "Logout";
  447.         case 11:
  448.             return "Settings";
  449.         case 12:
  450.             return "Emotes";
  451.         case 13:
  452.             return "PvP";
  453.         }
  454.         return "";
  455.     }
  456.  
  457.     /**
  458.      * Initializes the client for startup
  459.      */
  460.     @SuppressWarnings("unused")
  461.     private void initialize() {
  462.         try {
  463.             nodeID = 10;
  464.             portOffset = 0;
  465.             setHighMem();
  466.             isMembers = true;
  467.             SignLink.storeid = 32;
  468.             SignLink.startpriv(InetAddress.getLocalHost());
  469.             initClientFrame(frameWidth, frameHeight);
  470.             instance = this;
  471.         } catch (Exception exception) {
  472.             return;
  473.         }
  474.     }
  475.  
  476.     @SuppressWarnings("unused")
  477.     private void addObject(int x, int y, int objectId, int face, int type, int height) {
  478.         int mX = this.regionX - 6;
  479.         int mY = this.regionY - 6;
  480.         int x2 = x - mX * 8;
  481.         int y2 = y - mY * 8;
  482.         int i15 = 40 >> 2;
  483.         int l17 = objectGroups[i15];
  484.         if (y2 > 0 && y2 < 103 && x2 > 0 && x2 < 103) {
  485.             requestSpawnObject(-1, objectId, face, l17, y2, type, height, x2, 0);
  486.  
  487.         }
  488.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement