jagex

package
v0.0.0-...-7a1692d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecompressFileArchive

func DecompressFileArchive(bs []byte) ([]byte, error)

func DecryptFileArchive

func DecryptFileArchive(bs []byte, key []byte) ([]byte, error)

func FileArchiveLength

func FileArchiveLength(bs []byte) (int, error)

Types

type ArchiveCompression

type ArchiveCompression byte
const (
	ArchiveCompressionNone ArchiveCompression = iota
	ArchiveCompressionBZIP
	ArchiveCompressionGZIP
)

func (ArchiveCompression) AsByte

func (c ArchiveCompression) AsByte() byte

func (ArchiveCompression) Check

func (c ArchiveCompression) Check() error

func (ArchiveCompression) HeaderLength

func (c ArchiveCompression) HeaderLength() int

type CacheReader

type CacheReader struct {
	// contains filtered or unexported fields
}

func NewCacheReader

func NewCacheReader(index io.ReadSeeker, blocks io.ReadSeeker, fileType int) *CacheReader

func (*CacheReader) Read

func (r *CacheReader) Read(fileID int) ([]byte, error)

type FileEntry

type FileEntry struct {
	NameHash uint32 `json:"name"`
}

type FileGroupEntry

type FileGroupEntry struct {
	NameHash uint32       `json:"name"`
	Checksum uint32       `json:"checksum"`
	Revision uint32       `json:"revision"`
	Files    []*FileEntry `json:"files"`
}

func (*FileGroupEntry) FileIDs

func (e *FileGroupEntry) FileIDs() []int

func (*FileGroupEntry) FindFileID

func (e *FileGroupEntry) FindFileID(fileName string) (fileID int, found bool)

func (*FileGroupEntry) Size

func (e *FileGroupEntry) Size() (size int)

type FileIndex

type FileIndex struct {
	Revision uint32            `json:"revision"`
	Groups   []*FileGroupEntry `json:"groups"`
}

func DecodeFileIndex

func DecodeFileIndex(bs []byte) (*FileIndex, error)

func (*FileIndex) FindFileID

func (fi *FileIndex) FindFileID(groupName, fileName string) (groupID int, fileID int, found bool)

func (*FileIndex) FindGroup

func (fi *FileIndex) FindGroup(groupName string) *FileGroupEntry

func (*FileIndex) FindGroupID

func (fi *FileIndex) FindGroupID(groupName string) (groupID int, found bool)

func (*FileIndex) NamedIndex

func (fi *FileIndex) NamedIndex() *NamedEntryIndex

func (*FileIndex) Size

func (fi *FileIndex) Size() (size int)

type FileIndexFlags

type FileIndexFlags uint8
const (
	IndexFlagNamed FileIndexFlags = 0x1
)

type MultipartFile

type MultipartFile struct {
	Parts [][]byte
}

func DecodeFileGroup

func DecodeFileGroup(bs []byte, size int) []*MultipartFile

func (*MultipartFile) Collapse

func (f *MultipartFile) Collapse() []byte

func (*MultipartFile) CollapsedLength

func (f *MultipartFile) CollapsedLength() (length int)

type NamedEntryIndex

type NamedEntryIndex struct {
	// contains filtered or unexported fields
}

func (*NamedEntryIndex) LookupFileID

func (e *NamedEntryIndex) LookupFileID(groupName, fileName string) (groupID int, fileID int, exists bool)

func (*NamedEntryIndex) LookupGroupID

func (e *NamedEntryIndex) LookupGroupID(groupName string) (groupID int, exists bool)

type ReadBuffer

type ReadBuffer []byte

ReadBuffer provides reading of various binary types from byte slice. After reading a value, the underlying slice will be resliced so that unread bytes are next to be read.

func (*ReadBuffer) Copy

func (rb *ReadBuffer) Copy(n int) []byte

Get returns a copy of the next n bytes and reslices the underlying buffer to be a view of the bytes there after. This method is similar to Get except it returns a copy of the bytes which makes it safe to do modifications to the elements.

func (*ReadBuffer) Get

func (rb *ReadBuffer) Get(n int) (bs []byte)

Get returns a slice of the next N bytes and reslices the underlying buffer to be a view of the bytes after the read bytes. This method should be carefully used because changes to the elements in the returned slice will appear in this buffer and elsewhere.

func (*ReadBuffer) GetCString

func (rb *ReadBuffer) GetCString() (s string)

GetCString returns a null terminated string. TODO(hadyn): Runescape uses a specific character set, need to implement that.

func (*ReadBuffer) GetUint16

func (rb *ReadBuffer) GetUint16() (val uint16)

func (*ReadBuffer) GetUint16AsInt

func (rb *ReadBuffer) GetUint16AsInt() (val int)

func (*ReadBuffer) GetUint24

func (rb *ReadBuffer) GetUint24() (val uint32)

func (*ReadBuffer) GetUint24AsInt

func (rb *ReadBuffer) GetUint24AsInt() (val int)

func (*ReadBuffer) GetUint32

func (rb *ReadBuffer) GetUint32() (val uint32)

func (*ReadBuffer) GetUint32AsInt

func (rb *ReadBuffer) GetUint32AsInt() (val int)

func (*ReadBuffer) GetUint64

func (rb *ReadBuffer) GetUint64() (val uint64)

func (*ReadBuffer) GetUint8

func (rb *ReadBuffer) GetUint8() (val uint8)

func (*ReadBuffer) GetUint8AsInt

func (rb *ReadBuffer) GetUint8AsInt() (val int)

func (*ReadBuffer) Remaining

func (rb *ReadBuffer) Remaining() int

Remaining is an alias for the length of the underlying slice.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL