Thread: Netty317 - A networking only implementation, for building your own base.

Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 33
  1. #11  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    4,421
    Thanks given
    891
    Thanks received
    1,527
    Rep Power
    3285
    Thanks for the share.
    Reply With Quote  
     

  2. #12  
    Banned Netty317 - A networking only implementation, for building your own base. Market Banned


    Join Date
    Jan 2011
    Age
    26
    Posts
    3,112
    Thanks given
    1,198
    Thanks received
    1,479
    Rep Power
    0
    Too much global state... also singleton is generally considered an anti-pattern so you should try to avoid using it. Not a fan of how you designed some things (some of which were previously pointed out). I recommend reading up on some design patterns.
    Reply With Quote  
     

  3. #13  
    Registered Member MightyNes's Avatar
    Join Date
    Apr 2015
    Age
    26
    Posts
    130
    Thanks given
    101
    Thanks received
    12
    Rep Power
    9
    I'm personally not a big fan of old runescape. Goodluck with this.
    Reply With Quote  
     

  4. #14  
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,422
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    Quote Originally Posted by Kaleem View Post
    First of all, I think this is a very good idea, but for a few improvements (cba to look at github):
    Code:
    Packet.send(session.context(), "send-message", "Welcome to runescape.");
    • Not OO
    • Referring to outgoing packets via string is a bad idea, people cannot see an existing list unless they go into the source, possible misspellings, etc, use a class or something of the sort
    • I'd definitely prefer to use
      Code:
      session.context().writeAndFlush(new SendMessage("Welcome to runescape."));
      as if it's that much of a problem, you can use a helper method like
      Code:
      player.write(new SendMessage("Welcome to RuneScape"));
      (What server had that usage? Looks sick)
    • Also instead of using object varargs as the end parameter, I would make it so the outgoing packet class constructor contains the elements, what if a person doesn't know what arguments an outgoing packet contains? What if they don't know the order it should be in? All of that is avoided with the constructor containing elements/data
    While it's not OO i guess it just turned into preference, but yes, a helper class does make it look nicer and I'll probably make a commit sometime soon. The varargs was just a preference I had, but I see what you're saying from a standpoint of if the user wasn't sure. I'll make the update, thanks for the feedback.

    EDIT: This has been updated.
    Reply With Quote  
     

  5. Thankful user:


  6. #15  
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,422
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    Quote Originally Posted by lare96 View Post
    Too much global state... also singleton is generally considered an anti-pattern so you should try to avoid using it. Not a fan of how you designed some things (some of which were previously pointed out). I recommend reading up on some design patterns.
    Design patterns are definitely one of my biggest fall-backs. However as for the comment about the Singleton.

    Anti-pattern discussion:
    it is overused, introduces unnecessary restrictions in situations where a sole instance of a class is not actually required, and introduces global state into an application

    ---

    I agree that IN THIS the singleton is not exactly required, and it does introduce a small amount of global state.
    However it IS required in my implementation of it, for various reasons.

    ---

    I don't see any reason that the server should be initialized more than once here anyway, so a singleton pattern is just a way to prohibit it. - Correct me if I'm wrong.

    ---

    I've yet to find very many reads that help me with design patterns, which is why I always reference from code for patterns and try to adopt habits. The main question is, is there anything that you saw that directly influences performance? Or just design preference?
    Reply With Quote  
     

  7. #16  
    Registered Member
    Join Date
    Nov 2014
    Posts
    47
    Thanks given
    12
    Thanks received
    5
    Rep Power
    15
    Good job, Christian! Thanks for the contribution.
    Reply With Quote  
     

  8. #17  
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,422
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    Quote Originally Posted by Kaleem View Post
    Code:
    player.write(new SendMessage("Welcome to RuneScape"));
    Updated and committed.
    Reply With Quote  
     

  9. Thankful user:


  10. #18  
    Registered Member
    CTucker's Avatar
    Join Date
    Oct 2008
    Posts
    2,422
    Thanks given
    263
    Thanks received
    281
    Rep Power
    343
    Bumping to obtain for criticism, etc.
    Reply With Quote  
     

  11. #19  
    Endeavor

    Mikey`'s Avatar
    Join Date
    Dec 2007
    Posts
    4,434
    Thanks given
    715
    Thanks received
    1,435
    Rep Power
    1202
    Quote Originally Posted by CTucker View Post
    Bumping to obtain for criticism, etc.
    Doesn't really make since in my opinion for a player to extend a mob (if mob means npc in this context), it'd be better to have an Actor or CharacterEntity class that extends Entity and provides the common ground shared between players and npcs.
    Reply With Quote  
     

  12. #20  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    Reply With Quote  
     

Page 2 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. For noobs only! How to jar your Pi Client
    By timdegreen in forum Snippets
    Replies: 2
    Last Post: 01-23-2013, 02:51 AM
  2. Replies: 2
    Last Post: 01-02-2010, 10:41 AM
  3. Replies: 13
    Last Post: 10-17-2008, 11:18 PM
  4. Replies: 19
    Last Post: 02-29-2008, 07:24 PM
  5. How to: Make your own base farming.
    By RSSJ in forum Tutorials
    Replies: 3
    Last Post: 12-05-2007, 12:14 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •