#[non_exhaustive]pub enum Command {
Show 128 variants
Custom {
cmd_name: String,
arguments: 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,
},
Update,
HallOfFamePage {
page: usize,
},
HallOfFameFortressPage {
page: usize,
},
ViewPlayer {
ident: String,
},
BuyBeer,
StartQuest {
quest_pos: usize,
overwrite_inv: bool,
},
CancelQuest,
FinishQuest {
skip: Option<TimeSkip>,
},
StartWork {
hours: u8,
},
CancelWork,
FinishWork,
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,
GuildGetFightableTargets,
ToiletFlush,
ToiletOpen,
ToiletDrop {
inventory: PlayerItemPlace,
pos: usize,
},
BuyShop {
shop_type: ShopType,
shop_pos: usize,
inventory: PlayerItemPlace,
inventory_pos: usize,
},
SellShop {
inventory: PlayerItemPlace,
inventory_pos: usize,
},
InventoryMove {
inventory_from: PlayerItemPlace,
inventory_from_pos: usize,
inventory_to: PlayerItemPlace,
inventory_to_pos: usize,
},
ItemMove {
from: ItemPlace,
from_pos: usize,
to: ItemPlace,
to_pos: usize,
},
UsePotion {
from: ItemPlace,
from_pos: usize,
},
MessageOpen {
pos: i32,
},
MessageDelete {
pos: i32,
},
ViewScrapbook,
ViewPet {
pet_id: u16,
},
UnlockFeature {
unlockable: Unlockable,
},
FightPortal,
FightDungeon {
dungeon: Dungeon,
use_mushroom: bool,
},
FightTower {
current_level: u8,
use_mush: bool,
},
FightPetOpponent {
habitat: HabitatType,
opponent_id: PlayerId,
},
FightPetDungeon {
use_mush: bool,
habitat: HabitatType,
enemy_pos: u32,
player_pet_id: u32,
},
GuildSetInfo {
description: String,
emblem: Emblem,
},
GambleSilver {
amount: u64,
},
GambleMushrooms {
amount: u64,
},
SendMessage {
to: String,
msg: String,
},
SetDescription {
description: String,
},
WitchDropCauldron {
inventory_t: PlayerItemPlace,
position: usize,
},
Blacksmith {
inventory_t: PlayerItemPlace,
position: u8,
action: BlacksmithAction,
},
GuildSendChat {
message: String,
},
WitchEnchant {
enchantment: EnchantmentIdent,
},
SpinWheelOfFortune {
payment: FortunePayment,
},
CollectEventTaskReward {
pos: usize,
},
CollectDailyQuestReward {
pos: usize,
},
EquipCompanion {
from_inventory: InventoryType,
from_pos: u8,
to_companion: CompanionClass,
to_slot: EquipmentSlot,
},
FortressGather {
resource: FortressResourceType,
},
FortressGatherSecretStorage {
stone: u64,
wood: u64,
},
FortressBuild {
f_type: FortressBuildingType,
},
FortressBuildCancel {
f_type: FortressBuildingType,
},
FortressBuildFinish {
f_type: FortressBuildingType,
mushrooms: u32,
},
FortressBuildUnit {
unit: FortressUnitType,
count: u32,
},
FortressGemStoneSearch,
FortressGemStoneSearchCancel,
FortressGemStoneSearchFinish {
mushrooms: u32,
},
FortressAttack {
soldiers: u32,
},
FortressNewEnemy {
use_mushroom: bool,
},
FortressSetCAEnemy {
msg_id: u32,
},
FortressUpgradeHallOfKnights,
Whisper {
player_name: String,
message: String,
},
UnderworldCollect {
resource: UnderWorldResourceType,
},
UnderworldUnitUpgrade {
unit: UnderworldUnitType,
},
UnderworldUpgradeStart {
building: UnderworldBuildingType,
mushrooms: u32,
},
UnderworldUpgradeCancel {
building: UnderworldUnitType,
},
UnderworldUpgradeFinish {
building: UnderworldBuildingType,
mushrooms: u32,
},
UnderworldAttack {
player_id: PlayerId,
},
RollDice {
payment: RollDicePrice,
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 {
username: String,
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: ItemPlace,
from_pos: usize,
to: ItemPlace,
to_pos: usize,
},
ChangeItemLook {
inv: ItemPlace,
pos: usize,
raw_model_id: u16,
},
ExpeditionPickEncounter {
pos: usize,
},
ExpeditionContinue,
ExpeditionPickReward {
pos: usize,
},
ExpeditionStart {
pos: usize,
},
ExpeditionSkipWait {
typ: TimeSkip,
},
SetQuestsInsteadOfExpeditions {
value: ExpeditionSetting,
},
HellevatorEnter,
HellevatorViewGuildRanking,
HellevatorFight {
use_mushroom: bool,
},
HellevatorBuy {
position: usize,
typ: HellevatorTreatType,
price: u32,
use_mushroom: bool,
},
HellevatorRefreshShop,
HellevatorJoinHellAttack {
use_mushroom: bool,
plain: usize,
},
HellevatorClaimDaily,
HellevatorClaimDailyYesterday,
HellevatorClaimFinal,
HellevatorPreviewRewards,
HallOfFameHellevatorPage {
page: usize,
},
ClaimablePreview {
msg_id: i64,
},
ClaimableClaim {
msg_id: i64,
},
BuyGoldFrame,
}
Expand description
A command, that can be send to the sf server
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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
Login
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
SSOLogin
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
The Identifies the S&F account, that has this character
Register
Registers a new normal character in the server. I am not sure about the portrait, so currently this sets the same default portrait for every char
Fields
Update
Updates the current state of the entire gamestate. 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
HallOfFameFortressPage
Queries 51 Hall of Fame entries for the fortress starting from the top. Starts at 0
Fields
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 HallOfFames
BuyBeer
Buys a beer in the tavern
StartQuest
Starts one of the 3 tavern quests. 0,1,2
Fields
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
StartWork
Goes working for the specified amount of hours (1-10)
CancelWork
Cancels the current guard job
FinishWork
Collects the pay from the guard job
CheckNameAvailable
Checks if the given name is still available to register
BuyMount
Buys a mount, if the player has enough silver/mushrooms
IncreaseAttribute
Increases the given base attribute to the requested number. Should be
current + 1
Fields
attribute: AttributeType
The attribute you want to increase
RemovePotion
Removes the currently active potion 0,1,2
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. Note that this actually needs the name, not just the id
Fields
CollectCalendar
Collects the current reward from the calendar
ViewGuild
Queries information about another guild. The information can bet found
in hall_of_fames.other_guilds
GuildFound
Founds a new guild
GuildInvitePlayer
Invites a player with the given name into the players guild
GuildKickPlayer
Kicks a player with the given name from the players guild
GuildSetLeader
Promote a player from the guild into the leader role
GuildToggleOfficer
Toggles a member between officer and normal member
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
skill: GuildSkill
The skill you want to increase
GuildJoinAttack
Joins the current ongoing attack
GuildJoinDefense
Joins the defense of the guild
GuildAttack
Starts an attack in another guild
GuildRaid
Starts the next possible raid
GuildPortalBattle
Battles the enemy in the guildportal
GuildGetFightableTargets
Fetch the fightable guilds
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: PlayerItemPlace
The inventory you want to take the item from
BuyShop
Buys an item from the shop and puts it in the inventoy slot specified
Fields
inventory: PlayerItemPlace
The inventory you want to put the new item into
SellShop
Sells an item from the players inventory. To make this more convenient, this picks a shop&item position to sell to for you
Fields
inventory: PlayerItemPlace
The inventory you want to sell an item from
InventoryMove
Moves an item from one inventory position to another
Fields
inventory_from: PlayerItemPlace
The inventory you move the item from
inventory_to: PlayerItemPlace
The inventory you move the item to
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
UsePotion
Allows using an potion from any position
Fields
MessageOpen
Opens the message at the specified index [0-100]
MessageDelete
Deletes a single message, if you provide the index. -1 = all
Fields
ViewScrapbook
Pulls up your scrapbook to reveal more info, than normal
ViewPet
Views a specific pet. This fetches its stats and places it into the specified pet in the habitat
UnlockFeature
Unlocks a feature. The these unlockables can be found in
pending_unlocks
on GameState
Fields
unlockable: Unlockable
The thing to unlock
FightPortal
Starts a fight against the enemy in the players portal
FightDungeon
Enters a specific dungeon. This works for all dungeons, except the
Tower, which you must enter via the FightTower
command
Fields
FightTower
Attacks the requested level of the tower
Fields
FightPetOpponent
Fights the player opponent with your pet
Fields
habitat: HabitatType
The habitat opponent you want to attack the opponent in
FightPetDungeon
Fights the pet in the specified habitat dungeon
Fields
use_mush: bool
If this is true, you will spend a mushroom, if the timer has not run out. Note, that this is currently ignored by the server for some reason
habitat: HabitatType
The habitat, that you want to fight in
GuildSetInfo
Sets the guild info. Note the info about length limit from
SetDescription
for the description
GambleSilver
Gambles the desired amount of silver. Picking the right thing is not
actually required. That just masks the determined result. The result
will be in gamble_result
on Tavern
GambleMushrooms
Gambles the desired amount of mushrooms. Picking the right thing is not
actually required. That just masks the determined result. The result
will be in gamble_result
on Tavern
SendMessage
Sends a message to another player
SetDescription
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’ truncate the response, but that could get weird with character boundaries 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
Drop the item from the specified position into the witches cauldron
Fields
inventory_t: PlayerItemPlace
The inventory you want to move an item from
Blacksmith
Uses the blacksmith with the specified action on the specified item
Fields
inventory_t: PlayerItemPlace
The inventory the item you want to act upon is in
action: BlacksmithAction
The action you want to use on the item
GuildSendChat
Sends the specified message in the guild chat
WitchEnchant
Enchants the currently worn item, associated with this enchantment, with the enchantment
Fields
enchantment: EnchantmentIdent
The enchantment to apply
SpinWheelOfFortune
Spins the wheel. All information about when you can spin, or what you
won are in game_state.specials.wheel
Fields
payment: FortunePayment
The resource you want to spend to spin the wheel
CollectEventTaskReward
Collects the reward for event points
CollectDailyQuestReward
Collects the reward for collecting points.
EquipCompanion
Moves an item from a normal inventory, onto one of the companions
Fields
from_inventory: InventoryType
The inventory of your character you take the item from
to_companion: CompanionClass
The companion you want to equip
to_slot: EquipmentSlot
The slot of the companion you want to equip
FortressGather
Collects a specific resource from the fortress
Fields
resource: FortressResourceType
The type of resource you want to collect
FortressGatherSecretStorage
Collects resources from the fortress secret storage Note that the official client only ever collect either stone or wood but not both at the same time
Fields
FortressBuild
Builds, or upgrades a building in the fortress
Fields
f_type: FortressBuildingType
The building you want to upgrade, or build
FortressBuildCancel
Cancels the current build/upgrade, of the specified building in the fortress
Fields
f_type: FortressBuildingType
The building you want to cancel the upgrade, or build of
FortressBuildFinish
Finish building/upgrading a Building When mushrooms != 0, mushrooms will be used to “skip” the upgrade timer. However, this command also needs to be sent when not skipping the wait, with mushrooms = 0, after the build/upgrade timer has finished.
FortressBuildUnit
Builds new units of the selected type
FortressGemStoneSearch
Starts the search for gems
FortressGemStoneSearchCancel
Cancels the search for gems
FortressGemStoneSearchFinish
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
Attacks the current fortress attack target with the provided amount of soldiers
FortressNewEnemy
Re-rolls the enemy in the fortress
FortressSetCAEnemy
Sets the fortress enemy to the counterattack target of the message
FortressUpgradeHallOfKnights
Upgrades the Hall of Knights to the next level
Whisper
Sends a whisper message to another player
UnderworldCollect
Collects the resources of the selected type in the underworld
Fields
resource: UnderWorldResourceType
UnderworldUnitUpgrade
Upgrades the selected underworld unit by one level
Fields
unit: UnderworldUnitType
UnderworldUpgradeStart
Starts the upgrade of a building in the underworld
UnderworldUpgradeCancel
Cancels the upgrade of a building in the underworld
Fields
building: UnderworldUnitType
UnderworldUpgradeFinish
Finishes an upgrade after the time has run out (or before using mushrooms)
UnderworldAttack
Lures a player into the underworld
RollDice
Rolls the dice. The first round should be all re-rolls, after that, either re-roll again, or take some of the dice on the table
PetFeed
Feeds one of your pets
GuildPetBattle
Fights with the guild pet against the hydra
IdleUpgrade
Upgrades an idle building by the requested amount
IdleSacrifice
Sacrifice all the money in the idle game for runes
UpgradeSkill
Upgrades a skill to the requested attribute. Should probably be just current + 1 to mimic a user clicking
RefreshShop
Spend 1 mushroom to update the inventory of a shop
HallOfFameGroupPage
Fetches the Hall of Fame page for guilds
HallOfFameUnderworldPage
Crawls the Hall of Fame page for the underworld
HallOfFamePetsPage
SwapManequin
Switch equipment with the manequin, if it is unlocked
UpdateFlag
Updates your flag in the Hall of Fame
BlockGuildInvites
Changes if you can receive invites or not
ShowTips
Changes if you want to gets tips in the gui. Does nothing for the API
ChangePassword
Change your password. Note that I have not tested this and this might invalidate your session
ChangeMailAddress
Changes your mail to another address
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
SetPlayerRelation
Sets the relation to another player
SetPortraitFrame
I have no character with anything but the default (0) to test this with. If I had to guess, they continue sequentially
SwapRunes
Swaps the runes of two items
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.
ExpeditionPickEncounter
Continues the expedition by picking one of the <=3 encounters [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). Behind the scenes this is just ExpeditionPickReward(0)
ExpeditionPickReward
If there are multiple items to choose from after fighting a boss, you can choose which one to take here. [0,1,2]
ExpeditionStart
Starts one of the two expeditions [0,1]
ExpeditionSkipWait
Skips the waiting period of the current expedition. Note that mushroom may not always be possible
SetQuestsInsteadOfExpeditions
This sets the “Questing instead of expeditions” value in the settings.
This will decide if you can go on expeditions, or do quests, when
expeditions are available. Going on the “wrong” one will return an
error. Similarly this setting can only be changed, when no Thirst for
Adventure has been used today, so make sure to check if that is full
and beer_drunk == 0
Fields
value: ExpeditionSetting
The value you want to set
HellevatorEnter
HellevatorViewGuildRanking
HellevatorFight
HellevatorBuy
HellevatorRefreshShop
HellevatorJoinHellAttack
HellevatorClaimDaily
HellevatorClaimDailyYesterday
HellevatorClaimFinal
HellevatorPreviewRewards
HallOfFameHellevatorPage
ClaimablePreview
ClaimableClaim
BuyGoldFrame
Spend 1000 mushrooms to buy a gold frame