Enum sf_api::command::Command

source ·
pub enum Command {
Show 106 variants Custom { cmd_name: String, values: Vec<String>, }, Login { username: String, pw_hash: String, login_count: u32, }, SSOLogin { uuid: String, character_id: String, bearer_token: String, }, Register { username: String, password: String, gender: Gender, race: Race, class: Class, }, UpdatePlayer, HallOfFamePage { page: usize, }, HallOfFameFortressPage { page: usize, }, ViewPlayer { ident: String, }, BuyBeer, StartQuest { quest_pos: usize, overwrite_inv: bool, }, CancelQuest, FinishQuest { skip: Option<QuestSkip>, }, WorkStart { hours: u8, }, WorkCancel, WorkFinish, CheckNameAvailable { name: String, }, BuyMount { mount: Mount, }, IncreaseAttribute { attribute: AttributeType, increase_to: u32, }, RemovePotion { pos: usize, }, CheckArena, Fight { name: String, use_mushroom: bool, }, CollectCalendar, ViewGuild { guild_ident: String, }, GuildFound { name: String, }, GuildInvitePlayer { name: String, }, GuildKickPlayer { name: String, }, GuildSetLeader { name: String, }, GuildToggleOfficer { name: String, }, GuildLoadMushrooms, GuildIncreaseSkill { skill: GuildSkill, current: u16, }, GuildJoinAttack, GuildJoinDefense, GuildAttack { guild: String, }, GuildRaid, GuildPortalBattle, ToiletFlush, ToiletOpen, ToiletDrop { inventory: InventoryType, pos: usize, }, PlayerPortalBattle, BuyShop { shop_type: ShopType, shop_pos: usize, inventory: InventoryType, inventory_pos: usize, }, SellShop { inventory: InventoryType, inventory_pos: usize, shop_type: ShopType, shop_pos: usize, }, InventoryMove { inventory_from: InventoryType, inventory_from_pos: usize, inventory_to: InventoryType, inventory_to_pos: usize, }, ItemMove { from: ItemPosition, from_pos: usize, to: ItemPosition, to_pos: usize, }, MessageOpen { index: i32, }, MessageDelete { index: i32, }, ViewScrapbook, ViewPet { pet_index: u16, }, UnlockFeature { unlockable: Unlockable, }, FightLightDungeon { name: LightDungeon, use_mushroom: bool, }, FightTower { current_level: u8, use_mush: bool, }, GuildSetInfo { description: String, emblem_code: String, }, GambleSilver { amount: u64, }, GambleMushrooms { amount: u64, }, SendMessage { to: String, msg: String, }, SetDescription { description: String, }, WitchDropCauldron { inventory_t: InventoryType, position: usize, }, Blacksmith { inventory_t: InventoryType, position: u8, action: BlacksmithAction, }, GuildSendChat { message: String, }, WitchEnchant { position: EquipmentSlot, }, SpinWheelOfFortune { fortune_payment: FortunePayment, }, CollectEventTaskReward { pos: usize, }, CollectDailyQuestReward { pos: usize, }, EquipCompanion { inventory: InventoryType, position: u8, equipment_slot: EquipmentSlot, }, FortressGather { resource: FortressResourceType, }, FortressBuildStart { f_type: FortressBuildingType, }, FortressBuildCancel { f_type: FortressBuildingType, }, FortressBuildFinish { f_type: FortressBuildingType, mushrooms: u32, }, FortressBuildUnitStart { unit: FortressUnitType, count: u32, }, FortressGemStoneStart, FortressGemStoneCancel, FortressGemStoneFinish { mushrooms: u32, }, FortressAttack { soldiers: u32, }, FortressNewEnemy { use_mushroom: bool, }, FortressSetCAEnemy { msg_id: u32, }, Whisper { player_name: String, message: String, }, UnderworldCollect { resource: UnderWorldResourceType, }, UnderworldUnitUpgrade { unit: UnderworldUnitType, }, UnderworldUpgradeStart { building: UnderworldBuildingType, mushrooms: u32, }, UnderworldUpgradeCancel { building: UnderworldUnitType, }, UnderworldUpgradeComplete { building: UnderworldBuildingType, mushrooms: u32, }, UnderworldAttack { player_id: PlayerId, }, RollDice { payment: RollDiceType, dices: [DiceType; 5], }, PetFeed { pet_id: u32, fruit_idx: u32, }, GuildPetBattle { use_mushroom: bool, }, IdleUpgrade { typ: IdleBuildingType, amount: u64, }, IdleSacrifice, UpgradeSkill { attribute: AttributeType, next_attribute: u32, }, RefreshShop { shop: ShopType, }, HallOfFameGroupPage { page: u32, }, HallOfFameUnderworldPage { page: u32, }, HallOfFamePetsPage { page: u32, }, SwapManequin, UpdateFlag { flag: Option<Flag>, }, BlockGuildInvites { block_invites: bool, }, ShowTips { show_tips: bool, }, ChangePassword { old: String, new: String, }, ChangeMailAddress { old_mail: String, new_mail: String, password: String, username: String, }, SetLanguage { language: String, }, SetPlayerRelation { player_id: PlayerId, relation: Relationship, }, SetPortraitFrame { portrait_id: i64, }, SwapRunes { from: ItemPosition, from_pos: usize, to: ItemPosition, to_pos: usize, }, ChangeItemLook { inv: ItemPosition, pos: usize, raw_model_id: u16, }, ExpeditionChooseStreet { pos: usize, }, ExpeditionContinue, ExpeditionPickItem { pos: usize, }, ExpeditionStart { pos: usize, },
}

Variants§

§

Custom

Fields

§cmd_name: String
§values: Vec<String>

If there is a command you somehow know/reverse engineered, or need to extend the functionality of one of the existing commands, this is the command for you

§

Login

Fields

§username: String
👎Deprecated: Use the login method instead
§pw_hash: String
👎Deprecated: Use the login method instead
§login_count: u32
👎Deprecated: Use the login method instead
👎Deprecated: Use the login method instead

Manually sends a login request to the server. WARN: The behaviour for a credentials mismatch, with the credentials in the user is undefined. Use the login method instead for a safer abstraction

§

SSOLogin

Fields

§uuid: String
👎Deprecated: Use a login method instead
§character_id: String
👎Deprecated: Use a login method instead
§bearer_token: String
👎Deprecated: Use a login method instead
👎Deprecated: Use a login method instead

Manually sends a login request to the server. WARN: The behaviour for a credentials mismatch, with the credentials in the user is undefined. Use the login method instead for a safer abstraction

§

Register

Fields

§username: String
👎Deprecated: Use the register method instead
§password: String
👎Deprecated: Use the register method instead
§gender: Gender
👎Deprecated: Use the register method instead
§race: Race
👎Deprecated: Use the register method instead
§class: Class
👎Deprecated: Use the register method instead
👎Deprecated: Use the register method instead
§

UpdatePlayer

Updates the current state of the user. Also notifies the guild, that the player is logged in. Should therefore be send regularely

§

HallOfFamePage

Fields

§page: usize

Queries 30 Hall of Fame entries starting from the top. Starts at 0

NOTE: The server might return less then 30, if there is a “broken” player encountered. This is NOT a library bug, this is a S&F bug and will glitch out the UI, when trying to view the page in a browser.

§

HallOfFameFortressPage

Fields

§page: usize

Queries 30 Hall of Fame entries for the fortress starting from the top. Starts at 0

§

ViewPlayer

Fields

§ident: String

Looks at a specific player. Ident is either their name, or player_id

§

BuyBeer

Buys a beer in the tavern

§

StartQuest

Fields

§quest_pos: usize
§overwrite_inv: bool

Starts one of the 3 tavern quests. 0,1,2

§

CancelQuest

Cancels the currently running quest

§

FinishQuest

Fields

Finishes the current quest, which starts the battle. This can be used with a QuestSkip to skip the remaining time

§

WorkStart

Fields

§hours: u8

Goes working for the specified amount of hours (1-10)

§

WorkCancel

Cancels the current guard job

§

WorkFinish

Collects the pay from the guard job

§

CheckNameAvailable

Fields

§name: String

Checks if the given name is still available to register

§

BuyMount

Fields

§mount: Mount

Buys a mount, if the player has enough silver/mushrooms

§

IncreaseAttribute

Fields

§attribute: AttributeType
§increase_to: u32

Increases the given attribute to the requested number. Should be current + 1

§

RemovePotion

Fields

§pos: usize

Removes the currently active potion 0,1,2

§

CheckArena

Queries the currently available enemies in the arena

§

Fight

Fields

§name: String
§use_mushroom: bool

Fights the selected enemy. This should be used for both arena fights and normal fights. Not that this actually needs the name, not just the id

§

CollectCalendar

Collects the current reward from the calendar

§

ViewGuild

Fields

§guild_ident: String

Queries information about another guild

§

GuildFound

Fields

§name: String

Founds a new guild

§

GuildInvitePlayer

Fields

§name: String

Invites a player with the given name into the players guild

§

GuildKickPlayer

Fields

§name: String

Kicks a player with the given name from the players guild

§

GuildSetLeader

Fields

§name: String

Promote a player from the guild into the leader role

§

GuildToggleOfficer

Fields

§name: String

Toggles a member between officer and normal member

§

GuildLoadMushrooms

Loads a mushroom into the catapult

§

GuildIncreaseSkill

Fields

§current: u16

Increases one of the guild skills by 1. Needs to know the current, not the new value for some reason

§

GuildJoinAttack

Joins the current ongoing attack

§

GuildJoinDefense

Joins the defense of the guild

§

GuildAttack

Fields

§guild: String

Starts an attack in another guild

§

GuildRaid

Starts the next possible raid

§

GuildPortalBattle

Battles the enemy in the guildportal

§

ToiletFlush

Flushes the toilet

§

ToiletOpen

Opens the toilet door for the first time.

§

ToiletDrop

Fields

§inventory: InventoryType
§pos: usize

Drops an item from one of the inventories into the toilet

§

PlayerPortalBattle

§

BuyShop

Fields

§shop_type: ShopType
§shop_pos: usize
§inventory: InventoryType
§inventory_pos: usize

Buys an item from the shop and puts it in the inventoy slot specified

§

SellShop

Fields

§inventory: InventoryType
§inventory_pos: usize
§shop_type: ShopType
§shop_pos: usize

Buys an item from the shop and puts it in the inventoy slot specified

§

InventoryMove

Fields

§inventory_from: InventoryType
§inventory_from_pos: usize
§inventory_to: InventoryType
§inventory_to_pos: usize

Moves an item from one inventory position to another

§

ItemMove

Fields

§from_pos: usize
§to_pos: usize

Allows moving items from any position to any other position items can be at. You should make sure, that the move makes sense (do not move items from shop to shop)

§

MessageOpen

Fields

§index: i32

Opens the message at the specified index [0-100]

§

MessageDelete

Fields

§index: i32

Deletes a single message, if you provide the index. -1 = all

§

ViewScrapbook

Pulls up your scrapbook to reveal more info, than normal

§

ViewPet

Fields

§pet_index: u16

Views a specific pet. This fetches its stats

§

UnlockFeature

Fields

§unlockable: Unlockable

Unlocks a feature

§

FightLightDungeon

Fields

§use_mushroom: bool

Enters a specific dungeon

§

FightTower

Fields

§current_level: u8
§use_mush: bool

Attacks the requested level of the tower

§

GuildSetInfo

Fields

§description: String
§emblem_code: String

Sets the guild info. Note the info about length limit from SetDescription

§

GambleSilver

Fields

§amount: u64

Gambles the desired amount of silver. Picking the right thing is not actually required. That just masks the determined result

§

GambleMushrooms

Fields

§amount: u64

Gambles the desired amount of mushrooms. Picking the right thing is not actually required. That just masks the determined result

§

SendMessage

Fields

Sends a message to another player

§

SetDescription

Fields

§description: String

The description may only be 240 chars long, when it reaches the server. The problem is, that special chars like ‘/’ have to get escaped into two chars “$s” before getting send to the server. That means this string can be 120-240 chars long depending on the amount of escaped chars. We ‘could’ trunctate the response, but that could get weird with character boundries in UTF8 and split the escapes themself, so just make sure you provide a valid value here to begin with and be prepared for a server error

§

WitchDropCauldron

Fields

§inventory_t: InventoryType
§position: usize
§

Blacksmith

Fields

§inventory_t: InventoryType
§position: u8
§

GuildSendChat

Fields

§message: String
§

WitchEnchant

Fields

§position: EquipmentSlot

Enchants an item, if you have the scroll unlocked. Note that providing shield here is undefined

§

SpinWheelOfFortune

Fields

§fortune_payment: FortunePayment
§

CollectEventTaskReward

Fields

§pos: usize

Collects the reward for collecting points. One of [0,1,2]

§

CollectDailyQuestReward

Fields

§pos: usize

Collects the reward for collecting points. One of [0,1,2]

§

EquipCompanion

Fields

§inventory: InventoryType
§position: u8
§equipment_slot: EquipmentSlot
§

FortressGather

Fields

§

FortressBuildStart

§

FortressBuildCancel

§

FortressBuildFinish

Fields

§mushrooms: u32
§

FortressBuildUnitStart

Fields

§count: u32

Builds new units of the selected type

§

FortressGemStoneStart

Starts the search for gems

§

FortressGemStoneCancel

Cancles the search for gems

§

FortressGemStoneFinish

Fields

§mushrooms: u32

Finishes the gem stone search using the appropriate amount of mushrooms. The price is one mushroom per 600 sec / 10 minutes of time remaining

§

FortressAttack

Fields

§soldiers: u32

Attacks the current fortress attack target with the provided amount of soldiers

§

FortressNewEnemy

Fields

§use_mushroom: bool

Rerolls the enemy in the fortress

§

FortressSetCAEnemy

Fields

§msg_id: u32

Sets the fortress enemy to the counterattack target of the message

§

Whisper

Fields

§player_name: String
§message: String

Sends a wihsper message to another player

§

UnderworldCollect

Fields

Collects the ressources of the selected type in the underworld

§

UnderworldUnitUpgrade

Upgrades the selected underworld unit by one level

§

UnderworldUpgradeStart

Fields

§mushrooms: u32

Starts the upgrade of a building in the underworld

§

UnderworldUpgradeCancel

Fields

Cancels the upgrade of a building in the underworld

§

UnderworldUpgradeComplete

Fields

§mushrooms: u32

Finishes an upgrade after the time has run out (or before using mushrooms)

§

UnderworldAttack

Fields

§player_id: PlayerId

Lures a player into the underworld

§

RollDice

Fields

§dices: [DiceType; 5]

Rolls the dice. The first round should be all rerolls, after that, either reroll again, or take some of the dice on the table

§

PetFeed

Fields

§pet_id: u32
§fruit_idx: u32

Feeds one of your pets

§

GuildPetBattle

Fields

§use_mushroom: bool

Fights with the guild pet against the hydra

§

IdleUpgrade

Fields

§amount: u64

Upgrades an idle building by the requested amount

§

IdleSacrifice

Sacrifice all the money in the idle game for runes

§

UpgradeSkill

Fields

§attribute: AttributeType
§next_attribute: u32

Upgrades a skill to the requested atribute. Should probably be just current + 1 to mimic a user clicking

§

RefreshShop

Fields

Spend 1 mushroom to update the inventory of a shop

§

HallOfFameGroupPage

Fields

§page: u32

Fetches the HoF page for guilds

§

HallOfFameUnderworldPage

Fields

§page: u32

Crawls the HoF page for the underworld

§

HallOfFamePetsPage

Fields

§page: u32
§

SwapManequin

Switch equipment with the manequin, if it is unlocked

§

UpdateFlag

Fields

§flag: Option<Flag>

Updates your flag in the HoF

§

BlockGuildInvites

Fields

§block_invites: bool

Changes if you can receive invites or not

§

ShowTips

Fields

§show_tips: bool

Changes if you want to gets tips in the gui. Does nothing for the API

§

ChangePassword

Fields

Change your password. Note that I have not tested this and this might invalidate your session

§

ChangeMailAddress

Fields

§old_mail: String
§new_mail: String
§password: String
§username: String

Changes your mail to another address

§

SetLanguage

Fields

§language: String

Sets the language of the character. This should be basically irrelevant, but is still included for completeness sake. Expects a valid county code. I have not tested all, but it should be one of: ru,fi,ar,tr,nl,ja,it,sk,fr,ko,pl,cs,el,da,en,hr,de,zh,sv,hu,pt,es, pt-br, ro

§

SetPlayerRelation

Fields

§player_id: PlayerId
§relation: Relationship

Sets the relation to another player

§

SetPortraitFrame

Fields

§portrait_id: i64

I have no character with anything but the default (0) to test this with. If I had to guess, they continue sequentially

§

SwapRunes

Fields

§from_pos: usize
§to_pos: usize

Swaps the runes of two items

§

ChangeItemLook

Fields

§pos: usize
§raw_model_id: u16

Changes the look of the item to the selected raw_model_id for 10 mushrooms. Note that this is NOT the normal model id. it is the model_id + (class as usize) * 1000 if I remember correctly. Pretty sure nobody will ever uses this though, as it is only for looks.

§

ExpeditionChooseStreet

Fields

§pos: usize

Continues the expedition on one of the three streets, [0,1,2]

§

ExpeditionContinue

Continues the expedition, if you are currently in a situation, where there is only one option. This can be starting a fighting, or starting the wait after a fight (collecting the non item reward)

§

ExpeditionPickItem

Fields

§pos: usize

If there are multiple items to choose from after fighting a boss, you can choose which one to take here. [0,1,2]

§

ExpeditionStart

Fields

§pos: usize

Starts one of the two expeditions [0,1]

Trait Implementations§

source§

impl Clone for Command

source§

fn clone(&self) -> Command

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Command

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Command

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Command

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,