Documentation ¶
Index ¶
- Variables
- type Packet
- func BigInformationBox(msg string) (p *Packet)
- func BoundaryLocations(player *world.Player, newObjects []*world.Object) (p *Packet)
- func ClientSettings(player *world.Player) (p *Packet)
- func EquipmentStats(player *world.Player) (p *Packet)
- func Fatigue(player *world.Player) (p *Packet)
- func FightMode(player *world.Player) (p *Packet)
- func FriendList(player *world.Player) (p *Packet)
- func FriendUpdate(hash uint64, online bool) (p *Packet)
- func IgnoreList(player *world.Player) (p *Packet)
- func InventoryItems(player *world.Player) (p *Packet)
- func LoginBox(inactiveDays int, lastIP string) (p *Packet)
- func LoginResponse(v int) *Packet
- func NPCPositions(player *world.Player) (p *Packet)
- func NewBarePacket(src []byte) *Packet
- func NewOutgoingPacket(opcode byte) *Packet
- func NewPacket(opcode byte, payload []byte) *Packet
- func ObjectLocations(player *world.Player, newObjects []*world.Object) (p *Packet)
- func PlaneInfo(player *world.Player) *Packet
- func PlayerAppearances(ourPlayer *world.Player) (p *Packet)
- func PlayerChat(sender int, msg string) *Packet
- func PlayerPositions(player *world.Player) (p *Packet)
- func PlayerStat(player *world.Player, idx int) *Packet
- func PlayerStats(player *world.Player) *Packet
- func PrivateMessage(hash uint64, msg string) (p *Packet)
- func ServerInfo(onlineCount int) (p *Packet)
- func ServerMessage(msg string) (p *Packet)
- func TeleBubble(offsetX, offsetY int) (p *Packet)
- func (p *Packet) AddBits(value int, numBits int) *Packet
- func (p *Packet) AddByte(b uint8) *Packet
- func (p *Packet) AddBytes(b []byte) *Packet
- func (p *Packet) AddInt(i uint32) *Packet
- func (p *Packet) AddInt2(i uint32) *Packet
- func (p *Packet) AddLong(l uint64) *Packet
- func (p *Packet) AddShort(s uint16) *Packet
- func (p *Packet) ReadBool() bool
- func (p *Packet) ReadByte() byte
- func (p *Packet) ReadInt() int
- func (p *Packet) ReadLong() uint64
- func (p *Packet) ReadSByte() int8
- func (p *Packet) ReadShort() int
- func (p *Packet) ReadString(n int) (val string)
- func (p *Packet) String() string
Constants ¶
This section is empty.
Variables ¶
var CannotLogout = NewOutgoingPacket(183)
CannotLogout Message that you can not logout right now.
var ChangeAppearance = NewOutgoingPacket(59)
ChangeAppearance The appearance changing window.
var Death = NewOutgoingPacket(83)
Death The 'Oh dear...You are dead' fade-to-black graphic effect when you die.
var DefaultActionMessage = ServerMessage("Nothing interesting happens.")
DefaultActionMessage This is a message to inform the player that the action they were trying to perform didn't do anything.
var LogWarning = log.New(os.Stdout, "[WARNING] ", log.Ltime|log.Lshortfile)
LogWarning An output log for warnings.
var Logout = NewOutgoingPacket(4)
Logout Resets client to login welcome screen
var ResponsePong = NewOutgoingPacket(9)
ResponsePong Response to a RSC protocol ping packet
var WelcomeMessage = ServerMessage("Welcome to RuneScape")
WelcomeMessage Welcome to the game on login
Functions ¶
This section is empty.
Types ¶
type Packet ¶
type Packet struct { Opcode byte Payload []byte Bare bool // contains filtered or unexported fields }
Packet The definition of a game packet. Generally, these are commands, indexed by their Opcode(0-255), with
a 5000-byte buffer for arguments, stored in Payload. If the packet is bare, raw data is intended to be transmitted when writing the packet stucture to a socket, otherwise we put a 2-byte unsigned short for the length of the arguments buffer(plus one because the opcode is included in the payload size), and the 1-byte opcode at the start of the packet, as a header for the client to easily parse the information for each frame.
func BigInformationBox ¶
BigInformationBox Builds a packet to trigger the opening of a large black text window with msg as its contents
func BoundaryLocations ¶
BoundaryLocations Builds a packet with the view-area boundary positions in it, relative to the player. If no new objects are available and no existing local boundarys are removed from area, returns nil.
func ClientSettings ¶
ClientSettings Builds a packet containing the players client settings, e.g camera mode, mouse mode, sound fx...
func EquipmentStats ¶
EquipmentStats Builds a packet with the players equipment statistics in it.
func FriendList ¶
FriendList Builds a packet with the players friend list information in it.
func FriendUpdate ¶
FriendUpdate Builds a packet with an online status update for the player with the specified hash
func IgnoreList ¶
IgnoreList Builds a packet with the players ignore list information in it.
func InventoryItems ¶
InventoryItems Builds a packet containing the players inventory items.
func LoginBox ¶
LoginBox Builds a packet to create a welcome box on the client with the inactiveDays since login, and lastIP connected from.
func LoginResponse ¶
LoginResponse Builds a bare packet with the login response code.
func NPCPositions ¶
NPCPositions Builds a packet containing view area NPC position and sprite information
func NewBarePacket ¶
NewBarePacket Creates a new packet instance intended for sending raw data to the client.
func NewOutgoingPacket ¶
NewOutgoingPacket Creates a new packet instance intended for sending formatted data to the client.
func ObjectLocations ¶
ObjectLocations Builds a packet with the view-area object positions in it, relative to the player. If no new objects are available and no existing local objects are removed from area, returns nil.
func PlaneInfo ¶
PlaneInfo Builds a packet to update information about the clients environment, e.g height, player index...
func PlayerAppearances ¶
PlayerAppearances Builds a packet with the view-area player appearance profiles in it.
func PlayerChat ¶
PlayerChat Builds a packet containing a view-area chat message from the player with the index sender and returns it.
func PlayerPositions ¶
PlayerPositions Builds a packet containing view area player position and sprite information, including ones own information, and returns it. If no players need to be updated, returns nil.
func PlayerStat ¶
PlayerStat Builds a packet containing player's stat information for skill at idx and returns it.
func PlayerStats ¶
PlayerStats Builds a packet containing all the player's stat information and returns it.
func PrivateMessage ¶
PrivateMessage Builds a packet with a private message from hash with content msg.
func ServerInfo ¶
ServerInfo Builds a packet with the server information in it.
func ServerMessage ¶
ServerMessage Builds a packet containing a server message to display in the chat box.
func TeleBubble ¶
TeleBubble Builds a packet to draw a teleport bubble at the specified offsets.
func (*Packet) AddInt2 ¶
AddInt2 Adds a 32-bit integer or an 8-byte integer to the packet payload, depending on value.
func (*Packet) ReadBool ¶
ReadBool Reads the next byte, if it is 1 returns true, else returns false.
func (*Packet) ReadSByte ¶
ReadSByte Read the next 8-bit integer from the packet payload, as a signed byte.
func (*Packet) ReadString ¶
ReadString Read the next n bytes from the packet payload and return it as a Go-string.