clientpacket

package
v0.0.0-...-b0deb01 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InfoTable = [256]Info{}/* 256 elements not displayed */

InfoTable is a slice of 256 Info structs who's index in the slice matches the packet ID.

Functions

This section is empty.

Types

type AccountLogin

type AccountLogin struct {

	// Account username
	Username string
	// Account password in plain-text
	Password string
	// contains filtered or unexported fields
}

AccountLogin is the second packet sent to the login server and attempts to authenticate with a clear-text username and password o_O

func (*AccountLogin) ID

func (p *AccountLogin) ID() byte

ID implements the Packet interface.

type BoughtItem

type BoughtItem struct {
	// Serial of the item to be bought
	Item uo.Serial
	// Amount to buy
	Amount int
}

BoughtItem describes how much of which item to buy.

type BuyItems

type BuyItems struct {

	// Serial of the vendor we are buying from
	Vendor uo.Serial
	// List of items we are buying
	BoughtItems []BoughtItem
	// contains filtered or unexported fields
}

BuyItems is sent by the client in response to the vendor buy window.

func (*BuyItems) ID

func (p *BuyItems) ID() byte

ID implements the Packet interface.

type CharacterLogin

type CharacterLogin struct {

	// Character slot chosen
	Slot int
	// contains filtered or unexported fields
}

CharacterLogin is used to request a character login.

func (*CharacterLogin) ID

func (p *CharacterLogin) ID() byte

ID implements the Packet interface.

type ContextMenuRequest

type ContextMenuRequest struct {

	// Serial of the object the context menu should be opened for
	Serial uo.Serial
	// contains filtered or unexported fields
}

ContextMenuRequest is sent by the client when the user requests a context menu for an object.

func (*ContextMenuRequest) ID

func (p *ContextMenuRequest) ID() byte

func (*ContextMenuRequest) SCID

func (p *ContextMenuRequest) SCID() byte

type ContextMenuSelection

type ContextMenuSelection struct {

	// Serial of the object the context menu was opened on
	Serial uo.Serial
	// Unique ID of the entry selected
	EntryID uint16
	// contains filtered or unexported fields
}

ContextMenuSelection is sent by the client when the user selects a context menu entry.

func (*ContextMenuSelection) ID

func (p *ContextMenuSelection) ID() byte

func (*ContextMenuSelection) SCID

func (p *ContextMenuSelection) SCID() byte

type DoubleClick

type DoubleClick struct {

	// Object ID clicked on
	Object uo.Serial
	// WantPaperDoll is true if this is a request for our own paper doll
	WantPaperDoll bool
	// contains filtered or unexported fields
}

DoubleClick is sent by the client when the player double-clicks an object

func (*DoubleClick) ID

func (p *DoubleClick) ID() byte

ID implements the Packet interface.

type DropRequest

type DropRequest struct {

	// Serial of the object to drop
	Item uo.Serial
	// Location to drop the item
	Location uo.Location
	// Serial of the container to drop the item into. uo.SerialSystem means to
	// drop to the world.
	Container uo.Serial
	// contains filtered or unexported fields
}

DropRequest is sent when the player drops an item from the cursor.

func (*DropRequest) ID

func (p *DropRequest) ID() byte

ID implements the Packet interface.

type GUMPReply

type GUMPReply struct {

	// First serial in the 0xB0 packet, in sharduo this is usually the mobile's
	// serial
	MobileSerial uo.Serial
	// Second serial in the 0xB0 packet, in sharduo this is an identifier unique
	// on the net state but not globally
	GUMPSerial uo.Serial
	// The button ID used to reply, 0 means closed by the client
	Button uint32
	// List of all checkbox and radio buttons that are enabled, all valid values
	// that do not appear in this list are unset
	Switches []uint32
	// Map of text entry contents
	TextEntries map[uint16]string
	// contains filtered or unexported fields
}

GUMPReply describes a client's response to a generic GUMP form.

func (*GUMPReply) ID

func (p *GUMPReply) ID() byte

ID implements the Packet interface.

func (*GUMPReply) Switch

func (p *GUMPReply) Switch(id uint32) bool

Switch returns the value of switch id.

func (*GUMPReply) Text

func (p *GUMPReply) Text(id uint16) string

Text returns the value of text entry id or the empty string.

type GameServerLogin

type GameServerLogin struct {

	// Account username
	Username string
	// Account password in plain-text
	Password string
	// Key given by the login server
	Key uo.Serial
	// contains filtered or unexported fields
}

GameServerLogin is used to authenticate to the game server in clear text.

func (*GameServerLogin) ID

func (p *GameServerLogin) ID() byte

ID implements the Packet interface.

type GeneralInformationPacket

type GeneralInformationPacket interface {
	ID() byte
	SCID() byte
}

type IgnoredPacket

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

IgnoredPacket is a packet that we could fetch all the data for, but we do not have a struct nor a constructor, but it's OK for the server to ignore this.

