rsdatabase

package
v0.0.0-...-1047d84 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const EntrySize = 140

EntrySize Size of a single entry, in bytes.

Variables

View Source
var NilEntry = RSDEntry{-1, 0, "", -1, -1}

Functions

This section is empty.

Types

type RSDEntry

type RSDEntry struct {
	Index int
	// base37
	Username uint64
	// SHAKE256-64, len=128
	Password string
	X, Y     int
}

type RSDatabase

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

RSDatabase Represents a single player profile database.

func New

func New(path string) *RSDatabase

New Returns a new RSDatabase reference populated with the RSDatabase file at path.

func (*RSDatabase) Find

func (db *RSDatabase) Find(index int) RSDEntry

Find Returns the player in the buffer with the specified index. If no player is found, returns a RSDEntry filled with -1s

func (*RSDatabase) HasNext

func (db *RSDatabase) HasNext() bool

HasNext Returns true if there's any more entries in the buffer, otherwise returns false.

func (*RSDatabase) Next

func (db *RSDatabase) Next() RSDEntry

Next Returns the next entry in the database. If there isn't any entries left, returns NilEntry.

func (*RSDatabase) ReadInt

func (db *RSDatabase) ReadInt() int

ReadInt Reads the next integer from the buffer and return it.

func (*RSDatabase) ReadLong

func (db *RSDatabase) ReadLong() uint64

ReadLong Reads the next long integer from the buffer and return it.

func (*RSDatabase) ReadPass

func (db *RSDatabase) ReadPass() string

ReadPass Returns next 128 bytes as a string representation of a password hash.

func (*RSDatabase) ReadShort

func (db *RSDatabase) ReadShort() int

ReadShort Return the next short integer from the buffer and return it.

func (*RSDatabase) Reset

func (db *RSDatabase) Reset()

Reset Resets the position offset in the buffer to 0

func (*RSDatabase) Save

func (db *RSDatabase) Save(index int, userHash uint64, passHash string, x, y int)

Save Saves the specified information to the player profile at the specified index

func (*RSDatabase) Size

func (db *RSDatabase) Size() int

Size Returns the number of entries in this database.

Jump to

Keyboard shortcuts

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