Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ASDss: where do u download source and clients now
      August 18, 2017, 10:39:31 PM
    • ASDss: yo
      August 18, 2017, 10:39:20 PM
    • dan v jad: click me 4 da fun ;)[link]
      August 18, 2017, 04:39:58 PM
    • stCky: Palidinho is your OpenGL (was it OpenGL?) stuff open source anywhere?
      August 16, 2017, 09:07:22 PM
    • Travas:BUILD THE WALL
      August 15, 2017, 09:28:49 PM
    • Travas: i have ass cancer
      August 15, 2017, 09:23:29 PM
    • stCky: what are the fudge are you tryna ask?
      August 15, 2017, 08:21:35 PM
    • bader: what are the rsps community alive ?
      August 15, 2017, 05:46:16 PM
    • bader: yo guys
      August 15, 2017, 05:46:08 PM
    • Spacehost:[link] Updated our thread :)
      August 15, 2017, 09:40:34 AM
    • Adaro: The client is in Download section at Homepage
      August 15, 2017, 01:09:20 AM
    • FaTe_Of_GoDs: where do i get the client?????????????
      August 14, 2017, 05:23:14 PM
    • stCky: can anyone help me? I cant login to the shoutbox
      August 13, 2017, 05:45:15 PM
    • drubrkletern: appeal denied
      August 13, 2017, 02:35:27 PM
    • King_Trout:[link]
      August 13, 2017, 11:17:12 AM
    • Cole1497: no sorry
      August 13, 2017, 10:27:14 AM
    • ayz: yo can anyone explain something to me
      August 13, 2017, 08:08:51 AM
    • coolking12: Hi
      August 13, 2017, 04:16:06 AM
    • stCky: n+1
      August 11, 2017, 06:09:24 PM
    • PalidinoDH: How many more pages are going to show errors before this dude gets on and fixes shit
      August 11, 2017, 04:57:00 PM

    Author Topic: 317refactor - the most usable 317 client  (Read 9812 times)

    0 Members and 1 Guest are viewing this topic.

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    317refactor - the most usable 317 client
    « on: November 17, 2014, 07:02:16 PM »
    317refactor
    An educational renaming of the #317 client

    This has been a project of mine for almost the last year. I have always had a passion for client development - it is a lot more fun to play with than server development, in my opinion. However, whilst developing this, I have been unable to add any features or modifications to the client and therefore the time has come where I must release this to the public and allow others to continue the project. Many sources have been used for the refactoring however besides the audio classes (which were refactored by veer) this is almost all my own work.

    Why?
    There is nothing more prohibitive to client development that many tutorials, snippets and tools are unsuitable for the large number of clients due to the deobfuscation process. All your client needs is a slightly different naming scheme to the author's and the guide is no longer applicable. There is little use in switching to a typical "refactored" client because the majority of these also lack a lot of renaming and therefore are not useful - whilst method names may be refactored suitably, the variable names may differ along with the method signatures and class names.

    To combat this, and aid client development, I have refactored the near-majority of the code in the #317 client. This will, hopefully, give client developers a good base to work from and encourage users to share snippets and tutorials as they will actually be used by a lot of people.

    What have I done?
    The code throughout the client has been refactored. Every class has a suitable name (even the less used ones, such as GameObjectSpawnRequest or WallDecoration. Almost every method has a suitable name along with having the arguments in a suitable order ([player, x, y, z] rather than [x, player, z, y]). The majority of global and local variables have been renamed to allow their meaning to be understood. Methods and variables within classes have been sorted in alphabetical order.

    Where can I get it?
    You can find the project at Jameskmonger/317refactor on GitHub. If you do not have Git, or do not wish to use it, you can simply download the project as a zip archive.

    How can I contribute?
    If you wish to contribute to the codebase directly, the best way would be to fork the GitHub repository, make your changes, and then submit a pull request. If you do not wish to do this, you are welcome to send me a forum PM detailing your changes and I will submit them to the repository.

    However, the way I would prefer people to contribute to this would be by using it for their own personal projects - whether they be private or public. I created it with the intent of allowing people further understanding of the client and so I'd like to see that! :)

    Credits
    Jagex - the client
    Ambokile - majority of the renaming
    veer - the sound system
    Clienthax - reference
    Cyberus - reference
    « Last Edit: November 17, 2014, 08:33:39 PM by Ambokile »


    Offlinetyb97

    • Member
    • ****
    • Posts: 6,195
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #1 on: November 17, 2014, 07:03:45 PM »
    Delicious.
    what if i want to stick it in? you got a problem with that?


    Offlinesk8rdude461

    • MOPARSCAPE WAS HACKED
    • Member
    • ****
    • *
    • Posts: 12,471
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #2 on: November 17, 2014, 08:04:48 PM »
    Awesome. He showed me the work a bit early so I knew about the client and such beforehand.. But why the alphabetical sorting? Is there a reason behind it because I don't see one... I personally just make methods at the bottom of the class as I go...

    Offlineimthenull

    • Member
    • ****
    • Posts: 2,511
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #3 on: November 17, 2014, 08:11:15 PM »

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #4 on: November 17, 2014, 08:12:54 PM »
    Awesome. He showed me the work a bit early so I knew about the client and such beforehand.. But why the alphabetical sorting? Is there a reason behind it because I don't see one... I personally just make methods at the bottom of the class as I go...

    I personally think it looks a lot cleaner having them sorted like that.



    whats the point in including useless classes such as https://github.com/Jameskmonger/317refactor/blob/master/src/com/jagex/runescape/DummyClass.java

    Just an oversight, I forgot to remove it! :)



    I'll be releasing tutorials in the next few days about how to get features such as these:




    Offlineimthenull

    • Member
    • ****
    • Posts: 2,511
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #5 on: November 17, 2014, 08:21:18 PM »
    Just a little critique - you should probably put a little more effort into packaging the classes. I don't like to see a huge list of random classes that shouldn't belong together.

    Also - what makes your client any different than Cyberus'? His is very well done and he gives proper credits to the people who helped him. #msg4215490

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #6 on: November 17, 2014, 08:38:31 PM »
    Just a little critique - you should probably put a little more effort into packaging the classes. I don't like to see a huge list of random classes that shouldn't belong together.

    Also - what makes your client any different than Cyberus'? His is very well done and he gives proper credits to the people who helped him. #msg4215490

    I plan to package it soon unless someone else gets there first :)

    I also give proper credits to the people who help me - I wasn't sure who wrote Cyberus' and Clienthax' clients (although I only used them for reference) and so no credits were given. I've added them now. I originally gave credits to veer because I knew who he was.

    Feel free to take a look at Cyberus' code. Huge chunks of it are unrefactored making it very difficult to use if you wish to develop at all:
    Code: Java
    1.         privateboolean aBoolean897 =false;
    2.         privatefinalint[] anIntArray898 =newint[5];
    3.         privateint anInt899 =-1;
    4.         privatefinalint anInt900 =-680;
    5.         privatefinalboolean[] aBooleanArray901 =newboolean[5];
    6.         privateint playerWeight;
    7.         protected MouseCapturer mouseCapturer;
    8.         privatevolatileboolean aBoolean905 =false;
    9.         privateString reportedName ="";
    10.         privateint anInt909 =-1;
    11.         privateboolean actionMenuOpen =false;
    12.         privateint anInt911;
    13.         privateString chatboxInput ="";
    14.         privatefinalint MAX_PLAYERS =2048;
    15.         privatefinalint localPlayerId =2047;
    16.         private Player[] players =new Player[MAX_PLAYERS];
    17.         privateint playerCount;
    18.         protectedint[] anIntArray917 =newint[MAX_PLAYERS];
    19.         privateint anInt918;
    20.         privateint[] anIntArray919 =newint[MAX_PLAYERS];
    21.         private Buffer[] playerBuffer =new Buffer[MAX_PLAYERS];
    22.         privateint anInt921;
    23.         privateint anInt922 =1;

    Code: Java
    1.         publicfinalvoid method105(int i_624_, int i_625_, Widget widget, int i_626_){
    2.                 try{
    3.                         if(widget.type==0
    4.                                         && widget.children!=null
    5.                                         &&(!widget.hiddenUntilHovered|| anInt1051 == widget.id|| anInt1073 == widget.id|| anInt1064 == widget.id)){
    6.                                 int i_627_ = Rasterizer.topX;
    7.                                 int i_628_ = Rasterizer.topY;
    8.                                 int i_629_ = Rasterizer.bottomX;
    9.                                 int i_630_ = Rasterizer.bottomY;
    10.                                 Rasterizer.setCoordinates(i_625_, i_626_, i_625_ + widget.width, i_626_ + widget.height);
    11.                                 int i_631_ = widget.children.length;
    12.                                 for(int i_632_ =0; i_632_ < i_631_; i_632_++){
    13.                                         int i_633_ = widget.childrenX[i_632_]+ i_625_;
    14.                                         int i_634_ = widget.childrenY[i_632_]+ i_626_ - i_624_;
    15.                                         Widget widget_635_ = Widget.cache[widget.children[i_632_]];
    16.                                         i_633_ += widget_635_.x;
    17.                                         i_634_ += widget_635_.y;
    18.                                         if(widget_635_.contentType>0){
    19.                                                 method75(widget_635_);
    20.                                         }
    21.                                         if(widget_635_.type==0){
    22.                                                 if(widget_635_.scrollPosition> widget_635_.scrollLimit- widget_635_.height){
    23.                                                         widget_635_.scrollPosition= widget_635_.scrollLimit- widget_635_.height;
    24.                                                 }

    Take a look through this project. It is completely refactored.

    Offlineimthenull

    • Member
    • ****
    • Posts: 2,511
    • Thanks: +0/-0
      • View Profile
    « Last Edit: November 17, 2014, 08:44:55 PM by imthenull »

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #8 on: November 17, 2014, 09:11:10 PM »
    Oops I forgot about that! I refactored loads, probably about 40 hours of work, then in early November I noticed a commit back in August had broken it somehow so I had to revert. I'll re-refactor it

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #9 on: November 17, 2014, 09:41:15 PM »
    Model header isn't really a 'header', its more meta information about the model.

    Code: [Select]
    stream.currentOffset = modelData.length - 18;

    ^



    ?????????????????????????????????????????????????????????????????????




    ?????????????????????????????????????????????????????????????????????

    Code: [Select]
    public void generateKeys() {
    int i = currentOffset;
    currentOffset = 0;
    byte abyte0[] = new byte[i];
    readBytes(i, 0, abyte0);
    BigInteger biginteger2 = new BigInteger(abyte0);
    BigInteger biginteger3 = biginteger2/* .modPow(biginteger, biginteger1) */;
    byte abyte1[] = biginteger3.toByteArray();
    currentOffset = 0;
    put(abyte1.length);
    putBytes(abyte1, abyte1.length, 0);
    }

    You mean, encipherBuffer? Or rather just 'encipher', 'encipherWithRSA' any of those would work.

    like. wut.

    youre naming is inconsistent, and I mean. common. i give it a silab sticker of silab.
    « Last Edit: November 17, 2014, 09:44:19 PM by sinisoul »

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #10 on: November 17, 2014, 09:46:57 PM »
    Model header isn't really a 'header', its more meta information about the model.

    Code: [Select]
    stream.currentOffset = modelData.length - 18;

    ^



    ?????????????????????????????????????????????????????????????????????




    ?????????????????????????????????????????????????????????????????????

    Code: [Select]
    public void generateKeys() {
    int i = currentOffset;
    currentOffset = 0;
    byte abyte0[] = new byte[i];
    readBytes(i, 0, abyte0);
    BigInteger biginteger2 = new BigInteger(abyte0);
    BigInteger biginteger3 = biginteger2/* .modPow(biginteger, biginteger1) */;
    byte abyte1[] = biginteger3.toByteArray();
    currentOffset = 0;
    put(abyte1.length);
    putBytes(abyte1, abyte1.length, 0);
    }

    You mean, encipherBuffer? Or rather just 'encipher', 'encipherWithRSA' any of those would work.

    like. wut.

    youre naming is inconsistent, and I mean. common. i give it a silab sticker of silab.

    All of those were named nicely before I fudgeed the repo up. applyRSA was the name I went for.

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #11 on: November 17, 2014, 09:47:49 PM »
    fix it.

    Offlineimthenull

    • Member
    • ****
    • Posts: 2,511
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #12 on: November 17, 2014, 09:59:24 PM »
    youre naming is inconsistent, and I mean. common. i give it a silab sticker of silab.
    your*

    and lol @ silab sticker

    p.s. i've been trying to catch you on irc sini, do you ever get on?

    Offlinesini

    • Member
    • ****
    • *
    • *
    • Posts: 5,785
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #13 on: November 17, 2014, 10:29:51 PM »
    no. not really. dont really touch rsps much anymore besides my combat project. if you want to get ahold of me shoot a pm

    OfflineAmbokile

    • Member
    • ****
    • Posts: 3,009
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #14 on: November 18, 2014, 06:28:32 PM »
    Refactored entire GameFont class and one small change to Buffer class.

    The entire GameFont class has been refactored with documentation on each piece of code along with Javadoc annotations for each method.

    Fun fact: the wave:, wave2: and shake: chat effects are handled in the GameFont class whereas the scroll: and slide: chat effects are handled in the Client class.

    OfflineRyley

    • Member
    • ****
    • *
    • Posts: 7,315
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #15 on: November 18, 2014, 06:36:34 PM »
    GameFont, eh. TypeFace fits it more, imo.

    Offlineimthenull

    • Member
    • ****
    • Posts: 2,511
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #16 on: November 18, 2014, 06:50:52 PM »
    drawCentredTextWithPotentialShadow
    gross

    OfflineRyley

    • Member
    • ****
    • *
    • Posts: 7,315
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #17 on: November 18, 2014, 06:54:14 PM »
    drawCentredTextWithPotentialShadow
    gross

    Right, just keep it drawText, the boolean 'shadowed' is enough to signify that the text will have a shadow.

    getTextDisplayedWidth ???

    Offlineimthenull

    • Member
    • ****
    • Posts: 2,511
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #18 on: November 18, 2014, 07:02:26 PM »
    keep it simple. you don't have to cite sources in your docs either - if someone wants to know what kerning means they can google it

    OfflineVain_

    • Member
    • ****
    • Posts: 3,054
    • Thanks: +0/-0
      • View Profile
    Re: 317refactor - the most usable 317 client
    « Reply #19 on: November 18, 2014, 07:03:23 PM »
    your naming is rather ridiculous..

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal