CryPak文件档案系统.doc_第1页
CryPak文件档案系统.doc_第2页
CryPak文件档案系统.doc_第3页
CryPak文件档案系统.doc_第4页
CryPak文件档案系统.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

CryPak文件档案系统 CryPak是一个模块,可以存储游戏内容文件,并可以压缩和解压缩。特点 与标准压缩格式兼容(执行是基于Zlib库) 支持以标准文件系统之外的存储文件存档 数据可以同步读取(直接加载数据存档)和异步(流)通过IStreamCallback方式加载(最大4GB偏移,4GB大小的文件) 文件可以存储为压缩或解压缩形式 未压缩文件可以按需求读取部分 文件名比较不区分大小写(内部一切都转换为小写) 支持加载Zip/Pak文件,最大4GB(事实证明过的是超过2.1GB)Unicode和绝对路径处理 内部所有路径处理代码都是基于ASCII没有Unicode功能。这是为了节省内存和使用简单。没有对Unicode作为游戏的实际需要可以以ASCII路径进行开发如果没有这项规则的话,在制作其他国家版本的时候可能会出现问题。应避免用户如果以Unicode字符集作为游戏安装目录或文件夹。分层 通常游戏数据内哦那个被组织在游戏安装目录下的一些Pak文件里。如果一个文件要求打开擦做。CryPak系统会通过循环查找所有注册的Pak文件来找到此文件。这也可能混合直接存储到文件系统里的一些松散文件(没有放入Pak文件中)。如果一个文件作为松散的文件存在在Pak文档中,松散的文件会被作为开发模式下游戏的首选。然而为了避免游戏中的作弊,如果游戏不是在开发模式下,存储到Pak文件中的文件会比它作为松散文件时更优先。斜杠 通常使用前斜杠作为引擎的内部处理,但用户可以在输入路径中包含反斜杠。特殊文件夹的处理 路径别名%user%可用于相对于用户文件夹的指定路径。这可能需要存储用户的特定数据。Window对用户限制在其中存储文件。例如程序文件夹可能不可写,由于这个原因,屏幕截图,保存游戏的数据还有其他文件可能会被存储到用户文件夹下。一下是有效路径的例子。无法找到源代码格式的语言:文本。可用语言是Actionscript,html,java,javascript,none,sql,xthml,xml。%user%ProfilesSingle/lisa.datGame/Fred.dat内部的 这里有一个已知的执行缺陷,当每个目录超过1000个文件左右时会导致问题。 格式化属性: Zip文件格式每个文件头存储了它的路径和文件名以非压缩文本格式。为了更快的文件访问,有一个目录在文件结尾。该目录以未压缩文本形式保存路径和文件名(冗余)扩充阅读Contributor: PHIL KATZ System of Origin : IBMOriginal author : Phil KatzFILE FORMAT-Files stored in arbitrary order. Large zipfiles can span multiplediskette media. Local File Header 1 file 1 extra field file 1 comment file data 1 Local File Header 2 file 2 extra field file 2 comment file data 2 . . . Local File Header n file n extra field file n comment file data n Central Directory central extra field central comment End of Central Directory end commentEOFLOCAL FILE HEADER-OFFSET LABEL TYP VALUE DESCRIPTION- - - - - 00 ZIPLOCSIG HEX 04034B50 ;Local File Header Signature 04 ZIPVER DW 0000 ;Version needed to extract 06 ZIPGENFLG DW 0000 ;General purpose bit flag 08 ZIPMTHD DW 0000 ;Compression method 0A ZIPTIME DW 0000 ;Last mod file time (MS-DOS) 0C ZIPDATE DW 0000 ;Last mod file date (MS-DOS) 0E ZIPCRC HEX 00000000 ;CRC-3212 ZIPSIZE HEX 00000000 ;Compressed size 16 ZIPUNCMP HEX 00000000 ;Uncompressed size1A ZIPFNLN DW 0000 ;Filename length1C ZIPXTRALN DW 0000 ;Extra field length 1E ZIPNAME DS ZIPFNLN ;filename - ZIPXTRA DS ZIPXTRALN ;extra field CENTRAL DIRECTORY STRUCTURE- OFFSET LABEL TYP VALUE DESCRIPTION- - - - -00 ZIPCENSIG HEX 02014B50 ;Central file header signature 04 ZIPCVER DB 00 ;Version made by 05 ZIPCOS DB 00 ;Host operating system 06 ZIPCVXT DB 00 ;Version needed to extract 07 ZIPCEXOS DB 00 ;O/S of version needed for extraction 08 ZIPCFLG DW 0000 ;General purpose bit flag 0A ZIPCMTHD DW 0000 ;Compression method 0C ZIPCTIM DW 0000 ;Last mod file time (MS-DOS)0E ZIPCDAT DW 0000 ;Last mod file date (MS-DOS) 10 ZIPCCRC HEX 00000000 ;CRC-3214 ZIPCSIZ HEX 00000000 ;Compressed size18 ZIPCUNC HEX 00000000 ;Uncompressed size 1C ZIPCFNL DW 0000 ;Filename length 1E ZIPCXTL DW 0000 ;Extra field length 20 ZIPCCML DW 0000 ;File comment length 22 ZIPDSK DW 0000 ;Disk number start24 ZIPINT DW 0000 ;Internal file attributes LABEL BIT DESCRIPTION - - - ZIPINT 0 if = 1, file is apparently an ASCII or text file 0 if = 0, file apparently contains binary data 1-7 unused in version 1.0. 26 ZIPEXT HEX 00000000 ;External file attributes, host ;system dependent2A ZIPOFST HEX 00000000 ;Relative offset of local header ;from the start of the first disk ;on which this file appears2E ZIPCFN DS ZIPCFNL ;Filename or path - should not ;contain a drive or device letter, ;or a leading slash. All slashes ;should be forward slashes / - ZIPCXTR DS ZIPCXTL ;extra field- ZIPCOM DS ZIPCCML ;file commentEND OF CENTRAL DIR STRUCTURE- OFFSET LABEL TYP VALUE DESCRIPTION - - - - - 00 ZIPESIG HEX 06064B50 ;End of central dir signature04 ZIPEDSK DW 0000 ;Number of this disk 06 ZIPECEN DW 0000 ;Number of disk with start central dir 08 ZIPENUM DW 0000 ;Total number of entries in central dir ;on this disk 0A ZIPECENN DW 0000 ;total number entries in central dir 0C ZIPECSZ HEX 00000000 ;Size of the central directory10 ZIPEOFST HEX 00000000 ;Offset of start of central directory ;with respect to the starting disk ;number 14 ZIPECOML DW 0000 ;zipfile comment length 16 ZIPECOM DS ZIPECOML ;zipfile comment ZIP VALUES LEGEND- HOST O/S VALUE DESCRIPTION VALUE DESCRIPTION - - - - 0 MS-DOS and OS/2 (FAT) 5 Atari ST 1 Amiga 6 OS/2 1.2 extended file sys 2 VMS 7 Macintosh 3 *nix 8 thru 4 VM/CMS 255 unused GENERAL PURPOSE BIT FLAG LABEL BIT DESCRIPTION - - - ZIPGENFLG 0 If set, file is encrypted or 1 If file Imploded and this bit is set, 8K ZIPCFLG sliding dictionary was used. If clear, 4K sliding dictionary was used. 2 If file Imploded and this bit is set, 3 Shannon-Fano trees were used. If clear, 2 Shannon-Fano trees were used. 3-4 unused 5-7 used internaly by ZIP Note: Bits 1 and 2 are undefined if the compression method is other than type 6 (Imploding). COMPRESSION METHOD NAME METHOD DESCRIPTION - - - Stored 0 No compression used Shrunk 1 LZW, 8K buffer, 9-13 bits with partial clearing Reduced-1 2 Probalistic compression, L(X) = lower 7 bits Reduced-2 3 Probalistic compression, L(X) = lower 6 bits Reduced-3 4 Probalistic compression, L(X) = lower 5 bits Reduced-4 5 Probalistic compression, L(X) = lower 4 bits Imploded 6 2 Shanno-Fano trees, 4K sliding dictionary Imploded 7 3 Shanno-Fano trees, 4K sliding dictionary Imploded 8 2 Shanno-Fano trees, 8K sliding dictionary Imploded 9 3 Shanno-Fano trees, 8K sliding dictionary EXTRA FIELD OFFSET LABEL TYP VALUE DES

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论