func (*IgnoredPacket) ID

func (p *IgnoredPacket) ID() byte

ID implements the Packet interface.

type Info

type Info struct {
	// Packet ID
	ID byte
	// Length of the packet -1=dynamic, 0=unsupported
	Length int
}

Info contains the ID and length of a client packet.

type LiftRequest

type LiftRequest struct {

	// Serial of the object to lift
	Item uo.Serial
	// Amount to lift
	Amount int
	// contains filtered or unexported fields
}

LiftRequest is sent when the player lifts an item with the cursor.

func (*LiftRequest) ID

func (p *LiftRequest) ID() byte

ID implements the Packet interface.

type LoginSeed

type LoginSeed struct {

	// Connection seed
	Seed uint32
	// Version major part
	VersionMajor int
	// Version minor part
	VersionMinor int
	// Version patch part
	VersionPatch int
	// Version extra part
	VersionExtra int
	// contains filtered or unexported fields
}

LoginSeed is the first packet sent to the login server

func (*LoginSeed) ID

func (p *LoginSeed) ID() byte

ID implements the Packet interface.

type MacroRequest

type MacroRequest struct {
	MacroType uo.MacroType // What type of macro action is requested
	Offset    int          // Skill number, spell number, or action number
	// contains filtered or unexported fields
}

MacroRequest is sent by the client when requesting skill use, spell casts, door open macro, or bow and salute actions.

func (*MacroRequest) ID

func (p *MacroRequest) ID() byte

ID implements the Packet interface.

type MalformedPacket

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

MalformedPacket is sent when there is a non-specific decoding error.

func (*MalformedPacket) ID

func (p *MalformedPacket) ID() byte

ID implements the Packet interface.

type NameRequest

type NameRequest struct {
	Serial uo.Serial // Serial of the object who's name is being requested.
	// contains filtered or unexported fields
}

NameRequest is sent by the client to request the name of an object.

func (*NameRequest) ID

func (p *NameRequest) ID() byte

ID implements the Packet interface.

type OPLCacheMiss

type OPLCacheMiss struct {
	Serials []uo.Serial // Object serials of all objects the client requested OPL packets for.
	// contains filtered or unexported fields
}

OPLCacheMiss is sent by the client to request OPL packets for objects.

func (*OPLCacheMiss) ID

func (p *OPLCacheMiss) ID() byte

ID implements the Packet interface.

type Packet

type Packet interface {
	ID() byte
}

Packet is the interface all client packets implement.

func New

func New(data []byte) Packet

New creates a new client packet based on data.

type Ping

type Ping struct {

	// Don't know what this is used for
	Key byte
	// contains filtered or unexported fields
}

Ping is used for TCP keepalive and possibly latency determination.

func (*Ping) ID

func (p *Ping) ID() byte

ID implements the Packet interface.

type PlayerStatusRequest

type PlayerStatusRequest struct {

	// Type of the request
	StatusRequestType uo.StatusRequestType
	// ID of the player's mobile
	PlayerMobileID uo.Serial
	// contains filtered or unexported fields
}

PlayerStatusRequest is sent by the client to request status and skills updates.

func (*PlayerStatusRequest) ID

func (p *PlayerStatusRequest) ID() byte

ID implements the Packet interface.

type ProtocolExtension

type ProtocolExtension struct {

	// Type of request
	RequestType uo.ProtocolExtensionRequest
	// contains filtered or unexported fields
}

ProtocolExtension is sent by ClassicUO to query party and guild member positions for the built-in world map. I think the latest versions of Razor, UO Steam, and UOAM/UOPS do this as well.

func (*ProtocolExtension) ID

func (p *ProtocolExtension) ID() byte

ID implements the Packet interface.

type Reader

type Reader struct {

	// Header is the connection header, or nil if it has not been read.
	Header []byte
	// contains filtered or unexported fields
}

Reader reads the client packets and returns the bytes of the packet.

func NewReader

func NewReader(r io.Reader) *Reader

NewReader creates a new Reader for use.

func (*Reader) Read

func (r *Reader) Read() ([]byte, error)

Read reads the bytes of the next client packet and returns a slice of those bytes or an error.

func (*Reader) ReadConnectionHeader

func (r *Reader) ReadConnectionHeader() error

ReadConnectionHeader reads the 8-byte connection header used by Ultima Online tcp streams

func (*Reader) ReadPacket

func (r *Reader) ReadPacket() (Packet, error)

ReadPacket reads the bytes as in Read but returns a client packet object.

type RenameRequest

type RenameRequest struct {
	Serial uo.Serial // Serial of the mobile to rename.
	Name   string    // The new name of the mobile, truncated to 30 characters.
	// contains filtered or unexported fields
}

RenameRequest is sent by the client when renaming a mobile via their status bar.

func (*RenameRequest) ID

func (p *RenameRequest) ID() byte

ID implements the Packet interface.

type SelectServer

type SelectServer struct {

	// Index is the index of the server on the list.
	Index int
	// contains filtered or unexported fields
}

SelectServer is used during the login process to request the connection details of one of the servers on the list.

func (*SelectServer) ID

func (p *SelectServer) ID() byte

ID implements the Packet interface.

type SellItem

type SellItem struct {
	// Serial of the item to sell
	Serial uo.Serial
	// Amount of the item to sell from the stack
	Amount int
}

SellItem represents one item being sold by the player.

type SellResponse

type SellResponse struct {

	// Serial of the vendor being sold to
	Vendor uo.Serial
	// List of items bought
	SellItems []SellItem
	// contains filtered or unexported fields
}

SellResponse is sent by the client to sell items to a vendor.

func (*SellResponse) ID

func (p *SellResponse) ID() byte

ID implements the Packet interface.

type SingleClick

type SingleClick struct {

	// Object ID clicked on
	Object uo.Serial
	// contains filtered or unexported fields
}

SingleClick is sent by the client when the player single-clicks an object

func (*SingleClick) ID

func (p *SingleClick) ID() byte

ID implements the Packet interface.

type Speech

type Speech struct {

	// Type of speech
	Type uo.SpeechType
	// Hue of the text
	Hue uo.Hue
	// Font of the text
	Font uo.Font
	// Text of the message
	Text string
	// contains filtered or unexported fields
}

Speech is sent by the client to request speech.

func (*Speech) ID

func (p *Speech) ID() byte

ID implements the Packet interface.

type TargetResponse

type TargetResponse struct {

	// Target type
	TargetType uo.TargetType
	// Serial of this targeting request
	TargetSerial uo.Serial
	// Cursor type
	CursorType uo.CursorType
	// TargetObject is the serial of the object clicked on, or uo.SerialZero if
	// no object was targeted.
	TargetObject uo.Serial
	// Location of the target.
	Location uo.Location
	// Graphic of the object clicked, if any
	Graphic uo.Graphic
	// contains filtered or unexported fields
}

TargetResponse is sent by the client to respond to a tardc.Geting cursor

func (*TargetResponse) ID

func (p *TargetResponse) ID() byte

ID implements the Packet interface.

type TextGUMPReply

type TextGUMPReply struct {
	Serial uo.Serial // Serial of the GUMP we are replying to
	Text   string    // Reply text
	// contains filtered or unexported fields
}

TextGUMPReply is sent to respond to graphical text requests from 0xAB.

func (*TextGUMPReply) ID

func (p *TextGUMPReply) ID() byte

ID implements the Packet interface.

type UnknownPacket

type UnknownPacket struct {
	PType string
	// contains filtered or unexported fields
}

UnknownPacket is sent when the packet being decoded has no length information. This dc.Puts the packet stream in an inconsistent state.

func (*UnknownPacket) ID

func (p *UnknownPacket) ID() byte

ID implements the Packet interface.

type UnsupportedPacket

type UnsupportedPacket struct {
	PType string
	// contains filtered or unexported fields
}

UnsupportedPacket is sent when the packet being decoded does not have a constructor function yet.

func NewUnsupportedPacket

func NewUnsupportedPacket(ptype string, in []byte) *UnsupportedPacket

NewUnsupportedPacket creates a new UnsupportedPacket properly initialized.

func (*UnsupportedPacket) ID

func (p *UnsupportedPacket) ID() byte

ID implements the Packet interface.

type Version

type Version struct {

	// Version string
	String string
	// contains filtered or unexported fields
}

Version is used to communicate to the server the client's version string.

func (*Version) ID

func (p *Version) ID() byte

ID implements the Packet interface.

type ViewRange

type ViewRange struct {

	// Requested view range, clamped to between 4 and 18 inclusive
	Range int16
	// contains filtered or unexported fields
}

ViewRange is sent by the client to request a new view range.

func (*ViewRange) ID

func (p *ViewRange) ID() byte

ID implements the Packet interface.

type WalkRequest

type WalkRequest struct {

	// Direction to walk
	Direction uo.Direction
	// If true this is a run request
	IsRunning bool
	// Walk sequence number
	Sequence int
	// Fast-walk prevention key
	FastWalkKey uint32
	// contains filtered or unexported fields
}

WalkRequest is sent by the client to request walking or running in a direction.

func (*WalkRequest) ID

func (p *WalkRequest) ID() byte

ID implements the Packet interface.

type WearItemRequest

type WearItemRequest struct {

	// Serial of the item to wear
	Item uo.Serial
	// Serial of the mobile to equip the item to
	Wearer uo.Serial
	// contains filtered or unexported fields
}

WearItemRequest is sent when the player drops an item onto a paper doll

func (*WearItemRequest) ID

func (p *WearItemRequest) ID() byte

ID implements the Packet interface.

Jump to

Keyboard shortcuts

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