Thread: The preferences.dat

Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1 The preferences.dat 
    WVWVWVWVWVWVWVW

    _jordan's Avatar
    Join Date
    Nov 2012
    Posts
    3,046
    Thanks given
    111
    Thanks received
    1,848
    Rep Power
    5000
    Haven't seen much info on it, especially any defining of each byte in the file.
    The preferences are read when the client opens but I got this info from the login block.
    The preferences.dat stores 34 bytes of general information about your client such as graphics or volume settings.
    The first byte is an opcode, in this case 24 but there can be other values.

    What the client does during game login.
    Code:
        final ByteStream method2452(int i) {
            ByteStream stream = new ByteStream(Class208.method2624());
            stream.writeByte(24);
            stream.writeByte(aClass157_Sub6_4822.method1332());
            stream.writeByte(aClass157_Sub15_4808.method1360());
            stream.writeByte(aClass157_Sub22_4802.method1397());
            stream.writeByte(aClass157_Sub1_4792.method1317());
            stream.writeByte(aClass157_Sub19_4786.method1382());
            stream.writeByte(aClass157_Sub20_4796.method1387());
            stream.writeByte(aClass157_Sub2_4791.method1320());
            stream.writeByte(aClass157_Sub10_4809.method1347());
            stream.writeByte(aClass157_Sub11_4814.method1350());
            stream.writeByte(aClass157_Sub4_4816.method1326());
            stream.writeByte(aClass157_Sub25_4821.method1408());
            stream.writeByte(aClass157_Sub24_4800.method1404());
            stream.writeByte(aClass157_Sub28_4787.method1419());
            stream.writeByte(aClass157_Sub13_4794.method1356());
            stream.writeByte(aClass157_Sub14_4824.method1359());
            stream.writeByte(aClass157_Sub18_4799.method1379());
            stream.writeByte(aClass157_Sub26_4797.method1410());
            stream.writeByte(aClass157_Sub21_4790.method1393());
            stream.writeByte(aClass157_Sub16_4798.method1365(false));
            stream.writeByte(aClass157_Sub8_4811.method1342());
            stream.writeByte(aClass157_Sub29_4820.method1424());
            stream.writeByte(aClass157_Sub9_4807.method1346());
            stream.writeByte(aClass157_Sub23_4817.method1400());
            stream.writeByte(aClass157_Sub27_4805.method1413());
            stream.writeByte(aClass157_Sub3_4804.method1323());
            stream.writeByte(aClass157_Sub12_4795.method1354());
            stream.writeByte(aClass157_Sub5_4789.method1330());
            stream.writeByte(aClass157_Sub7_4815.method1339());
            stream.writeByte(aClass157_Sub7_4825.method1339());
            stream.writeByte(aClass157_Sub7_4801.method1339());
            stream.writeByte(aClass157_Sub7_4785.method1339());
            stream.writeByte(aClass157_Sub7_4813.method1339());
            stream.writeByte(aClass157_Sub17_4803.method1371());
            return stream;
        }
    What these are (in order)
    Code:
                opcode = payload.readUnsignedByte().toInt(),
                antiAliasing = payload.readUnsignedByte().toInt(),
                bloom = payload.readUnsignedByte().toInt(),
                brightness = payload.readUnsignedByte().toInt(),
                buildArea = payload.readUnsignedByte().toInt(),
                flickeringEffects = payload.readUnsignedByte().toInt(),
                fog = payload.readUnsignedByte().toInt(),
                groundBlending = payload.readUnsignedByte().toInt(),
                groundDecoration = payload.readUnsignedByte().toInt(),
                idleAnimations = payload.readUnsignedByte().toInt(),
                lightingDetail = payload.readUnsignedByte().toInt(),
                sceneryShadows = payload.readUnsignedByte().toInt(),
                particles = payload.readUnsignedByte().toInt(),
                removeRoofs = payload.readUnsignedByte().toInt(),
                maxScreenSize = payload.readUnsignedByte().toInt(),
                skyDetail = payload.readUnsignedByte().toInt(),
                characterShadows = payload.readUnsignedByte().toInt(),
                smallTextures = payload.readUnsignedByte().toInt(),
                textures = payload.readUnsignedByte().toInt(),
                graphicsMode = payload.readUnsignedByte().toInt(),
                animateBackground = payload.readUnsignedByte().toInt(),
                waterDetail = payload.readUnsignedByte().toInt(),
                screenSize = payload.readUnsignedByte().toInt(),
                customCursors = payload.readUnsignedByte().toInt(),
                preset = payload.readUnsignedByte().toInt(),
                cpuUsage = payload.readUnsignedByte().toInt(),
                loadingSequence = payload.readUnsignedByte().toInt(),
                safeMode = payload.readUnsignedByte().toInt(),
                soundEffects = payload.readUnsignedByte().toInt(),
                areaSounds = payload.readUnsignedByte().toInt(),
                voiceOverVolume = payload.readUnsignedByte().toInt(),
                music = payload.readUnsignedByte().toInt(),
                themeMusicVolume = payload.readUnsignedByte().toInt(),
                stereoSound = payload.readUnsignedByte().toInt()
    Quote Originally Posted by Graham View Post
    > The first byte is an opcode, in this case 24 but there can be other values.

    It's really the version number, so the client can load older preferences files. e.g. 550 uses v11:
    Last edited by _jordan; 08-08-2021 at 12:53 AM. Reason: updated
    Attached image
    Attached image
    Reply With Quote  
     


  2. #2  
    08-13, SpawnScape Owner

    jet kai's Avatar
    Join Date
    Dec 2009
    Age
    28
    Posts
    870
    Thanks given
    630
    Thanks received
    957
    Rep Power
    5000
    Thanks for share!
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Registered Member
    rebecca's Avatar
    Join Date
    Aug 2017
    Posts
    1,071
    Thanks given
    862
    Thanks received
    915
    Rep Power
    5000
    cool jordan ty =]
    Reply With Quote  
     

  5. Thankful user:


  6. #4  
    Banned

    Join Date
    Mar 2015
    Age
    31
    Posts
    1,332
    Thanks given
    215
    Thanks received
    329
    Rep Power
    0
    thanks for the info
    Reply With Quote  
     

  7. Thankful user:


  8. #5  
    Registered Member Cisco's Avatar
    Join Date
    May 2021
    Posts
    27
    Thanks given
    16
    Thanks received
    16
    Rep Power
    21
    Useful information.

    Thank you for the share Jordan!
    Reply With Quote  
     

  9. Thankful user:


  10. #6  
    The preferences.dat



    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    30
    Posts
    16,307
    Thanks given
    7,215
    Thanks received
    12,308
    Rep Power
    5000
    Quote Originally Posted by _jordan View Post
    Still missing some because I can't figure out what they are.
    Code:
    public final Buffer serialise() {
    	Buffer buffer = new Buffer(optionCount());
    	buffer.writeByte(25);
    	buffer.writeByte(antialiasingMode.getValue());
    	buffer.writeByte(bloom.getValue());
    	buffer.writeByte(brightness.getValue());
    	buffer.writeByte(buildArea.getValue());
    	buffer.writeByte(flickeringEffects.getValue());
    	buffer.writeByte(fog.getValue());
    	buffer.writeByte(groundBlending.getValue());
    	buffer.writeByte(groundDecor.getValue());
    	buffer.writeByte(idleAnimations.getValue());
    	buffer.writeByte(lightDetail.getValue());
    	buffer.writeByte(hardShadows.getValue());
    	buffer.writeByte(orthographic.getValue());
    	buffer.writeByte(particles.getValue());
    	buffer.writeByte(removeRoofs.getValue());
    	buffer.writeByte(maxScreenSize.getValue());
    	buffer.writeByte(skydetail.getValue());
    	buffer.writeByte(spotShadows.getValue());
    	buffer.writeByte(smallTextures.getValue());
    	buffer.writeByte(textures.getValue());
    	buffer.writeByte(toolkitDefault.getValue());
    	buffer.writeByte(animateBackground.getValue());
    	buffer.writeByte(waterDetail.getValue());
    	buffer.writeByte(screenSize.getValue());
    	buffer.writeByte(customCursors.getValue());
    	buffer.writeByte(graphicsLevel.getValue());
    	buffer.writeByte(cpuUsage.getValue());
    	buffer.writeByte(loadingSequence.getValue());
    	buffer.writeByte(safeMode.getValue());
    	buffer.writeByte(soundVolume.getValue());
    	buffer.writeByte(backgroundSoundVolume.getValue());
    	buffer.writeByte(voiceOverVolume.getValue());
    	buffer.writeByte(musicVolume.getValue());
    	buffer.writeByte(themeMusicVolume.getValue());
    	buffer.writeByte(stereoSound.getValue());
    	return buffer;
    }

    Attached image
    Reply With Quote  
     

  11. Thankful users:


  12. #7  
    Christ is King

    Makar's Avatar
    Join Date
    Jul 2011
    Age
    29
    Posts
    2,004
    Thanks given
    545
    Thanks received
    965
    Rep Power
    427
    There's what I had done for 727 when I was refactoring the CS2 around it.

    https://github.com/titandino/darkan-...nces.java#L414
    Attached image
    The best open-source pre-eoc remake project that isn't in its early stages for once
    Darkan Client (727 Client Refactor)
    Darkan World Server
    “It would not be impossible to prove with sufficient repetition and a psychological understanding of the people concerned that a square is in fact a circle. They are mere words, and words can be molded until they clothe ideas and disguise.”
    Reply With Quote  
     

  13. Thankful users:


  14. #8  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,147
    Thanks given
    2,656
    Thanks received
    3,731
    Rep Power
    5000
    > The first byte is an opcode, in this case 24 but there can be other values.

    It's really the version number, so the client can load older preferences files. e.g. 550 uses v11:

    Code:
     @OriginalMember(owner = "client!fh", name = "b", descriptor = "(I)Lclient!fd;")
    	public static Buffer encode() {
    		@Pc(13) Buffer buffer = new Buffer(34);
    		buffer.writeByte(11);
    		buffer.writeByte(brightness);
    		buffer.writeByte(allLevelsVisible ? 1 : 0);
    		buffer.writeByte(roofsVisible ? 1 : 0);
    		buffer.writeByte(groundDecoration ? 1 : 0);
    		buffer.writeByte(highDetailTextures ? 1 : 0);
    		buffer.writeByte(manyIdleAnimations ? 1 : 0);
    		buffer.writeByte(flickeringEffects ? 1 : 0);
    		buffer.writeByte(groundTextures ? 1 : 0);
    		buffer.writeByte(characterShadows ? 1 : 0);
    		buffer.writeByte(sceneryShadows);
    		buffer.writeByte(highDetailLighting ? 1 : 0);
    		buffer.writeByte(highDetailWater ? 1 : 0);
    		buffer.writeByte(fog ? 1 : 0);
    		buffer.writeByte(antiAliasingMode);
    		buffer.writeByte(stereo ? 1 : 0);
    		buffer.writeByte(soundEffectsVolume);
    		buffer.writeByte(musicVolume);
    		buffer.writeByte(areaSoundsVolume);
    		buffer.writeShort(fullScreenWidth);
    		buffer.writeShort(fullScreenHeight);
    		buffer.writeByte(getParticles());
    		buffer.writeInt(favouriteWorlds);
    		buffer.writeByte(windowMode);
    		buffer.writeByte(safeMode ? 1 : 0);
    		buffer.writeByte(aBoolean293 ? 1 : 0);
    		buffer.writeByte(buildArea);
    		buffer.writeByte(hdr ? 1 : 0);
    		buffer.writeByte(customCursors ? 1 : 0);
    		return buffer;
    	}
    .
    Reply With Quote  
     

  15. Thankful users:


  16. #9  
    Banned

    Join Date
    Mar 2010
    Posts
    2,218
    Thanks given
    170
    Thanks received
    262
    Rep Power
    0
    Interesting.. If your preferences.dat is for settings then what are random.dat / preferences2.dat used for?
    Reply With Quote  
     

  17. #10  
    Programmer, Contributor, RM and Veteran




    Join Date
    Mar 2007
    Posts
    5,147
    Thanks given
    2,656
    Thanks received
    3,731
    Rep Power
    5000
    Quote Originally Posted by Ynneh View Post
    Interesting.. If your preferences.dat is for settings then what are random.dat / preferences2.dat used for?
    random.dat contains a 24 byte unique ID, I think Jagex use this to help track players/computers even if their IP changes or if the IP is shared due to NAT.

    (The older uid.dat file was similar but only 4 bytes long, so not universally unique.)

    I don't know about preferences2.
    .
    Reply With Quote  
     

  18. Thankful user:


Page 1 of 2 12 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. Where could I get the 317 dat files for models?
    By cool1234567 in forum Models
    Replies: 0
    Last Post: 10-22-2017, 07:40 PM
  2. Replies: 17
    Last Post: 11-30-2010, 11:09 PM
  3. Do you prefer the old czar days?
    By Michael11 in forum RS2 Server
    Replies: 6
    Last Post: 10-12-2010, 03:32 AM
  4. Trailer dats culer den the rest
    By Rugrats in forum Show-off
    Replies: 14
    Last Post: 07-22-2010, 08:45 PM
  5. the water .dat
    By karbon v2 in forum Help
    Replies: 0
    Last Post: 01-23-2010, 11:43 PM
Tags for this Thread

View Tag Cloud

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