inventory

package
v0.0.0-...-54eea7a Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddNewUser

func AddNewUser(ws *websocket.Conn, login string, id int)

func Open

func Open(ws *websocket.Conn, msg Message)

func Reader

func Reader(ws *websocket.Conn)

func RemoveAmmo

func RemoveAmmo(ws *websocket.Conn, msg Message)

func RemoveBody

func RemoveBody(ws *websocket.Conn, msg Message)

func RemoveEquip

func RemoveEquip(ws *websocket.Conn, msg Message)

func RemoveWeapon

func RemoveWeapon(ws *websocket.Conn, msg Message)

func Repair

func Repair(ws *websocket.Conn, msg Message)

func SetAmmo

func SetAmmo(ws *websocket.Conn, msg Message)

func SetBody

func SetBody(ws *websocket.Conn, msg Message)

func SetEquip

func SetEquip(ws *websocket.Conn, msg Message)

func SetWeapon

func SetWeapon(ws *websocket.Conn, msg Message)

func UpdateInventory

func UpdateInventory(userID int)

func UpdateSquad

func UpdateSquad(event string, user *player.Player, err error, ws *websocket.Conn, msg Message)

func UpdateStorage

func UpdateStorage(userID int)

Types

type Message

type Message struct {
	Event string `json:"event"`

	SquadID int `json:"squad_id"`

	BodyID   int `json:"id_body"`
	WeaponID int `json:"weapon_id"`
	EquipID  int `json:"equip_id"`
	AmmoID   int `json:"ammo_id"`

	InventorySlot  int   `json:"inventory_slot"`
	InventorySlots []int `json:"inventory_slots"`

	StorageSlot  int   `json:"storage_slot"`
	StorageSlots []int `json:"storage_slots"`

	EquipSlot     int `json:"equip_slot"`
	EquipSlotType int `json:"equip_slot_type"`

	UnitSlot    int `json:"unit_slot"`
	ThoriumSlot int `json:"thorium_slot"`

	Source      string `json:"source"`
	Destination string `json:"destination"`
	SrcSlot     int    `json:"src_slot"`
	DstSlot     int    `json:"dst_slot"`

	Name       string           `json:"name"`
	Storage    bool             `json:"storage"`
	Count      int              `json:"count"`
	ThrowItems []inventory.Slot `json:"throw_items"`

	BodyColor1   string `json:"body_color_1"`
	BodyColor2   string `json:"body_color_2"`
	WeaponColor1 string `json:"weapon_color_1"`
	WeaponColor2 string `json:"weapon_color_2"`
}

type Response

type Response struct {
	Event         string               `json:"event"`
	Squad         *squad.Squad         `json:"squad"`
	BaseSquads    []*squad.Squad       `json:"base_squads"`
	InventorySize float32              `json:"inventory_size"`
	InBase        bool                 `json:"in_base"`
	Error         string               `json:"error"`
	Storage       *inventory.Inventory `json:"inventory"`
	UnitSlot      int                  `json:"unit_slot"`
}

Jump to

Keyboard shortcuts

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