Thread: [emulos help]

Results 1 to 8 of 8
  1. #1 [emulos help] 
    Banned

    Join Date
    Oct 2007
    Posts
    928
    Thanks given
    17
    Thanks received
    2
    Rep Power
    0
    anyone know how to get this tut:
    http://www.rune-server.org/showthread.php?t=132053

    to work with emulos?
    Reply With Quote  
     

  2. #2  
    Registered Member
    Sway's Avatar
    Join Date
    Feb 2008
    Age
    33
    Posts
    1,201
    Thanks given
    97
    Thanks received
    419
    Rep Power
    4948
    thats client-side, not server side.







    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Oct 2007
    Posts
    928
    Thanks given
    17
    Thanks received
    2
    Rep Power
    0
    Check the bottom of the tut, im asking how to make it work with emulos.
    Reply With Quote  
     

  4. #4  
    Registered Member
    Sway's Avatar
    Join Date
    Feb 2008
    Age
    33
    Posts
    1,201
    Thanks given
    97
    Thanks received
    419
    Rep Power
    4948
    Quote Originally Posted by CRANK View Post
    Check the bottom of the tut, im asking how to make it work with emulos.
    use the java file searcher and search

    Code:
    Public Void Run()







    Reply With Quote  
     

  5. #5  
    Banned

    Join Date
    Oct 2007
    Posts
    928
    Thanks given
    17
    Thanks received
    2
    Rep Power
    0
    Wow you think im that stupid, when i add it i still get T2 errors...

    thats why i need the correct configs which i dont know.

    heres my void run:

    Code:
    	public void run() {
    		
    		isActive = false;
    		long serverSessionKey = 0, clientSessionKey = 0;
    		
    		serverSessionKey = ((long)(java.lang.Math.random() * 99999999D) << 32) + (long)(java.lang.Math.random() * 99999999D);
    
    		try {
    			
    			fillInStream(2);
    
    			for(int i = 0; i < 8; i++) out.write(0);			
    			out.write(0);
    
    			outStream.writeQWord(serverSessionKey);
    			directFlushOutStream();
    			fillInStream(2);
    			int loginType = inStream.readUnsignedByte();	
    			if(loginType != 16 && loginType != 18) {	
    				return;
    			}
    			int loginPacketSize = inStream.readUnsignedByte();
    			int loginEncryptPacketSize = loginPacketSize-(36+1+1+2);	
    			if(loginEncryptPacketSize <= 0) {	
    				return;
    			}
    			fillInStream(loginPacketSize);
    			if(inStream.readUnsignedByte() != 255 || inStream.readUnsignedWord() != 317) {	
    				return;
    			}
    			lowMemoryVersion = inStream.readUnsignedByte();
    		
    			for(int i = 0; i < 9; i++) {
    				Integer.toHexString(inStream.readDWord());
    			}
    
    			loginEncryptPacketSize--;		
    			int tmp = inStream.readUnsignedByte();
    			if(loginEncryptPacketSize != tmp) {
    				
    				return;
    			}
    			tmp = inStream.readUnsignedByte();
    			if(tmp != 10) {	
    				return;
    			}	
    			clientSessionKey = inStream.readQWord();
    			serverSessionKey = inStream.readQWord();
    			int UID = inStream.readDWord();
    			
    			if(UID == 0 || UID == 99735086) { //all for free bot and syi will get ip banned straight away
    				ConnectionHandler.addIpToBanList(connectedFrom);
    				ConnectionHandler.addIpToFile(connectedFrom);
    				returnCode = 11;
    				disconnected = true;
    				saveFile = false;
    			}
    			
    			playerName = inStream.readString();		
    			playerName = playerName.replaceAll("_", " ");	
    			playerName = playerName.replaceAll("[^A-z 0-9]", " ");
    			playerName = (playerName.substring(0, 1).toUpperCase() + playerName.substring(1).toLowerCase()).trim();
    			if(playerName == null || playerName.length() == 0) playerName = "player"+playerId;
    			playerPass = inStream.readString();
    			Misc.println(playerName+" has connected - UID: " +UID );
    			
    			int sessionKey[] = new int[4];
    			sessionKey[0] = (int)(clientSessionKey >> 32);
    			sessionKey[1] = (int)clientSessionKey;
    			sessionKey[2] = (int)(serverSessionKey >> 32);
    			sessionKey[3] = (int)serverSessionKey;
    
    			
    			for(int i = 0; i < 4; i++) {
    				Integer.toHexString(sessionKey[i]);
    			}
    
    			inStreamDecryption = new Cryption(sessionKey);
    			for(int i = 0; i < 4; i++) sessionKey[i] += 50;
    
    			for(int i = 0; i < 4; i++)
    				Integer.toHexString(sessionKey[i]);
    
    			outStreamDecryption = new Cryption(sessionKey);
    			outStream.packetEncryption = outStreamDecryption;
    
    			returnCode = 2;
    			
    		
    			if(ConnectionHandler.isNamedBanned(playerName)) {
    				returnCode = 4;
    				disconnected = true;
    				saveFile = false;
    			}
    			if(Server.playerHandler.isPlayerOn(playerName)) {
    				returnCode = 5;
    				disconnected = true;
    				saveFile = false;
    			}
    				
    			int load = PlayerSave.loadGame(Server.playerHandler.players[playerId], playerName, playerPass);
    			if(load == 2) {
    				returnCode = 3;
    				disconnected = true;
    				saveFile = false;
    			}
    			
    			if(playerId == -1) {
    				out.write(7);	
    			}			
    			else out.write(returnCode);				
    			out.write(playerRights > 2 ? 2 : playerRights);		
    			out.write(0);
    		} catch(Exception e) {
    			Misc.println("Login fail from " +connectedFrom);			
    			destruct();
    			disconnected = true;
    			return;
    		}
    		isActive = true;
    		if(playerId == -1 || returnCode != 2) return;		
    		
    		packetSize = 0;
    		packetType = -1;
    
    		readPtr = 0;
    		writePtr = 0;
    
    		int numBytesInBuffer, offset;
    		while(!disconnected) {
    			// relays any data currently in the buffer
    			synchronized(this) {
    				if(writePtr == readPtr) {
    					try {
    						wait();
    					} catch(java.lang.InterruptedException _ex) { }
    				}
    
    				if(disconnected) return;
    
    				offset = readPtr;
    				if(writePtr >= readPtr) numBytesInBuffer = writePtr - readPtr;
    				else numBytesInBuffer = Config.BUFFER_SIZE - readPtr;
    			}
    			if(numBytesInBuffer > 0) {
    				try {
    					//Thread.sleep(3000);		// artificial lag for testing purposes
                        			out.write(buffer, offset, numBytesInBuffer);
    					readPtr = (readPtr + numBytesInBuffer) % Config.BUFFER_SIZE;
    					if(writePtr == readPtr) out.flush();
    				} catch(java.lang.Exception __ex) {
    					disconnected = true;
    				}
                }
    		}
    	}
    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Mar 2008
    Posts
    1,945
    Thanks given
    118
    Thanks received
    201
    Rep Power
    2104
    lol

    emulous/server/model/players/cleint.java

    search run()

    find playerRights in the run

    replace out.write(playerRights > 2 ? 2 : playerRights); with this

    Code:
    if (playerRights == 4) { 
    } //just ignore this. But do add it.
    if (playerRights == 3) { 
    out.write(3); //Crown fixup 
    } else { 
    out.write(playerRights); // mod level 
    }
    Attached image
    Reply With Quote  
     

  7. #7  
    Banned

    Join Date
    Oct 2007
    Posts
    928
    Thanks given
    17
    Thanks received
    2
    Rep Power
    0
    thanks worked xD

    edit: rep for yoooo
    Reply With Quote  
     

  8. #8  
    Donator


    Join Date
    Mar 2008
    Posts
    1,945
    Thanks given
    118
    Thanks received
    201
    Rep Power
    2104
    thank you
    Attached image
    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
  •