Thread: update key loading/update server

Results 1 to 5 of 5
  1. #1 update key loading/update server 
    Registered Member

    Join Date
    Jun 2007
    Age
    26
    Posts
    3,007
    Thanks given
    52
    Thanks received
    98
    Rep Power
    3208
    How would I go about making one of these? If I wanted to convert winterlove from 317 to 474 (was just an example) then what would I need to learn to add an update key loader/update server?
    Reply With Quote  
     

  2. #2  
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    27
    Posts
    1,358
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    Woops missed read lol
    Visit Rune Miracle [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member

    Join Date
    Jun 2007
    Age
    26
    Posts
    3,007
    Thanks given
    52
    Thanks received
    98
    Rep Power
    3208
    I know all the bottom stuff but that has nothing to do with an update server, sorry if I confused you in my original post.

    I tried to look for the 474 protocol data on runewiki but it isn't there
    Reply With Quote  
     

  4. #4  
    Registered Member
    craig903's Avatar
    Join Date
    Sep 2007
    Age
    27
    Posts
    1,358
    Thanks given
    14
    Thanks received
    92
    Rep Power
    238
    Well a simple update/key sending server is real easy to do.


    Here is some example code from a 474 rs2hd server.

    When the connection has been recieved you have to check for a byte 15 instead of 14(Case 0 of the example below). If it was a 15 then the case -1 is called when more data is recieved, then -2.


    Code:
    	    switch (loginStage) {
    	    case -2:
    		if (8 <= in.remaining()) {
    		    for (int i = 0; i < 8; i++) {
    			in.get();
    		    }
    		    StaticPacketBuilder ukeys = new StaticPacketBuilder();
    		    ukeys.setBare(true);
    		    for (int key : Constants.UPDATE_KEYS) {
    			ukeys.addByte((byte) key);
    		    }
    		    session.write(ukeys.toPacket());
    		    session.close();
    		    return true;
    		}
    		in.rewind();
    		return false;
    	    case -1:
    		if (3 <= in.remaining()) {
    		    in.get();
    		    int clientVersion = in.getShort();
    		    if (clientVersion == 474) {
    			StaticPacketBuilder u1Response = new StaticPacketBuilder();
    			u1Response.setBare(true).addByte((byte) 0);
    			session.write(u1Response.toPacket());
    			session.setAttribute("LOGIN_STAGE", -2);
    		    }
    		    return true;
    		}
    		in.rewind();
    		return false;
    	    case 0: // first login packets
    		if (2 <= in.remaining()) {
    		    int protocolId = in.get() & 0xff;
    		    @SuppressWarnings("unused")
    		    int namePart = in.get() & 0xff;
    		    if (protocolId == 15) {
    			session.setAttribute("LOGIN_STAGE", -1);
    		    } else {
    			long serverSessionKey = ((long) (java.lang.Math
    				.random() * 99999999D) << 32)
    				+ (long) (java.lang.Math.random() * 99999999D);
    			StaticPacketBuilder s1Response = new StaticPacketBuilder();
    			s1Response.setBare(true).addByte((byte) 0).addLong(
    				serverSessionKey);
    			session.setAttribute("SERVER_SESSION_KEY",
    				serverSessionKey);
    			session.write(s1Response.toPacket());
    			session.setAttribute("LOGIN_STAGE", 1);
    			// Logger.log("protocolId="+protocolId+"; namePart="+namePart);
    		    }
    		    return true;
    		} else {
    		    in.rewind();
    		    return false;
    		}
    Visit Rune Miracle [Only registered and activated users can see links. ]
    Reply With Quote  
     

  5. #5  
    Registered Member

    Join Date
    Jun 2007
    Age
    26
    Posts
    3,007
    Thanks given
    52
    Thanks received
    98
    Rep Power
    3208
    Don't really understand it :/


    Would be so much easier if someone filled this in: [Only registered and activated users can see links. ]
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •