Enum sf_api::command::Command

source ·
pub enum Command {
Show 107 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, }, FightShadowDungeon { name: ShadowDungeons, 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

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

Fields

§cmd_name: String
§values: Vec<String>
§

Login

👎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

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
§

SSOLogin

👎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

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
§

Register

👎Deprecated: Use the register method instead

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
§

UpdatePlayer

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

§

HallOfFamePage

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

NOTE: The server might return less then 51, 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.

Fields

§page: usize
§

HallOfFameFortressPage

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

Fields

§page: usize
§

ViewPlayer

Looks at a specific player. Ident is either their name, or player_id. The information about the player can then be found by using the lookup_* methods on Otherplayers

Fields

§ident: String
§

BuyBeer

Buys a beer in the tavern

§

StartQuest

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

Fields

§quest_pos: usize
§overwrite_inv: bool
§

CancelQuest

Cancels the currently running quest

§

FinishQuest

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

Fields

§

WorkStart

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

Fields

§hours: u8
§

WorkCancel

Cancels the current guard job

§

WorkFinish

Collects the pay from the guard job

§

CheckNameAvailable

Checks if the given name is still available to register

Fields

§name: String
§

BuyMount

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

Fields

§mount: Mount
§

IncreaseAttribute

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

Fields

§attribute: AttributeType
§increase_to: u32
§

RemovePotion

Removes the currently active potion 0,1,2

Fields

§pos: usize
§

CheckArena

Queries the currently available enemies in the arena

§

Fight

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

Fields

§name: String
§use_mushroom: bool
§

CollectCalendar

Collects the current reward from the calendar

§

ViewGuild

Queries information about another guild

Fields

§guild_ident: String
§

GuildFound

Founds a new guild

Fields

§name: String
§

GuildInvitePlayer

Invites a player with the given name into the players guild

Fields

§name: String
§

GuildKickPlayer

Kicks a player with the given name from the players guild

Fields

§name: String
§

GuildSetLeader

Promote a player from the guild into the leader role

Fields

§name: String
§

GuildToggleOfficer

Toggles a member between officer and normal member

Fields

§name: String
§

GuildLoadMushrooms

Loads a mushroom into the catapult

§

GuildIncreaseSkill

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

Fields

§current: u16
§

GuildJoinAttack

Joins the current ongoing attack

§

GuildJoinDefense

Joins the defense of the guild

§

GuildAttack

Starts an attack in another guild

Fields

§guild: String
§

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

Drops an item from one of the inventories into the toilet

Fields

§inventory: InventoryType
§pos: usize
§

PlayerPortalBattle

§

BuyShop

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

Fields

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

SellShop

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

Fields

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

InventoryMove

Moves an item from one inventory position to another

Fields

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

ItemMove

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)

Fields

§from_pos: usize
§to_pos: usize
§

MessageOpen

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

Fields

§index: i32
§

MessageDelete

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

Fields

§index: i32
§

ViewScrapbook

Pulls up your scrapbook to reveal more info, than normal

§

ViewPet

Views a specific pet. This fetches its stats

Fields

§pet_index: u16
§

UnlockFeature

Unlocks a feature

Fields

§unlockable: Unlockable
§

FightLightDungeon

Enters a specific dungeon

Fields

§use_mushroom: bool
§

FightShadowDungeon

Enters a specific shadow dungeon

Fields

§use_mushroom: bool
§

FightTower

Attacks the requested level of the tower

Fields

§current_level: u8
§use_mush: bool
§

GuildSetInfo

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

Fields

§description: String
§emblem_code: String
§

GambleSilver

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

Fields

§amount: u64
§

GambleMushrooms

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

Fields

§amount: u64
§

SendMessage

Sends a message to another player

Fields

§

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

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

Fields

§position: EquipmentSlot
§

SpinWheelOfFortune

Fields

§fortune_payment: FortunePayment
§

CollectEventTaskReward

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

Fields

§pos: usize
§

CollectDailyQuestReward

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

Fields

§pos: usize
§

EquipCompanion

Fields

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

FortressGather

Fields

§

FortressBuildStart

§

FortressBuildCancel

§

FortressBuildFinish

Fields

§mushrooms: u32
§

FortressBuildUnitStart

Builds new units of the selected type

Fields

§count: u32
§

FortressGemStoneStart

Starts the search for gems

§

FortressGemStoneCancel

Cancles the search for gems

§

FortressGemStoneFinish

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

Fields

§mushrooms: u32
§

FortressAttack

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

Fields

§soldiers: u32
§

FortressNewEnemy

Rerolls the enemy in the fortress

Fields

§use_mushroom: bool
§

FortressSetCAEnemy

Sets the fortress enemy to the counterattack target of the message

Fields

§msg_id: u32
§

Whisper

Sends a wihsper message to another player

Fields

§player_name: String
§message: String
§

UnderworldCollect

Collects the ressources of the selected type in the underworld

Fields

§

UnderworldUnitUpgrade

Upgrades the selected underworld unit by one level

§

UnderworldUpgradeStart

Starts the upgrade of a building in the underworld

Fields

§mushrooms: u32
§

UnderworldUpgradeCancel

Cancels the upgrade of a building in the underworld

Fields

§

UnderworldUpgradeComplete

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

Fields

§mushrooms: u32
§

UnderworldAttack

Lures a player into the underworld

Fields

§player_id: PlayerId
§

RollDice

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

Fields

§dices: [DiceType; 5]
§

PetFeed

Feeds one of your pets

Fields

§pet_id: u32
§fruit_idx: u32
§

GuildPetBattle

Fights with the guild pet against the hydra

Fields

§use_mushroom: bool
§

IdleUpgrade

Upgrades an idle building by the requested amount

Fields

§amount: u64
§

IdleSacrifice

Sacrifice all the money in the idle game for runes

§

UpgradeSkill

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

Fields

§attribute: AttributeType
§next_attribute: u32
§

RefreshShop

Spend 1 mushroom to update the inventory of a shop

Fields

§

HallOfFameGroupPage

Fetches the HoF page for guilds

Fields

§page: u32
§

HallOfFameUnderworldPage

Crawls the HoF page for the underworld

Fields

§page: u32
§

HallOfFamePetsPage

Fields

§page: u32
§

SwapManequin

Switch equipment with the manequin, if it is unlocked

§

UpdateFlag

Updates your flag in the HoF

Fields

§flag: Option<Flag>
§

BlockGuildInvites

Changes if you can receive invites or not

Fields

§block_invites: bool
§

ShowTips

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

Fields

§show_tips: bool
§

ChangePassword

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

Fields

§

ChangeMailAddress

Changes your mail to another address

Fields

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

SetLanguage

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

Fields

§language: String
§

SetPlayerRelation

Sets the relation to another player

Fields

§player_id: PlayerId
§relation: Relationship
§

SetPortraitFrame

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

Fields

§portrait_id: i64
§

SwapRunes

Swaps the runes of two items

Fields

§from_pos: usize
§to_pos: usize
§

ChangeItemLook

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.

Fields

§pos: usize
§raw_model_id: u16
§

ExpeditionChooseStreet

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

Fields

§pos: usize
§

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

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

Fields

§pos: usize
§

ExpeditionStart

Starts one of the two expeditions [0,1]

Fields

§pos: usize

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.

source§

impl<T> Instrument for T

source§

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

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

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.
source§

impl<T> WithSubscriber for T

source§

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
source§

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>,