A RuneTek3 client (377) that is deobfuscated, converted to Kotlin, and includes QoL improvements.
0

Configure Feed

Select the types of activity you want to include in your feed.

some refactoring in game and a fix in TypeFace for string lenght

+54 -65
+53 -61
src/main/java/com/jagex/runescape/Game.java
··· 256 256 private int fullscreenWidgetId = -1; 257 257 private int[] skillMaxLevel = new int[SkillConstants.SKILL_COUNT]; 258 258 private int anInt1055 = 2; 259 - private int anInt1056 = 3; 260 259 private int systemUpdateTime; 261 260 private String clickToContinueString; 262 261 private TypeFace fontSmall; ··· 266 265 private int mouseInvInterfaceIndex; 267 266 private int lastActiveInvInterface; 268 267 private boolean menuOpen = false; 269 - private byte aByte1066 = 1; 270 268 private boolean aBoolean1067 = false; 271 269 private int playerMembers; 272 270 private String[] aStringArray1069 = new String[5]; ··· 400 398 private ProducingGraphicsBuffer aClass18_1204; 401 399 private ProducingGraphicsBuffer aClass18_1205; 402 400 private ProducingGraphicsBuffer aClass18_1206; 403 - private static boolean aBoolean1207; 404 - private int anInt1208; 405 401 private boolean loadingMap = false; 406 402 private LinkedList gameAnimableObjectQueue = new LinkedList(); 407 403 private boolean cutsceneActive = false; ··· 2294 2290 } 2295 2291 if (opcode == UPDATE_WELCOME_SCREEN) { // @TODO rename all these vars 2296 2292 lastPasswordChangeTime = buffer.getUnsignedShortLE(); 2297 - anInt1075 = buffer.getUnsignedNegativeOffsetShortLE(); // Never read anywhere... Junk?... 2293 + buffer.getUnsignedNegativeOffsetShortLE(); // Never read anywhere... Junk?... 2298 2294 buffer.getUnsignedShortBE(); // junk... 2299 - anInt1208 = buffer.getUnsignedShortBE(); // Never read anywhere... Junk?... 2295 + buffer.getUnsignedShortBE(); // Never read anywhere... Junk?... 2300 2296 loginScreenUpdateTime = buffer.getUnsignedShortLE(); 2301 2297 unreadWebsiteMessages = buffer.getUnsignedNegativeOffsetShortBE(); 2302 2298 lastLoginTime = buffer.getUnsignedNegativeOffsetShortBE(); ··· 7954 7950 } 7955 7951 } 7956 7952 7957 - private void method103(byte byte0, Widget widget) { 7958 - if (byte0 == 2) 7959 - byte0 = 0; 7960 - else 7961 - anInt1004 = -82; 7962 - int i = widget.contentType; 7963 - if (i >= 1 && i <= 100 || i >= 701 && i <= 800) { 7964 - if (i == 1 && friendListStatus == 0) { 7953 + private void updateWidget(Widget widget) { 7954 + int type = widget.contentType; 7955 + if (type >= 1 && type <= 100 || type >= 701 && type <= 800) { 7956 + if (type == 1 && friendListStatus == 0) { 7965 7957 widget.disabledText = "Loading friend list"; 7966 7958 widget.actionType = 0; 7967 7959 return; 7968 7960 } 7969 - if (i == 1 && friendListStatus == 1) { 7961 + if (type == 1 && friendListStatus == 1) { 7970 7962 widget.disabledText = "Connecting to friendserver"; 7971 7963 widget.actionType = 0; 7972 7964 return; 7973 7965 } 7974 - if (i == 2 && friendListStatus != 2) { 7966 + if (type == 2 && friendListStatus != 2) { 7975 7967 widget.disabledText = "Please wait..."; 7976 7968 widget.actionType = 0; 7977 7969 return; ··· 7979 7971 int j = friendsCount; 7980 7972 if (friendListStatus != 2) 7981 7973 j = 0; 7982 - if (i > 700) 7983 - i -= 601; 7974 + if (type > 700) 7975 + type -= 601; 7984 7976 else 7985 - i--; 7986 - if (i >= j) { 7977 + type--; 7978 + if (type >= j) { 7987 7979 widget.disabledText = ""; 7988 7980 widget.actionType = 0; 7989 7981 return; 7990 7982 } else { 7991 - widget.disabledText = friendUsernames[i]; 7983 + widget.disabledText = friendUsernames[type]; 7992 7984 widget.actionType = 1; 7993 7985 return; 7994 7986 } 7995 7987 } 7996 - if (i >= 101 && i <= 200 || i >= 801 && i <= 900) { 7997 - int k = friendsCount; 7988 + if (type >= 101 && type <= 200 || type >= 801 && type <= 900) { 7989 + int count = friendsCount; 7998 7990 if (friendListStatus != 2) 7999 - k = 0; 8000 - if (i > 800) 8001 - i -= 701; 7991 + count = 0; 7992 + if (type > 800) 7993 + type -= 701; 8002 7994 else 8003 - i -= 101; 8004 - if (i >= k) { 7995 + type -= 101; 7996 + if (type >= count) { 8005 7997 widget.disabledText = ""; 8006 7998 widget.actionType = 0; 8007 7999 return; 8008 8000 } 8009 - if (friendWorlds[i] == 0) 8001 + if (friendWorlds[type] == 0) 8010 8002 widget.disabledText = "@red@Offline"; 8011 - else if (friendWorlds[i] < 200) { 8012 - if (friendWorlds[i] == world) 8013 - widget.disabledText = "@gre@World" + (friendWorlds[i] - 9); 8003 + else if (friendWorlds[type] < 200) { 8004 + if (friendWorlds[type] == world) 8005 + widget.disabledText = "@gre@World" + (friendWorlds[type] - 9); 8014 8006 else 8015 - widget.disabledText = "@yel@World" + (friendWorlds[i] - 9); 8016 - } else if (friendWorlds[i] == world) 8017 - widget.disabledText = "@gre@Classic" + (friendWorlds[i] - 219); 8007 + widget.disabledText = "@yel@World" + (friendWorlds[type] - 9); 8008 + } else if (friendWorlds[type] == world) 8009 + widget.disabledText = "@gre@Classic" + (friendWorlds[type] - 219); 8018 8010 else 8019 - widget.disabledText = "@yel@Classic" + (friendWorlds[i] - 219); 8011 + widget.disabledText = "@yel@Classic" + (friendWorlds[type] - 219); 8020 8012 widget.actionType = 1; 8021 8013 return; 8022 8014 } 8023 - if (i == 203) { 8024 - int l = friendsCount; 8015 + if (type == 203) { 8016 + int count = friendsCount; 8025 8017 if (friendListStatus != 2) 8026 - l = 0; 8027 - widget.scrollLimit = l * 15 + 20; 8018 + count = 0; 8019 + widget.scrollLimit = count * 15 + 20; 8028 8020 if (widget.scrollLimit <= widget.height) 8029 8021 widget.scrollLimit = widget.height + 1; 8030 8022 return; 8031 8023 } 8032 - if (i >= 401 && i <= 500) { 8033 - if ((i -= 401) == 0 && friendListStatus == 0) { 8024 + if (type >= 401 && type <= 500) { 8025 + if ((type -= 401) == 0 && friendListStatus == 0) { 8034 8026 widget.disabledText = "Loading ignore list"; 8035 8027 widget.actionType = 0; 8036 8028 return; 8037 8029 } 8038 - if (i == 1 && friendListStatus == 0) { 8030 + if (type == 1 && friendListStatus == 0) { 8039 8031 widget.disabledText = "Please wait..."; 8040 8032 widget.actionType = 0; 8041 8033 return; 8042 8034 } 8043 - int i1 = ignoresCount; 8035 + int count = ignoresCount; 8044 8036 if (friendListStatus == 0) 8045 - i1 = 0; 8046 - if (i >= i1) { 8037 + count = 0; 8038 + if (type >= count) { 8047 8039 widget.disabledText = ""; 8048 8040 widget.actionType = 0; 8049 8041 return; 8050 8042 } else { 8051 - widget.disabledText = TextUtils.formatName(TextUtils.longToName(ignores[i])); 8043 + widget.disabledText = TextUtils.formatName(TextUtils.longToName(ignores[type])); 8052 8044 widget.actionType = 1; 8053 8045 return; 8054 8046 } 8055 8047 } 8056 - if (i == 503) { 8048 + if (type == 503) { 8057 8049 widget.scrollLimit = ignoresCount * 15 + 20; 8058 8050 if (widget.scrollLimit <= widget.height) 8059 8051 widget.scrollLimit = widget.height + 1; 8060 8052 return; 8061 8053 } 8062 - if (i == 327) { 8054 + if (type == 327) { 8063 8055 widget.rotationX = 150; 8064 8056 widget.rotationY = (int) (Math.sin((double) pulseCycle / 40D) * 256D) & 0x7ff; 8065 8057 if (characterModelChanged) { ··· 8097 8089 } 8098 8090 return; 8099 8091 } 8100 - if (i == 324) { 8092 + if (type == 324) { 8101 8093 if (aClass50_Sub1_Sub1_Sub1_1102 == null) { 8102 8094 aClass50_Sub1_Sub1_Sub1_1102 = widget.disabledImage; 8103 8095 aClass50_Sub1_Sub1_Sub1_1103 = widget.enabledImage; ··· 8110 8102 return; 8111 8103 } 8112 8104 } 8113 - if (i == 325) { 8105 + if (type == 325) { 8114 8106 if (aClass50_Sub1_Sub1_Sub1_1102 == null) { 8115 8107 aClass50_Sub1_Sub1_Sub1_1102 = widget.disabledImage; 8116 8108 aClass50_Sub1_Sub1_Sub1_1103 = widget.enabledImage; ··· 8123 8115 return; 8124 8116 } 8125 8117 } 8126 - if (i == 600) { 8118 + if (type == 600) { 8127 8119 widget.disabledText = reportedName; 8128 8120 if (pulseCycle % 20 < 10) { 8129 8121 widget.disabledText += "|"; ··· 8133 8125 return; 8134 8126 } 8135 8127 } 8136 - if (i == 620) 8128 + if (type == 620) 8137 8129 if (playerRights >= 1) { 8138 8130 if (reportMutePlayer) { 8139 8131 widget.disabledColor = 0xff0000; ··· 8145 8137 } else { 8146 8138 widget.disabledText = ""; 8147 8139 } 8148 - if (i == 660) { 8140 + if (type == 660) { 8149 8141 int k1 = loginScreenUpdateTime - lastLoginTime; 8150 8142 String s1; 8151 8143 if (k1 <= 0) ··· 8156 8148 s1 = k1 + " days ago"; 8157 8149 widget.disabledText = "You last logged in @red@" + s1 + "@bla@ from: @red@" + SignLink.dns; 8158 8150 } 8159 - if (i == 661) 8151 + if (type == 661) 8160 8152 if (recoveryQuestionSetTime == 0) 8161 8153 widget.disabledText = "\\nYou have not yet set any recovery questions.\\nIt is @lre@strongly@yel@ recommended that you do so.\\n\\nIf you don't you will be @lre@unable to recover your\\n@lre@password@yel@ if you forget it, or it is stolen."; 8162 8154 else if (recoveryQuestionSetTime <= loginScreenUpdateTime) { ··· 8175 8167 + formatWelcomeScreenDate(recoveryQuestionSetTime) 8176 8168 + "\\n\\nIf you do not remember making this request\\ncancel it immediately, and change your password."; 8177 8169 } 8178 - if (i == 662) { 8170 + if (type == 662) { 8179 8171 String s; 8180 8172 if (unreadWebsiteMessages == 0) 8181 8173 s = "@yel@0 unread messages"; ··· 8185 8177 s = "@gre@" + unreadWebsiteMessages + " unread messages"; 8186 8178 widget.disabledText = "You have " + s + "\\nin your message centre."; 8187 8179 } 8188 - if (i == 663) 8180 + if (type == 663) 8189 8181 if (lastPasswordChangeTime <= 0 || lastPasswordChangeTime > loginScreenUpdateTime + 10) 8190 8182 widget.disabledText = "Last password change:\\n@gre@Never changed"; 8191 8183 else 8192 8184 widget.disabledText = "Last password change:\\n@gre@" + formatWelcomeScreenDate(lastPasswordChangeTime); 8193 - if (i == 665) 8185 + if (type == 665) 8194 8186 if (membershipCreditRemaining > 2 && !memberServer) 8195 8187 widget.disabledText = "This is a non-members\\nworld. To enjoy your\\nmembers benefits we\\nrecommend you play on a\\nmembers world instead."; 8196 8188 else if (membershipCreditRemaining > 2) ··· 8201 8193 + "@yel@ days of\\nmember credit remaining.\\n\\n@lre@Credit low! Renew now\\n@lre@to avoid losing members."; 8202 8194 else 8203 8195 widget.disabledText = "You are not a member.\\n\\nChoose to subscribe and\\nyou'll get loads of extra\\nbenefits and features."; 8204 - if (i == 667) 8196 + if (type == 667) 8205 8197 if (membershipCreditRemaining > 2 && !memberServer) 8206 8198 widget.disabledText = "To switch to a members-only world:\\n1) Logout and return to the world selection page.\\n2) Choose one of the members world with a gold star next to it's name.\\n\\nIf you prefer you can continue to use this world,\\nbut members only features will be unavailable here."; 8207 8199 else if (membershipCreditRemaining > 0) 8208 8200 widget.disabledText = "To extend or cancel a subscription:\\n1) Logout and return to the frontpage of this website.\\n2)Choose the relevant option from the 'membership' section.\\n\\nNote: If you are a credit card subscriber a top-up payment will\\nautomatically be taken when 3 days credit remain.\\n(unless you cancel your subscription, which can be done at any time.)"; 8209 8201 else 8210 8202 widget.disabledText = "To initializeApplication a subscripton:\\n1) Logout and return to the frontpage of this website.\\n2) Choose 'Start a new subscription'"; 8211 - if (i == 668) { 8203 + if (type == 668) { 8212 8204 if (recoveryQuestionSetTime > loginScreenUpdateTime) { 8213 8205 widget.disabledText = "To cancel this request:\\n1) Logout and return to the frontpage of this website.\\n2) Choose 'Cancel recovery questions'."; 8214 8206 return; ··· 11028 11020 k2 += child.xOffset; 11029 11021 l2 += child.yOffset; 11030 11022 if (child.contentType > 0) 11031 - method103((byte) 2, child); 11023 + updateWidget(child); 11032 11024 if (child.type == 0) { 11033 11025 if (child.scrollPosition > child.scrollLimit - child.height) 11034 11026 child.scrollPosition = child.scrollLimit - child.height;
+1 -4
src/main/java/com/jagex/runescape/cache/media/TypeFace.java
··· 172 172 character = 174; 173 173 } 174 174 } 175 - if (character == '@' && character + 4 < string.length() && string.charAt(character + 4) == '@') { 176 - int stringColour = getColour(string.substring(character + 1, character + 4)); 177 - if (stringColour != -1) 178 - textColor = stringColour; 175 + if (character == '@' && idx + 4 < string.length() && string.charAt(idx + 4) == '@') { 179 176 idx += 4; 180 177 continue; 181 178 }