Barotrauma Server
|
Public Types | |
enum | NetFlags : UInt16 { Misc = 0x1 , MapAndMissions = 0x2 , UpgradeManager = 0x4 , SubList = 0x8 , ItemsInBuyCrate = 0x10 , ItemsInSellFromSubCrate = 0x20 , PurchasedItems = 0x80 , SoldItems = 0x100 , Reputation = 0x200 , CharacterInfo = 0x800 } |
![]() | |
enum | InteractionType { None , Talk , Examine , Map , Crew , Store , Upgrade , PurchaseSub , MedicalClinic , Cargo } |
enum | TransitionType { None , LeaveLocation , ProgressToNextLocation , ReturnToPreviousLocation , ReturnToPreviousEmptyLocation , ProgressToNextEmptyLocation , End } |
Public Member Functions | |
UInt16 | GetLastUpdateIdForFlag (NetFlags flag) |
void | SetLastUpdateIdForFlag (NetFlags flag, UInt16 id) |
void | IncrementLastUpdateIdForFlag (NetFlags flag) |
void | IncrementAllLastUpdateIds () |
override Wallet | GetWallet (Client client=null) |
override void | Start () |
void | SaveExperiencePoints (Client client) |
int | GetSavedExperiencePoints (Client client) |
void | ClearSavedExperiencePoints (Client client) |
void | SavePlayers () |
void | MoveDiscardedCharacterBalancesToBank () |
bool | CanPurchaseSub (SubmarineInfo info, Client client) |
void | DiscardClientCharacterData (Client client) |
CharacterCampaignData | GetClientCharacterData (Client client) |
CharacterCampaignData | GetCharacterData (CharacterInfo characterInfo) |
CharacterCampaignData | SetClientCharacterData (Client client) |
void | AssignClientCharacterInfos (IEnumerable< Client > connectedClients) |
Dictionary< Client, Job > | GetAssignedJobs (IEnumerable< Client > connectedClients) |
override void | Update (float deltaTime) |
override void | End (TransitionType transitionType=TransitionType.None) |
void | ServerWrite (IWriteMessage msg, Client c) |
void | ServerRead (IReadMessage msg, Client sender) |
void | ServerReadMoney (IReadMessage msg, Client sender) |
void | ServerReadRewardDistribution (IReadMessage msg, Client sender) |
void | ResetSalaries (Client sender) |
void | ServerReadCrew (IReadMessage msg, Client sender) |
void | SendCrewState ((ushort id, string newName) renamedCrewMember=default, CharacterInfo firedCharacter=null, bool createNotification=true) |
Notifies the clients of the current bot situation like syncing pending and available hires. | |
override bool | TryPurchase (Client client, int price) |
override int | GetBalance (Client client=null) |
override void | Save (XElement element) |
void | SaveSingleCharacter (CharacterCampaignData newData, bool skipBackup=false) |
Load the current character save file and add/replace a single character's data with a new version immediately. | |
CharacterCampaignData | RestoreSingleCharacterFromBackup (Client client) |
![]() | |
bool | CanAfford (int cost, Client client=null) |
Location | GetCurrentDisplayLocation () |
The location that's displayed as the "current one" in the map screen. Normally the current outpost or the location at the start of the level, but when selecting the next destination at the end of the level at an uninhabited location we use the location at the end. | |
SubmarineInfo | GetPredefinedStartOutpost () |
void | InitFactions () |
override void | AddExtraMissions (LevelData levelData) |
void | LoadNewLevel () |
TransitionType | GetAvailableTransition (out LevelData nextLevel, out Submarine leavingSub) |
Which type of transition between levels is currently possible (if any) | |
TransitionType | GetAvailableTransition () |
void | HandleSaveAndQuit () |
Handles updating store stock, registering event history and relocating items (i.e. things that need to be done when saving and quitting mid-round) | |
void | UpdateStoreStock () |
Updates store stock before saving the game. | |
void | EndCampaign () |
Faction | GetRandomFaction (Rand.RandSync randSync, bool allowEmpty=true) |
Returns a random faction based on their ControlledOutpostPercentage. | |
Faction | GetRandomSecondaryFaction (Rand.RandSync randSync, bool allowEmpty=true) |
Returns a random faction based on their SecondaryControlledOutpostPercentage. | |
bool | TryHireCharacter (Location location, CharacterInfo characterInfo, bool takeMoney=true, Client client=null, bool buyingNewCharacter=false) |
int | NewCharacterCost (CharacterInfo characterInfo) |
bool | CanAffordNewCharacter (CharacterInfo characterInfo) |
void | AssignNPCMenuInteraction (Character character, InteractionType interactionType) |
void | OutpostNPCAttacked (Character npc, Character attacker, AttackResult attackResult) |
Faction | GetFaction (Identifier identifier) |
float | GetReputation (Identifier factionIdentifier) |
FactionAffiliation | GetFactionAffiliation (Identifier factionIdentifier) |
void | Save (XElement element) |
void | LogState () |
override void | Remove () |
int | NumberOfMissionsAtLocation (Location location) |
void | CheckTooManyMissions (Location currentLocation, Client sender) |
void | SwitchSubs () |
void | SavePets (XElement parentElement=null) |
void | LoadPets () |
void | SaveActiveOrders (XElement parentElement=null) |
void | LoadActiveOrders () |
override void | ShowStartMessage () |
![]() | |
virtual void | UpdateWhilePaused (float deltaTime) |
GameMode (GameModePreset preset) | |
virtual void | AddToGUIUpdateList () |
Static Public Member Functions | |
static MultiPlayerCampaign | StartNew (string mapSeed, CampaignSettings settings) |
static MultiPlayerCampaign | LoadNew (XElement element) |
static string | GetCharacterDataSavePath (string savePath) |
static string | GetCharacterDataSavePath () |
static List< SubmarineInfo > | GetCampaignSubs () |
static void | StartNewCampaign (string savePath, string subPath, string seed, CampaignSettings startingSettings) |
static void | LoadCampaign (string selectedSave, Client client) |
static void | StartCampaignSetup () |
![]() | |
static bool | BlocksInteraction (InteractionType interactionType) |
static List< Submarine > | GetSubsToLeaveBehind (Submarine leavingSub) |
static int | GetHullRepairCost () |
static int | GetItemRepairCost () |
static Faction | GetRandomFaction (IEnumerable< Faction > factions, Rand.RandSync randSync, bool secondary=false, bool allowEmpty=true) |
static Faction | GetRandomFaction (IEnumerable< Faction > factions, Random random, bool secondary=false, bool allowEmpty=true) |
static bool | AllowedToManageCampaign (Client client, ClientPermissions permissions) |
There is a client-side implementation of the method in CampaignMode | |
static bool | AllowImmediateItemDelivery (Client client) |
static bool | AllowedToManageWallets (Client client) |
Public Attributes | |
List< CharacterCampaignData > | replacedCharacterDataBackup = new List<CharacterCampaignData>() |
Temporary backup storage for characters that have been overwritten by SaveSingleCharacter, this will be gone once the round ends or the server closes. Currently needed to enable the console command "revive" in ironman mode. | |
![]() | |
double | TotalPlayTime |
int | TotalPassedLevels |
readonly CargoManager | CargoManager |
UpgradeManager | UpgradeManager |
MedicalClinic | MedicalClinic |
readonly CampaignMetadata | CampaignMetadata |
CampaignSettings | Settings |
readonly NamedEvent< WalletChangedEvent > | OnMoneyChanged = new NamedEvent<WalletChangedEvent>() |
bool | CheatsEnabled |
SubmarineInfo | PendingSubmarineSwitch |
Wallet | Bank |
bool | PurchasedLostShuttlesInLatestSave |
bool | PurchasedHullRepairsInLatestSave |
bool | PurchasedItemRepairsInLatestSave |
bool | DivingSuitWarningShown |
bool | ItemsRelocatedToMainSub |
Protected Member Functions | |
override void | LoadInitialLevel () |
override IEnumerable< CoroutineStatus > | DoLevelTransition (TransitionType transitionType, LevelData newLevel, Submarine leavingSub, bool mirror) |
![]() | |
CampaignMode (GameModePreset preset, CampaignSettings settings) | |
void | LoadInitialLevel () |
Load the first level and start the round after loading a save file. | |
IEnumerable< CoroutineStatus > | DoLevelTransition (TransitionType transitionType, LevelData newLevel, Submarine leavingSub, bool mirror) |
virtual void | EndCampaignProjSpecific () |
void | KeepCharactersCloseToOutpost (float deltaTime) |
void | LoadStats (XElement element) |
XElement | SaveStats () |
void | TransferItemsBetweenSubs () |
Also serializes the current sub. | |
void | RefreshOwnedSubmarines () |
Properties | |
UInt16 | LastSaveID [get, set] |
byte | CampaignID [get, set] |
bool | ForceMapUI [get, set] |
bool | GameOver [get] |
override bool | Paused [get] |
override bool | PurchasedHullRepairs [get, set] |
override bool | PurchasedLostShuttles [get, set] |
override bool | PurchasedItemRepairs [get, set] |
![]() | |
IReadOnlyList< Faction > | Factions [get] |
XElement | ActiveOrdersElement [get, set] |
bool | IsFirstRound = true [get, protected set] |
bool | DisableEvents [get] |
bool | TransferItemsOnSubSwitch [get, set] |
bool | SwitchedSubsThisRound [get] |
Map | Map [get] |
override IEnumerable< Mission > | Missions [get] |
Location | CurrentLocation [get] |
LevelData | NextLevel [get, protected set] |
virtual bool | PurchasedHullRepairs [get, set] |
virtual bool | PurchasedLostShuttles [get, set] |
virtual bool | PurchasedItemRepairs [get, set] |
bool | MirrorLevel [get, protected set] |
![]() | |
CrewManager | CrewManager [get] |
virtual IEnumerable< Mission > | Missions [get] |
bool | IsSinglePlayer [get] |
LocalizedString | Name [get] |
virtual bool | Paused [get] |
GameModePreset | Preset [get] |
Additional Inherited Members | |
![]() | |
readonly record struct SaveInfo(string FilePath, Option< SerializableDateTime > SaveTime, string SubmarineName, ImmutableArray< string > EnabledContentPackageNames) const int | MaxMoney = int.MaxValue / 2 |
const int | InitialMoney = 8500 |
const float | HullRepairCostPerDamage = 0.1f |
const float | ItemRepairCostPerRepairDuration = 1.0f |
const int | ShuttleReplaceCost = 1000 |
const int | MaxHullRepairCost = 600 |
const int | MaxItemRepairCost = 2000 |
![]() | |
static List< GameModePreset > | PresetList = new List<GameModePreset>() |
![]() | |
static void | LeaveUnconnectedSubs (Submarine leavingSub) |
![]() | |
XElement | petsElement |
bool | wasDocked |
Map | map |
![]() | |
DateTime | startTime |
GameModePreset | preset |
![]() | |
const float | EndTransitionDuration = 5.0f |
![]() | |
Action | BeforeLevelLoading |
Automatically cleared after triggering -> no need to unregister. | |
Action | OnSaveAndQuit |
Triggers when saving and quitting mid-round (as in, not just transferring to a new level). Automatically cleared after triggering -> no need to unregister. | |
enum Barotrauma.MultiPlayerCampaign.NetFlags : UInt16 |
void Barotrauma.MultiPlayerCampaign.AssignClientCharacterInfos | ( | IEnumerable< Client > | connectedClients | ) |
bool Barotrauma.MultiPlayerCampaign.CanPurchaseSub | ( | SubmarineInfo | info, |
Client | client ) |
void Barotrauma.MultiPlayerCampaign.ClearSavedExperiencePoints | ( | Client | client | ) |
void Barotrauma.MultiPlayerCampaign.DiscardClientCharacterData | ( | Client | client | ) |
|
protected |
|
virtual |
Reimplemented from Barotrauma.CampaignMode.
Dictionary< Client, Job > Barotrauma.MultiPlayerCampaign.GetAssignedJobs | ( | IEnumerable< Client > | connectedClients | ) |
|
virtual |
Reimplemented from Barotrauma.CampaignMode.
|
static |
CharacterCampaignData Barotrauma.MultiPlayerCampaign.GetCharacterData | ( | CharacterInfo | characterInfo | ) |
|
static |
|
static |
CharacterCampaignData Barotrauma.MultiPlayerCampaign.GetClientCharacterData | ( | Client | client | ) |
UInt16 Barotrauma.MultiPlayerCampaign.GetLastUpdateIdForFlag | ( | NetFlags | flag | ) |
int Barotrauma.MultiPlayerCampaign.GetSavedExperiencePoints | ( | Client | client | ) |
|
virtual |
Reimplemented from Barotrauma.CampaignMode.
void Barotrauma.MultiPlayerCampaign.IncrementAllLastUpdateIds | ( | ) |
void Barotrauma.MultiPlayerCampaign.IncrementLastUpdateIdForFlag | ( | NetFlags | flag | ) |
|
static |
|
protected |
|
static |
void Barotrauma.MultiPlayerCampaign.MoveDiscardedCharacterBalancesToBank | ( | ) |
void Barotrauma.MultiPlayerCampaign.ResetSalaries | ( | Client | sender | ) |
CharacterCampaignData Barotrauma.MultiPlayerCampaign.RestoreSingleCharacterFromBackup | ( | Client | client | ) |
override void Barotrauma.MultiPlayerCampaign.Save | ( | XElement | element | ) |
void Barotrauma.MultiPlayerCampaign.SaveExperiencePoints | ( | Client | client | ) |
void Barotrauma.MultiPlayerCampaign.SavePlayers | ( | ) |
void Barotrauma.MultiPlayerCampaign.SaveSingleCharacter | ( | CharacterCampaignData | newData, |
bool | skipBackup = false ) |
Load the current character save file and add/replace a single character's data with a new version immediately.
newData | New character to insert. If it matches one existing in the save, that will get replaced. |
skipBackup | By default, replaced characters will be temporarily backed up, but that might be unwanted eg. when using this method to save a character itself restored from the backup. |
void Barotrauma.MultiPlayerCampaign.SendCrewState | ( | (ushort id, string newName) | renamedCrewMember = default, |
CharacterInfo | firedCharacter = null, | ||
bool | createNotification = true ) |
Notifies the clients of the current bot situation like syncing pending and available hires.
hiredCharacters | Inform the clients that these characters have been hired. |
firedCharacter | Inform the clients that this character has been fired. |
It might be obsolete to sync available hires. I found that the available hires are always the same between the client and the server when there's only one person on the server but when a second person joins both of their available hires are different from the server.
void Barotrauma.MultiPlayerCampaign.ServerRead | ( | IReadMessage | msg, |
Client | sender ) |
void Barotrauma.MultiPlayerCampaign.ServerReadCrew | ( | IReadMessage | msg, |
Client | sender ) |
void Barotrauma.MultiPlayerCampaign.ServerReadMoney | ( | IReadMessage | msg, |
Client | sender ) |
void Barotrauma.MultiPlayerCampaign.ServerReadRewardDistribution | ( | IReadMessage | msg, |
Client | sender ) |
void Barotrauma.MultiPlayerCampaign.ServerWrite | ( | IWriteMessage | msg, |
Client | c ) |
CharacterCampaignData Barotrauma.MultiPlayerCampaign.SetClientCharacterData | ( | Client | client | ) |
void Barotrauma.MultiPlayerCampaign.SetLastUpdateIdForFlag | ( | NetFlags | flag, |
UInt16 | id ) |
|
virtual |
Reimplemented from Barotrauma.CampaignMode.
|
static |
|
static |
|
static |
|
virtual |
Reimplemented from Barotrauma.CampaignMode.
|
virtual |
Reimplemented from Barotrauma.GameMode.
List<CharacterCampaignData> Barotrauma.MultiPlayerCampaign.replacedCharacterDataBackup = new List<CharacterCampaignData>() |
Temporary backup storage for characters that have been overwritten by SaveSingleCharacter, this will be gone once the round ends or the server closes. Currently needed to enable the console command "revive" in ironman mode.
|
getset |
|
getset |
|
get |
|
getset |
|
get |
|
getset |
|
getset |
|
getset |