From fd6b833c98f8cd7e262389d75c9beb721c832f91 Mon Sep 17 00:00:00 2001 From: Evil Factory <36804725+evilfactory@users.noreply.github.com> Date: Mon, 16 May 2022 13:53:39 -0300 Subject: [PATCH] misc doc fixes --- .../Characters/CharacterNetworking.cs | 2 +- .../SharedSource/LuaCs/Lua/LuaDocs.cs | 1 + .../SharedSource/LuaCs/LuaCsUtility.cs | 2 +- docs/baseluadocs/GameSettings.lua | 8 + docs/lua/Game.lua | 18 +- docs/lua/Networking.lua | 16 + docs/lua/generated/Entity.lua | 18 +- docs/lua/generated/GameSettings.lua | 510 +----------------- 8 files changed, 56 insertions(+), 519 deletions(-) create mode 100644 docs/baseluadocs/GameSettings.lua diff --git a/Barotrauma/BarotraumaServer/ServerSource/Characters/CharacterNetworking.cs b/Barotrauma/BarotraumaServer/ServerSource/Characters/CharacterNetworking.cs index 77b1a5abd..9f45f67f5 100644 --- a/Barotrauma/BarotraumaServer/ServerSource/Characters/CharacterNetworking.cs +++ b/Barotrauma/BarotraumaServer/ServerSource/Characters/CharacterNetworking.cs @@ -701,7 +701,7 @@ namespace Barotrauma var tempBuffer = new ReadWriteMessage(); WriteStatus(tempBuffer); - if (msgLengthBeforeStatus + tempBuffer.LengthBytes >= 255 && restrictMessageSize && GameMain.LuaCs.Networking.restrictMessageSize) + if (msgLengthBeforeStatus + tempBuffer.LengthBytes >= 255 && restrictMessageSize && GameMain.LuaCs.Networking.RestrictMessageSize) { msg.Write(false); if (msgLengthBeforeStatus < 255) diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaDocs.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaDocs.cs index 9ab5717cc..8079c42cc 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaDocs.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/Lua/LuaDocs.cs @@ -96,6 +96,7 @@ namespace Barotrauma GenerateDocs(typeof(AfflictionPrefab), "AfflictionPrefab.lua", "AfflictionPrefab"); GenerateDocs(typeof(WayPoint), "WayPoint.lua", "WayPoint"); GenerateDocs(typeof(ServerSettings), "ServerSettings.lua", "Game.ServerSettings"); + GenerateDocs(typeof(GameSettings), "GameSettings.lua", "Game.Settings"); } public static void GenerateDocs(Type type, string name, string categoryName = null) diff --git a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs index de1ce6c04..84b9100b1 100644 --- a/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs +++ b/Barotrauma/BarotraumaShared/SharedSource/LuaCs/LuaCsUtility.cs @@ -218,7 +218,7 @@ namespace Barotrauma partial class LuaCsNetworking { - public bool restrictMessageSize = true; + public bool RestrictMessageSize = true; public Dictionary LuaCsNetReceives = new Dictionary(); #if SERVER diff --git a/docs/baseluadocs/GameSettings.lua b/docs/baseluadocs/GameSettings.lua new file mode 100644 index 000000000..98100bedc --- /dev/null +++ b/docs/baseluadocs/GameSettings.lua @@ -0,0 +1,8 @@ +-- luacheck: ignore 111 + +--[[-- +Barotrauma.GameSettings +]] +-- @code Game.Settings +-- @pragma nostrip +local GameSettings = {} \ No newline at end of file diff --git a/docs/lua/Game.lua b/docs/lua/Game.lua index 4d41b2221..c75257a0a 100644 --- a/docs/lua/Game.lua +++ b/docs/lua/Game.lua @@ -20,6 +20,14 @@ Game.IsDedicated = true -- @realm server Game.ServerSettings = true +--- Server settings. +-- @realm server +Game.Settings = true + +--- ChatBox. +-- @realm ChatBox +Game.ChatBox = true + --- Send chat message to every client. -- @realm server function Game.SendMessage(msg, messageType, sender, character) end @@ -94,16 +102,6 @@ function Game.StartGame() end -- @realm server function Game.EndGame() end ---- Gets all enabled content packages. ---@treturn table Table containing ContentPackages --- @realm shared -function Game.GetEnabledContentPackages() end - ---- Gets all enabled content packages by reading directly the player xml, useful when your mod doesn't have any xml. ---@treturn table Table containing ContentPackages --- @realm shared -function Game.GetEnabledPackagesDirectlyFromFile() end - --- Adds a new command, onExecute is called with a table of strings. -- @realm shared function Game.AddCommand(name, help, onExecute, getValidArgs, isCheat) end diff --git a/docs/lua/Networking.lua b/docs/lua/Networking.lua index d0890dceb..de5a5fa29 100644 --- a/docs/lua/Networking.lua +++ b/docs/lua/Networking.lua @@ -8,6 +8,14 @@ Class providing networking related tasks. local Networking = {} +--- +-- @realm server +Networking.FileSenderMaxPacketsPerUpdate = 4 + +--- +-- @realm server +Networking.LastClientListUpdateID = 0 + --- Send a post HTTP Request, callback is called with an argument result string. -- @realm server function Networking.RequestPostHTTP(url, callback, textData, contentType) end @@ -37,3 +45,11 @@ function Networking.Receive(netMessageName, callback) end -- @realm server function Networking.ClientWriteLobby(client) end +--- Creates an entity event. +-- @realm shared +function Networking.CreateEntityEvent(entity, extraData) end + +--- Updates the client permissions, call this after you i've changed the permissions of a client, so they are notified about it. +-- @realm server +function Networking.UpdateClientPermissions(client) end + diff --git a/docs/lua/generated/Entity.lua b/docs/lua/generated/Entity.lua index 95abcc8ce..36c9642d6 100644 --- a/docs/lua/generated/Entity.lua +++ b/docs/lua/generated/Entity.lua @@ -8,6 +8,15 @@ Barotrauma source code: [Entity.cs](https://github.com/evilfactory/Barotrauma-lu -- @code Entity -- @pragma nostrip +--- Remove +-- @realm shared +function Remove() end + +--- ToString +-- @realm shared +-- @treturn string +function ToString() end + --- GetEntities -- @realm shared -- @treturn IReadOnlyCollection`1 @@ -33,10 +42,6 @@ function Entity.RemoveAll() end -- @realm shared function FreeID() end ---- Remove --- @realm shared -function Remove() end - --- DumpIds -- @realm shared -- @tparam number count @@ -48,11 +53,6 @@ function Entity.DumpIds(count, filename) end -- @treturn Type function GetType() end ---- ToString --- @realm shared --- @treturn string -function ToString() end - --- Equals -- @realm shared -- @tparam Object obj diff --git a/docs/lua/generated/GameSettings.lua b/docs/lua/generated/GameSettings.lua index f7d1796bc..1df17c805 100644 --- a/docs/lua/generated/GameSettings.lua +++ b/docs/lua/generated/GameSettings.lua @@ -3,83 +3,22 @@ --[[-- Barotrauma.GameSettings ]] --- @code Game.GameSettings +-- @code Game.Settings -- @pragma nostrip local GameSettings = {} ---- SelectCorePackage +--- Init -- @realm shared --- @tparam ContentPackage contentPackage --- @tparam bool forceReloadAll -function SelectCorePackage(contentPackage, forceReloadAll) end +function GameSettings.Init() end ---- AutoSelectCorePackage +--- SetCurrentConfig -- @realm shared --- @tparam Enumerable toRemove -function AutoSelectCorePackage(toRemove) end +-- @tparam Config& newConfig +function GameSettings.SetCurrentConfig(newConfig) end ---- BackUpModOrder +--- SaveCurrentConfig -- @realm shared -function BackUpModOrder() end - ---- SwapPackages --- @realm shared --- @tparam ContentPackage corePackage --- @tparam table regularPackages -function SwapPackages(corePackage, regularPackages) end - ---- RestoreBackupPackages --- @realm shared -function RestoreBackupPackages() end - ---- EnableRegularPackage --- @realm shared --- @tparam ContentPackage contentPackage -function EnableRegularPackage(contentPackage) end - ---- DisableRegularPackage --- @realm shared --- @tparam ContentPackage contentPackage -function DisableRegularPackage(contentPackage) end - ---- SortContentPackages --- @realm shared --- @tparam bool refreshAll -function SortContentPackages(refreshAll) end - ---- EnableContentPackageItems --- @realm shared --- @tparam Enumerable unorderedFiles -function EnableContentPackageItems(unorderedFiles) end - ---- DisableContentPackageItems --- @realm shared --- @tparam Enumerable unorderedFiles -function DisableContentPackageItems(unorderedFiles) end - ---- RefreshContentPackageItems --- @realm shared --- @tparam Enumerable files -function RefreshContentPackageItems(files) end - ---- LoadPlayerConfig --- @realm shared -function LoadPlayerConfig() end - ---- SaveNewPlayerConfig --- @realm shared --- @treturn bool -function SaveNewPlayerConfig() end - ---- ResetToDefault --- @realm shared -function ResetToDefault() end - ---- AreJobPreferencesEqual --- @realm shared --- @tparam table compareTo --- @treturn bool -function AreJobPreferencesEqual(compareTo) end +function GameSettings.SaveCurrentConfig() end --- GetType -- @realm shared @@ -103,437 +42,12 @@ function Equals(obj) end function GetHashCode() end --- --- GraphicsWidth, Field of type number +-- GameSettings.CurrentConfig, Field of type Config& -- @realm shared --- @number GraphicsWidth +-- @Config& GameSettings.CurrentConfig --- --- GraphicsHeight, Field of type number +-- GameSettings.PlayerConfigPath, Field of type string -- @realm shared --- @number GraphicsHeight - ---- --- VSyncEnabled, Field of type bool --- @realm shared --- @bool VSyncEnabled - ---- --- TextureCompressionEnabled, Field of type bool --- @realm shared --- @bool TextureCompressionEnabled - ---- --- EnableSplashScreen, Field of type bool --- @realm shared --- @bool EnableSplashScreen - ---- --- ParticleLimit, Field of type number --- @realm shared --- @number ParticleLimit - ---- --- LightMapScale, Field of type number --- @realm shared --- @number LightMapScale - ---- --- ChromaticAberrationEnabled, Field of type bool --- @realm shared --- @bool ChromaticAberrationEnabled - ---- --- PauseOnFocusLost, Field of type bool --- @realm shared --- @bool PauseOnFocusLost - ---- --- MuteOnFocusLost, Field of type bool --- @realm shared --- @bool MuteOnFocusLost - ---- --- DynamicRangeCompressionEnabled, Field of type bool --- @realm shared --- @bool DynamicRangeCompressionEnabled - ---- --- VoipAttenuationEnabled, Field of type bool --- @realm shared --- @bool VoipAttenuationEnabled - ---- --- UseDirectionalVoiceChat, Field of type bool --- @realm shared --- @bool UseDirectionalVoiceChat - ---- --- DisableVoiceChatFilters, Field of type bool --- @realm shared --- @bool DisableVoiceChatFilters - ---- --- AudioOutputDevice, Field of type string --- @realm shared --- @string AudioOutputDevice - ---- --- VoiceSetting, Field of type VoiceMode --- @realm shared --- @VoiceMode VoiceSetting - ---- --- VoiceCaptureDevice, Field of type string --- @realm shared --- @string VoiceCaptureDevice - ---- --- NoiseGateThreshold, Field of type number --- @realm shared --- @number NoiseGateThreshold - ---- --- UseLocalVoiceByDefault, Field of type bool --- @realm shared --- @bool UseLocalVoiceByDefault - ---- --- RequireSteamAuthentication, Field of type bool --- @realm shared --- @bool RequireSteamAuthentication - ---- --- UseSteamMatchmaking, Field of type bool --- @realm shared --- @bool UseSteamMatchmaking - ---- --- UseDualModeSockets, Field of type bool --- @realm shared --- @bool UseDualModeSockets - ---- --- WindowMode, Field of type WindowMode --- @realm shared --- @WindowMode WindowMode - ---- --- JobPreferences, Field of type table --- @realm shared --- @table JobPreferences - ---- --- TeamPreference, Field of type CharacterTeamType --- @realm shared --- @CharacterTeamType TeamPreference - ---- --- AimAssistAmount, Field of type number --- @realm shared --- @number AimAssistAmount - ---- --- EnableMouseLook, Field of type bool --- @realm shared --- @bool EnableMouseLook - ---- --- EnableRadialDistortion, Field of type bool --- @realm shared --- @bool EnableRadialDistortion - ---- --- CrewMenuOpen, Field of type bool --- @realm shared --- @bool CrewMenuOpen - ---- --- ChatOpen, Field of type bool --- @realm shared --- @bool ChatOpen - ---- --- CorpseDespawnDelay, Field of type number --- @realm shared --- @number CorpseDespawnDelay - ---- --- CorpsesPerSubDespawnThreshold, Field of type number --- @realm shared --- @number CorpsesPerSubDespawnThreshold - ---- --- UnsavedSettings, Field of type bool --- @realm shared --- @bool UnsavedSettings - ---- --- SoundVolume, Field of type number --- @realm shared --- @number SoundVolume - ---- --- MusicVolume, Field of type number --- @realm shared --- @number MusicVolume - ---- --- VoiceChatVolume, Field of type number --- @realm shared --- @number VoiceChatVolume - ---- --- VoiceChatCutoffPrevention, Field of type number --- @realm shared --- @number VoiceChatCutoffPrevention - ---- --- MicrophoneVolume, Field of type number --- @realm shared --- @number MicrophoneVolume - ---- --- Language, Field of type string --- @realm shared --- @string Language - ---- --- CurrentCorePackage, Field of type ContentPackage --- @realm shared --- @ContentPackage CurrentCorePackage - ---- --- EnabledRegularPackages, Field of type IReadOnlyList`1 --- @realm shared --- @IReadOnlyList`1 EnabledRegularPackages - ---- --- AllEnabledPackages, Field of type Enumerable --- @realm shared --- @Enumerable AllEnabledPackages - ---- --- ContentPackageSelectionDirtyNotification, Field of type bool --- @realm shared --- @bool ContentPackageSelectionDirtyNotification - ---- --- ContentPackageSelectionDirty, Field of type bool --- @realm shared --- @bool ContentPackageSelectionDirty - ---- --- ServerFilterElement, Field of type XElement --- @realm shared --- @XElement ServerFilterElement - ---- --- DisableInGameHints, Field of type bool --- @realm shared --- @bool DisableInGameHints - ---- --- AutomaticQuickStartEnabled, Field of type bool --- @realm shared --- @bool AutomaticQuickStartEnabled - ---- --- AutomaticCampaignLoadEnabled, Field of type bool --- @realm shared --- @bool AutomaticCampaignLoadEnabled - ---- --- TextManagerDebugModeEnabled, Field of type bool --- @realm shared --- @bool TextManagerDebugModeEnabled - ---- --- TestScreenEnabled, Field of type bool --- @realm shared --- @bool TestScreenEnabled - ---- --- ModBreakerMode, Field of type bool --- @realm shared --- @bool ModBreakerMode - ---- --- MasterServerUrl, Field of type string --- @realm shared --- @string MasterServerUrl - ---- --- RemoteContentUrl, Field of type string --- @realm shared --- @string RemoteContentUrl - ---- --- AutoCheckUpdates, Field of type bool --- @realm shared --- @bool AutoCheckUpdates - ---- --- PlayerName, Field of type string --- @realm shared --- @string PlayerName - ---- --- LosMode, Field of type LosMode --- @realm shared --- @LosMode LosMode - ---- --- GameSettings.HUDScale, Field of type number --- @realm shared --- @number GameSettings.HUDScale - ---- --- GameSettings.InventoryScale, Field of type number --- @realm shared --- @number GameSettings.InventoryScale - ---- --- GameSettings.TextScale, Field of type number --- @realm shared --- @number GameSettings.TextScale - ---- --- CompletedTutorialNames, Field of type table --- @realm shared --- @table CompletedTutorialNames - ---- --- IgnoredHints, Field of type HashSet`1 --- @realm shared --- @HashSet`1 IgnoredHints - ---- --- EncounteredCreatures, Field of type HashSet`1 --- @realm shared --- @HashSet`1 EncounteredCreatures - ---- --- KilledCreatures, Field of type HashSet`1 --- @realm shared --- @HashSet`1 KilledCreatures - ---- --- GameSettings.VerboseLogging, Field of type bool --- @realm shared --- @bool GameSettings.VerboseLogging - ---- --- GameSettings.SaveDebugConsoleLogs, Field of type bool --- @realm shared --- @bool GameSettings.SaveDebugConsoleLogs - ---- --- ShowLanguageSelectionPrompt, Field of type bool --- @realm shared --- @bool ShowLanguageSelectionPrompt - ---- --- GameSettings.ShowOffensiveServerPrompt, Field of type bool --- @realm shared --- @bool GameSettings.ShowOffensiveServerPrompt - ---- --- GameSettings.EnableSubmarineAutoSave, Field of type bool --- @realm shared --- @bool GameSettings.EnableSubmarineAutoSave - ---- --- GameSettings.MaximumAutoSaves, Field of type number --- @realm shared --- @number GameSettings.MaximumAutoSaves - ---- --- GameSettings.AutoSaveIntervalSeconds, Field of type number --- @realm shared --- @number GameSettings.AutoSaveIntervalSeconds - ---- --- GameSettings.SubEditorBackgroundColor, Field of type Color --- @realm shared --- @Color GameSettings.SubEditorBackgroundColor - ---- --- GameSettings.SubEditorMaxUndoBuffer, Field of type number --- @realm shared --- @number GameSettings.SubEditorMaxUndoBuffer - ---- --- ShowTutorialSkipWarning, Field of type bool --- @realm shared --- @bool ShowTutorialSkipWarning - ---- --- AudioDeviceNames, Field of type IList`1 --- @realm shared --- @IList`1 AudioDeviceNames - ---- --- CaptureDeviceNames, Field of type IList`1 --- @realm shared --- @IList`1 CaptureDeviceNames - ---- --- jobPreferences, Field of type table --- @realm shared --- @table jobPreferences - ---- --- QuickStartSubmarineName, Field of type string --- @realm shared --- @string QuickStartSubmarineName - ---- --- AutoUpdateWorkshopItems, Field of type bool --- @realm shared --- @bool AutoUpdateWorkshopItems - ---- --- SuppressModFolderWatcher, Field of type bool --- @realm shared --- @bool SuppressModFolderWatcher - ---- --- WaitingForAutoUpdate, Field of type bool --- @realm shared --- @bool WaitingForAutoUpdate - ---- --- RecentlyEncounteredCreatures, Field of type HashSet`1 --- @realm shared --- @HashSet`1 RecentlyEncounteredCreatures - ---- --- CampaignDisclaimerShown, Field of type bool --- @realm shared --- @bool CampaignDisclaimerShown - ---- --- EditorDisclaimerShown, Field of type bool --- @realm shared --- @bool EditorDisclaimerShown - ---- --- GameSettings.SavePath, Field of type string --- @realm shared --- @string GameSettings.SavePath - ---- --- GameSettings.PlayerSavePath, Field of type string --- @realm shared --- @string GameSettings.PlayerSavePath - ---- --- GameSettings.VanillaContentPackagePath, Field of type string --- @realm shared --- @string GameSettings.VanillaContentPackagePath - ---- --- GameSettings.MaxMicrophoneVolume, Field of type number --- @realm shared --- @number GameSettings.MaxMicrophoneVolume +-- @string GameSettings.PlayerConfigPath