Thread: Character help! Urgent

Results 1 to 9 of 9
  1. #1 Character help! Urgent 
    Registered Member puresdeath's Avatar
    Join Date
    May 2008
    Posts
    172
    Thanks given
    12
    Thanks received
    1
    Rep Power
    4
    so i just found out people can log onto any account on my server without knowing the password, you can just choose any pass and it will log onto a account. please someone help! im not sure if it just started or if it was after i added something.. i have team viewer if that helps. my source is formationx

    Quote Originally Posted by Andrew View Post
    Never, knew blunt objects with spikes came out of your pants.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Apr 2011
    Posts
    161
    Thanks given
    9
    Thanks received
    12
    Rep Power
    3
    Perhaps post your Rs2LoginProtocolDecoder.java you probably have something done wrong in there.
    Reply With Quote  
     

  3. #3  
    Registered Member puresdeath's Avatar
    Join Date
    May 2008
    Posts
    172
    Thanks given
    12
    Thanks received
    1
    Rep Power
    4
    i tried my backup source and i had no trouble with it so im not sure whats wrong guess ill just use that one. also when i ip ban someone they just log back in beecause they change there ip is there a way to ban there perm ip somehow not there temp one?

    Quote Originally Posted by Andrew View Post
    Never, knew blunt objects with spikes came out of your pants.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Apr 2011
    Posts
    161
    Thanks given
    9
    Thanks received
    12
    Rep Power
    3
    Quote Originally Posted by puresdeath View Post
    i tried my backup source and i had no trouble with it so im not sure whats wrong guess ill just use that one. also when i ip ban someone they just log back in beecause they change there ip is there a way to ban there perm ip somehow not there temp one?
    Lol I know what you mean its annoying...But you can't really do anything if they change their IP.

    Good luck with your source though .
    Reply With Quote  
     

  5. #5  
    Registered Member puresdeath's Avatar
    Join Date
    May 2008
    Posts
    172
    Thanks given
    12
    Thanks received
    1
    Rep Power
    4
    Quote Originally Posted by iamanoob View Post
    Lol I know what you mean its annoying...But you can't really do anything if they change their IP.

    Good luck with your source though .
    thanks, im still having character password trouble, do you have a fix or a thread to show me how to re code the character file password part

    Quote Originally Posted by Andrew View Post
    Never, knew blunt objects with spikes came out of your pants.
    Reply With Quote  
     

  6. #6  
    looking for partnership

    Satan's Avatar
    Join Date
    Oct 2010
    Posts
    833
    Thanks given
    287
    Thanks received
    68
    Rep Power
    269
    post your password save methode

    [/url]
    Reply With Quote  
     

  7. #7  
    Registered Member puresdeath's Avatar
    Join Date
    May 2008
    Posts
    172
    Thanks given
    12
    Thanks received
    1
    Rep Power
    4
    Quote Originally Posted by Johan View Post
    post your password save methode
    where exactly would that be? and is this the code you wanted?

    Code:
    				case 1:
    					if (token.equals("character-password")) {
    						if (playerPass.equalsIgnoreCase(token2)
    								|| Misc.basicEncrypt(playerPass).equals(token2)) {
    							playerPass = token2;
    						} else {
    							return 3;
    						}
    					}
    					break;

    Quote Originally Posted by Andrew View Post
    Never, knew blunt objects with spikes came out of your pants.
    Reply With Quote  
     

  8. #8  
    Registered Member puresdeath's Avatar
    Join Date
    May 2008
    Posts
    172
    Thanks given
    12
    Thanks received
    1
    Rep Power
    4
    Quote Originally Posted by iamanoob View Post
    Perhaps post your Rs2LoginProtocolDecoder.java you probably have something done wrong in there.
    okay here is my rs2LoginProtocolDecoder

    Code:
    package server.net;
    
    import org.apache.mina.common.ByteBuffer;
    import org.apache.mina.common.IoFuture;
    import org.apache.mina.common.IoFutureListener;
    import org.apache.mina.common.IoSession;
    import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
    import org.apache.mina.filter.codec.ProtocolCodecFilter;
    import org.apache.mina.filter.codec.ProtocolDecoderOutput;
    
    import server.Config;
    import server.Connection;
    import server.Server;
    import server.model.players.Client;
    import server.model.players.PlayerHandler;
    import server.model.players.PlayerSave;
    import server.util.ISAACRandomGen;
    
    /**
     * Login protocol decoder.
     * @author Graham
     * @author Ryan / Lmctruck30 <- login Protocol fixes
     *
     */
    public class RS2LoginProtocolDecoder extends CumulativeProtocolDecoder {
    	
    	/**
    	 * Parses the data in the provided byte buffer and writes it to
    	 * <code>out</code> as a <code>Packet</code>.
    	 *
    	 * @param session The IoSession the data was read from
    	 * @param in	  The buffer
    	 * @param out	 The decoder output stream to which to write the <code>Packet</code>
    	 * @return Whether enough data was available to create a packet
    	 */
    	@Override
    	public boolean doDecode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) {
    			synchronized(session) {
    				Object loginStageObj = session.getAttribute("LOGIN_STAGE");
    				int loginStage = 0;
    				if(loginStageObj != null) {
    					loginStage = (Integer)loginStageObj;
    				}
    				//Logger.log("recv login packet, stage: "+loginStage);
    				switch(loginStage) {
    				case 0:
    					if(2 <= in.remaining()) {
    						int protocol = in.get() & 0xff;
    						@SuppressWarnings("unused")
    						int nameHash = in.get() & 0xff;
    						if(protocol == 14) {
    							long serverSessionKey = ((long) (java.lang.Math.random() * 99999999D) << 32) + (long) (java.lang.Math.random() * 99999999D);
    						    StaticPacketBuilder s1Response = new StaticPacketBuilder();
    						    s1Response.setBare(true).addBytes(new byte[] { 0, 0, 0, 0, 0, 0, 0, 0 }).addByte((byte) 0).addLong(serverSessionKey);
    						    session.setAttribute("SERVER_SESSION_KEY", serverSessionKey);
    						    session.write(s1Response.toPacket());
    						    session.setAttribute("LOGIN_STAGE", 1);
    						}
    						return true;
    					} else {
    						in.rewind();
    						return false;
    					}
    				case 1:
    					@SuppressWarnings("unused")
    					int loginType = -1, loginPacketSize = -1, loginEncryptPacketSize = -1;
    					if(2 <= in.remaining()) {
    						loginType = in.get() & 0xff; //should be 16 or 18
    						loginPacketSize = in.get() & 0xff;
    						loginEncryptPacketSize = loginPacketSize-(36+1+1+2);
    						if(loginPacketSize <= 0 || loginEncryptPacketSize <= 0) {
    							System.out.println("Zero or negative login size.");
    							session.close();
    							return false;
    						}
    					} else {
    						in.rewind();
    						return false;
    					}
    					if(loginPacketSize <= in.remaining()) {
    						int magic = in.get() & 0xff;
    						int version = in.getUnsignedShort();
    						if(magic != 255) {
    							//System.out.println("Wrong magic id.");
    							session.close();
    							return false;
    						}
    						if(version != 1) {
    							//Dont Add Anything
    						}
    						@SuppressWarnings("unused")
    						int lowMem = in.get() & 0xff;
    						for(int i = 0; i < 9; i++) {
    							in.getInt();
    						}
    						loginEncryptPacketSize--;
    						if(loginEncryptPacketSize != (in.get() & 0xff)) {
    							System.out.println("Encrypted size mismatch.");
    							session.close();
    							return false;
    						}
    						if((in.get() & 0xff) != 10) {
    							System.out.println("Encrypted id != 10.");
    							session.close();
    							return false;
    						}
    						long clientSessionKey = in.getLong();
    						long serverSessionKey = in.getLong();
    						int uid = in.getInt();
    						
    						if(uid == 0 || uid == 99735086) {
    							session.close();
    							return false;
    						}
    						
    						String name = readRS2String(in);
    						String pass = readRS2String(in);
    						int sessionKey[] = new int[4];
    						sessionKey[0] = (int)(clientSessionKey >> 32);
    						sessionKey[1] = (int)clientSessionKey;
    						sessionKey[2] = (int)(serverSessionKey >> 32);
    						sessionKey[3] = (int)serverSessionKey;
    						ISAACRandomGen inC = new ISAACRandomGen(sessionKey);
    						for(int i = 0; i < 4; i++) sessionKey[i] += 50;
    						ISAACRandomGen outC = new ISAACRandomGen(sessionKey);
    						load(session, uid, name, pass, inC, outC, version);
    						// WorkerThread.load(session, name, pass, inC, outC);
    						session.getFilterChain().remove("protocolFilter");
    						session.getFilterChain().addLast("protocolFilter", new ProtocolCodecFilter(new GameCodecFactory(inC)));
    						return true;
    					} else {
    						in.rewind();
    						return false;
    					}
    				}
    			}
    		return false;
    	}
    
    	private synchronized void load(final IoSession session, final int uid, String name, String pass, final ISAACRandomGen inC, ISAACRandomGen outC, int version) {
    		session.setAttribute("opcode", -1);
    		session.setAttribute("size", -1);
    		int loginDelay = 1;
    		int returnCode = 2;
    		
    		name = name.trim();
    		name = name.toLowerCase();
    		pass = pass.toLowerCase();
    		
    		if(!name.matches("[A-Za-z0-9 ]+")) {
    			returnCode = 4;
    		}
    		
    		if(name.length() > 12) {
    			returnCode = 8;
    		}
    		
    		Client cl = new Client(session, -1);
    		cl.playerName = name;
    		cl.playerName2 = cl.playerName;
    		cl.playerPass = pass;
    		cl.setInStreamDecryption(inC);
    		cl.setOutStreamDecryption(outC);
    		cl.outStream.packetEncryption = outC;
    				
    		cl.saveCharacter = false;
    		
    		char first = name.charAt(0);
    		cl.properName = Character.toUpperCase(first)+ name.substring(1, name.length());
    		
    		if(Connection.isNamedBanned(cl.playerName)) {
    			returnCode = 4;
    		}
    
    
    		
    		if(PlayerHandler.isPlayerOn(name)) {
    			returnCode = 5;
    		}
    		
    		//if(Config.CLIENT_VERSION != version) {
    			//returnCode = 6;
    		//}
    		
    		if(PlayerHandler.playerCount >= Config.MAX_PLAYERS) {
    			returnCode = 7;
    		}
    		
    //		Login Limit Exceeded
    //		if() {
    //			returnCode = 9;
    //		}
    		
    		if(Server.UpdateServer) {
    			returnCode = 14;
    		}
    		
    //		if(Connection.checkLoginList(loginIp)) {
    //			returnCode = 16;
    //		}
    		
    //		Just Left World Login Delay Included
    //		if() {
    //			returnCode = 21;
    //		}
    		
    		if(returnCode == 2) {
    			int load = PlayerSave.loadGame(cl, cl.playerName, cl.playerPass);
    			if (load == 0)
    				cl.addStarter = true;
    			if(load == 3) {
    				returnCode = 3;
    				cl.saveFile = false;
    			} else {
    				for(int i = 0; i < cl.playerEquipment.length; i++) {
    					if(cl.playerEquipment[i] == 0) {
    						cl.playerEquipment[i] = -1;
    						cl.playerEquipmentN[i] = 0;
    					}
    				}
    				if(!Server.playerHandler.newPlayerClient(cl)) {
    					returnCode = 7;
    					cl.saveFile = false;
    				} else {
    					cl.saveFile = true;
    				}
    			}
    		}
    		
    		cl.packetType = -1;
    		cl.packetSize = 0;
    		
    		StaticPacketBuilder bldr = new StaticPacketBuilder();
    		bldr.setBare(true);
    		bldr.addByte((byte) returnCode);
    		if(returnCode == 2) {
    			cl.saveCharacter = true;
    			if(cl.playerRights == 3) {
    				bldr.addByte((byte) 2);
    			} else {
    				bldr.addByte((byte) cl.playerRights);
    			}
    			//cl.playerServer = "riotscape.no-ip.info";
    		} else if(returnCode == 21) {
    			bldr.addByte((byte) loginDelay);
    		} else {
    			bldr.addByte((byte) 0);
    		}
    		cl.isActive = true;
    		bldr.addByte((byte) 0);
    		Packet pkt = bldr.toPacket();
    		final Client fcl = cl;
    		session.setAttachment(cl);
    		session.write(pkt).addListener(new IoFutureListener() {
    			@Override
    			public void operationComplete(IoFuture arg0) {
    				session.getFilterChain().remove("protocolFilter");
    				session.getFilterChain().addFirst("protocolFilter", new ProtocolCodecFilter(new GameCodecFactory(inC)));				
    			}
    		});
    	}
    
    	private synchronized String readRS2String(ByteBuffer in) {
    		StringBuilder sb = new StringBuilder();
    		byte b;
    		while((b = in.get()) != 10) {
    			sb.append((char) b);
    		}
    		return sb.toString();
    	}
    
    
    
    	/**
    	 * Releases the buffer used by the given session.
    	 *
    	 * @param session The session for which to release the buffer
    	 * @throws Exception if failed to dispose all resources
    	 */
    	@Override
    	public void dispose(IoSession session) throws Exception {
    		super.dispose(session);
    	}
    
    }

    Quote Originally Posted by Andrew View Post
    Never, knew blunt objects with spikes came out of your pants.
    Reply With Quote  
     

  9. #9  
    Banned

    Join Date
    Oct 2010
    Posts
    1,309
    Thanks given
    63
    Thanks received
    257
    Rep Power
    0
    OMG server name!!? lol jokes, i had this problem before and the problem was in playersave.java i added something rong or overwrote the password save bit, so u might wanna check on that
    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

Similar Threads

  1. [URGENT] Bad Memory leak [URGENT]
    By Mini Slurpee in forum Help
    Replies: 1
    Last Post: 08-11-2011, 02:13 PM
  2. [urgent]player files not saving![/urgent]
    By silabgarza in forum Help
    Replies: 6
    Last Post: 06-25-2011, 11:40 AM
  3. [PI] Character File not found..[Urgent]
    By Kduffy45 in forum Help
    Replies: 6
    Last Post: 03-03-2011, 01:07 AM
  4. [URGENT] Coords loading glitch [URGENT]
    By The Myth in forum Help
    Replies: 9
    Last Post: 08-21-2009, 04:53 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
  •