From dcab6131da227215e78f0fb62e257e85ef873d40 Mon Sep 17 00:00:00 2001 From: Citrinate Date: Mon, 30 Dec 2024 15:46:14 -0500 Subject: [PATCH] Add documentation --- .../IPC/Documentation/Interface/Start.md | 44 ++ .../IPC/Documentation/Interface/Stop.md | 41 ++ .../IPC/Documentation/Items/CraftItem.md | 51 +++ .../Documentation/Items/GetCrateContents.md | 183 ++++++++ .../IPC/Documentation/Items/InspectItem.md | 397 ++++++++++++++++++ .../IPC/Documentation/Items/Inventory.md | 289 +++++++++++++ .../IPC/Documentation/Items/RetrieveItem.md | 37 ++ .../IPC/Documentation/Items/StoreItem.md | 34 ++ .../Documentation/Players/PlayerProfile.md | 109 +++++ README.md | 27 +- 10 files changed, 1196 insertions(+), 16 deletions(-) create mode 100644 CS2Interface/IPC/Documentation/Interface/Start.md create mode 100644 CS2Interface/IPC/Documentation/Interface/Stop.md create mode 100644 CS2Interface/IPC/Documentation/Items/CraftItem.md create mode 100644 CS2Interface/IPC/Documentation/Items/GetCrateContents.md create mode 100644 CS2Interface/IPC/Documentation/Items/InspectItem.md create mode 100644 CS2Interface/IPC/Documentation/Items/Inventory.md create mode 100644 CS2Interface/IPC/Documentation/Items/RetrieveItem.md create mode 100644 CS2Interface/IPC/Documentation/Items/StoreItem.md create mode 100644 CS2Interface/IPC/Documentation/Players/PlayerProfile.md diff --git a/CS2Interface/IPC/Documentation/Interface/Start.md b/CS2Interface/IPC/Documentation/Interface/Start.md new file mode 100644 index 0000000..ae08835 --- /dev/null +++ b/CS2Interface/IPC/Documentation/Interface/Start.md @@ -0,0 +1,44 @@ +# GET /Api/CS2Interface/{botNames}/Start + +## Description + +Starts the CS2 interface for the given `botNames` + +> [!NOTE] +> This request will run until the interface successfully starts or it encounters an error. If attempting to start the interface for a bot that already has the interface running, nothing will happen. + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botNames` | Yes | One or more ASF [bot names](https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Commands#bots-argument) + +## Query Parameters + +None + +## Response Result + +Property | Type | Description +--- | --- | --- +`botName.Message` | `string` | A description of whatever just happened to `botName` +`botName.Success` | `bool` | True if the interface is now running for `botName` + +## Example Response + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/Start +``` + +```json +{ + "Message": "OK", + "Success": true, + "Result": { + "Bot1": { + "Message": "CS2 Interface started", + "Success": true + } + } +} +``` diff --git a/CS2Interface/IPC/Documentation/Interface/Stop.md b/CS2Interface/IPC/Documentation/Interface/Stop.md new file mode 100644 index 0000000..db08278 --- /dev/null +++ b/CS2Interface/IPC/Documentation/Interface/Stop.md @@ -0,0 +1,41 @@ +# GET /Api/CS2Interface/{botNames}/Stop + +## Description + +Stops the CS2 interface for the given `botNames` + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botNames` | Yes | One or more ASF [bot names](https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Commands#bots-argument) + +## Query Parameters + +None + +## Response Result + +Property | Type | Description +--- | --- | --- +`botName.Message` | `string` | A description of whatever just happened to `botName` +`botName.Success` | `bool` | True if the interface is now not running for `botName` + +## Example Response + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/Stop +``` + +```json +{ + "Message": "OK", + "Success": true, + "Result": { + "Bot1": { + "Message": "CS2 Interface successfully stopped", + "Success": true + } + } +} +``` diff --git a/CS2Interface/IPC/Documentation/Items/CraftItem.md b/CS2Interface/IPC/Documentation/Items/CraftItem.md new file mode 100644 index 0000000..91ccf9f --- /dev/null +++ b/CS2Interface/IPC/Documentation/Items/CraftItem.md @@ -0,0 +1,51 @@ +# GET /Api/CS2Interface/{botName}/CraftItem/{recipeID} + +## Description + +Crafts an item for the given `botName` using the specified crafting `recipeID` + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botName` | Yes | The ASF bot name that will be used to craft an item +`recipeID` | Yes | The ID for the crafting recipe + +## Query Parameters + +Name | Required | Description +--- | --- | --- +`itemIDs` | Yes | A comma separated list of item IDs to be used in the crafting recipe + +## Response Result + +Property | Type | Description +--- | --- | --- +`recipe` | `ushort` | Should be the same as `recipeID` +`unknown` | `uint` | Unknown +`itemcount` | `ushort` | The number of items created +`itemids` | `array` | The item IDs for each of the newly created items + +> [!NOTE] +> Details for the newly crafted items can be found using the [Inventory](/CS2Interface/IPC/Documentation/Items/Inventory.md) API + +## Example Response + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/CraftItem/0?itemIDs=41112241128,41112243329,41112241214,41112246101,41112244630,41112248299,41112243430,41112247282,41112248426,41112244626 +``` + +```javascript +{ + "Message": "OK", + "Success": true, + "Result": { + "recipe": 0, + "unknown": 0, + "itemcount": 1, + "itemids": [ + 41112277716 + ] + } +} +``` diff --git a/CS2Interface/IPC/Documentation/Items/GetCrateContents.md b/CS2Interface/IPC/Documentation/Items/GetCrateContents.md new file mode 100644 index 0000000..f744ac0 --- /dev/null +++ b/CS2Interface/IPC/Documentation/Items/GetCrateContents.md @@ -0,0 +1,183 @@ +# GET /Api/CS2Interface/{botName}/GetCrateContents/{crateID} + +## Description + +Get the contents of storage unit `crateID` owned by the given `botName` + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botName` | Yes | The ASF bot name for the owner of the storage unit +`crateID` | Yes | The storage unit's item ID + +## Query Parameters + +Name | Required | Description +--- | --- | --- +`minimal` | No | If set to true, the response will only contain the data recieved from CS2 +`showDefs` | No | If set to true, the response will include a `defs` property containing additional game data + +## Response Result + +Property | Type | Description +--- | --- | --- +`iteminfo` | `object` | The raw item info recieved from CS2. The details of this object are defined by [`CSOEconItem`](https://github.com/SteamDatabase/Protobufs/blob/master/csgo/base_gcmessages.proto) +`attributes` | `object` | Item attributes which will vary depending on the item. The type for these attribute's values will depend on the attribute, and can be any of: `string`, `float`, or `uint` +`casket_id` | `ulong` | The item ID for the storage unit this item is currently in +`moveable` | `bool` | True if this item can be placed into a storage unit +`full_name` | `string` | The item's name (as it would appear in the url of the item's Steam Marketplace listing page) +`full_type_name` | `string` | The item's type (as it would appear on the Steam Marketplace) +`rarity_name` | `string` | The item's rarity +`quality_name` | `string` | The item's quality +`origin_name` | `string` | How the item was obtained +`type_name` | `string` | The item's type +`item_name` | `string` | The item's name +`tool_name` | `string` | What type of tool this is (usually the same as `type_name`, except for Sealed Graffiti) +`tint_name` | `string` | The item's tint +`weapon_image_url` | `string` | An image of the item (if one exists in [items_game_cdn.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game_cdn.txt)) +`weapon_name` | `string` | The weapon this applies to +`wear_name` | `string` | The name for the float range this item falls into +`wear` | `float` | The item's float value +`wear_min` | `float` | The item's minimum possible float +`wear_max` | `float` | The item's maximum possible float +`name_id` | `string` | The unique string ID for this kind of item +`set_name_id` | `string` | The unique string ID for the collection this item belongs to +`set_name` | `string` | The name of the collection this item belongs to +`crate_name_id` | `string` | The unique string ID for the crate this item can be found in +`crate_defindex` | `uint` | The definition index for the crate this item can be found in (the definition for which can be found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `items`) +`crate_name` | `string` | The name of the crate this item can be found in +`defs.item_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `items` +`defs.paint_kit_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `paint_kits` +`defs.sticker_kit_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `sticker_kits` +`defs.music_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `music_definitions` +`defs.keychain_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `keychain_definitions` + +## Example Response + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/GetCrateContents/31555237276 +``` + +```json +{ + "Message": "OK", + "Success": true, + "Result": [ + { + "iteminfo": { + "id": 41020250307, + "account_id": 84122798, + "inventory": 3221225475, + "def_index": 4818, + "quantity": 1, + "level": 1, + "quality": 4, + "flags": 0, + "origin": 24, + "attribute": [ + { + "def_index": 75, + "value_bytes": "APZ0Zw==" + }, + { + "def_index": 272, + "value_bytes": "nLXWWA==" + }, + { + "def_index": 273, + "value_bytes": "BwAAAA==" + } + ], + "interior_item": null, + "in_use": false, + "equipped_state": [], + "rarity": 1 + }, + "attributes": { + "tradable after date": 1735718400, + "casket item id low": 1490466204, + "casket item id high": 7 + }, + "casket_id": 31555237276, + "moveable": true, + "full_name": "Dreams & Nightmares Case", + "full_type_name": "Base Grade Container", + "rarity_name": "Base Grade", + "quality_name": "Unique", + "origin_name": "Level Up Reward", + "type_name": "Container", + "item_name": "Dreams & Nightmares Case", + "name_id": "crate_community_30" + }, + { + "iteminfo": { + "id": 41005308811, + "account_id": 84122798, + "inventory": 3221225475, + "def_index": 36, + "quantity": 1, + "level": 1, + "quality": 4, + "flags": 0, + "origin": 23, + "attribute": [ + { + "def_index": 6, + "value_bytes": "AIBBRA==" + }, + { + "def_index": 7, + "value_bytes": "DLIGQw==" + }, + { + "def_index": 8, + "value_bytes": "SMWOPQ==" + }, + { + "def_index": 75, + "value_bytes": "gKRzZw==" + }, + { + "def_index": 272, + "value_bytes": "nLXWWA==" + }, + { + "def_index": 273, + "value_bytes": "BwAAAA==" + } + ], + "interior_item": null, + "in_use": false, + "equipped_state": [], + "rarity": 3 + }, + "attributes": { + "set item texture prefab": 774, + "set item texture seed": 131.4292, + "set item texture wear": 0.06968424, + "tradable after date": 1735632000, + "casket item id low": 1490466204, + "casket item id high": 7 + }, + "casket_id": 31555237276, + "moveable": true, + "full_name": "P250 | Small Game (Factory New)", + "full_type_name": "Mil-Spec Grade Pistol", + "rarity_name": "Mil-Spec Grade", + "quality_name": "Unique", + "origin_name": "Quest Reward", + "type_name": "Pistol", + "item_name": "Small Game", + "weapon_name": "P250", + "wear_name": "Factory New", + "wear": 0.069684237241745, + "wear_min": 0, + "wear_max": 0.7, + "name_id": "[soch_hunter_blaze_p250]weapon_p250", + "set_name_id": "set_realism_camo", + "set_name": "The Sport & Field Collection" + } + ] +} +``` diff --git a/CS2Interface/IPC/Documentation/Items/InspectItem.md b/CS2Interface/IPC/Documentation/Items/InspectItem.md new file mode 100644 index 0000000..2bd02b1 --- /dev/null +++ b/CS2Interface/IPC/Documentation/Items/InspectItem.md @@ -0,0 +1,397 @@ +# GET /Api/CS2Interface/{botNames}/InspectItem + +## Description + +Inspect a CS2 Item + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botNames` | Yes | One or more ASF [bot names](https://github.com/JustArchiNET/ArchiSteamFarm/wiki/Commands#bots-argument) + +> [!NOTE] +> Responses are not dependent on the account used to inspect an item. You may provide multiple `botNames`, and the first available bot will be used to make the request. + +## Query Parameters + +Name | Required | Description +--- | --- | --- +`url` | No | The item's inspect link +`s` | No | The `S` value from the item's inspect link (not needed if using the `url` parameter) +`a` | No | The `A` value from the item's inspect link (not needed if using the `url` parameter) +`d` | No | The `D` value from the item's inspect link (not needed if using the `url` parameter) +`m` | No | The `M` value from the item's inspect link (not needed if using the `url` parameter) +`minimal` | No | If set to true, the response will only contain the data recieved from CS2 +`showDefs` | No | If set to true, the response will include a `defs` property containing additional game data + +## Response Result + +Property | Type | Description +--- | --- | --- +`iteminfo` | `object` | The raw item info recieved from CS2. The details of this object are defined by [`CEconItemPreviewDataBlock`](https://github.com/SteamDatabase/Protobufs/blob/master/csgo/cstrike15_gcmessages.proto) +`full_name` | `string` | The item's name (as it would appear in the url of the item's Steam Marketplace listing page) +`full_type_name` | `string` | The item's type (as it would appear on the Steam Marketplace) +`rarity_name` | `string` | The item's rarity +`quality_name` | `string` | The item's quality +`origin_name` | `string` | How the item was obtained +`type_name` | `string` | The item's type +`item_name` | `string` | The item's name +`tool_name` | `string` | What type of tool this is (usually the same as `type_name`, except for Sealed Graffiti) +`tint_name` | `string` | The item's tint +`weapon_image_url` | `string` | An image of the item (if one exists in [items_game_cdn.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game_cdn.txt)) +`weapon_name` | `string` | The weapon this applies to +`wear_name` | `string` | The name for the float range this item falls into +`wear` | `float` | The item's float value +`wear_min` | `float` | The item's minimum possible float +`wear_max` | `float` | The item's maximum possible float +`name_id` | `string` | The unique string ID for this kind of item +`set_name_id` | `string` | The unique string ID for the collection this item belongs to +`set_name` | `string` | The name of the collection this item belongs to +`crate_name_id` | `string` | The unique string ID for the crate this item can be found in +`crate_defindex` | `uint` | The definition index for the crate this item can be found in (the definition for which can be found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `items`) +`crate_name` | `string` | The name of the crate this item can be found in +`defs.item_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `items` +`defs.paint_kit_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `paint_kits` +`defs.sticker_kit_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `sticker_kits` +`defs.music_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `music_definitions` +`defs.keychain_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `keychain_definitions` + +## Example Response + +``` +http://127.0.0.1:1242/Api/CS2Interface/asf/InspectItem?url=steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20M625254122282020305A6760346663D30614827701953021 +``` + +```json +{ + "Message": "OK", + "Success": true, + "Result": { + "iteminfo": { + "itemid": 6760346663, + "defindex": 7, + "paintindex": 282, + "rarity": 5, + "quality": 9, + "paintwear": 1041772571, + "paintseed": 566, + "killeaterscoretype": 0, + "killeatervalue": 0, + "stickers": [ + { + "slot": 0, + "sticker_id": 815 + }, + { + "slot": 1, + "sticker_id": 1008 + }, + { + "slot": 2, + "sticker_id": 328 + }, + { + "slot": 3, + "sticker_id": 1223 + } + ], + "inventory": 44, + "origin": 8, + "keychains": [] + }, + "full_name": "StatTrak™ AK-47 | Redline (Minimal Wear)", + "full_type_name": "StatTrak™ Classified Rifle", + "rarity_name": "Classified", + "quality_name": "StatTrak™", + "origin_name": "Found in Crate", + "type_name": "Rifle", + "item_name": "Redline", + "weapon_image_url": "http://media.steampowered.com/apps/730/icons/econ/default_generated/weapon_ak47_cu_ak47_cobra_light_large.7494bfdf4855fd4e6a2dbd983ed0a243c80ef830.png", + "weapon_name": "AK-47", + "wear_name": "Minimal Wear", + "wear": 0.14862100780010223, + "wear_min": 0.1, + "wear_max": 0.7, + "name_id": "[cu_ak47_cobra]weapon_ak47", + "set_name_id": "set_community_2", + "set_name": "The Phoenix Collection", + "crate_name_id": "crate_community_2", + "crate_defindex": 4011, + "crate_supply_series": 11, + "crate_name": "Operation Phoenix Weapon Case" + } +} +``` + +--- + +``` +http://127.0.0.1:1242/Api/CS2Interface/asf/InspectItem?url=steam://rungame/730/76561202255233023/+csgo_econ_action_preview%20M625254122282020305A6760346663D30614827701953021&showDefs=true +``` + +```json +{ + "Message": "OK", + "Success": true, + "Result": { + "iteminfo": { + "itemid": 6760346663, + "defindex": 7, + "paintindex": 282, + "rarity": 5, + "quality": 9, + "paintwear": 1041772571, + "paintseed": 566, + "killeaterscoretype": 0, + "killeatervalue": 0, + "stickers": [ + { + "slot": 0, + "sticker_id": 815 + }, + { + "slot": 1, + "sticker_id": 1008 + }, + { + "slot": 2, + "sticker_id": 328 + }, + { + "slot": 3, + "sticker_id": 1223 + } + ], + "inventory": 44, + "origin": 8, + "keychains": [] + }, + "full_name": "StatTrak™ AK-47 | Redline (Minimal Wear)", + "full_type_name": "StatTrak™ Classified Rifle", + "rarity_name": "Classified", + "quality_name": "StatTrak™", + "origin_name": "Found in Crate", + "type_name": "Rifle", + "item_name": "Redline", + "weapon_image_url": "http: //media.steampowered.com/apps/730/icons/econ/default_generated/weapon_ak47_cu_ak47_cobra_light_large.7494bfdf4855fd4e6a2dbd983ed0a243c80ef830.png", + "weapon_name": "AK-47", + "wear_name": "Minimal Wear", + "wear": 0.14862100780010223, + "wear_min": 0.1, + "wear_max": 0.7, + "name_id": "[cu_ak47_cobra]weapon_ak47", + "set_name_id": "set_community_2", + "set_name": "The Phoenix Collection", + "crate_name_id": "crate_community_2", + "crate_defindex": 4011, + "crate_supply_series": 11, + "crate_name": "Operation Phoenix Weapon Case", + "defs": { + "item_def": { + "name": "weapon_ak47", + "prefab": "weapon_ak47_prefab", + "item_quality": "normal", + "baseitem": 1, + "flexible_loadout_slot": "rifle1", + "flexible_loadout_default": 1, + "item_class": "weapon_ak47", + "item_name": "#SFUI_WPNHUD_AK47", + "item_description": "#CSGO_Item_Desc_AK47", + "item_rarity": "uncommon", + "image_inventory": "econ/weapons/base_weapons/weapon_ak47", + "model_player": "weapons/models/ak47/weapon_rif_ak47.vmdl", + "model_world": "weapons/models/ak47/weapon_rif_ak47.vmdl", + "model_dropped": "weapons/models/ak47/weapon_rif_ak47.vmdl", + "icon_default_image": "materials/icons/inventory_icon_weapon_ak47.vtf", + "used_by_classes": { + "terrorists": 1 + }, + "attributes": { + "magazine model": "weapons/models/ak47/weapon_rif_ak47_mag.vmdl", + "primary reserve ammo max": 90, + "recovery time crouch": 0.305257, + "recovery time crouch final": 0.419728, + "recovery time stand": 0.368, + "recovery time stand final": 0.506, + "inaccuracy jump initial": 100.94, + "inaccuracy jump": 140.76, + "heat per shot": 0.3, + "addon scale": 0.9, + "tracer frequency": 3, + "max player speed": 215, + "is full auto": 1, + "in game price": 2700, + "armor ratio": 1.55, + "crosshair delta distance": 4, + "penetration": 2, + "damage": 36, + "range": 8192, + "cycletime": 0.1, + "time to idle": 1.9, + "flinch velocity modifier large": 0.4, + "flinch velocity modifier small": 0.55, + "spread": 0.6, + "inaccuracy crouch": 4.81, + "inaccuracy stand": 6.41, + "inaccuracy land": 0.242, + "inaccuracy ladder": 140, + "inaccuracy fire": 7.8, + "inaccuracy move": 175.06, + "recoil angle": 0, + "recoil angle variance": 70, + "recoil magnitude": 30, + "recoil magnitude variance": 0, + "recoil seed": 223, + "primary clip size": 30, + "weapon weight": 25, + "rumble effect": 4, + "inaccuracy crouch alt": 4.81, + "inaccuracy fire alt": 7.8, + "inaccuracy jump alt": 140.76, + "inaccuracy ladder alt": 140, + "inaccuracy land alt": 0.242, + "inaccuracy move alt": 175.06, + "inaccuracy stand alt": 6.41, + "max player speed alt": 215, + "recoil angle alt": 0, + "recoil angle variance alt": 70, + "recoil magnitude alt": 30, + "recoil magnitude variance alt": 0, + "spread alt": 0.6, + "stattrak model": "models/weapons/stattrack.vmdl", + "recovery transition start bullet": 2, + "recovery transition end bullet": 5, + "allow hand flipping": 1, + "attack movespeed factor": 1, + "bot audible range": 2000, + "bullets": 1, + "cannot shoot underwater": 0, + "crosshair min distance": 4, + "cycletime alt": 0.3, + "headshot multiplier": 4, + "has burst mode": 0, + "has silencer": 0, + "hide view model zoomed": 0, + "idle interval": 20, + "inaccuracy jump apex": 0, + "inaccuracy reload": 0, + "inaccuracy pitch shift": 0, + "inaccuracy alt sound threshold": 0, + "is melee weapon": 0, + "is revolver": 0, + "itemflag select on empty": 0, + "itemflag no auto reload": 0, + "itemflag no auto switch empty": 0, + "itemflag limit in world": 0, + "itemflag exhaustible": 0, + "itemflag do hit location dmg": 0, + "itemflag no ammo pickups": 0, + "itemflag no item pickup": 0, + "kill award": 300, + "model right handed": 1, + "primary default clip size": -1, + "range modifier": 0.98, + "spread seed": 0, + "secondary clip size": 0, + "secondary default clip size": -1, + "secondary reserve ammo max": 0, + "unzoom after shot": 0, + "zoom fov 1": 90, + "zoom fov 2": 90, + "zoom levels": 0, + "zoom time 0": 0, + "zoom time 1": 0, + "zoom time 2": 0 + }, + "inventory_image_data": { + "camera_angles": "-2.0 -135.0 0.0", + "camera_offset": "18.0 3.7 -2.5", + "camera_fov": 35, + "override_default_light": 1, + "spot_light_key": { + "position": "-120 120 180", + "color": "2 2.1 2.3", + "lookat": "0.0 0.0 0.0", + "inner_cone": 0.5, + "outer_cone": 1 + }, + "spot_light_rim": { + "position": "10.0 -90.0 -60.0", + "color": "3 5 5", + "lookat": "0.0 0.0 0.0", + "inner_cone": 0.04, + "outer_cone": 0.5 + } + }, + "paint_data": { + "PaintableMaterial0": { + "Name": "rif_ak47", + "OrigMat": "ak47", + "ViewmodelDim": 2048, + "WorldDim": 512, + "BaseTextureOverride": 0, + "WeaponLength": 37.7462, + "UVScale": 0.549 + } + }, + "visuals": { + "muzzle_flash_effect_1st_person": "weapon_muzzle_flash_assaultrifle", + "muzzle_flash_effect_3rd_person": "weapon_muzzle_flash_assaultrifle", + "heat_effect": "weapon_muzzle_smoke", + "addon_location": "primary_rifle", + "eject_brass_effect": "weapon_shell_casing_rifle", + "tracer_effect": "weapon_tracers_assrifle", + "weapon_type": "Rifle", + "player_animation_extension": "ak", + "primary_ammo": "BULLET_PLAYER_762MM", + "sound_single_shot": "Weapon_AK47.Single", + "sound_nearlyempty": "Default.nearlyempty" + }, + "item_type_name": "#CSGO_Type_Rifle", + "flexible_loadout_category": "rifle", + "flexible_loadout_group": "rifle", + "inv_group_equipment": "rifle", + "mouse_pressed_sound": "sounds/weapons/m4a1/m4a1_clipout.vsnd", + "drop_sound": "sounds/weapons/m4a1/m4a1_clipin.vsnd", + "taxonomy": { + "rifle": 1, + "primary": 1, + "weapon": 1, + "self_damage_on_miss__inflicts_damage": 1 + }, + "item_gear_slot": "primary", + "item_gear_slot_position": 0, + "capabilities": { + "nameable": 1, + "paintable": 1, + "can_stattrack_swap": 1, + "can_sticker": 1, + "can_keychain": 1 + }, + "craft_class": "weapon", + "craft_material_type": "weapon", + "min_ilevel": 1, + "max_ilevel": 1, + "image_inventory_size_w": 128, + "image_inventory_size_h": 82, + "stickers": "weapon", + "keychains": "single", + "hidden": 1 + }, + "paint_kit_def": { + "name": "cu_ak47_cobra", + "use_legacy_model": 1, + "description_string": "#PaintKit_cu_awp_cobra", + "description_tag": "#PaintKit_cu_awp_cobra_tag", + "style": 7, + "wear_remap_min": 0.1, + "wear_remap_max": 0.7, + "wear_gradient": "canvas", + "wear_default": 0.1, + "seed": 0 + } + } + } +} +``` diff --git a/CS2Interface/IPC/Documentation/Items/Inventory.md b/CS2Interface/IPC/Documentation/Items/Inventory.md new file mode 100644 index 0000000..70fcb6e --- /dev/null +++ b/CS2Interface/IPC/Documentation/Items/Inventory.md @@ -0,0 +1,289 @@ +# GET /Api/CS2Interface/{botName}/Inventory + +## Description + +Get the CS2 inventory for the given `botName` + +> [!NOTE] +> There's a few seconds of delay between when the interface first connects and when bot's inventory is available. + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botName` | Yes | The ASF bot name to get the inventory of + +## Query Parameters + +Name | Required | Description +--- | --- | --- +`minimal` | No | If set to true, the response will only contain the data recieved from CS2 +`showDefs` | No | If set to true, the response will include a `defs` property containing additional game data + + +## Response Result + +Property | Type | Description +--- | --- | --- +`iteminfo` | `object` | The raw item info recieved from CS2. The details of this object are defined by [`CSOEconItem`](https://github.com/SteamDatabase/Protobufs/blob/master/csgo/base_gcmessages.proto) +`attributes` | `object` | Item attributes which will vary depending on the item. The type for these attribute's values will depend on the attribute, and can be any of: `string`, `float`, or `uint` +`moveable` | `bool` | True if this item can be placed into a storage unit +`full_name` | `string` | The item's name (as it would appear in the url of the item's Steam Marketplace listing page) +`full_type_name` | `string` | The item's type (as it would appear on the Steam Marketplace) +`rarity_name` | `string` | The item's rarity +`quality_name` | `string` | The item's quality +`origin_name` | `string` | How the item was obtained +`type_name` | `string` | The item's type +`item_name` | `string` | The item's name +`tool_name` | `string` | What type of tool this is (usually the same as `type_name`, except for Sealed Graffiti) +`tint_name` | `string` | The item's tint +`weapon_image_url` | `string` | An image of the item (if one exists in [items_game_cdn.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game_cdn.txt)) +`weapon_name` | `string` | The weapon this applies to +`wear_name` | `string` | The name for the float range this item falls into +`wear` | `float` | The item's float value +`wear_min` | `float` | The item's minimum possible float +`wear_max` | `float` | The item's maximum possible float +`name_id` | `string` | The unique string ID for this kind of item +`set_name_id` | `string` | The unique string ID for the collection this item belongs to +`set_name` | `string` | The name of the collection this item belongs to +`crate_name_id` | `string` | The unique string ID for the crate this item can be found in +`crate_defindex` | `uint` | The definition index for the crate this item can be found in (the definition for which can be found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `items`) +`crate_name` | `string` | The name of the crate this item can be found in +`defs.item_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `items` +`defs.paint_kit_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `paint_kits` +`defs.sticker_kit_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `sticker_kits` +`defs.music_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `music_definitions` +`defs.keychain_def` | `object` | Related game data found in [items_game.txt](https://raw.githubusercontent.com/SteamDatabase/GameTracking-CS2/master/game/csgo/pak01_dir/scripts/items/items_game.txt) under `keychain_definitions` + +## Example Responses + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/Inventory +``` + +```json +{ + "Message": "OK", + "Success": true, + "Result": [ + { + "iteminfo": { + "id": 41020250307, + "account_id": 84122798, + "inventory": 1, + "def_index": 4818, + "quantity": 1, + "level": 1, + "quality": 4, + "flags": 0, + "origin": 24, + "attribute": [ + { + "def_index": 75, + "value_bytes": "APZ0Zw==" + } + ], + "interior_item": null, + "in_use": false, + "equipped_state": [], + "rarity": 1 + }, + "attributes": { + "tradable after date": 1735718400 + }, + "moveable": true, + "full_name": "Dreams & Nightmares Case", + "full_type_name": "Base Grade Container", + "rarity_name": "Base Grade", + "quality_name": "Unique", + "origin_name": "Level Up Reward", + "type_name": "Container", + "item_name": "Dreams & Nightmares Case", + "name_id": "crate_community_30" + }, + { + "iteminfo": { + "id": 41005308811, + "account_id": 84122798, + "inventory": 1, + "def_index": 36, + "quantity": 1, + "level": 1, + "quality": 4, + "flags": 0, + "origin": 23, + "attribute": [ + { + "def_index": 6, + "value_bytes": "AIBBRA==" + }, + { + "def_index": 7, + "value_bytes": "DLIGQw==" + }, + { + "def_index": 8, + "value_bytes": "SMWOPQ==" + }, + { + "def_index": 75, + "value_bytes": "gKRzZw==" + } + ], + "interior_item": null, + "in_use": false, + "equipped_state": [], + "rarity": 3 + }, + "attributes": { + "set item texture prefab": 774, + "set item texture seed": 131.4292, + "set item texture wear": 0.06968424, + "tradable after date": 1735632000 + }, + "moveable": true, + "full_name": "P250 | Small Game (Factory New)", + "full_type_name": "Mil-Spec Grade Pistol", + "rarity_name": "Mil-Spec Grade", + "quality_name": "Unique", + "origin_name": "Quest Reward", + "type_name": "Pistol", + "item_name": "Small Game", + "weapon_name": "P250", + "wear_name": "Factory New", + "wear": 0.069684237241745, + "wear_min": 0, + "wear_max": 0.7, + "name_id": "[soch_hunter_blaze_p250]weapon_p250", + "set_name_id": "set_realism_camo", + "set_name": "The Sport & Field Collection" + }, + { + "iteminfo": { + "id": 34865269642, + "account_id": 84122798, + "inventory": 0, + "def_index": 874, + "quantity": 1, + "level": 1, + "quality": 4, + "flags": 0, + "origin": 0, + "attribute": [], + "interior_item": null, + "in_use": false, + "equipped_state": [], + "rarity": 6 + }, + "attributes": {}, + "moveable": false, + "full_name": "5 Year Veteran Coin", + "full_type_name": "Extraordinary Collectible", + "rarity_name": "Extraordinary", + "quality_name": "Unique", + "origin_name": "Timed Drop", + "type_name": "Collectible", + "item_name": "5 Year Veteran Coin", + "name_id": "Five Year Service Coin" + }, + { + "iteminfo": { + "id": 31555237276, + "account_id": 84122798, + "inventory": 1, + "def_index": 1201, + "quantity": 1, + "level": 1, + "quality": 4, + "flags": 0, + "origin": 2, + "attribute": [ + { + "def_index": 111, + "value_bytes": "CgEx" + }, + { + "def_index": 270, + "value_bytes": "AAAAAA==" + }, + { + "def_index": 271, + "value_bytes": "qtJwZw==" + } + ], + "interior_item": null, + "in_use": false, + "equipped_state": [], + "rarity": 1 + }, + "attributes": { + "custom name attr": "1", + "items count": 0, + "modification date": 1735447210 + }, + "moveable": false, + "full_name": "Storage Unit", + "full_type_name": "Base Grade Tool", + "rarity_name": "Base Grade", + "quality_name": "Unique", + "origin_name": "Purchased", + "type_name": "Tool", + "item_name": "Storage Unit", + "name_id": "casket" + }, + { + "iteminfo": { + "id": 22487518448, + "account_id": 84122798, + "inventory": 2, + "def_index": 1314, + "quantity": 1, + "level": 1, + "quality": 4, + "flags": 0, + "origin": 0, + "attribute": [ + { + "def_index": 2, + "value_bytes": "AQAAAA==" + }, + { + "def_index": 166, + "value_bytes": "KAAAAA==" + } + ], + "interior_item": null, + "in_use": false, + "equipped_state": [], + "rarity": 3 + }, + "attributes": { + "cannot trade": 1, + "music id": 40 + }, + "moveable": false, + "full_name": "Music Kit | Halo, The Master Chief Collection", + "full_type_name": "High Grade Music Kit", + "rarity_name": "High Grade", + "quality_name": "Unique", + "origin_name": "Timed Drop", + "type_name": "Music Kit", + "item_name": "Halo, The Master Chief Collection", + "name_id": "[halo_01]musickit" + } + ] +} +``` + +--- + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/Inventory +``` + +```json +{ + "Message": "Inventory not loaded yet", + "Success": false +} +``` diff --git a/CS2Interface/IPC/Documentation/Items/RetrieveItem.md b/CS2Interface/IPC/Documentation/Items/RetrieveItem.md new file mode 100644 index 0000000..6b7814b --- /dev/null +++ b/CS2Interface/IPC/Documentation/Items/RetrieveItem.md @@ -0,0 +1,37 @@ +# GET /Api/CS2Interface/{botName}/RetrieveItem/{crateID}/{itemID} + +## Description + +Retrieves an item `itemID` from storage unit `crateID` owned by `botName` + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botName` | Yes | The ASF bot name for the owner of the storage unit +`crateID` | Yes | The storage unit's item ID +`itemID` | Yes | The item's ID + +## Query Parameters + +None + +## Response Result + +None + +> [!NOTE] +> This request will fail and return a message of "Request timed out" if `itemID` is not found in `crateID` + +## Example Response + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/RetrieveItem/31555237276/41020280968 +``` + +```javascript +{ + "Message": "OK", + "Success": true +} +``` diff --git a/CS2Interface/IPC/Documentation/Items/StoreItem.md b/CS2Interface/IPC/Documentation/Items/StoreItem.md new file mode 100644 index 0000000..7e11a6f --- /dev/null +++ b/CS2Interface/IPC/Documentation/Items/StoreItem.md @@ -0,0 +1,34 @@ +# GET /Api/CS2Interface/{botName}/StoreItem/{crateID}/{itemID} + +## Description + +Stores an item `itemID` into storage unit `crateID` owned by `botName` + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botName` | Yes | The ASF bot name for the owner of the storage unit +`crateID` | Yes | The storage unit's item ID +`itemID` | Yes | The item's ID + +## Query Parameters + +None + +## Response Result + +None + +## Example Response + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/StoreItem/31555237276/41020280968 +``` + +```javascript +{ + "Message": "OK", + "Success": true +} +``` diff --git a/CS2Interface/IPC/Documentation/Players/PlayerProfile.md b/CS2Interface/IPC/Documentation/Players/PlayerProfile.md new file mode 100644 index 0000000..58e8d22 --- /dev/null +++ b/CS2Interface/IPC/Documentation/Players/PlayerProfile.md @@ -0,0 +1,109 @@ +# GET /Api/CS2Interface/{botName}/PlayerProfile/{steamID} + +## Description + +Get the CS2 player profile for `steamID`, a friend of `botName` + +## Path Parameters + +Name | Required | Description +--- | --- | --- +`botName` | Yes | An ASF bot name +`steamID` | No | A 64-bit SteamID for an account on the friends list of `botName`. If missing, the player profile for `botName` will be returned instead + +## Query Parameters + +None + +## Response Result + +The details of this result are defined by [`CMsgGCCStrike15_v2_PlayersProfile`](https://github.com/SteamDatabase/Protobufs/blob/master/csgo/cstrike15_gcmessages.proto) + +> [!NOTE] +> This request will fail and return a message of "Request timed out" if the account with `steamID` is not a friend of `botName` + +## Example Response + +``` +http://127.0.0.1:1242/Api/CS2Interface/Bot1/PlayerProfile/76561197960287930 +``` + +```json +{ + "Message": "OK", + "Success": true, + "Result": { + "account_profiles": [ + { + "account_id": 22202, + "ongoingmatch": null, + "global_stats": null, + "ranking": { + "account_id": 22202, + "rank_id": 0, + "wins": 562, + "rank_type_id": 6, + "per_map_rank": [] + }, + "commendation": { + "cmd_friendly": 66, + "cmd_teaching": 50, + "cmd_leader": 55 + }, + "medals": { + "display_items_defidx": [ + 6020, + 4906, + 996, + 6018, + 1376, + 970, + 6014, + 6016, + 1357, + 922, + 6009, + 1336, + 1024, + 1028, + 1331, + 1327 + ], + "featured_display_item_defidx": 6020 + }, + "my_current_event": null, + "my_current_event_teams": [], + "my_current_team": null, + "my_current_event_stages": [], + "activity": null, + "player_level": 21, + "player_cur_xp": 327682418, + "rankings": [ + { + "account_id": 22202, + "rank_id": 0, + "wins": 2, + "rank_type_id": 7, + "per_map_rank": [] + }, + { + "account_id": 22202, + "rank_id": 0, + "wins": 2, + "rank_type_id": 10, + "per_map_rank": [] + }, + { + "account_id": 22202, + "rank_id": 0, + "wins": 3, + "rank_type_id": 11, + "rank_window_stats": 16777488, + "per_map_rank": [] + } + ] + } + ] + } +} +``` diff --git a/README.md b/README.md index 6dee8fe..1510793 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ This plugin allows you to interact with Counter-Strike 2 using ArchiSteamFarm's Command | Access | Description --- | --- | --- -`cs2interface`|`FamilySharing`|Prints version of plugin. +`cs2interface`|`FamilySharing`|Prints the current version of the plugin `cstart [Bots]`|`Master`|Starts the CS2 Interface `cstop [Bots]`|`Master`|Stops the CS2 Interface `cstatus [Bots]`|`Master`|Displays the status of the CS2 Interface @@ -46,7 +46,7 @@ Command | Alias | > [!NOTE] > It's not possible for a bot to farm non-CS2 cards and use the CS2 Interface at the same time. These two operations can interfere with one another on startup, and so it's important to also enable the `FarmingPausedByDefault` flag. This will prevent ASF's CardFarmer module from starting automatically. > -> If you want to farm cards you can still do so using the `resume` command. The CS2 Interface will automatically start after card farming is complete. +> If you want to farm cards you can still do so using the `resume` command. The CS2 Interface will automatically start when ASF stops farming. --- @@ -55,31 +55,26 @@ Command | Alias | > [!NOTE] > Each bot can only process 1 request at a time. -> [!NOTE] -> Once the plugin is installed additional documentation can be found, by default, at: [`/swagger`](http://localhost:1242/swagger) - #### Interface API | Method | Parameters | Description --- | --- | --- | --- -`/Api/CS2Interface/{botNames}/Start`|`GET`| |Starts the CS2 Interface -`/Api/CS2Interface/{botNames}/Stop`|`GET`| |Stops the CS2 Interface +[`/Api/CS2Interface/{botNames}/Start`](CS2Interface/IPC/Documentation/Interface/Start.md)|`GET`| |Starts the CS2 Interface +[`/Api/CS2Interface/{botNames}/Stop`](CS2Interface/IPC/Documentation/Interface/Stop.md)|`GET`| |Stops the CS2 Interface #### Players API | Method | Parameters | Description --- | --- | --- | --- -`/Api/CS2Interface/{botName}/PlayerProfile/{steamID}`|`GET`| |Get a friend's CS2 player profile +[`/Api/CS2Interface/{botName}/PlayerProfile/{steamID}`](CS2Interface/IPC/Documentation/Players/PlayerProfile.md)|`GET`| |Get a friend's CS2 player profile #### Items API | Method | Parameters | Description --- | --- | --- | --- -`/Api/CS2Interface/{botName}/CraftItem/{recipeID}`|`GET`|`itemIDs`|Crafts an item using the specified trade up recipe -`/Api/CS2Interface/{botName}/GetCrateContents/{crateID}`|`GET`|`minimal`, `showDefs`|Get the contents of the given bot's crate -`/Api/CS2Interface/{botNames}/InspectItem`|`GET`|`url`, `s`, `a`, `d`, `m`, `minimal`, `showDefs`|Inspect a CS2 Item [^1] -`/Api/CS2Interface/{botName}/Inventory`|`GET`|`minimal`, `showDefs`|Get the given bot's CS2 inventory -`/Api/CS2Interface/{botName}/RetrieveItem/{crateID}/{itemID}`|`GET`| |Retrieves an item from the specified crate -`/Api/CS2Interface/{botName}/StoreItem/{crateID}/{itemID}`|`GET`| |Stores an item into the specified crate - -[^1]: Responses are not dependent on the account used to make these requests. You may provide multiple `botNames`, and the first available bot will be used to make the request. +[`/Api/CS2Interface/{botName}/CraftItem/{recipeID}`](CS2Interface/IPC/Documentation/Items/CraftItem.md)|`GET`|`itemIDs`|Crafts an item using the specified trade up recipe +[`/Api/CS2Interface/{botName}/GetCrateContents/{crateID}`](CS2Interface/IPC/Documentation/Items/GetCrateContents.md)|`GET`|`minimal`, `showDefs`|Get the contents of the given bot's crate +[`/Api/CS2Interface/{botNames}/InspectItem`](CS2Interface/IPC/Documentation/Items/InspectItem.md)|`GET`|`url`, `s`, `a`, `d`, `m`, `minimal`, `showDefs`|Inspect a CS2 Item +[`/Api/CS2Interface/{botName}/Inventory`](CS2Interface/IPC/Documentation/Items/Inventory.md)|`GET`|`minimal`, `showDefs`|Get the given bot's CS2 inventory +[`/Api/CS2Interface/{botName}/RetrieveItem/{crateID}/{itemID}`](CS2Interface/IPC/Documentation/Items/RetrieveItem.md)|`GET`| |Retrieves an item from the specified crate +[`/Api/CS2Interface/{botName}/StoreItem/{crateID}/{itemID}`](CS2Interface/IPC/Documentation/Items/StoreItem.md)|`GET`| |Stores an item into the specified crate