Documentation ¶
Index ¶
- Constants
- Variables
- type RSDEntry
- type RSDatabase
- func (db *RSDatabase) Find(index int) RSDEntry
- func (db *RSDatabase) HasNext() bool
- func (db *RSDatabase) Next() RSDEntry
- func (db *RSDatabase) ReadInt() int
- func (db *RSDatabase) ReadLong() uint64
- func (db *RSDatabase) ReadPass() string
- func (db *RSDatabase) ReadShort() int
- func (db *RSDatabase) Reset()
- func (db *RSDatabase) Save(index int, userHash uint64, passHash string, x, y int)
- func (db *RSDatabase) Size() int
Constants ¶
const EntrySize = 140
EntrySize Size of a single entry, in bytes.
Variables ¶
var NilEntry = RSDEntry{-1, 0, "", -1, -1}
Functions ¶
This section is empty.
Types ¶
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.