Thread: TopList functionality

Page 1 of 13 12311 ... LastLast
Results 1 to 10 of 122
  1. #1 TopList functionality 
    Administrator

    Kevy's Avatar
    Join Date
    Jul 2006
    Posts
    1,428
    Thanks given
    204
    Thanks received
    1,905
    Rep Power
    5000
    Players online protocol has been added to TopList! This means every server can now show how much people are currently online on the details page. It is really easy to implent! Takes only about few lines of code.

    Quote Originally Posted by Vastastico View Post
    Hyperion simple modification of 1 file.

    Code:
    case OPCODE_PLAYERCOUNT:
                        session.write(new PacketBuilder().putShort(World.getWorld().getPlayers().size()).toPacket());
                        return true;
    beneath:
    Code:
    case OPCODE_UPDATE:
                        session.setAttribute("state", STATE_UPDATE);
                        session.write(new PacketBuilder().put(INITIAL_RESPONSE).toPacket());
                        return true;
    add:
    Code:
    public static final int OPCODE_PLAYERCOUNT = 20;
    beneath:
    Code:
    public static final int OPCODE_UPDATE = 15;
    Adding it to WL is also very easy. More detailed TUT coming soon!

    PI: Java - Rune-Server Official Pastebin

    As you can see this feature is trusting the count server sends to it. Altough there may be some people who will increase this value, thatswhy faking the value will get your server disabled on the list for a week and account banned for a week too! There will be a report button soon and moderators who deal with them!

    Edit: I will release the PHP script soon, so you can display how many people are online in your signature or on site!

    Edit:

    Code:
     <?php  $fs = @fsockopen("localhost", 50000, $errno, $errstr, 2);
    
       if($fs)
       {
        stream_set_timeout($fs, 2);
        write_byte($fs, 20);
        $players = read_short($fs);
        @fclose($fs);
    
         echo "Server is online, players: ".$players;
       }
       else
         echo "Server is offline.";
    
      function write_byte($fs, $b)
      {
       @fwrite($fs, chr($b));
      }
    
      function read_byte($fs)
      {
       return ord(@fread($fs, 1));
      }
    
      function read_ubyte($fs)
      {
       return read_byte($fs) & 0xff;
      }
    
      function read_short($fs)
      {
       return (read_ubyte($fs) << 8) + read_ubyte($fs);
      }
    
     ?>
    Thanks, Kevin.
     

  2. Thankful users:


  3. #2  
    SERGEANT OF THE MASTER SERGEANTS MOST IMPORTANT PERSON OF EXTREME SERGEANTS TO THE MAX!

    cube's Avatar
    Join Date
    Jun 2007
    Posts
    8,871
    Thanks given
    1,854
    Thanks received
    4,745
    Rep Power
    5000
    inb4howcaniaddthistomypi

    Attached image

     


  4. #3  
    Registered Member
    Teemuzz's Avatar
    Join Date
    Oct 2009
    Posts
    2,755
    Thanks given
    1,212
    Thanks received
    422
    Rep Power
    934
    nice 1st
    edit: fuck u square..
     

  5. #4  
    Registered Member

    Join Date
    Sep 2007
    Age
    32
    Posts
    2,396
    Thanks given
    5
    Thanks received
    436
    Rep Power
    902
    Nice feature I was wondering when toplist owners would start adding this

    In Project Insanity open RS2LoginDecoder

    and search for:

    Code:
    if(protocol == 14) {
    and replace that line with

    Code:
    if(protocol == 16){
    							session.write(new StaticPacketBuilder().addShort((PlayerHandler.playerCount*50)).toPacket());
    							session.close();
    							return false;
    						} else if(protocol == 14) {
    Hyperion V2 Martin's Updates.

    Scar says:
    i hate it when it hits your face
     

  6. #5  
    Registered Member minimike150's Avatar
    Join Date
    Aug 2009
    Age
    30
    Posts
    56
    Thanks given
    0
    Thanks received
    1
    Rep Power
    13
    Nice addition, I always wondered why top lists didn't have this!
    Look forward to seeing the tutorials for WL.
     

  7. #6  
    Professional Java Developer

    Rainex's Avatar
    Join Date
    Jan 2010
    Age
    28
    Posts
    667
    Thanks given
    102
    Thanks received
    32
    Rep Power
    77
    nice i think it will add more activity to toplist
     

  8. #7  
    sυввч

    Sub's Avatar
    Join Date
    Aug 2007
    Age
    24
    Posts
    4,352
    Thanks given
    1,205
    Thanks received
    359
    Rep Power
    2845
    Quote Originally Posted by Kevy View Post
    Players online protocol has been added to TopList! This means every server can now show how much people are currently online on the details page. It is really easy to implent! Takes only about few lines of code.



    Adding it to WL is also very easy. More detailed TUT coming soon!

    As you can see this feature is trusting the count server sends to it. Altough there may be some people who will increase this value, thatswhy faking the value will get your server disabled on the list for a week and account banned for a week too! There will be a report button soon and moderators who deal with them!

    how we ment to send to your server
     

  9. #8  
    :doge:

    Join Date
    Jan 2009
    Posts
    3,758
    Thanks given
    221
    Thanks received
    817
    Rep Power
    2116
    so all your doing is writing a byte to the server via the toplist? and when the byte is received the server can handle it(just like the js5 protocol)?
     

  10. #9  
    「 m e o w 」「 m e o w 」

    Thee Wolf's Avatar
    Join Date
    Sep 2008
    Posts
    3,692
    Thanks given
    695
    Thanks received
    1,678
    Rep Power
    5000
    Very interesting.
     

  11. #10  
    :doge:

    Join Date
    Jan 2009
    Posts
    3,758
    Thanks given
    221
    Thanks received
    817
    Rep Power
    2116
    why are you using opcode 16 though.. the runescape client uses that opcode. you should change it to something different.
     

  12. Thankful users:


Page 1 of 13 12311 ... 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. Toplist!
    By Division in forum Website Development
    Replies: 21
    Last Post: 07-09-2010, 11:55 PM
  2. Toplist
    By La Lampara in forum Forum Related Help
    Replies: 2
    Last Post: 03-14-2010, 02:11 PM
  3. Toplist
    By Tyler in forum Suggestions
    Replies: 19
    Last Post: 10-19-2008, 10:25 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
  •