Thread: Gielinor-Netty-Framework

Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 40
  1. #21  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Posts
    2,622
    Thanks given
    201
    Thanks received
    813
    Rep Power
    1462
    Quote Originally Posted by Adam A View Post
    Appreciate the feedback and your work on your NIO framework , thanks dude. Just finding the best way to do Player updating in terms of desgin.
    I don't know if you ever looked at scape-emu (530 source, written by Graham and his brother). I thought that it had the best player updating design. It was so good that after seeing the source, I scrapped my current implementation and had switched to that.

    Edit: For your entity list. I found the best design in terms of speed and performance was to use a queue and an array. The queue contains valid unused mob indexes and the array is used for storing the reference to the entity.
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  2. #22  
    Registered Member
    Join Date
    Sep 2016
    Posts
    122
    Thanks given
    4
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by Advocatus View Post
    Skimmed through it.


    You need to look @ Entity Collection, your add method will not work with multiple players.
    Code:
        @Override
        public boolean add(T t) {
            for (int i = 0; i < capacity(); i++) {
                entity[i] = t;
                t.setIndex(i);
                size++;
                return true;
            }
            return false;
        }
    The login responses enum was pretty cute.

    You reference the player/create the object through the Login Session class. Would be a better idea to either make a Game Session class or rename this class.

    If you want a dummy player update packet, here
    Code:
    			/* a dummy encoder for the packet */
    			PacketBuilder builder = new PacketBuilder(81, Type.VARIABLE_SHORT);
    			builder.startBitAccess();
    			builder.putBits(1, 1); /* this player has updated */
    			builder.putBits(2, 3); /* indicates we teleported */
    			builder.putBits(2, 0); /* height level */
    			builder.putBits(1, 1); /* should the walk queue be discarded? */
    			builder.putBits(1, 1); /* is there a block update? */
    			builder.putBits(7, 48); /* local Y coordinate */
    			builder.putBits(7, 48); /* local X coordinate */
    			builder.putBits(8, 0); /* number of other players */
    			builder.putBits(11, 2047); /* magic id to indicate blocks follow */
    			builder.finishBitAccess();
    			builder.put((byte)0); /* empty mask - no blocks for this player */
    			player.write(builder.toPacket());
    This packet will allow you to render the landscape/terrain.
    From: https://github.com/MatthewBishop/Pos...blePlayer.java
    wtf is up with your variable naming? its always dollar sign first, because in some perl languages like PHP the code can be parsed more easily. Java does not have any benefit in doing this so there's no point in even using it.
    https://github.com/MatthewBishop/Pos...dater.java#L61

    this class is horrible, so for every incoming packet you're going to handle them in a switch statement? wtf
    https://github.com/MatthewBishop/Pos...etManager.java

    don't put all your packets in a single class like this, this horrible. class per packet is a far better design. looks like you ripped several pi classes tbh
    https://github.com/MatthewBishop/Pos...ionSender.java
    Reply With Quote  
     

  3. #23  
    Registered Member

    Join Date
    Sep 2016
    Posts
    384
    Thanks given
    1
    Thanks received
    117
    Rep Power
    311
    Quote Originally Posted by Advocatus View Post
    I don't know if you ever looked at scape-emu (530 source, written by Graham and his brother). I thought that it had the best player updating design. It was so good that after seeing the source, I scrapped my current implementation and had switched to that.

    Edit: For your entity list. I found the best design in terms of speed and performance was to use a queue and an array. The queue contains valid unused mob indexes and the array is used for storing the reference to the entity.

    Will be looking at ScapeEmulator and will be doing what you said on the Entity collection once I get this player updating done which is my main priority to do it right and efficiently.
    Reply With Quote  
     

  4. #24  
    Registered Member
    hc747's Avatar
    Join Date
    Dec 2013
    Age
    26
    Posts
    1,474
    Thanks given
    3,312
    Thanks received
    691
    Rep Power
    1098
    Quote Originally Posted by Adam A View Post
    Will be looking at ScapeEmulator and will be doing what you said on the Entity collection once I get this player updating done which is my main priority to do it right and efficiently.
    https://github.com/AdamAliRS/Gielino...ssion.java#L72 Goes against the event driven design of Netty and will actually cause you to lose on performance (through you performing a blocking operation) - I recommend you read up on the following and implement their solution: https://netty.io/4.0/api/io/netty/ch...nelFuture.html

    Additionally, https://github.com/AdamAliRS/Gielino...on.java#L55L58 should be replaced (as Capri suggested) with something like:

    Code:
    if (entity[i] == null) {
    entity[i] = t;
    t.setIndex(i);
    size++;
    return true;
    }
    Reply With Quote  
     

  5. #25  
    Registered Member
    Join Date
    Sep 2016
    Posts
    122
    Thanks given
    4
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by hc747 View Post
    https://github.com/AdamAliRS/Gielino...ssion.java#L72 Goes against the event driven design of Netty and will actually cause you to lose on performance (through you performing a blocking operation) - I recommend you read up on the following and implement their solution: https://netty.io/4.0/api/io/netty/ch...nelFuture.html

    Additionally, https://github.com/AdamAliRS/Gielino...on.java#L55L58 should be replaced (as Capri suggested) with something like:

    Code:
    if (entity[i] == null) {
    entity[i] = t;
    t.setIndex(i);
    size++;
    return true;
    }
    better solution instead of doing

    Code:
    if (entity[i] == null) {
    entity[i] = t;
    t.setIndex(i);
    size++;
    return true;
    }
    is to queue indexes. or else you're gonna have to search for an available index every time. when an index gets recycled it can be placed back in the queue, every time you need an available index poll the next index.
    Reply With Quote  
     

  6. Thankful user:


  7. #26  
    Registered Member

    Join Date
    Sep 2016
    Posts
    384
    Thanks given
    1
    Thanks received
    117
    Rep Power
    311
    Quote Originally Posted by hc747 View Post
    https://github.com/AdamAliRS/Gielino...ssion.java#L72 Goes against the event driven design of Netty and will actually cause you to lose on performance (through you performing a blocking operation) - I recommend you read up on the following and implement their solution: https://netty.io/4.0/api/io/netty/ch...nelFuture.html

    Additionally, https://github.com/AdamAliRS/Gielino...on.java#L55L58 should be replaced (as Capri suggested) with something like:

    Code:
    if (entity[i] == null) {
    entity[i] = t;
    t.setIndex(i);
    size++;
    return true;
    }
    Didn't know you could highlight things like that, thanks for the tips.

    Quote Originally Posted by Capri View Post
    better solution instead of doing

    Code:
    if (entity[i] == null) {
    entity[i] = t;
    t.setIndex(i);
    size++;
    return true;
    }
    is to cache the slots. queues work great for this. or else you're gonna have to search for an available index every-time.
    Will also be looking at queuing .
    Reply With Quote  
     

  8. #27  
    Chemist

    Advocatus's Avatar
    Join Date
    Dec 2009
    Posts
    2,622
    Thanks given
    201
    Thanks received
    813
    Rep Power
    1462
    Quote Originally Posted by Adam A View Post
    Will be looking at ScapeEmulator and will be doing what you said on the Entity collection once I get this player updating done which is my main priority to do it right and efficiently.
    Good. I look forward to seeing where you take this.

    @ Capri, I split my reply into multiple sections to address your criticisms. I agree with you on 2 out of the 3 points.

    It is noteworthy that the source you are critiquing is nearing 6 years without an update and the majority of the code is closer to 7 years or so old.

    Quote Originally Posted by Capri View Post
    wtf is up with your variable naming? its always dollar sign first, because in some perl languages like PHP the code can be parsed more easily. Java does not have any benefit in doing this so there's no point in even using it.
    https://github.com/MatthewBishop/Pos...dater.java#L61
    I actually have no idea what I was thinking with that. As I said it was a long time ago, and I can rarely remember what I had for lunch a few days ago.

    Quote Originally Posted by Capri View Post
    this class is horrible, so for every incoming packet you're going to handle them in a switch statement? wtf
    https://github.com/MatthewBishop/Pos...etManager.java
    Note the age of the server and the lack of features at the time. This class was obviously a placeholder.


    Quote Originally Posted by Capri View Post
    don't put all your packets in a single class like this, this horrible. class per packet is a far better design. looks like you ripped several pi classes tbh
    https://github.com/MatthewBishop/Pos...ionSender.java
    The time this was written, rs2hd (by extension rs2dv) and hyperion were the best available options. Both of these used the same system/layout. It was more familiar for me at the time.
    Quote Originally Posted by blakeman8192 View Post
    Quitting is the only true failure.
    Reply With Quote  
     

  9. Thankful user:


  10. #28  
    Registered Member
    Join Date
    Jul 2016
    Age
    27
    Posts
    392
    Thanks given
    19
    Thanks received
    61
    Rep Power
    68
    Thanks for contribution


    Sent from my iPhone using Tapatalk
    Thanks,
    Mikk
    Reply With Quote  
     

  11. #29  
    Registered Member

    Join Date
    Sep 2016
    Posts
    384
    Thanks given
    1
    Thanks received
    117
    Rep Power
    311
    Quote Originally Posted by flosd View Post
    Thanks for contribution


    Sent from my iPhone using Tapatalk
    Np dude.


    OT
    Got a new job, but got some updates done to be pushed later on.
    Reply With Quote  
     

  12. #30  
    Registered Member
    Join Date
    Sep 2016
    Posts
    122
    Thanks given
    4
    Thanks received
    30
    Rep Power
    0
    Quote Originally Posted by Adam A View Post
    Np dude.


    OT
    Got a new job, but got some updates done to be pushed later on.
    programming job?
    Reply With Quote  
     

Page 3 of 4 FirstFirst 1234 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Netty Framework
    By Chiief in forum Requests
    Replies: 5
    Last Post: 10-15-2010, 03:43 AM
  2. Replies: 2
    Last Post: 09-26-2010, 04:42 AM
  3. Replies: 8
    Last Post: 08-28-2010, 09:16 PM
  4. 562 Scratch Netty Framework. QuickServ.
    By Warbo in forum Show-off
    Replies: 7
    Last Post: 07-27-2010, 12:59 AM
  5. Creating a Client & Server in JBoss's Netty framework
    By Virus X3 in forum Application Development
    Replies: 2
    Last Post: 05-25-2010, 05:46 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •