Documentation
¶
Index ¶
- Constants
- Variables
- func AuthKey(challenge string) string
- func DecodeServerText(charset, value string) string
- type ChatEvent
- type Client
- func (c *Client) ClickPlayer(ctx context.Context, playerID uint16) error
- func (c *Client) ClickTextDraw(ctx context.Context, textDrawID uint16) error
- func (c *Client) Close() error
- func (c *Client) EnterVehicle(ctx context.Context, vehicleID uint16, passenger bool) error
- func (c *Client) Events() <-chan Event
- func (c *Client) ExitVehicle(ctx context.Context) error
- func (c *Client) RefreshScores(ctx context.Context) error
- func (c *Client) RequestSpawn(ctx context.Context) error
- func (c *Client) RespondDialog(ctx context.Context, id int16, button uint8, item int16, input string) error
- func (c *Client) RespondDialogBytes(ctx context.Context, id int16, button uint8, item int16, input []byte) error
- func (c *Client) SendChat(ctx context.Context, text string) error
- func (c *Client) SendCommand(ctx context.Context, command string) error
- func (c *Client) SetAFK(enabled bool)
- func (c *Client) SetKeys(ctx context.Context, mask uint32) error
- func (c *Client) Teleport(ctx context.Context, x, y, z float32) error
- type ClientOptions
- type DialogEvent
- type Event
- type EventType
- type Info
- type ObjectEvent
- type PlayerEvent
- type SpawnInfo
- type TextDrawEvent
- type VehicleEvent
- type VehicleStateEvent
Constants ¶
const ( RPCClientJoin uint8 = 25 RPCRequestClass uint8 = 128 RPCRequestSpawn uint8 = 129 RPCSpawn uint8 = 52 RPCWorldPlayerAdd uint8 = 32 RPCSetSpawnInfo uint8 = 68 RPCSetPlayerPos uint8 = 12 RPCSetPlayerPosFindZ uint8 = 13 RPCSetPlayerSkin uint8 = 153 RPCSetPlayerTeam uint8 = 69 RPCSetFacingAngle uint8 = 19 RPCPutPlayerInVehicle uint8 = 70 RPCRemoveFromVehicle uint8 = 71 RPCSetPlayerColor uint8 = 72 RPCSetPlayerDrunkLevel uint8 = 35 RPCClickPlayer uint8 = 23 RPCEnterVehicle uint8 = 26 RPCDialogResponse uint8 = 62 RPCClickTextDraw uint8 = 83 RPCChat uint8 = 101 RPCServerCommand uint8 = 50 RPCExitVehicle uint8 = 154 RPCUpdateScores uint8 = 155 RPCServerJoin uint8 = 137 RPCServerQuit uint8 = 138 RPCInitGame uint8 = 139 RPCClientMessage uint8 = 93 RPCClientCheck uint8 = 103 RPCDialogBox uint8 = 61 RPCShowTextDraw uint8 = 134 RPCHideTextDraw uint8 = 135 RPCSetTextDrawString uint8 = 105 RPCCreateObject uint8 = 44 RPCDestroyObject uint8 = 47 RPCWorldVehicleAdd uint8 = 164 RPCWorldVehicleRemove uint8 = 165 )
Variables ¶
Functions ¶
func DecodeServerText ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func DialClient ¶
func DialClientWithOptions ¶ added in v0.1.3
func (*Client) ClickPlayer ¶
func (*Client) ClickTextDraw ¶
func (*Client) EnterVehicle ¶
func (*Client) RequestSpawn ¶ added in v0.1.3
RequestSpawn mirrors the Android raksamp spawn button. A class response only supplies spawn information; the client must explicitly request spawn unless the server sends a forced-spawn outcome.
func (*Client) RespondDialog ¶
func (*Client) RespondDialogBytes ¶
func (*Client) SendCommand ¶
type ClientOptions ¶ added in v0.1.3
type ClientOptions struct {
EmulatePCClientCheck bool
}
ClientOptions controls compatibility behavior that is optional in the Android raksamp client. In particular, PC client-check emulation is off by default there and must not be advertised unless explicitly requested.
type DialogEvent ¶
type EventType ¶
type EventType string
const ( EventJoined EventType = "joined" EventChat EventType = "chat" EventPlayerJoin EventType = "player.join" EventPlayerQuit EventType = "player.quit" EventScores EventType = "scores" EventDialog EventType = "dialog" EventDisconnected EventType = "disconnected" EventProtocolError EventType = "protocol.error" EventTextDrawShow EventType = "textdraw.show" EventTextDrawHide EventType = "textdraw.hide" EventTextDrawText EventType = "textdraw.text" EventObjectAdd EventType = "object.add" EventObjectRemove EventType = "object.remove" EventVehicleAdd EventType = "vehicle.add" EventVehicleRemove EventType = "vehicle.remove" EventPlayerSync EventType = "player.sync" EventPosition EventType = "position" EventAppearance EventType = "appearance" EventVehicleState EventType = "vehicle.state" EventSpawned EventType = "spawned" EventVehicleSync EventType = "vehicle.sync" )
type ObjectEvent ¶
type PlayerEvent ¶
type SpawnInfo ¶
func (SpawnInfo) PlayerEvent ¶
func (s SpawnInfo) PlayerEvent() PlayerEvent