v50 Steam/Premium information for editors
- v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
- Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.
Editing User:Quietust/rawextract.php
Jump to navigation
Jump to search
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | <nowiki><? | + | <nowiki><? |
$versions = array( | $versions = array( | ||
1287 => '0.31.01', | 1287 => '0.31.01', | ||
Line 41: | Line 41: | ||
1442 => '0.40.02', | 1442 => '0.40.02', | ||
1443 => '0.40.03', | 1443 => '0.40.03', | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
); | ); | ||
Line 109: | Line 50: | ||
while (1) | while (1) | ||
{ | { | ||
− | $len = | + | $len = readLong($file); |
if (feof($file)) | if (feof($file)) | ||
break; | break; | ||
Line 151: | Line 92: | ||
if (isset($versions[$version])) | if (isset($versions[$version])) | ||
echo "World is from version $versions[$version]\n"; | echo "World is from version $versions[$version]\n"; | ||
− | else echo "World is from an unrecognized version | + | else echo "World is from an unrecognized version!\n"; |
$comp = readLong($raw); | $comp = readLong($raw); | ||
if ($comp == 1) | if ($comp == 1) | ||
Line 161: | Line 102: | ||
if ($version >= 1372) | if ($version >= 1372) | ||
fseek($raw, 0x14, SEEK_CUR); | fseek($raw, 0x14, SEEK_CUR); | ||
− | if ($version >= | + | if ($version >= 1400) |
fseek($raw, 0x4, SEEK_CUR); | fseek($raw, 0x4, SEEK_CUR); | ||
if ($version >= 1441) | if ($version >= 1441) | ||
fseek($raw, 0x14, SEEK_CUR); | fseek($raw, 0x14, SEEK_CUR); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
if (readByte($raw)) | if (readByte($raw)) | ||
{ | { | ||
Line 186: | Line 116: | ||
$len = readShort($raw); | $len = readShort($raw); | ||
$world = fread($raw, $len); | $world = fread($raw, $len); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
echo "Extracting randomly generated raws of $world:\n\n"; | echo "Extracting randomly generated raws of $world:\n\n"; | ||
} | } | ||
Line 208: | Line 127: | ||
if (isset($versions[$version])) | if (isset($versions[$version])) | ||
echo "World is from version $versions[$version]\n"; | echo "World is from version $versions[$version]\n"; | ||
− | else echo "World is from an unrecognized version | + | else echo "World is from an unrecognized version!\n"; |
$comp = readLong($raw); | $comp = readLong($raw); | ||
if ($comp == 1) | if ($comp == 1) | ||
Line 218: | Line 137: | ||
if ($version >= 1372) | if ($version >= 1372) | ||
fseek($raw, 0x14, SEEK_CUR); | fseek($raw, 0x14, SEEK_CUR); | ||
− | if ($version >= | + | if ($version >= 1400) |
fseek($raw, 0x4, SEEK_CUR); | fseek($raw, 0x4, SEEK_CUR); | ||
− | if ($version >= 1441) | + | if ($version >= 1441) // GUESS |
fseek($raw, 0x14, SEEK_CUR); | fseek($raw, 0x14, SEEK_CUR); | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
$len = readShort($raw); | $len = readShort($raw); | ||
Line 238: | Line 147: | ||
$len = readShort($raw); | $len = readShort($raw); | ||
$world = fread($raw, $len); | $world = fread($raw, $len); | ||
− | + | echo "Extracting randomly generated raws of $world:\n\n"; | |
− | + | readLong($raw); // year | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | echo "Extracting randomly generated raws of $world | ||
} | } | ||
Line 283: | Line 181: | ||
extractList($raw, 'plant', array('PLANT')); | extractList($raw, 'plant', array('PLANT')); | ||
− | if ($version >= | + | if ($version >= 1400) |
extractList($raw, 'item', array('ITEM_.*?')); | extractList($raw, 'item', array('ITEM_.*?')); | ||
Line 290: | Line 188: | ||
if ($version >= 1441) | if ($version >= 1441) | ||
extractList($raw, 'entity', array('ENTITY')); | extractList($raw, 'entity', array('ENTITY')); | ||
− | |||
− | |||
− | |||
if ($version >= 1372) | if ($version >= 1372) | ||
extractList($raw, 'interaction', array('INTERACTION')); | extractList($raw, 'interaction', array('INTERACTION')); | ||
− | if ($version >= | + | if ($version >= 1441) |
extractList($raw, 'language', array('TRANSLATION')); | extractList($raw, 'language', array('TRANSLATION')); | ||
echo "done!\n"; | echo "done!\n"; | ||
?></nowiki> | ?></nowiki> |