From 971ba54d0182bc4a34ee25e2e9a8f3d10583e6ec Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Tue, 11 Aug 2026 14:45:18 +0200 Subject: [PATCH 01/12] Freeze version 0.2.4 --- README.md | 6 + docusaurus.config.ts | 8 +- .../current.json | 2 +- .../version-0.2.4.json | 114 ++ .../docs/Development/APIs/_category_.json | 4 + .../Development/APIs/console-commands.mdx | 119 ++ .../Development/APIs/custom-components.md | 11 + .../docs/Development/APIs/game-events.md | 7 + .../docs/Development/APIs/key-bindings.md | 73 ++ .../Development/APIs/save-file-management.md | 14 + .../docs/Development/Examples/_category_.json | 11 + .../docs/Development/Examples/swarm-mode.md | 191 +++ .../docs/Development/_category_.json | 6 + .../docs/Development/custom-rpc.md | 213 ++++ .../docs/Development/getting-started.md | 32 + .../docs/Development/hosted-services.md | 38 + .../docs/Development/mod-manifest.md | 37 + .../docs/Development/patching.md | 75 ++ .../version-0.2.4/docs/Development/systems.md | 45 + .../version-0.2.4/docs/Server/_category_.json | 6 + .../version-0.2.4/docs/Server/admin-panel.mdx | 53 + .../docs/Server/installation.mdx | 170 +++ .../docs/Server/mod-management.md | 64 + .../version-0.2.4/docs/Server/save-files.md | 43 + .../version-0.2.4/docs/Server/server-list.mdx | 116 ++ .../version-0.2.4/docs/quick-start.mdx | 150 +++ .../version-0.2.4/docs/what-is-wukong-mp.md | 102 ++ ...eLib.Attributes.HarmonyTargetMethodHint.md | 131 ++ .../PreludeLib.Attributes.In-1.md | 28 + .../PreludeLib.Attributes.Out-1.md | 28 + .../PreludeLib.Attributes.Ref-1.md | 28 + .../PreludeLib.Attributes.md | 26 + ...yM.Api.Command.ConsoleCommand.ParamInfo.md | 67 + .../ReadyM.Api.Command.ConsoleCommand.md | 131 ++ .../ReadyM.Api.Command/ReadyM.Api.Command.md | 9 + .../ReadyM.Api.DI.IDependencyContainer.md | 94 ++ .../ReadyM.Api.DI.IHostedService.md | 29 + .../ReadyM.Api.DI/ReadyM.Api.DI.md | 15 + .../ReadyM.Api.Idents.AreaId.md | 172 +++ .../ReadyM.Api.Idents.PlayerId.md | 169 +++ .../ReadyM.Api.Idents/ReadyM.Api.Idents.md | 17 + ...Api.Multiplayer.Client.ConnectionTicket.md | 168 +++ ...eadyM.Api.Multiplayer.Client.IRpcClient.md | 74 ++ ...dyM.Api.Multiplayer.Client.RelayMessage.md | 55 + .../ReadyM.Api.Multiplayer.Client.md | 13 + ...erators.DeriveINetSerializableAttribute.md | 93 ++ ...ultiplayer.Generators.RpcEventAttribute.md | 83 ++ .../ReadyM.Api.Multiplayer.Generators.md | 14 + ...iplayer.Protocol.Enums.RelayMessageCode.md | 50 + ...pi.Multiplayer.Protocol.Enums.RelayMode.md | 38 + .../ReadyM.Api.Multiplayer.Protocol.md | 24 + .../ReadyM.Api.Multiplayer.RPC.md | 10 + ...iplayer.Protocol.CustomRelayEventHeader.md | 93 ++ ...Multiplayer.Protocol.DisconnectedReason.md | 68 + .../ReadyM.Api.Multiplayer.Protocol.Enums.md | 13 + ...ReadyM.Api.Multiplayer.RPC.RpcClassBase.md | 151 +++ ...tiplayer.Serialization.IRelaySerializer.md | 56 + .../ReadyM.Api.Multiplayer.Serialization.md | 7 + .../ReadyM.Api.Serialization.md | 9 + ...adyM.Api.Serialization.SerializableMode.md | 29 + ...Api.Configuration.GameplayConfiguration.md | 83 ++ ...ukongMp.Api.Configuration.PatchCategory.md | 68 + .../WukongMp.Api.Configuration.TamerKind.md | 137 ++ .../WukongMp.Api.Configuration.TamerKinds.md | 619 +++++++++ ...ukongMp.Api.Configuration.UnitPathUtils.md | 43 + .../WukongMp.Api.Configuration.md | 26 + .../WukongMp.Api.Https.FileInfo.md | 59 + .../WukongMp.Api.Https/WukongMp.Api.Https.md | 7 + .../WukongMp.Api.Resources.BuiltinTexts.md | 1110 +++++++++++++++++ .../WukongMp.Api.Resources.md | 9 + .../WukongMp.Api.UI.CountdownWidget.md | 57 + .../WukongMp.Api.UI.GameMessageWidget.md | 83 ++ .../WukongMp.Api.UI.GameWidgetBase.md | 99 ++ .../WukongMp.Api.UI/WukongMp.Api.UI.md | 13 + .../WukongMp.Api.WukongUtils.GameUtils.md | 63 + .../WukongMp.Api.WukongUtils.md | 9 + .../WukongMp.Api.EcsExtensions.md | 53 + .../WukongMp.Api.IWukongSaveApi.md | 108 ++ .../WukongMp.Api/WukongMp.Api.Logging.md | 214 ++++ .../WukongMp.Api.USharpExtensions.md | 117 ++ .../WukongMp.Api/WukongMp.Api.md | 34 + .../WukongMp.Sdk.Api.IWukongChatApi.md | 60 + .../WukongMp.Sdk.Api.IWukongCheatsApi.md | 90 ++ ...ukongMp.Sdk.Api.IWukongConfigurationApi.md | 200 +++ .../WukongMp.Sdk.Api.IWukongConsoleApi.md | 97 ++ .../WukongMp.Sdk.Api.IWukongEventApi.md | 270 ++++ .../WukongMp.Sdk.Api.IWukongFileApi.md | 35 + .../WukongMp.Sdk.Api.IWukongInputApi.md | 86 ++ .../WukongMp.Sdk.Api.IWukongLocalApi.md | 100 ++ .../WukongMp.Sdk.Api.IWukongPvpApi.md | 167 +++ ...ongMp.Sdk.Api.IWukongSynchronizationApi.md | 329 +++++ .../WukongMp.Sdk.Api.IWukongWidgetApi.md | 130 ++ .../WukongMp.Sdk.Api.WukongApi.md | 187 +++ .../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md | 58 + .../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md | 23 + .../WukongMp.Sdk.Entities.ReadyActor.md | 57 + ...ongMp.Sdk.Entities.ReadyActorExtensions.md | 45 + .../WukongMp.Sdk.Entities.ReadyCharacter.md | 85 ++ ...p.Sdk.Entities.ReadyCharacterExtensions.md | 179 +++ ...ukongMp.Sdk.Entities.ReadyMainCharacter.md | 219 ++++ .../WukongMp.Sdk.Entities.ReadyObject.md | 27 + ...ngMp.Sdk.Entities.ReadyObjectExtensions.md | 155 +++ .../WukongMp.Sdk.Entities.ReadyTamer.md | 167 +++ .../WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md | 40 + .../WukongMp.Sdk.IReadyEntity-1.md | 14 + .../WukongMp.Sdk/WukongMp.Sdk.ModBase.md | 153 +++ .../WukongMp.Sdk.ModSystemBase.UpdateTick.md | 59 + .../WukongMp.Sdk.ModSystemBase.md | 45 + .../WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md | 26 + .../WukongMp.Sdk/WukongMp.Sdk.md | 34 + .../docs/Development/APIs/_category_.json | 4 + .../Development/APIs/console-commands.mdx | 116 ++ .../Development/APIs/custom-components.md | 11 + .../docs/Development/APIs/game-events.md | 5 + .../docs/Development/APIs/key-bindings.md | 68 + .../Development/APIs/save-file-management.md | 13 + .../docs/Development/Examples/_category_.json | 11 + .../docs/Development/Examples/swarm-mode.md | 181 +++ .../docs/Development/_category_.json | 6 + .../docs/Development/custom-rpc.md | 191 +++ .../docs/Development/getting-started.md | 27 + .../docs/Development/hosted-services.md | 35 + .../docs/Development/mod-manifest.md | 36 + .../docs/Development/patching.md | 60 + .../version-0.2.4/docs/Development/systems.md | 44 + .../version-0.2.4/docs/Server/_category_.json | 6 + .../version-0.2.4/docs/Server/admin-panel.mdx | 58 + .../docs/Server/installation.mdx | 169 +++ .../docs/Server/mod-management.md | 63 + .../version-0.2.4/docs/Server/save-files.md | 38 + .../version-0.2.4/docs/Server/server-list.mdx | 113 ++ .../version-0.2.4/docs/quick-start.mdx | 148 +++ .../version-0.2.4/docs/what-is-wukong-mp.md | 95 ++ .../version-0.2.4-sidebars.json | 14 + versions.json | 1 + 135 files changed, 11360 insertions(+), 3 deletions(-) create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4.json create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/_category_.json create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/console-commands.mdx create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/custom-components.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/game-events.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/key-bindings.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/save-file-management.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/Examples/_category_.json create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/Examples/swarm-mode.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/_category_.json create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/custom-rpc.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/getting-started.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/hosted-services.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/mod-manifest.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/patching.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/systems.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/_category_.json create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/admin-panel.mdx create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/installation.mdx create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/mod-management.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/save-files.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/server-list.mdx create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/quick-start.mdx create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/what-is-wukong-mp.md create mode 100644 versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md create mode 100644 versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.In-1.md create mode 100644 versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md create mode 100644 versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md create mode 100644 versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Serialization.md create mode 100644 versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.EcsExtensions.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.Logging.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.USharpExtensions.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongEventApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md create mode 100644 versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/APIs/_category_.json create mode 100644 versioned_docs/version-0.2.4/docs/Development/APIs/console-commands.mdx create mode 100644 versioned_docs/version-0.2.4/docs/Development/APIs/custom-components.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/APIs/game-events.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/APIs/key-bindings.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/APIs/save-file-management.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/Examples/_category_.json create mode 100644 versioned_docs/version-0.2.4/docs/Development/Examples/swarm-mode.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/_category_.json create mode 100644 versioned_docs/version-0.2.4/docs/Development/custom-rpc.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/getting-started.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/hosted-services.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/mod-manifest.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/patching.md create mode 100644 versioned_docs/version-0.2.4/docs/Development/systems.md create mode 100644 versioned_docs/version-0.2.4/docs/Server/_category_.json create mode 100644 versioned_docs/version-0.2.4/docs/Server/admin-panel.mdx create mode 100644 versioned_docs/version-0.2.4/docs/Server/installation.mdx create mode 100644 versioned_docs/version-0.2.4/docs/Server/mod-management.md create mode 100644 versioned_docs/version-0.2.4/docs/Server/save-files.md create mode 100644 versioned_docs/version-0.2.4/docs/Server/server-list.mdx create mode 100644 versioned_docs/version-0.2.4/docs/quick-start.mdx create mode 100644 versioned_docs/version-0.2.4/docs/what-is-wukong-mp.md create mode 100644 versioned_sidebars/version-0.2.4-sidebars.json diff --git a/README.md b/README.md index f5dc1fc..148ffc0 100644 --- a/README.md +++ b/README.md @@ -73,3 +73,9 @@ yarn serve --locale zh-Hans # Chinese ~~~ This command generates static content into the `build` directory and can be served using any static contents hosting service. + +## Add a new version + +To add a new version for a documentation page, follow this guide: https://docusaurus.io/docs/docs-multi-instance#tagging-new-versions. + +Remember, that the `docs:version` command expets the **current** version (one that is getting frozen), not the new one. \ No newline at end of file diff --git a/docusaurus.config.ts b/docusaurus.config.ts index d6069b6..09f58ec 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -71,7 +71,10 @@ const config: Config = { lastVersion: 'current', versions: { current: { - label: '0.2.4' + label: '0.3.0' + }, + '0.2.4': { + label: '0.2.4', }, '0.1.0': { label: '0.1.0', @@ -157,7 +160,8 @@ const config: Config = { { type: 'docsVersionDropdown', versions: { - 'current': { label: '0.2.4' }, + 'current': { label: '0.3.0' }, + '0.2.4': { label: '0.2.4' }, '0.1.0': { label: '0.1.0' }, }, position: 'right', diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json index 59fbb4a..2118021 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json @@ -1,6 +1,6 @@ { "version.label": { - "message": "0.2.4", + "message": "0.3.0", "description": "The label for version current" }, "sidebar.wukongMpDocsSidebar.category.APIs": { diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4.json new file mode 100644 index 0000000..59fbb4a --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4.json @@ -0,0 +1,114 @@ +{ + "version.label": { + "message": "0.2.4", + "description": "The label for version current" + }, + "sidebar.wukongMpDocsSidebar.category.APIs": { + "message": "API 接口", + "description": "The label for category 'APIs' in sidebar 'wukongMpDocsSidebar'" + }, + "sidebar.wukongMpDocsSidebar.category.sdk-examples": { + "message": "模组示例", + "description": "The label for category 'Mod examples' in sidebar 'wukongMpDocsSidebar'" + }, + "sidebar.wukongMpDocsSidebar.category.sdk-examples.link.generated-index.title": { + "message": "模组示例", + "description": "The generated-index page title for category 'Mod examples' in sidebar 'wukongMpDocsSidebar'" + }, + "sidebar.wukongMpDocsSidebar.category.sdk-examples.link.generated-index.description": { + "message": "使用 WukongMP SDK 构建的示例模组", + "description": "The generated-index page description for category 'Mod examples' in sidebar 'wukongMpDocsSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Command": { + "message": "ReadyM.Api.Command", + "description": "The label for category 'ReadyM.Api.Command' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Idents": { + "message": "ReadyM.Api.Idents", + "description": "The label for category 'ReadyM.Api.Idents' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Multiplayer.Generators": { + "message": "ReadyM.Api.Multiplayer.Generators", + "description": "The label for category 'ReadyM.Api.Multiplayer.Generators' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Multiplayer.Protocol.Enums": { + "message": "ReadyM.Api.Multiplayer.Protocol.Enums", + "description": "The label for category 'ReadyM.Api.Multiplayer.Protocol.Enums' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Serialization": { + "message": "ReadyM.Api.Serialization", + "description": "The label for category 'ReadyM.Api.Serialization' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Api": { + "message": "WukongMp.Api", + "description": "The label for category 'WukongMp.Api' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Api.Configuration": { + "message": "WukongMp.Api.Configuration", + "description": "The label for category 'WukongMp.Api.Configuration' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Api.Https": { + "message": "WukongMp.Api.Https", + "description": "The label for category 'WukongMp.Api.Https' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Api.Resources": { + "message": "WukongMp.Api.Resources", + "description": "The label for category 'WukongMp.Api.Resources' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Api.UI": { + "message": "WukongMp.Api.UI", + "description": "The label for category 'WukongMp.Api.UI' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Api.WukongUtils": { + "message": "WukongMp.Api.WukongUtils", + "description": "The label for category 'WukongMp.Api.WukongUtils' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Sdk": { + "message": "WukongMp.Sdk", + "description": "The label for category 'WukongMp.Sdk' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Sdk.Api": { + "message": "WukongMp.Sdk.Api", + "description": "The label for category 'WukongMp.Sdk.Api' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.WukongMp.Sdk.Entities": { + "message": "WukongMp.Sdk.Entities", + "description": "The label for category 'WukongMp.Sdk.Entities' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpDocsSidebar.category.Server hosting": { + "message": "服务器托管", + "description": "The label for category 'Server hosting' in sidebar 'wukongMpDocsSidebar'" + }, + "sidebar.wukongMpDocsSidebar.category.Mod development": { + "message": "模组开发", + "description": "The label for category 'Mod development' in sidebar 'wukongMpDocsSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.PreludeLib.Attributes": { + "message": "PreludeLib.Attributes", + "description": "The label for category 'PreludeLib.Attributes' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.DI": { + "message": "ReadyM.Api.DI", + "description": "The label for category 'ReadyM.Api.DI' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Multiplayer.Client": { + "message": "ReadyM.Api.Multiplayer.Client", + "description": "The label for category 'ReadyM.Api.Multiplayer.Client' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Multiplayer.Protocol": { + "message": "ReadyM.Api.Multiplayer.Protocol", + "description": "The label for category 'ReadyM.Api.Multiplayer.Protocol' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Multiplayer.RPC": { + "message": "ReadyM.Api.Multiplayer.RPC", + "description": "The label for category 'ReadyM.Api.Multiplayer.RPC' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.wukongMpApiSidebar.category.ReadyM.Api.Multiplayer.Serialization": { + "message": "ReadyM.Api.Multiplayer.Serialization", + "description": "The label for category 'ReadyM.Api.Multiplayer.Serialization' in sidebar 'wukongMpApiSidebar'" + }, + "sidebar.oblivionMpDocsSidebar.category.Server hosting": { + "message": "Server hosting", + "description": "The label for category 'Server hosting' in sidebar 'oblivionMpDocsSidebar'" + } +} diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/_category_.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/_category_.json new file mode 100644 index 0000000..d94fdae --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/_category_.json @@ -0,0 +1,4 @@ +{ + "collapsible": true, + "collapsed": false +} \ No newline at end of file diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/console-commands.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/console-commands.mdx new file mode 100644 index 0000000..7eacc3b --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/console-commands.mdx @@ -0,0 +1,119 @@ +import Tabs from '@theme/Tabs'; + +import TabItem from '@theme/TabItem'; + +# 控制台命令 + +WukongMP SDK 包含一个命令控制台,按下键盘上的 F1 即可访问。 + +## 键盘快捷键 + +| 绑定 | 行动 | +| ----------------------------- | ----------- | +| TAB | 对所选命令进行自动完成 | +| Alt + | 上一条命令 | +| Alt + | 下一条命令 | + +## 定义自定义命令 + +使用 [Console +API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi) +来定义自定义命令。 + + +### 注册没有参数的命令 + + + + +```csharp +void RebirthAtShrine() { ... } +// ... +{ + WukongApi.Console.AddCommand("rebirth_shrine", ConsoleCommand.Create(RebirthAtShrine)); +} +``` + + + + + +```shell +rebirth_shrine +``` + + + + +### 需要参数 + +命令参数将从处理程序签名中推断——支持的类型包括 `string`、`int`、`float`、`double` 以及 +`bool`。参数可以是可选的,在这种情况下需要提供默认值。 + + + + +```csharp +void TeleportToShrine(int shrine = 1001) { ... } +// ... +{ + WukongApi.Console.AddCommand("teleport_shrine", ConsoleCommand.Create(TeleportToShrine)); +} +``` + + + + +```shell +teleport_shrine # teleports to shrine 1001 +teleport_shrine 2005 # teleports to shrine 2005 +``` + + + + +### 定义自动完成的参数 + +您可以定义在输入命令时将显示的一组参数值。这些值可以用箭头键进行选择,并可通过 TAB 自动完成。 + + + + +```csharp +IEnumerable GetAllValidUnitNames() => ["wolf_soldier", "wolf_sentinel", "gold_rhino"]; + +void SpawnMonster(string monsterType) { ... } +// ... +{ + WukongApi.Console.AddCommand("spawn", ConsoleCommand.Create(SpawnMonster), GetAllValidUnitNames()); +} +``` + + + + +在完成命令名称后,系统将立即显示可用的参数值: + +```shell +spawn +//highlight-start +wolf_soldier +wolf_sentinel +gold_rhino +//highlight-end +``` + +参数会根据已输入的内容进行筛选: + +```shell +spawn wo +//highlight-start +wolf_soldier +wolf_sentinel +//highlight-end +``` + +--- + + + diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/custom-components.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/custom-components.md new file mode 100644 index 0000000..7561530 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/custom-components.md @@ -0,0 +1,11 @@ +# 自定义组件 + +WukongMP SDK 允许在游戏中的实体上定义自定义数据组件。这些组件可以是从原始值到复杂结构的任何形式。 + +--- + +:::info[正在进行中] + +此功能正在开发中,将在未来的 SDK 版本中提供。 + +::: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/game-events.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/game-events.md new file mode 100644 index 0000000..f42cd49 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/game-events.md @@ -0,0 +1,7 @@ +# 游戏事件 + +WukongMP SDK 提供了在游戏中对最常见事件做出反应的方式。 + +请参阅 [Events +API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongEventApi) +以获取完整列表。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/key-bindings.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/key-bindings.md new file mode 100644 index 0000000..31b009c --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/key-bindings.md @@ -0,0 +1,73 @@ +# 按键绑定 + +[Input API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi) +提供了一种注册自定义键盘和控制器绑定的方式。 + +## 示例 + +定义在每次按下按键时执行的处理程序。 + +```csharp showLineNumbers +WukongApi.Input.RegisterKeyBind(Key.F1, () => +{ + // toggle command window visibility +}); +``` + +## 指定修饰键 + +```csharp showLineNumbers +WukongApi.Input.RegisterKeyBind(ModifierKeys.Alt, Key.X, () => +{ + // do something +}); +``` + +## 注册控制器绑定 + +使用 +[RegisterGamePadBind](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi#-registergamepadbindgamepadbutton-action) +方法绑定到以下按钮之一: + +```csharp +public enum GamePadButton +{ + None, + DPadUp, + DPadDown, + DPadLeft, + DPadRight, + Start, + Back, + LeftThumb, + RightThumb, + LeftShoulder, + RightShoulder, + A, + B, + X, + Y, + LeftTrigger, + RightTrigger, + DPadRightUp, + DPadLeftDown, + DPadRightDown, + DPadLeftUp, +} +``` + +## 使用 `CanApplyInput` + +按键绑定在每次按下按键时都会执行,与上下文无关。如果你希望在聊天输入时按下 'K' 不会触发任何命令逻辑,请将其通过对 +[CanApplyInput](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi#-canapplyinput) +的调用进行过滤。 + +```csharp showLineNumbers +WukongApi.Input.RegisterKeyBind(Key.K, () => +{ + if (WukongApi.Input.CanApplyInput()) + { + // toggle chat window visibility + } +}); +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/save-file-management.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/save-file-management.md new file mode 100644 index 0000000..c4cd2e8 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/APIs/save-file-management.md @@ -0,0 +1,14 @@ +# 保存文件管理 + +使用 [Save API](../../../api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi) +以与我们的合作模组类似的方式上传和下载存档文件。 + +[服务器文档](../../Server/save-files) 描述了当前在服务器端对保存文件的管理方式。 + +--- + +:::info[正在进行中] + +我们正在努力提供更多管理存档的方式,包括本地访问、备份,以及为每个玩家提供多个存档等。 + +::: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/Examples/_category_.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/Examples/_category_.json new file mode 100644 index 0000000..ac4d790 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/Examples/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Mod examples", + "key": "sdk-examples", + "collapsible": true, + "collapsed": false, + "link": { + "type": "generated-index", + "title": "Mod examples", + "description": "Example mods built with WukongMP SDK" + } +} \ No newline at end of file diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/Examples/swarm-mode.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/Examples/swarm-mode.md new file mode 100644 index 0000000..36b141d --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/Examples/swarm-mode.md @@ -0,0 +1,191 @@ +--- +sidebar_position: 1 +--- + +# 蜂群模式 + +本模组的目的是提供在 WukongMP 中实现新游戏模式的最简单示例。它注册一个控制台命令 +`swarm_mode`,使敌人在每隔几秒钟的波次中在玩家周围刷出。玩家应一直战斗,直到再也打不过为止,之后模组将打印召唤的敌人数量。 + +## 模组入口点 + +为了创建一个 WukongMP 模组,您必须创建一个新的 C# 类库项目,引用 `WukongMp.Sdk.dll`,并定义一个从 +[ModBase](../../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase) 派生的类。 + +模块至少必须定义其名称: + +```csharp title="Mod.cs" +public class Mod : ModBase +{ + public override string Name => "Swarm"; +``` + +`Initialize` 方法是配置模组的地方。在这个模组中,我们要做几件事: + +1. 在依赖注入容器中注册我们的 RPC 处理程序类,以实现 RPC 的发送与接收。 +1. 从依赖注入容器中解析 `SpawnEnemySwarmSystem`——你模组中定义的每个系统都会在那里被注入。 +1. 注册一个控制台命令 `swarm_mode`,用于开启我们的自定义游戏模式,并通知其他玩家。 +1. 订阅 `OnPlayerDead` 事件,在最后一个玩家死亡时将其禁用,并在有人死亡时发送事件。 + +```csharp title="Mod.cs" showLineNumbers + protected override void Initialize(IDependencyContainer services) + { + services.RegisterSingleton(); + + var rpc = services.Resolve(); + var spawnSystem = services.Resolve(); + + WukongApi.Console.AddCommand("swarm_mode", ConsoleCommand.Create(() => + { + spawnSystem.Enable(); + rpc.SendSwarmStarted(); + })); + + WukongApi.Events.OnPlayerDead += (victim, attacker) => + { + var alivePlayers = WukongApi.Sync.AllMainCharacters.Count(x => !x.IsDead); + if (alivePlayers > 0) + { + rpc.SendRemainingPlayers(alivePlayers); + } + else + { + rpc.SendSwarmEnded(spawnSystem.SpawnedEnemies); + spawnSystem.Disable(); + } + }; + } +} +``` + +## 自定义 RPC + +我们的模组使用一些自定义的远程过程调用来向其他玩家通知战斗的状态。 + +这些调用都会显示用户界面元素——信息横幅或对接收玩家可见的聊天消息。 + +我们使用 `AreaOfInterestAll` [Relay +mode](../../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode),以在同一关卡的所有客户端接收该消息,包含发送者。这样每个人看到的消息相同。 + +请参阅 [RPC 文档](../custom-rpc),以了解在 RPC 类中你还能做些什么。 + +```csharp title="自定义 RPC 类" +public partial class Rpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestAll)] + private void OnSwarmStarted(PlayerId __sender) + { + if (!WukongApi.Sync.TryGetPlayerInfoById(__sender, out var playerName, out _)) + { + Logging.LogError("Failed to get player info for sender {Sender}", __sender); + } + + WukongApi.Local.ShowInfoMessage("Get ready!", 3); + WukongApi.Local.AddChatMessage($"Swarm mode enabled by {playerName}!", FLinearColor.NavajoWhite); + WukongApi.Local.AddChatMessage("Enemies will spawn around you every 10 seconds, with increasing numbers. Survive as long as you can!", FLinearColor.NavajoWhite); + } + + [RpcEvent(RelayMode.AreaOfInterestAll)] + private void OnSwarmEnded(int enemiesSpawned) + { + WukongApi.Local.AddChatMessage($"Swarm mode ended, survived {enemiesSpawned} enemies", FLinearColor.OrangeRed); + } + + [RpcEvent(RelayMode.AreaOfInterestAll)] + private void OnRemainingPlayers(int remaining) + { + WukongApi.Local.AddChatMessage($"Remaining players: {remaining}", FLinearColor.Yellow); + } +} +``` + +## 核心游戏循环 + +模组的核心逻辑封装在 `SpawnEnemySwarmSystem`。 + +我们首先定义一些常量来配置系统的行为: + +```csharp showLineNumbers title="SpawnEnemySwarmSystem.cs" +public sealed class SpawnEnemySwarmSystem : ModSystemBase +{ + private bool _enabled; + private float _timeSinceLastSpawn; + private int _swarmSize = 3; + private int _enemies; + private const int SwarmIncrement = 1; + private const int SwarmMax = 7; + private const float SpawnRadius = 1000.0f; + private const float SpawnInterval = 10.0f; + private const float InitialDelay = 3.0f; +``` + +接下来是启用和禁用系统的方法。我们使用 [Local +API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi) +来显示消息横幅并向聊天窗口添加消息。 + +```csharp showLineNumbers=13 title="SpawnEnemySwarmSystem.cs" + public void Enable() + { + _enabled = true; + + WukongApi.Local.ShowInfoMessage("Get ready!", 3); + WukongApi.Local.AddChatMessage("Swarm mode enabled! Enemies will spawn around you every 10 seconds, with increasing numbers. Survive as long as you can!", FLinearColor.NavajoWhite); + } + + public void Disable() + { + if (!_enabled) + return; + + _enabled = false; + WukongApi.Local.AddChatMessage($"Swarm mode ended, survived {_enemies} enemies", FLinearColor.OrangeRed); + + // reset state for next time + _enemies = 0; + _swarmSize = 3; + _timeSinceLastSpawn = SpawnInterval - InitialDelay; + } +``` + +所有系统(派生自 +[ModSystemBase](../../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase) +的类)都会暴露一个在每帧执行的 +[OnUpdate](../../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase#-onupdateupdatetick) +方法。我们可以用它来统计自上次生成敌人以来经过的秒数。当 `_timeSinceLastSpawn` 超过阈值时,我们使用 [Synchronization +API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi) +在玩家周围以圆环的方式重复生成若干个敌人(Wolf Sentinel)。所有可用的敌人类型都在 +[TamerKinds](../../../api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds) +中定义。 + +```csharp showLineNumbers=35 title="SpawnEnemySwarmSystem.cs" + protected override void OnUpdate(UpdateTick tick) + { + if (!_enabled || !WukongApi.Sync.LocalMainCharacter.HasValue) + return; + + _timeSinceLastSpawn += tick.deltaTime; + if (_timeSinceLastSpawn > SpawnInterval) + { + _timeSinceLastSpawn = 0; + WukongApi.Local.ShowInfoMessage($"Spawning {_swarmSize} enemies!", 1); + +// highlight-start + // spawn a few enemies around the player + for (var i = 0; i < _swarmSize; i++) + { + var position = GetNthPointOnCircle(WukongApi.Sync.LocalMainCharacter.Value.Location, i, _swarmSize); + WukongApi.Sync.SpawnEnemy(TamerConstants.WolfSentinel, position); + } +// highlight-end + + // increase swarm size, up to a certain point + _swarmSize = Math.Min(_swarmSize + SwarmIncrement, SwarmMax); + + // count total enemies spawned for end-of-mode summary + _enemies += _swarmSize; + } + } + + private static Vector3 GetNthPointOnCircle(Vector3 center, int i, int n) { ... } +} +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/_category_.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/_category_.json new file mode 100644 index 0000000..0aa616e --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/_category_.json @@ -0,0 +1,6 @@ +{ + "collapsible": true, + "collapsed": false, + "position": 3, + "label": "模组开发" +} \ No newline at end of file diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/custom-rpc.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/custom-rpc.md new file mode 100644 index 0000000..a5ed9c1 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/custom-rpc.md @@ -0,0 +1,213 @@ +--- +sidebar_position: 5 +--- + +# 自定义 RPC + +WukongMP SDK 的核心功能之一是支持任意远程过程调用 (RPC) 函数。这些函数可以携带任意有效负载,并支持多种 +[中继模式](../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode)。 + +RPC 处理程序允许你定义自己的事件,这些事件将发送给连接到同一服务器的其他玩家。 + +## 声明一个 RPC 处理程序类 + +为了向你的模组添加自定义 RPC 过程,你必须定义一个 +[partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) +类,它继承自 +[RpcClassBase](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase)。 + +```csharp title="最简 RPC 类定义" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + // 在此处编写 RPC 处理器 +} +``` + +:::important + +要注册任何 RPC 处理程序,类 **必须**被添加到 DI 容器中,在你的模组的 `Initialize` 方法中。请查阅 +[ModBase](../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase) 的文档。 + +::: + +## 定义 RPC 处理程序 + +为了向你的模组添加一个新的 RPC 处理程序,请添加一个带有 +[RpcEvent](../../api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute) +属性的方法。 + +方法名必须以“On...”开头——在同一个类中会自动为发送 RPC 生成相应的“Send...”方法。 + +```csharp title="最简 RPC 处理器" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestOthers)] + private void OnMyCustomCall() + { + // 收到此消息时执行的操作 + } + + // 由 SDK 生成 + private void SendMyCustomCall() { ... } +} +``` + +该属性需要一个类型为 +[RelayMode](../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode) +的参数,该参数指示消息到达服务器时将如何传播给玩家。 + +当前支持以下模式: + +| 中继模式 | 描述 | +| ------------------------ | ------------------------ | +| **AreaOfInterestOthers** | 消息已发送给同一等级的所有其他玩家 | +| **AreaOfInterestAll** | 消息将发送给同一等级的所有玩家,包括发送者本人。 | +| **GlobalOthers** | 消息已发送给服务器上的所有其他玩家 | +| **GlobalAll** | 消息已发送给服务器上的所有玩家,包括发送者 | + +## 正在发送数据 + +RPC 处理程序支持在参数中传递数据,这些数据要么是: + +* 原始数据类型 +* 被 + [[DeriveINetSerializable]](../../api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute) + 装饰的结构体。 +* 由 SDK 注入的特殊参数 + +一个 RPC 处理程序可以按任意数量、任意顺序声明这些参数。生成的“Send...”方法将具有相同的参数(不包括注入的参数)。 + +### 基本数据类型 + +我们支持在 C# +运行时定义的所有原始数据类型:`bool`、`char`、`sbyte`、`byte`、`short`、`ushort`、`int`、`uint`、`long`、`ulong`、`float`、`double`,以及 +`string`。 + +```csharp title="传递基本数据" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestOthers)] + private void OnMyCustomCall(int number, string text) + { + // 收到此消息时执行的操作 + } + + // 由 SDK 生成 + private void SendMyCustomCall(int number, string text) { ... } +} +``` + +### 复杂数据类型 + +您可以在 RPC 参数中使用复杂的数据结构。这些数据结构必须实现 +[INetSerializable](https://revenantx.github.io/LiteNetLib/api/LiteNetLib.Utils.INetSerializable.html) +接口。 + +载荷结构的字段可以是任何可序列化类型,包括其他复杂类型,前提是它们也实现了 +[INetSerializable](https://revenantx.github.io/LiteNetLib/api/LiteNetLib.Utils.INetSerializable.html)。 + +```csharp title="复杂 RPC 参数示例" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestOthers)] + private void OnPlayerBuffed(BuffData payload) + { + // 收到此消息时执行的操作 + } + + // 由 SDK 生成 + private void SendPlayerBuffed(BuffData payload) { ... } +} +``` + +SDK 提供了 +[[DeriveINetSerializable]](../../api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute) +属性,这使得 SDK 在大多数情况下能够自动生成序列化代码。为了实现这一点,结构体必须声明为 +[partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods)。 + +```csharp title="生成序列化代码" +[DeriveINetSerializable] +public partial struct BuffData(int buffId, float duration) : INetSerializable +{ + public int BuffId = buffId; + public float Duration = duration; +} +``` + +如果你想对通过网络发送的数据拥有完全的控制权,也可以手动实现该接口。 + +我们将 [LiteNetLib](https://github.com/revenantx/litenetlib) 库作为我们网络栈的基础。你可以参考它的 +[documentation](https://revenantx.github.io/LiteNetLib/index.html) 以了解如何使用 +`NetDataWriter` 和 `NetDataReader`。 + +```csharp title="手写序列化代码" +public struct BuffAddData(int buffId, float duration) : INetSerializable +{ + public int BuffId = buffId; + public float Duration = duration; + + public void Serialize(NetDataWriter writer) + { + writer.Put(BuffId); + writer.Put(Duration); + } + + public void Deserialize(NetDataReader reader) + { + BuffId = reader.GetInt(); + Duration = reader.GetFloat(); + } +} +``` + +### 特殊参数 + +目前只能使用一个特殊参数。我们可能会在未来版本的 SDK 中扩展此功能。 + +| 名称 | 类型 | 描述 | +| ---------- | ---------------------------------------------------------------------------- | --------------- | +| `__sender` | [PlayerId](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId) | 发送该 RPC 的玩家的标识符 | + +此参数可与其他参数一起使用,但在生成的“Send...”方法中不可见。 + +```csharp title="使用注入的参数" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestOthers)] + private void OnComplexEvent(int number, PlayerId __sender, BuffData buffData) + { + // 示例:处理发送者昵称 + if (WukongApi.Sync.TryGetPlayerInfoById(__sender, out var playerName, out _)) + { + Logging.LogInfo("Received data from {Sender}", playerName); + } + } + + // 由 SDK 生成 + private void SendComplexEvent(int number, BuffData buffData) { ... } +} +``` + +## 在主线程执行回调 + +RPC 处理程序在单独的网络线程上执行,因此它们不应直接与游戏世界交互,因为这样做可能会导致崩溃。不过,你可以使用在你的 RPC 处理程序类中提供的 +[RunOnMainThread](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase#-runonmainthreadaction) +方法,将回调安排在主线程上执行。 + +```csharp title="Running code on the main thread" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestAll)] + private void OnDespawnAllMonsters() + { + // destroying an Unreal Engine pawn must be done on the main thread + RunOnMainThread(() => + { + foreach (var monster in WukongApi.Sync.AreaTamers) + { + monster.Tamer?.CurrentRef.DestroyTamer(); // calls BGU_UnrealWorldUtil.DestroyActor + } + }); + } +} +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/getting-started.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/getting-started.md new file mode 100644 index 0000000..8a5ee04 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/getting-started.md @@ -0,0 +1,32 @@ +--- +sidebar_position: 1 +--- + +# 快速入门 + +在 WukongMP SDK 上开始开发你自己的模组的最简单方式,是使用官方的 [WukongMP +模组模板](https://github.com/readycodeio/wukongmp-mod-template)。 + +克隆仓库并按照 +[README](https://github.com/readycodeio/wukongmp-mod-template/blob/main/README.md) +文件中提供的说明进行操作。 + +## 功能状态 + +目前你可以开发对游戏事件、实体数据(玩家、敌人)有访问权限的模组,并且可以定义自定义命令和游戏逻辑系统。 + +服务器端逻辑和自定义数据同步的支持正在推进中。 + +请访问 [examples](/wukong-mp/category/mod-examples) 页面以获取灵感,或浏览 +[co-op](https://github.com/readycodeio/WukongMP-co-op-mod) 与 +[PvP](https://github.com/readycodeio/WukongMP-PvP-mod) 模组的源代码。 + +| 特性 | 状态 | +| --------- | -------------------------------------------------------------- | +| 修改游戏代码 | :white_check_mark: [已完成](../Development/patching) | +| 游戏事件 | :white_check_mark: [已完成](../Development/APIs/game-events) | +| 控制台命令 API | :white_check_mark: [已完成](../Development/APIs/console-commands) | +| 自定义 RPC | :white_check_mark: [已完成](../Development/custom-rpc) | +| 保存文件 API | :construction: [部分](../Development/APIs/save-file-management) | +| 自定义数据同步 | :soon: [进行中](../Development/APIs/custom-components) | +| 服务器端模组 | :soon: 进行中 | diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/hosted-services.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/hosted-services.md new file mode 100644 index 0000000..aa9ac2c --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/hosted-services.md @@ -0,0 +1,38 @@ +--- +sidebar_position: 5 +--- + +# 托管服务 + +除了系统之外,WukongMP SDK 还提供一种实现 **托管服务** 的方式。这些类暴露了在游戏启动和停止时的生命周期方法,但没有 tick 方法。 + +## 声明托管服务 + +任何实现 +[IHostedService](../../api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService) +并在你模组的 `Initialize` 方法中被添加到依赖注入容器的类,将在游戏启动时自动调用其 `OnScopeStart` 方法,且在游戏关闭时被释放。 + +此类服务对于管理事件订阅,或运行不适合放在模组类的 `Initialize` 方法中的初始化代码,或需要在游戏关闭时进行清理的代码,都是有用的。 + +下面是 PvP 模组中一个托管服务的示例。它封装了一些简单的逻辑,用于在进入新区域时同步 PvP +状态。由于模组的许多功能依赖于对游戏事件的订阅,这种使用托管服务来管理事件订阅的模式已在整个模组的代码库中得到广泛应用。 + +```csharp title="托管服务示例" +public sealed class PvpSynchronizer : IHostedService +{ + public void OnScopeStart() + => WukongApi.Events.OnJoinedArea += OnJoinedAreaHandler; + + public void Dispose() + => WukongApi.Events.OnJoinedArea -= OnJoinedAreaHandler; + + private static void OnJoinedAreaHandler(AreaId areaId) + { + var isMasterClient = WukongApi.Sync.IsMasterClient; + Logging.LogDebug("Joined area {AreaId}, is master client: {IsMasterClient}", areaId, isMasterClient); + + if (isMasterClient) + WukongApi.PvP.InitializeAreaPvpState(); + } +} +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/mod-manifest.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/mod-manifest.md new file mode 100644 index 0000000..22e1cb6 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/mod-manifest.md @@ -0,0 +1,37 @@ +--- +sidebar_position: 2 +--- + +# 模组清单 + +官方的 WukongMP SDK 模组模板包含一个名为 `manifest.json` 的文件。此文件是模组加载器识别包含你的模组 DLL 的文件夹为 +WukongMP 模组所必需的,并包含解析模组依赖所需的信息。 + +一个示例 `manifest.json` 文件如下所示: + +```json title="manifest.json" +{ + "uniqueId": "WukongMP.Coop", + "version": "0.2.0", + "name": "WukongMP Co-op mode", + "author": "ReadyM Team", + "description": "The official WukongMP Co-op mode.", + "dependencies": [ + { + "uniqueId": "WukongMP.SDK", + "minimumVersion": "0.2.0" + } + ] +} +``` + +请参阅下表,了解清单文件中各字段的描述。 + +| 表单字段 | 类型 | 可选 | 描述 | +| -------------- | ------ | ----- | -------------------------------------------------------------------- | +| `uniqueId` | string | 否 | 模组的唯一标识符。只能包含字母数字字符,`.` 或 `_` | +| `version` | string | 否 | 模组版本,采用 `MAJOR.MINOR.PATCH` 格式。 | +| `name` | string | 否 | 模组名称(将在服务器管理员门户和启动器中显示) | +| `author` | string | 否 | 模组作者,将在服务器管理门户和启动器中显示。 | +| `description` | string | **是** | 该模组的简短描述。 | +| `dependencies` | 对象数组 | **是** | 为使你的模组正常工作所需的其他模组列表。每个依赖项必须指定所需模组的 `uniqueId`,以及一个 `minimumVersion`。 | diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/patching.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/patching.md new file mode 100644 index 0000000..a68ddd5 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/patching.md @@ -0,0 +1,75 @@ +--- +sidebar_position: 3 +--- + +# 为游戏打补丁 + +WukongMP SDK 构建在对 [Harmony](https://github.com/pardeike/Harmony) 库的自定义分支之上。虽然它支持 +Harmony 的大部分 API,但在补丁的发现和启用方式上存在一些差异。 + +通常,在为你的 WukongMP 模组定义补丁时,请参考 [Harmony +官方文档](https://harmony.pardeike.net/articles/intro.html)。 + +以下是确保补丁正确工作所需满足的一些要求。 + +## 类别为必填项 + +你模组代码中声明的每个 Harmony 补丁都必须使用 +[HarmonyPatchCategory](https://harmony.pardeike.net/api/HarmonyLib.HarmonyPatchCategory.html) +属性进行标记,并使用 +[PatchCategory](../../api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory) +中定义的常量之一,如下所示: + +```csharp title="补丁示例" +[HarmonyPatch(typeof(BPS_PlayerTeleportSystem), "OnPlayerTeleportTo")] +[HarmonyPatchCategory(PatchCategory.Global)] +public static class PatchOnPlayerTeleportTo { ... } +``` + +在 SDK 的当前版本中,只有属于 `PatchCategory.Global` 或 `PatchCategory.Connected` +类别的补丁在游戏启动时才会被启用。 + +## 使用 [TargetMethod](https://harmony.pardeike.net/articles/patching-auxiliary.html#targetmethod) + +有时你必须在补丁类中使用 +[TargetMethod](https://harmony.pardeike.net/articles/patching-auxiliary.html#targetmethod) +方法,才能对 `private` 或 `internal` 类的成员进行补丁。 + +在 WukongMP SDK 的 Harmony 分叉中,必须存在 +[HarmonyTargetMethodHint](../../api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint) +属性。第一个参数是完整限定类名,第二个参数是被补丁的成员名称。 + +```csharp title="示例:针对内部类打补丁" +[HarmonyPatch] +[HarmonyPatchCategory(PatchCategory.Connected)] +internal static class PatchComplexSkillDoInteractAction +{ + [HarmonyTargetMethodHint("b1.BUIAComplexSkill", "DoInteractAction")] + private static MethodBase TargetMethod() + { + return AccessTools.Method("b1.BUIAComplexSkill:DoInteractAction"); + } + ... +} +``` + +另一个 +[TargetMethod](https://harmony.pardeike.net/articles/patching-auxiliary.html#targetmethod) +的用例是通用类(泛型类)。在这种情况下,您还必须使用 +[HarmonyTargetMethodHint](../../api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint) +进行装饰,提供专门化的类类型和成员名称。 + +```csharp title="示例:针对泛型类打补丁" +[HarmonyPatch] +[HarmonyPatchCategory(PatchCategory.Global)] +public class PatchShrineRegisterFunc +{ + [HarmonyTargetMethodHint(typeof(FMenuHelper), "RegisterFunc")] + public static MethodBase TargetMethod() + { + var specializedType = typeof(FMenuHelper); + return specializedType.GetMethod("RegisterFunc")!; + } + ... +} +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/systems.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/systems.md new file mode 100644 index 0000000..16c7a5f --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Development/systems.md @@ -0,0 +1,45 @@ +--- +sidebar_position: 4 +--- + +# 玩法系统 + +为便于开发游戏逻辑,WukongMP SDK 提供了一种实现 **系统** 的方式。这些类暴露了一个绑定到游戏更新循环的 tick 方法。 + +## 声明系统 + +任何从 [ModSystemBase](../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase) +派生并在与您的主模组类位于同一程序集中的类(该类继承自 +[ModBase](../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase))将会在游戏启动时自动注册,并在不久之后开始执行。 + +:::info + +系统是单例的——每个系统在同一时间只运行一个实例。 + +::: + +目前没有用于开启或关闭系统的功能,你需要自己实现相应的方法。 + +以下是一个最小系统声明的示例: + +```csharp title="最简系统示例" +public class MySystem : ModSystemBase +{ + protected override void OnUpdate(UpdateTick tick) + { + // 每帧执行的操作 + } +} +``` + +您可以通过从依赖注入容器中解析它来获取系统实例的引用: + +```csharp title="通过依赖注入解析系统" +public class MyMod : ModBase +{ + protected override void Initialize(IDependencyContainer services) + { + var mySystemInstance = services.Resolve(); + } +} +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/_category_.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/_category_.json new file mode 100644 index 0000000..36152ab --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/_category_.json @@ -0,0 +1,6 @@ +{ + "collapsible": true, + "collapsed": false, + "position": 2, + "label": "服务器托管" +} \ No newline at end of file diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/admin-panel.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/admin-panel.mdx new file mode 100644 index 0000000..1cc10c4 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/admin-panel.mdx @@ -0,0 +1,53 @@ +--- +sidebar_position: 2 +--- + +# 后台管理面板 + +管理面板可通过 HTTP 访问,端口为 **9050**(除非在 `config.json` 中更改)。 + +如果服务器在本地计算机上运行,您可以在 http://localhost:9050 打开它。 + +## 首次设置 + +首次启动服务器时,您需要创建一个管理员账户。 + +在启动时,服务器会在控制台输出中打印一个一次性设置 PIN 码: + +```shell-session +$ ./server.exe +[15:16:37 INF] Starting web server on 127.0.0.1:9050 +[15:16:37 INF] Starting RelayServer... +[15:16:37 INF] Running server on port 9050 +... +//highlight-next-line +[15:16:37 WRN] No admin users found. Admin setup PIN: 766596 +``` + +在后台管理面板中输入此 PIN 以开始设置过程。 + +设置 PIN 码界面 + +## 通过 ReadyM 登录 + +输入 PIN 后,您将被要求使用 ReadyM 账户登录。 + +您将被重定向到 ReadyM 身份验证页面,在那里可以输入您的凭据。 + +认证成功后,系统将自动将您重定向回后台管理面板。 + +## 后台管理面板界面 + +登录后,您可以访问后台管理面板界面。 + + + +管理面板提供以下视图: + +* **终端** - 查看服务器状态、在线玩家、运行时间和实时日志。 +* **Players** - 查看自服务器上线以来曾连接过的玩家列表,以及他们的首次和最后访问日期。 +* **模组** - 查看服务器上当前安装的模组列表。 +* **管理员** - 查看服务器管理员列表、添加新的管理员,以及管理他们的权限。 +* **设置** - 管理面板设置,如语言和主题。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/installation.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/installation.mdx new file mode 100644 index 0000000..e1542ed --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/installation.mdx @@ -0,0 +1,170 @@ +--- +sidebar_position: 1 +--- + +import Tabs from '@theme/Tabs'; + +import TabItem from '@theme/TabItem'; + +# 安装 + +WukongMP 服务器当前以以下格式分发: + +- 二进制软件包 +- [Docker 镜像](#docker) + +## 二进制软件包 + +### 下载 + +| 平台 | 架构 | 下载 | +| ------- | --- | --------------------------------------------------------------------------------------------------------------- | +| Linux | x64 | [Linux 版下载](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.2.4.zip) | +| Windows | x64 | [Windows 版下载](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.2.4.zip) | + +### 安装 + +将二进制包解压到你选择的位置。 + +解压后,目录结构应如下所示: + + + + +```text +server/ +├── server.exe # 主服务器二进制文件 +├── config.json # 配置文件 +├── mods/ # 模组目录 +| ├── WukongMp.Sdk/ # SDK 模组 +| └── WukongMp.PvP/ # 对战模组 +├── optional_mods/ # 将其中任意模组移动到 "mods" 文件夹以启用 +| └── WukongMp.Coop/ # 合作模组 +├── saves/ # 游戏存档目录(默认为空) +├── wwwroot/ # 管理面板资源 +├── e_sqlite3.dll # 依赖项 +└── aspnetcorev2_inprocess.dll # 依赖项 +``` + + + + +```text +server/ +├── server # 主服务器二进制文件 +├── config.json # 配置文件 +├── mods/ # 模组目录 +| ├── WukongMp.Sdk/ # SDK 模组 +| └── WukongMp.PvP/ # 对战模组 +├── optional_mods/ # 将其中任意模组移动到 "mods" 文件夹以启用 +| └── WukongMp.Coop/ # 合作模组 +├── saves/ # 游戏存档目录(默认为空) +├── wwwroot/ # 管理面板资源 +└── libe_sqlite3.so # 依赖项 +``` + + + + +### 配置 + +您可以通过编辑 `config.json` 文件来调整服务器设置。在以下表格中,使用 `:` 记法来表示嵌套设置。 + +| 设置 | 类型 | 目的 | +| ------------- | ------ | --------------------------------------------- | +| `Server:Port` | 数字 | 服务器监听传入连接的端口 | +| `Server:Password` | string | 可选。设置后,玩家在加入时必须在启动器中输入此密码。留空或省略以表示开放服务器。 | +| `Telemetry:OptOut` | 布尔值 | 设置为 `true` 即可选择不向 ReadyM 发送匿名遥测。默认值为 `false`。 | + +:::note + +`服务器:密码` 对包括管理员和白名单用户在内的每位玩家都需要通过密码进行验证。受密码保护的服务器在公开服务器列表中显示为带锁的图标。 + +::: + +### 首次启动 + +通过运行 `server.exe` 二进制文件来启动服务器。 + +首次启动时,服务器在服务器文件夹内创建一个 `data/` 目录。该目录包含用于存储持久数据的 `web.db` 数据库文件。 + +除非在 `config.json` 中进行了更改,否则服务器将监听以下端口: + +| 端口 | 协议 | 目的 | +| ---- | ---- | --------------------- | +| 9050 | UDP | 游戏网络流量(玩家连接、游戏状态同步等) | +| 9050 | HTTP | [后台管理面板](admin-panel) | + +## Docker + +也提供了基于 Linux 的 x64 Docker 镜像,供偏好容器化部署的用户使用。 + +从注册表拉取镜像: + +```shell +docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 +``` + +从镜像中复制配置文件: + +```shell +docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.2.4 +docker cp wukongmp-tmp:/app/config.json ./config.json +docker rm wukongmp-tmp +``` + +运行: + + + + +```shell +docker run \ + -p 9050:9050/udp -p 9050:9050/tcp \ + -v ./data:/app/data \ + -v ./mods:/app/mods \ + -v ./saves:/app/saves \ + -v ./config.json:/app/config.json \ + --name wukongmp-server \ + ghcr.io/readycodeio/wukongmp-server:0.2.4 +``` + + + + +```yaml title="docker-compose.yml" +services: + server: + image: ghcr.io/readycodeio/wukongmp-server:0.2.4 + container_name: wukongmp-server + restart: unless-stopped + ports: + - "9050:9050/tcp" + - "9050:9050/udp" + volumes: + - ./data:/app/data + - ./mods:/app/mods + - ./saves:/app/saves + - ./config.json:/app/config.json +``` + + + + +:::important + +镜像 **不带模组**。在启动容器之前,将 `WukongMp.Sdk` +以及你想要的模式(`WukongMp.PvP`、`WukongMp.Coop`)从二进制 ZIP 文件复制到你的 `mods/` 卷中。 + +::: + +### 配置 + +端口的配置是通过在 `docker run` 命令或 Docker Compose 文件中重新映射容器端口来完成的。例如,要使用端口 9060 而不是 +9050,请将端口部分更改为: + +```yaml title="docker-compose.yml" +ports: + - "9060:9060/tcp" + - "9060:9060/udp" +``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/mod-management.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/mod-management.md new file mode 100644 index 0000000..b3e5eba --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/mod-management.md @@ -0,0 +1,64 @@ +--- +sidebar_position: 3 +--- + +# 模组管理 + +模组支持是 WukongMP 的核心功能,允许你通过自定义内容扩展服务器的功能。 + +## 客户端模组 + +WukongMP 支持对连接到服务器的客户端进行自动模组同步。客户端连接时,服务器会检查客户端是否安装了所需的模组。如果没有,[ReadyM +Launcher](https://portal.ready.mp/pl/dashboard/launcher) 将下载并安装缺失的模组,才能加入游戏。 + +要将模组添加到服务器,只需将模组文件夹放在 `mods/` 目录中。 + +模组文件夹的预期结构如下。如果你使用我们的[官方模组模板](https://github.com/readycodeio/wukongmp-mod-template),里面有一个`MakeModFolder.ps1`脚本,它将相应地打包模组。 + + +```text title="示例 mod 文件夹布局" +mods/ +└──MyModFolder/ # mod 的根目录,可以任意命名 + ├── MyMod.dll # mod 的主程序集 + ├── manifest.json # mod 清单文件 + └── other_files... # mod 所需的其他文件(可选) +``` + +连接到服务器时,客户端将自动从 `mods/` 目录下载并安装任何缺失的模组,确保无缝的多人游戏体验。 + +:::danger[安全公告] + +WukongMP SDK 和服务器的抢先体验版本不包含任何针对模组的沙箱或安全机制。 + +仅使用来自可信来源的模组,因为它们可能在客户端执行任意代码。 + +请勿在服务器上运行不可信的模组,尤其是在服务器对公众可访问时。 + +::: + +### .pak 文件 + +WukongMP 的模组可以包含用于游戏资源的 `.pak` 文件,这些文件将被游戏自动加载。 + +要在你的模组中包含一个 `.pak` 文件,只需将它放在模组文件夹中的任意位置即可。只要模组中存在有效的 `manifest.json` +文件,服务器就会将其识别为模组并分发给客户端,游戏在加载模组时会加载 `.pak` 文件。 + +特别是,这使你能够创建仅包含自定义资源且不包含任何代码的模组,这对于简单的内容模组非常有用。 + +一个包含 `.pak` 文件的示例模组结构如下: + +```text title="Example mod folder layout with .pak file" +mods/ +└──MyModFolder/ # mod 的根目录,可以任意命名 + ├── manifest.json # mod 清单文件 + ├── custom_assets.pak # 自定义资源包 + └── other_files... # mod 所需的其他文件(可选) +``` + +## 服务器端模组 + +:::info[正在进行中] + +此功能正在开发中,将在未来的 SDK 版本中提供。 + +::: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/save-files.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/save-files.md new file mode 100644 index 0000000..b6caba4 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/save-files.md @@ -0,0 +1,43 @@ +--- +sidebar_position: 4 +--- + +# 游戏存档文件 + +WukongMP SDK 允许使用 [Save API](../Development/APIs/save-file-management) +将玩家的存档数据同步到服务器。 + +存档文件存放在服务器上的 `saves/` 目录中。 + +```text title="存档文件夹结构示例" +saves +├── world.sav +└── players/ + ├── player_c703feff87364096a8b1eb19eabc9a8b.sav + └── player_a246246929654f37aa0483e35be1b2cc.sav +``` + +主世界存档文件(所有玩家共享的世界状态)将放置在 `world.sav` 文件中。 + +属于各个玩家的保存文件存放在符合以下命名模式的文件中:`player_GUID.sav`,其中 +[GUID](https://en.wikipedia.org/wiki/Globally_Unique_Identifier) 由 ReadyM +平台提供,并且对每个玩家都是唯一的。 + +## 使用联机合作模组 + +在我们扩展 [Save API](../Development/APIs/save-file-management) +以允许上传任意数量的带有任意元数据的存档文件之前,存档文件的行为如下: + +1. 首个加载新位置(区域)的玩家被视为该区域的「主机」,并在游戏保存时负责上传 `world.sav`。 +2. 包括主机在内的所有玩家也会上传他们自己的 `player_GUID.sav` 存档文件,其中包含各自角色的信息。 + +### 开始新游戏 + +要重置服务器的存档数据,只需删除 `saves` 文件夹。下次有人连接服务器时,他们将开始新游戏,前提是已启用联机合作模组。 + +### 从共享存档开始 + +如果你希望所有玩家都从特定的存档文件开始游戏,请将其放在 `saves/world.sav`,并删除 `saves/players` +文件夹,以强制所有玩家从该存档文件开始。 + +如果你不删除 `saves/players` 文件夹,位置和世界状态将取自 `world.sav`,玩家进度(装备、等级、技能等)将取自每个玩家的个人存档文件。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/server-list.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/server-list.mdx new file mode 100644 index 0000000..8f66531 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/Server/server-list.mdx @@ -0,0 +1,116 @@ +--- +sidebar_position: 5 +--- + +# 发布你的服务器 + +要在启动器的公共服务器列表中列出您的服务器,请在 `config.json` 中配置 `ServerList` 部分。 + +:::note + +对 `config.json` 所做的任何更改都需要 **服务器重启** 才能生效。 + +::: + +### 配置设置 + +| 设置 | 类型 | 描述 | +| ------------ | ------ | --------------------------------------------------------------- | +| `Enabled` | 布尔值 | 是否公开列出服务器。 | +| `Name` | string | 在启动器中可见的显示名称。最多 50 个字符。 | +| `Gamemode` | string | 游戏模式标签,显示在名称旁边。最多 15 个字符。 | +| `Description` | string | 可选。在启动器服务器卡片上显示的简短描述。最多 300 个字符。 | +| `Country` | string | 可选。两位字母 [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) 国家/地区代码(例如 `PL`、`US`、`DE`),用于在服务器卡片上显示国旗。 | +| `MaxPlayers` | 整数 | 最大可容纳的玩家数量。必须介于 **1 到 64** 之间(在玩家连接时强制执行)。 | +| `PublicHost` | string | 公开可路由的 IP 地址或主机名(最多 253 个字符)。请参阅 [主机验证规则](#主机验证规则)。 | +| `PublicPort` | 整数 | 玩家通过公共 IP 连接到服务器所使用的对外端口。 | +| `LicenseKey` | string | 用于获取验证的许可密钥。请参阅 [已验证状态](#已验证状态)。 | + +:::note + +这些限制在您的服务器向公共列表上报时强制执行。如果某个值无效(例如描述超过 300 个字符或国家/地区代码格式错误),服务器将不会被列出。 + +::: + +在选择名称和游戏模式标签时请保持尊重,因为它们将对启动器中的所有玩家可见。违反 [ReadyM 服务条款](https://portal.ready.mp/en/terms) 可能导致您的服务器从公开列表中移除,或您的账户被封禁。 + +### 最小配置示例 + +```json +{ +//highlight-start + "ServerList": { + "Enabled": true, + "Name": "Bob's arena", + "Gamemode": "PvP", + "Description": "Weekly PvP tournaments, all welcome", + "Country": "CN", + "MaxPlayers": 32, + "PublicHost": "203.0.113.1", + "PublicPort": 9050, + "LicenseKey": "" + }, +//highlight-end + "Server": { "Port": 9050 } +} +``` + +--- + +## 网络配置 + +在配置服务器网络布局时,区分本地绑定端口和公共路由端口非常重要: + +* **`Server.Port`**:服务器软件在您的主机上绑定的本地端口。 +* **`ServerList.PublicPort`**:对外公布给公共互联网的端口,玩家将使用该端口连接到您的服务器。 + +> 如果您的服务器位于路由器后面,使用 **端口转发**、网络地址转换(**NAT**)层,或在如 **Docker** +> 这样的虚拟化环境中运行,这两个端口可以不同。请确保外部防火墙将来自 `PublicPort` 的进入流量路由到本地 `Server.Port`。 + +--- + +## 主机验证规则 + +我们的系统会对 `PublicHost` 字符串进行评估,以确保网络有效性。如果您的地址不符合以下路由要求,服务器将无法在公开列表中列出。 + +### 主机名与 IP 地址 + +* **主机名**:标准域名(例如 `server.example.com`)在无需远程解析的情况下被接受。服务器会自动清理末尾的点(FQDN 格式化),并去除 + IPv6 字面量括号中的方括号(`[...]`)。 +* **本地主机限制**:默认拒绝将 `localhost` 作为主机名,以防止内部路由环回。 + +### 被阻塞的网络范围 + +如果提供了显式 IP 地址,它 **必须公网可路由**。系统明确阻止以下私有、本地和受限地址分配: + +| 地址类型 | IPv4 范围 | IPv6 范围 / 规则 | +| --------------- | ----------------------------------------------- | ------------------------ | +| **回环 / 未指定** | `127.0.0.0/8`, `0.0.0.0/8` | `::1`, `::`, IPv4 映射回环地址 | +| **私有网络** | `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16` | 唯一本地地址(`fc00::/7`) | +| **链路本地 / 站点本地** | `169.254.0.0/16` | 链路本地(`fe80::/10`),站点本地 | +| **运营商级 NAT** | `100.64.0.0/10` | 不适用 | +| **多播与保留** | `224.0.0.0/4`至 `255.255.255.255` | 多播(`ff00::/8`) | + +--- + +## 已验证状态 + +要在服务器列表中获得 **已验证** 徽章,请在 `ServerList:LicenseKey` 中输入一个有效的许可密钥。您可以在 [玩家门户](https://portal.ready.mp/en/dashboard/licenses) 生成密钥。 + + + +### 许可证分配 + +* 一个账户最多可以生成 **3 个许可密钥**。 +* **密钥共享**:一个许可密钥可以同时在多台服务器之间共享。这使您能够使用您分配的密钥来托管无限数量的公开、已验证的服务器。*(注:此行为可能会在未来的门户更新中发生更改。)* + +:::warning + +密钥是机密信息,不应公开共享。如果您认为密钥已被泄露,请在玩家门户中重新生成一个新密钥,并立即撤销被泄露的令牌。 + +::: + +在配置中输入有效密钥并重启后,服务器在启动器中将被标记为 **已验证**: + +启动器中的已验证服务器 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/quick-start.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/quick-start.mdx new file mode 100644 index 0000000..5d498ed --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/quick-start.mdx @@ -0,0 +1,150 @@ +--- +sidebar_position: 2 +--- + +import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; + +# 快速开始 + +在不到5分钟内让 WukongMP 服务器运行起来。 + +## 1. 下载服务器 + + + + +[⬇ Windows +下载(x64,v0.2.4)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.2.4.zip) + + + + +[⬇ Linux +下载(x64,v0.2.4)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.2.4.zip) + + + + +```shell +docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 +``` + + + + +## 2. 提取并配置 + + + + +将 `.zip` 解压到你选择的文件夹中。服务器是独立的——无需安装程序。 + +如要更改端口(默认值:`9050`),打开 `config.json` 并编辑 `Server:Port`。 + + + + +将 `.zip` 解压到你选择的文件夹中。服务器是独立的——无需安装程序。 + +如要更改端口(默认值:`9050`),打开 `config.json` 并编辑 `Server:Port`。 + + + + +从镜像中复制配置文件: + +```shell +docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.2.4 +docker cp wukongmp-tmp:/app/config.json ./config.json +docker rm wukongmp-tmp +``` + +端口配置通过重新映射容器端口来处理 — 请参见第3步。 + +:::important + +镜像 **不带模组**。在启动容器之前,请下载二进制程序包并将 `WukongMp.Sdk` 以及你选择的游戏模式模组(`WukongMp.PvP` 或 +`WukongMp.Coop`)复制到本地 `./mods/` 文件夹中。 + +::: + + + + +## 3. 启动服务器 + + + + +双击 `server.exe`,或在终端中运行它: + +```shell +.\server.exe +``` + + + + +```shell +chmod +x server && ./server +``` + + + + +```shell +docker run \ + -p 9050:9050/udp -p 9050:9050/tcp \ + -v ./data:/app/data \ + -v ./mods:/app/mods \ + -v ./saves:/app/saves \ + -v ./config.json:/app/config.json \ + --name wukongmp-server \ + ghcr.io/readycodeio/wukongmp-server:0.2.4 +``` + +或者使用 Docker Compose: + +```yaml title="docker-compose.yml" +services: + server: + image: ghcr.io/readycodeio/wukongmp-server:0.2.4 + container_name: wukongmp-server + restart: unless-stopped + ports: + - "9050:9050/tcp" + - "9050:9050/udp" + volumes: + - ./data:/app/data + - ./mods:/app/mods + - ./saves:/app/saves + - ./config.json:/app/config.json +``` + + + + +## 4. 打开管理面板 + +服务器运行后,请打开浏览器并前往: + +``` +http://localhost:9050 +``` + +在这里你可以管理玩家、配置模组,并实时监控你的服务器。 + +--- + +🎉 **你已上线!** 分享你的 IP 和端口 `:9050` 给玩家——他们需要安装 ReadyM Launcher 才能连接。 + +--- + +## 后续步骤 + +| | | +| ----------------------------- | ------------- | +| [完整安装指南](Server/installation) | 高级配置和选项 | +| [后台管理面板](Server/admin-panel) | 管理用户、封禁和服务器设置 | +| [模组管理](Server/mod-management) | 安装并配置模组 | +| [服务器列表](Server/server-list) | 将您的服务器公开注册 | diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/what-is-wukong-mp.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/what-is-wukong-mp.md new file mode 100644 index 0000000..49b06fe --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/version-0.2.4/docs/what-is-wukong-mp.md @@ -0,0 +1,102 @@ +--- +sidebar_position: 1 +--- + +# 什么是 WukongMP? + +WukongMP 是一个面向 **Black Myth: Wukong** +的社区多人游戏平台。它将游戏的单人体验转变为一个充满活力、由社区驱动的世界——让玩家运行自己的服务器、加入合作联机、在 PvP +竞技场中战斗,并构建完全自定义的游戏模式。 + +WukongMP 由 [ReadyM](https://www.ready.mp) 团队构建并维护。它 **不是** Black Myth: Wukong +的官方服务,也与 Game Science 无关。 + +--- + +## 你可以做什么 + +### 作为玩家 + +- **协作联机** — 与朋友一起探索世界并击败首领们 +- **PvP** — 加入社区运营的 PvP 服务器,具备自定义规则集 +- **一键加入** — 自动模组与资源同步意味着你无需手动安装模组包;只需点击即可开始游戏 +- **单一账户,所有游戏** — 你的 ReadyM 账户可在 WukongMP 和其他 ReadyM 支持的游戏中使用 + +### 作为服务器所有者 + +- **运行你自己的服务器** — 下载服务器二进制文件或 Docker 镜像,并在任意机器或云服务提供商上托管(包括 + [Nodecraft](https://nodecraft.com/games/wukongmp-server-hosting)) +- **自定义游戏模式** — 使用 C# SDK 构建角色扮演服务器、生存模式、Boss Rush 联赛,或具备完全自定义逻辑的 PvP 锦标赛 +- **模组管理** — 通过管理员面板安装、启用和禁用模组,无需重启服务器 +- **实时分析** — 监控你的社区如何进行游戏、跟踪玩家数量,并实时观察服务器健康状况 + +--- + +## 工作原理 + +### 玩家 + +1. **在 [portal.ready.mp](https://portal.ready.mp/signup) 创建 ReadyM 账户 +2. **下载启动器** — 连接服务器时它会自动处理模组同步 +3. **挑选服务器并开始游玩** — 浏览服务器列表,点击加入,启动器会处理其余部分 + +### 作为服务器所有者 + +1. **下载服务器二进制文件**(Windows 或 Linux)或拉取 Docker 镜像 — 请参阅 + [快速入门指南](quick-start),几分钟即可上线 +2. **配置** — 编辑 `config.json` 以设置端口,然后将 mods 放入 `mods/` 文件夹 +3. **启动并管理** — 启动服务器并使用内置网页管理面板来管理玩家、模组和设置 + +--- + +## ReadyM 平台 + +WukongMP 架构在 **ReadyM SDK 与平台** 之上,提供实现社区级多人游戏所需的共享基础架构: + +| 特性 | 描述 | +| --------------- | -------------------------------------------------- | +| **安全的单点登录** | 玩家通过 ReadyM 账户进行身份验证 — 无需为每个服务器配置账户系统 | +| **自动模组同步** | 启动器在连接前会安装服务器所需的确切模组 | +| **C# 脚本引擎** | 在 C# 中编写服务器端游戏逻辑,能够访问游戏事件、实体数据、命令以及自定义 RPC | +| **服务器二进制** | 为云端和专用硬件优化的独立可部署包 | +| **Admin panel** | 内置网页用户界面,用于实时服务器管理,访问地址为 `http://your-server:9050` | + +ReadyM 的设计目标是为社区运行的游戏服务器做 FiveM 对 *Grand Theft Auto V* +所做的事——一个民主、开放的平台,任何人都可以创建并分享自定义的多人游戏体验。 + +--- + +## 当前状态 + +WukongMP 处于 **活跃开发**状态。该 SDK 于 2026 年 5 月公开测试版上线。 + +| 区域 | 状态 | +| ------------------------- | ------- | +| 合作与 PvP 服务器 | ✅ 可用 | +| 服务器二进制文件(Windows 与 Linux) | ✅ 可用 | +| Docker 镜像 | ✅ 可用 | +| SDK(C# 脚本) | ✅ 公开测试版 | +| 自定义 RPC | ✅ 可用 | +| 保存文件 API | 🚧 部分完成 | +| 自定义数据同步 | 🔜 进行中 | +| 服务器端模组 | 🔜 进行中 | + +有关完整的 SDK 功能分解,请参阅 [Getting Started](Development/getting-started)。 + +--- + +## 合作伙伴 + +ReadyM 与行业伙伴合作,提供尽可能最佳的服务器托管和工具体验: + +- **[Nodecraft](https://nodecraft.com/games/wukongmp-server-hosting)** — + WukongMP 服务器的官方托管提供商 + +--- + +## 开始使用 + +- 👾 **玩家?** [Create a ReadyM account](https://portal.ready.mp/signup) 并下载启动器 +- 🖥️ **服务器所有者?** 按照 [Quick Start guide](quick-start) 让您的服务器在几分钟内上线 +- ⚡ **开发者?** 请参阅 [快速入门](Development/getting-started),以使用 SDK 构建您的第一个模组 +- 💬 **问题?** 加入 [WukongMP Discord](https://dsc.gg/readym) diff --git a/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md new file mode 100644 index 0000000..2095711 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md @@ -0,0 +1,131 @@ +# Class HarmonyTargetMethodHint + +Namespace: [PreludeLib.Attributes](../PreludeLib.Attributes/PreludeLib.Attributes.md) +Assembly: PreludeLib.dll + +When declaring a TargetMethod method in your patch class, you must decorate it with this attribute. + +```csharp +[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] +public class HarmonyTargetMethodHint : Attribute +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) ← +[HarmonyTargetMethodHint](../PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md) + +#### Inherited Members + +[Attribute.GetCustomAttributes\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(MemberInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\)), +[Attribute.GetCustomAttributes\(MemberInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-boolean\)), +[Attribute.IsDefined\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.IsDefined\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-boolean\)), +[Attribute.IsDefined\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.IsDefined\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttributes\(Module\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\)), +[Attribute.GetCustomAttributes\(Module, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\)), +[Attribute.IsDefined\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttribute\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttributes\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\)), +[Attribute.GetCustomAttributes\(Assembly, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-boolean\)), +[Attribute.IsDefined\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\)), +[Attribute.IsDefined\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttribute\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.equals), +[Attribute.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.gethashcode), +[Attribute.Match\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.match), +[Attribute.IsDefaultAttribute\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefaultattribute), +[Attribute.TypeId](https://learn.microsoft.com/dotnet/api/system.attribute.typeid), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### HarmonyTargetMethodHint\(string, params Type\[\]\) + +Use this constructor when the HarmonyPatch attribute on the patch class already specifies the declaring type. + +```csharp +public HarmonyTargetMethodHint(string methodName, params Type[] args) +``` + +#### Parameters + +`methodName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Name of the target method. + +`args` [Type](https://learn.microsoft.com/dotnet/api/system.type)\[\] + +Types of the target method parameters, in order. Use an empty array for parameterless methods. + +### HarmonyTargetMethodHint\(Type, string, params Type\[\]\) + +The declaring type can be specified as a Type to allow for compile-time checking of the target method's existence and signature. +However, this creates a hard reference to the assembly containing the target method, which may not be desirable in all cases. + +```csharp +public HarmonyTargetMethodHint(Type declaringType, string methodName, params Type[] args) +``` + +#### Parameters + +`declaringType` [Type](https://learn.microsoft.com/dotnet/api/system.type) + +Fully qualified name of the declaring type, including namespace. + +`methodName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Name of the target method. + +`args` [Type](https://learn.microsoft.com/dotnet/api/system.type)\[\] + +Types of the target method parameters, in order. Use an empty array for parameterless methods. + +### HarmonyTargetMethodHint\(string, string, params Type\[\]\) + +The declaring type can be specified as a string to avoid hard references to the assembly containing the target method. + +```csharp +public HarmonyTargetMethodHint(string declaringType, string methodName, params Type[] args) +``` + +#### Parameters + +`declaringType` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Fully qualified name of the declaring type, including namespace. + +`methodName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Name of the target method. + +`args` [Type](https://learn.microsoft.com/dotnet/api/system.type)\[\] + +Types of the target method parameters, in order. Use an empty array for parameterless methods. + + diff --git a/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.In-1.md b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.In-1.md new file mode 100644 index 0000000..d04d441 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.In-1.md @@ -0,0 +1,28 @@ +# Struct In + +Namespace: [PreludeLib.Attributes](../PreludeLib.Attributes/PreludeLib.Attributes.md) +Assembly: PreludeLib.dll + +Use in **HarmonyTargetMethodHint** parameter list to indicate that the parameter is an in parameter. +This is required for Harmony to correctly identify the method when matching signatures, as in parameters are treated differently than regular parameters. + +```csharp +public struct In +``` + +#### Type Parameters + +`T` + +The type of the in parameter. + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + + diff --git a/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md new file mode 100644 index 0000000..6541b7a --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md @@ -0,0 +1,28 @@ +# Struct Out + +Namespace: [PreludeLib.Attributes](../PreludeLib.Attributes/PreludeLib.Attributes.md) +Assembly: PreludeLib.dll + +Use in **HarmonyTargetMethodHint** parameter list to indicate that the parameter is an out parameter. +This is required for Harmony to correctly identify the method when matching signatures, as out parameters are treated differently than regular parameters. + +```csharp +public struct Out +``` + +#### Type Parameters + +`T` + +The type of the out parameter. + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + + diff --git a/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md new file mode 100644 index 0000000..6518d63 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md @@ -0,0 +1,28 @@ +# Struct Ref + +Namespace: [PreludeLib.Attributes](../PreludeLib.Attributes/PreludeLib.Attributes.md) +Assembly: PreludeLib.dll + +Use in **HarmonyTargetMethodHint** parameter list to indicate that the parameter is an ref parameter. +This is required for Harmony to correctly identify the method when matching signatures, as ref parameters are treated differently than regular parameters. + +```csharp +public struct Ref +``` + +#### Type Parameters + +`T` + +The type of the ref parameter. + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + + diff --git a/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.md b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.md new file mode 100644 index 0000000..e6a7e63 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.md @@ -0,0 +1,26 @@ +# PreludeLib.Attributes + +### Classes + + [HarmonyTargetMethodHint](../PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md) + +When declaring a TargetMethod method in your patch class, you must decorate it with this attribute. + +### Structs + + [In](../PreludeLib.Attributes/PreludeLib.Attributes.In-1.md) + +Use in **HarmonyTargetMethodHint** parameter list to indicate that the parameter is an in parameter. +This is required for Harmony to correctly identify the method when matching signatures, as in parameters are treated differently than regular parameters. + + [Out](../PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md) + +Use in **HarmonyTargetMethodHint** parameter list to indicate that the parameter is an out parameter. +This is required for Harmony to correctly identify the method when matching signatures, as out parameters are treated differently than regular parameters. + + [Ref](../PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md) + +Use in **HarmonyTargetMethodHint** parameter list to indicate that the parameter is an ref parameter. +This is required for Harmony to correctly identify the method when matching signatures, as ref parameters are treated differently than regular parameters. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md new file mode 100644 index 0000000..b2e7a77 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md @@ -0,0 +1,67 @@ +# Struct ConsoleCommand.ParamInfo + +Namespace: [ReadyM.Api.Command](../ReadyM.Api.Command/ReadyM.Api.Command.md) +Assembly: ReadyM.Api.dll + +```csharp +public readonly struct ConsoleCommand.ParamInfo +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ParamInfo\(Type, bool, object?\) + +```csharp +public ParamInfo(Type paramType, bool hasDefault, object? defaultValue) +``` + +#### Parameters + +`paramType` [Type](https://learn.microsoft.com/dotnet/api/system.type) + +`hasDefault` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +`defaultValue` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +## Fields + +### DefaultValue + +```csharp +public readonly object? DefaultValue +``` + +#### Field Value + + [object](https://learn.microsoft.com/dotnet/api/system.object)? + +### HasDefault + +```csharp +public readonly bool HasDefault +``` + +#### Field Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ParamType + +```csharp +public readonly Type ParamType +``` + +#### Field Value + + [Type](https://learn.microsoft.com/dotnet/api/system.type) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md new file mode 100644 index 0000000..fac4c31 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md @@ -0,0 +1,131 @@ +# Struct ConsoleCommand + +Namespace: [ReadyM.Api.Command](../ReadyM.Api.Command/ReadyM.Api.Command.md) +Assembly: ReadyM.Api.dll + +```csharp +public readonly struct ConsoleCommand +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ConsoleCommand\(Delegate, int, int?, IReadOnlyList, Type?, bool\) + +```csharp +public ConsoleCommand(Delegate handler, int minArgCount, int? maxArgCount, IReadOnlyList args, Type? repeatingParam, bool isDebugOnly) +``` + +#### Parameters + +`handler` [Delegate](https://learn.microsoft.com/dotnet/api/system.delegate) + +`minArgCount` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`maxArgCount` [int](https://learn.microsoft.com/dotnet/api/system.int32)? + +`args` [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[ConsoleCommand](../ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md).[ParamInfo](../ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md)\> + +`repeatingParam` [Type](https://learn.microsoft.com/dotnet/api/system.type)? + +`isDebugOnly` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +## Fields + +### Handler + +```csharp +public readonly Delegate Handler +``` + +#### Field Value + + [Delegate](https://learn.microsoft.com/dotnet/api/system.delegate) + +### IsDebugOnly + +```csharp +public readonly bool IsDebugOnly +``` + +#### Field Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### MaxArgCount + +```csharp +public readonly int? MaxArgCount +``` + +#### Field Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32)? + +### MinArgCount + +```csharp +public readonly int MinArgCount +``` + +#### Field Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Parameters + +```csharp +public readonly IReadOnlyList Parameters +``` + +#### Field Value + + [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[ConsoleCommand](../ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md).[ParamInfo](../ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md)\> + +### RepeatingParam + +```csharp +public readonly Type? RepeatingParam +``` + +#### Field Value + + [Type](https://learn.microsoft.com/dotnet/api/system.type)? + +## Methods + +### Create\(Delegate, bool\) + +```csharp +public static ConsoleCommand Create(Delegate handler, bool isDebugOnly = false) +``` + +#### Parameters + +`handler` [Delegate](https://learn.microsoft.com/dotnet/api/system.delegate) + +`isDebugOnly` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +#### Returns + + [ConsoleCommand](../ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md) + +### Invoke\(IReadOnlyList\) + +```csharp +public void Invoke(IReadOnlyList args) +``` + +#### Parameters + +`args` [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[object](https://learn.microsoft.com/dotnet/api/system.object)?\> + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.md new file mode 100644 index 0000000..34795b2 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.md @@ -0,0 +1,9 @@ +# ReadyM.Api.Command + +### Structs + + [ConsoleCommand](../ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md) + + [ConsoleCommand.ParamInfo](../ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md new file mode 100644 index 0000000..9537c12 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md @@ -0,0 +1,94 @@ +# Interface IDependencyContainer + +Namespace: [ReadyM.Api.DI](../ReadyM.Api.DI/ReadyM.Api.DI.md) +Assembly: ReadyM.Api.dll + +Dependency injection container interface for registering and resolving services. + +```csharp +public interface IDependencyContainer +``` + +## Methods + +### RegisterSingleton\(\) + +```csharp +void RegisterSingleton() +``` + +#### Type Parameters + +`TService` + +### RegisterSingleton\(TService\) + +```csharp +void RegisterSingleton(TService instance) +``` + +#### Parameters + +`instance` TService + +#### Type Parameters + +`TService` + +### RegisterSingleton\(Type\) + +```csharp +void RegisterSingleton(Type implementationType) +``` + +#### Parameters + +`implementationType` [Type](https://learn.microsoft.com/dotnet/api/system.type) + +#### Type Parameters + +`TService` + +### RegisterSingleton\(\) + +```csharp +void RegisterSingleton() where TImplementation : TService +``` + +#### Type Parameters + +`TService` + +`TImplementation` + +### RegisterSingleton\(TImplementation\) + +```csharp +void RegisterSingleton(TImplementation instance) where TImplementation : TService +``` + +#### Parameters + +`instance` TImplementation + +#### Type Parameters + +`TService` + +`TImplementation` + +### Resolve\(\) + +```csharp +T Resolve() +``` + +#### Returns + + T + +#### Type Parameters + +`T` + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md new file mode 100644 index 0000000..446859e --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md @@ -0,0 +1,29 @@ +# Interface IHostedService + +Namespace: [ReadyM.Api.DI](../ReadyM.Api.DI/ReadyM.Api.DI.md) +Assembly: ReadyM.Api.dll + +Services that implement this interface will have their **OnScopeStart** method called when the DI container is initialized (on game start). +This allows them to perform any necessary setup at the appropriate time, such as registering event handlers. +The service will be disposed when the game shuts down, allowing for any necessary cleanup. + +```csharp +public interface IHostedService : IDisposable +``` + +#### Implements + +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +## Methods + +### OnScopeStart\(\) + +Called when the DI container is initialized (on game start). +This allows the service to perform any necessary setup at the appropriate time, such as registering event handlers. + +```csharp +void OnScopeStart() +``` + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md new file mode 100644 index 0000000..682dfc6 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md @@ -0,0 +1,15 @@ +# ReadyM.Api.DI + +### Interfaces + + [IDependencyContainer](../ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md) + +Dependency injection container interface for registering and resolving services. + + [IHostedService](../ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md) + +Services that implement this interface will have their **OnScopeStart** method called when the DI container is initialized (on game start). +This allows them to perform any necessary setup at the appropriate time, such as registering event handlers. +The service will be disposed when the game shuts down, allowing for any necessary cleanup. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md new file mode 100644 index 0000000..deab097 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md @@ -0,0 +1,172 @@ +# Struct AreaId + +Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) +Assembly: ReadyM.Api.dll + +Identifies an area within the game world. +Areas can be main Chapter maps, sub-areas such as the Zodiac Village, or hidden boss arenas. +If going somewhere requires a loading screen, it's probably a different area. + +```csharp +public struct AreaId : INetSerializable, IEquatable +``` + +#### Implements + +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs), +[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### AreaId\(ushort\) + +Identifies an area within the game world. +Areas can be main Chapter maps, sub-areas such as the Zodiac Village, or hidden boss arenas. +If going somewhere requires a loading screen, it's probably a different area. + +```csharp +public AreaId(ushort id) +``` + +#### Parameters + +`id` [ushort](https://learn.microsoft.com/dotnet/api/system.uint16) + +The underlying ID value. This is not guaranteed to be stable across game versions, and should not be used for anything other than debugging or logging purposes. + +## Properties + +### Invalid + +```csharp +public static AreaId Invalid { get; } +``` + +#### Property Value + + [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +### Max + +```csharp +public static AreaId Max { get; } +``` + +#### Property Value + + [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +## Methods + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Equals\(AreaId\) + +```csharp +public bool Equals(AreaId other) +``` + +#### Parameters + +`other` [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equals\(object?\) + +```csharp +public override bool Equals(object? obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### GetHashCode\(\) + +```csharp +public override int GetHashCode() +``` + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### ToString\(\) + +```csharp +public override string ToString() +``` + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Operators + +### operator ==\(AreaId, AreaId\) + +```csharp +public static bool operator ==(AreaId left, AreaId right) +``` + +#### Parameters + +`left` [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +`right` [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### operator \!=\(AreaId, AreaId\) + +```csharp +public static bool operator !=(AreaId left, AreaId right) +``` + +#### Parameters + +`left` [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +`right` [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md new file mode 100644 index 0000000..42924ea --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md @@ -0,0 +1,169 @@ +# Struct PlayerId + +Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) +Assembly: ReadyM.Api.dll + +A unique identifier for a player in the current session. +This is not a persistent identifier and can change over time, especially if players disconnect and reconnect. +It should be used for identifying players during the current session, but not for long-term storage or cross-session identification. + +```csharp +public struct PlayerId : INetSerializable, IEquatable +``` + +#### Implements + +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs), +[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### Invalid + +An invalid PlayerId, which can be used to represent the absence of a player or an uninitialized state. + +```csharp +public static PlayerId Invalid { get; } +``` + +#### Property Value + + [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + +### RawValue + +```csharp +public ushort RawValue { get; } +``` + +#### Property Value + + [ushort](https://learn.microsoft.com/dotnet/api/system.uint16) + +### Server + +The PlayerId representing the server itself. +This can be used to identify actions or messages that originate from the server rather than any specific player. + +```csharp +public static PlayerId Server { get; } +``` + +#### Property Value + + [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + +## Methods + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Equals\(PlayerId\) + +```csharp +public bool Equals(PlayerId other) +``` + +#### Parameters + +`other` [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equals\(object?\) + +```csharp +public override bool Equals(object? obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### GetHashCode\(\) + +```csharp +public override int GetHashCode() +``` + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### ToString\(\) + +```csharp +public override string ToString() +``` + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Operators + +### operator ==\(PlayerId, PlayerId\) + +```csharp +public static bool operator ==(PlayerId left, PlayerId right) +``` + +#### Parameters + +`left` [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + +`right` [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### operator \!=\(PlayerId, PlayerId\) + +```csharp +public static bool operator !=(PlayerId left, PlayerId right) +``` + +#### Parameters + +`left` [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + +`right` [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md new file mode 100644 index 0000000..081907e --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md @@ -0,0 +1,17 @@ +# ReadyM.Api.Idents + +### Structs + + [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +Identifies an area within the game world. +Areas can be main Chapter maps, sub-areas such as the Zodiac Village, or hidden boss arenas. +If going somewhere requires a loading screen, it's probably a different area. + + [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + +A unique identifier for a player in the current session. +This is not a persistent identifier and can change over time, especially if players disconnect and reconnect. +It should be used for identifying players during the current session, but not for long-term storage or cross-session identification. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md new file mode 100644 index 0000000..d3a713f --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md @@ -0,0 +1,168 @@ +# Struct ConnectionTicket + +Namespace: [ReadyM.Api.Multiplayer.Client](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md) +Assembly: ReadyM.Api.Multiplayer.dll + +```csharp +public struct ConnectionTicket : IEquatable, INetSerializable +``` + +#### Implements + +[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Equals\(ConnectionTicket\) + +```csharp +public bool Equals(ConnectionTicket other) +``` + +#### Parameters + +`other` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equals\(object?\) + +```csharp +public override bool Equals(object? obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### GetHashCode\(\) + +```csharp +public override int GetHashCode() +``` + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### New\(\) + +```csharp +public static ConnectionTicket New() +``` + +#### Returns + + [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) + +### Parse\(string\) + +```csharp +public static ConnectionTicket Parse(string text) +``` + +#### Parameters + +`text` [string](https://learn.microsoft.com/dotnet/api/system.string) + +#### Returns + + [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) + +### Serialize\(NetDataWriter\) + +```csharp +public readonly void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### ToString\(\) + +```csharp +public override string ToString() +``` + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### TryParse\(string, out ConnectionTicket?\) + +```csharp +public static bool TryParse(string text, out ConnectionTicket? ticket) +``` + +#### Parameters + +`text` [string](https://learn.microsoft.com/dotnet/api/system.string) + +`ticket` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +## Operators + +### operator ==\(ConnectionTicket, ConnectionTicket\) + +```csharp +public static bool operator ==(ConnectionTicket left, ConnectionTicket right) +``` + +#### Parameters + +`left` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) + +`right` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### operator \!=\(ConnectionTicket, ConnectionTicket\) + +```csharp +public static bool operator !=(ConnectionTicket left, ConnectionTicket right) +``` + +#### Parameters + +`left` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) + +`right` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md new file mode 100644 index 0000000..85e5e26 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md @@ -0,0 +1,74 @@ +# Interface IRpcClient + +Namespace: [ReadyM.Api.Multiplayer.Client](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md) +Assembly: ReadyM.Api.Multiplayer.dll + +```csharp +public interface IRpcClient +``` + +## Methods + +### AddClientRpcMessageHandler\(RelayMessageCode, Action\) + +```csharp +void AddClientRpcMessageHandler(RelayMessageCode eventCode, Action handler) +``` + +#### Parameters + +`eventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +`handler` [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md), [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs)\> + +### AddClientRpcMessageHandler\(RelayMessageCode, RelayMessageCode, Action\) + +```csharp +void AddClientRpcMessageHandler(RelayMessageCode minEventCode, RelayMessageCode maxEventCode, Action handler) +``` + +#### Parameters + +`minEventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +`maxEventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +`handler` [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md), [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs)\> + +### RemoveClientRpcMessageHandler\(RelayMessageCode, Action\) + +```csharp +void RemoveClientRpcMessageHandler(RelayMessageCode eventCode, Action handler) +``` + +#### Parameters + +`eventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +`handler` [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md), [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs)\> + +### RemoveClientRpcMessageHandler\(RelayMessageCode, RelayMessageCode, Action\) + +```csharp +void RemoveClientRpcMessageHandler(RelayMessageCode minEventCode, RelayMessageCode maxEventCode, Action handler) +``` + +#### Parameters + +`minEventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +`maxEventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +`handler` [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md), [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs)\> + +### SendMessage\(RelayMessage\) + +```csharp +void SendMessage(RelayMessage message) +``` + +#### Parameters + +`message` [RelayMessage](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md new file mode 100644 index 0000000..e428fd9 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md @@ -0,0 +1,55 @@ +# Struct RelayMessage + +Namespace: [ReadyM.Api.Multiplayer.Client](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md) +Assembly: ReadyM.Api.Multiplayer.dll + +```csharp +public struct RelayMessage +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Fields + +### Writer + +```csharp +public readonly NetDataWriter Writer +``` + +#### Field Value + + [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +## Methods + +### ByRelayMode\(RelayMessageCode, PlayerId, RelayMode, DeliveryMethod\) + +Send an event with a specific delivery method. + +```csharp +public static RelayMessage ByRelayMode(RelayMessageCode eventCode, PlayerId playerId, RelayMode mode, DeliveryMethod deliveryMethod) +``` + +#### Parameters + +`eventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +`playerId` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + +`mode` [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) + +`deliveryMethod` [DeliveryMethod](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/NetConstants.cs) + +#### Returns + + [RelayMessage](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md new file mode 100644 index 0000000..c4b4da5 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md @@ -0,0 +1,13 @@ +# ReadyM.Api.Multiplayer.Client + +### Structs + + [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) + + [RelayMessage](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md) + +### Interfaces + + [IRpcClient](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md new file mode 100644 index 0000000..3a90699 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md @@ -0,0 +1,93 @@ +# Class DeriveINetSerializableAttribute + +Namespace: [ReadyM.Api.Multiplayer.Generators](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Decorate a struct with this attribute to make it available for use as an RPC parameter. + +```csharp +[AttributeUsage(AttributeTargets.Struct)] +public sealed class DeriveINetSerializableAttribute : Attribute +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) ← +[DeriveINetSerializableAttribute](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md) + +#### Inherited Members + +[Attribute.GetCustomAttributes\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(MemberInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\)), +[Attribute.GetCustomAttributes\(MemberInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-boolean\)), +[Attribute.IsDefined\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.IsDefined\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-boolean\)), +[Attribute.IsDefined\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.IsDefined\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttributes\(Module\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\)), +[Attribute.GetCustomAttributes\(Module, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\)), +[Attribute.IsDefined\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttribute\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttributes\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\)), +[Attribute.GetCustomAttributes\(Assembly, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-boolean\)), +[Attribute.IsDefined\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\)), +[Attribute.IsDefined\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttribute\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.equals), +[Attribute.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.gethashcode), +[Attribute.Match\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.match), +[Attribute.IsDefaultAttribute\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefaultattribute), +[Attribute.TypeId](https://learn.microsoft.com/dotnet/api/system.attribute.typeid), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### DeriveINetSerializableAttribute\(SerializableMode\) + +Decorate a struct with this attribute to make it available for use as an RPC parameter. + +```csharp +public DeriveINetSerializableAttribute(SerializableMode mode = SerializableMode.Default) +``` + +#### Parameters + +`mode` [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Serialization/SerializableMode.cs) + +Determines which members of the struct are serialized. See **SerializableMode** for details. + +## Fields + +### Mode + +```csharp +public readonly SerializableMode Mode +``` + +#### Field Value + + [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Serialization/SerializableMode.cs) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md new file mode 100644 index 0000000..79d9293 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md @@ -0,0 +1,83 @@ +# Class RpcEventAttribute + +Namespace: [ReadyM.Api.Multiplayer.Generators](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Marks a method as an RPC event handler. +Use this in partial classes extending from **RpcClassBase**. + +```csharp +[AttributeUsage(AttributeTargets.Method)] +public sealed class RpcEventAttribute : Attribute +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) ← +[RpcEventAttribute](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md) + +#### Inherited Members + +[Attribute.GetCustomAttributes\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(MemberInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\)), +[Attribute.GetCustomAttributes\(MemberInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-boolean\)), +[Attribute.IsDefined\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.IsDefined\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-boolean\)), +[Attribute.IsDefined\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.IsDefined\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttributes\(Module\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\)), +[Attribute.GetCustomAttributes\(Module, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\)), +[Attribute.IsDefined\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttribute\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttributes\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\)), +[Attribute.GetCustomAttributes\(Assembly, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-boolean\)), +[Attribute.IsDefined\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\)), +[Attribute.IsDefined\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttribute\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.equals), +[Attribute.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.gethashcode), +[Attribute.Match\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.match), +[Attribute.IsDefaultAttribute\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefaultattribute), +[Attribute.TypeId](https://learn.microsoft.com/dotnet/api/system.attribute.typeid), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### RpcEventAttribute\(RelayMode\) + +Marks a method as an RPC event handler. +Use this in partial classes extending from **RpcClassBase**. + +```csharp +public RpcEventAttribute(RelayMode relayMode) +``` + +#### Parameters + +`relayMode` [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) + +Determines how the event is relayed to other clients. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md new file mode 100644 index 0000000..cc1e732 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md @@ -0,0 +1,14 @@ +# ReadyM.Api.Multiplayer.Generators + +### Classes + + [DeriveINetSerializableAttribute](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md) + +Decorate a struct with this attribute to make it available for use as an RPC parameter. + + [RpcEventAttribute](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md) + +Marks a method as an RPC event handler. +Use this in partial classes extending from **RpcClassBase**. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md new file mode 100644 index 0000000..5551126 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md @@ -0,0 +1,50 @@ +# Enum RelayMessageCode + +Namespace: [ReadyM.Api.Multiplayer.Protocol.Enums](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md) +Assembly: ReadyM.Api.Multiplayer.dll + +A unique identifier of a single RPC message type. + +```csharp +public enum RelayMessageCode : byte +``` + +## Fields + +`HandshakeConnected = 255` + +`RequestAreaEvent = 254` + +`AreaEvent = 253` + +`OtherPlayerConnectionEvent = 252` + +`OtherPlayerAreaEvent = 251` + +`EcsDelta = 250` + +`MaxBuiltInEvent = 250` + +`EcsSnapshot = 249` + +`EcsCreateEntity = 248` + +`EcsDeleteEntity = 247` + +`EcsChangeOwnership = 246` + +`MinBuiltInEvent = 246` + +`MaxAnyCustomEvent = 245` + +`MaxServerRpcEvent = 245` + +`MinServerRpcEvent = 150` + +`MaxClientRpcEvent = 149` + +`MinClientRpcEvent = 0` + +`MinAnyCustomEvent = 0` + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md new file mode 100644 index 0000000..bd7ee14 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md @@ -0,0 +1,38 @@ +# Enum RelayMode + +Namespace: [ReadyM.Api.Multiplayer.Protocol.Enums](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Indicates how an RPC message should be relayed to other players in the game. + +```csharp +public enum RelayMode : byte +``` + +## Fields + +`AreaOfInterestOthers = 0` + +Sends the message to all players in the area of interest of the sender, other than the sender. + + + +`AreaOfInterestAll = 1` + +Sends the message to all players in the area of interest of the sender, including the sender. + + + +`GlobalOthers = 2` + +Sends the message to all players in the game, other than the sender. + + + +`GlobalAll = 3` + +Sends the message to all players in the game, including the sender. + + + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md new file mode 100644 index 0000000..6f868a4 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md @@ -0,0 +1,24 @@ +# ReadyM.Api.Multiplayer.Protocol + +### Namespaces + + [ReadyM.Api.Multiplayer.Protocol.Enums](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md) + +### Structs + + [CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md) + +Spans 4 bytes in standard relay modes and (6 + 2 * peers) in peer-targeted relay mode. +- 1 byte for eventCode +- 2 bytes for sender +- 2 bytes for peers count +- 1 byte for relayMode +- peers * 2 bytes for peers + +### Enums + + [DisconnectedReason](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md) + +Denotes a reason for being disconnected from the server. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md new file mode 100644 index 0000000..3280576 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md @@ -0,0 +1,10 @@ +# ReadyM.Api.Multiplayer.RPC + +### Classes + + [RpcClassBase](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md) + +Base class for an RPC container. +Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md new file mode 100644 index 0000000..0fe639c --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md @@ -0,0 +1,93 @@ +# Struct CustomRelayEventHeader + +Namespace: [ReadyM.Api.Multiplayer.Protocol](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Spans 4 bytes in standard relay modes and (6 + 2 * peers) in peer-targeted relay mode. +- 1 byte for eventCode +- 2 bytes for sender +- 2 bytes for peers count +- 1 byte for relayMode +- peers * 2 bytes for peers + +```csharp +public struct CustomRelayEventHeader +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### CustomRelayEventHeader\(RelayMessageCode, PlayerId, PlayerId\[\]?, RelayMode\) + +Spans 4 bytes in standard relay modes and (6 + 2 * peers) in peer-targeted relay mode. +- 1 byte for eventCode +- 2 bytes for sender +- 2 bytes for peers count +- 1 byte for relayMode +- peers * 2 bytes for peers + +```csharp +public CustomRelayEventHeader(RelayMessageCode eventCode, PlayerId sender, PlayerId[]? peers, RelayMode relayMode = RelayMode.AreaOfInterestOthers) +``` + +#### Parameters + +`eventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +`sender` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + +`peers` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\[\]? + +`relayMode` [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) + +## Fields + +### EventCode + +```csharp +public RelayMessageCode EventCode +``` + +#### Field Value + + [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +### Peers + +```csharp +public PlayerId[]? Peers +``` + +#### Field Value + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\[\]? + +### RelayMode + +```csharp +public RelayMode RelayMode +``` + +#### Field Value + + [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) + +### Sender + +```csharp +public PlayerId Sender +``` + +#### Field Value + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md new file mode 100644 index 0000000..0f296e4 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md @@ -0,0 +1,68 @@ +# Enum DisconnectedReason + +Namespace: [ReadyM.Api.Multiplayer.Protocol](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Denotes a reason for being disconnected from the server. + +```csharp +public enum DisconnectedReason : byte +``` + +## Fields + +`Unknown = 0` + +Reason for disconnection was unknown. + + + +`Timeout = 1` + +Connection to the server timed out. + + + +`ClientDisconnected = 2` + +Client disconnected voluntarily. + + + +`IncompatibleVersion = 3` + +The client-side SDK mod version is incompatible with the server. + + + +`ExpiredTicket = 4` + +Connection ticket issued by the server has expired. + + + +`AlreadyConnected = 5` + +Player is already connected to the server in another session. + + + +`ServerFull = 6` + +Server is full and does not allow new connections. + + + +`Kicked = 7` + +Player was kicked from the server by an admin. + + + +`Banned = 8` + +Player was banned from the server by an admin. + + + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md new file mode 100644 index 0000000..a613d24 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md @@ -0,0 +1,13 @@ +# ReadyM.Api.Multiplayer.Protocol.Enums + +### Enums + + [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) + +A unique identifier of a single RPC message type. + + [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) + +Indicates how an RPC message should be relayed to other players in the game. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md new file mode 100644 index 0000000..78121f5 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md @@ -0,0 +1,151 @@ +# Class RpcClassBase + +Namespace: [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Base class for an RPC container. +Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class. + +```csharp +public abstract class RpcClassBase : IHostedService, IDisposable +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[RpcClassBase](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md) + +#### Implements + +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/DI/IHostedService.cs), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### RpcClassBase\(IRpcClient, IRelaySerializer\) + +Base class for an RPC container. +Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class. + +```csharp +protected RpcClassBase(IRpcClient client, IRelaySerializer serializer) +``` + +#### Parameters + +`client` [IRpcClient](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md) + +RPC client to use for sending RPCs. This is injected by the DI container. + +`serializer` [IRelaySerializer](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md) + +Serializer to use for serializing RPC parameters. This is injected by the DI container. + +## Properties + +### EventsCount + +Number of RPC events defined in this class. +Generated by the source generator in derived classes. + +```csharp +protected abstract byte EventsCount { get; } +``` + +#### Property Value + + [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +### Offset + +Event code offset assigned to this RPC class. +Generated by the source generator in derived classes. + +```csharp +protected byte Offset { get; } +``` + +#### Property Value + + [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +### RelayClient + +RPC client to use for sending RPCs. This is injected by the DI container. + +```csharp +protected IRpcClient RelayClient { get; } +``` + +#### Property Value + + [IRpcClient](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md) + +### Serializer + +Serializer to use for serializing RPC parameters. This is injected by the DI container. + +```csharp +protected IRelaySerializer Serializer { get; } +``` + +#### Property Value + + [IRelaySerializer](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md) + +## Methods + +### DeInitRpc\(\) + +De-initializes the RPC class, e.g. by unregistering RPC handlers. +Generated by the source generator in derived classes. + +```csharp +protected abstract void DeInitRpc() +``` + +### Dispose\(\) + +```csharp +public virtual void Dispose() +``` + +### InitRpc\(\) + +Initializes the RPC class, e.g. by registering RPC handlers. +Generated by the source generator in derived classes. + +```csharp +protected abstract void InitRpc() +``` + +### OnScopeStart\(\) + +Called when the DI container is initialized (on game start). +This allows the service to perform any necessary setup at the appropriate time, such as registering event handlers. + +```csharp +public virtual void OnScopeStart() +``` + +### RunOnMainThread\(Action\) + +```csharp +protected void RunOnMainThread(Action callback) +``` + +#### Parameters + +`callback` [Action](https://learn.microsoft.com/dotnet/api/system.action) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md new file mode 100644 index 0000000..cd54dff --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md @@ -0,0 +1,56 @@ +# Interface IRelaySerializer + +Namespace: [ReadyM.Api.Multiplayer.Serialization](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md) +Assembly: ReadyM.Api.Multiplayer.dll + +```csharp +public interface IRelaySerializer +``` + +## Methods + +### DeserializeObject\(NetDataReader\) + +```csharp +object? DeserializeObject(NetDataReader stream) +``` + +#### Parameters + +`stream` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +#### Returns + + [object](https://learn.microsoft.com/dotnet/api/system.object)? + +### DeserializeObject\(NetDataReader\) + +```csharp +T DeserializeObject(NetDataReader stream) +``` + +#### Parameters + +`stream` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +#### Returns + + T + +#### Type Parameters + +`T` + +### SerializeObject\(NetDataWriter, object?\) + +```csharp +void SerializeObject(NetDataWriter writer, object? data) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +`data` [object](https://learn.microsoft.com/dotnet/api/system.object)? + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md new file mode 100644 index 0000000..bd35eef --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md @@ -0,0 +1,7 @@ +# ReadyM.Api.Multiplayer.Serialization + +### Interfaces + + [IRelaySerializer](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Serialization.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Serialization.md new file mode 100644 index 0000000..903ce61 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Serialization.md @@ -0,0 +1,9 @@ +# ReadyM.Api.Serialization + +### Enums + + [SerializableMode](../ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md) + +Defines how a struct should be serialized when using DeriveINetSerializableAttribute. + + diff --git a/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md new file mode 100644 index 0000000..cb69bca --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md @@ -0,0 +1,29 @@ +# Enum SerializableMode + +Namespace: [ReadyM.Api.Serialization](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Serialization.md) +Assembly: ReadyM.Api.dll + +Defines how a struct should be serialized when using DeriveINetSerializableAttribute. + +```csharp +[Flags] +public enum SerializableMode : byte +``` + +## Fields + +`MapFields = 1` + +`MapProperties = 2` + +`MapFieldsAndProperties = 3` + +`MapPrivate = 4` + +`MapPublic = 8` + +`MapInternal = 16` + +`Default = 13` + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md new file mode 100644 index 0000000..f335e9c --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md @@ -0,0 +1,83 @@ +# Class GameplayConfiguration + +Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) +Assembly: WukongMp.Api.dll + +Configuration class for gameplay-related settings and queries. + +```csharp +[Obsolete("Will be replaced with a configuration file in the future.")] +public sealed class GameplayConfiguration +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[GameplayConfiguration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### GameplayConfiguration\(ILogger\) + +Configuration class for gameplay-related settings and queries. + +```csharp +public GameplayConfiguration(ILogger logger) +``` + +#### Parameters + +`logger` [ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger) + +## Properties + +### EnableCustomCameraArmLength + +When enabled, allows for a custom camera arm length to be set, which can affect how close or far the camera is from the character. +This is true in PvP and false in co-op. + +```csharp +public bool EnableCustomCameraArmLength { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsStrongDamageImmueEnabled + +Is immunity to strong damage enabled? +This would prevent characters from being one-shot by powerful attacks, providing a more balanced gameplay experience. +This is true in PvP and false in co-op. + +```csharp +public bool IsStrongDamageImmueEnabled { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsSupportMultiLockEnabled + +Can secondary lock targets (other than the character's body) be locked when using the camera lock-on feature? +This is true in co-op and false in PvP. + +```csharp +public bool IsSupportMultiLockEnabled { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md new file mode 100644 index 0000000..21bed88 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md @@ -0,0 +1,68 @@ +# Class PatchCategory + +Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) +Assembly: WukongMp.Api.dll + +Category for Harmony patches. +Each patch must be assigned to a category. + +```csharp +public static class PatchCategory +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[PatchCategory](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Fields + +### Connected + +Patches in this category are only enabled when the player is connected to the server. +NOTE: In the current version of the SDK, this category is the same as **Global**. +In the future, we will add support for enabling/disabling these patches based on the connection state of the player. + +```csharp +public const string Connected = "Connected" +``` + +#### Field Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Disabled + +Patches in this category are not enabled. + +```csharp +public const string Disabled = "Disabled" +``` + +#### Field Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Global + +Patches in this category are enabled at all times. + +```csharp +public const string Global = "Global" +``` + +#### Field Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md new file mode 100644 index 0000000..7c081cc --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md @@ -0,0 +1,137 @@ +# Struct TamerKind + +Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) +Assembly: WukongMp.Api.dll + +Represents the type of a Tamer (monster). + +```csharp +public readonly struct TamerKind : IEquatable +``` + +#### Implements + +[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### TamerKind\(string\) + +Represents the type of a Tamer (monster). + +```csharp +public TamerKind(string name) +``` + +#### Parameters + +`name` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Must be a valid monster name. + +## Fields + +### Name + +```csharp +public readonly string? Name +``` + +#### Field Value + + [string](https://learn.microsoft.com/dotnet/api/system.string)? + +## Methods + +### Equals\(TamerKind\) + +```csharp +public bool Equals(TamerKind other) +``` + +#### Parameters + +`other` [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equals\(object?\) + +```csharp +public override bool Equals(object? obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### GetHashCode\(\) + +```csharp +public override int GetHashCode() +``` + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### ToString\(\) + +```csharp +public override string ToString() +``` + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Operators + +### operator ==\(TamerKind, TamerKind\) + +```csharp +public static bool operator ==(TamerKind left, TamerKind right) +``` + +#### Parameters + +`left` [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +`right` [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### operator \!=\(TamerKind, TamerKind\) + +```csharp +public static bool operator !=(TamerKind left, TamerKind right) +``` + +#### Parameters + +`left` [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +`right` [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md new file mode 100644 index 0000000..1191e94 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md @@ -0,0 +1,619 @@ +# Class TamerKinds + +Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) +Assembly: WukongMp.Api.dll + +Defines constants for Tamer (monster) types. + +```csharp +public static class TamerKinds +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[TamerKinds](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Fields + +### Acolyte + +```csharp +public static readonly TamerKind Acolyte +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### ApramanaBat + +```csharp +public static readonly TamerKind ApramanaBat +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### AxeStalwart + +```csharp +public static readonly TamerKind AxeStalwart +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### Bandit + +```csharp +public static readonly TamerKind Bandit +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### BlackBear + +```csharp +public static readonly TamerKind BlackBear +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### BlackLoong + +```csharp +public static readonly TamerKind BlackLoong +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### BlackWind + +```csharp +public static readonly TamerKind BlackWind +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### BladeMonk + +```csharp +public static readonly TamerKind BladeMonk +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### BullSergeant + +```csharp +public static readonly TamerKind BullSergeant +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### BullSoldier + +```csharp +public static readonly TamerKind BullSoldier +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### BullStalwart + +```csharp +public static readonly TamerKind BullStalwart +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### CrowDiviner + +```csharp +public static readonly TamerKind CrowDiviner +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### CyanLoong + +```csharp +public static readonly TamerKind CyanLoong +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### DaSheng + +```csharp +public static readonly TamerKind DaSheng +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### DaSheng2 + +```csharp +public static readonly TamerKind DaSheng2 +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### Dear + +```csharp +public static readonly TamerKind Dear +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### EagleSoldier + +```csharp +public static readonly TamerKind EagleSoldier +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### EarthRakshasa + +```csharp +public static readonly TamerKind EarthRakshasa +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### EarthWolf + +```csharp +public static readonly TamerKind EarthWolf +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### Erlang + +```csharp +public static readonly TamerKind Erlang +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### ErlangShen + +```csharp +public static readonly TamerKind ErlangShen +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### FatherOfStones + +```csharp +public static readonly TamerKind FatherOfStones +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### GoldRhino + +```csharp +public static readonly TamerKind GoldRhino +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### GoreEye + +```csharp +public static readonly TamerKind GoreEye +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### KangLoong + +```csharp +public static readonly TamerKind KangLoong +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### KangStar + +```csharp +public static readonly TamerKind KangStar +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### MadTiger + +```csharp +public static readonly TamerKind MadTiger +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### Mantis + +```csharp +public static readonly TamerKind Mantis +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### NonPure + +```csharp +public static readonly TamerKind NonPure +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### NonVoid + +```csharp +public static readonly TamerKind NonVoid +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### PoisonChief + +```csharp +public static readonly TamerKind PoisonChief +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### RatCaptain + +```csharp +public static readonly TamerKind RatCaptain +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### RatSoldier + +```csharp +public static readonly TamerKind RatSoldier +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### RedBoy + +```csharp +public static readonly TamerKind RedBoy +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### RedLoong + +```csharp +public static readonly TamerKind RedLoong +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### SnakePatroller + +```csharp +public static readonly TamerKind SnakePatroller +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### StoneMonkey + +```csharp +public static readonly TamerKind StoneMonkey +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### TigerVanguard + +```csharp +public static readonly TamerKind TigerVanguard +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### TurtleTreasure + +```csharp +public static readonly TamerKind TurtleTreasure +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WhitecladNoble + +```csharp +public static readonly TamerKind WhitecladNoble +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfArcher + +```csharp +public static readonly TamerKind WolfArcher +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfArcherMove + +```csharp +public static readonly TamerKind WolfArcherMove +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfAssassin + +```csharp +public static readonly TamerKind WolfAssassin +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfGuardian + +```csharp +public static readonly TamerKind WolfGuardian +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfScout + +```csharp +public static readonly TamerKind WolfScout +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfSentinel + +```csharp +public static readonly TamerKind WolfSentinel +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfSoldier + +```csharp +public static readonly TamerKind WolfSoldier +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfStalwart + +```csharp +public static readonly TamerKind WolfStalwart +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### WolfSwornsword + +```csharp +public static readonly TamerKind WolfSwornsword +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### YakshaArcher + +```csharp +public static readonly TamerKind YakshaArcher +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### YakshaPatroller + +```csharp +public static readonly TamerKind YakshaPatroller +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### YellowLoong + +```csharp +public static readonly TamerKind YellowLoong +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### YellowSquire + +```csharp +public static readonly TamerKind YellowSquire +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### YellowWind + +```csharp +public static readonly TamerKind YellowWind +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### YinTiger + +```csharp +public static readonly TamerKind YinTiger +``` + +#### Field Value + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +## Methods + +### GetAllValidTamerKinds\(\) + +```csharp +public static IEnumerable GetAllValidTamerKinds() +``` + +#### Returns + + [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md)\> + +### GetTamerKind\(string?\) + +```csharp +public static TamerKind GetTamerKind(string? tamerName) +``` + +#### Parameters + +`tamerName` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +#### Returns + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +### IsValidTamerName\(string\) + +```csharp +public static bool IsValidTamerName(string tamerName) +``` + +#### Parameters + +`tamerName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md new file mode 100644 index 0000000..7525ff4 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md @@ -0,0 +1,43 @@ +# Class UnitPathUtils + +Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) +Assembly: WukongMp.Api.dll + +```csharp +public static class UnitPathUtils +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[UnitPathUtils](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### GetUnitPathName\(TamerKind\) + +Get the path to the unit blueprint for a given tamer kind. This is used for spawning units in the world. + +```csharp +public static string GetUnitPathName(TamerKind tamerKind) +``` + +#### Parameters + +`tamerKind` [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.md new file mode 100644 index 0000000..47670de --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.md @@ -0,0 +1,26 @@ +# WukongMp.Api.Configuration + +### Classes + + [GameplayConfiguration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md) + +Configuration class for gameplay-related settings and queries. + + [PatchCategory](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md) + +Category for Harmony patches. +Each patch must be assigned to a category. + + [TamerKinds](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md) + +Defines constants for Tamer (monster) types. + + [UnitPathUtils](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md) + +### Structs + + [TamerKind](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md) + +Represents the type of a Tamer (monster). + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md new file mode 100644 index 0000000..fda76b8 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md @@ -0,0 +1,59 @@ +# Struct FileInfo + +Namespace: [WukongMp.Api.Https](../WukongMp.Api.Https/WukongMp.Api.Https.md) +Assembly: WukongMp.Api.dll + +```csharp +public readonly struct FileInfo +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### FileInfo\(string, byte\[\]\) + +```csharp +public FileInfo(string name, byte[] content) +``` + +#### Parameters + +`name` [string](https://learn.microsoft.com/dotnet/api/system.string) + +`content` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\] + +## Properties + +### Content + +The binary content of the file. + +```csharp +public byte[] Content { get; } +``` + +#### Property Value + + [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\] + +### Name + +The name of the file. + +```csharp +public string Name { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.md new file mode 100644 index 0000000..6b96b38 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.md @@ -0,0 +1,7 @@ +# WukongMp.Api.Https + +### Structs + + [FileInfo](../WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md new file mode 100644 index 0000000..cfd7d95 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md @@ -0,0 +1,1110 @@ +# Class BuiltinTexts + +Namespace: [WukongMp.Api.Resources](../WukongMp.Api.Resources/WukongMp.Api.Resources.md) +Assembly: WukongMp.Api.dll + +A strongly-typed resource class, for looking up localized strings, etc. + +```csharp +public class BuiltinTexts +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[BuiltinTexts](../WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### AlreadyConnected + +Looks up a localized string similar to Already connected to the server elsewhere.. + +```csharp +public static string AlreadyConnected { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### AntiStallWarning + +Looks up a localized string similar to Engage!. + +```csharp +public static string AntiStallWarning { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Banned + +Looks up a localized string similar to You were banned from the server.. + +```csharp +public static string Banned { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### BlueTeam + +Looks up a localized string similar to Team Blue. + +```csharp +public static string BlueTeam { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### BotName + +Looks up a localized string similar to Bot. + +```csharp +public static string BotName { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraDownControls + +Looks up a localized string similar to Q. + +```csharp +public static string CameraDownControls { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraDownDescription + +Looks up a localized string similar to Down. + +```csharp +public static string CameraDownDescription { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraMoveControls + +Looks up a localized string similar to W S A D. + +```csharp +public static string CameraMoveControls { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraMoveDescription + +Looks up a localized string similar to Move. + +```csharp +public static string CameraMoveDescription { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraRotateControls + +Looks up a localized string similar to RMB. + +```csharp +public static string CameraRotateControls { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraRotateDescription + +Looks up a localized string similar to Rotate. + +```csharp +public static string CameraRotateDescription { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraSwitchControls + +Looks up a localized string similar to ←/→. + +```csharp +public static string CameraSwitchControls { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraSwitchDescription + +Looks up a localized string similar to Switch player. + +```csharp +public static string CameraSwitchDescription { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraUpControls + +Looks up a localized string similar to E. + +```csharp +public static string CameraUpControls { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CameraUpDescription + +Looks up a localized string similar to Up. + +```csharp +public static string CameraUpDescription { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### ChatHelperDescription + +Looks up a localized string similar to ENTER - Type/Send | K - Hide/Show Chat. + +```csharp +public static string ChatHelperDescription { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### ChatHelperNoSendDescription + +Looks up a localized string similar to K - Hide/Show Event Log. + +```csharp +public static string ChatHelperNoSendDescription { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CheatsAreDisabled + +Looks up a localized string similar to Cheats are disabled. + +```csharp +public static string CheatsAreDisabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CheatsDisabled + +Looks up a localized string similar to Cheats disabled. + +```csharp +public static string CheatsDisabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CheatsEnabled + +Looks up a localized string similar to Cheats enabled. + +```csharp +public static string CheatsEnabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CommandHelperDescription + +Looks up a localized string similar to ENTER - Type | F1 - Hide/Show. + +```csharp +public static string CommandHelperDescription { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Connected + +Looks up a localized string similar to Players in zone. + +```csharp +public static string Connected { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### ConnectionRejectedByServer + +Looks up a localized string similar to Connection rejected by server. + +```csharp +public static string ConnectionRejectedByServer { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Culture + +Overrides the current thread's CurrentUICulture property for all +resource lookups using this strongly typed resource class. + +```csharp +public static CultureInfo Culture { get; set; } +``` + +#### Property Value + + [CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo) + +### CustomSpiritCooldown + +Looks up a localized string similar to {0} set spirit cooldown to {1} s. + +```csharp +public static string CustomSpiritCooldown { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Disconnected + +Looks up a localized string similar to Disconnected. + +```csharp +public static string Disconnected { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### ExecutionError + +Looks up a localized string similar to Execution error: {0}. + +```csharp +public static string ExecutionError { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### HelpCommandHeader + +Looks up a localized string similar to Available commands: {0}. + +```csharp +public static string HelpCommandHeader { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### HintCommandsUse + +Looks up a localized string similar to Press F1 to use commands. + +```csharp +public static string HintCommandsUse { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InMultiplayer + +Looks up a localized string similar to In Multiplayer Lobby. + +```csharp +public static string InMultiplayer { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### IncompatibleVersion + +Looks up a localized string similar to Unable to connect. Incompatible SDK version.. + +```csharp +public static string IncompatibleVersion { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InfManaDisabled + +Looks up a localized string similar to {0} disabled infinite mana. + +```csharp +public static string InfManaDisabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InfManaEnabled + +Looks up a localized string similar to {0} enabled infinite mana. + +```csharp +public static string InfManaEnabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InfSpiritDisabled + +Looks up a localized string similar to {0} disabled infinite spirit energy. + +```csharp +public static string InfSpiritDisabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InfSpiritEnabled + +Looks up a localized string similar to {0} enabled infinite spirit energy. + +```csharp +public static string InfSpiritEnabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InfTransformDisabled + +Looks up a localized string similar to {0} disabled infinite transform energy. + +```csharp +public static string InfTransformDisabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InfTransformEnabled + +Looks up a localized string similar to {0} enabled infinite transform energy. + +```csharp +public static string InfTransformEnabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InfVesselDisabled + +Looks up a localized string similar to {0} disabled infinite vessel energy. + +```csharp +public static string InfVesselDisabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InfVesselEnabled + +Looks up a localized string similar to {0} enabled infinite vessel energy. + +```csharp +public static string InfVesselEnabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InstantCooldownDisabled + +Looks up a localized string similar to {0} disabled instant skill cooldown. + +```csharp +public static string InstantCooldownDisabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InstantCooldownEnabled + +Looks up a localized string similar to {0} enabled instant skill cooldown. + +```csharp +public static string InstantCooldownEnabled { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InvalidArgumentFormat + +Looks up a localized string similar to Invalid argument format: {0}. + +```csharp +public static string InvalidArgumentFormat { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InvalidArgumentType + +Looks up a localized string similar to Invalid argument at index {0}. Expected {1}, got {2}. + +```csharp +public static string InvalidArgumentType { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InvalidCommand + +Looks up a localized string similar to Invalid command: {0}. + +```csharp +public static string InvalidCommand { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InvalidCommandFormat + +Looks up a localized string similar to Invalid command format: {0}. + +```csharp +public static string InvalidCommandFormat { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InvalidCooldown + +Looks up a localized string similar to Invalid cooldown value. + +```csharp +public static string InvalidCooldown { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InvalidUnitName + +Looks up a localized string similar to Invalid unit name: {0}. + +```csharp +public static string InvalidUnitName { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### InvalidUnitsCount + +Looks up a localized string similar to Invalid number of units {0}. + +```csharp +public static string InvalidUnitsCount { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### JoinOtherPlayersToProceed + +Looks up a localized string similar to Join other players to proceed. + +```csharp +public static string JoinOtherPlayersToProceed { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Kicked + +Looks up a localized string similar to You were kicked from the server.. + +```csharp +public static string Kicked { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### MasterClient + +Looks up a localized string similar to Master client: {0}. + +```csharp +public static string MasterClient { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### MissingPak + +Looks up a localized string similar to WukongMP.pak is missing. + +```csharp +public static string MissingPak { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### More + +Looks up a localized string similar to more. + +```csharp +public static string More { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Ping + +Looks up a localized string similar to Ping. + +```csharp +public static string Ping { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PingUnits + +Looks up a localized string similar to ms. + +```csharp +public static string PingUnits { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerCooldown + +Looks up a localized string similar to {0} set cooldown multiplier to {1}. + +```csharp +public static string PlayerCooldown { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerGaveUp + +Looks up a localized string similar to {0} gave up. + +```csharp +public static string PlayerGaveUp { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerIsNotReady + +Looks up a localized string similar to {0} is not ready. + +```csharp +public static string PlayerIsNotReady { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerIsReady + +Looks up a localized string similar to {0} is ready. + +```csharp +public static string PlayerIsReady { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerJoined + +Looks up a localized string similar to {0} has joined!. + +```csharp +public static string PlayerJoined { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerKilledPlayer + +Looks up a localized string similar to {0} killed {1}. + +```csharp +public static string PlayerKilledPlayer { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerLeft + +Looks up a localized string similar to {0} has left!. + +```csharp +public static string PlayerLeft { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerRequestedRebirth + +Looks up a localized string similar to {0} requested rebirth. + +```csharp +public static string PlayerRequestedRebirth { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerSpawned + +Looks up a localized string similar to {0} spawned {1} {2}. + +```csharp +public static string PlayerSpawned { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PressToBeNotReady + +Looks up a localized string similar to Press J to be not ready. + +```csharp +public static string PressToBeNotReady { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PressToBeReady + +Looks up a localized string similar to Press J to be ready. + +```csharp +public static string PressToBeReady { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PressToCancelMatch + +Looks up a localized string similar to Press I to cancel match. + +```csharp +public static string PressToCancelMatch { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PressToPlayWithBots + +Looks up a localized string similar to Press I to play with bots. + +```csharp +public static string PressToPlayWithBots { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PressToSwitchTeam + +Looks up a localized string similar to Press L to switch team. + +```csharp +public static string PressToSwitchTeam { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Ready + +Looks up a localized string similar to Ready. + +```csharp +public static string Ready { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### RedTeam + +Looks up a localized string similar to Team Red. + +```csharp +public static string RedTeam { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### ResourceManager + +Returns the cached ResourceManager instance used by this class. + +```csharp +public static ResourceManager ResourceManager { get; } +``` + +#### Property Value + + [ResourceManager](https://learn.microsoft.com/dotnet/api/system.resources.resourcemanager) + +### RoundCount + +Looks up a localized string similar to Round {0} of {1}. + +```csharp +public static string RoundCount { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### RoundDraw + +Looks up a localized string similar to Round ended. Draw. + +```csharp +public static string RoundDraw { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### RoundEndedWinner + +Looks up a localized string similar to Round ended. {0} won. + +```csharp +public static string RoundEndedWinner { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### ServerFull + +Looks up a localized string similar to Server is full, try again later.. + +```csharp +public static string ServerFull { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### SeverePacketLossDetected + +Looks up a localized string similar to Severe packet loss detected!. + +```csharp +public static string SeverePacketLossDetected { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### SoftlockDetected + +Looks up a localized string similar to Softlock. Use /softlock command to respawn. + +```csharp +public static string SoftlockDetected { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### Spectators + +Looks up a localized string similar to Spectators. + +```csharp +public static string Spectators { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### StallingMessage + +Looks up a localized string similar to Stalling - losing HP. + +```csharp +public static string StallingMessage { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### StartingGame + +Looks up a localized string similar to Starting PvP match. + +```csharp +public static string StartingGame { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### TooFewArguments + +Looks up a localized string similar to Too few arguments: min {0}, actual {1}. + +```csharp +public static string TooFewArguments { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### TooManyArguments + +Looks up a localized string similar to Too many arguments: max {0}, actual {1}. + +```csharp +public static string TooManyArguments { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### TournamentDraw + +Looks up a localized string similar to Draw. + +```csharp +public static string TournamentDraw { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### TournamentEndedWinner + +Looks up a localized string similar to Winner: {0}. + +```csharp +public static string TournamentEndedWinner { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### UnrecognizedCommand + +Looks up a localized string similar to Unrecognized command: {0}. + +```csharp +public static string UnrecognizedCommand { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### WaitForEnd + +Looks up a localized string similar to Wait for the match to end. + +```csharp +public static string WaitForEnd { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### WaitForOtherPlayers + +Looks up a localized string similar to Wait for other players. + +```csharp +public static string WaitForOtherPlayers { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### WaitForOtherPlayersCount + +Looks up a localized string similar to Wait for other players ({0}/{1}). + +```csharp +public static string WaitForOtherPlayersCount { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### YouAreReady + +Looks up a localized string similar to You are ready. + +```csharp +public static string YouAreReady { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.md new file mode 100644 index 0000000..a8ba061 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.md @@ -0,0 +1,9 @@ +# WukongMp.Api.Resources + +### Classes + + [BuiltinTexts](../WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md) + +A strongly-typed resource class, for looking up localized strings, etc. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md new file mode 100644 index 0000000..c3d4a48 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md @@ -0,0 +1,57 @@ +# Class CountdownWidget + +Namespace: [WukongMp.Api.UI](../WukongMp.Api.UI/WukongMp.Api.UI.md) +Assembly: WukongMp.Api.dll + +```csharp +public class CountdownWidget : GameWidgetBase +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[GameWidgetBase](../WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md) ← +[CountdownWidget](../WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md) + +#### Inherited Members + +[GameWidgetBase.GameWidget](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_GameWidget), +[GameWidgetBase.Initialize\(\)](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_Initialize), +[GameWidgetBase.PostInitialize\(\)](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_PostInitialize), +[GameWidgetBase.SetVisibility\(bool\)](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_SetVisibility\_System\_Boolean\_), +[GameWidgetBase.Deinitialize\(\)](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_Deinitialize), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### CountdownWidget\(\) + +```csharp +public CountdownWidget() +``` + +## Methods + +### PostInitialize\(\) + +```csharp +protected override void PostInitialize() +``` + +### SetText\(int\) + +```csharp +public void SetText(int seconds) +``` + +#### Parameters + +`seconds` [int](https://learn.microsoft.com/dotnet/api/system.int32) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md new file mode 100644 index 0000000..20ce3ac --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md @@ -0,0 +1,83 @@ +# Class GameMessageWidget + +Namespace: [WukongMp.Api.UI](../WukongMp.Api.UI/WukongMp.Api.UI.md) +Assembly: WukongMp.Api.dll + +```csharp +public class GameMessageWidget : GameWidgetBase +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[GameWidgetBase](../WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md) ← +[GameMessageWidget](../WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md) + +#### Inherited Members + +[GameWidgetBase.GameWidget](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_GameWidget), +[GameWidgetBase.Initialize\(\)](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_Initialize), +[GameWidgetBase.PostInitialize\(\)](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_PostInitialize), +[GameWidgetBase.SetVisibility\(bool\)](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_SetVisibility\_System\_Boolean\_), +[GameWidgetBase.Deinitialize\(\)](WukongMp.Api.UI.GameWidgetBase.md\#WukongMp\_Api\_UI\_GameWidgetBase\_Deinitialize), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### GameMessageWidget\(\) + +```csharp +public GameMessageWidget() +``` + +## Methods + +### ClearMessages\(\) + +```csharp +public void ClearMessages() +``` + +### PostInitialize\(\) + +```csharp +protected override void PostInitialize() +``` + +### SetMainText\(string\) + +```csharp +public void SetMainText(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +### SetSecondText\(string\) + +```csharp +public void SetSecondText(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +### SetThirdText\(string\) + +```csharp +public void SetThirdText(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md new file mode 100644 index 0000000..70b68d9 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md @@ -0,0 +1,99 @@ +# Class GameWidgetBase + +Namespace: [WukongMp.Api.UI](../WukongMp.Api.UI/WukongMp.Api.UI.md) +Assembly: WukongMp.Api.dll + +Base class for UI widgets defined in .pak files. + +```csharp +public abstract class GameWidgetBase +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[GameWidgetBase](../WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md) + +#### Derived + +[CountdownWidget](../WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md), +[GameMessageWidget](../WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### GameWidgetBase\(string\) + +Base class for UI widgets defined in .pak files. + +```csharp +protected GameWidgetBase(string path) +``` + +#### Parameters + +`path` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The path to the widget, relative to the "Content/UI" folder in the .pak files. For example, for a widget located at "Content/UI/MyWidget.uasset", the path would be "MyWidget". + +## Fields + +### GameWidget + +```csharp +protected UUserWidget? GameWidget +``` + +#### Field Value + + UUserWidget? + +## Methods + +### Deinitialize\(\) + +Removes the widget from the viewport and sets the reference to null. + +```csharp +public void Deinitialize() +``` + +### Initialize\(\) + +Initializes the widget by trying to find it first, and if it doesn't exist, spawns a new one. + +```csharp +public void Initialize() +``` + +### PostInitialize\(\) + +```csharp +protected abstract void PostInitialize() +``` + +### SetVisibility\(bool\) + +Set the visibility of the widget. +This requires the widget to be initialized first, otherwise it will do nothing. + +```csharp +public virtual void SetVisibility(bool visible) +``` + +#### Parameters + +`visible` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +Whether the widget should be visible or not. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.md new file mode 100644 index 0000000..c0e28c4 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.md @@ -0,0 +1,13 @@ +# WukongMp.Api.UI + +### Classes + + [CountdownWidget](../WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md) + + [GameMessageWidget](../WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md) + + [GameWidgetBase](../WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md) + +Base class for UI widgets defined in .pak files. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md new file mode 100644 index 0000000..7214493 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md @@ -0,0 +1,63 @@ +# Class GameUtils + +Namespace: [WukongMp.Api.WukongUtils](../WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md) +Assembly: WukongMp.Api.dll + +Provides utility methods for directly interacting with the game world, bypassing the SDK. + +```csharp +public static class GameUtils +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[GameUtils](../WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Remarks + +These methods are not guaranteed to be stable across game updates, and might be removed in the future. + +## Methods + +### GetControlledPawn\(\) + +```csharp +public static BGUPlayerCharacterCS? GetControlledPawn() +``` + +#### Returns + + BGUPlayerCharacterCS? + +### GetPlayerController\(\) + +```csharp +public static BGP_PlayerControllerB1? GetPlayerController() +``` + +#### Returns + + BGP\_PlayerControllerB1? + +### GetWorld\(\) + +```csharp +public static UWorld? GetWorld() +``` + +#### Returns + + UWorld? + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md new file mode 100644 index 0000000..c7b5a2a --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md @@ -0,0 +1,9 @@ +# WukongMp.Api.WukongUtils + +### Classes + + [GameUtils](../WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md) + +Provides utility methods for directly interacting with the game world, bypassing the SDK. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.EcsExtensions.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.EcsExtensions.md new file mode 100644 index 0000000..f476633 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.EcsExtensions.md @@ -0,0 +1,53 @@ +# Class EcsExtensions + +Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) +Assembly: WukongMp.Api.dll + +```csharp +public static class EcsExtensions +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[EcsExtensions](../WukongMp.Api/WukongMp.Api.EcsExtensions.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### GetComponent\(BGUActorBaseCS\) + +Get a **game ECS** component of type T from the given actor. + +```csharp +public static T? GetComponent(this BGUActorBaseCS actor) where T : UActorCompBaseCS +``` + +#### Parameters + +`actor` BGUActorBaseCS + +The actor to get the component from. + +#### Returns + + T? + +The component of type T if found; otherwise, null. + +#### Type Parameters + +`T` + +The type of the component to get. Must be a subclass of **UActorCompBaseCS**. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md new file mode 100644 index 0000000..258ccf7 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md @@ -0,0 +1,108 @@ +# Interface IWukongSaveApi + +Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) +Assembly: WukongMp.Api.dll + +API for managing world and player saves in Wukong Multiplayer. +Supports co-op style operations where each player has their own save file, and there's a shared world save file for all players. + +```csharp +public interface IWukongSaveApi +``` + +## Methods + +### DownloadPlayerSaveAsync\(CancellationToken\) + +Downloads the player's save file from the server. +This operation is expected to return the most recent save file for the player, if any. + +```csharp +Task DownloadPlayerSaveAsync(CancellationToken ct = default) +``` + +#### Parameters + +`ct` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) + +Cancellation token to cancel the download operation. + +#### Returns + + [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](../WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md)?\> + +The content of the player's save file if the download was successful, null otherwise. + +### DownloadWorldSaveAsync\(CancellationToken\) + +Downloads the world save file from the server. + +```csharp +Task DownloadWorldSaveAsync(CancellationToken ct = default) +``` + +#### Parameters + +`ct` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) + +Cancellation token to cancel the download operation. + +#### Returns + + [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](../WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md)?\> + +The content of the world save file if the download was successful, null otherwise. + +### UploadPlayerSaveAsync\(byte\[\], CancellationToken\) + +Uploads the player's save file to the server. +This operation always overwrites the existing save file on the server, if any. +At this point, the server is expected to keep only the most recent save file for each player. + +```csharp +Task UploadPlayerSaveAsync(byte[] content, CancellationToken ct = default) +``` + +#### Parameters + +`content` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\] + +The content of the save file to upload. + +`ct` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) + +Cancellation token to cancel the upload operation. + +#### Returns + + [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\> + +true if the save was uploaded successfully, false otherwise. + +### UploadWorldSaveAsync\(byte\[\], CancellationToken\) + +Uploads the world save file to the server. +This operation always overwrites the existing world save file on the server, if any. +At this point, the server is expected to keep only the most recent world save file for all players. + +```csharp +Task UploadWorldSaveAsync(byte[] content, CancellationToken ct = default) +``` + +#### Parameters + +`content` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\] + +The content of the world save file to upload. + +`ct` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) + +Cancellation token to cancel the upload operation. + +#### Returns + + [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\> + +true if the save was uploaded successfully, false otherwise. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.Logging.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.Logging.md new file mode 100644 index 0000000..013781e --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.Logging.md @@ -0,0 +1,214 @@ +# Class Logging + +Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) +Assembly: WukongMp.Api.dll + +Provides static logging methods that can be used throughout the codebase without needing to inject a logger instance. + +```csharp +public static class Logging +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Logging](../WukongMp.Api/WukongMp.Api.Logging.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### LogCritical\(string?, params object?\[\]\) + +Logs a critical error message. +This method is active in all build configurations and is suitable for logging critical errors or exceptions that occur during the mod's operation, indicating a severe failure that may result in shutdown or data loss. + +```csharp +public static void LogCritical(string? message, params object?[] args) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The message template to log. Use structured logging syntax (e.g., "User {UserId} logged in"). + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. + +### LogCritical\(Exception?, string?, params object?\[\]\) + +Logs a critical error message along with an exception. +This method is active in all build configurations and is suitable for logging critical errors or exceptions that occur during the mod's operation, providing additional context from the exception and indicating a severe failure that may result in shutdown or data loss. + +```csharp +public static void LogCritical(Exception? ex, string? message = null, params object?[] args) +``` + +#### Parameters + +`ex` [Exception](https://learn.microsoft.com/dotnet/api/system.exception)? + +The exception to log. This can be null if no exception is being logged, but the method will still log the message and arguments. + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The message template to log. Use structured logging syntax (e.g., "User {UserId} logged in"). This parameter is optional and can be null, in which case only the exception will be logged, but the log entry will still be marked as critical. + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. This parameter is optional and can be empty if no additional context is needed. + +### LogDebug\(string?, params object?\[\]\) + +Logs a debug message. +This method is only active in DEBUG builds and will be stripped out in release builds to avoid performance overhead. + +```csharp +public static void LogDebug(string? message, params object?[] args) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The message template to log. Use structured logging syntax (e.g., "User {UserId} logged in"). + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. + +### LogError\(string?, params object?\[\]\) + +Logs an error message. +This method is active in all build configurations and is suitable for logging errors or exceptions that occur during the mod's operation. + +```csharp +public static void LogError(string? message, params object?[] args) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The message template to log. Use structured logging syntax (e.g., "User {UserId} logged in"). + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. + +### LogError\(Exception?, string?, params object?\[\]\) + +Logs an error message along with an exception. +This method is active in all build configurations and is suitable for logging errors or exceptions that occur during the mod's operation, providing additional context from the exception. + +```csharp +public static void LogError(Exception? ex, string? message = null, params object?[] args) +``` + +#### Parameters + +`ex` [Exception](https://learn.microsoft.com/dotnet/api/system.exception)? + +The exception to log. This can be null if no exception is being logged, but the method will still log the message and arguments. + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The message template to log. Use structured logging syntax (e.g., "User {UserId} logged in"). This parameter is optional and can be null, in which case only the exception will be logged. + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. This parameter is optional and can be empty if no additional context is needed. + +### LogException\(Exception, string?, params object?\[\]\) + +Logs an exception with an optional message and arguments. +This method is a convenience wrapper around LogError that allows you to log an exception along with a custom message and structured arguments. +If the message is null, it will default to "An exception occurred". +This method is active in all build configurations and is suitable for logging exceptions that occur during the mod's operation, providing additional context from the exception and any relevant information through the message and arguments. + +```csharp +public static void LogException(Exception ex, string? message = null, params object?[] args) +``` + +#### Parameters + +`ex` [Exception](https://learn.microsoft.com/dotnet/api/system.exception) + +The exception to log. + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +An optional message template to log alongside the exception. Use structured logging syntax (e.g., "User {UserId} logged in"). If null, a default message will be used. + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. This parameter is optional and can be empty if no additional context is needed. + +### LogInformation\(string?, params object?\[\]\) + +Logs an informational message. +This method is active in all build configurations and is suitable for logging general information about the mod's operation. + +```csharp +public static void LogInformation(string? message, params object?[] args) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The message template to log. Use structured logging syntax (e.g., "User {UserId} logged in"). + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. + +### LogTrace\(string?, params object?\[\]\) + +Logs a trace message. +This method is only active in DEBUG builds and will be stripped out in release builds to avoid performance overhead. + +```csharp +public static void LogTrace(string? message, params object?[] args) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The message template to log. Use structured logging syntax (e.g., "User {UserId} logged in"). + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. + +### LogWarning\(string?, params object?\[\]\) + +Logs a warning message. +This method is active in all build configurations and is suitable for logging potential issues or important events that are not necessarily errors. + +```csharp +public static void LogWarning(string? message, params object?[] args) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The message template to log. Use structured logging syntax (e.g., "User {UserId} logged in"). + +`args` [object](https://learn.microsoft.com/dotnet/api/system.object)?\[\] + +The arguments to be formatted into the message template. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.USharpExtensions.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.USharpExtensions.md new file mode 100644 index 0000000..9c73562 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.USharpExtensions.md @@ -0,0 +1,117 @@ +# Class USharpExtensions + +Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) +Assembly: WukongMp.Api.dll + +Extension methods for Unreal Engine types and other helper methods. + +```csharp +public static class USharpExtensions +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[USharpExtensions](../WukongMp.Api/WukongMp.Api.USharpExtensions.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### Equals\(float, float, float\) + +```csharp +public static bool Equals(this float a, float b, float tolerance) +``` + +#### Parameters + +`a` [float](https://learn.microsoft.com/dotnet/api/system.single) + +`b` [float](https://learn.microsoft.com/dotnet/api/system.single) + +`tolerance` [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsNullOrDestroyed\(UObject?\) + +```csharp +public static bool IsNullOrDestroyed(this UObject? obj) +``` + +#### Parameters + +`obj` UObject? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ToFRotator\(Vector3\) + +```csharp +public static FRotator ToFRotator(this Vector3 vector) +``` + +#### Parameters + +`vector` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +#### Returns + + FRotator + +### ToFVector\(Vector3\) + +```csharp +public static FVector ToFVector(this Vector3 vector) +``` + +#### Parameters + +`vector` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +#### Returns + + FVector + +### ToVector3\(FVector\) + +```csharp +public static Vector3 ToVector3(this FVector vector) +``` + +#### Parameters + +`vector` FVector + +#### Returns + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +### ToVector3\(FRotator\) + +```csharp +public static Vector3 ToVector3(this FRotator vector) +``` + +#### Parameters + +`vector` FRotator + +#### Returns + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.md new file mode 100644 index 0000000..0231dbf --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Api/WukongMp.Api.md @@ -0,0 +1,34 @@ +# WukongMp.Api + +### Namespaces + + [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) + + [WukongMp.Api.Https](../WukongMp.Api.Https/WukongMp.Api.Https.md) + + [WukongMp.Api.Resources](../WukongMp.Api.Resources/WukongMp.Api.Resources.md) + + [WukongMp.Api.UI](../WukongMp.Api.UI/WukongMp.Api.UI.md) + + [WukongMp.Api.WukongUtils](../WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md) + +### Classes + + [EcsExtensions](../WukongMp.Api/WukongMp.Api.EcsExtensions.md) + + [Logging](../WukongMp.Api/WukongMp.Api.Logging.md) + +Provides static logging methods that can be used throughout the codebase without needing to inject a logger instance. + + [USharpExtensions](../WukongMp.Api/WukongMp.Api.USharpExtensions.md) + +Extension methods for Unreal Engine types and other helper methods. + +### Interfaces + + [IWukongSaveApi](../WukongMp.Api/WukongMp.Api.IWukongSaveApi.md) + +API for managing world and player saves in Wukong Multiplayer. +Supports co-op style operations where each player has their own save file, and there's a shared world save file for all players. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md new file mode 100644 index 0000000..2697cdb --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md @@ -0,0 +1,60 @@ +# Interface IWukongChatApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +API for interacting with the in-game chat. + +```csharp +public interface IWukongChatApi +``` + +## Methods + +### SendPlayerMessage\(string\) + +Sends a message to the in-game chat, as if the player wrote it. + +```csharp +void SendPlayerMessage(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The message to send. + +### SendServerMessage\(string\) + +Sends a message to the in-game chat without a player name attached to it. + +```csharp +void SendServerMessage(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The message to send. + +### ShowLocalMessage\(string, FLinearColor\) + +Adds a message to the in-game chat, visible only to the local player. + +```csharp +void ShowLocalMessage(string message, FLinearColor color) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The message to add to the chat. + +`color` FLinearColor + +The color of the message in the chat. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md new file mode 100644 index 0000000..f4e3120 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md @@ -0,0 +1,90 @@ +# Interface IWukongCheatsApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +Provides methods and properties for enabling and managing cheats in the game. + +```csharp +public interface IWukongCheatsApi +``` + +## Properties + +### CheatsAllowed + +Gets a value indicating whether cheats are allowed. + +```csharp +bool CheatsAllowed { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +## Methods + +### ResetCooldowns\(\) + +Resets all cooldowns for the player. + +```csharp +void ResetCooldowns() +``` + +### ResetMana\(\) + +Resets the player's mana to its maximum value. + +```csharp +void ResetMana() +``` + +### SetSpritCooldownTime\(float\) + +Sets the cooldown time for the player's spirit abilities. + +```csharp +void SetSpritCooldownTime(float spiritCooldownTime) +``` + +#### Parameters + +`spiritCooldownTime` [float](https://learn.microsoft.com/dotnet/api/system.single) + +The cooldown time to set, in seconds. + +### ToggleInfiniteMana\(\) + +Toggles infinite mana for the player. + +```csharp +void ToggleInfiniteMana() +``` + +### ToggleInfiniteTransform\(\) + +Toggles infinite transformation for the player. + +```csharp +void ToggleInfiniteTransform() +``` + +### ToggleInfiniteVessel\(\) + +Toggles infinite vessel usage for the player. + +```csharp +void ToggleInfiniteVessel() +``` + +### ToggleNoSkillsCooldown\(\) + +Toggles no cooldowns for skills for the player. + +```csharp +void ToggleNoSkillsCooldown() +``` + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md new file mode 100644 index 0000000..f43eaee --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md @@ -0,0 +1,200 @@ +# Interface IWukongConfigurationApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +Provides ways to configure various aspects othe game's behavior. +Will be replaced in the future with more specific configuration APIs, but for now serves as a catch-all for miscellaneous configuration options that don't fit anywhere else. +Hence, we do not document the individual configuration options here, as they are all subject to change and may be removed in the future without a major version bump. + +```csharp +public interface IWukongConfigurationApi +``` + +## Properties + +### DeleteDestroyedTamersFromEcs + +```csharp +bool DeleteDestroyedTamersFromEcs { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### DisableCutscenes + +```csharp +bool DisableCutscenes { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### EnableCustomCameraArmLength + +```csharp +bool EnableCustomCameraArmLength { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsStrongDamageImmueEnabled + +```csharp +bool IsStrongDamageImmueEnabled { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsSupportMultiLockEnabled + +```csharp +bool IsSupportMultiLockEnabled { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### OverrideLocalPlayerTeamFromGlobalEntity + +```csharp +bool OverrideLocalPlayerTeamFromGlobalEntity { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### SyncTamerTeamFromGameToEcs + +```csharp +bool SyncTamerTeamFromGameToEcs { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +## Methods + +### ClearDisableTamerAttackQuery\(\) + +```csharp +void ClearDisableTamerAttackQuery() +``` + +### ClearIsAreaOverlapDisabledQuery\(\) + +```csharp +void ClearIsAreaOverlapDisabledQuery() +``` + +### ClearIsInteractionAllowedQuery\(\) + +```csharp +void ClearIsInteractionAllowedQuery() +``` + +### ClearIsPlayerInBattleQuery\(\) + +```csharp +void ClearIsPlayerInBattleQuery() +``` + +### ClearIsSkillEnabledQuery\(\) + +```csharp +void ClearIsSkillEnabledQuery() +``` + +### ClearIsTamerNotSynchronizedQuery\(\) + +```csharp +void ClearIsTamerNotSynchronizedQuery() +``` + +### GetLaunchParameter\(string, string\) + +```csharp +string GetLaunchParameter(string key, string defaultValue) +``` + +#### Parameters + +`key` [string](https://learn.microsoft.com/dotnet/api/system.string) + +`defaultValue` [string](https://learn.microsoft.com/dotnet/api/system.string) + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### SetDisableTamerAttackQuery\(Func\) + +```csharp +void SetDisableTamerAttackQuery(Func shouldDisableTamerAttack) +``` + +#### Parameters + +`shouldDisableTamerAttack` [Func](https://learn.microsoft.com/dotnet/api/system.func-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\> + +### SetIsAreaOverlapDisabledQuery\(Func\) + +```csharp +void SetIsAreaOverlapDisabledQuery(Func isAreaOverlapDisabled) +``` + +#### Parameters + +`isAreaOverlapDisabled` [Func](https://learn.microsoft.com/dotnet/api/system.func-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [bool](https://learn.microsoft.com/dotnet/api/system.boolean)\> + +### SetIsInteractionAllowedQuery\(Func\) + +```csharp +void SetIsInteractionAllowedQuery(Func isInteractAllowed) +``` + +#### Parameters + +`isInteractAllowed` [Func](https://learn.microsoft.com/dotnet/api/system.func-2) + +### SetIsPlayerInBattleQuery\(Func\) + +```csharp +void SetIsPlayerInBattleQuery(Func isPlayerInBattle) +``` + +#### Parameters + +`isPlayerInBattle` [Func](https://learn.microsoft.com/dotnet/api/system.func-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\> + +### SetIsSkillEnabledQuery\(Func\) + +```csharp +void SetIsSkillEnabledQuery(Func isSkillEnabled) +``` + +#### Parameters + +`isSkillEnabled` [Func](https://learn.microsoft.com/dotnet/api/system.func-2)<[int](https://learn.microsoft.com/dotnet/api/system.int32), [bool](https://learn.microsoft.com/dotnet/api/system.boolean)\> + +### SetIsTamerNotSynchronizedQuery\(Func\) + +```csharp +void SetIsTamerNotSynchronizedQuery(Func isTamerNotSynchronized) +``` + +#### Parameters + +`isTamerNotSynchronized` [Func](https://learn.microsoft.com/dotnet/api/system.func-2)<[string](https://learn.microsoft.com/dotnet/api/system.string), [bool](https://learn.microsoft.com/dotnet/api/system.boolean)\> + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md new file mode 100644 index 0000000..df05d52 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md @@ -0,0 +1,97 @@ +# Interface IWukongConsoleApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +API for the in-game console (F1). + +```csharp +public interface IWukongConsoleApi +``` + +## Methods + +### AddCommand\(string, ConsoleCommand, IEnumerable?\) + +Registers a console command that all players in the session can run. + +```csharp +void AddCommand(string commandName, ConsoleCommand command, IEnumerable? availableFirstParams = null) +``` + +#### Parameters + +`commandName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Text the player types to invoke the command (e.g. "spawn"). + +`command` [ConsoleCommand](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Command/ConsoleCommand.cs) + +Handler that runs when the command is executed. + +`availableFirstParams` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>? + +Optional fixed list of autocomplete suggestions for the command's first parameter. +The list is captured once at registration, so use this overload when the +suggestions never change, e.g. a known set of spawnables: "spawn wolf_sentinel". + +### AddCommand\(string, ConsoleCommand, Func\>\) + +Registers a console command that all players in the session can run. + +```csharp +void AddCommand(string commandName, ConsoleCommand command, Func> availableFirstParams) +``` + +#### Parameters + +`commandName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Text the player types to invoke the command (e.g. "kick"). + +`command` [ConsoleCommand](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Command/ConsoleCommand.cs) + +Handler that runs when the command is executed. + +`availableFirstParams` [Func](https://learn.microsoft.com/dotnet/api/system.func-1)<[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[string](https://learn.microsoft.com/dotnet/api/system.string)\>\> + +A factory that produces autocomplete suggestions for the command's first +parameter. It is invoked each time the console requests suggestions, so use this +overload when the values depend on live state, e.g. currently connected players +or spawned entities. + +### HasCommand\(string\) + +Checks if a command with the given name is already registered in the console. + +```csharp +bool HasCommand(string commandName) +``` + +#### Parameters + +`commandName` [string](https://learn.microsoft.com/dotnet/api/system.string) + +Name of the command to check. + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +true if a command with the given name is registered, false otherwise. + +### LogMessage\(string\) + +Logs a message to the in-game console. This can be used to provide feedback to the player after executing a command, or to log important information that the player should see. + +```csharp +void LogMessage(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The message to log. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongEventApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongEventApi.md new file mode 100644 index 0000000..82a8365 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongEventApi.md @@ -0,0 +1,270 @@ +# Interface IWukongEventApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +Provides events related to gameplay, player actions, and multiplayer interactions in Wukong Multiplayer. + +```csharp +public interface IWukongEventApi +``` + +### OnBeginPlayGameplayLevel + +Fired when the player enters a gameplay level. + +```csharp +event Action? OnBeginPlayGameplayLevel +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action)? + +### OnConnected + +Fired when any player connects to the server. + +```csharp +event Action? OnConnected +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\>? + +### OnDisconnected + +Fired when any player disconnects from the server, either voluntarily or involuntarily. + +```csharp +event Action? OnDisconnected +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs), [DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\>? + +### OnEndPlayGameplayLevel + +Fired when the player leaves a gameplay level, either by exiting to the main menu or by loading another level. + +```csharp +event Action? OnEndPlayGameplayLevel +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action)? + +### OnExitLevel + +Fired when the player exits a level, either by exiting to the main menu or by loading another level. + +```csharp +event Action? OnExitLevel +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action)? + +### OnJoinedArea + +Fired when the player enters an area. + +```csharp +event Action? OnJoinedArea +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)\>? + +### OnLanguageChanged + +Fired when the game's language is changed, either by the player changing it in the settings or by the game automatically setting it based on the player's system language. + +```csharp +event Action? OnLanguageChanged +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[CultureInfo](https://learn.microsoft.com/dotnet/api/system.globalization.cultureinfo)\>? + +### OnLeftArea + +Fired when the player leaves an area. + +```csharp +event Action? OnLeftArea +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)\>? + +### OnLevelLoaded + +Fired when a gameplay level is loaded, but before the loading screen is closed. +This is a good event to use for initializing custom widgets, so that they are ready to be shown as soon as the loading screen is closed. + +```csharp +event Action? OnLevelLoaded +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action)? + +### OnLoadingScreenClose + +Fired when the loading screen is closed after loading a gameplay level. + +```csharp +event Action? OnLoadingScreenClose +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action)? + +### OnLocalPlayerBeforeRebirth + +Fired when the local player's character is about to rebirth. +This is fired before the rebirth actually happens, so the player's character will still be dead at this point. + +```csharp +event Action? OnLocalPlayerBeforeRebirth +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action)? + +### OnLocalPlayerChangedSpectator + +Fired when the local player changes spectator mode, either by entering or exiting spectator mode. + +```csharp +event Action? OnLocalPlayerChangedSpectator +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\>? + +### OnMainCharacterEntityInitialized + +Fired when the player's main character ECS entity is initialized and ready. +This is fired before **OnPlayerPawnSpawned**, so it can be used to set up things that need to be ready before the pawn is spawned. + +```csharp +event Action? OnMainCharacterEntityInitialized +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)\>? + +### OnMonsterDead + +Fired when any monster dies. +The first parameter is the monster that died, and the second parameter is the entity that killed it (if applicable). + +```csharp +event Action? OnMonsterDead +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md), [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md)?\>? + +### OnMonsterDestroyed + +Fired when a monster is removed from the game world, either by dying or by being despawned for other reasons (e.g. the player leaving the area). + +```csharp +event Action? OnMonsterDestroyed +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md)\>? + +### OnMonsterSpawned + +Fired when a monster is spawned in the game world, either by being spawned by the player or by being spawned by the game itself. + +```csharp +event Action? OnMonsterSpawned +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md)\>? + +### OnOtherPlayerInsideArea + +Fired when another player enters the same area as the local player. + +```csharp +event Action? OnOtherPlayerInsideArea +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)\>? + +### OnOtherPlayerOutsideArea + +Fired when another player leaves the area that the local player is in. + +```csharp +event Action? OnOtherPlayerOutsideArea +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)\>? + +### OnPlayerChangedTeam + +Fired when the player changes team, either by rebirthing or by joining a game in progress. + +```csharp +event Action? OnPlayerChangedTeam +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)\>? + +### OnPlayerDead + +Fired when any player dies. +The first parameter is the player character that died, and the second parameter is the entity that killed them (if applicable). + +```csharp +event Action? OnPlayerDead +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md), [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md)?\>? + +### OnPlayerPawnSpawned + +Fired when the player's pawn (the in-game character they control) is spawned. +This can happen when you enter a new area, or when another player connects to the game and their pawn is spawned for you. + +```csharp +event Action? OnPlayerPawnSpawned +``` + +#### Event Type + + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)\>? + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md new file mode 100644 index 0000000..8220cf1 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md @@ -0,0 +1,35 @@ +# Interface IWukongFileApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +Provides methods related to manipulating files for Wukong mods, such as save files. + +```csharp +public interface IWukongFileApi +``` + +## Methods + +### GetModDirectory\(\) + +Get the absolute path to the mod's directory. +Useful for finding files packaged with the mod. + +```csharp +string GetModDirectory() where T : ModBase +``` + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +The absolute path to the mod's directory. + +#### Type Parameters + +`T` + +Pass the type of your mod's entry point. Used to find the mod's assembly and thus its directory. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md new file mode 100644 index 0000000..2fff0dd --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md @@ -0,0 +1,86 @@ +# Interface IWukongInputApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +Provides methods related to input, such as registering key binds. + +```csharp +public interface IWukongInputApi +``` + +## Methods + +### CanApplyInput\(\) + +Determines whether keyboard input can currently be applied (i.e., not blocked by active text fields or menus). + +```csharp +bool CanApplyInput() +``` + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +true if keyboard input is not blocked by active text fields and menus; otherwise, false. + +### RegisterGamePadBind\(GamePadButton, Action\) + +Registers a gamepad button bind with the specified button and action. + +```csharp +void RegisterGamePadBind(GamePadButton button, Action action) +``` + +#### Parameters + +`button` [GamePadButton](https://github.com/readycodeio/embed\-csharp\-loader/blob/72a84f50456aa082e7ead2a681d861586cbde74c/CSharpModBase/Input/GamePadButton.cs) + +The gamepad button to bind. + +`action` [Action](https://learn.microsoft.com/dotnet/api/system.action) + +The action to execute when the button is pressed. + +### RegisterKeyBind\(Key, Action\) + +Registers a key bind with the specified key and action. + +```csharp +void RegisterKeyBind(Key key, Action action) +``` + +#### Parameters + +`key` [Key](https://github.com/readycodeio/embed\-csharp\-loader/blob/72a84f50456aa082e7ead2a681d861586cbde74c/CSharpModBase/Input/Key.cs) + +The key to bind. + +`action` [Action](https://learn.microsoft.com/dotnet/api/system.action) + +The action to execute when the key is pressed. + +### RegisterKeyBind\(ModifierKeys, Key, Action\) + +Registers a key bind with the specified modifier keys, key, and action. + +```csharp +void RegisterKeyBind(ModifierKeys modifiers, Key key, Action action) +``` + +#### Parameters + +`modifiers` [ModifierKeys](https://github.com/readycodeio/embed\-csharp\-loader/blob/72a84f50456aa082e7ead2a681d861586cbde74c/CSharpModBase/Input/ModifierKeys.cs) + +The modifier keys (e.g., Ctrl, Alt, Shift). + +`key` [Key](https://github.com/readycodeio/embed\-csharp\-loader/blob/72a84f50456aa082e7ead2a681d861586cbde74c/CSharpModBase/Input/Key.cs) + +The key to bind. + +`action` [Action](https://learn.microsoft.com/dotnet/api/system.action) + +The action to execute when the key combination is pressed. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md new file mode 100644 index 0000000..89cc06c --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md @@ -0,0 +1,100 @@ +# Interface IWukongLocalApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +Provides various utility methods not related to networking. + +```csharp +public interface IWukongLocalApi +``` + +## Properties + +### IsGameplayLevel + +Is the game currently in a gameplay level, as opposed to a menu or the like? + +```csharp +bool IsGameplayLevel { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +## Methods + +### HideInfoMessage\(\) + +Hides the message currently being shown on the player's screen, if any. + +```csharp +void HideInfoMessage() +``` + +### ShowInfoMessage\(string\) + +Shows a message on the player's screen. + +```csharp +void ShowInfoMessage(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The message to show. + +### ShowInfoMessage\(string, float\) + +Shows a message on the player's screen for a certain amount of time. + +```csharp +void ShowInfoMessage(string message, float timeoutSeconds) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The message to show. + +`timeoutSeconds` [float](https://learn.microsoft.com/dotnet/api/system.single) + +The amount of time, in seconds, to show the message for. + +### ShowTip\(string, bool\) + +Shows a tip message on the player's screen using the game's UI. + +```csharp +void ShowTip(string message, bool autoHide) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The message to show. + +`autoHide` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +Whether the message should automatically hide after 5 seconds + +### Wait\(Task\) + +Waits for the given task to complete in a synchronous manner. + +```csharp +void Wait(Task task) +``` + +#### Parameters + +`task` [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task) + +The task to wait for. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md new file mode 100644 index 0000000..15f53fb --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md @@ -0,0 +1,167 @@ +# Interface IWukongPvpApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +API for PvP mode. Will be removed in the future when custom data sync and server-side scripting are implemented. + +```csharp +[Obsolete("This API is temporary and will be removed in the future when custom data sync is implemented.")] +public interface IWukongPvpApi +``` + +## Properties + +### AntiStallEnabled + +```csharp +bool AntiStallEnabled { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ConsumablesAllowed + +```csharp +bool ConsumablesAllowed { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### CurrentRound + +```csharp +int CurrentRound { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### EnemiesNgPlusLevel + +```csharp +int EnemiesNgPlusLevel { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### GourdAllowed + +```csharp +bool GourdAllowed { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ImmobilizeAllowed + +```csharp +bool ImmobilizeAllowed { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### InPvP + +```csharp +bool InPvP { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### InPvpTournament + +```csharp +bool InPvpTournament { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### LevelId + +```csharp +int LevelId { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### OwnsPvpState + +```csharp +bool OwnsPvpState { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### RoundWinners + +```csharp +IEnumerable RoundWinners { get; set; } +``` + +#### Property Value + + [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> + +### TournamentRounds + +```csharp +int TournamentRounds { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### InitializeAreaPvpState\(\) + +```csharp +void InitializeAreaPvpState() +``` + +### PvpData\(ReadyMainCharacter\) + +```csharp +ref PvPComponent PvpData(ReadyMainCharacter mainCharacter) +``` + +#### Parameters + +`mainCharacter` [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + +#### Returns + + [PvPComponent](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Wukong.Common/ECS/Components/PvPComponent.cs) + +### SetLastRoundWinnerTeam\(int\) + +```csharp +void SetLastRoundWinnerTeam(int winner) +``` + +#### Parameters + +`winner` [int](https://learn.microsoft.com/dotnet/api/system.int32) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md new file mode 100644 index 0000000..4537033 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md @@ -0,0 +1,329 @@ +# Interface IWukongSynchronizationApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +Provides methods related to synchronizing game state between players in a multiplayer session. + +```csharp +public interface IWukongSynchronizationApi +``` + +## Properties + +### AllMainCharacters + +Gets a list of all main characters. + +```csharp +EntityList AllMainCharacters { get; } +``` + +#### Property Value + + [EntityList](../WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md)<[ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)\> + +### AllPlayers + +Gets a list of all players on the server. + +```csharp +IReadOnlyList AllPlayers { get; } +``` + +#### Property Value + + [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\> + +### AllTamers + +Gets a list of all tamers (monsters). + +```csharp +EntityList AllTamers { get; } +``` + +#### Property Value + + [EntityList](../WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md)<[ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md)\> + +### AreaMainCharacters + +Gets a list of main characters in the current area. + +```csharp +EntityList AreaMainCharacters { get; } +``` + +#### Property Value + + [EntityList](../WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md)<[ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)\> + +### AreaPlayers + +Gets a list of players in the current area. + +```csharp +IReadOnlyList AreaPlayers { get; } +``` + +#### Property Value + + [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\> + +### AreaTamers + +Gets a list of tamers (monsters) in the current area. + +```csharp +EntityList AreaTamers { get; } +``` + +#### Property Value + + [EntityList](../WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md)<[ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md)\> + +### CurrentAreaId + +Gets the current area ID. + +```csharp +AreaId? CurrentAreaId { get; } +``` + +#### Property Value + + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)? + +### InArea + +Gets a value indicating whether the player is in an area. + +```csharp +bool InArea { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsConnected + +Gets a value indicating whether the player is connected to the server. + +```csharp +bool IsConnected { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsMasterClient + +Gets a value indicating whether the player is the master client in an area. + +```csharp +bool IsMasterClient { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### LocalMainCharacter + +Gets the local main character. + +```csharp +ReadyMainCharacter? LocalMainCharacter { get; } +``` + +#### Property Value + + [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)? + +### LocalPlayerId + +Gets the local player's ID. + +```csharp +PlayerId? LocalPlayerId { get; } +``` + +#### Property Value + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)? + +## Methods + +### DisableSpectatorMode\(ReadyMainCharacter\) + +Disables spectator mode for the specified character. + +```csharp +void DisableSpectatorMode(ReadyMainCharacter character) +``` + +#### Parameters + +`character` [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + +The character to disable spectator mode for. + +### EnableSpectatorMode\(ReadyMainCharacter, SpectatorReason\) + +Enables spectator mode for the specified character. + +```csharp +void EnableSpectatorMode(ReadyMainCharacter character, SpectatorReason reason) +``` + +#### Parameters + +`character` [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + +The character to enable spectator mode for. + +`reason` [SpectatorReason](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Wukong.Common/ECS/Values/SpectatorReason.cs) + +The reason for enabling spectator mode. + +### GetDisconnectReasonAndInvoke\(Action\) + +Retrieves the disconnect reason and invokes the provided callback with it. + +```csharp +void GetDisconnectReasonAndInvoke(Action callback) +``` + +#### Parameters + +`callback` [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\> + +The callback to invoke with the disconnect reason. + +### GetMainCharacterByPlayerId\(PlayerId\) + +Gets the main character associated with the specified player ID. + +```csharp +ReadyMainCharacter? GetMainCharacterByPlayerId(PlayerId playerId) +``` + +#### Parameters + +`playerId` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + +The player ID. + +#### Returns + + [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)? + +The main character, or null if not found. + +### GetPlayerEntityByActor\(AActor?\) + +Gets the player entity associated with the specified actor. + +```csharp +ReadyMainCharacter? GetPlayerEntityByActor(AActor? actor) +``` + +#### Parameters + +`actor` AActor? + +The actor to find the player entity for. + +#### Returns + + [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)? + +The player entity, or null if not found. + +### GetPlayerEntityByLastTransformation\(BGUCharacterCS?\) + +Gets the player entity associated with the last transformation of the specified character. + +```csharp +ReadyMainCharacter? GetPlayerEntityByLastTransformation(BGUCharacterCS? targetCharacter) +``` + +#### Parameters + +`targetCharacter` BGUCharacterCS? + +The character to find the player entity for. + +#### Returns + + [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md)? + +The player entity, or null if not found. + +### SpawnEnemy\(TamerKind, Vector3, int, int\) + +Spawns an enemy of the specified kind at the given position. + +```csharp +void SpawnEnemy(TamerKind kind, Vector3 position, int count = 1, int teamId = 2) +``` + +#### Parameters + +`kind` [TamerKind](https://github.com/readycodeio/wukong\-csharp\-mod/blob/4ce5be749a5b9f1ddd146615733443ef6d41c763/WukongMp.Api/Configuration/TamerKind.cs) + +The kind of enemy to spawn. + +`position` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +The position to spawn the enemy at. + +`count` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +The number of enemies to spawn. Defaults to 1. + +`teamId` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +The team ID for the spawned enemies. Defaults to the default monster team ID (2). + +### SyncMonstersInArea\(\) + +Register all monsters in the current area to be synchronized over the network. +This should be called whenever the first player enters a new area. + +```csharp +void SyncMonstersInArea() +``` + +### TryGetPlayerInfoById\(PlayerId, out string?, out int?\) + +Tries to get player information by ID. + +```csharp +bool TryGetPlayerInfoById(PlayerId player, out string? nickname, out int? team) +``` + +#### Parameters + +`player` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + +The player ID. + +`nickname` [string](https://learn.microsoft.com/dotnet/api/system.string)? + +The player's nickname, if found. + +`team` [int](https://learn.microsoft.com/dotnet/api/system.int32)? + +The player's team ID, if found. + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +true if the player information was found; otherwise, false. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md new file mode 100644 index 0000000..bfabe1d --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md @@ -0,0 +1,130 @@ +# Interface IWukongWidgetApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +Provides methods related to in-game widgets, such as chat messages, info messages, tips, and timers. + +```csharp +public interface IWukongWidgetApi +``` + +## Methods + +### AddMessageToConsole\(string\) + +Adds a message to the in-game console. + +```csharp +void AddMessageToConsole(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The message to add to the console. + +### HideInfoMessage\(\) + +Hides the currently displayed informational message. + +```csharp +void HideInfoMessage() +``` + +### HideTip\(\) + +Hides the currently displayed tip. + +```csharp +void HideTip() +``` + +### SetCountdownText\(int, int\) + +Sets the value of the countdown timer widget. + +```csharp +void SetCountdownText(int initialMinutes, int initialSeconds) +``` + +#### Parameters + +`initialMinutes` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +The initial minutes to display on the countdown timer. + +`initialSeconds` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +The initial seconds to display on the countdown timer. + +### SetCountdownVisibility\(bool\) + +Sets the visibility of the countdown timer widget. + +```csharp +void SetCountdownVisibility(bool visible) +``` + +#### Parameters + +`visible` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +Indicates whether the countdown timer should be visible. + +### ShowInGameWidgets\(bool\) + +Shows or hides in-game widgets based on whether the player is on the gameplay level. + +```csharp +void ShowInGameWidgets(bool isOnGameplayLevel) +``` + +#### Parameters + +`isOnGameplayLevel` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +Indicates whether the player is on a gameplay level. + +### ShowInfoMessage\(string\) + +Displays an informational message on the screen. + +```csharp +void ShowInfoMessage(string message) +``` + +#### Parameters + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The informational message to display. + +### ShowTip\(string, bool\) + +Displays a tip on the screen using the game UI tip widget. + +```csharp +void ShowTip(string tip, bool autoHide) +``` + +#### Parameters + +`tip` [string](https://learn.microsoft.com/dotnet/api/system.string) + +The tip to display. + +`autoHide` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +Indicates whether the tip should automatically hide after a duration. + +### ToggleCommandVisibility\(\) + +Toggles the visibility of the command console. + +```csharp +void ToggleCommandVisibility() +``` + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md new file mode 100644 index 0000000..5a85d3d --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md @@ -0,0 +1,187 @@ +# Class WukongApi + +Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) +Assembly: WukongMp.Sdk.dll + +The main entry point for accessing Wukong's API. +Provides access to all of the various APIs and services that WukongMP offers. + +```csharp +public static class WukongApi +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[WukongApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### Chat + +API for interacting with the in-game chat. + +```csharp +public static IWukongChatApi Chat { get; } +``` + +#### Property Value + + [IWukongChatApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md) + +### Cheats + +Provides methods and properties for enabling and managing cheats in the game. + +```csharp +public static IWukongCheatsApi Cheats { get; } +``` + +#### Property Value + + [IWukongCheatsApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md) + +### Configuration + +Provides ways to configure various aspects othe game's behavior. +Will be replaced in the future with more specific configuration APIs, but for now serves as a catch-all for miscellaneous configuration options that don't fit anywhere else. +Hence, we do not document the individual configuration options here, as they are all subject to change and may be removed in the future without a major version bump. + +```csharp +public static IWukongConfigurationApi Configuration { get; } +``` + +#### Property Value + + [IWukongConfigurationApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md) + +### Console + +API for the in-game console (F1). + +```csharp +public static IWukongConsoleApi Console { get; } +``` + +#### Property Value + + [IWukongConsoleApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md) + +### Events + +Provides events related to gameplay, player actions, and multiplayer interactions in Wukong Multiplayer. + +```csharp +public static IWukongEventApi Events { get; } +``` + +#### Property Value + + [IWukongEventApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongEventApi.md) + +### Files + +Provides methods related to manipulating files for Wukong mods, such as save files. + +```csharp +public static IWukongFileApi Files { get; } +``` + +#### Property Value + + [IWukongFileApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md) + +### Input + +Provides methods related to input, such as registering key binds. + +```csharp +public static IWukongInputApi Input { get; } +``` + +#### Property Value + + [IWukongInputApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md) + +### Local + +Provides various utility methods not related to networking. + +```csharp +public static IWukongLocalApi Local { get; } +``` + +#### Property Value + + [IWukongLocalApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md) + +### PvP + +API for PvP mode. Will be removed in the future when custom data sync and server-side scripting are implemented. + +```csharp +public static IWukongPvpApi PvP { get; } +``` + +#### Property Value + + [IWukongPvpApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md) + +### Saves + +API for managing world and player saves in Wukong Multiplayer. +Supports co-op style operations where each player has their own save file, and there's a shared world save file for all players. + +```csharp +public static IWukongSaveApi Saves { get; } +``` + +#### Property Value + + [IWukongSaveApi](https://github.com/readycodeio/wukong\-csharp\-mod/blob/4ce5be749a5b9f1ddd146615733443ef6d41c763/WukongMp.Api/IWukongSaveApi.cs) + +### Services + +```csharp +public static IDependencyContainer Services { get; } +``` + +#### Property Value + + [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/DI/IDependencyContainer.cs) + +### Sync + +Provides methods related to synchronizing game state between players in a multiplayer session. + +```csharp +public static IWukongSynchronizationApi Sync { get; } +``` + +#### Property Value + + [IWukongSynchronizationApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md) + +### Widgets + +Provides methods related to in-game widgets, such as chat messages, info messages, tips, and timers. + +```csharp +public static IWukongWidgetApi Widgets { get; } +``` + +#### Property Value + + [IWukongWidgetApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.md new file mode 100644 index 0000000..42311f7 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.md @@ -0,0 +1,58 @@ +# WukongMp.Sdk.Api + +### Classes + + [WukongApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md) + +The main entry point for accessing Wukong's API. +Provides access to all of the various APIs and services that WukongMP offers. + +### Interfaces + + [IWukongChatApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md) + +API for interacting with the in-game chat. + + [IWukongCheatsApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md) + +Provides methods and properties for enabling and managing cheats in the game. + + [IWukongConfigurationApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md) + +Provides ways to configure various aspects othe game's behavior. +Will be replaced in the future with more specific configuration APIs, but for now serves as a catch-all for miscellaneous configuration options that don't fit anywhere else. +Hence, we do not document the individual configuration options here, as they are all subject to change and may be removed in the future without a major version bump. + + [IWukongConsoleApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md) + +API for the in-game console (F1). + + [IWukongEventApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongEventApi.md) + +Provides events related to gameplay, player actions, and multiplayer interactions in Wukong Multiplayer. + + [IWukongFileApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md) + +Provides methods related to manipulating files for Wukong mods, such as save files. + + [IWukongInputApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md) + +Provides methods related to input, such as registering key binds. + + [IWukongLocalApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md) + +Provides various utility methods not related to networking. + + [IWukongPvpApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md) + +API for PvP mode. Will be removed in the future when custom data sync and server-side scripting are implemented. + + [IWukongSynchronizationApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md) + +Provides methods related to synchronizing game state between players in a multiplayer session. + + [IWukongWidgetApi](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md) + +Provides methods related to in-game widgets, such as chat messages, info messages, tips, and timers. + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md new file mode 100644 index 0000000..fa53165 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md @@ -0,0 +1,23 @@ +# WukongMp.Sdk.Entities + +### Classes + + [ReadyActorExtensions](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md) + + [ReadyCharacterExtensions](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md) + + [ReadyObjectExtensions](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md) + +### Structs + + [ReadyActor](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md) + + [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + + [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + + [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + + [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md new file mode 100644 index 0000000..2acded6 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md @@ -0,0 +1,57 @@ +# Struct ReadyActor + +Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public readonly struct ReadyActor : IReadyEntity +``` + +#### Implements + +[IReadyEntity](../WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +#### Extension Methods + +[ReadyObjectExtensions.SetLocationRotation\(ReadyActor, Vector3, Vector3\)](WukongMp.Sdk.Entities.ReadyObjectExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyObjectExtensions\_SetLocationRotation\_\_1\_\_\_0\_System\_Numerics\_Vector3\_System\_Numerics\_Vector3\_) + +## Operators + +### explicit operator ReadyActor\(ReadyObject\) + +```csharp +public static explicit operator ReadyActor(ReadyObject obj) +``` + +#### Parameters + +`obj` [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + +#### Returns + + [ReadyActor](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md) + +### implicit operator ReadyObject\(ReadyActor\) + +```csharp +public static implicit operator ReadyObject(ReadyActor actor) +``` + +#### Parameters + +`actor` [ReadyActor](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md) + +#### Returns + + [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md new file mode 100644 index 0000000..7b30378 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md @@ -0,0 +1,45 @@ +# Class ReadyActorExtensions + +Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public static class ReadyActorExtensions +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ReadyActorExtensions](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### get\_Pawn\(TSelf\) + +```csharp +public static BGUCharacterCS? get_Pawn(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + BGUCharacterCS? + +#### Type Parameters + +`TSelf` + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md new file mode 100644 index 0000000..cc5ea23 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md @@ -0,0 +1,85 @@ +# Struct ReadyCharacter + +Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public readonly struct ReadyCharacter : IReadyEntity +``` + +#### Implements + +[IReadyEntity](../WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +#### Extension Methods + +[ReadyObjectExtensions.SetLocationRotation\(ReadyCharacter, Vector3, Vector3\)](WukongMp.Sdk.Entities.ReadyObjectExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyObjectExtensions\_SetLocationRotation\_\_1\_\_\_0\_System\_Numerics\_Vector3\_System\_Numerics\_Vector3\_) + +## Operators + +### explicit operator ReadyCharacter\(ReadyObject\) + +```csharp +public static explicit operator ReadyCharacter(ReadyObject obj) +``` + +#### Parameters + +`obj` [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + +#### Returns + + [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + +### explicit operator ReadyCharacter\(ReadyActor\) + +```csharp +public static explicit operator ReadyCharacter(ReadyActor actor) +``` + +#### Parameters + +`actor` [ReadyActor](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md) + +#### Returns + + [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + +### implicit operator ReadyObject\(ReadyCharacter\) + +```csharp +public static implicit operator ReadyObject(ReadyCharacter character) +``` + +#### Parameters + +`character` [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + +#### Returns + + [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + +### implicit operator ReadyActor\(ReadyCharacter\) + +```csharp +public static implicit operator ReadyActor(ReadyCharacter tamer) +``` + +#### Parameters + +`tamer` [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + +#### Returns + + [ReadyActor](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md new file mode 100644 index 0000000..e0bd4ab --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md @@ -0,0 +1,179 @@ +# Class ReadyCharacterExtensions + +Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public static class ReadyCharacterExtensions +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ReadyCharacterExtensions](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### HideMarker\(TSelf\) + +```csharp +public static void HideMarker(this TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Type Parameters + +`TSelf` + +### SetMarkerMessage\(TSelf, string, string\) + +```csharp +public static void SetMarkerMessage(this TSelf obj, string message, string color) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +`message` [string](https://learn.microsoft.com/dotnet/api/system.string) + +`color` [string](https://learn.microsoft.com/dotnet/api/system.string) + +#### Type Parameters + +`TSelf` + +### get\_Hp\(TSelf\) + +```csharp +public static float get_Hp(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Type Parameters + +`TSelf` + +### get\_HpMaxBase\(TSelf\) + +```csharp +public static float get_HpMaxBase(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Type Parameters + +`TSelf` + +### get\_IsDead\(TSelf\) + +```csharp +public static bool get_IsDead(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +#### Type Parameters + +`TSelf` + +### get\_TeamId\(TSelf\) + +```csharp +public static int get_TeamId(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Type Parameters + +`TSelf` + +### set\_Hp\(TSelf, float\) + +```csharp +public static void set_Hp(TSelf obj, float value) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +`value` [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Type Parameters + +`TSelf` + +### set\_HpMaxBase\(TSelf, float\) + +```csharp +public static void set_HpMaxBase(TSelf obj, float value) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +`value` [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Type Parameters + +`TSelf` + +### set\_TeamId\(TSelf, int\) + +```csharp +public static void set_TeamId(TSelf obj, int value) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Type Parameters + +`TSelf` + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md new file mode 100644 index 0000000..537e3aa --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md @@ -0,0 +1,219 @@ +# Struct ReadyMainCharacter + +Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public readonly struct ReadyMainCharacter : IReadyEntity +``` + +#### Implements + +[IReadyEntity](../WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +#### Extension Methods + +[ReadyCharacterExtensions.HideMarker\(ReadyMainCharacter\)](WukongMp.Sdk.Entities.ReadyCharacterExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyCharacterExtensions\_HideMarker\_\_1\_\_\_0\_), +[ReadyObjectExtensions.SetLocationRotation\(ReadyMainCharacter, Vector3, Vector3\)](WukongMp.Sdk.Entities.ReadyObjectExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyObjectExtensions\_SetLocationRotation\_\_1\_\_\_0\_System\_Numerics\_Vector3\_System\_Numerics\_Vector3\_), +[ReadyCharacterExtensions.SetMarkerMessage\(ReadyMainCharacter, string, string\)](WukongMp.Sdk.Entities.ReadyCharacterExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyCharacterExtensions\_SetMarkerMessage\_\_1\_\_\_0\_System\_String\_System\_String\_) + +## Properties + +### BeguilingChantEligible + +```csharp +public bool BeguilingChantEligible { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsRespawning + +```csharp +public bool IsRespawning { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsSpectator + +```csharp +public bool IsSpectator { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsTransformed + +```csharp +public bool IsTransformed { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsWaitingForCutscene + +```csharp +public bool IsWaitingForCutscene { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Nickname + +```csharp +public string Nickname { get; set; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### PlayerId + +```csharp +public PlayerId PlayerId { get; } +``` + +#### Property Value + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + +### RebirthPointId + +```csharp +public int RebirthPointId { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### WaitingCutsceneId + +```csharp +public int WaitingCutsceneId { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### EnableInteraction\(bool\) + +```csharp +public void EnableInteraction(bool enabled) +``` + +#### Parameters + +`enabled` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### RebirthAtShrine\(int\) + +```csharp +public void RebirthAtShrine(int shrineId) +``` + +#### Parameters + +`shrineId` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### RebirthInPlace\(\) + +```csharp +public void RebirthInPlace() +``` + +### Teleport\(Vector3, Vector3\) + +```csharp +public void Teleport(Vector3 location, Vector3 rotation) +``` + +#### Parameters + +`location` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +`rotation` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +## Operators + +### explicit operator ReadyMainCharacter\(ReadyObject\) + +```csharp +public static explicit operator ReadyMainCharacter(ReadyObject obj) +``` + +#### Parameters + +`obj` [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + +#### Returns + + [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + +### explicit operator ReadyMainCharacter\(ReadyCharacter\) + +```csharp +public static explicit operator ReadyMainCharacter(ReadyCharacter character) +``` + +#### Parameters + +`character` [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + +#### Returns + + [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + +### implicit operator ReadyObject\(ReadyMainCharacter\) + +```csharp +public static implicit operator ReadyObject(ReadyMainCharacter mainCharacter) +``` + +#### Parameters + +`mainCharacter` [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + +#### Returns + + [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + +### implicit operator ReadyCharacter\(ReadyMainCharacter\) + +```csharp +public static implicit operator ReadyCharacter(ReadyMainCharacter mainCharacter) +``` + +#### Parameters + +`mainCharacter` [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + +#### Returns + + [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md new file mode 100644 index 0000000..ac8f3b7 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md @@ -0,0 +1,27 @@ +# Struct ReadyObject + +Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public readonly struct ReadyObject : IReadyEntity +``` + +#### Implements + +[IReadyEntity](../WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +#### Extension Methods + +[ReadyObjectExtensions.SetLocationRotation\(ReadyObject, Vector3, Vector3\)](WukongMp.Sdk.Entities.ReadyObjectExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyObjectExtensions\_SetLocationRotation\_\_1\_\_\_0\_System\_Numerics\_Vector3\_System\_Numerics\_Vector3\_) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md new file mode 100644 index 0000000..b292f92 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md @@ -0,0 +1,155 @@ +# Class ReadyObjectExtensions + +Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public static class ReadyObjectExtensions +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ReadyObjectExtensions](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### SetLocationRotation\(TSelf, Vector3, Vector3\) + +```csharp +public static void SetLocationRotation(this TSelf obj, Vector3 location, Vector3 rotation) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +`location` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +`rotation` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +#### Type Parameters + +`TSelf` + +### get\_AreaId\(TSelf\) + +```csharp +public static AreaId? get_AreaId(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)? + +#### Type Parameters + +`TSelf` + +### get\_Location\(TSelf\) + +```csharp +public static Vector3 get_Location(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +#### Type Parameters + +`TSelf` + +### get\_Owner\(TSelf\) + +Gets the owner of the entity. This is usually the player that spawned the entity, or a player that was handled the ownership after the original owner disconnected. + +```csharp +public static PlayerId get_Owner(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + +#### Type Parameters + +`TSelf` + +#### Exceptions + + [InvalidOperationException](https://learn.microsoft.com/dotnet/api/system.invalidoperationexception) + +### get\_Rotation\(TSelf\) + +```csharp +public static Vector3 get_Rotation(TSelf obj) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +#### Returns + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +#### Type Parameters + +`TSelf` + +### set\_Location\(TSelf, Vector3\) + +```csharp +public static void set_Location(TSelf obj, Vector3 value) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +`value` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +#### Type Parameters + +`TSelf` + +### set\_Rotation\(TSelf, Vector3\) + +```csharp +public static void set_Rotation(TSelf obj, Vector3 value) where TSelf : struct, IReadyEntity, IReadyConvertable +``` + +#### Parameters + +`obj` TSelf + +`value` [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +#### Type Parameters + +`TSelf` + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md new file mode 100644 index 0000000..531a81f --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md @@ -0,0 +1,167 @@ +# Struct ReadyTamer + +Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public readonly struct ReadyTamer : IReadyEntity +``` + +#### Implements + +[IReadyEntity](../WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +#### Extension Methods + +[ReadyCharacterExtensions.HideMarker\(ReadyTamer\)](WukongMp.Sdk.Entities.ReadyCharacterExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyCharacterExtensions\_HideMarker\_\_1\_\_\_0\_), +[ReadyObjectExtensions.SetLocationRotation\(ReadyTamer, Vector3, Vector3\)](WukongMp.Sdk.Entities.ReadyObjectExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyObjectExtensions\_SetLocationRotation\_\_1\_\_\_0\_System\_Numerics\_Vector3\_System\_Numerics\_Vector3\_), +[ReadyCharacterExtensions.SetMarkerMessage\(ReadyTamer, string, string\)](WukongMp.Sdk.Entities.ReadyCharacterExtensions.md\#WukongMp\_Sdk\_Entities\_ReadyCharacterExtensions\_SetMarkerMessage\_\_1\_\_\_0\_System\_String\_System\_String\_) + +## Properties + +### Guid + +```csharp +public string? Guid { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string)? + +### HpMultiplier + +```csharp +public float HpMultiplier { get; set; } +``` + +#### Property Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +### IsBossOrElite + +```csharp +public bool IsBossOrElite { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsMonsterActive + +```csharp +public bool IsMonsterActive { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Tamer + +```csharp +public BUTamerActor? Tamer { get; } +``` + +#### Property Value + + BUTamerActor? + +## Operators + +### explicit operator ReadyTamer\(ReadyObject\) + +```csharp +public static explicit operator ReadyTamer(ReadyObject obj) +``` + +#### Parameters + +`obj` [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + +#### Returns + + [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md) + +### explicit operator ReadyTamer\(ReadyCharacter\) + +```csharp +public static explicit operator ReadyTamer(ReadyCharacter character) +``` + +#### Parameters + +`character` [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + +#### Returns + + [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md) + +### explicit operator ReadyTamer\(ReadyActor\) + +```csharp +public static explicit operator ReadyTamer(ReadyActor actor) +``` + +#### Parameters + +`actor` [ReadyActor](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md) + +#### Returns + + [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md) + +### implicit operator ReadyObject\(ReadyTamer\) + +```csharp +public static implicit operator ReadyObject(ReadyTamer tamer) +``` + +#### Parameters + +`tamer` [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md) + +#### Returns + + [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) + +### implicit operator ReadyCharacter\(ReadyTamer\) + +```csharp +public static implicit operator ReadyCharacter(ReadyTamer tamer) +``` + +#### Parameters + +`tamer` [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md) + +#### Returns + + [ReadyCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md) + +### implicit operator ReadyActor\(ReadyTamer\) + +```csharp +public static implicit operator ReadyActor(ReadyTamer tamer) +``` + +#### Parameters + +`tamer` [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md) + +#### Returns + + [ReadyActor](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md new file mode 100644 index 0000000..efb24f6 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md @@ -0,0 +1,40 @@ +# Struct EntityList + +Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public readonly struct EntityList : IEnumerable, IEnumerable where T : struct, IReadyEntity +``` + +#### Type Parameters + +`T` + +#### Implements + +[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1), +[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### GetEnumerator\(\) + +```csharp +public IEnumerator GetEnumerator() +``` + +#### Returns + + [IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md new file mode 100644 index 0000000..4fcc8a0 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md @@ -0,0 +1,14 @@ +# Interface IReadyEntity + +Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public interface IReadyEntity where TSelf : struct, IReadyEntity +``` + +#### Type Parameters + +`TSelf` + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md new file mode 100644 index 0000000..4603d8f --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md @@ -0,0 +1,153 @@ +# Class ModBase + +Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) +Assembly: WukongMp.Sdk.dll + +Base class for WukongMP SDK mods. +Each mod should have exactly one class extending from this, which will be instantiated by the mod loader. + +```csharp +public abstract class ModBase : ICSharpModExV2, ICSharpModEx, ICSharpMod +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ModBase](../WukongMp.Sdk/WukongMp.Sdk.ModBase) + +#### Implements + +[ICSharpModExV2](https://github.com/readycodeio/embed\-csharp\-loader/blob/72a84f50456aa082e7ead2a681d861586cbde74c/CSharpModBaseV2/ICSharpModExV2.cs), +[ICSharpModEx](https://github.com/readycodeio/embed\-csharp\-loader/blob/72a84f50456aa082e7ead2a681d861586cbde74c/CSharpModBase/ICSharpModEx.cs), +[ICSharpMod](https://github.com/readycodeio/embed\-csharp\-loader/blob/72a84f50456aa082e7ead2a681d861586cbde74c/CSharpModBase/ICSharpMod.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ModBase\(\) + +```csharp +protected ModBase() +``` + +## Properties + +### IsDebug + +Indicates whether the mod is running in a debug build. +Can be used to enable debug-only features or logging. + +```csharp +public bool IsDebug { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Logger + +```csharp +protected ILogger Logger { get; } +``` + +#### Property Value + + [ILogger](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger) + +### Name + +Mod name, used for logging and patching. + +```csharp +public abstract string Name { get; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Methods + +### DeInit\(\) + +Called by the mod loader on game closing. + +```csharp +public virtual void DeInit() +``` + +### GetReloadContext\(\) + +Called by the mod loader. +Used in hot reload. + +```csharp +public virtual object? GetReloadContext() +``` + +#### Returns + + [object](https://learn.microsoft.com/dotnet/api/system.object)? + +### Init\(\) + +Called by the mod loader on game start. + +```csharp +public void Init() +``` + +### Initialize\(IDependencyContainer\) + +```csharp +protected abstract void Initialize(IDependencyContainer services) +``` + +#### Parameters + +`services` [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/DI/IDependencyContainer.cs) + +### LateInit\(\) + +Called by the mod loader after all Init calls. + +```csharp +public virtual void LateInit() +``` + +### Reload\(object?\) + +Called by the mod loader. +Used in hot reload. + +```csharp +public virtual void Reload(object? context) +``` + +#### Parameters + +`context` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +### SetLoggerFactory\(ILoggerFactory\) + +Called by the mod loader. + +```csharp +public void SetLoggerFactory(ILoggerFactory loggerFactory) +``` + +#### Parameters + +`loggerFactory` [ILoggerFactory](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.iloggerfactory) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md new file mode 100644 index 0000000..b1042d9 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md @@ -0,0 +1,59 @@ +# Struct ModSystemBase.UpdateTick + +Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) +Assembly: WukongMp.Sdk.dll + +```csharp +protected readonly ref struct ModSystemBase.UpdateTick +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### UpdateTick\(float, float\) + +```csharp +public UpdateTick(float deltaTime, float time) +``` + +#### Parameters + +`deltaTime` [float](https://learn.microsoft.com/dotnet/api/system.single) + +`time` [float](https://learn.microsoft.com/dotnet/api/system.single) + +## Fields + +### deltaTime + +The time in seconds since the last tick. + +```csharp +public readonly float deltaTime +``` + +#### Field Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +### time + +The time at the beginning of the current frame since application start. + +```csharp +public readonly float time +``` + +#### Field Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md new file mode 100644 index 0000000..e0f3cd8 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md @@ -0,0 +1,45 @@ +# Class ModSystemBase + +Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) +Assembly: WukongMp.Sdk.dll + +```csharp +public abstract class ModSystemBase +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ModSystemBase](../WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ModSystemBase\(\) + +```csharp +protected ModSystemBase() +``` + +## Methods + +### OnUpdate\(UpdateTick\) + +```csharp +protected abstract void OnUpdate(ModSystemBase.UpdateTick tick) +``` + +#### Parameters + +`tick` [ModSystemBase](../WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md).[UpdateTick](../WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md) + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md new file mode 100644 index 0000000..1bc8939 --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md @@ -0,0 +1,26 @@ +# Enum SaveFileType + +Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) +Assembly: WukongMp.Sdk.dll + +Indicates the type of a save file. + +```csharp +public enum SaveFileType +``` + +## Fields + +`WorldSave = 0` + +Indicates a world save file, which contains the state of the world. + + + +`PlayerSave = 1` + +Indicates a player save file, which contains the equipment, inventory, skills, and other data related to a player. + + + + diff --git a/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.md b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.md new file mode 100644 index 0000000..70154cd --- /dev/null +++ b/versioned_docs/version-0.2.4/api-reference/WukongMp.Sdk/WukongMp.Sdk.md @@ -0,0 +1,34 @@ +# WukongMp.Sdk + +### Namespaces + + [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) + + [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) + +### Classes + + [ModBase](../WukongMp.Sdk/WukongMp.Sdk.ModBase.md) + +Base class for WukongMP SDK mods. +Each mod should have exactly one class extending from this, which will be instantiated by the mod loader. + + [ModSystemBase](../WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md) + +### Structs + + [EntityList](../WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md) + + [ModSystemBase.UpdateTick](../WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md) + +### Interfaces + + [IReadyEntity](../WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md) + +### Enums + + [SaveFileType](../WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md) + +Indicates the type of a save file. + + diff --git a/versioned_docs/version-0.2.4/docs/Development/APIs/_category_.json b/versioned_docs/version-0.2.4/docs/Development/APIs/_category_.json new file mode 100644 index 0000000..d94fdae --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/APIs/_category_.json @@ -0,0 +1,4 @@ +{ + "collapsible": true, + "collapsed": false +} \ No newline at end of file diff --git a/versioned_docs/version-0.2.4/docs/Development/APIs/console-commands.mdx b/versioned_docs/version-0.2.4/docs/Development/APIs/console-commands.mdx new file mode 100644 index 0000000..a7ca531 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/APIs/console-commands.mdx @@ -0,0 +1,116 @@ +import Tabs from '@theme/Tabs'; + +import TabItem from '@theme/TabItem'; + +# Console commands + +The WukongMP SDK includes a command console accessible by pressing F1 on your keyboard. + +## Keyboard shortcuts + +| Binding | Action | +| --------|--------| +| TAB | Auto-complete the selected command | +| Alt + | Previous command | +| Alt + | Next command | + +## Defining custom commands + +Use the [Console API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi) to define custom commands. + +### Register commands without parameters + + + + +```csharp +void RebirthAtShrine() { ... } +// ... +{ + WukongApi.Console.AddCommand("rebirth_shrine", ConsoleCommand.Create(RebirthAtShrine)); +} +``` + + + + + +```shell +rebirth_shrine +``` + + + + +### Require parameters + +The command parameters are deducted from the handler signature - supported types are `string`, `int`, `float`, `double`, and `bool`. +Parameters can be optional, in which case a default value must be provided. + + + + +```csharp +void TeleportToShrine(int shrine = 1001) { ... } +// ... +{ + WukongApi.Console.AddCommand("teleport_shrine", ConsoleCommand.Create(TeleportToShrine)); +} +``` + + + + +```shell +teleport_shrine # teleports to shrine 1001 +teleport_shrine 2005 # teleports to shrine 2005 +``` + + + + +### Define auto-completed paremeters + +You can define a list of parameter values that will be displayed when the command is typed in. These values will be selectable with arrow keys and auto-completeable with TAB. + + + + +```csharp +IEnumerable GetAllValidUnitNames() => ["wolf_soldier", "wolf_sentinel", "gold_rhino"]; + +void SpawnMonster(string monsterType) { ... } +// ... +{ + WukongApi.Console.AddCommand("spawn", ConsoleCommand.Create(SpawnMonster), GetAllValidUnitNames()); +} +``` + + + + +Immediately upon finishing the command name, the available parameter values will be shown: + +```shell +spawn +//highlight-start +wolf_soldier +wolf_sentinel +gold_rhino +//highlight-end +``` + +The parameters are filtered by what's already been typed: + +```shell +spawn wo +//highlight-start +wolf_soldier +wolf_sentinel +//highlight-end +``` + +--- + + + \ No newline at end of file diff --git a/versioned_docs/version-0.2.4/docs/Development/APIs/custom-components.md b/versioned_docs/version-0.2.4/docs/Development/APIs/custom-components.md new file mode 100644 index 0000000..187f5a7 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/APIs/custom-components.md @@ -0,0 +1,11 @@ +# Custom components + +The WukongMP SDK allows for defining custom data components attached to entities in the game. These can be anything from primitive values to complex structures. + +--- + +:::warning[Work in progress] + +This feature is under development and will be available in a future version of the SDK. + +::: diff --git a/versioned_docs/version-0.2.4/docs/Development/APIs/game-events.md b/versioned_docs/version-0.2.4/docs/Development/APIs/game-events.md new file mode 100644 index 0000000..517a524 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/APIs/game-events.md @@ -0,0 +1,5 @@ +# Game events + +The WukongMP SDK provides means to react to the most common events in the game. + +Refer to the [Events API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongEventApi) for a complete list. diff --git a/versioned_docs/version-0.2.4/docs/Development/APIs/key-bindings.md b/versioned_docs/version-0.2.4/docs/Development/APIs/key-bindings.md new file mode 100644 index 0000000..d0450b8 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/APIs/key-bindings.md @@ -0,0 +1,68 @@ +# Key bindings + +The [Input API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md) provides a way to register custom keyboard and controller bindings. + +## Examples + +Define handlers that execute every time a key is pressed. + +```csharp showLineNumbers +WukongApi.Input.RegisterKeyBind(Key.F1, () => +{ + // toggle command window visibility +}); +``` + +## Specify modifier keys + +```csharp showLineNumbers +WukongApi.Input.RegisterKeyBind(ModifierKeys.Alt, Key.X, () => +{ + // do something +}); +``` + +## Register controller bindings + +Use the [RegisterGamePadBind](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi#-registergamepadbindgamepadbutton-action) method to bind to one of the following buttons: + +```csharp +public enum GamePadButton +{ + None, + DPadUp, + DPadDown, + DPadLeft, + DPadRight, + Start, + Back, + LeftThumb, + RightThumb, + LeftShoulder, + RightShoulder, + A, + B, + X, + Y, + LeftTrigger, + RightTrigger, + DPadRightUp, + DPadLeftDown, + DPadRightDown, + DPadLeftUp, +} +``` + +## Using `CanApplyInput` + +Key bindings run every time a key is pressed, regardless of context. If you want to ensure that pressing 'K' when typing in chat will not trigger any command logic, gate it behind the call to [CanApplyInput](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi#-canapplyinput). + +```csharp showLineNumbers +WukongApi.Input.RegisterKeyBind(Key.K, () => +{ + if (WukongApi.Input.CanApplyInput()) + { + // toggle chat window visibility + } +}); +``` diff --git a/versioned_docs/version-0.2.4/docs/Development/APIs/save-file-management.md b/versioned_docs/version-0.2.4/docs/Development/APIs/save-file-management.md new file mode 100644 index 0000000..5cbf786 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/APIs/save-file-management.md @@ -0,0 +1,13 @@ +# Save file management + +Use the [Save API](../../../api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi) to upload and download save files in a similar way our co-op mod does. + +The [server documentation](../../Server/save-files) describes how save files are currently being managed on the server side. + +--- + +:::warning[Work in progress] + +We're working on supporting more ways to manage your save files, including local access, backups, having multiple save files per player etc. + +::: diff --git a/versioned_docs/version-0.2.4/docs/Development/Examples/_category_.json b/versioned_docs/version-0.2.4/docs/Development/Examples/_category_.json new file mode 100644 index 0000000..ac4d790 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/Examples/_category_.json @@ -0,0 +1,11 @@ +{ + "label": "Mod examples", + "key": "sdk-examples", + "collapsible": true, + "collapsed": false, + "link": { + "type": "generated-index", + "title": "Mod examples", + "description": "Example mods built with WukongMP SDK" + } +} \ No newline at end of file diff --git a/versioned_docs/version-0.2.4/docs/Development/Examples/swarm-mode.md b/versioned_docs/version-0.2.4/docs/Development/Examples/swarm-mode.md new file mode 100644 index 0000000..19c1f55 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/Examples/swarm-mode.md @@ -0,0 +1,181 @@ +--- +sidebar_position: 1 +--- + +# Swarm Mode + +The purpose of this mod is to provide an example of a simplest way to implement a new game mode in WukongMP. +It registers a console command `swarm_mode` which makes enemies spawn around the player in waves every few seconds. +The players are supposed to fight until they can't anymore, after which the mod will print the number of enemies summoned. + +## Mod entry point + +In order to create a WukongMP mod, you must create a new C# library project referencing `WukongMp.Sdk.dll` and define a class derived from [ModBase](../../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase). + +At minimum, the mod must define its name: + +```csharp title="Mod.cs" +public class Mod : ModBase +{ + public override string Name => "Swarm"; +``` + +The `Initialize` method is the place to configure your mod. In this mod, we do a few things: + +1. Register our RPC handler class in the dependency injection container to enable sending and receiving RPC. +1. Resolve `SpawnEnemySwarmSystem` from the DI container - every system defined in your mod will be injected there. +1. Register a console command `swarm_mode` which turns on our custom game mode, notifying other players. +1. Subscribe to the `OnPlayerDead` event to turn it off when the last player dies and send events when someone dies. + +```csharp title="Mod.cs" showLineNumbers + protected override void Initialize(IDependencyContainer services) + { + services.RegisterSingleton(); + + var rpc = services.Resolve(); + var spawnSystem = services.Resolve(); + + WukongApi.Console.AddCommand("swarm_mode", ConsoleCommand.Create(() => + { + spawnSystem.Enable(); + rpc.SendSwarmStarted(); + })); + + WukongApi.Events.OnPlayerDead += (victim, attacker) => + { + var alivePlayers = WukongApi.Sync.AllMainCharacters.Count(x => !x.IsDead); + if (alivePlayers > 0) + { + rpc.SendRemainingPlayers(alivePlayers); + } + else + { + rpc.SendSwarmEnded(spawnSystem.SpawnedEnemies); + spawnSystem.Disable(); + } + }; + } +} +``` + +## Custom RPC + +Our mod uses a few custom Remote Procedure Calls to notify other players about the state of the fight. + +All of these calls display UI elements - informational banners or chat messages visible to the receiving player. + +We use the `AreaOfInterestAll` [Relay mode](../../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode) to receive the message on all clients in the same level, the sender included. This ensures everyone sees the same messages. + +Refer to the [RPC documentation](../custom-rpc) to learn what else you can do in RPC classes. + +```csharp title="Custom RPC class" +public partial class Rpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestAll)] + private void OnSwarmStarted(PlayerId __sender) + { + if (!WukongApi.Sync.TryGetPlayerInfoById(__sender, out var playerName, out _)) + { + Logging.LogError("Failed to get player info for sender {Sender}", __sender); + } + + WukongApi.Local.ShowInfoMessage("Get ready!", 3); + WukongApi.Local.AddChatMessage($"Swarm mode enabled by {playerName}!", FLinearColor.NavajoWhite); + WukongApi.Local.AddChatMessage("Enemies will spawn around you every 10 seconds, with increasing numbers. Survive as long as you can!", FLinearColor.NavajoWhite); + } + + [RpcEvent(RelayMode.AreaOfInterestAll)] + private void OnSwarmEnded(int enemiesSpawned) + { + WukongApi.Local.AddChatMessage($"Swarm mode ended, survived {enemiesSpawned} enemies", FLinearColor.OrangeRed); + } + + [RpcEvent(RelayMode.AreaOfInterestAll)] + private void OnRemainingPlayers(int remaining) + { + WukongApi.Local.AddChatMessage($"Remaining players: {remaining}", FLinearColor.Yellow); + } +} +``` + +## Core gameplay loop + +The main logic of the mod is encapsulated in `SpawnEnemySwarmSystem`. + +We begin by defining a few constants to configure the behavior of our system: + +```csharp showLineNumbers title="SpawnEnemySwarmSystem.cs" +public sealed class SpawnEnemySwarmSystem : ModSystemBase +{ + private bool _enabled; + private float _timeSinceLastSpawn; + private int _swarmSize = 3; + private int _enemies; + private const int SwarmIncrement = 1; + private const int SwarmMax = 7; + private const float SpawnRadius = 1000.0f; + private const float SpawnInterval = 10.0f; + private const float InitialDelay = 3.0f; +``` + +Then - the methods for enabling and disabling the system. We use the [Local API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi) for showing message banners and adding messages to the chat window. + +```csharp showLineNumbers=13 title="SpawnEnemySwarmSystem.cs" + public void Enable() + { + _enabled = true; + + WukongApi.Local.ShowInfoMessage("Get ready!", 3); + WukongApi.Local.AddChatMessage("Swarm mode enabled! Enemies will spawn around you every 10 seconds, with increasing numbers. Survive as long as you can!", FLinearColor.NavajoWhite); + } + + public void Disable() + { + if (!_enabled) + return; + + _enabled = false; + WukongApi.Local.AddChatMessage($"Swarm mode ended, survived {_enemies} enemies", FLinearColor.OrangeRed); + + // reset state for next time + _enemies = 0; + _swarmSize = 3; + _timeSinceLastSpawn = SpawnInterval - InitialDelay; + } +``` + +All systems (classes derived from [ModSystemBase](../../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase)) expose an [OnUpdate](../../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase#-onupdateupdatetick) method which runs on every frame. +We can use that to count the number of seconds since the last time we spawned enemies. When `_timeSinceLastSpawn` exceedes the threshold, we use the [Synchronization API](../../../api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi) to spawn an enemy (Wolf Sentinel) a few times in a circle around the player. All available enemy types are defined in [TamerKinds](../../../api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds). + +```csharp showLineNumbers=35 title="SpawnEnemySwarmSystem.cs" + protected override void OnUpdate(UpdateTick tick) + { + if (!_enabled || !WukongApi.Sync.LocalMainCharacter.HasValue) + return; + + _timeSinceLastSpawn += tick.deltaTime; + if (_timeSinceLastSpawn > SpawnInterval) + { + _timeSinceLastSpawn = 0; + WukongApi.Local.ShowInfoMessage($"Spawning {_swarmSize} enemies!", 1); + +// highlight-start + // spawn a few enemies around the player + for (var i = 0; i < _swarmSize; i++) + { + var position = GetNthPointOnCircle(WukongApi.Sync.LocalMainCharacter.Value.Location, i, _swarmSize); + WukongApi.Sync.SpawnEnemy(TamerConstants.WolfSentinel, position); + } +// highlight-end + + // increase swarm size, up to a certain point + _swarmSize = Math.Min(_swarmSize + SwarmIncrement, SwarmMax); + + // count total enemies spawned for end-of-mode summary + _enemies += _swarmSize; + } + } + + private static Vector3 GetNthPointOnCircle(Vector3 center, int i, int n) { ... } +} +``` diff --git a/versioned_docs/version-0.2.4/docs/Development/_category_.json b/versioned_docs/version-0.2.4/docs/Development/_category_.json new file mode 100644 index 0000000..7fd80c4 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/_category_.json @@ -0,0 +1,6 @@ +{ + "collapsible": true, + "collapsed": false, + "position": 4, + "label": "Mod development" +} \ No newline at end of file diff --git a/versioned_docs/version-0.2.4/docs/Development/custom-rpc.md b/versioned_docs/version-0.2.4/docs/Development/custom-rpc.md new file mode 100644 index 0000000..519676f --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/custom-rpc.md @@ -0,0 +1,191 @@ +--- +sidebar_position: 5 +--- + +# Custom RPC + +One of the core WukongMP SDK functionalities is the support for arbitrary Remote Procedure Call (RPC) functions. These can have arbitrary payloads and support a number of [Relay Modes](../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode). + +RPC handlers allow you to define your own events that are sent to other players connected to the same server. + +## Declaring an RPC handler class + +In order to add custom RPC procedures to your mod, you must define a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class that extends [RpcClassBase](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase). + +```csharp title="Minimal RPC class definition" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + // RPC handlers go here +} +``` + +:::important + +For any of the RPC handlers to be registered, the class **must** be added to the DI container in your mod's `Initialize` method. +Consult the documentation for [ModBase](../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase). + +::: + +## Defining RPC handlers + +In order to add a new RPC handler to your mod, add a method decorated with the [RpcEvent](../../api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute) attribute. + +Method names must start with "On..." — corresponding "Send..." methods for sending the RPC will be generated automatically in the same class. + +```csharp title="Minimal RPC handler" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestOthers)] + private void OnMyCustomCall() + { + // do something when this message is received + } + + // generated by the SDK + private void SendMyCustomCall() { ... } +} +``` + +The attribute requires a parameter of type [RelayMode](../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode), which indicates how the message will be propagated to players when it reaches the server. + +Currently, the following modes are supported: + +| Relay mode | Description | +| ---------- | ----------- | +| **AreaOfInterestOthers** | Message is sent to all other players on the same level | +| **AreaOfInterestAll** | Message is sent to all players on the same level, including the sender | +| **GlobalOthers** | Message is sent to all other players on the server | +| **GlobalAll** | Message is sent to all players on the server, including the sender | + +## Sending data + +RPC handlers support passing data in parameters that are either: + +* primitive data types +* structs, decorated with [[DeriveINetSerializable]](../../api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute). +* special parameters injected by the SDK + +An RPC hander can have any number of these parameters declared in any order. The generated "Send..." methods will have the same parameters (excluding the injected ones). + +### Primitive data types + +We support all primitive data types defined in the C# runtime: `bool`, `char`, `sbyte`, `byte`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`, `float`, `double`, and `string`. + +```csharp title="Passing primitive data" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestOthers)] + private void OnMyCustomCall(int number, string text) + { + // do something when this message is received + } + + // generated by the SDK + private void SendMyCustomCall(int number, string text) { ... } +} +``` + +### Complex data types + +You can use complex data structures in your RPC parameters. These must extend the [INetSerializable](https://revenantx.github.io/LiteNetLib/api/LiteNetLib.Utils.INetSerializable.html) interface. + +The fields of the payload structures can be of any serializable type, including other complex types, provided they also extend [INetSerializable](https://revenantx.github.io/LiteNetLib/api/LiteNetLib.Utils.INetSerializable.html). + +```csharp title="Complex RPC parameter example" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestOthers)] + private void OnPlayerBuffed(BuffData payload) + { + // do something when this message is received + } + + // generated by the SDK + private void SendPlayerBuffed(BuffData payload) { ... } +} +``` + +The SDK provides the [[DeriveINetSerializable]](../../api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute) attribute, which makes the SDK automatically generate serialization code for most cases. The structure must be declared [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) for this to work. + +```csharp title="Generating serialization code" +[DeriveINetSerializable] +public partial struct BuffData(int buffId, float duration) : INetSerializable +{ + public int BuffId = buffId; + public float Duration = duration; +} +``` + +You can also implement the interface manually if you want to have full control over the data sent over the wire. + +We use the [LiteNetLib](https://github.com/revenantx/litenetlib) library as a base for our networking stack. You can refer to its [documentation](https://revenantx.github.io/LiteNetLib/index.html) to learn how to use `NetDataWriter` and `NetDataReader`. + +```csharp title="Writing serialization code manually" +public struct BuffAddData(int buffId, float duration) : INetSerializable +{ + public int BuffId = buffId; + public float Duration = duration; + + public void Serialize(NetDataWriter writer) + { + writer.Put(BuffId); + writer.Put(Duration); + } + + public void Deserialize(NetDataReader reader) + { + BuffId = reader.GetInt(); + Duration = reader.GetFloat(); + } +} +``` + +### Special parameters + +Right now there is only one special parameter that can be used. We might expand this functionality in future versions of the SDK. + +| Name | Type | Description | +| ---- | ---- | ----------- | +| `__sender` | [PlayerId](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId) | The identifier of the player sending the RPC | + +This parameter can be used alongside other parameters, but is not visible in the generated "Send..." method. + +```csharp title="Using injected parameters" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestOthers)] + private void OnComplexEvent(int number, PlayerId __sender, BuffData buffData) + { + // example: do something with sender nickname + if (WukongApi.Sync.TryGetPlayerInfoById(__sender, out var playerName, out _)) + { + Logging.LogInfo("Received data from {Sender}", playerName); + } + } + + // generated by the SDK + private void SendComplexEvent(int number, BuffData buffData) { ... } +} +``` + +## Executing callbacks on the main thread + +RPC handlers are executed on a separate network thread, so they should not interact with the game world directly, as doing so can cause crashes. However, you can schedule callbacks to be executed on the main thread using the [RunOnMainThread](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase#-runonmainthreadaction) method available in your RPC handler class. + +```csharp title="Running code on the main thread" +public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +{ + [RpcEvent(RelayMode.AreaOfInterestAll)] + private void OnDespawnAllMonsters() + { + // destroying an Unreal Engine pawn must be done on the main thread + RunOnMainThread(() => + { + foreach (var monster in WukongApi.Sync.AreaTamers) + { + monster.Tamer?.CurrentRef.DestroyTamer(); // calls BGU_UnrealWorldUtil.DestroyActor + } + }); + } +} +``` diff --git a/versioned_docs/version-0.2.4/docs/Development/getting-started.md b/versioned_docs/version-0.2.4/docs/Development/getting-started.md new file mode 100644 index 0000000..3eaffb8 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/getting-started.md @@ -0,0 +1,27 @@ +--- +sidebar_position: 1 +--- + +# Getting started + +The easiest way to get started with developing your own mods on top of the WukongMP SDK is to use the official [WukongMP mod template](https://github.com/readycodeio/wukongmp-mod-template). + +Clone the repository and follow instructions provided in the [README](https://github.com/readycodeio/wukongmp-mod-template/blob/main/README.md) file. + +## Feature status + +Right now you can develop mods that have access to game events, entity data (players, enemies), and can define custom commands and game logic systems. + +Support for server-side logic and custom data sync is on the way. + +Visit the [examples](/wukong-mp/category/mod-examples) page for some inspiration, or browse the source code of the [co-op](https://github.com/readycodeio/WukongMP-co-op-mod) and [PvP](https://github.com/readycodeio/WukongMP-PvP-mod) mods. + +| Feature | Status | +|---|---| +| Patching game code | :white_check_mark: [done](../Development/patching) | +| Game event API | :white_check_mark: [done](../Development/APIs/game-events) | +| Console command API | :white_check_mark: [done](../Development/APIs/console-commands) | +| Custom RPC | :white_check_mark: [done](../Development/custom-rpc) | +| Save file API | :construction: [partial](../Development/APIs/save-file-management) | +| Custom data sync | :soon: [in progress](../Development/APIs/custom-components) | +| Server-side mods | :soon: in progress | diff --git a/versioned_docs/version-0.2.4/docs/Development/hosted-services.md b/versioned_docs/version-0.2.4/docs/Development/hosted-services.md new file mode 100644 index 0000000..b05e0ec --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/hosted-services.md @@ -0,0 +1,35 @@ +--- +sidebar_position: 5 +--- + +# Hosted services + +In addition to systems, the WukongMP SDK also provides a way to implement **hosted services**. These are classes that expose lifecycle methods for when the game starts and stops, but don't have a tick method. + +## Declaring hosted services + +Any class implementing [IHostedService](../../api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService) and added to the Dependency Injection container in your mod's `Initialize` method will automatically call its `OnScopeStart` method when the game starts, and disposed of when the game shuts down. + +Such services are useful for managing event subscriptions, or running initialization code that doesn't fit in the `Initialize` method of your mod class, or that needs to be cleaned up when the game shuts down. + +Below is an example of a hosted service from the PvP mod. It encapsulates some simple logic for synchronizing PvP state when joining a new area. Since many of the mod's features depend on subcribing to game events, this pattern of using hosted services to manage event subscriptions is used throughout the mod's codebase. + +```csharp title="Hosted service example" +public sealed class PvpSynchronizer : IHostedService +{ + public void OnScopeStart() + => WukongApi.Events.OnJoinedArea += OnJoinedAreaHandler; + + public void Dispose() + => WukongApi.Events.OnJoinedArea -= OnJoinedAreaHandler; + + private static void OnJoinedAreaHandler(AreaId areaId) + { + var isMasterClient = WukongApi.Sync.IsMasterClient; + Logging.LogDebug("Joined area {AreaId}, is master client: {IsMasterClient}", areaId, isMasterClient); + + if (isMasterClient) + WukongApi.PvP.InitializeAreaPvpState(); + } +} +``` diff --git a/versioned_docs/version-0.2.4/docs/Development/mod-manifest.md b/versioned_docs/version-0.2.4/docs/Development/mod-manifest.md new file mode 100644 index 0000000..4cb2f1a --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/mod-manifest.md @@ -0,0 +1,36 @@ +--- +sidebar_position: 2 +--- + +# Mod manifests + +The official WukongMP SDK mod template contains a file named `manifest.json`. This file is required by the mod loader to recognize the folder containing your mod DLL as a WukongMP mod, and contains information required for resolving mod dependencies. + +An example `manifest.json` file looks like this: + +```json title="manifest.json" +{ + "uniqueId": "WukongMP.Coop", + "version": "0.2.0", + "name": "WukongMP Co-op mode", + "author": "ReadyM Team", + "description": "The official WukongMP Co-op mode.", + "dependencies": [ + { + "uniqueId": "WukongMP.SDK", + "minimumVersion": "0.2.0" + } + ] +} +``` + +Refer to the table below for the description of each field in the manifest file. + +| Field | Type | Optional | Description | +| ----- | ---- | -------- | ----------- | +| `uniqueId` | string | no | Unique identifier of your mod. Can contain only alphanumeric characters, `.` or `_` | +| `version` | string | no | Mod version, in `MAJOR.MINOR.PATCH` format. | +| `name` | string | no | Mod name, as it will be displayed in the server admin portal and in the Launcher. | +| `author` | string | no | Mod author, as it will be displayed in the server admin portal and in the Launcher. | +| `description` | string | **yes** | A short description of the mod. | +| `dependencies` | array of objects | **yes** | A list of other mods that are required for your mod to work. Each dependency must specify the `uniqueId` of the required mod, and a `minimumVersion`. | diff --git a/versioned_docs/version-0.2.4/docs/Development/patching.md b/versioned_docs/version-0.2.4/docs/Development/patching.md new file mode 100644 index 0000000..14d8a78 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/patching.md @@ -0,0 +1,60 @@ +--- +sidebar_position: 3 +--- + +# Patching the game + +The WukongMP SDK is built on a custom fork of the [Harmony](https://github.com/pardeike/Harmony) library. While it supports most of the Hamony's API, there are some differences in how patches are discovered and enabled. + +In general, refer to the [official Harmony documentation](https://harmony.pardeike.net/articles/intro.html) when defining patches in your WukongMP mods. + +Below are a few requirements that must be satisfied for patches to work correctly. + +## Categories are mandatory + +Each Harmony patch declared in your mod's code must be decorated with the [HarmonyPatchCategory](https://harmony.pardeike.net/api/HarmonyLib.HarmonyPatchCategory.html) attribute, with one of the constants defined in [PatchCategory](../../api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory), like so: + +```csharp title="Example patch" +[HarmonyPatch(typeof(BPS_PlayerTeleportSystem), "OnPlayerTeleportTo")] +[HarmonyPatchCategory(PatchCategory.Global)] +public static class PatchOnPlayerTeleportTo { ... } +``` + +As of the current version of the SDK, only patches with the `PatchCategory.Global` or `PatchCategory.Connected` category are enabled at game start. + +## Using [TargetMethod](https://harmony.pardeike.net/articles/patching-auxiliary.html#targetmethod) + +Sometimes you have to use the [TargetMethod](https://harmony.pardeike.net/articles/patching-auxiliary.html#targetmethod) method in your patch class to be able to patch a member of a `private` or `internal` class. + +In the WukongMP SDK's Harmony fork this method requires the [HarmonyTargetMethodHint](../../api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint) attribute to be present. The first argument is the fully qualified class name. The second argument is the patched member name. + +```csharp title="Example: patching an internal class" +[HarmonyPatch] +[HarmonyPatchCategory(PatchCategory.Connected)] +internal static class PatchComplexSkillDoInteractAction +{ + [HarmonyTargetMethodHint("b1.BUIAComplexSkill", "DoInteractAction")] + private static MethodBase TargetMethod() + { + return AccessTools.Method("b1.BUIAComplexSkill:DoInteractAction"); + } + ... +} +``` + +Another use case for [TargetMethod](https://harmony.pardeike.net/articles/patching-auxiliary.html#targetmethod) are generic classes. In such cases, you must also decorate with [HarmonyTargetMethodHint](../../api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint), providing the specialized class type and member name. + +```csharp title="Example: Patching a generic class" +[HarmonyPatch] +[HarmonyPatchCategory(PatchCategory.Global)] +public class PatchShrineRegisterFunc +{ + [HarmonyTargetMethodHint(typeof(FMenuHelper), "RegisterFunc")] + public static MethodBase TargetMethod() + { + var specializedType = typeof(FMenuHelper); + return specializedType.GetMethod("RegisterFunc")!; + } + ... +} +``` diff --git a/versioned_docs/version-0.2.4/docs/Development/systems.md b/versioned_docs/version-0.2.4/docs/Development/systems.md new file mode 100644 index 0000000..67eb594 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Development/systems.md @@ -0,0 +1,44 @@ +--- +sidebar_position: 4 +--- + +# Gameplay systems + +In order to facilitate the development of gameplay logic, the WukongMP SDK provides a way to implement **systems**. +These are classes that expose a tick method tied to the game's update loop. + +## Declaring systems + +Any class deriving from [ModSystemBase](../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase) and defined in the same assembly as your main mod class (one that extends [ModBase](../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase)) will be automatically registered when the game starts, and will begin executing soon after. + +:::info + +Systems are singletons — each system has only one instance running at a time. + +::: + +At this time there is no functionality for turning systems on an off, you have to implement methods for that yourself. + +Below is an example of a minimal system declaration: + +```csharp title="Minimal system example" +public class MySystem : ModSystemBase +{ + protected override void OnUpdate(UpdateTick tick) + { + // do something every frame + } +} +``` + +You can get a reference to your system's instance by resolving it from the Dependency Injection container: + +```csharp title="Resolving systems from DI" +public class MyMod : ModBase +{ + protected override void Initialize(IDependencyContainer services) + { + var mySystemInstance = services.Resolve(); + } +} +``` diff --git a/versioned_docs/version-0.2.4/docs/Server/_category_.json b/versioned_docs/version-0.2.4/docs/Server/_category_.json new file mode 100644 index 0000000..84685f0 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Server/_category_.json @@ -0,0 +1,6 @@ +{ + "collapsible": true, + "collapsed": false, + "position": 3, + "label": "Server hosting" +} \ No newline at end of file diff --git a/versioned_docs/version-0.2.4/docs/Server/admin-panel.mdx b/versioned_docs/version-0.2.4/docs/Server/admin-panel.mdx new file mode 100644 index 0000000..2275874 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Server/admin-panel.mdx @@ -0,0 +1,58 @@ +--- +sidebar_position: 2 +--- + +# Admin panel + +The admin panel is available over HTTP on port **9050** (unless changed in `config.json`). + +If the server is running on your local machine, you can open it at http://localhost:9050. + +## First-time setup + +When launching the server for the first time, you will need to create an administrator account. + +During startup, the server prints a one-time setup PIN in the console output: + +```shell-session +$ ./server.exe +[15:16:37 INF] Starting web server on 127.0.0.1:9050 +[15:16:37 INF] Starting RelayServer... +[15:16:37 INF] Running server on port 9050 +... +//highlight-next-line +[15:16:37 WRN] No admin users found. Admin setup PIN: 766596 +``` + +Enter this PIN in the admin panel to begin the setup process. + +Setup PIN code view + +## Sign in with ReadyM + +After entering the PIN, you will be asked to sign in with your ReadyM account. + +You will be redirected to the ReadyM authentication page, where you can enter your credentials. + +Once authentication is successful, you will be redirected back to the admin panel automatically. + +## Admin panel interface + +After signing in, you can access the admin panel interface. + +Admin panel terminal + +The admin panel offers the following views: + +* **Terminal** - view server status, active players, uptime, and real-time logs. +* **Players** - view the list of players who have ever connected to the server, along with their first and last visit date. +* **Mods** - view the list of currently installed mods on the server. +* **Admins** - view the list of server administrators, add new administrators, and manage their permissions. +* **Settings** - manage panel settings, such as language and theme. \ No newline at end of file diff --git a/versioned_docs/version-0.2.4/docs/Server/installation.mdx b/versioned_docs/version-0.2.4/docs/Server/installation.mdx new file mode 100644 index 0000000..e6b7ef1 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Server/installation.mdx @@ -0,0 +1,169 @@ +--- +sidebar_position: 1 +--- + +import Tabs from '@theme/Tabs'; + +import TabItem from '@theme/TabItem'; + +# Installation + +The WukongMP server is currently distributed in the following formats: + +- Binary package +- [Docker image](#docker) + +## Binary package + +### Downloads + +| Platform | Architecture | Download | +| --- | --- | --- | +| Linux | x64 | [Download for Linux](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.2.4.zip) | +| Windows | x64 | [Download for Windows](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.2.4.zip) | + +### Installation + +Extract the binary package to a location of your choice. + +After extraction, the directory structure should look like this: + + + + +```text +server/ +├── server.exe # Main server binary +├── config.json # Configuration file +├── mods/ # Directory for mods +| ├── WukongMp.Sdk/ # SDK mod +| └── WukongMp.PvP/ # PvP mod +├── optional_mods/ # Move any of these mods to the "mods" folder to enable them +| └── WukongMp.Coop/ # Co-op mod +├── saves/ # Directory for game saves (empty by default) +├── wwwroot/ # Admin panel assets +├── e_sqlite3.dll # Dependency +└── aspnetcorev2_inprocess.dll # Dependency +``` + + + + +```text +server/ +├── server # Main server binary +├── config.json # Configuration file +├── mods/ # Directory for mods +| ├── WukongMp.Sdk/ # SDK mod +| └── WukongMp.PvP/ # PvP mod +├── optional_mods/ # Move any of these mods to the "mods" folder to enable them +| └── WukongMp.Coop/ # Co-op mod +├── saves/ # Directory for game saves (empty by default) +├── wwwroot/ # Admin panel assets +└── libe_sqlite3.so # Dependency +``` + + + + +### Configuration + +You can adjust server settings by editing the `config.json` file. In the following table, the `:` notation is used to represent nested settings. + +| Setting | Type | Purpose | +| --- | --- | --- | +| `Server:Port` | number | The port on which the server listens for incoming connections | +| `Server:Password` | string | Optional. When set, players must enter this password in the Launcher to join. Leave empty or omit for an open server. | +| `Telemetry:OptOut` | boolean | Set to `true` to opt out of sending anonymous telemetry to ReadyM. Defaults to `false`. | + +:::note + +`Server:Password` gates every player, including admins and whitelisted users. Password-protected servers are shown with a lock on the public server list. + +::: + +### First launch + +Start the server by running the `server.exe` binary. + +On first launch, the server creates a `data/` directory inside the server folder. +This directory contains the `web.db` database file, where persistent data is stored. + +Unless changed in `config.json`, the server listens on the following ports: + +| Port | Protocol | Purpose | +| --- | --- | --- | +| 9050 | UDP | Game traffic (player connections, game state synchronization, etc.) | +| 9050 | HTTP | [Admin panel](admin-panel) | + +## Docker + +A Linux-based x64 Docker image is also available for those who prefer containerized deployments. + +Pull the image from the registry: + +```shell +docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 +``` + +Copy the config file from the image: + +```shell +docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.2.4 +docker cp wukongmp-tmp:/app/config.json ./config.json +docker rm wukongmp-tmp +``` + +Run: + + + + +```shell +docker run \ + -p 9050:9050/udp -p 9050:9050/tcp \ + -v ./data:/app/data \ + -v ./mods:/app/mods \ + -v ./saves:/app/saves \ + -v ./config.json:/app/config.json \ + --name wukongmp-server \ + ghcr.io/readycodeio/wukongmp-server:0.2.4 +``` + + + + +```yaml title="docker-compose.yml" +services: + server: + image: ghcr.io/readycodeio/wukongmp-server:0.2.4 + container_name: wukongmp-server + restart: unless-stopped + ports: + - "9050:9050/tcp" + - "9050:9050/udp" + volumes: + - ./data:/app/data + - ./mods:/app/mods + - ./saves:/app/saves + - ./config.json:/app/config.json +``` + + + + +:::important + +The image ships **without mods**. Copy `WukongMp.Sdk` and the mode you want (`WukongMp.PvP`, `WukongMp.Coop`) from the binary ZIP into your `mods/` volume before starting the container. + +::: + +### Configuration + +Configuring the port is done by remapping the container ports in the `docker run` command or Docker Compose file. For example, to use port 9060 instead of 9050, change the ports section to: + +```yaml title="docker-compose.yml" +ports: + - "9060:9060/tcp" + - "9060:9060/udp" +``` \ No newline at end of file diff --git a/versioned_docs/version-0.2.4/docs/Server/mod-management.md b/versioned_docs/version-0.2.4/docs/Server/mod-management.md new file mode 100644 index 0000000..27f8473 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Server/mod-management.md @@ -0,0 +1,63 @@ +--- +sidebar_position: 3 +--- + +# Mod management + +Mod support is a core feature of WukongMP, allowing you to extend the functionality of your server with custom content. + +## Client-side mods + +WukongMP supports automatic mod sync for clients connecting to the server. +When a client connects, the server checks if the client has the required mods installed. +If not, the [ReadyM Launcher](https://portal.ready.mp/pl/dashboard/launcher) will download and install the missing mods before they can join the game. + +To add a mod to your server, simply place the mod folder in the `mods/` directory. + +The expected structure of a mod folder is as follows. If you use our [official mod template](https://github.com/readycodeio/wukongmp-mod-template), there's a `MakeModFolder.ps1` script in there, which will package the mod appropriately. + +```text title="Example mod folder layout" +mods/ +└──MyModFolder/ # Root directory of the mod, can be named arbitrarily + ├── MyMod.dll # Main assembly of the mod + ├── manifest.json # Mod manifest file + └── other_files... # Other files required by the mod (optional) +``` + +Upon connecting to the server, clients will automatically download and install any missing mods from the `mods/` directory, ensuring a seamless multiplayer experience. + +:::danger[Security notice] + +The early access version of the WukongMP SDK and server does not include any sandboxing or security mechanisms for mods. + +Only use mods from trusted sources, as they can execute arbitrary code on the client. + +Never run a server with untrusted mods, especially if the server is publicly accessible. + +::: + +### .pak files + +WukongMP mods can include `.pak` files for game assets, which will be automatically loaded by the game. + +To include a `.pak` file in your mod, simply place it anywhere in the mod folder. As long as there is a valid `manifest.json` file in the mod, the server will recognize it as a mod and distribute it to clients, and the game will load the `.pak` file when the mod is loaded. + +In particular, this allows you to create mods that only include custom assets without any code, which can be useful for simple content mods. + +An example mod structure with a `.pak` file would look like this: + +```text title="Example mod folder layout with .pak file" +mods/ +└──MyModFolder/ # Root directory of the mod, can be named arbitrarily + ├── manifest.json # Mod manifest file + ├── custom_assets.pak # Custom asset pack + └── other_files... # Other files required by the mod (optional) +``` + +## Server-side mods + +:::warning[Work in progress] + +This feature is under development and will be available in a future version of the SDK. + +::: diff --git a/versioned_docs/version-0.2.4/docs/Server/save-files.md b/versioned_docs/version-0.2.4/docs/Server/save-files.md new file mode 100644 index 0000000..b2e0ceb --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Server/save-files.md @@ -0,0 +1,38 @@ +--- +sidebar_position: 4 +--- + +# Save files + +WukongMP SDK allows for synchronizing player save data with the server using the [Save API](../Development/APIs/save-file-management). + +The save files are stored in the `saves/` directory on the server. + +```text title="Example save folder layout" +saves +├── world.sav +└── players/ + ├── player_c703feff87364096a8b1eb19eabc9a8b.sav + └── player_a246246929654f37aa0483e35be1b2cc.sav +``` + +The main world save file, shared world state for all players, will be placed in the `world.sav` file. + +Save files belonging to individual players are stored in files with the following naming pattern: `player_GUID.sav`, where the [GUID](https://en.wikipedia.org/wiki/Globally_Unique_Identifier) is provided by the ReadyM platform and unique for each player. + +## Using the co-op mod + +Until we expand the [Save API](../Development/APIs/save-file-management) to allow uploading an arbitrary number of save files with arbitrary metadata, the save file behavior is as follows: + +1. The first player that loads a new location (area) is considered the "host" of that area, and is responsible for uploading `world.sav` when the game would be saved. +2. All players, including the host, also upload their own `player_GUID.sav` save files, which contain their individual characters' information. + +### Starting a new game + +To reset the save data of the server, simply remove the `saves` folder. The next time someone connects to the server, they will start a new game, assuming the co-op mod is enabled. + +### Starting from a shared save file + +If you want all players to start playing from a specific save file, place it at `saves/world.sav` and remove the `saves/players` folder to force all players to start from that save file. + +If you do not remove the `saves/players` folder, the location and world state will be taken from `world.sav`, and the player progression (equipment, level, skills, etc.) will be taken from each player's individual save file. diff --git a/versioned_docs/version-0.2.4/docs/Server/server-list.mdx b/versioned_docs/version-0.2.4/docs/Server/server-list.mdx new file mode 100644 index 0000000..9fb423a --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/Server/server-list.mdx @@ -0,0 +1,113 @@ +--- +sidebar_position: 5 +--- + +# Publishing your server + +To list your server on the public server list in the Launcher, configure the `ServerList` section in `config.json`. + +:::note + +Any changes made to `config.json` require a **server restart** to take effect. + +::: + +### Configuration Settings + +| Setting | Type | Description | +| --- | --- | --- | +| `Enabled` | boolean | Whether to list the server publicly. | +| `Name` | string | Display name visible in the Launcher. Maximum 50 characters. | +| `Gamemode` | string | Game mode tag, shown next to the name. Maximum 15 characters. | +| `Description` | string | Optional. Short description shown on the server's card in the Launcher. Maximum 300 characters. | +| `Country` | string | Optional. Two-letter [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code (e.g. `PL`, `US`, `DE`), used to show a flag on the server's card. | +| `MaxPlayers` | integer | Maximum number of players. Must be between **1 and 64** (enforced when players connect). | +| `PublicHost` | string | Publicly routable IP address or hostname (maximum 253 characters). See [Host Validation](#host-validation-rules). | +| `PublicPort` | integer | The advertised port for players to connect to via the public IP. | +| `LicenseKey` | string | License key used to obtain verification. See [Verified status](#verified-status). | + +:::note + +These limits are enforced when your server reports to the public list. If a value is invalid (for example a description over 300 characters or a malformed country code), the server is not listed. + +::: + +Be respectful when choosing a name and gamemode tag, as they will be visible to all players in the Launcher. Violations of the [ReadyM Terms of Service](https://portal.ready.mp/en/terms) may result in your server being removed from the public list or your account being banned. + +### Minimal Configuration Example + +```json +{ +//highlight-start + "ServerList": { + "Enabled": true, + "Name": "Bob's arena", + "Gamemode": "PvP", + "Description": "Weekly PvP tournaments, all welcome", + "Country": "US", + "MaxPlayers": 32, + "PublicHost": "203.0.113.1", + "PublicPort": 9050, + "LicenseKey": "" + }, +//highlight-end + "Server": { "Port": 9050 } +} +``` + +--- + +## Network Configuration + +When configuring your server network layout, it is important to distinguish between the local binding port and the public routing port: + +* **`Server.Port`**: The local port the server software binds to on your host machine. +* **`ServerList.PublicPort`**: The external port advertised to the public internet that players will use to connect to your server. + +> These two ports can be different if your server operates behind a router using **Port Forwarding**, a network address translation (**NAT**) layer, or inside a virtualized environment like **Docker**. Ensure your external firewall routes incoming traffic from the `PublicPort` to your local `Server.Port`. + +--- + +## Host Validation Rules + +Our system evaluates the `PublicHost` string to ensure network validity. If your address does not comply with the following routing requirements, the server will fail to list publicly. + +### Hostnames vs. IP Addresses + +* **Hostnames**: Standard domain names (e.g., `server.example.com`) are accepted without remote resolution. The server automatically cleans up trailing dots (FQDN formatting) and strips IPv6 literal brackets (`[...]`). +* **Localhost Restriction**: Using `localhost` as a hostname is rejected by default to prevent internal routing loopbacks. + +### Blocked Network Ranges + +If an explicit IP address is supplied, it **must be publicly routable**. The system explicitly blocks the following private, local, and restricted address allocations: + +| Address Type | IPv4 Ranges | IPv6 Ranges / Rules | +| --- | --- | --- | +| **Loopback / Unspecified** | `127.0.0.0/8`, `0.0.0.0/8` | `::1`, `::`, IPv4-mapped loopbacks | +| **Private Networks** | `10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16` | Unique Local Addresses (`fc00::/7`) | +| **Link-Local / Site-Local** | `169.254.0.0/16` | Link-Local (`fe80::/10`), Site-Local | +| **Carrier-Grade NAT** | `100.64.0.0/10` | N/A | +| **Multicast & Reserved** | `224.0.0.0/4` through `255.255.255.255` | Multicast (`ff00::/8`) | + +--- + +## Verified status + +To get the **Verified** badge on the server list, provide a valid license key in `ServerList:LicenseKey`. You can generate keys on the [Player Portal](https://portal.ready.mp/en/dashboard/licenses). + +Server licenses in the Player Portal + +### License Allocations + +* An account can generate a maximum of **3 license keys**. +* **Key Sharing**: A single license key can be shared across multiple servers simultaneously. This allows you to host an unlimited number of public, verified servers using your allocated keys. *(Note: This behavior is subject to change in future portal updates).* + +:::warning + +The key is a secret and should not be shared publicly. If you believe your key has been compromised, generate a new one in the Player Portal and immediately revoke the compromised token. + +::: + +After entering a valid key in the configuration and restarting, the server will be marked as **Verified** in the Launcher: + +Verified server in the Launcher \ No newline at end of file diff --git a/versioned_docs/version-0.2.4/docs/quick-start.mdx b/versioned_docs/version-0.2.4/docs/quick-start.mdx new file mode 100644 index 0000000..b9f8ed1 --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/quick-start.mdx @@ -0,0 +1,148 @@ +--- +sidebar_position: 2 +--- + +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; + +# Quick Start + +Get a WukongMP server running in under 5 minutes. + +## 1. Download the server + + + + +[⬇ Download for Windows (x64, v0.2.4)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.2.4.zip) + + + + +[⬇ Download for Linux (x64, v0.2.4)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.2.4.zip) + + + + +```shell +docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 +``` + + + + +## 2. Extract and configure + + + + +Extract the `.zip` to a folder of your choice. The server is self-contained — no installer needed. + +To change the port (default: `9050`), open `config.json` and edit `Server:Port`. + + + + +Extract the `.zip` to a folder of your choice. The server is self-contained — no installer needed. + +To change the port (default: `9050`), open `config.json` and edit `Server:Port`. + + + + +Copy the config file from the image: + +```shell +docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.2.4 +docker cp wukongmp-tmp:/app/config.json ./config.json +docker rm wukongmp-tmp +``` + +Port configuration is handled by remapping the container ports — see step 3. + +:::important + +The image ships **without mods**. Before starting the container, download the binary package and copy `WukongMp.Sdk` and your chosen game mode mod (`WukongMp.PvP` or `WukongMp.Coop`) into your local `./mods/` folder. + +::: + + + + +## 3. Start the server + + + + +Double-click `server.exe`, or run it from a terminal: + +```shell +.\server.exe +``` + + + + +```shell +chmod +x server && ./server +``` + + + + +```shell +docker run \ + -p 9050:9050/udp -p 9050:9050/tcp \ + -v ./data:/app/data \ + -v ./mods:/app/mods \ + -v ./saves:/app/saves \ + -v ./config.json:/app/config.json \ + --name wukongmp-server \ + ghcr.io/readycodeio/wukongmp-server:0.2.4 +``` + +Or with Docker Compose: + +```yaml title="docker-compose.yml" +services: + server: + image: ghcr.io/readycodeio/wukongmp-server:0.2.4 + container_name: wukongmp-server + restart: unless-stopped + ports: + - "9050:9050/tcp" + - "9050:9050/udp" + volumes: + - ./data:/app/data + - ./mods:/app/mods + - ./saves:/app/saves + - ./config.json:/app/config.json +``` + + + + +## 4. Open the admin panel + +Once the server is running, open your browser and go to: + +``` +http://localhost:9050 +``` + +From here you can manage players, configure mods, and monitor your server in real time. + +--- + +🎉 **You're live!** Share your IP and port `:9050` with players — they'll need the ReadyM Launcher installed to connect. + +--- + +## Next steps + +| | | +|---|---| +| [Full Installation Guide](Server/installation) | Advanced configuration and options | +| [Admin Panel](Server/admin-panel) | Manage users, bans, and server settings | +| [Mod Management](Server/mod-management) | Install and configure mods | +| [Server List](Server/server-list) | Register your server publicly | diff --git a/versioned_docs/version-0.2.4/docs/what-is-wukong-mp.md b/versioned_docs/version-0.2.4/docs/what-is-wukong-mp.md new file mode 100644 index 0000000..c8087ba --- /dev/null +++ b/versioned_docs/version-0.2.4/docs/what-is-wukong-mp.md @@ -0,0 +1,95 @@ +--- +sidebar_position: 1 +--- + +# What is WukongMP? + +WukongMP is a community multiplayer platform for **Black Myth: Wukong**. It transforms the game's single-player experience into a living, community-driven world — letting players run their own servers, join co-op sessions, fight in PvP arenas, and build entirely custom game modes. + +WukongMP is built and maintained by the [ReadyM](https://www.ready.mp) team. It is **not** an official Black Myth: Wukong service and is not affiliated with Game Science. + +--- + +## What you can do + +### As a player + +- **Co-op** — explore the world and fight bosses alongside friends +- **PvP** — join community-run PvP servers with custom rulesets +- **One-click join** — automatic mod and resource sync means you never manually install modpacks; just click and play +- **Single account, all games** — your ReadyM account works across WukongMP and other ReadyM-supported titles + +### As a server owner + +- **Run your own server** — download the server binary or Docker image and host on any machine or cloud provider (including [Nodecraft](https://nodecraft.com/games/wukongmp-server-hosting)) +- **Custom game modes** — use the C# SDK to build roleplaying servers, survival modes, boss rush leagues, or PvP tournaments with fully custom logic +- **Mod management** — install, enable, and disable mods from the admin panel without restarting the server +- **Real-time analytics** — monitor how your community plays, track player counts, and watch server health in real time + +--- + +## How it works + +### For players + +1. **Create a ReadyM account** at [portal.ready.mp](https://portal.ready.mp/signup) +2. **Download the launcher** — it handles mod sync automatically when you join a server +3. **Pick a server and play** — browse the server list, click join, and the launcher takes care of the rest + +### For server owners + +1. **Download the server binary** (Windows or Linux) or pull the Docker image — see the [Quick Start guide](quick-start) to be live in minutes +2. **Configure** — edit `config.json` to set your port, then drop mods into the `mods/` folder +3. **Launch and manage** — start the server and use the built-in web admin panel to manage players, mods, and settings + +--- + +## The ReadyM platform + +WukongMP runs on top of the **ReadyM SDK and platform**, which provides the shared infrastructure that makes community multiplayer possible: + +| Feature | Description | +|---|---| +| **Secure SSO** | Players authenticate via their ReadyM account — no per-server account systems needed | +| **Automatic mod sync** | The launcher installs the exact mods a server requires before connecting | +| **C# scripting engine** | Write server-side game logic in C# with access to game events, entity data, commands, and custom RPC | +| **Server binary** | A self-contained deployable package optimised for cloud and dedicated hardware | +| **Admin panel** | Built-in web UI for live server management, accessible at `http://your-server:9050` | + +ReadyM is designed to do for community-run game servers what FiveM did for *Grand Theft Auto V* — a democratic, open platform where anyone can create and share custom multiplayer experiences. + +--- + +## Current status + +WukongMP is in **active development**. The SDK reached public open beta in May 2026. + +| Area | Status | +|---|---| +| Co-op and PvP servers | ✅ Available | +| Server binary (Windows & Linux) | ✅ Available | +| Docker image | ✅ Available | +| SDK (C# scripting) | ✅ Public open beta | +| Custom RPC | ✅ Available | +| Save file API | 🚧 Partial | +| Custom data sync | 🔜 In progress | +| Server-side mods | 🔜 In progress | + +For the full SDK feature breakdown, see [Getting Started](Development/getting-started). + +--- + +## Partners + +ReadyM works with industry partners to provide the best possible server hosting and tooling experience: + +- **[Nodecraft](https://nodecraft.com/games/wukongmp-server-hosting)** — official managed hosting provider for WukongMP servers + +--- + +## Get started + +- 👾 **Player?** [Create a ReadyM account](https://portal.ready.mp/signup) and download the launcher +- 🖥️ **Server owner?** Follow the [Quick Start guide](quick-start) to get your server live in minutes +- ⚡ **Developer?** See [Getting Started](Development/getting-started) to build your first mod with the SDK +- 💬 **Questions?** Join the [WukongMP Discord](https://dsc.gg/readym) diff --git a/versioned_sidebars/version-0.2.4-sidebars.json b/versioned_sidebars/version-0.2.4-sidebars.json new file mode 100644 index 0000000..4187919 --- /dev/null +++ b/versioned_sidebars/version-0.2.4-sidebars.json @@ -0,0 +1,14 @@ +{ + "wukongMpDocsSidebar": [ + { + "type": "autogenerated", + "dirName": "docs" + } + ], + "wukongMpApiSidebar": [ + { + "type": "autogenerated", + "dirName": "api-reference" + } + ] +} diff --git a/versions.json b/versions.json index 7b999c7..95a6020 100644 --- a/versions.json +++ b/versions.json @@ -1,3 +1,4 @@ [ + "0.2.4", "0.1.0" ] From 1577694f85ae91f7315ac3f601f521b24b8c9581 Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Tue, 11 Aug 2026 15:47:27 +0200 Subject: [PATCH 02/12] Update version number --- wukong-mp/docs/Server/installation.mdx | 11 +++++++---- wukong-mp/docs/quick-start.mdx | 8 +++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/wukong-mp/docs/Server/installation.mdx b/wukong-mp/docs/Server/installation.mdx index e6b7ef1..f8c479d 100644 --- a/wukong-mp/docs/Server/installation.mdx +++ b/wukong-mp/docs/Server/installation.mdx @@ -103,13 +103,13 @@ A Linux-based x64 Docker image is also available for those who prefer containeri Pull the image from the registry: ```shell -docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 +docker pull ghcr.io/readycodeio/wukongmp-server:0.3.0 ``` Copy the config file from the image: ```shell -docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.2.4 +docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.3.0 docker cp wukongmp-tmp:/app/config.json ./config.json docker rm wukongmp-tmp ``` @@ -124,10 +124,11 @@ docker run \ -p 9050:9050/udp -p 9050:9050/tcp \ -v ./data:/app/data \ -v ./mods:/app/mods \ + -v ./server_mods:/app/server_mods \ -v ./saves:/app/saves \ -v ./config.json:/app/config.json \ --name wukongmp-server \ - ghcr.io/readycodeio/wukongmp-server:0.2.4 + ghcr.io/readycodeio/wukongmp-server:0.3.0 ``` @@ -136,7 +137,7 @@ docker run \ ```yaml title="docker-compose.yml" services: server: - image: ghcr.io/readycodeio/wukongmp-server:0.2.4 + image: ghcr.io/readycodeio/wukongmp-server:0.3.0 container_name: wukongmp-server restart: unless-stopped ports: @@ -145,6 +146,7 @@ services: volumes: - ./data:/app/data - ./mods:/app/mods + - ./server_mods:/app/server_mods - ./saves:/app/saves - ./config.json:/app/config.json ``` @@ -155,6 +157,7 @@ services: :::important The image ships **without mods**. Copy `WukongMp.Sdk` and the mode you want (`WukongMp.PvP`, `WukongMp.Coop`) from the binary ZIP into your `mods/` volume before starting the container. +The same applies to server-side mods and the `server_mods` folder. ::: diff --git a/wukong-mp/docs/quick-start.mdx b/wukong-mp/docs/quick-start.mdx index b9f8ed1..042a31d 100644 --- a/wukong-mp/docs/quick-start.mdx +++ b/wukong-mp/docs/quick-start.mdx @@ -53,7 +53,7 @@ To change the port (default: `9050`), open `config.json` and edit `Server:Port`. Copy the config file from the image: ```shell -docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.2.4 +docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.3.0 docker cp wukongmp-tmp:/app/config.json ./config.json docker rm wukongmp-tmp ``` @@ -95,10 +95,11 @@ docker run \ -p 9050:9050/udp -p 9050:9050/tcp \ -v ./data:/app/data \ -v ./mods:/app/mods \ + -v ./server_mods:/app/server_mods \ -v ./saves:/app/saves \ -v ./config.json:/app/config.json \ --name wukongmp-server \ - ghcr.io/readycodeio/wukongmp-server:0.2.4 + ghcr.io/readycodeio/wukongmp-server:0.3.0 ``` Or with Docker Compose: @@ -106,7 +107,7 @@ Or with Docker Compose: ```yaml title="docker-compose.yml" services: server: - image: ghcr.io/readycodeio/wukongmp-server:0.2.4 + image: ghcr.io/readycodeio/wukongmp-server:0.3.0 container_name: wukongmp-server restart: unless-stopped ports: @@ -115,6 +116,7 @@ services: volumes: - ./data:/app/data - ./mods:/app/mods + - ./server_mods:/app/server_mods - ./saves:/app/saves - ./config.json:/app/config.json ``` From b9e6ffa0698a772ef05f6eaa19c2518fd1355570 Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Tue, 11 Aug 2026 17:52:14 +0200 Subject: [PATCH 03/12] Document server-side scripting and network panel --- blog/2026-04-27-sdk-020.md | 2 +- .../2026-04-27-sdk-020.md | 2 +- scripts/docfx-wukong/docfx.json | 8 + .../docs/Development/Examples/swarm-mode.md | 2 +- wukong-mp/docs/Development/custom-rpc.md | 100 +++++++++--- wukong-mp/docs/Development/getting-started.md | 6 +- .../docs/Server-development/_category_.json | 6 + .../docs/Server-development/archetypes.md | 154 ++++++++++++++++++ .../docs/Server-development/custom-rpc.md | 108 ++++++++++++ .../Server-development/getting-started.md | 147 +++++++++++++++++ wukong-mp/docs/Server-development/systems.md | 124 ++++++++++++++ wukong-mp/docs/Server/admin-panel.mdx | 1 + wukong-mp/docs/Server/installation.mdx | 10 +- wukong-mp/docs/Server/mod-management.md | 31 +++- wukong-mp/docs/Server/network-stats.mdx | 97 +++++++++++ 15 files changed, 763 insertions(+), 35 deletions(-) create mode 100644 wukong-mp/docs/Server-development/_category_.json create mode 100644 wukong-mp/docs/Server-development/archetypes.md create mode 100644 wukong-mp/docs/Server-development/custom-rpc.md create mode 100644 wukong-mp/docs/Server-development/getting-started.md create mode 100644 wukong-mp/docs/Server-development/systems.md create mode 100644 wukong-mp/docs/Server/network-stats.mdx diff --git a/blog/2026-04-27-sdk-020.md b/blog/2026-04-27-sdk-020.md index bf9b177..fa07b6c 100644 --- a/blog/2026-04-27-sdk-020.md +++ b/blog/2026-04-27-sdk-020.md @@ -25,7 +25,7 @@ Read on for the full list of changes and the [Migration Guide](/releases/wukongm ## SDK updates - The PvP mod is now included in the server package, alongside the co-op mod, both built on top of SDK version `0.2.0`. -- RPC event handlers built on top of [RpcClassBase](../wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase) now have access to the `RunOnMainThread` method, which allows you to schedule callbacks to run on the main thread in a safe way. This is particularly useful for RPC handlers that need to interact with the game world, as doing so from the network thread can cause crashes. +- RPC event handlers built on top of [RpcClassBase](../wukong-mp/0.2.4/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase) now have access to the `RunOnMainThread` method, which allows you to schedule callbacks to run on the main thread in a safe way. This is particularly useful for RPC handlers that need to interact with the game world, as doing so from the network thread can cause crashes. - In-game chat has been re-enabled. - API methods related to the built-in chat have been moved from the [Local API](../wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi) to the new [Chat API](../wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi) for better organization and separation of concerns. - Two new (temporary) APIs - [PvP API](../wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi) and [Cheats API](../wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi) were used to implement the self-hosted version of the PvP mod before server-side scripting is ready. Once server-side scripting is implemented, these APIs will be removed and their functionality will be implemented using regular server-side mods instead. diff --git a/i18n/zh-Hans/docusaurus-plugin-content-blog/2026-04-27-sdk-020.md b/i18n/zh-Hans/docusaurus-plugin-content-blog/2026-04-27-sdk-020.md index 7b759e4..e95dccd 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-blog/2026-04-27-sdk-020.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-blog/2026-04-27-sdk-020.md @@ -28,7 +28,7 @@ hide_table_of_contents: false - PvP 模组现已包含在服务器包中,与合作模组一起,二者均基于 SDK 版本 `0.2.0` 构建。 - 基于 - [RpcClassBase](../wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase) + [RpcClassBase](../wukong-mp/0.2.4/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase) 构建的 RPC 事件处理程序现在可以访问 `RunOnMainThread` 方法,该方法允许你以安全的方式将回调安排在主线程上执行。这对于需要与游戏世界交互的 RPC 处理程序尤为有用,因为在网络线程中执行此操作可能导致崩溃。 - 游戏内聊天已重新启用。 diff --git a/scripts/docfx-wukong/docfx.json b/scripts/docfx-wukong/docfx.json index 8c9ef19..6323d0d 100644 --- a/scripts/docfx-wukong/docfx.json +++ b/scripts/docfx-wukong/docfx.json @@ -12,6 +12,14 @@ "WukongMp.Sdk.dll" ] }, + { + "src": "../../../../wukong-csharp-mod/readym-gameserver/src/WukongMp.Sdk.Serverside/bin/Debug/net10.0", + "files": [ + "WukongMp.Sdk.Serverside.dll", + "ReadyM.Relay.Server.Sdk.dll", + "ReadyM.Wukong.Common.dll" + ] + }, { "src": "../../../../embed-csharp-loader/HarmonyPrepatcher/src/PreludeLib/bin/Release/netstandard2.0", "files": [ diff --git a/wukong-mp/docs/Development/Examples/swarm-mode.md b/wukong-mp/docs/Development/Examples/swarm-mode.md index 19c1f55..6eb9336 100644 --- a/wukong-mp/docs/Development/Examples/swarm-mode.md +++ b/wukong-mp/docs/Development/Examples/swarm-mode.md @@ -69,7 +69,7 @@ We use the `AreaOfInterestAll` [Relay mode](../../../api-reference/ReadyM.Api.Mu Refer to the [RPC documentation](../custom-rpc) to learn what else you can do in RPC classes. ```csharp title="Custom RPC class" -public partial class Rpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class Rpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestAll)] private void OnSwarmStarted(PlayerId __sender) diff --git a/wukong-mp/docs/Development/custom-rpc.md b/wukong-mp/docs/Development/custom-rpc.md index 519676f..273d47e 100644 --- a/wukong-mp/docs/Development/custom-rpc.md +++ b/wukong-mp/docs/Development/custom-rpc.md @@ -4,16 +4,21 @@ sidebar_position: 5 # Custom RPC -One of the core WukongMP SDK functionalities is the support for arbitrary Remote Procedure Call (RPC) functions. These can have arbitrary payloads and support a number of [Relay Modes](../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode). +The WukongMP SDK supports two kinds of Remote Procedure Call (RPC) messages: -RPC handlers allow you to define your own events that are sent to other players connected to the same server. +* **Client-relayed RPC**, sent by a client and relayed by the server to other clients. The server does not react to these messages, it only forwards them. This is what most of this page covers. +* **Server RPC**, sent by a client to the server, which runs your server-side logic and may reply. Contracts and server-side handlers for these are defined in [server-side development](../Server-development/custom-rpc). This page covers how to handle the client side of a server RPC. -## Declaring an RPC handler class +## Client-relayed RPC -In order to add custom RPC procedures to your mod, you must define a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class that extends [RpcClassBase](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase). +Client-relayed RPC lets you define your own events that are sent to other players connected to the same server, without any server-side logic involved. These can have arbitrary payloads and support a number of [Relay Modes](../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode). + +### Declaring an RPC handler class + +In order to add custom RPC procedures to your mod, you must define a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class that extends [ClientRpcHandler](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler). ```csharp title="Minimal RPC class definition" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { // RPC handlers go here } @@ -24,16 +29,25 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc For any of the RPC handlers to be registered, the class **must** be added to the DI container in your mod's `Initialize` method. Consult the documentation for [ModBase](../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase). +```csharp +protected override void Initialize(IDependencyContainer services) +{ + services.RegisterSingleton(); +} +``` + ::: -## Defining RPC handlers +Dependencies are injected through the constructor, so a handler that needs a logger or another service takes it as a primary constructor parameter: `public partial class MyRpc(ILogger logger) : ClientRpcHandler`. + +### Defining RPC handlers In order to add a new RPC handler to your mod, add a method decorated with the [RpcEvent](../../api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute) attribute. -Method names must start with "On..." — corresponding "Send..." methods for sending the RPC will be generated automatically in the same class. +Method names must start with "On...", and corresponding "Send..." methods for sending the RPC will be generated automatically in the same class. ```csharp title="Minimal RPC handler" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestOthers)] private void OnMyCustomCall() @@ -57,7 +71,7 @@ Currently, the following modes are supported: | **GlobalOthers** | Message is sent to all other players on the server | | **GlobalAll** | Message is sent to all players on the server, including the sender | -## Sending data +### Sending data RPC handlers support passing data in parameters that are either: @@ -67,12 +81,12 @@ RPC handlers support passing data in parameters that are either: An RPC hander can have any number of these parameters declared in any order. The generated "Send..." methods will have the same parameters (excluding the injected ones). -### Primitive data types +#### Primitive data types We support all primitive data types defined in the C# runtime: `bool`, `char`, `sbyte`, `byte`, `short`, `ushort`, `int`, `uint`, `long`, `ulong`, `float`, `double`, and `string`. ```csharp title="Passing primitive data" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestOthers)] private void OnMyCustomCall(int number, string text) @@ -85,14 +99,14 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc } ``` -### Complex data types +#### Complex data types You can use complex data structures in your RPC parameters. These must extend the [INetSerializable](https://revenantx.github.io/LiteNetLib/api/LiteNetLib.Utils.INetSerializable.html) interface. The fields of the payload structures can be of any serializable type, including other complex types, provided they also extend [INetSerializable](https://revenantx.github.io/LiteNetLib/api/LiteNetLib.Utils.INetSerializable.html). ```csharp title="Complex RPC parameter example" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestOthers)] private void OnPlayerBuffed(BuffData payload) @@ -140,7 +154,7 @@ public struct BuffAddData(int buffId, float duration) : INetSerializable } ``` -### Special parameters +#### Special parameters Right now there is only one special parameter that can be used. We might expand this functionality in future versions of the SDK. @@ -151,7 +165,7 @@ Right now there is only one special parameter that can be used. We might expand This parameter can be used alongside other parameters, but is not visible in the generated "Send..." method. ```csharp title="Using injected parameters" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestOthers)] private void OnComplexEvent(int number, PlayerId __sender, BuffData buffData) @@ -168,24 +182,60 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc } ``` -## Executing callbacks on the main thread +### Threading -RPC handlers are executed on a separate network thread, so they should not interact with the game world directly, as doing so can cause crashes. However, you can schedule callbacks to be executed on the main thread using the [RunOnMainThread](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase#-runonmainthreadaction) method available in your RPC handler class. +Messages arrive on a separate network thread, but the SDK schedules every `[RpcEvent]` handler onto the game thread before invoking it. Your handler body can touch the game world directly, so working with Unreal Engine objects needs no extra ceremony: -```csharp title="Running code on the main thread" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +```csharp title="Touching the game world from a handler" +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestAll)] private void OnDespawnAllMonsters() { - // destroying an Unreal Engine pawn must be done on the main thread - RunOnMainThread(() => + foreach (var monster in WukongApi.Sync.AreaTamers) + { + monster.Tamer?.CurrentRef.DestroyTamer(); // calls BGU_UnrealWorldUtil.DestroyActor + } + } +} +``` + +Because handlers run on the game thread, they also share its budget. Anything expensive belongs in a [system](systems) or on a background task, not in the handler body. + +:::note + +This is specific to client-relayed RPC. Server RPC response handlers are **not** scheduled for you, see below. + +::: + +## Handling server RPC on the client + +Server RPC contracts are declared in a common project shared by the server and client mods, and describe both the request (client to server) and response (server to client) shapes of an RPC. See [server-side development](../Server-development/custom-rpc) for how they are defined. + +On the client, define a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class extending [ServerRpcClient](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient) to send requests to the server and handle its responses. As with client-relayed RPC, the class must be registered in your mod's `Initialize` method. + +Unlike `[RpcEvent]` handlers, these are invoked on the network thread as the response is parsed. Wrap anything that touches the game world in `RunOnGameThread`: + +```csharp title="Client-side server RPC handling" +public partial class MyServerRpc : ServerRpcClient +{ + // called when the server responds to our ScaleBossHp request + partial void OnBossHpScaleConfirm(int scalingPercent, int players) + { + RunOnGameThread(() => { - foreach (var monster in WukongApi.Sync.AreaTamers) - { - monster.Tamer?.CurrentRef.DestroyTamer(); // calls BGU_UnrealWorldUtil.DestroyActor - } + WukongApi.Chat.ShowLocalMessage( + $"Boss HP is set to {scalingPercent}% and multiplied by {players} players.", + FLinearColor.Gray); }); } } ``` + +Calling the generated `Send...` method sends the request to the server: + +```csharp +WukongApi.Services.Resolve().SendScaleBossHp(150); +``` + +Only the legs declared by the shared contract are generated: a one-way client-to-server RPC has no `On...` handler stub on the client, and a one-way server-to-client RPC has no `Send...` method. diff --git a/wukong-mp/docs/Development/getting-started.md b/wukong-mp/docs/Development/getting-started.md index 3eaffb8..2edf977 100644 --- a/wukong-mp/docs/Development/getting-started.md +++ b/wukong-mp/docs/Development/getting-started.md @@ -12,7 +12,7 @@ Clone the repository and follow instructions provided in the [README](https://gi Right now you can develop mods that have access to game events, entity data (players, enemies), and can define custom commands and game logic systems. -Support for server-side logic and custom data sync is on the way. +Mods can also run logic on the server itself: see [server-side development](../Server-development/getting-started). Visit the [examples](/wukong-mp/category/mod-examples) page for some inspiration, or browse the source code of the [co-op](https://github.com/readycodeio/WukongMP-co-op-mod) and [PvP](https://github.com/readycodeio/WukongMP-PvP-mod) mods. @@ -23,5 +23,5 @@ Visit the [examples](/wukong-mp/category/mod-examples) page for some inspiration | Console command API | :white_check_mark: [done](../Development/APIs/console-commands) | | Custom RPC | :white_check_mark: [done](../Development/custom-rpc) | | Save file API | :construction: [partial](../Development/APIs/save-file-management) | -| Custom data sync | :soon: [in progress](../Development/APIs/custom-components) | -| Server-side mods | :soon: in progress | +| Custom data sync | :white_check_mark: [done](../Server-development/archetypes) | +| Server-side mods | :white_check_mark: [done](../Server-development/getting-started) | diff --git a/wukong-mp/docs/Server-development/_category_.json b/wukong-mp/docs/Server-development/_category_.json new file mode 100644 index 0000000..2a08fec --- /dev/null +++ b/wukong-mp/docs/Server-development/_category_.json @@ -0,0 +1,6 @@ +{ + "collapsible": true, + "collapsed": false, + "position": 5, + "label": "Server-side development" +} diff --git a/wukong-mp/docs/Server-development/archetypes.md b/wukong-mp/docs/Server-development/archetypes.md new file mode 100644 index 0000000..6e711e5 --- /dev/null +++ b/wukong-mp/docs/Server-development/archetypes.md @@ -0,0 +1,154 @@ +--- +sidebar_position: 4 +--- + +# Archetypes and components + +An **archetype** is the fixed set of components an entity is created with. WukongMP exposes four built-in archetypes that your server mod can query and extend: + +- the **area** entity (one per active area), +- the **global player entity** (one per connected player), +- the **tamer** (an enemy in the world), +- the **main character** (the player's pawn in the world). + +They are named by [WukongArchetypes](../../api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes), a small class that maps each one to its [ArchetypeId](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId): + +```csharp +var archetypes = new WukongArchetypes(); +// archetypes.AreaArchetype +// archetypes.GlobalPlayerArchetype +// archetypes.TamerArchetype +// archetypes.MainCharacterArchetype +``` + +The class holds fixed IDs and no state, so constructing it directly is fine. `WukongMp.Sdk.Serverside` also registers it as a singleton. + +:::danger[Do not hardcode archetype IDs] + +The numeric IDs behind these properties are an implementation detail of the current release and will change. Do not hardcode these, but rather go through `WukongArchetypes`. + +::: + +Attach your own [networked components](getting-started#registering-components-and-archetypes) to any of these in your mod's `Init`, the same way the bounty example does in [Getting started](getting-started#registering-components-and-archetypes). The tables below list the components each archetype already carries, so you know what is available to query. + +:::warning[The access API is temporary] + +Right now you read and write these components through the low-level [`EcsApi`](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi) (raw `Query` calls and `ref` component access). This is deliberately bare-bones for `0.3.0`. A higher-level, less raw server API is planned, so expect the way you access entity data to change in a later release. + +::: + +## Area entity + +One entity per active area, carrying the state that belongs to the area rather than to any player in it. + +:::info[What are areas?] + +In Black Myth: Wukong, an area is a loaded map. Each main story act has one, each hidden boss location or arena has one, etc. If you need to go through a loading screen, you are changing an area. + +::: + +This is where room rules live, so a system that needs to know whether cheats are allowed or whether a cutscene has already played reads it here. + +| Component | Description | +| --- | --- | +| [`AreaScopeComponent`](../../api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent) | The `AreaId` this entity scopes to. | +| [`RoomComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent) | Room configuration: level, tournament rounds, whether the gourd, consumables, immobilize, Phantom Rush, chat, cheats and anti-stall are allowed, and the NG+ level spawned enemies scale to in PvP. | +| [`MovieComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent) | Which cutscenes have started and finished in this area. | + +`AreaScopeComponent` is the component every area-scoped entity is matched on. Pairing it with a component of your own is how you narrow a query to a single area, as the SDK's own movie handlers do. + +## Global player entity + +One entity per connected player. It exists for the whole session, independent of which area the player is in, and is the right place to hang **persistent, player-scoped** data. Players are identified by their [`PlayerId`](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId) on this entity. + +| Component | Description | +| --- | --- | +| [`PlayerScopeComponent`](../../api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent) | The owning player's `PlayerId`. | +| [`PlayerComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent) | Persisted nickname and the player's team ID. | + +This is the archetype that mod-registered "global" player components are added to. + +## Tamer + +A tamer is an enemy entity: everything from a wandering mob to a boss. Area-scoped, so it exists while the area is active and is destroyed with it when the last player leaves. + +| Component | Description | +| --- | --- | +| [`TamerComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent) | The tamer's GUID and unit path, whether it is a boss or elite, whether its logic is paused, and which players are keeping it spawned. | +| [`TransformComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent) | World position and rotation. | +| [`HpComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent) | Current HP, base max HP, the max HP multiplier in percent, and death state. | +| [`NicknameComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent) | Displayed name. Used in PvP to display "Bot" overhead. | +| [`TeamComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent) | Team ID of the underlying game actor. | +| [`AnimationComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent) | Movement animation state: velocity, acceleration and move speed level. | +| [`MonsterAnimationComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent) | Move AI type and animation play rate. | + +## Main character + +The player's pawn in the world: an **area-scoped** entity that exists while the player is present in an area. It holds the character's live state and is linked to the global player entity by the same `PlayerId`. + +When crossing between areas, this entity is destroyed and recreated, so persistent data should not be stored here. + +| Component | Description | +| --- | --- | +| [`MainCharacterComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent) | The owning `PlayerId` plus the character's live state: movement, animation flags, transformation, spectator state, rebirth point, attributes and equipment. | +| [`TransformComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent) | World position and rotation. | +| [`HpComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent) | Current HP, base max HP, the max HP multiplier in percent, and death state. | +| [`NicknameComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent) | The player's displayed name, copied from `PlayerComponent` on area change. | +| [`TeamComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent) | Team ID of the underlying game actor. | +| [`PvPComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent) | Whether the player has readied up for PvP. | + +`MainCharacterComponent` is the component to pair with when you want per-player data, because it is the one that carries the `PlayerId` in the world. Almost every query in a server mod starts here. + +All of the above are the game's own networked components, defined in `ReadyM.Wukong.Common`. + +:::note[PvP state] + +The PvP mod adds a fifth, global archetype holding a single [`PvpStateComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent) with the match settings and round state. `WukongArchetypes.PvpStateArchetype` still names it, but it is marked obsolete and will move into the PvP mod, so treat it as PvP-internal rather than part of the SDK surface. + +::: + +## Registering your own archetype + +Besides extending the built-in archetypes, a mod can register an entirely new one with `RegisterArchetype`. Register your components in `RegisterComponents` first, then build the archetype in `Init` and keep the returned `ArchetypeId` so you can create entities with it later. + +```csharp title="Registering a new archetype and attaching a component to an existing one" +public class Mod : ServerModBase +{ + public static ArchetypeId ShrineArchetype { get; private set; } + + protected override void RegisterComponents(IComponentRegistry registry) + { + // A component must be registered before any archetype can use it. + registry.RegisterComponent(); + registry.RegisterComponent(); + } + + protected override void Init() + { + var registry = Services.Resolve(); + + // A brand new archetype: one of the game's components plus one of our own. + ShrineArchetype = registry.RegisterArchetype(b => b + .Add() + .Add()); + + // Attaching a component to a built-in archetype instead. + var archetypes = new WukongArchetypes(); + registry.ModifyArchetype(archetypes.GlobalPlayerArchetype, b => b.Add()); + } +} +``` + +Both calls take a builder, where `Add()` declares one component on the archetype. The game's own components are resolved by type, so you can freely mix them with your own. + +With the `ArchetypeId` in hand, create entities from it through `EcsApi`: + +```csharp +var entity = ecsApi.CreateEntity(Mod.ShrineArchetype); +``` + +:::important + +An archetype your mod registers exists only on the server unless the client mod registers a matching one. Keep the component set and its order identical on both sides. + +::: diff --git a/wukong-mp/docs/Server-development/custom-rpc.md b/wukong-mp/docs/Server-development/custom-rpc.md new file mode 100644 index 0000000..fa99d8e --- /dev/null +++ b/wukong-mp/docs/Server-development/custom-rpc.md @@ -0,0 +1,108 @@ +--- +sidebar_position: 3 +--- + +# Custom RPC + +Server RPC lets a client send a request to the server and, optionally, receive a response. Unlike [client-relayed RPC](../Development/custom-rpc#client-relayed-rpc), the server always runs your code first: it decides whether and how to reply. + +A server RPC is defined once, as a **contract** shared between the server mod and the client mod, in a common project both reference. The contract declares the shape of each direction of the message. The server mod implements the handler, and the client mod implements the response handler described in [Handling server RPC on the client](../Development/custom-rpc#handling-server-rpc-on-the-client). + +## Declaring a contract + +A contract is a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) static class decorated with `[ServerRpcContracts]`, containing one partial method per RPC. Each method must be marked with `[ClientToServer]`, `[ServerToClient]`, or both, declaring which direction(s) it carries: + +```csharp title="A contract with a one-way push and a request/response pair" +using ReadyM.Api.Multiplayer; + +[ServerRpcContracts] +public static partial class RpcContracts +{ + // one-way push: only the server can send this + [ServerToClient] public static partial void BeguilingChant(byte state); + + // request/response: the two directions can have different payloads, since they + // are declared as separate overloads + [ClientToServer] public static partial void ScaleBossHp(int scalingPercent); + [ServerToClient] public static partial void BossHpScaleConfirm(int scalingPercent, int players); +} +``` + +* A method with only `[ClientToServer]` is a one-way command: the client sends it, the server handles it, and there is no reply. +* A method with only `[ServerToClient]` is a one-way push: only the server can send it. +* Two overloads of the same name, one of each attribute, form a request/response pair. Their payloads do not need to match. +* A single method carrying **both** attributes is a symmetric two-way message, sharing one payload shape. + +Parameters follow the same rules as [client-relayed RPC](../Development/custom-rpc#sending-data): primitive types or `[DeriveINetSerializable]` structs. + +:::important + +The contract project is referenced by both the server mod and the client mod, and both sides read the wire codes from it. Recompile and ship them together, or the two sides will disagree about which code means what. + +::: + +## Declaring server-side handlers + +Implement the server side of a contract in a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class extending [ServerRpcHandlersBase](../../api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase). For every `[ClientToServer]` leg of the contract, define a matching `On...` partial method. The SDK generates the corresponding `Send...` method for any `[ServerToClient]` leg. + +```csharp title="Server-side RPC handler" +public partial class RpcHandlers(ScaleHpSystem hpScaling, EcsApi ecs) : ServerRpcHandlersBase +{ + partial void OnScaleBossHp(RpcContext context, int scalingPercent) + { + hpScaling.ScalingPercent = scalingPercent; + + var players = 0; + ecs.Query(ref players, static (ref _, ref players) => { players++; }); + + // confirm to everyone, since the setting affects the whole server + ecs.Query((ref player) => + { + // generated by the SDK + SendBossHpScaleConfirm(player.PlayerId, scalingPercent, players); + }); + } +} +``` + +The [RpcContext](../../api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext) parameter is always injected first and exposes `Sender`, the [PlayerId](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId) of the client that sent the request. Generated `Send...` methods take a `PlayerId` recipient as their first parameter, followed by the response payload. There is no broadcast overload: to reach every player, query the main characters and send to each, as above. + +:::important + +For any of the RPC handlers to be registered, the class **must** be added to the dependency injection container in your mod's `Init` method. + +```csharp +protected override void Init() +{ + Services.RegisterSingleton(); +} +``` + +::: + +## Replying to just the sender + +When the response is only meaningful to the client that asked, match the sender against the entity you are about to read. Pairing your component with `MainCharacterComponent` gives you the `PlayerId` to compare against: + +```csharp title="Answering one player" +partial void OnGetBounty(RpcContext context) +{ + ecs.Query((ref main, ref bounty) => + { + if (main.PlayerId == context.Sender) + { + SendGetBounty(context.Sender, bounty.Kills); + } + }); +} +``` + +A client can only ask the server to act on its own behalf, but nothing stops a malformed or malicious request from naming someone else's entity or passing an out-of-range value. Always check `context.Sender` against the entity you are about to modify, and validate payloads before applying them. + +## Handlers run on the network thread + +`On...` methods are invoked on the network thread as the packet is parsed, not on the server tick. Reading and writing components through `EcsApi` from a handler is supported, but long-running work is not: it blocks packet processing for every client. If the response depends on state that only a system can produce, store the request and let the system act on it, as shown in [Gameplay systems](systems#systems-and-rpc-handlers-together). + +## Client side + +See [Handling server RPC on the client](../Development/custom-rpc#handling-server-rpc-on-the-client) for how to send requests and handle responses from your client-side mod. diff --git a/wukong-mp/docs/Server-development/getting-started.md b/wukong-mp/docs/Server-development/getting-started.md new file mode 100644 index 0000000..8275cb7 --- /dev/null +++ b/wukong-mp/docs/Server-development/getting-started.md @@ -0,0 +1,147 @@ +--- +sidebar_position: 1 +--- + +# Getting started + +Server-side mods run inside the WukongMP relay server. They can register their own networked components, attach them to existing archetypes, run gameplay systems on the server tick, and handle RPCs sent by clients. + +A server-side mod is a .NET class library referencing the server SDK, defining a single class extending [ServerModBase](../../api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase). Its assembly is placed directly in the server's [`server_mods/` directory](../Server/mod-management#server-side-mods), a separate location from the client-facing `mods/` folder, where the mod loader picks it up and instantiates the class when the server starts. + +```csharp title="Minimal server mod class" +using ReadyM.Relay.Server.Sdk; +using ReadyM.Relay.Server.Sdk.Ecs.Components; + +public class MyServerMod : ServerModBase +{ + protected override void RegisterComponents(IComponentRegistry registry) + { + // register your networked components here + } + + protected override void Init() + { + // register systems, RPC handlers, and modify archetypes here + } +} +``` + +`RegisterComponents` runs first, before the server's ECS schema is finalized. This is the only place you can register new networked components. `Init` runs afterwards and is where you resolve services, register [systems](systems) and [RPC handlers](custom-rpc), and attach components to archetypes. + +:::tip[Learn from a shipping mod] + +The [co-op mod](https://github.com/readycodeio/WukongMP-co-op-mod) is built on this SDK and ships with the server. Its `WukongMp.Coop.Serverside` project is a small, complete example of everything on these pages: two systems, one RPC handler, and a shared contract project. The [PvP mod](https://github.com/readycodeio/WukongMP-PvP-mod) is not updated to use server-side features. + +::: + +## Setting up the project + +A server-side mod targets `net10.0`, unlike client-side mods which target `netstandard2.0`. It references the server SDK and the shared WukongMP assemblies, all of which ship in the server package. Use to the [mod template](https://github.com/readycodeio/wukongmp-mod-template) to get started with creating a server-side mod. + +A typical setup for a fully-featured mod involves **three projects**: + +* A shared `netstandard2.0` mod that contains type definitions and RPC contracts. +* A server-side mod, targeting `net10.0`, and referencing the shared mod. +* A client-side mod, targeting `netstandard2.0`, and referencing the shared mod. + +## Registering components and archetypes + +A networked component is declared with `[DeriveINetworkedComponent]` on a `partial struct`. The generator turns each private field into a public property and writes the serialization code: + +```csharp title="A networked component (in the shared project)" +using System.Runtime.InteropServices; +using ReadyM.Api.Multiplayer.Generators; + +[DeriveINetworkedComponent] +[StructLayout(LayoutKind.Auto)] +public partial struct BountyComponent +{ + private int _kills; + private float _multiplier; +} +``` + +Register it in `RegisterComponents`, then attach it to an archetype in `Init`: + +```csharp title="Registering a component and attaching it to the global player archetype" +public class MyServerMod : ServerModBase +{ + protected override void RegisterComponents(IComponentRegistry registry) + { + registry.RegisterComponent(); + } + + protected override void Init() + { + var registry = Services.Resolve(); + var archetypes = new WukongArchetypes(); + + registry.ModifyArchetype(archetypes.GlobalPlayerArchetype, archetype => + { + archetype.Add(); + }); + } +} +``` + +A running kill count is persistent, player-scoped data, so it belongs on the **global player entity**: one entity per connected player that lives for the whole session, regardless of which area the player is in. Data that describes the character's presence in the world (position, HP, team) belongs on the main character instead. See [Archetypes and components](archetypes) for what each archetype carries. + +:::important + +A networked component's shape and its archetype membership must match between the server mod and every client mod. Ship server-side and client-side mods together as versions of the same package. + +::: + +## Reading and writing entity data + +Inside your mod, use [EcsApi](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi) (resolved with `Services.Resolve()`, or injected into your class) to query and modify entities. Every matching entity is visited once per call, with the requested components passed by reference: + +```csharp title="Querying entities" +ecsApi.Query((ref bounty) => +{ + bounty.Kills += 1; +}); +``` + +`Query` overloads take up to six component types at once, and only entities carrying all of them are visited. Pairing a component with `MainCharacterComponent` is the usual way to reach player-owned entities: + +```csharp title="Querying two components together" +ecsApi.Query((ref main, ref hp) => +{ + if (hp.IsDead) + { + logger.LogDebug("Player {PlayerId} is down", main.PlayerId); + } +}); +``` + +Each overload also comes in a variant that threads a `ref` state value through the callback. Use it when you need to accumulate a result, since it lets the callback stay `static` and avoids allocating a closure on every tick: + +```csharp title="Counting with ref state" +var alive = 0; +ecsApi.Query(ref alive, static (ref hp, ref alive) => +{ + if (!hp.IsDead) + alive++; +}); +``` + +Writes made from a server mod are authoritative: the SDK marks them as server-authored, so a change your mod makes to an owned component is replicated back to the owning client rather than being overwritten by it. + +:::warning[Known issues] + +There is a known issue in this version that overwriting data that the client changes every frame, e.g. position, usually does not work. + +**This will be addressed in a future update to the SDK.** For now, use RPC for making updates to such components. For example, do not attempt to teleport a player by settings their `TransformComponent.Position` in a query on the server, but rather send an RPC so that the client does teleportation logic. + +::: + +## Feature status + +| Feature | Status | +|---|---| +| Networked components | :white_check_mark: [done](#registering-components-and-archetypes) | +| Gameplay systems | :white_check_mark: [done](systems) | +| Server RPC | :white_check_mark: [done](custom-rpc) | +| Higher-level entity API | :soon: planned, see the note in [Archetypes and components](archetypes) | +| Server mod manifests | :soon: not used in 0.3.0 | diff --git a/wukong-mp/docs/Server-development/systems.md b/wukong-mp/docs/Server-development/systems.md new file mode 100644 index 0000000..d83bcab --- /dev/null +++ b/wukong-mp/docs/Server-development/systems.md @@ -0,0 +1,124 @@ +--- +sidebar_position: 2 +--- + +# Gameplay systems + +Just like on the client, the server SDK provides **systems**: classes that expose a tick method, run on the server's own update loop. Use these for logic that should run continuously on the server, independent of any single RPC call. Timers, periodic world state checks, and scaling rules that react to how many players are connected all belong here. + +## Declaring systems + +A server-side system derives from [ModSystemBase](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase) and overrides `OnUpdate`: + +```csharp title="Minimal server system example" +public class MySystem : ModSystemBase +{ + protected override void OnUpdate(UpdateTick tick) + { + // do something every server tick + } +} +``` + +The [UpdateTick](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick) passed to `OnUpdate` exposes `deltaTime` (seconds since the last tick) and `time` (seconds since server start). + +:::important + +Unlike client-side systems, server-side systems are **not** discovered automatically. Register each one explicitly in your mod's `Init` method: + +```csharp +protected override void Init() +{ + Services.RegisterSystem(); +} +``` + +::: + +You can inject dependencies, such as [EcsApi](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi) or a logger, through the constructor, same as any other service resolved from the dependency injection container. + +```csharp title="A system with dependencies" +public class BountySystem(EcsApi ecs, ILogger logger) : ModSystemBase +{ + protected override void OnUpdate(UpdateTick tick) + { + ecs.Query((ref bounty) => + { + bounty.Multiplier = 1f + bounty.Kills * 0.05f; + }); + } +} +``` + +## Reacting to player count + +The most common reason to run a system rather than an RPC handler is that the answer depends on the whole world, not on one client's request. Scaling boss health with the number of connected players is the shipping example, taken from the co-op mod: + +```csharp title="Scaling elite and boss HP with player count" +public class ScaleHpSystem(EcsApi ecs, ILogger logger) : ModSystemBase +{ + // written by an RPC handler on the network thread, read here on the server loop + public int ScalingPercent { get { ... } set { ... } } + + protected override void OnUpdate(UpdateTick tick) + { + // count all players on the server, not just the ones in this area + var players = 0; + ecs.Query(ref players, static (ref _, ref players) => { players++; }); + + if (players == 0) return; + + var targetScalingPercent = ScalingPercent * players; + + ecs.Query((ref tamer, ref hp) => + { + if (!tamer.IsBossOrElite) + return; // do not scale common enemies + + if (hp is { HpMaxBase: 0, Hp: 0 }) + return; // a monster that has not spawned yet has no HP to scale + + var currentMultPercent = hp.HpMaxMulPercent == 0 ? 100 : hp.HpMaxMulPercent; + if (targetScalingPercent != currentMultPercent) + { + hp.Hp *= (float)targetScalingPercent / currentMultPercent; + hp.HpMaxMulPercent = targetScalingPercent; + } + }); + } +} +``` + +Note the shape of this system: it reads world state every tick, compares it against what it already applied, and only writes when the two disagree. A system that writes unconditionally sends a component delta to every client on every tick, which shows up immediately as egress in the [network stats](../Server/network-stats). + +## Systems and RPC handlers together + +`RegisterSystem` also makes the system resolvable from the container, so an [RPC handler](custom-rpc) can take it as a constructor dependency. This is how a client-facing setting reaches a system: the handler validates and stores it, the system acts on it. + +```csharp title="A handler that configures a system" +protected override void Init() +{ + Services.RegisterSystem(); + Services.RegisterSingleton(); +} +``` + +```csharp +public partial class RpcHandlers(ScaleHpSystem hpScaling) : ServerRpcHandlersBase +{ + partial void OnScaleBossHp(RpcContext context, int scalingPercent) + { + hpScaling.ScalingPercent = scalingPercent; + } +} +``` + +:::warning + +RPC handlers run on the network thread, while systems tick on the server loop. Any field a handler writes and a system reads should be treated as shared state: keep it to a single value that is safe to read torn, or guard it with `Volatile` accessors or locks. + +::: + +## Cost of a system + +Every system your mod registers runs inside the server's system root update, which is exactly what the **Server tick duration** chart in the [network stats](../Server/network-stats) measures. A system that scans every entity on a timer instead of reacting to a change is the usual cause of a rising p99 with a flat p50. That page is the fastest way to tell whether your system is the one costing tick time. diff --git a/wukong-mp/docs/Server/admin-panel.mdx b/wukong-mp/docs/Server/admin-panel.mdx index 2275874..b4400a2 100644 --- a/wukong-mp/docs/Server/admin-panel.mdx +++ b/wukong-mp/docs/Server/admin-panel.mdx @@ -52,6 +52,7 @@ After signing in, you can access the admin panel interface. The admin panel offers the following views: * **Terminal** - view server status, active players, uptime, and real-time logs. +* **Network** - view live relay traffic, server tick timing, and a per-component breakdown of what is being replicated. See [Network stats](./network-stats). * **Players** - view the list of players who have ever connected to the server, along with their first and last visit date. * **Mods** - view the list of currently installed mods on the server. * **Admins** - view the list of server administrators, add new administrators, and manage their permissions. diff --git a/wukong-mp/docs/Server/installation.mdx b/wukong-mp/docs/Server/installation.mdx index f8c479d..d8cd9af 100644 --- a/wukong-mp/docs/Server/installation.mdx +++ b/wukong-mp/docs/Server/installation.mdx @@ -35,11 +35,14 @@ After extraction, the directory structure should look like this: server/ ├── server.exe # Main server binary ├── config.json # Configuration file -├── mods/ # Directory for mods +├── mods/ # Directory for client-side mods | ├── WukongMp.Sdk/ # SDK mod | └── WukongMp.PvP/ # PvP mod ├── optional_mods/ # Move any of these mods to the "mods" folder to enable them | └── WukongMp.Coop/ # Co-op mod +├── server_mods/ # Directory for server-side mods +| ├── WukongMp.Sdk.Serverside.dll # Server-side SDK +| └── WukongMp.Coop.Serverside.dll # Co-op mod, server side ├── saves/ # Directory for game saves (empty by default) ├── wwwroot/ # Admin panel assets ├── e_sqlite3.dll # Dependency @@ -53,11 +56,14 @@ server/ server/ ├── server # Main server binary ├── config.json # Configuration file -├── mods/ # Directory for mods +├── mods/ # Directory for client-side mods | ├── WukongMp.Sdk/ # SDK mod | └── WukongMp.PvP/ # PvP mod ├── optional_mods/ # Move any of these mods to the "mods" folder to enable them | └── WukongMp.Coop/ # Co-op mod +├── server_mods/ # Directory for server-side mods +| ├── WukongMp.Sdk.Serverside.dll # Server-side SDK +| └── WukongMp.Coop.Serverside.dll # Co-op mod, server side ├── saves/ # Directory for game saves (empty by default) ├── wwwroot/ # Admin panel assets └── libe_sqlite3.so # Dependency diff --git a/wukong-mp/docs/Server/mod-management.md b/wukong-mp/docs/Server/mod-management.md index 27f8473..8d0f6cf 100644 --- a/wukong-mp/docs/Server/mod-management.md +++ b/wukong-mp/docs/Server/mod-management.md @@ -56,8 +56,35 @@ mods/ ## Server-side mods -:::warning[Work in progress] +WukongMP mods can also run logic on the server itself, in addition to any client-side content. Server-side mods live in a **separate** `server_mods/` directory, next to `mods/`, and are loaded differently. -This feature is under development and will be available in a future version of the SDK. +Unlike client mods, server-side mods are not folders with a manifest. Drop the mod's assembly (and any dependencies) directly into `server_mods/`. The server scans the directory recursively for `.dll` files on startup and loads any assembly that contains a mod class. + +```text title="Example server_mods/ layout" +server_mods/ +├── WukongMp.Sdk.Serverside.dll # Server-side SDK, ships with the server +├── ReadyM.Wukong.Common.dll # Shared component and RPC definitions +├── WukongMp.Coop.Serverside.dll # Co-op mod, server side +├── WukongMp.Coop.Common.dll # Co-op mod, shared contracts +└── MyServerMod.dll # your server-side mod +``` + +The server ships with no gameplay logic of its own beyond the mods listed above. Write your own server-side mod, or install one built by the community. + +:::important + +A server-side mod and the client-side mod it talks to are two halves of one thing. Their networked component shapes and RPC contracts have to match, so ship them together as versions of the same package: the client half in `mods/`, the server half in `server_mods/`. + +::: + +A server-side mod can register networked ECS components, run gameplay systems on the server tick, and handle server RPCs sent by clients. See the [server-side development](../Server-development/getting-started) docs to learn how to build one. + +:::danger[Security notice] + +The early access version of the WukongMP SDK and server does not include any sandboxing or security mechanisms for mods. + +Only use mods from trusted sources, as they can execute arbitrary code on the server and connected clients. + +Never run a server with untrusted mods, especially if the server is publicly accessible. ::: diff --git a/wukong-mp/docs/Server/network-stats.mdx b/wukong-mp/docs/Server/network-stats.mdx new file mode 100644 index 0000000..2bcc76e --- /dev/null +++ b/wukong-mp/docs/Server/network-stats.mdx @@ -0,0 +1,97 @@ +--- +sidebar_position: 6 +--- + +# Network stats + +The **Network** view in the [admin panel](./admin-panel) is a live breakdown of what the relay is actually sending. It is the fastest way to answer "how much does my mod cost on the wire", so it is worth knowing how to read before you ship a component that replicates every tick. + +Viewing it requires the **Dashboard access** permission. + +Network tab in admin panel + +## How sampling works + +The server closes one measurement window per second and pushes it to the panel over an event stream. It retains the last 300 windows; the charts and tables show the most recent 120, which is what the `last 120s` label next to the **LIVE** badge means. + +Windows do not overlap and nothing is smoothed across them. Every counter is snapshotted and zeroed at the window boundary. A burst of traffic therefore stays in the aggregate until it falls off the back of the 120 window view, then drops out on its own. That is normal, not a stat resetting. + +The stream is only reported as broken after five seconds pass with no sample. A dropped connection retries by itself and the server replays its retained history on reconnect, so short interruptions leave no gap in the charts. + +## Wire bytes and payload bytes + +Almost every confusion about this page comes from mixing up the two accounting layers, which are deliberately kept separate and will never agree. + +**Wire** is ground truth from LiteNetLib: every byte it actually put on the socket, including channel headers, acks, pings and reliable retransmits. This feeds the Ingress, Egress and UDP throughput figures. + +**Payload** is application bytes only, counted where the server composes and parses packets. This is what the per component and per message type tables show, and it is the only layer that can attribute bytes to your mod. + +Payload always sums to less than wire. The difference is the **Protocol overhead** tile, and it is a useful signal in itself: a large gap means acks and retransmits, not your data. + +Neither layer counts the 28 bytes of IP and UDP headers that every datagram carries. **Link egress** adds those back, and it is the only figure that reflects what your host actually bills you for. + +:::note + +Egress is counted per recipient. One delta composed once and relayed to five peers is five times the egress, because that is what leaves the box. This is why fan-out matters more than payload size for anything replicated to a busy area. + +::: + +## Summary tiles + +| Tile | What it shows | +| --- | --- | +| **Ingress** | Wire bytes per second received, with packets per second underneath. Latest window only. | +| **Egress** | Wire bytes per second sent, with packets per second underneath. Latest window only. | +| **Connected peers** | Peers LiteNetLib currently holds a connection to. | +| **Server tick p99** | 99th percentile tick duration in the latest window, with the achieved network loop rate underneath. | +| **Protocol overhead** | Wire egress minus payload egress, as a rate. Shows a percentage of egress only once payload passes 16 KB over the window, otherwise it says so instead of printing a confident number off a near zero denominator. | +| **Link egress** | Wire egress plus 28 bytes per datagram. Many small packets are cheap in payload and expensive here. | + +## UDP throughput + +Wire bytes per second in and out, one point per window. Excludes IP and UDP headers, so compare it against **Link egress** rather than against your host's bandwidth graph. + +## Server tick duration + +p50 and p99 of how long one server tick takes, measured around the whole system root update. [Systems your server mod registers](../Server-development/systems) run inside this, so this chart is where a system that does too much per tick shows up first. + +Durations are histogrammed in 1 microsecond buckets, so the percentiles are exact rather than interpolated. Anything slower than 20 ms clamps into the top bucket; if you see a flat line at 20 ms, the real value is worse. + +A rising p99 with a flat p50 is the usual shape of a system that occasionally does heavy work, for example one that scans every entity on a timer instead of reacting to a change. + +## Top components by egress + +The eight components with the highest payload egress rate. Everything below that folds into a single `Other (n)` row rather than being dropped, so the bars always account for the full total. + +The axis labels drop a trailing `Component` suffix to save width, so `MonsterAnimationComponent` charts as `MonsterAnimation`. The table below keeps the full name. + +## Traffic by ECS component + +Per component payload, aggregated across the visible windows. The names here are the [component types on the built-in archetypes](../Server-development/archetypes), plus any your mods register. + +| Column | Meaning | +| --- | --- | +| **Component** | Type name of the component. | +| **In** / **Out** | Payload bytes per second, averaged over the whole visible window. | +| **In msgs** / **Out msgs** | Message counts. These are totals over the window, not rates, unlike the byte columns beside them. | +| **In/msg** / **Out/msg** | Average payload bytes per message. | +| **Fan-out** | Egress divided by ingress, over the aggregate. How far one client update spreads. | + +Every row is divided by the same total window duration, so a one shot join payload reports a small per second figure rather than looking like sustained load. Rows are comparable against each other by design. + +A yellow `!` on a per message column means the average payload is smaller than the 28 bytes of framing each datagram costs, so most of the link cost is headers rather than data. Batching more state per packet is the fix, not shrinking the payload further. + +**Fan-out** shows `-` when the component saw no ingress at all in the window. That is undefined, not zero, and it is the expected reading for server authored components that clients never send. Anything a [server-side system](../Server-development/systems) writes lands in this category. + +The sort tabs (`total`, `egress`, `ingress`, `fan-out`) only reorder the rows. Components with undefined fan-out sort last rather than as zero. + +## Traffic by message type + +The same payload bytes, grouped by wire message code instead of by component. Use it to separate ECS state replication from RPC and from one shot events. + +Built in codes appear under their protocol names: `EcsDelta`, `EcsSnapshot`, `EcsCreateEntity`, `EcsDeleteEntity`, `EcsChangeOwnership`, `AreaEvent`, `HandshakeConnected` and so on. Custom RPC codes have no name to look up and appear as `ServerRpc(n)` and `ClientRpc(n)`, numbered by their wire code. Your own [client-relayed RPC](../Development/custom-rpc) shows up in the `ClientRpc` range, and your [server RPC](../Server-development/custom-rpc) in the `ServerRpc` range. + +If `EcsSnapshot` is a large share of egress, players are crossing scope boundaries often. Snapshots are sent reliably and in full, so they are much more expensive than the deltas that follow. From 520c82b945edf9847ab938be84e81a5dd0d03bff Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Tue, 11 Aug 2026 17:52:22 +0200 Subject: [PATCH 04/12] Refresh API reference --- .../ReadyM.Api.DI.DependencyContainerBase.md | 164 +++++++ .../ReadyM.Api.DI.IDependencyContainer.md | 14 + .../ReadyM.Api.DI/ReadyM.Api.DI.md | 4 + ...ReadyM.Api.ECS.Worlds.EntityBuilderBase.md | 76 +++ ...eadyM.Api.ECS.Worlds.IArchetypeRegistry.md | 52 +++ .../ReadyM.Api.ECS.Worlds.md | 13 + .../ReadyM.Api.Idents.ArchetypeId.md | 158 +++++++ .../ReadyM.Api.Idents.AreaId.md | 50 +- .../ReadyM.Api.Idents.CellId.md | 193 ++++++++ .../ReadyM.Api.Idents.FullCellId.md | 190 ++++++++ .../ReadyM.Api.Idents.PlayerId.md | 16 + .../ReadyM.Api.Idents/ReadyM.Api.Idents.md | 18 + ...Api.Multiplayer.Client.ConnectionTicket.md | 168 ------- ...eadyM.Api.Multiplayer.Client.IRpcClient.md | 74 --- ...dyM.Api.Multiplayer.Client.RelayMessage.md | 55 --- .../ReadyM.Api.Multiplayer.Client.md | 13 - ...layer.ECS.Components.AreaScopeComponent.md | 93 ++++ ...yer.ECS.Components.PlayerScopeComponent.md | 83 ++++ .../ReadyM.Api.Multiplayer.ECS.Components.md | 13 + ...erators.DeriveINetSerializableAttribute.md | 4 +- ...ultiplayer.Generators.RpcEventAttribute.md | 4 +- .../ReadyM.Api.Multiplayer.Generators.md | 2 +- .../ReadyM.Api.Multiplayer.md | 25 + ...iplayer.Protocol.Enums.RelayMessageCode.md | 50 -- .../ReadyM.Api.Multiplayer.Protocol.md | 11 - .../ReadyM.Api.Multiplayer.RPC.md | 10 - ...iplayer.Protocol.CustomRelayEventHeader.md | 93 ---- .../ReadyM.Api.Multiplayer.Protocol.Enums.md | 4 - ...yM.Api.Multiplayer.RPC.ClientRpcHandler.md | 76 +++ .../ReadyM.Api.Multiplayer.RPC.RpcBase.md | 106 +++++ ...ReadyM.Api.Multiplayer.RPC.RpcClassBase.md | 151 ------ ...dyM.Api.Multiplayer.RPC.ServerRpcClient.md | 47 ++ .../ReadyM.Api.Multiplayer.RPC.md | 18 + ...tiplayer.Serialization.IRelaySerializer.md | 56 --- .../ReadyM.Api.Multiplayer.Serialization.md | 7 - ...Api.Multiplayer.ClientToServerAttribute.md | 76 +++ ...Api.Multiplayer.ServerToClientAttribute.md | 74 +++ .../ReadyM.Api.Saves.FileInfo.md} | 14 +- .../ReadyM.Api.Saves.SaveFileType.md} | 4 +- .../ReadyM.Api.Saves/ReadyM.Api.Saves.md | 15 + .../ReadyM.Api.Serialization.md | 0 ...adyM.Api.Serialization.SerializableMode.md | 2 +- ...r.Sdk.Ecs.Components.IComponentRegistry.md | 42 ++ .../ReadyM.Relay.Server.Sdk.Ecs.Components.md | 9 + ...dk.Ecs.Systems.ModSystemBase.UpdateTick.md | 67 +++ ...ay.Server.Sdk.Ecs.Systems.ModSystemBase.md | 70 +++ .../ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md | 435 ++++++++++++++++++ .../ReadyM.Relay.Server.Sdk.Ecs.Entity.md | 47 ++ .../ReadyM.Relay.Server.Sdk.Ecs.Systems.md | 16 + .../ReadyM.Relay.Server.Sdk.Ecs.md | 23 + .../ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md | 45 ++ .../ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md | 51 ++ ...ay.Server.Sdk.Rpc.ServerRpcHandlersBase.md | 89 ++++ ...y.Server.Sdk.IServerDependencyContainer.md | 29 ++ .../ReadyM.Relay.Server.Sdk.Rpc.md | 18 + .../ReadyM.Relay.Server.Sdk.ServerModBase.md | 85 ++++ .../ReadyM.Relay.Server.Sdk.md | 20 + ...ommon.ECS.Components.AnimationComponent.md | 110 +++++ ...ukong.Common.ECS.Components.HpComponent.md | 100 ++++ ...n.ECS.Components.MainCharacterComponent.md | 313 +++++++++++++ ...CS.Components.MonsterAnimationComponent.md | 80 ++++ ...ng.Common.ECS.Components.MovieComponent.md | 291 ++++++++++++ ...Common.ECS.Components.NicknameComponent.md | 70 +++ ...g.Common.ECS.Components.PlayerComponent.md | 85 ++++ ...kong.Common.ECS.Components.PvPComponent.md | 70 +++ ...Common.ECS.Components.PvpStateComponent.md | 210 +++++++++ ...ong.Common.ECS.Components.RoomComponent.md | 160 +++++++ ...ng.Common.ECS.Components.TamerComponent.md | 229 +++++++++ ...ong.Common.ECS.Components.TeamComponent.md | 70 +++ ...ommon.ECS.Components.TransformComponent.md | 80 ++++ .../ReadyM.Wukong.Common.ECS.Components.md | 55 +++ ...ukong.Common.ECS.Values.AttributesState.md | 149 ++++++ ....Wukong.Common.ECS.Values.EquipPosition.md | 30 ++ ...mon.ECS.Values.EquipmentState.Converter.md | 78 ++++ ...Wukong.Common.ECS.Values.EquipmentState.md | 184 ++++++++ ...Wukong.Common.ECS.Values.MoveSpeedLevel.md | 20 + ...ukong.Common.ECS.Values.SpectatorReason.md | 26 ++ .../ReadyM.Wukong.Common.ECS.Values.md | 31 ++ .../ReadyM.Wukong.Common.Rpc.md | 9 + .../ReadyM.Wukong.Common.Rpc.SkipMovieData.md | 98 ++++ .../WukongMp.Api.Https/WukongMp.Api.Https.md | 7 - .../WukongMp.Api.IWukongSaveApi.md | 4 +- .../WukongMp.Api/WukongMp.Api.md | 2 - .../WukongMp.Sdk.Api.IWukongConsoleApi.md | 4 +- .../WukongMp.Sdk.Api.IWukongEventApi.md | 12 +- .../WukongMp.Sdk.Api.IWukongPvpApi.md | 18 +- ...ongMp.Sdk.Api.IWukongSynchronizationApi.md | 38 +- .../WukongMp.Sdk.Api.WukongApi.md | 4 +- .../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md | 4 + ...ukongMp.Sdk.Entities.ReadyMainCharacter.md | 14 +- ...ngMp.Sdk.Entities.ReadyObjectExtensions.md | 4 +- .../WukongMp.Sdk.Entities.ReadyTamer.md | 8 +- ...ukongMp.Sdk.Serverside.WukongArchetypes.md | 116 +++++ .../WukongMp.Sdk/WukongMp.Sdk.ModBase.md | 4 +- .../WukongMp.Sdk/WukongMp.Sdk.Serverside.md | 9 + .../WukongMp.Sdk/WukongMp.Sdk.md | 8 +- 96 files changed, 5379 insertions(+), 767 deletions(-) create mode 100644 wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md delete mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md rename wukong-mp/api-reference/{WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md => ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md} (73%) rename wukong-mp/api-reference/{WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md => ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md} (77%) create mode 100644 wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.md rename wukong-mp/api-reference/{ReadyM.Api.Multiplayer.Serialization => ReadyM.Api.Saves}/ReadyM.Api.Serialization.md (100%) create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md create mode 100644 wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md create mode 100644 wukong-mp/api-reference/ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md delete mode 100644 wukong-mp/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.md create mode 100644 wukong-mp/api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md create mode 100644 wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.Serverside.md diff --git a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md new file mode 100644 index 0000000..30f1f36 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md @@ -0,0 +1,164 @@ +# Class DependencyContainerBase + +Namespace: [ReadyM.Api.DI](../ReadyM.Api.DI/ReadyM.Api.DI.md) +Assembly: ReadyM.Api.dll + +```csharp +public abstract class DependencyContainerBase : IDependencyContainer, IDisposable +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[DependencyContainerBase](../ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md) + +#### Implements + +[IDependencyContainer](../ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### DependencyContainerBase\(\) + +```csharp +protected DependencyContainerBase() +``` + +## Properties + +### Container + +```csharp +protected IContainer Container { get; } +``` + +#### Property Value + + IContainer + +## Methods + +### Dispose\(\) + +```csharp +public virtual void Dispose() +``` + +### Init\(\) + +```csharp +public virtual void Init() +``` + +### RegisterSingleton\(TImplementation\) + +```csharp +public void RegisterSingleton(TImplementation instance) where TImplementation : TService +``` + +#### Parameters + +`instance` TImplementation + +#### Type Parameters + +`TService` + +`TImplementation` + +### RegisterSingleton\(\) + +```csharp +public void RegisterSingleton() +``` + +#### Type Parameters + +`T` + +### RegisterSingleton\(T\) + +```csharp +public void RegisterSingleton(T instance) +``` + +#### Parameters + +`instance` T + +#### Type Parameters + +`T` + +### RegisterSingleton\(Type\) + +```csharp +public void RegisterSingleton(Type type) +``` + +#### Parameters + +`type` [Type](https://learn.microsoft.com/dotnet/api/system.type) + +#### Type Parameters + +`TService` + +### RegisterSingleton\(\) + +```csharp +public void RegisterSingleton() where TImplementation : TService +``` + +#### Type Parameters + +`TService` + +`TImplementation` + +### Resolve\(\) + +```csharp +public T Resolve() +``` + +#### Returns + + T + +#### Type Parameters + +`T` + +### ResolveAll\(\) + +```csharp +public IEnumerable ResolveAll() +``` + +#### Returns + + [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) + +#### Type Parameters + +`T` + +### StartHostedServices\(\) + +```csharp +public void StartHostedServices() +``` + + diff --git a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md index 9537c12..f9c5eea 100644 --- a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md +++ b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md @@ -91,4 +91,18 @@ T Resolve() `T` +### ResolveAll\(\) + +```csharp +IEnumerable ResolveAll() +``` + +#### Returns + + [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1) + +#### Type Parameters + +`T` + diff --git a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md index 682dfc6..5606ad5 100644 --- a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md +++ b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md @@ -1,5 +1,9 @@ # ReadyM.Api.DI +### Classes + + [DependencyContainerBase](../ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md) + ### Interfaces [IDependencyContainer](../ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md) diff --git a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md new file mode 100644 index 0000000..777a718 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md @@ -0,0 +1,76 @@ +# Class EntityBuilderBase + +Namespace: [ReadyM.Api.ECS.Worlds](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md) +Assembly: ReadyM.Api.dll + +```csharp +public abstract class EntityBuilderBase +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[EntityBuilderBase](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### EntityBuilderBase\(\) + +```csharp +protected EntityBuilderBase() +``` + +## Methods + +### Add\(\) + +Add a component to the archetype. + +```csharp +public abstract EntityBuilderBase Add() where T : struct, IComponent +``` + +#### Returns + + [EntityBuilderBase](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md) + +#### Type Parameters + +`T` + +Type of the component. Must implement **IComponent**. + +### Add\(in T\) + +Add a component with a default value to the archetype. + +```csharp +[Obsolete("Default values are ignored on the server-side. Use Add() and set the values manually later.")] +public abstract EntityBuilderBase Add(in T component) where T : struct, IComponent +``` + +#### Parameters + +`component` T + +#### Returns + + [EntityBuilderBase](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md) + +#### Type Parameters + +`T` + +Type of the component. Must implement **IComponent**. + + diff --git a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md new file mode 100644 index 0000000..0c1ce92 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md @@ -0,0 +1,52 @@ +# Interface IArchetypeRegistry + +Namespace: [ReadyM.Api.ECS.Worlds](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md) +Assembly: ReadyM.Api.dll + +Allows registering and modifying entity archetypes in the ECS. + +```csharp +public interface IArchetypeRegistry +``` + +## Methods + +### ModifyArchetype\(ArchetypeId, Action\) + +Extends an existing entity archetype with additional components. + +```csharp +void ModifyArchetype(ArchetypeId archetypeId, Action build) +``` + +#### Parameters + +`archetypeId` [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +The identifier of the archetype to modify. + +`build` [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[EntityBuilderBase](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md)\> + +A action for adding components. + +### RegisterArchetype\(Action\) + +Registers a new entity archetype with the configured components. + +```csharp +ArchetypeId RegisterArchetype(Action build) +``` + +#### Parameters + +`build` [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[EntityBuilderBase](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md)\> + +An action for adding components. + +#### Returns + + [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +The identifier of the defined archetype. + + diff --git a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md new file mode 100644 index 0000000..16c4f94 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md @@ -0,0 +1,13 @@ +# ReadyM.Api.ECS.Worlds + +### Classes + + [EntityBuilderBase](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md) + +### Interfaces + + [IArchetypeRegistry](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md) + +Allows registering and modifying entity archetypes in the ECS. + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md new file mode 100644 index 0000000..35a8024 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md @@ -0,0 +1,158 @@ +# Struct ArchetypeId + +Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) +Assembly: ReadyM.Api.dll + +Represents a unique identifier for an archetype in the ECS. +Entities of a given archetype have a fixed set of components, never changed after creation. + +```csharp +public struct ArchetypeId : IEquatable, INetSerializable +``` + +#### Implements + +[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ArchetypeId\(byte\) + +Represents a unique identifier for an archetype in the ECS. +Entities of a given archetype have a fixed set of components, never changed after creation. + +```csharp +public ArchetypeId(byte id) +``` + +#### Parameters + +`id` [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +## Properties + +### None + +```csharp +public static ArchetypeId None { get; } +``` + +#### Property Value + + [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +## Methods + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Equals\(ArchetypeId\) + +```csharp +public bool Equals(ArchetypeId other) +``` + +#### Parameters + +`other` [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equals\(object?\) + +```csharp +public override bool Equals(object? obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### GetHashCode\(\) + +```csharp +public override int GetHashCode() +``` + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### ToString\(\) + +```csharp +public override string ToString() +``` + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Operators + +### operator ==\(ArchetypeId, ArchetypeId\) + +```csharp +public static bool operator ==(ArchetypeId left, ArchetypeId right) +``` + +#### Parameters + +`left` [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +`right` [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### operator \!=\(ArchetypeId, ArchetypeId\) + +```csharp +public static bool operator !=(ArchetypeId left, ArchetypeId right) +``` + +#### Parameters + +`left` [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +`right` [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md index deab097..40f7440 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md @@ -27,38 +27,42 @@ public struct AreaId : INetSerializable, IEquatable ## Constructors -### AreaId\(ushort\) - -Identifies an area within the game world. -Areas can be main Chapter maps, sub-areas such as the Zodiac Village, or hidden boss arenas. -If going somewhere requires a loading screen, it's probably a different area. +### AreaId\(NativeString256\) ```csharp -public AreaId(ushort id) +public AreaId(NativeString256 id) ``` #### Parameters -`id` [ushort](https://learn.microsoft.com/dotnet/api/system.uint16) +`id` [NativeString256](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeString256.cs) -The underlying ID value. This is not guaranteed to be stable across game versions, and should not be used for anything other than debugging or logging purposes. +### AreaId\(string\) -## Properties +```csharp +public AreaId(string id) +``` -### Invalid +#### Parameters + +`id` [string](https://learn.microsoft.com/dotnet/api/system.string) + +### AreaId\(int\) ```csharp -public static AreaId Invalid { get; } +public AreaId(int id) ``` -#### Property Value +#### Parameters - [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) +`id` [int](https://learn.microsoft.com/dotnet/api/system.int32) -### Max +## Properties + +### Invalid ```csharp -public static AreaId Max { get; } +public static AreaId Invalid { get; } ``` #### Property Value @@ -125,6 +129,22 @@ public void Serialize(NetDataWriter writer) `writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) +### TextDeserialize\(ref Utf8JsonReader, JsonSerializerOptions\) + +```csharp +public static AreaId TextDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options) +``` + +#### Parameters + +`reader` [Utf8JsonReader](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonreader) + +`options` [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) + +#### Returns + + [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + ### ToString\(\) ```csharp diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md new file mode 100644 index 0000000..beaa2cb --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md @@ -0,0 +1,193 @@ +# Struct CellId + +Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) +Assembly: ReadyM.Api.dll + +Identifies a cell within an area. +**CellId** has to be unique within its parent area (identified by **AreaId**). +The main difference between a cell and an area is that a player can be only in one area at once, but can have many cells active within that area. +Cells are only used in OblivionMP for now. WukongMP does not use cells. + +```csharp +public struct CellId : INetSerializable, IEquatable +``` + +#### Implements + +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs), +[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### CellId\(NativeString256\) + +```csharp +public CellId(NativeString256 id) +``` + +#### Parameters + +`id` [NativeString256](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeString256.cs) + +### CellId\(string\) + +```csharp +public CellId(string id) +``` + +#### Parameters + +`id` [string](https://learn.microsoft.com/dotnet/api/system.string) + +### CellId\(int\) + +```csharp +public CellId(int id) +``` + +#### Parameters + +`id` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Properties + +### Invalid + +```csharp +public static CellId Invalid { get; } +``` + +#### Property Value + + [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +## Methods + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Equals\(CellId\) + +```csharp +public bool Equals(CellId other) +``` + +#### Parameters + +`other` [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equals\(object?\) + +```csharp +public override bool Equals(object? obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### GetHashCode\(\) + +```csharp +public override int GetHashCode() +``` + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### TextDeserialize\(ref Utf8JsonReader, JsonSerializerOptions\) + +```csharp +public static CellId TextDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options) +``` + +#### Parameters + +`reader` [Utf8JsonReader](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonreader) + +`options` [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) + +#### Returns + + [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +### ToString\(\) + +```csharp +public override string ToString() +``` + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Operators + +### operator ==\(CellId, CellId\) + +```csharp +public static bool operator ==(CellId left, CellId right) +``` + +#### Parameters + +`left` [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +`right` [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### operator \!=\(CellId, CellId\) + +```csharp +public static bool operator !=(CellId left, CellId right) +``` + +#### Parameters + +`left` [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +`right` [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md new file mode 100644 index 0000000..cf700ae --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md @@ -0,0 +1,190 @@ +# Struct FullCellId + +Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) +Assembly: ReadyM.Api.dll + +Fully identifies a cell across the whole game world by pairing it with its parent area. +A **CellId** only has to be unique within its parent **AreaId**, so a cell can only be +uniquely identified by the (**AreaId**, **CellId**) pair represented by this struct. + +```csharp +public struct FullCellId : INetSerializable, IEquatable +``` + +#### Implements + +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs), +[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Remarks + +This struct doesn't replace **CellId**, because most of the time +**AreaId** can be inferred from the context of which area is a given player in. +Cells are only used in OblivionMP for now. WukongMP does not use cells. + +## Constructors + +### FullCellId\(AreaId, CellId\) + +```csharp +public FullCellId(AreaId areaId, CellId cellId) +``` + +#### Parameters + +`areaId` [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +`cellId` [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +## Properties + +### AreaId + +```csharp +public AreaId AreaId { get; } +``` + +#### Property Value + + [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) + +### CellId + +```csharp +public CellId CellId { get; } +``` + +#### Property Value + + [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +## Methods + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Equals\(FullCellId\) + +```csharp +public bool Equals(FullCellId other) +``` + +#### Parameters + +`other` [FullCellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equals\(object?\) + +```csharp +public override bool Equals(object? obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### GetHashCode\(\) + +```csharp +public override int GetHashCode() +``` + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### TextDeserialize\(ref Utf8JsonReader, JsonSerializerOptions\) + +```csharp +public static FullCellId TextDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options) +``` + +#### Parameters + +`reader` [Utf8JsonReader](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonreader) + +`options` [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) + +#### Returns + + [FullCellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md) + +### ToString\(\) + +```csharp +public override string ToString() +``` + +#### Returns + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Operators + +### operator ==\(FullCellId, FullCellId\) + +```csharp +public static bool operator ==(FullCellId left, FullCellId right) +``` + +#### Parameters + +`left` [FullCellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md) + +`right` [FullCellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### operator \!=\(FullCellId, FullCellId\) + +```csharp +public static bool operator !=(FullCellId left, FullCellId right) +``` + +#### Parameters + +`left` [FullCellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md) + +`right` [FullCellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md index 42924ea..f44cd09 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md @@ -122,6 +122,22 @@ public void Serialize(NetDataWriter writer) `writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) +### TextDeserialize\(ref Utf8JsonReader, JsonSerializerOptions\) + +```csharp +public static PlayerId TextDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options) +``` + +#### Parameters + +`reader` [Utf8JsonReader](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonreader) + +`options` [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) + +#### Returns + + [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) + ### ToString\(\) ```csharp diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md index 081907e..3aee7c7 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md @@ -2,12 +2,30 @@ ### Structs + [ArchetypeId](../ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md) + +Represents a unique identifier for an archetype in the ECS. +Entities of a given archetype have a fixed set of components, never changed after creation. + [AreaId](../ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md) Identifies an area within the game world. Areas can be main Chapter maps, sub-areas such as the Zodiac Village, or hidden boss arenas. If going somewhere requires a loading screen, it's probably a different area. + [CellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md) + +Identifies a cell within an area. +**CellId** has to be unique within its parent area (identified by **AreaId**). +The main difference between a cell and an area is that a player can be only in one area at once, but can have many cells active within that area. +Cells are only used in OblivionMP for now. WukongMP does not use cells. + + [FullCellId](../ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md) + +Fully identifies a cell across the whole game world by pairing it with its parent area. +A **CellId** only has to be unique within its parent **AreaId**, so a cell can only be +uniquely identified by the (**AreaId**, **CellId**) pair represented by this struct. + [PlayerId](../ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md) A unique identifier for a player in the current session. diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md deleted file mode 100644 index d3a713f..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md +++ /dev/null @@ -1,168 +0,0 @@ -# Struct ConnectionTicket - -Namespace: [ReadyM.Api.Multiplayer.Client](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md) -Assembly: ReadyM.Api.Multiplayer.dll - -```csharp -public struct ConnectionTicket : IEquatable, INetSerializable -``` - -#### Implements - -[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1), -[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) - -#### Inherited Members - -[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), -[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), -[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), -[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), -[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), -[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) - -## Methods - -### Deserialize\(NetDataReader\) - -```csharp -public void Deserialize(NetDataReader reader) -``` - -#### Parameters - -`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) - -### Equals\(ConnectionTicket\) - -```csharp -public bool Equals(ConnectionTicket other) -``` - -#### Parameters - -`other` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) - -#### Returns - - [bool](https://learn.microsoft.com/dotnet/api/system.boolean) - -### Equals\(object?\) - -```csharp -public override bool Equals(object? obj) -``` - -#### Parameters - -`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? - -#### Returns - - [bool](https://learn.microsoft.com/dotnet/api/system.boolean) - -### GetHashCode\(\) - -```csharp -public override int GetHashCode() -``` - -#### Returns - - [int](https://learn.microsoft.com/dotnet/api/system.int32) - -### New\(\) - -```csharp -public static ConnectionTicket New() -``` - -#### Returns - - [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) - -### Parse\(string\) - -```csharp -public static ConnectionTicket Parse(string text) -``` - -#### Parameters - -`text` [string](https://learn.microsoft.com/dotnet/api/system.string) - -#### Returns - - [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) - -### Serialize\(NetDataWriter\) - -```csharp -public readonly void Serialize(NetDataWriter writer) -``` - -#### Parameters - -`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) - -### ToString\(\) - -```csharp -public override string ToString() -``` - -#### Returns - - [string](https://learn.microsoft.com/dotnet/api/system.string) - -### TryParse\(string, out ConnectionTicket?\) - -```csharp -public static bool TryParse(string text, out ConnectionTicket? ticket) -``` - -#### Parameters - -`text` [string](https://learn.microsoft.com/dotnet/api/system.string) - -`ticket` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md)? - -#### Returns - - [bool](https://learn.microsoft.com/dotnet/api/system.boolean) - -## Operators - -### operator ==\(ConnectionTicket, ConnectionTicket\) - -```csharp -public static bool operator ==(ConnectionTicket left, ConnectionTicket right) -``` - -#### Parameters - -`left` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) - -`right` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) - -#### Returns - - [bool](https://learn.microsoft.com/dotnet/api/system.boolean) - -### operator \!=\(ConnectionTicket, ConnectionTicket\) - -```csharp -public static bool operator !=(ConnectionTicket left, ConnectionTicket right) -``` - -#### Parameters - -`left` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) - -`right` [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) - -#### Returns - - [bool](https://learn.microsoft.com/dotnet/api/system.boolean) - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md deleted file mode 100644 index 85e5e26..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md +++ /dev/null @@ -1,74 +0,0 @@ -# Interface IRpcClient - -Namespace: [ReadyM.Api.Multiplayer.Client](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md) -Assembly: ReadyM.Api.Multiplayer.dll - -```csharp -public interface IRpcClient -``` - -## Methods - -### AddClientRpcMessageHandler\(RelayMessageCode, Action\) - -```csharp -void AddClientRpcMessageHandler(RelayMessageCode eventCode, Action handler) -``` - -#### Parameters - -`eventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -`handler` [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md), [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs)\> - -### AddClientRpcMessageHandler\(RelayMessageCode, RelayMessageCode, Action\) - -```csharp -void AddClientRpcMessageHandler(RelayMessageCode minEventCode, RelayMessageCode maxEventCode, Action handler) -``` - -#### Parameters - -`minEventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -`maxEventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -`handler` [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md), [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs)\> - -### RemoveClientRpcMessageHandler\(RelayMessageCode, Action\) - -```csharp -void RemoveClientRpcMessageHandler(RelayMessageCode eventCode, Action handler) -``` - -#### Parameters - -`eventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -`handler` [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md), [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs)\> - -### RemoveClientRpcMessageHandler\(RelayMessageCode, RelayMessageCode, Action\) - -```csharp -void RemoveClientRpcMessageHandler(RelayMessageCode minEventCode, RelayMessageCode maxEventCode, Action handler) -``` - -#### Parameters - -`minEventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -`maxEventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -`handler` [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md), [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs)\> - -### SendMessage\(RelayMessage\) - -```csharp -void SendMessage(RelayMessage message) -``` - -#### Parameters - -`message` [RelayMessage](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md) - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md deleted file mode 100644 index e428fd9..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md +++ /dev/null @@ -1,55 +0,0 @@ -# Struct RelayMessage - -Namespace: [ReadyM.Api.Multiplayer.Client](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md) -Assembly: ReadyM.Api.Multiplayer.dll - -```csharp -public struct RelayMessage -``` - -#### Inherited Members - -[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), -[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), -[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), -[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), -[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), -[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) - -## Fields - -### Writer - -```csharp -public readonly NetDataWriter Writer -``` - -#### Field Value - - [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) - -## Methods - -### ByRelayMode\(RelayMessageCode, PlayerId, RelayMode, DeliveryMethod\) - -Send an event with a specific delivery method. - -```csharp -public static RelayMessage ByRelayMode(RelayMessageCode eventCode, PlayerId playerId, RelayMode mode, DeliveryMethod deliveryMethod) -``` - -#### Parameters - -`eventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -`playerId` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) - -`mode` [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) - -`deliveryMethod` [DeliveryMethod](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/NetConstants.cs) - -#### Returns - - [RelayMessage](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md) - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md deleted file mode 100644 index c4b4da5..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.md +++ /dev/null @@ -1,13 +0,0 @@ -# ReadyM.Api.Multiplayer.Client - -### Structs - - [ConnectionTicket](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.ConnectionTicket.md) - - [RelayMessage](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.RelayMessage.md) - -### Interfaces - - [IRpcClient](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md) - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md new file mode 100644 index 0000000..0fd850c --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md @@ -0,0 +1,93 @@ +# Struct AreaScopeComponent + +Namespace: [ReadyM.Api.Multiplayer.ECS.Components](../ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Holds information about the area entity, which is a scope for other entities. + +```csharp +public struct AreaScopeComponent : IIndexedComponent, IComponent, INetSerializable +``` + +#### Implements + +[IIndexedComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/Index/IIndexedComponent.cs), +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### AreaId + +```csharp +public AreaId AreaId { get; set; } +``` + +#### Property Value + + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs) + +### MasterClient + +```csharp +public PlayerId MasterClient { get; set; } +``` + +#### Property Value + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +## Methods + +### Assign\(in AreaScopeComponent\) + +```csharp +public void Assign(in AreaScopeComponent value) +``` + +#### Parameters + +`value` [AreaScopeComponent](../ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### GetIndexedValue\(\) + +Returns the value of the indexed component field. + +```csharp +public AreaId GetIndexedValue() +``` + +#### Returns + + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md new file mode 100644 index 0000000..807037d --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md @@ -0,0 +1,83 @@ +# Struct PlayerScopeComponent + +Namespace: [ReadyM.Api.Multiplayer.ECS.Components](../ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Holds the ID of the global player entity. + +```csharp +public struct PlayerScopeComponent : IIndexedComponent, IComponent, INetSerializable +``` + +#### Implements + +[IIndexedComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/Index/IIndexedComponent.cs), +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### PlayerId + +```csharp +public PlayerId PlayerId { get; set; } +``` + +#### Property Value + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +## Methods + +### Assign\(in PlayerScopeComponent\) + +```csharp +public void Assign(in PlayerScopeComponent value) +``` + +#### Parameters + +`value` [PlayerScopeComponent](../ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### GetIndexedValue\(\) + +Returns the value of the indexed component field. + +```csharp +public PlayerId GetIndexedValue() +``` + +#### Returns + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md new file mode 100644 index 0000000..deca5b3 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md @@ -0,0 +1,13 @@ +# ReadyM.Api.Multiplayer.ECS.Components + +### Structs + + [AreaScopeComponent](../ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md) + +Holds information about the area entity, which is a scope for other entities. + + [PlayerScopeComponent](../ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md) + +Holds the ID of the global player entity. + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md index 3a90699..b9f0269 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md @@ -74,7 +74,7 @@ public DeriveINetSerializableAttribute(SerializableMode mode = SerializableMode. #### Parameters -`mode` [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Serialization/SerializableMode.cs) +`mode` [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Serialization/SerializableMode.cs) Determines which members of the struct are serialized. See **SerializableMode** for details. @@ -88,6 +88,6 @@ public readonly SerializableMode Mode #### Field Value - [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Serialization/SerializableMode.cs) + [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Serialization/SerializableMode.cs) diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md index 79d9293..b8dbab8 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md @@ -4,7 +4,7 @@ Namespace: [ReadyM.Api.Multiplayer.Generators](../ReadyM.Api.Multiplayer.Generat Assembly: ReadyM.Api.Multiplayer.dll Marks a method as an RPC event handler. -Use this in partial classes extending from **RpcClassBase**. +Use this in partial classes extending from **ClientRpcHandler**. ```csharp [AttributeUsage(AttributeTargets.Method)] @@ -68,7 +68,7 @@ public sealed class RpcEventAttribute : Attribute ### RpcEventAttribute\(RelayMode\) Marks a method as an RPC event handler. -Use this in partial classes extending from **RpcClassBase**. +Use this in partial classes extending from **ClientRpcHandler**. ```csharp public RpcEventAttribute(RelayMode relayMode) diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md index cc1e732..5578bb6 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md @@ -9,6 +9,6 @@ Decorate a struct with this attribute to make it available for use as an RPC par [RpcEventAttribute](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md) Marks a method as an RPC event handler. -Use this in partial classes extending from **RpcClassBase**. +Use this in partial classes extending from **ClientRpcHandler**. diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md new file mode 100644 index 0000000..ac5bb76 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md @@ -0,0 +1,25 @@ +# ReadyM.Api.Multiplayer + +### Namespaces + + [ReadyM.Api.Multiplayer.Generators](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md) + + [ReadyM.Api.Multiplayer.Protocol](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md) + + [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md) + +### Classes + + [ClientToServerAttribute](../ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md) + +Client-to-server (request) leg of a contract method: generates a Send on the client and an +On(RpcContext, ...) handler on the server. Different-shaped two-way RPCs are two overloads +(one per direction); identical-shape two-way is one method with both attributes. Every contract +method needs at least one direction attribute. + + [ServerToClientAttribute](../ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md) + +Server-to-client (response/push) leg of a contract method: generates a Send(PlayerId, ...) on +the server and an On(...) handler on the client. See **ClientToServerAttribute**. + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md deleted file mode 100644 index 5551126..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md +++ /dev/null @@ -1,50 +0,0 @@ -# Enum RelayMessageCode - -Namespace: [ReadyM.Api.Multiplayer.Protocol.Enums](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md) -Assembly: ReadyM.Api.Multiplayer.dll - -A unique identifier of a single RPC message type. - -```csharp -public enum RelayMessageCode : byte -``` - -## Fields - -`HandshakeConnected = 255` - -`RequestAreaEvent = 254` - -`AreaEvent = 253` - -`OtherPlayerConnectionEvent = 252` - -`OtherPlayerAreaEvent = 251` - -`EcsDelta = 250` - -`MaxBuiltInEvent = 250` - -`EcsSnapshot = 249` - -`EcsCreateEntity = 248` - -`EcsDeleteEntity = 247` - -`EcsChangeOwnership = 246` - -`MinBuiltInEvent = 246` - -`MaxAnyCustomEvent = 245` - -`MaxServerRpcEvent = 245` - -`MinServerRpcEvent = 150` - -`MaxClientRpcEvent = 149` - -`MinClientRpcEvent = 0` - -`MinAnyCustomEvent = 0` - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md index 6f868a4..84727ca 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md @@ -4,17 +4,6 @@ [ReadyM.Api.Multiplayer.Protocol.Enums](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md) -### Structs - - [CustomRelayEventHeader](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md) - -Spans 4 bytes in standard relay modes and (6 + 2 * peers) in peer-targeted relay mode. -- 1 byte for eventCode -- 2 bytes for sender -- 2 bytes for peers count -- 1 byte for relayMode -- peers * 2 bytes for peers - ### Enums [DisconnectedReason](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md) diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md deleted file mode 100644 index 3280576..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md +++ /dev/null @@ -1,10 +0,0 @@ -# ReadyM.Api.Multiplayer.RPC - -### Classes - - [RpcClassBase](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md) - -Base class for an RPC container. -Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class. - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md deleted file mode 100644 index 0fe639c..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.CustomRelayEventHeader.md +++ /dev/null @@ -1,93 +0,0 @@ -# Struct CustomRelayEventHeader - -Namespace: [ReadyM.Api.Multiplayer.Protocol](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md) -Assembly: ReadyM.Api.Multiplayer.dll - -Spans 4 bytes in standard relay modes and (6 + 2 * peers) in peer-targeted relay mode. -- 1 byte for eventCode -- 2 bytes for sender -- 2 bytes for peers count -- 1 byte for relayMode -- peers * 2 bytes for peers - -```csharp -public struct CustomRelayEventHeader -``` - -#### Inherited Members - -[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), -[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), -[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), -[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), -[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), -[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) - -## Constructors - -### CustomRelayEventHeader\(RelayMessageCode, PlayerId, PlayerId\[\]?, RelayMode\) - -Spans 4 bytes in standard relay modes and (6 + 2 * peers) in peer-targeted relay mode. -- 1 byte for eventCode -- 2 bytes for sender -- 2 bytes for peers count -- 1 byte for relayMode -- peers * 2 bytes for peers - -```csharp -public CustomRelayEventHeader(RelayMessageCode eventCode, PlayerId sender, PlayerId[]? peers, RelayMode relayMode = RelayMode.AreaOfInterestOthers) -``` - -#### Parameters - -`eventCode` [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -`sender` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) - -`peers` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\[\]? - -`relayMode` [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) - -## Fields - -### EventCode - -```csharp -public RelayMessageCode EventCode -``` - -#### Field Value - - [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -### Peers - -```csharp -public PlayerId[]? Peers -``` - -#### Field Value - - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\[\]? - -### RelayMode - -```csharp -public RelayMode RelayMode -``` - -#### Field Value - - [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) - -### Sender - -```csharp -public PlayerId Sender -``` - -#### Field Value - - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md index a613d24..bfd8e49 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md @@ -2,10 +2,6 @@ ### Enums - [RelayMessageCode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMessageCode.md) - -A unique identifier of a single RPC message type. - [RelayMode](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md) Indicates how an RPC message should be relayed to other players in the game. diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md new file mode 100644 index 0000000..b538784 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md @@ -0,0 +1,76 @@ +# Class ClientRpcHandler + +Namespace: [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Base class for a client-side RPC handler. +Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class. + +```csharp +public abstract class ClientRpcHandler : RpcBase, IHostedService, IDisposable +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[RpcBase](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md) ← +[ClientRpcHandler](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md) + +#### Implements + +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IHostedService.cs), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +#### Inherited Members + +[RpcBase.InitRpc\(\)](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_InitRpc), +[RpcBase.DeInitRpc\(\)](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_DeInitRpc), +[RpcBase.OnScopeStart\(\)](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_OnScopeStart), +[RpcBase.Dispose\(\)](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_Dispose), +[RpcBase.RelayClient](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_RelayClient), +[RpcBase.Serializer](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_Serializer), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ClientRpcHandler\(\) + +```csharp +protected ClientRpcHandler() +``` + +## Properties + +### EventsCount + +Number of RPC events defined in this class. +Generated by the source generator in derived classes. + +```csharp +protected abstract byte EventsCount { get; } +``` + +#### Property Value + + [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +### Offset + +Event code offset assigned to this RPC class. +Generated by the source generator in derived classes. + +```csharp +protected byte Offset { get; } +``` + +#### Property Value + + [byte](https://learn.microsoft.com/dotnet/api/system.byte) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md new file mode 100644 index 0000000..d2e45a8 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md @@ -0,0 +1,106 @@ +# Class RpcBase + +Namespace: [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Base class for all RPC handlers, client and server. + +```csharp +public abstract class RpcBase : IHostedService, IDisposable +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[RpcBase](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md) + +#### Derived + +[ClientRpcHandler](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md), +[ServerRpcClient](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md) + +#### Implements + +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IHostedService.cs), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### RpcBase\(\) + +```csharp +protected RpcBase() +``` + +## Properties + +### RelayClient + +RPC client to use for sending RPCs. This is injected by the DI container. + +```csharp +public IRpcClient RelayClient { protected get; set; } +``` + +#### Property Value + + IRpcClient + +### Serializer + +Serializer to use for serializing RPC parameters. This is injected by the DI container. + +```csharp +public IRelaySerializer Serializer { protected get; set; } +``` + +#### Property Value + + IRelaySerializer + +## Methods + +### DeInitRpc\(\) + +De-initializes the RPC class, e.g. by unregistering RPC handlers. +Generated by the source generator in derived classes. + +```csharp +protected abstract void DeInitRpc() +``` + +### Dispose\(\) + +```csharp +public virtual void Dispose() +``` + +### InitRpc\(\) + +Initializes the RPC class, e.g. by registering RPC handlers. +Generated by the source generator in derived classes. + +```csharp +protected abstract void InitRpc() +``` + +### OnScopeStart\(\) + +Called when the DI container is initialized (on game start). +This allows the service to perform any necessary setup at the appropriate time, such as registering event handlers. + +```csharp +public virtual void OnScopeStart() +``` + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md deleted file mode 100644 index 78121f5..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md +++ /dev/null @@ -1,151 +0,0 @@ -# Class RpcClassBase - -Namespace: [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.RPC.md) -Assembly: ReadyM.Api.Multiplayer.dll - -Base class for an RPC container. -Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class. - -```csharp -public abstract class RpcClassBase : IHostedService, IDisposable -``` - -#### Inheritance - -[object](https://learn.microsoft.com/dotnet/api/system.object) ← -[RpcClassBase](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase.md) - -#### Implements - -[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/DI/IHostedService.cs), -[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) - -#### Inherited Members - -[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), -[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), -[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), -[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), -[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), -[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), -[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) - -## Constructors - -### RpcClassBase\(IRpcClient, IRelaySerializer\) - -Base class for an RPC container. -Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class. - -```csharp -protected RpcClassBase(IRpcClient client, IRelaySerializer serializer) -``` - -#### Parameters - -`client` [IRpcClient](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md) - -RPC client to use for sending RPCs. This is injected by the DI container. - -`serializer` [IRelaySerializer](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md) - -Serializer to use for serializing RPC parameters. This is injected by the DI container. - -## Properties - -### EventsCount - -Number of RPC events defined in this class. -Generated by the source generator in derived classes. - -```csharp -protected abstract byte EventsCount { get; } -``` - -#### Property Value - - [byte](https://learn.microsoft.com/dotnet/api/system.byte) - -### Offset - -Event code offset assigned to this RPC class. -Generated by the source generator in derived classes. - -```csharp -protected byte Offset { get; } -``` - -#### Property Value - - [byte](https://learn.microsoft.com/dotnet/api/system.byte) - -### RelayClient - -RPC client to use for sending RPCs. This is injected by the DI container. - -```csharp -protected IRpcClient RelayClient { get; } -``` - -#### Property Value - - [IRpcClient](../ReadyM.Api.Multiplayer.Client/ReadyM.Api.Multiplayer.Client.IRpcClient.md) - -### Serializer - -Serializer to use for serializing RPC parameters. This is injected by the DI container. - -```csharp -protected IRelaySerializer Serializer { get; } -``` - -#### Property Value - - [IRelaySerializer](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md) - -## Methods - -### DeInitRpc\(\) - -De-initializes the RPC class, e.g. by unregistering RPC handlers. -Generated by the source generator in derived classes. - -```csharp -protected abstract void DeInitRpc() -``` - -### Dispose\(\) - -```csharp -public virtual void Dispose() -``` - -### InitRpc\(\) - -Initializes the RPC class, e.g. by registering RPC handlers. -Generated by the source generator in derived classes. - -```csharp -protected abstract void InitRpc() -``` - -### OnScopeStart\(\) - -Called when the DI container is initialized (on game start). -This allows the service to perform any necessary setup at the appropriate time, such as registering event handlers. - -```csharp -public virtual void OnScopeStart() -``` - -### RunOnMainThread\(Action\) - -```csharp -protected void RunOnMainThread(Action callback) -``` - -#### Parameters - -`callback` [Action](https://learn.microsoft.com/dotnet/api/system.action) - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md new file mode 100644 index 0000000..aa533b5 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md @@ -0,0 +1,47 @@ +# Class ServerRpcClient + +Namespace: [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Base class for server-defined RPC handlers. + +```csharp +public abstract class ServerRpcClient : RpcBase, IHostedService, IDisposable +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[RpcBase](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md) ← +[ServerRpcClient](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md) + +#### Implements + +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IHostedService.cs), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +#### Inherited Members + +[RpcBase.InitRpc\(\)](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_InitRpc), +[RpcBase.DeInitRpc\(\)](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_DeInitRpc), +[RpcBase.OnScopeStart\(\)](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_OnScopeStart), +[RpcBase.Dispose\(\)](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_Dispose), +[RpcBase.RelayClient](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_RelayClient), +[RpcBase.Serializer](ReadyM.Api.Multiplayer.RPC.RpcBase.md\#ReadyM\_Api\_Multiplayer\_RPC\_RpcBase\_Serializer), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ServerRpcClient\(\) + +```csharp +protected ServerRpcClient() +``` + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md new file mode 100644 index 0000000..df80753 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md @@ -0,0 +1,18 @@ +# ReadyM.Api.Multiplayer.RPC + +### Classes + + [ClientRpcHandler](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md) + +Base class for a client-side RPC handler. +Each class that defines RPC methods with [RpcEvent] attributes must inherit from this class. + + [RpcBase](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md) + +Base class for all RPC handlers, client and server. + + [ServerRpcClient](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md) + +Base class for server-defined RPC handlers. + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md deleted file mode 100644 index cd54dff..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md +++ /dev/null @@ -1,56 +0,0 @@ -# Interface IRelaySerializer - -Namespace: [ReadyM.Api.Multiplayer.Serialization](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md) -Assembly: ReadyM.Api.Multiplayer.dll - -```csharp -public interface IRelaySerializer -``` - -## Methods - -### DeserializeObject\(NetDataReader\) - -```csharp -object? DeserializeObject(NetDataReader stream) -``` - -#### Parameters - -`stream` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) - -#### Returns - - [object](https://learn.microsoft.com/dotnet/api/system.object)? - -### DeserializeObject\(NetDataReader\) - -```csharp -T DeserializeObject(NetDataReader stream) -``` - -#### Parameters - -`stream` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) - -#### Returns - - T - -#### Type Parameters - -`T` - -### SerializeObject\(NetDataWriter, object?\) - -```csharp -void SerializeObject(NetDataWriter writer, object? data) -``` - -#### Parameters - -`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) - -`data` [object](https://learn.microsoft.com/dotnet/api/system.object)? - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md deleted file mode 100644 index bd35eef..0000000 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.md +++ /dev/null @@ -1,7 +0,0 @@ -# ReadyM.Api.Multiplayer.Serialization - -### Interfaces - - [IRelaySerializer](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Multiplayer.Serialization.IRelaySerializer.md) - - diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md new file mode 100644 index 0000000..41f6731 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md @@ -0,0 +1,76 @@ +# Class ClientToServerAttribute + +Namespace: [ReadyM.Api.Multiplayer](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Client-to-server (request) leg of a contract method: generates a Send on the client and an +On(RpcContext, ...) handler on the server. Different-shaped two-way RPCs are two overloads +(one per direction); identical-shape two-way is one method with both attributes. Every contract +method needs at least one direction attribute. + +```csharp +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public sealed class ClientToServerAttribute : Attribute +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) ← +[ClientToServerAttribute](../ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md) + +#### Inherited Members + +[Attribute.GetCustomAttributes\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(MemberInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\)), +[Attribute.GetCustomAttributes\(MemberInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-boolean\)), +[Attribute.IsDefined\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.IsDefined\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-boolean\)), +[Attribute.IsDefined\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.IsDefined\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttributes\(Module\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\)), +[Attribute.GetCustomAttributes\(Module, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\)), +[Attribute.IsDefined\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttribute\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttributes\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\)), +[Attribute.GetCustomAttributes\(Assembly, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-boolean\)), +[Attribute.IsDefined\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\)), +[Attribute.IsDefined\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttribute\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.equals), +[Attribute.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.gethashcode), +[Attribute.Match\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.match), +[Attribute.IsDefaultAttribute\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefaultattribute), +[Attribute.TypeId](https://learn.microsoft.com/dotnet/api/system.attribute.typeid), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ClientToServerAttribute\(\) + +```csharp +public ClientToServerAttribute() +``` + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md new file mode 100644 index 0000000..760b36f --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md @@ -0,0 +1,74 @@ +# Class ServerToClientAttribute + +Namespace: [ReadyM.Api.Multiplayer](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Server-to-client (response/push) leg of a contract method: generates a Send(PlayerId, ...) on +the server and an On(...) handler on the client. See **ClientToServerAttribute**. + +```csharp +[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] +public sealed class ServerToClientAttribute : Attribute +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) ← +[ServerToClientAttribute](../ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md) + +#### Inherited Members + +[Attribute.GetCustomAttributes\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(MemberInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\)), +[Attribute.GetCustomAttributes\(MemberInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-boolean\)), +[Attribute.IsDefined\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.IsDefined\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-boolean\)), +[Attribute.IsDefined\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.IsDefined\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttributes\(Module\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\)), +[Attribute.GetCustomAttributes\(Module, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\)), +[Attribute.IsDefined\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttribute\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttributes\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\)), +[Attribute.GetCustomAttributes\(Assembly, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-boolean\)), +[Attribute.IsDefined\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\)), +[Attribute.IsDefined\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttribute\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.equals), +[Attribute.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.gethashcode), +[Attribute.Match\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.match), +[Attribute.IsDefaultAttribute\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefaultattribute), +[Attribute.TypeId](https://learn.microsoft.com/dotnet/api/system.attribute.typeid), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ServerToClientAttribute\(\) + +```csharp +public ServerToClientAttribute() +``` + + diff --git a/wukong-mp/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md similarity index 73% rename from wukong-mp/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md rename to wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md index fda76b8..b778adc 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md +++ b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md @@ -1,7 +1,9 @@ # Struct FileInfo -Namespace: [WukongMp.Api.Https](../WukongMp.Api.Https/WukongMp.Api.Https.md) -Assembly: WukongMp.Api.dll +Namespace: [ReadyM.Api.Saves](../ReadyM.Api.Saves/ReadyM.Api.Saves.md) +Assembly: ReadyM.Api.dll + +Represents a file with a name and binary content, used for saving game data. ```csharp public readonly struct FileInfo @@ -18,7 +20,9 @@ public readonly struct FileInfo ## Constructors -### FileInfo\(string, byte\[\]\) +### FileInfo\(string, byte\[\]\) + +Represents a file with a name and binary content, used for saving game data. ```csharp public FileInfo(string name, byte[] content) @@ -32,7 +36,7 @@ public FileInfo(string name, byte[] content) ## Properties -### Content +### Content The binary content of the file. @@ -44,7 +48,7 @@ public byte[] Content { get; } [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[\] -### Name +### Name The name of the file. diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md similarity index 77% rename from wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md rename to wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md index 1bc8939..1aba420 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md +++ b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md @@ -1,7 +1,7 @@ # Enum SaveFileType -Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) -Assembly: WukongMp.Sdk.dll +Namespace: [ReadyM.Api.Saves](../ReadyM.Api.Saves/ReadyM.Api.Saves.md) +Assembly: ReadyM.Api.dll Indicates the type of a save file. diff --git a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.md b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.md new file mode 100644 index 0000000..2e9dccc --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.md @@ -0,0 +1,15 @@ +# ReadyM.Api.Saves + +### Structs + + [FileInfo](../ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md) + +Represents a file with a name and binary content, used for saving game data. + +### Enums + + [SaveFileType](../ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md) + +Indicates the type of a save file. + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Serialization.md b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Serialization.md similarity index 100% rename from wukong-mp/api-reference/ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Serialization.md rename to wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Serialization.md diff --git a/wukong-mp/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md b/wukong-mp/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md index cb69bca..dc617d6 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md +++ b/wukong-mp/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md @@ -1,6 +1,6 @@ # Enum SerializableMode -Namespace: [ReadyM.Api.Serialization](../ReadyM.Api.Multiplayer.Serialization/ReadyM.Api.Serialization.md) +Namespace: [ReadyM.Api.Serialization](../ReadyM.Api.Saves/ReadyM.Api.Serialization.md) Assembly: ReadyM.Api.dll Defines how a struct should be serialized when using DeriveINetSerializableAttribute. diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md new file mode 100644 index 0000000..5095afa --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md @@ -0,0 +1,42 @@ +# Interface IComponentRegistry + +Namespace: [ReadyM.Relay.Server.Sdk.Ecs.Components](../ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +Allows registering components with the ECS system, both local and networked. + +```csharp +public interface IComponentRegistry +``` + +## Methods + +### RegisterComponent\(\) + +Registers a networked (replicated over the network) component type with the ECS system. + +```csharp +void RegisterComponent() where T : struct, INetworkedComponent +``` + +#### Type Parameters + +`T` + +The type of the component to register. Must be a struct that implements **INetworkedComponent**. + +### RegisterLocalComponent\(\) + +Registers a local (not replicated over the network) component type with the ECS system. + +```csharp +void RegisterLocalComponent() where T : struct +``` + +#### Type Parameters + +`T` + +The type of the component to register. Must be a struct. + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md new file mode 100644 index 0000000..0c30e69 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md @@ -0,0 +1,9 @@ +# ReadyM.Relay.Server.Sdk.Ecs.Components + +### Interfaces + + [IComponentRegistry](../ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md) + +Allows registering components with the ECS system, both local and networked. + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md new file mode 100644 index 0000000..984231c --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md @@ -0,0 +1,67 @@ +# Struct ModSystemBase.UpdateTick + +Namespace: [ReadyM.Relay.Server.Sdk.Ecs.Systems](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +Holds the time information for the current update tick. + +```csharp +protected readonly struct ModSystemBase.UpdateTick +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### UpdateTick\(float, float\) + +Holds the time information for the current update tick. + +```csharp +public UpdateTick(float deltaTime, float time) +``` + +#### Parameters + +`deltaTime` [float](https://learn.microsoft.com/dotnet/api/system.single) + +Time since last tick, in seconds. + +`time` [float](https://learn.microsoft.com/dotnet/api/system.single) + +Total time since server start, in seconds. + +## Fields + +### deltaTime + +The time in seconds since the last tick. + +```csharp +public readonly float deltaTime +``` + +#### Field Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +### time + +The time at the beginning of the current frame since application start. + +```csharp +public readonly float time +``` + +#### Field Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md new file mode 100644 index 0000000..38a511d --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md @@ -0,0 +1,70 @@ +# Class ModSystemBase + +Namespace: [ReadyM.Relay.Server.Sdk.Ecs.Systems](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +A base class for server-side mod systems that need to perform updates each tick. +Inherit from this class and implement the **UpdateTick)** method to define your system's behavior. + +```csharp +public abstract class ModSystemBase +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ModSystemBase](../ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ModSystemBase\(\) + +```csharp +protected ModSystemBase() +``` + +## Methods + +### OnUpdate\(UpdateTick\) + +Called every tick to update the system. Implement this method in derived classes to define the system's behavior. + +```csharp +protected abstract void OnUpdate(ModSystemBase.UpdateTick tick) +``` + +#### Parameters + +`tick` [ModSystemBase](../ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md).[UpdateTick](../ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md) + +The current update tick information, including delta time and total time. + +### Update\(float, float\) + +Runs the system update for the current tick. + +```csharp +public void Update(float deltaTime, float time) +``` + +#### Parameters + +`deltaTime` [float](https://learn.microsoft.com/dotnet/api/system.single) + +Time since last tick, in seconds. + +`time` [float](https://learn.microsoft.com/dotnet/api/system.single) + +Total time since server start, in seconds. + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md new file mode 100644 index 0000000..28229fd --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md @@ -0,0 +1,435 @@ +# Class EcsApi + +Namespace: [ReadyM.Relay.Server.Sdk.Ecs](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +Mod-side ECS API. Wraps the function pointers exposed by the AOT server. +All component types - whether defined in the server binary or in this mod - are +identified by int component IDs assigned at registration time. + +```csharp +public class EcsApi +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### CreateEntity\(ArchetypeId\) + +```csharp +public Entity CreateEntity(ArchetypeId archetypeId) +``` + +#### Parameters + +`archetypeId` [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + +#### Returns + + [Entity](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md) + +### Query\(EmbedForEach\) + +```csharp +public void Query(EcsApi.EmbedForEach callback) where T : struct +``` + +#### Parameters + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEach + +#### Type Parameters + +`T` + +### Query\(TState, EmbedForEachStateManaged\) + +```csharp +public void Query(TState state, EcsApi.EmbedForEachStateManaged callback) where T : struct where TState : class +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachStateManaged + +#### Type Parameters + +`T` + +`TState` + +### Query\(ref TState, EmbedForEachState\) + +```csharp +public void Query(ref TState state, EcsApi.EmbedForEachState callback) where T : struct where TState : unmanaged +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachState + +#### Type Parameters + +`T` + +`TState` + +### Query\(EmbedForEach\) + +```csharp +public void Query(EcsApi.EmbedForEach callback) where T1 : struct where T2 : struct +``` + +#### Parameters + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEach + +#### Type Parameters + +`T1` + +`T2` + +### Query\(TState, EmbedForEachStateManaged\) + +```csharp +public void Query(TState state, EcsApi.EmbedForEachStateManaged callback) where T1 : struct where T2 : struct where TState : class +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachStateManaged + +#### Type Parameters + +`T1` + +`T2` + +`TState` + +### Query\(ref TState, EmbedForEachState\) + +```csharp +public void Query(ref TState state, EcsApi.EmbedForEachState callback) where T1 : struct where T2 : struct where TState : unmanaged +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachState + +#### Type Parameters + +`T1` + +`T2` + +`TState` + +### Query\(EmbedForEach\) + +```csharp +public void Query(EcsApi.EmbedForEach callback) where T1 : struct where T2 : struct where T3 : struct +``` + +#### Parameters + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEach + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +### Query\(TState, EmbedForEachStateManaged\) + +```csharp +public void Query(TState state, EcsApi.EmbedForEachStateManaged callback) where T1 : struct where T2 : struct where T3 : struct where TState : class +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachStateManaged + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`TState` + +### Query\(ref TState, EmbedForEachState\) + +```csharp +public void Query(ref TState state, EcsApi.EmbedForEachState callback) where T1 : struct where T2 : struct where T3 : struct where TState : unmanaged +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachState + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`TState` + +### Query\(EmbedForEach\) + +```csharp +public void Query(EcsApi.EmbedForEach callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct +``` + +#### Parameters + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEach + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +### Query\(TState, EmbedForEachStateManaged\) + +```csharp +public void Query(TState state, EcsApi.EmbedForEachStateManaged callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct where TState : class +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachStateManaged + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +`TState` + +### Query\(ref TState, EmbedForEachState\) + +```csharp +public void Query(ref TState state, EcsApi.EmbedForEachState callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct where TState : unmanaged +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachState + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +`TState` + +### Query\(EmbedForEach\) + +```csharp +public void Query(EcsApi.EmbedForEach callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct +``` + +#### Parameters + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEach + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +`T5` + +### Query\(TState, EmbedForEachStateManaged\) + +```csharp +public void Query(TState state, EcsApi.EmbedForEachStateManaged callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where TState : class +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachStateManaged + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +`T5` + +`TState` + +### Query\(ref TState, EmbedForEachState\) + +```csharp +public void Query(ref TState state, EcsApi.EmbedForEachState callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where TState : unmanaged +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachState + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +`T5` + +`TState` + +### Query\(EmbedForEach\) + +```csharp +public void Query(EcsApi.EmbedForEach callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct +``` + +#### Parameters + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEach + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +`T5` + +`T6` + +### Query\(TState, EmbedForEachStateManaged\) + +```csharp +public void Query(TState state, EcsApi.EmbedForEachStateManaged callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct where TState : class +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachStateManaged + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +`T5` + +`T6` + +`TState` + +### Query\(ref TState, EmbedForEachState\) + +```csharp +public void Query(ref TState state, EcsApi.EmbedForEachState callback) where T1 : struct where T2 : struct where T3 : struct where T4 : struct where T5 : struct where T6 : struct where TState : unmanaged +``` + +#### Parameters + +`state` TState + +`callback` [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md).EmbedForEachState + +#### Type Parameters + +`T1` + +`T2` + +`T3` + +`T4` + +`T5` + +`T6` + +`TState` + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md new file mode 100644 index 0000000..64ed31e --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md @@ -0,0 +1,47 @@ +# Struct Entity + +Namespace: [ReadyM.Relay.Server.Sdk.Ecs](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +Represents an entity in the ECS. + +```csharp +public readonly struct Entity +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### GetComponent\(\) + +Gets a reference to the component of type T associated with this entity. + +```csharp +public ref T GetComponent() where T : struct +``` + +#### Returns + + T + +A mutable reference to the component. + +#### Type Parameters + +`T` + +Type of the component + +#### Remarks + +Attempting to access a component that does not exist on the entity's archetype will crash your mod. + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md new file mode 100644 index 0000000..f12890c --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md @@ -0,0 +1,16 @@ +# ReadyM.Relay.Server.Sdk.Ecs.Systems + +### Classes + + [ModSystemBase](../ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md) + +A base class for server-side mod systems that need to perform updates each tick. +Inherit from this class and implement the **UpdateTick)** method to define your system's behavior. + +### Structs + + [ModSystemBase.UpdateTick](../ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md) + +Holds the time information for the current update tick. + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md new file mode 100644 index 0000000..1fc2d9e --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md @@ -0,0 +1,23 @@ +# ReadyM.Relay.Server.Sdk.Ecs + +### Namespaces + + [ReadyM.Relay.Server.Sdk.Ecs.Components](../ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md) + + [ReadyM.Relay.Server.Sdk.Ecs.Systems](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md) + +### Classes + + [EcsApi](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md) + +Mod-side ECS API. Wraps the function pointers exposed by the AOT server. +All component types - whether defined in the server binary or in this mod - are +identified by int component IDs assigned at registration time. + +### Structs + + [Entity](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md) + +Represents an entity in the ECS. + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md new file mode 100644 index 0000000..eef73d4 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md @@ -0,0 +1,45 @@ +# Class RpcApi + +Namespace: [ReadyM.Relay.Server.Sdk.Rpc](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +Low-level API for handling RPC messages in the ReadyM Relay Server SDK. + +```csharp +public class RpcApi +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[RpcApi](../ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Methods + +### SendToOne\(PlayerId, NetDataWriter, DeliveryMethod\) + +Sends a message to a specific player with the given data and delivery method. + +```csharp +public void SendToOne(PlayerId player, NetDataWriter data, DeliveryMethod deliveryMethod) +``` + +#### Parameters + +`player` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +`data` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +`deliveryMethod` [DeliveryMethod](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/NetConstants.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md new file mode 100644 index 0000000..d8d1ba5 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md @@ -0,0 +1,51 @@ +# Struct RpcContext + +Namespace: [ReadyM.Relay.Server.Sdk.Rpc](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +Contextual information passed to every generated OnX server RPC stub. +Wraps per-message metadata so handler signatures stay clean as the context grows. + +```csharp +public readonly struct RpcContext +``` + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### RpcContext\(PlayerId\) + +Contextual information passed to every generated OnX server RPC stub. +Wraps per-message metadata so handler signatures stay clean as the context grows. + +```csharp +public RpcContext(PlayerId sender) +``` + +#### Parameters + +`sender` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +## Properties + +### Sender + +The client player who sent this RPC. + +```csharp +public PlayerId Sender { get; } +``` + +#### Property Value + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md new file mode 100644 index 0000000..d6375b2 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md @@ -0,0 +1,89 @@ +# Class ServerRpcHandlersBase + +Namespace: [ReadyM.Relay.Server.Sdk.Rpc](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +```csharp +public abstract class ServerRpcHandlersBase : IHostedService, IDisposable +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ServerRpcHandlersBase](../ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md) + +#### Implements + +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IHostedService.cs), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ServerRpcHandlersBase\(\) + +```csharp +protected ServerRpcHandlersBase() +``` + +## Properties + +### Rpc + +```csharp +public RpcApi Rpc { protected get; set; } +``` + +#### Property Value + + [RpcApi](../ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md) + +### Serializer + +```csharp +public IRelaySerializer Serializer { protected get; set; } +``` + +#### Property Value + + IRelaySerializer + +## Methods + +### DeInitRpc\(\) + +```csharp +protected abstract void DeInitRpc() +``` + +### Dispose\(\) + +```csharp +public virtual void Dispose() +``` + +### InitRpc\(\) + +```csharp +protected abstract void InitRpc() +``` + +### OnScopeStart\(\) + +Called when the DI container is initialized (on game start). +This allows the service to perform any necessary setup at the appropriate time, such as registering event handlers. + +```csharp +public void OnScopeStart() +``` + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md new file mode 100644 index 0000000..48001ed --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md @@ -0,0 +1,29 @@ +# Interface IServerDependencyContainer + +Namespace: [ReadyM.Relay.Server.Sdk](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +Represents a dependency injection container for server-side mods. +Allows registering systems, apart from standard DI services. + +```csharp +public interface IServerDependencyContainer : IDependencyContainer +``` + +#### Implements + +[IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IDependencyContainer.cs) + +## Methods + +### RegisterSystem\(\) + +```csharp +void RegisterSystem() where TSystem : ModSystemBase +``` + +#### Type Parameters + +`TSystem` + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md new file mode 100644 index 0000000..9545181 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md @@ -0,0 +1,18 @@ +# ReadyM.Relay.Server.Sdk.Rpc + +### Classes + + [RpcApi](../ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md) + +Low-level API for handling RPC messages in the ReadyM Relay Server SDK. + + [ServerRpcHandlersBase](../ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md) + +### Structs + + [RpcContext](../ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md) + +Contextual information passed to every generated OnX server RPC stub. +Wraps per-message metadata so handler signatures stay clean as the context grows. + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md new file mode 100644 index 0000000..619c1dd --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md @@ -0,0 +1,85 @@ +# Class ServerModBase + +Namespace: [ReadyM.Relay.Server.Sdk](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md) +Assembly: ReadyM.Relay.Server.Sdk.dll + +```csharp +public abstract class ServerModBase +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[ServerModBase](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ServerModBase\(\) + +```csharp +protected ServerModBase() +``` + +## Properties + +### Services + +```csharp +protected IServerDependencyContainer Services { get; } +``` + +#### Property Value + + [IServerDependencyContainer](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md) + +## Methods + +### Init\(\) + +```csharp +protected abstract void Init() +``` + +### Initialize\(IServerDependencyContainer\) + +```csharp +public void Initialize(IServerDependencyContainer services) +``` + +#### Parameters + +`services` [IServerDependencyContainer](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md) + +### InitializeAot\(IComponentRegistry\) + +```csharp +public void InitializeAot(IComponentRegistry registry) +``` + +#### Parameters + +`registry` [IComponentRegistry](../ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md) + +### RegisterComponents\(IComponentRegistry\) + +Any components defined in the mod must be registered here. + +```csharp +protected virtual void RegisterComponents(IComponentRegistry registry) +``` + +#### Parameters + +`registry` [IComponentRegistry](../ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md) + + diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md new file mode 100644 index 0000000..699b1d1 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md @@ -0,0 +1,20 @@ +# ReadyM.Relay.Server.Sdk + +### Namespaces + + [ReadyM.Relay.Server.Sdk.Ecs](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md) + + [ReadyM.Relay.Server.Sdk.Rpc](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md) + +### Classes + + [ServerModBase](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md) + +### Interfaces + + [IServerDependencyContainer](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md) + +Represents a dependency injection container for server-side mods. +Allows registering systems, apart from standard DI services. + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md new file mode 100644 index 0000000..531fd9a --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md @@ -0,0 +1,110 @@ +# Struct AnimationComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds entity movement animation state. + +```csharp +public struct AnimationComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### MoveAcceleration + +```csharp +public Vector3 MoveAcceleration { get; set; } +``` + +#### Property Value + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +### MoveSpeedLevel + +```csharp +public byte MoveSpeedLevel { get; set; } +``` + +#### Property Value + + [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +### MoveSpeedState + +```csharp +public byte MoveSpeedState { get; set; } +``` + +#### Property Value + + [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +### ShouldWaitRotateFinished + +```csharp +public bool ShouldWaitRotateFinished { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Velocity + +```csharp +public Vector3 Velocity { get; set; } +``` + +#### Property Value + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +## Methods + +### Assign\(in AnimationComponent\) + +```csharp +public void Assign(in AnimationComponent value) +``` + +#### Parameters + +`value` [AnimationComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md new file mode 100644 index 0000000..593b964 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md @@ -0,0 +1,100 @@ +# Struct HpComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds entity HP, max HP, scaling factor and death state. + +```csharp +public struct HpComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### Hp + +```csharp +public float Hp { get; set; } +``` + +#### Property Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +### HpMaxBase + +```csharp +public float HpMaxBase { get; set; } +``` + +#### Property Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +### HpMaxMulPercent + +```csharp +public int HpMaxMulPercent { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### IsDead + +```csharp +public bool IsDead { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +## Methods + +### Assign\(in HpComponent\) + +```csharp +public void Assign(in HpComponent value) +``` + +#### Parameters + +`value` [HpComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md new file mode 100644 index 0000000..eacf6e7 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md @@ -0,0 +1,313 @@ +# Struct MainCharacterComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds the main character state. + +```csharp +public struct MainCharacterComponent : IIndexedComponent, IComponent, INetSerializable +``` + +#### Implements + +[IIndexedComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/Index/IIndexedComponent.cs), +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### MainCharacterComponent\(\) + +Holds the main character state. + +```csharp +public MainCharacterComponent() +``` + +## Properties + +### Attributes + +```csharp +public AttributesState Attributes { get; set; } +``` + +#### Property Value + + [AttributesState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md) + +### BeguilingChantEligible + +```csharp +public bool BeguilingChantEligible { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equipment + +```csharp +public EquipmentState Equipment { get; set; } +``` + +#### Property Value + + [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + +### InJump + +```csharp +public bool InJump { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsAttacking + +```csharp +public bool IsAttacking { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsFalling + +```csharp +public bool IsFalling { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsFlying + +```csharp +public bool IsFlying { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsLandingMove + +```csharp +public bool IsLandingMove { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsSpectator + +```csharp +public bool IsSpectator { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsStandRotate + +```csharp +public bool IsStandRotate { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsTransformed + +```csharp +public bool IsTransformed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### MoveAcceleration + +```csharp +public Vector3 MoveAcceleration { get; set; } +``` + +#### Property Value + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +### MoveSpeedLevel + +```csharp +public MoveSpeedLevel MoveSpeedLevel { get; set; } +``` + +#### Property Value + + [MoveSpeedLevel](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md) + +### MoveSpeedState + +```csharp +public MoveSpeedLevel MoveSpeedState { get; set; } +``` + +#### Property Value + + [MoveSpeedLevel](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md) + +### OrientRotationToMovement + +```csharp +public bool OrientRotationToMovement { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### PlayerId + +```csharp +public PlayerId PlayerId { get; set; } +``` + +#### Property Value + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +### RebirthPointId + +```csharp +public int RebirthPointId { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### ShouldWaitRotateFinished + +```csharp +public bool ShouldWaitRotateFinished { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### SpectatorReason + +```csharp +public SpectatorReason SpectatorReason { get; set; } +``` + +#### Property Value + + [SpectatorReason](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md) + +### TurnInplaceRemainAngle + +```csharp +public float TurnInplaceRemainAngle { get; set; } +``` + +#### Property Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +### TurnInplaceTargetRotation + +```csharp +public Vector3 TurnInplaceTargetRotation { get; set; } +``` + +#### Property Value + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +### Velocity + +```csharp +public Vector3 Velocity { get; set; } +``` + +#### Property Value + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +### WaitingSequenceId + +```csharp +public int WaitingSequenceId { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### Assign\(in MainCharacterComponent\) + +```csharp +public void Assign(in MainCharacterComponent value) +``` + +#### Parameters + +`value` [MainCharacterComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### GetIndexedValue\(\) + +Returns the value of the indexed component field. + +```csharp +public PlayerId GetIndexedValue() +``` + +#### Returns + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md new file mode 100644 index 0000000..7505c2d --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md @@ -0,0 +1,80 @@ +# Struct MonsterAnimationComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds the state of the monster's animation. + +```csharp +public struct MonsterAnimationComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### AnimationPlayRate + +```csharp +public float AnimationPlayRate { get; set; } +``` + +#### Property Value + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +### MoveAiType + +```csharp +public byte MoveAiType { get; set; } +``` + +#### Property Value + + [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +## Methods + +### Assign\(in MonsterAnimationComponent\) + +```csharp +public void Assign(in MonsterAnimationComponent value) +``` + +#### Parameters + +`value` [MonsterAnimationComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md new file mode 100644 index 0000000..17cf847 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md @@ -0,0 +1,291 @@ +# Struct MovieComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds the state of the movie sequences that are currently playing or have finished playing in a given area. + +```csharp +public struct MovieComponent : IComponent, INetSerializable, IDisposable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### FinishedSequencesCount + +```csharp +public int FinishedSequencesCount { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### StartedSequencesCount + +```csharp +public int StartedSequencesCount { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### AddFinishedSequences\(in int\) + +```csharp +public void AddFinishedSequences(in int value) +``` + +#### Parameters + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### AddStartedSequences\(in int\) + +```csharp +public void AddStartedSequences(in int value) +``` + +#### Parameters + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Assign\(in MovieComponent\) + +```csharp +public void Assign(in MovieComponent value) +``` + +#### Parameters + +`value` [MovieComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md) + +### ClearFinishedSequences\(\) + +```csharp +public void ClearFinishedSequences() +``` + +### ClearStartedSequences\(\) + +```csharp +public void ClearStartedSequences() +``` + +### ContainsFinishedSequences\(in int\) + +```csharp +public bool ContainsFinishedSequences(in int value) +``` + +#### Parameters + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ContainsStartedSequences\(in int\) + +```csharp +public bool ContainsStartedSequences(in int value) +``` + +#### Parameters + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Dispose\(\) + +```csharp +public void Dispose() +``` + +### GetFinishedSequences\(\) + +```csharp +public NativeList.ReadOnly GetFinishedSequences() +``` + +#### Returns + + [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs) + +### GetFinishedSequences\(int\) + +```csharp +public int GetFinishedSequences(int index) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### GetStartedSequences\(\) + +```csharp +public NativeList.ReadOnly GetStartedSequences() +``` + +#### Returns + + [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs) + +### GetStartedSequences\(int\) + +```csharp +public int GetStartedSequences(int index) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### InsertFinishedSequences\(int, in int\) + +```csharp +public void InsertFinishedSequences(int index, in int value) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### InsertStartedSequences\(int, in int\) + +```csharp +public void InsertStartedSequences(int index, in int value) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### RemoveAtFinishedSequences\(int\) + +```csharp +public int RemoveAtFinishedSequences(int index) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### RemoveAtStartedSequences\(int\) + +```csharp +public int RemoveAtStartedSequences(int index) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### SetFinishedSequences\(in NativeList\) + +```csharp +public void SetFinishedSequences(in NativeList value) +``` + +#### Parameters + +`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> + +### SetFinishedSequences\(int, in int\) + +```csharp +public void SetFinishedSequences(int index, in int value) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### SetStartedSequences\(in NativeList\) + +```csharp +public void SetStartedSequences(in NativeList value) +``` + +#### Parameters + +`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> + +### SetStartedSequences\(int, in int\) + +```csharp +public void SetStartedSequences(int index, in int value) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`value` [int](https://learn.microsoft.com/dotnet/api/system.int32) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md new file mode 100644 index 0000000..e2db7c8 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md @@ -0,0 +1,70 @@ +# Struct NicknameComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds the displayed nickname of an entity. + +```csharp +public struct NicknameComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### Nickname + +```csharp +public string Nickname { get; set; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +## Methods + +### Assign\(in NicknameComponent\) + +```csharp +public void Assign(in NicknameComponent value) +``` + +#### Parameters + +`value` [NicknameComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md new file mode 100644 index 0000000..c314f8f --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md @@ -0,0 +1,85 @@ +# Struct PlayerComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +```csharp +public struct PlayerComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### Nickname + +Globally persisted player nickname. +**NicknameComponent** attached to an area-scoped player character entity is recreated from this value on area change. + +```csharp +public string Nickname { get; set; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string) + +### TeamId + +This is the players' Team ID, used in PvP, possibly in the future in creative mode +This is separate separated out from the TeamID on the main character which describes directly the team of the +underlying game actor. + +```csharp +public int TeamId { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### Assign\(in PlayerComponent\) + +```csharp +public void Assign(in PlayerComponent value) +``` + +#### Parameters + +`value` [PlayerComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md new file mode 100644 index 0000000..c2789a2 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md @@ -0,0 +1,70 @@ +# Struct PvPComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds player PvP readiness flag. + +```csharp +public struct PvPComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### IsReadyForPvP + +```csharp +public bool IsReadyForPvP { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +## Methods + +### Assign\(in PvPComponent\) + +```csharp +public void Assign(in PvPComponent value) +``` + +#### Parameters + +`value` [PvPComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md new file mode 100644 index 0000000..73c9799 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md @@ -0,0 +1,210 @@ +# Struct PvpStateComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds the state of the PvP mode, including settings and in-game state. + +```csharp +public struct PvpStateComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### AntiStallEnabled + +```csharp +public bool AntiStallEnabled { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### CheatsAllowed + +```csharp +public bool CheatsAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ConsumablesAllowed + +```csharp +public bool ConsumablesAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### CurrentRound + +```csharp +public int CurrentRound { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### EnemiesNgPlusLevel + +```csharp +public int EnemiesNgPlusLevel { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### GourdAllowed + +```csharp +public bool GourdAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ImmobilizeAllowed + +```csharp +public bool ImmobilizeAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### InPvP + +```csharp +public bool InPvP { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### InTournament + +```csharp +public bool InTournament { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### LevelId + +```csharp +public int LevelId { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### PhantomRushAllowed + +```csharp +public bool PhantomRushAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### RoundWinners + +```csharp +public IEnumerable RoundWinners { get; set; } +``` + +#### Property Value + + [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> + +### RoundWinnersEncoded + +```csharp +public string? RoundWinnersEncoded { get; set; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string)? + +### TournamentRounds + +```csharp +public int TournamentRounds { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### Assign\(in PvpStateComponent\) + +```csharp +public void Assign(in PvpStateComponent value) +``` + +#### Parameters + +`value` [PvpStateComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### SetLastRoundWinnerTeam\(int\) + +```csharp +public void SetLastRoundWinnerTeam(int teamId) +``` + +#### Parameters + +`teamId` [int](https://learn.microsoft.com/dotnet/api/system.int32) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md new file mode 100644 index 0000000..a3f7760 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md @@ -0,0 +1,160 @@ +# Struct RoomComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds room configuration. + +```csharp +public struct RoomComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### AntiStallEnabled + +```csharp +public bool AntiStallEnabled { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ChatEnabled + +```csharp +public bool ChatEnabled { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### CheatsAllowed + +```csharp +public bool CheatsAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ConsumablesAllowed + +```csharp +public bool ConsumablesAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### EnemiesNgPlusLevel + +```csharp +public int EnemiesNgPlusLevel { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### GourdAllowed + +```csharp +public bool GourdAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### ImmobilizeAllowed + +```csharp +public bool ImmobilizeAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### LevelId + +```csharp +public int LevelId { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### PhantomRushAllowed + +```csharp +public bool PhantomRushAllowed { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### TournamentRounds + +```csharp +public int TournamentRounds { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### Assign\(in RoomComponent\) + +```csharp +public void Assign(in RoomComponent value) +``` + +#### Parameters + +`value` [RoomComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md new file mode 100644 index 0000000..4ec1ff0 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md @@ -0,0 +1,229 @@ +# Struct TamerComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds the state of a tamer (monster) entity. + +```csharp +public struct TamerComponent : IComponent, INetSerializable, IDisposable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs), +[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### ForceKeepSpawned + +```csharp +public bool ForceKeepSpawned { get; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Guid + +```csharp +public string? Guid { get; set; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string)? + +### HasFsmPaused + +```csharp +public bool HasFsmPaused { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### HoldingPlayersCount + +```csharp +public int HoldingPlayersCount { get; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### IsBossOrElite + +```csharp +public bool IsBossOrElite { get; set; } +``` + +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### UnitPath + +```csharp +public string? UnitPath { get; set; } +``` + +#### Property Value + + [string](https://learn.microsoft.com/dotnet/api/system.string)? + +## Methods + +### AddHoldingPlayers\(in PlayerId\) + +```csharp +public void AddHoldingPlayers(in PlayerId value) +``` + +#### Parameters + +`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +### Assign\(in TamerComponent\) + +```csharp +public void Assign(in TamerComponent value) +``` + +#### Parameters + +`value` [TamerComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md) + +### ClearHoldingPlayers\(\) + +```csharp +public void ClearHoldingPlayers() +``` + +### ContainsHoldingPlayers\(in PlayerId\) + +```csharp +public bool ContainsHoldingPlayers(in PlayerId value) +``` + +#### Parameters + +`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Dispose\(\) + +```csharp +public void Dispose() +``` + +### GetHoldingPlayers\(\) + +```csharp +public NativeList.ReadOnly GetHoldingPlayers() +``` + +#### Returns + + [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs) + +### GetHoldingPlayers\(int\) + +```csharp +public PlayerId GetHoldingPlayers(int index) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +### InsertHoldingPlayers\(int, in PlayerId\) + +```csharp +public void InsertHoldingPlayers(int index, in PlayerId value) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +### RemoveAtHoldingPlayers\(int\) + +```csharp +public PlayerId RemoveAtHoldingPlayers(int index) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### SetHoldingPlayers\(in NativeList\) + +```csharp +public void SetHoldingPlayers(in NativeList value) +``` + +#### Parameters + +`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\> + +### SetHoldingPlayers\(int, in PlayerId\) + +```csharp +public void SetHoldingPlayers(int index, in PlayerId value) +``` + +#### Parameters + +`index` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md new file mode 100644 index 0000000..8163404 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md @@ -0,0 +1,70 @@ +# Struct TeamComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds entity team ID. + +```csharp +public struct TeamComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### TeamId + +```csharp +public int TeamId { get; set; } +``` + +#### Property Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### Assign\(in TeamComponent\) + +```csharp +public void Assign(in TeamComponent value) +``` + +#### Parameters + +`value` [TeamComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md new file mode 100644 index 0000000..638efdd --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md @@ -0,0 +1,80 @@ +# Struct TransformComponent + +Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) +Assembly: ReadyM.Wukong.Common.dll + +Holds entity position and rotation state. + +```csharp +public struct TransformComponent : IComponent, INetSerializable +``` + +#### Implements + +[IComponent](https://github.com/readycodeio/Friflo.Engine.ECS/blob/1a45e3364ed58ecef9294b4024b79ec07ece0732/src/ECS/IComponent.cs), +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Properties + +### Position + +```csharp +public Vector3 Position { get; set; } +``` + +#### Property Value + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +### Rotation + +```csharp +public Vector3 Rotation { get; set; } +``` + +#### Property Value + + [Vector3](https://learn.microsoft.com/dotnet/api/system.numerics.vector3) + +## Methods + +### Assign\(in TransformComponent\) + +```csharp +public void Assign(in TransformComponent value) +``` + +#### Parameters + +`value` [TransformComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md new file mode 100644 index 0000000..babc52a --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md @@ -0,0 +1,55 @@ +# ReadyM.Wukong.Common.ECS.Components + +### Structs + + [AnimationComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md) + +Holds entity movement animation state. + + [HpComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md) + +Holds entity HP, max HP, scaling factor and death state. + + [MainCharacterComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md) + +Holds the main character state. + + [MonsterAnimationComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md) + +Holds the state of the monster's animation. + + [MovieComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md) + +Holds the state of the movie sequences that are currently playing or have finished playing in a given area. + + [NicknameComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md) + +Holds the displayed nickname of an entity. + + [PlayerComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md) + + [PvPComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md) + +Holds player PvP readiness flag. + + [PvpStateComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md) + +Holds the state of the PvP mode, including settings and in-game state. + + [RoomComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md) + +Holds room configuration. + + [TamerComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md) + +Holds the state of a tamer (monster) entity. + + [TeamComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md) + +Holds entity team ID. + + [TransformComponent](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md) + +Holds entity position and rotation state. + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md new file mode 100644 index 0000000..ab270d7 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md @@ -0,0 +1,149 @@ +# Struct AttributesState + +Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) +Assembly: ReadyM.Wukong.Common.dll + +Entity attributes. Keys correspond to the EBGUAttrFloat enum in the game. + +```csharp +public struct AttributesState : INetSerializable +``` + +#### Implements + +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### AttributesState\(\) + +Entity attributes. Keys correspond to the EBGUAttrFloat enum in the game. + +```csharp +public AttributesState() +``` + +### AttributesState\(Dictionary?\) + +```csharp +public AttributesState(Dictionary? data) +``` + +#### Parameters + +`data` [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[byte](https://learn.microsoft.com/dotnet/api/system.byte), [float](https://learn.microsoft.com/dotnet/api/system.single)\>? + +## Methods + +### DeltaEquals\(AttributesState, float\) + +```csharp +public bool DeltaEquals(AttributesState other, float delta) +``` + +#### Parameters + +`other` [AttributesState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md) + +`delta` [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### GetAttribute\(byte\) + +```csharp +public float GetAttribute(byte attr) +``` + +#### Parameters + +`attr` [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +#### Returns + + [float](https://learn.microsoft.com/dotnet/api/system.single) + +### GetEnumerator\(\) + +```csharp +public IEnumerator> GetEnumerator() +``` + +#### Returns + + [IEnumerator](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerator-1)<[KeyValuePair](https://learn.microsoft.com/dotnet/api/system.collections.generic.keyvaluepair-2)<[byte](https://learn.microsoft.com/dotnet/api/system.byte), [float](https://learn.microsoft.com/dotnet/api/system.single)\>\> + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### ToDictionary\(\) + +```csharp +public Dictionary ToDictionary() +``` + +#### Returns + + [Dictionary](https://learn.microsoft.com/dotnet/api/system.collections.generic.dictionary-2)<[byte](https://learn.microsoft.com/dotnet/api/system.byte), [float](https://learn.microsoft.com/dotnet/api/system.single)\> + +### TryGetAttribute\(byte, out float\) + +```csharp +public bool TryGetAttribute(byte key, out float value) +``` + +#### Parameters + +`key` [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +`value` [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### WithSetAttribute\(byte, float\) + +```csharp +public AttributesState WithSetAttribute(byte key, float value) +``` + +#### Parameters + +`key` [byte](https://learn.microsoft.com/dotnet/api/system.byte) + +`value` [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Returns + + [AttributesState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md new file mode 100644 index 0000000..eb2d30a --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md @@ -0,0 +1,30 @@ +# Enum EquipPosition + +Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) +Assembly: ReadyM.Wukong.Common.dll + +A position in the player's equipment. + +```csharp +public enum EquipPosition : byte +``` + +## Fields + +`Head = 0` + +`Upwear = 1` + +`Arm = 2` + +`Foot = 3` + +`Hulu = 4` + +`Weapon = 5` + +`Fabao = 6` + +`Accessory = 7` + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md new file mode 100644 index 0000000..07a2b68 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md @@ -0,0 +1,78 @@ +# Class EquipmentState.Converter + +Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) +Assembly: ReadyM.Wukong.Common.dll + +```csharp +public class EquipmentState.Converter : JsonConverter +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[JsonConverter](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter) ← +[JsonConverter](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1) ← +[EquipmentState.Converter](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md) + +#### Inherited Members + +[JsonConverter.CanConvert\(Type\)](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1.canconvert), +[JsonConverter.Read\(ref Utf8JsonReader, Type, JsonSerializerOptions\)](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1.read), +[JsonConverter.Write\(Utf8JsonWriter, EquipmentState, JsonSerializerOptions\)](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1.write), +[JsonConverter.ReadAsPropertyName\(ref Utf8JsonReader, Type, JsonSerializerOptions\)](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1.readaspropertyname), +[JsonConverter.WriteAsPropertyName\(Utf8JsonWriter, EquipmentState, JsonSerializerOptions\)](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1.writeaspropertyname), +[JsonConverter.HandleNull](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1.handlenull), +[JsonConverter.Type](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter-1.type), +[JsonConverter.CanConvert\(Type\)](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter.canconvert), +[JsonConverter.Type](https://learn.microsoft.com/dotnet/api/system.text.json.serialization.jsonconverter.type), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### Converter\(\) + +```csharp +public Converter() +``` + +## Methods + +### Read\(ref Utf8JsonReader, Type, JsonSerializerOptions\) + +```csharp +public override EquipmentState Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) +``` + +#### Parameters + +`reader` [Utf8JsonReader](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonreader) + +`typeToConvert` [Type](https://learn.microsoft.com/dotnet/api/system.type) + +`options` [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) + +#### Returns + + [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + +### Write\(Utf8JsonWriter, EquipmentState, JsonSerializerOptions\) + +```csharp +public override void Write(Utf8JsonWriter writer, EquipmentState value, JsonSerializerOptions options) +``` + +#### Parameters + +`writer` [Utf8JsonWriter](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonwriter) + +`value` [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + +`options` [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md new file mode 100644 index 0000000..dac337a --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md @@ -0,0 +1,184 @@ +# Struct EquipmentState + +Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) +Assembly: ReadyM.Wukong.Common.dll + +Player character's equipment. + +```csharp +public struct EquipmentState : INetSerializable, IEquatable +``` + +#### Implements + +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs), +[IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### EquipmentState\(IEnumerable<\(EquipPosition, int\)\>\) + +```csharp +public EquipmentState(IEnumerable<(EquipPosition, int)> equipments) +``` + +#### Parameters + +`equipments` [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)<\([EquipPosition](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md), [int](https://learn.microsoft.com/dotnet/api/system.int32)\)\> + +## Methods + +### DeltaEquals\(EquipmentState, float\) + +```csharp +public bool DeltaEquals(EquipmentState other, float delta) +``` + +#### Parameters + +`other` [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + +`delta` [float](https://learn.microsoft.com/dotnet/api/system.single) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Equals\(EquipmentState\) + +```csharp +public bool Equals(EquipmentState other) +``` + +#### Parameters + +`other` [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### Equals\(object?\) + +```csharp +public override bool Equals(object? obj) +``` + +#### Parameters + +`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)? + +#### Returns + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### GetHashCode\(\) + +```csharp +public override int GetHashCode() +``` + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### GetItem\(EquipPosition\) + +```csharp +public int GetItem(EquipPosition pos) +``` + +#### Parameters + +`pos` [EquipPosition](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md) + +#### Returns + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### GetItems\(\) + +```csharp +public List<(EquipPosition, int)> GetItems() +``` + +#### Returns + + [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)<\([EquipPosition](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md), [int](https://learn.microsoft.com/dotnet/api/system.int32)\)\> + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + +### TextDeserialize\(ref Utf8JsonReader, JsonSerializerOptions\) + +```csharp +public static EquipmentState TextDeserialize(ref Utf8JsonReader reader, JsonSerializerOptions options) +``` + +#### Parameters + +`reader` [Utf8JsonReader](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonreader) + +`options` [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) + +#### Returns + + [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + +### TextSerialize\(Utf8JsonWriter, EquipmentState, JsonSerializerOptions\) + +```csharp +public static void TextSerialize(Utf8JsonWriter writer, EquipmentState obj, JsonSerializerOptions options) +``` + +#### Parameters + +`writer` [Utf8JsonWriter](https://learn.microsoft.com/dotnet/api/system.text.json.utf8jsonwriter) + +`obj` [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + +`options` [JsonSerializerOptions](https://learn.microsoft.com/dotnet/api/system.text.json.jsonserializeroptions) + +### WithSetItem\(EquipPosition, int\) + +```csharp +public EquipmentState WithSetItem(EquipPosition position, int eqId) +``` + +#### Parameters + +`position` [EquipPosition](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md) + +`eqId` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +#### Returns + + [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md new file mode 100644 index 0000000..5aa6b12 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md @@ -0,0 +1,20 @@ +# Enum MoveSpeedLevel + +Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) +Assembly: ReadyM.Wukong.Common.dll + +Represents the movement speed level of an entity in the game. + +```csharp +public enum MoveSpeedLevel : byte +``` + +## Fields + +`Walk = 0` + +`Run = 1` + +`Sprint = 2` + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md new file mode 100644 index 0000000..ea70562 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md @@ -0,0 +1,26 @@ +# Enum SpectatorReason + +Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) +Assembly: ReadyM.Wukong.Common.dll + +The reason why the character is in spectator mode. + +```csharp +public enum SpectatorReason +``` + +## Fields + +`Api = 0` + +Free camera mode was set from code. + + + +`Death = 1` + +The character died and entered free camera mode. + + + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md new file mode 100644 index 0000000..c93bb35 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md @@ -0,0 +1,31 @@ +# ReadyM.Wukong.Common.ECS.Values + +### Classes + + [EquipmentState.Converter](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md) + +### Structs + + [AttributesState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md) + +Entity attributes. Keys correspond to the EBGUAttrFloat enum in the game. + + [EquipmentState](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md) + +Player character's equipment. + +### Enums + + [EquipPosition](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md) + +A position in the player's equipment. + + [MoveSpeedLevel](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md) + +Represents the movement speed level of an entity in the game. + + [SpectatorReason](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md) + +The reason why the character is in spectator mode. + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md new file mode 100644 index 0000000..dba1bb1 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md @@ -0,0 +1,9 @@ +# ReadyM.Wukong.Common.Rpc + +### Structs + + [SkipMovieData](../ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md) + +Data structure for the RPC which is used to vote on skipping a cutscene in the game. + + diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md new file mode 100644 index 0000000..5b4a58b --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md @@ -0,0 +1,98 @@ +# Struct SkipMovieData + +Namespace: [ReadyM.Wukong.Common.Rpc](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md) +Assembly: ReadyM.Wukong.Common.dll + +Data structure for the RPC which is used to vote on skipping a cutscene in the game. + +```csharp +[DeriveINetSerializable(SerializableMode.Default)] +public struct SkipMovieData : INetSerializable +``` + +#### Implements + +[INetSerializable](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/INetSerializable.cs) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### SkipMovieData\(int, int, int\) + +Data structure for the RPC which is used to vote on skipping a cutscene in the game. + +```csharp +public SkipMovieData(int sequenceId, int waitingPlayers, int allPlayers) +``` + +#### Parameters + +`sequenceId` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`waitingPlayers` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +`allPlayers` [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Fields + +### AllPlayers + +```csharp +public int AllPlayers +``` + +#### Field Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### SequenceId + +```csharp +public int SequenceId +``` + +#### Field Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +### WaitingPlayers + +```csharp +public int WaitingPlayers +``` + +#### Field Value + + [int](https://learn.microsoft.com/dotnet/api/system.int32) + +## Methods + +### Deserialize\(NetDataReader\) + +```csharp +public void Deserialize(NetDataReader reader) +``` + +#### Parameters + +`reader` [NetDataReader](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataReader.cs) + +### Serialize\(NetDataWriter\) + +```csharp +public void Serialize(NetDataWriter writer) +``` + +#### Parameters + +`writer` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) + + diff --git a/wukong-mp/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.md b/wukong-mp/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.md deleted file mode 100644 index 6b96b38..0000000 --- a/wukong-mp/api-reference/WukongMp.Api.Https/WukongMp.Api.Https.md +++ /dev/null @@ -1,7 +0,0 @@ -# WukongMp.Api.Https - -### Structs - - [FileInfo](../WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md) - - diff --git a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md index 258ccf7..94cc9f7 100644 --- a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md +++ b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md @@ -29,7 +29,7 @@ Cancellation token to cancel the download operation. #### Returns - [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](../WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md)?\> + [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Saves/FileInfo.cs)?\> The content of the player's save file if the download was successful, null otherwise. @@ -49,7 +49,7 @@ Cancellation token to cancel the download operation. #### Returns - [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](../WukongMp.Api.Https/WukongMp.Api.Https.FileInfo.md)?\> + [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Saves/FileInfo.cs)?\> The content of the world save file if the download was successful, null otherwise. diff --git a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.md b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.md index 0231dbf..d8c0431 100644 --- a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.md +++ b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.md @@ -4,8 +4,6 @@ [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) - [WukongMp.Api.Https](../WukongMp.Api.Https/WukongMp.Api.Https.md) - [WukongMp.Api.Resources](../WukongMp.Api.Resources/WukongMp.Api.Resources.md) [WukongMp.Api.UI](../WukongMp.Api.UI/WukongMp.Api.UI.md) diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md index df05d52..b2f888a 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md @@ -25,7 +25,7 @@ void AddCommand(string commandName, ConsoleCommand command, IEnumerable? Text the player types to invoke the command (e.g. "spawn"). -`command` [ConsoleCommand](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Command/ConsoleCommand.cs) +`command` [ConsoleCommand](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Command/ConsoleCommand.cs) Handler that runs when the command is executed. @@ -49,7 +49,7 @@ void AddCommand(string commandName, ConsoleCommand command, Func? OnConnected #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\>? ### OnDisconnected @@ -43,7 +43,7 @@ event Action? OnDisconnected #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs), [DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs), [DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\>? ### OnEndPlayGameplayLevel @@ -79,7 +79,7 @@ event Action? OnJoinedArea #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)\>? ### OnLanguageChanged @@ -103,7 +103,7 @@ event Action? OnLeftArea #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)\>? ### OnLevelLoaded @@ -215,7 +215,7 @@ event Action? OnOtherPlayerInsideArea #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)\>? ### OnOtherPlayerOutsideArea @@ -227,7 +227,7 @@ event Action? OnOtherPlayerOutsideArea #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)\>? ### OnPlayerChangedTeam diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md index 15f53fb..de085ab 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md @@ -140,10 +140,10 @@ int TournamentRounds { get; } void InitializeAreaPvpState() ``` -### PvpData\(ReadyMainCharacter\) +### IsReadyForPvP\(ReadyMainCharacter\) ```csharp -ref PvPComponent PvpData(ReadyMainCharacter mainCharacter) +bool IsReadyForPvP(ReadyMainCharacter mainCharacter) ``` #### Parameters @@ -152,7 +152,19 @@ ref PvPComponent PvpData(ReadyMainCharacter mainCharacter) #### Returns - [PvPComponent](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Wukong.Common/ECS/Components/PvPComponent.cs) + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### SetIsReadyForPvp\(ReadyMainCharacter, bool\) + +```csharp +void SetIsReadyForPvp(ReadyMainCharacter mainCharacter, bool ready) +``` + +#### Parameters + +`mainCharacter` [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) + +`ready` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) ### SetLastRoundWinnerTeam\(int\) diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md index 4537033..33d302d 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md @@ -33,7 +33,7 @@ IReadOnlyList AllPlayers { get; } #### Property Value - [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\> + [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\> ### AllTamers @@ -69,7 +69,7 @@ IReadOnlyList AreaPlayers { get; } #### Property Value - [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)\> + [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\> ### AreaTamers @@ -93,7 +93,7 @@ AreaId? CurrentAreaId { get; } #### Property Value - [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)? + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)? ### InArea @@ -153,7 +153,7 @@ PlayerId? LocalPlayerId { get; } #### Property Value - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs)? + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)? ## Methods @@ -185,7 +185,7 @@ void EnableSpectatorMode(ReadyMainCharacter character, SpectatorReason reason) The character to enable spectator mode for. -`reason` [SpectatorReason](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Wukong.Common/ECS/Values/SpectatorReason.cs) +`reason` [SpectatorReason](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Wukong.Common/ECS/Values/SpectatorReason.cs) The reason for enabling spectator mode. @@ -199,7 +199,7 @@ void GetDisconnectReasonAndInvoke(Action callback) #### Parameters -`callback` [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\> +`callback` [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\> The callback to invoke with the disconnect reason. @@ -213,7 +213,7 @@ ReadyMainCharacter? GetMainCharacterByPlayerId(PlayerId playerId) #### Parameters -`playerId` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) +`playerId` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) The player ID. @@ -263,6 +263,26 @@ The character to find the player entity for. The player entity, or null if not found. +### GetTamerEntityByActor\(ABGUTamerBase?\) + +Gets the tamer entity associated with the specified actor. + +```csharp +ReadyTamer? GetTamerEntityByActor(ABGUTamerBase? actor) +``` + +#### Parameters + +`actor` ABGUTamerBase? + +The tamer actor to find the tamer entity for. + +#### Returns + + [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md)? + +The tamer entity, or null if not found. + ### SpawnEnemy\(TamerKind, Vector3, int, int\) Spawns an enemy of the specified kind at the given position. @@ -273,7 +293,7 @@ void SpawnEnemy(TamerKind kind, Vector3 position, int count = 1, int teamId = 2) #### Parameters -`kind` [TamerKind](https://github.com/readycodeio/wukong\-csharp\-mod/blob/4ce5be749a5b9f1ddd146615733443ef6d41c763/WukongMp.Api/Configuration/TamerKind.cs) +`kind` [TamerKind](https://github.com/readycodeio/wukong\-csharp\-mod/blob/ee9f19ef1810c3437563f50da3d7fcdf8f3e22ed/WukongMp.Api/Configuration/TamerKind.cs) The kind of enemy to spawn. @@ -308,7 +328,7 @@ bool TryGetPlayerInfoById(PlayerId player, out string? nickname, out int? team) #### Parameters -`player` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) +`player` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) The player ID. diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md index 5a85d3d..6cf0d55 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md @@ -148,7 +148,7 @@ public static IWukongSaveApi Saves { get; } #### Property Value - [IWukongSaveApi](https://github.com/readycodeio/wukong\-csharp\-mod/blob/4ce5be749a5b9f1ddd146615733443ef6d41c763/WukongMp.Api/IWukongSaveApi.cs) + [IWukongSaveApi](https://github.com/readycodeio/wukong\-csharp\-mod/blob/ee9f19ef1810c3437563f50da3d7fcdf8f3e22ed/WukongMp.Api/IWukongSaveApi.cs) ### Services @@ -158,7 +158,7 @@ public static IDependencyContainer Services { get; } #### Property Value - [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/DI/IDependencyContainer.cs) + [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IDependencyContainer.cs) ### Sync diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md index fa53165..4f9d85e 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md @@ -16,8 +16,12 @@ [ReadyMainCharacter](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md) +Represents the player character entity in the game. + [ReadyObject](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md) [ReadyTamer](../WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md) +Represents a tamer (monster) entity in the Wukong multiplayer SDK. + diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md index 537e3aa..3f4a877 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md @@ -3,6 +3,8 @@ Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll +Represents the player character entity in the game. + ```csharp public readonly struct ReadyMainCharacter : IReadyEntity ``` @@ -34,6 +36,16 @@ public readonly struct ReadyMainCharacter : IReadyEntity public bool BeguilingChantEligible { get; set; } ``` +#### Property Value + + [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + +### IsObserver + +```csharp +public bool IsObserver { get; } +``` + #### Property Value [bool](https://learn.microsoft.com/dotnet/api/system.boolean) @@ -96,7 +108,7 @@ public PlayerId PlayerId { get; } #### Property Value - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) ### RebirthPointId diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md index b292f92..91983ed 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md @@ -54,7 +54,7 @@ public static AreaId? get_AreaId(TSelf obj) where TSelf : struct, IReadyE #### Returns - [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/AreaId.cs)? + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)? #### Type Parameters @@ -92,7 +92,7 @@ public static PlayerId get_Owner(TSelf obj) where TSelf : struct, IReadyE #### Returns - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) #### Type Parameters diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md index 531a81f..423365e 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md @@ -3,6 +3,8 @@ Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll +Represents a tamer (monster) entity in the Wukong multiplayer SDK. + ```csharp public readonly struct ReadyTamer : IReadyEntity ``` @@ -38,15 +40,15 @@ public string? Guid { get; } [string](https://learn.microsoft.com/dotnet/api/system.string)? -### HpMultiplier +### HpScalingPercent ```csharp -public float HpMultiplier { get; set; } +public int HpScalingPercent { get; set; } ``` #### Property Value - [float](https://learn.microsoft.com/dotnet/api/system.single) + [int](https://learn.microsoft.com/dotnet/api/system.int32) ### IsBossOrElite diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md b/wukong-mp/api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md new file mode 100644 index 0000000..3cb5d83 --- /dev/null +++ b/wukong-mp/api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md @@ -0,0 +1,116 @@ +# Class WukongArchetypes + +Namespace: [WukongMp.Sdk.Serverside](../WukongMp.Sdk/WukongMp.Sdk.Serverside.md) +Assembly: WukongMp.Sdk.Serverside.dll + +Provides references for core entity archetypes in WukongMP. + +```csharp +public class WukongArchetypes +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[WukongArchetypes](../WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### WukongArchetypes\(\) + +```csharp +public WukongArchetypes() +``` + +## Properties + +### AreaArchetype + +```csharp +public ArchetypeId AreaArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + +### GlobalPlayerArchetype + +Global player entity archetype. +Components:
+* **PlayerScopeComponent**
+* **PlayerComponent** + +```csharp +public ArchetypeId GlobalPlayerArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + +### MainCharacterArchetype + +Area-scoped main character entity archetype. +Components:
+* **MainCharacterComponent**
+* **TransformComponent**
+* **HpComponent**
+* **NicknameComponent**
+* **TeamComponent**
+* **PvPComponent**
+ +```csharp +public ArchetypeId MainCharacterArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + +### PvpStateArchetype + +Global PvP state entity archetype. Used by the PvP mod. +Components:
+* **PvpStateComponent** + +```csharp +[Obsolete("Will be moved to the PvP mod in future refactoring.")] +public ArchetypeId PvpStateArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + +### TamerArchetype + +Area-scoped tamer entity archetype. +Components:
+* **TamerComponent**
+* **TransformComponent**
+* **HpComponent**
+* **NicknameComponent**
+* **TeamComponent**
+* **AnimationComponent**
+* **MonsterAnimationComponent** + +```csharp +public ArchetypeId TamerArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + + diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md index 4603d8f..c1001bb 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md @@ -13,7 +13,7 @@ public abstract class ModBase : ICSharpModExV2, ICSharpModEx, ICSharpMod #### Inheritance [object](https://learn.microsoft.com/dotnet/api/system.object) ← -[ModBase](../WukongMp.Sdk/WukongMp.Sdk.ModBase) +[ModBase](../WukongMp.Sdk/WukongMp.Sdk.ModBase.md) #### Implements @@ -115,7 +115,7 @@ protected abstract void Initialize(IDependencyContainer services) #### Parameters -`services` [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/a1b59546bbb845a6f917219c2bff68f0f63b4da0/src/ReadyM.Api/DI/IDependencyContainer.cs) +`services` [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IDependencyContainer.cs) ### LateInit\(\) diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.Serverside.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.Serverside.md new file mode 100644 index 0000000..c3f37aa --- /dev/null +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.Serverside.md @@ -0,0 +1,9 @@ +# WukongMp.Sdk.Serverside + +### Classes + + [WukongArchetypes](../WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md) + +Provides references for core entity archetypes in WukongMP. + + diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.md index 70154cd..9812cb8 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.md @@ -6,6 +6,8 @@ [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) + [WukongMp.Sdk.Serverside](../WukongMp.Sdk/WukongMp.Sdk.Serverside.md) + ### Classes [ModBase](../WukongMp.Sdk/WukongMp.Sdk.ModBase.md) @@ -25,10 +27,4 @@ Each mod should have exactly one class extending from this, which will be instan [IReadyEntity](../WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md) -### Enums - - [SaveFileType](../WukongMp.Sdk/WukongMp.Sdk.SaveFileType.md) - -Indicates the type of a save file. - From 18bf71af11091ec37ed2829e4dff9a9dd646919b Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Tue, 11 Aug 2026 19:01:50 +0200 Subject: [PATCH 05/12] Mention [ServerRpcFor] --- wukong-mp/docs/Development/custom-rpc.md | 5 +++-- .../docs/Server-development/custom-rpc.md | 19 ++++++++++++++++++- wukong-mp/docs/Server-development/systems.md | 1 + 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/wukong-mp/docs/Development/custom-rpc.md b/wukong-mp/docs/Development/custom-rpc.md index 273d47e..515802c 100644 --- a/wukong-mp/docs/Development/custom-rpc.md +++ b/wukong-mp/docs/Development/custom-rpc.md @@ -212,11 +212,12 @@ This is specific to client-relayed RPC. Server RPC response handlers are **not** Server RPC contracts are declared in a common project shared by the server and client mods, and describe both the request (client to server) and response (server to client) shapes of an RPC. See [server-side development](../Server-development/custom-rpc) for how they are defined. -On the client, define a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class extending [ServerRpcClient](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient) to send requests to the server and handle its responses. As with client-relayed RPC, the class must be registered in your mod's `Initialize` method. +On the client, define a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class extending [ServerRpcClient](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient) to send requests to the server and handle its responses. It must carry `[ServerRpcFor]` naming the contract class it implements, exactly like its server-side counterpart. As with client-relayed RPC, the class must be registered in your mod's `Initialize` method. Unlike `[RpcEvent]` handlers, these are invoked on the network thread as the response is parsed. Wrap anything that touches the game world in `RunOnGameThread`: ```csharp title="Client-side server RPC handling" +[ServerRpcFor(typeof(RpcContracts))] public partial class MyServerRpc : ServerRpcClient { // called when the server responds to our ScaleBossHp request @@ -238,4 +239,4 @@ Calling the generated `Send...` method sends the request to the server: WukongApi.Services.Resolve().SendScaleBossHp(150); ``` -Only the legs declared by the shared contract are generated: a one-way client-to-server RPC has no `On...` handler stub on the client, and a one-way server-to-client RPC has no `Send...` method. +Only the legs declared by the shared contract are generated: a one-way client-to-server RPC has no `On...` handler stub on the client, and a one-way server-to-client RPC has no `Send...` method. Only the legs of the class named in `[ServerRpcFor]` are generated, so use one class per contract set. See [Binding a class to its contract](../Server-development/custom-rpc#binding-a-class-to-its-contract). diff --git a/wukong-mp/docs/Server-development/custom-rpc.md b/wukong-mp/docs/Server-development/custom-rpc.md index fa99d8e..62214c6 100644 --- a/wukong-mp/docs/Server-development/custom-rpc.md +++ b/wukong-mp/docs/Server-development/custom-rpc.md @@ -43,9 +43,10 @@ The contract project is referenced by both the server mod and the client mod, an ## Declaring server-side handlers -Implement the server side of a contract in a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class extending [ServerRpcHandlersBase](../../api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase). For every `[ClientToServer]` leg of the contract, define a matching `On...` partial method. The SDK generates the corresponding `Send...` method for any `[ServerToClient]` leg. +Implement the server side of a contract in a [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) class extending [ServerRpcHandlersBase](../../api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase), annotated with `[ServerRpcFor]` naming the contract class it implements. For every `[ClientToServer]` leg of that contract, define a matching `On...` partial method. The SDK generates the corresponding `Send...` method for any `[ServerToClient]` leg. ```csharp title="Server-side RPC handler" +[ServerRpcFor(typeof(RpcContracts))] public partial class RpcHandlers(ScaleHpSystem hpScaling, EcsApi ecs) : ServerRpcHandlersBase { partial void OnScaleBossHp(RpcContext context, int scalingPercent) @@ -67,6 +68,22 @@ public partial class RpcHandlers(ScaleHpSystem hpScaling, EcsApi ecs) : ServerRp The [RpcContext](../../api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext) parameter is always injected first and exposes `Sender`, the [PlayerId](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId) of the client that sent the request. Generated `Send...` methods take a `PlayerId` recipient as their first parameter, followed by the response payload. There is no broadcast overload: to reach every player, query the main characters and send to each, as above. +### Binding a class to its contract + +`[ServerRpcFor]` is **required** on every server handler and client RPC class, and takes the `[ServerRpcContracts]` class it implements. Your mod may reference several contract sets, directly or through a chain of shared projects, and this is what tells the generator which one to emit against. + +Only the legs declared by the named contract class are generated, so a class implements exactly one contract set. If you have several contract classes, give each its own handler class: + +```csharp title="One handler class per contract set" +[ServerRpcFor(typeof(BossContracts))] +public partial class BossRpc(EcsApi ecs) : ServerRpcHandlersBase { /* boss legs only */ } + +[ServerRpcFor(typeof(ArenaContracts))] +public partial class ArenaRpc(EcsApi ecs) : ServerRpcHandlersBase { /* arena legs only */ } +``` + +Omitting the attribute is a compile error (`SRPC004`), as is naming a class that is not annotated with `[ServerRpcContracts]` (`SRPC005`). + :::important For any of the RPC handlers to be registered, the class **must** be added to the dependency injection container in your mod's `Init` method. diff --git a/wukong-mp/docs/Server-development/systems.md b/wukong-mp/docs/Server-development/systems.md index d83bcab..c6ee258 100644 --- a/wukong-mp/docs/Server-development/systems.md +++ b/wukong-mp/docs/Server-development/systems.md @@ -104,6 +104,7 @@ protected override void Init() ``` ```csharp +[ServerRpcFor(typeof(RpcContracts))] public partial class RpcHandlers(ScaleHpSystem hpScaling) : ServerRpcHandlersBase { partial void OnScaleBossHp(RpcContext context, int scalingPercent) From 1979c320997b7f74c8edbac7a3a1513dcceba14f Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Wed, 12 Aug 2026 10:09:22 +0200 Subject: [PATCH 06/12] Mention networked sync is in progress --- .../Development/APIs/custom-components.md | 6 +- wukong-mp/docs/Development/getting-started.md | 2 +- .../docs/Server-development/archetypes.md | 13 ++++- .../Server-development/getting-started.md | 55 ++++++++++++++++++- 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/wukong-mp/docs/Development/APIs/custom-components.md b/wukong-mp/docs/Development/APIs/custom-components.md index 187f5a7..61c70a6 100644 --- a/wukong-mp/docs/Development/APIs/custom-components.md +++ b/wukong-mp/docs/Development/APIs/custom-components.md @@ -6,6 +6,10 @@ The WukongMP SDK allows for defining custom data components attached to entities :::warning[Work in progress] -This feature is under development and will be available in a future version of the SDK. +The server half of this shipped in 0.3.0: a server-side mod can declare a networked component and attach it to an archetype, as described in [server-side development](../../Server-development/getting-started#registering-components-and-archetypes). + +What is still missing is the client half. There is no way yet for a client mod to register the matching archetype change, so the client never syncs the component and a server-registered networked component stays server-only for now. That last piece lands in **0.3.1**, and nothing written against the server API needs to change when it does. + +Until then, use [local components](../../Server-development/getting-started#local-components) for server-owned state and [RPC](../custom-rpc) to get what the client needs across. ::: diff --git a/wukong-mp/docs/Development/getting-started.md b/wukong-mp/docs/Development/getting-started.md index 2edf977..30d749a 100644 --- a/wukong-mp/docs/Development/getting-started.md +++ b/wukong-mp/docs/Development/getting-started.md @@ -23,5 +23,5 @@ Visit the [examples](/wukong-mp/category/mod-examples) page for some inspiration | Console command API | :white_check_mark: [done](../Development/APIs/console-commands) | | Custom RPC | :white_check_mark: [done](../Development/custom-rpc) | | Save file API | :construction: [partial](../Development/APIs/save-file-management) | -| Custom data sync | :white_check_mark: [done](../Server-development/archetypes) | +| Custom data sync | :construction: [preview](../Development/APIs/custom-components), client-side registration lands in 0.3.1 | | Server-side mods | :white_check_mark: [done](../Server-development/getting-started) | diff --git a/wukong-mp/docs/Server-development/archetypes.md b/wukong-mp/docs/Server-development/archetypes.md index 6e711e5..1120963 100644 --- a/wukong-mp/docs/Server-development/archetypes.md +++ b/wukong-mp/docs/Server-development/archetypes.md @@ -29,7 +29,13 @@ The numeric IDs behind these properties are an implementation detail of the curr ::: -Attach your own [networked components](getting-started#registering-components-and-archetypes) to any of these in your mod's `Init`, the same way the bounty example does in [Getting started](getting-started#registering-components-and-archetypes). The tables below list the components each archetype already carries, so you know what is available to query. +Attach your own components to any of these in your mod's `Init`, the same way the examples in [Getting started](getting-started#registering-components-and-archetypes) do. The tables below list the components each archetype already carries, so you know what is available to query. + +:::info[Replication of your own components is a preview] + +Attaching a component to an archetype works on the server today, and [local components](getting-started#local-components) are fully usable. Networked ones are only half wired: the client cannot register the matching archetype change yet, so it never syncs them. That other half lands in **0.3.1** with no changes needed on your side. See the note in [Getting started](getting-started#registering-components-and-archetypes). + +::: :::warning[The access API is temporary] @@ -119,7 +125,8 @@ public class Mod : ServerModBase protected override void RegisterComponents(IComponentRegistry registry) { // A component must be registered before any archetype can use it. - registry.RegisterComponent(); + // Use RegisterLocalComponent for server-only state, RegisterComponent for networked. + registry.RegisterLocalComponent(); registry.RegisterComponent(); } @@ -149,6 +156,6 @@ var entity = ecsApi.CreateEntity(Mod.ShrineArchetype); :::important -An archetype your mod registers exists only on the server unless the client mod registers a matching one. Keep the component set and its order identical on both sides. +An archetype your mod registers exists only on the server. Once client-side registration lands in 0.3.1, the client mod will need to register a matching one, with the component set and its order identical on both sides. ::: diff --git a/wukong-mp/docs/Server-development/getting-started.md b/wukong-mp/docs/Server-development/getting-started.md index 8275cb7..10015ab 100644 --- a/wukong-mp/docs/Server-development/getting-started.md +++ b/wukong-mp/docs/Server-development/getting-started.md @@ -16,7 +16,7 @@ public class MyServerMod : ServerModBase { protected override void RegisterComponents(IComponentRegistry registry) { - // register your networked components here + // register your custom components here } protected override void Init() @@ -46,6 +46,16 @@ A typical setup for a fully-featured mod involves **three projects**: ## Registering components and archetypes +:::info[Networked components are a preview in 0.3.0] + +The API below is final and the server side of it works, so you can write against it today. What is missing is the other half: there is no way yet for a client mod to register the matching archetype change, so the client never learns about your component and never syncs it. Until it lands, a mod-registered networked component is server-only state. + +Client-side registration ships in **0.3.1**, and it is an additive change: your `RegisterComponent` and `ModifyArchetype` calls stay exactly as they are, and the values start replicating once both halves are in place. + +In the meantime, [local components](#local-components) are the ones to reach for. They work end to end on the server right now. + +::: + A networked component is declared with `[DeriveINetworkedComponent]` on a `partial struct`. The generator turns each private field into a public property and writes the serialization code: ```csharp title="A networked component (in the shared project)" @@ -88,7 +98,45 @@ A running kill count is persistent, player-scoped data, so it belongs on the **g :::important -A networked component's shape and its archetype membership must match between the server mod and every client mod. Ship server-side and client-side mods together as versions of the same package. +Once client-side registration lands in 0.3.1, a networked component's shape and its archetype membership must match between the server mod and every client mod. Ship server-side and client-side mods together as versions of the same package. + +::: + +## Local components + +A **local component** is server-side state hung off an entity, with no replication attached. It is a plain `struct` implementing `IComponent`: + +```csharp title="A local component" +public struct CooldownComponent : IComponent +{ + public float RemainingSeconds; +} +``` + +Register it with `RegisterLocalComponent` instead of `RegisterComponent`, and attach it to an archetype exactly the same way: + +```csharp title="Registering a local component" +protected override void RegisterComponents(IComponentRegistry registry) +{ + registry.RegisterLocalComponent(); +} + +protected override void Init() +{ + var registry = Services.Resolve(); + var archetypes = new WukongArchetypes(); + + registry.ModifyArchetype(archetypes.MainCharacterArchetype, a => a.Add()); +} +``` + +From there it behaves like any other component: it shows up in `Query`, you read and write it by `ref`, and it lives and dies with its entity. It simply never leaves the server. + +This is the whole surface you need for logic the server owns and the client only ever learns about through [RPC](custom-rpc): timers, cooldowns, accumulated scores, per-player bookkeeping. + +:::note + +Components are capped at 256 bytes each, local or networked, and the server has a fixed number of component slots. Registering fails loudly if you exceed either. ::: @@ -140,8 +188,9 @@ There is a known issue in this version that overwriting data that the client cha | Feature | Status | |---|---| -| Networked components | :white_check_mark: [done](#registering-components-and-archetypes) | +| Local components | :white_check_mark: [done](#local-components) | | Gameplay systems | :white_check_mark: [done](systems) | | Server RPC | :white_check_mark: [done](custom-rpc) | +| Networked components | :construction: [preview](#registering-components-and-archetypes), client-side registration lands in 0.3.1 | | Higher-level entity API | :soon: planned, see the note in [Archetypes and components](archetypes) | | Server mod manifests | :soon: not used in 0.3.0 | From 8982e8837c8bccae66ea4b31ee62e0f32c07c868 Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Wed, 12 Aug 2026 10:28:25 +0200 Subject: [PATCH 07/12] Release blog post --- blog/2026-08-12-sdk-030.md | 68 +++++++++++++++++++ .../Development/APIs/custom-components.md | 4 +- .../docs/Server-development/archetypes.md | 2 +- .../Server-development/getting-started.md | 2 +- 4 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 blog/2026-08-12-sdk-030.md diff --git a/blog/2026-08-12-sdk-030.md b/blog/2026-08-12-sdk-030.md new file mode 100644 index 0000000..dac91c4 --- /dev/null +++ b/blog/2026-08-12-sdk-030.md @@ -0,0 +1,68 @@ +--- +title: WukongMP SDK 0.3.0 released +description: Server-side scripting, a Network view in the admin panel, and co-op fixes +slug: wukongmp-sdk-030 +authors: readym +tags: [wukongmp, adminPanel] +hide_table_of_contents: false +--- + +Server-side scripting is here. A mod can now run its own code inside the relay server: register components on server entities, tick systems on the server loop, and answer requests from clients over RPC. This is the piece we said was coming and the co-op mod already runs on it. + +This release also adds a Network view to the admin panel, which shows what the relay is actually sending, broken down per ECS component. Alongside that, three co-op fixes, including NPCs that could turn hostile and block quests. + +Update your server binaries to `0.3.0`. Client mods built on `0.2.4` need a rebuild and a few small code changes, see the [Migration guide](/releases/wukongmp-sdk-030#migration-guide). + + + +## Server-side mods + +A server-side mod is a .NET class library that the relay server loads from its `server_mods/` directory, separate from the client-facing `mods/` folder. Drop the assembly in and the server picks it up on startup. + +What it can do: + +* **[Components on server entities](/wukong-mp/docs/Server-development/archetypes)**, local (server-only) or networked, attached to the built-in archetypes or to new ones your mod registers. +* **[Systems](/wukong-mp/docs/Server-development/systems)** that tick on the server's update loop, for logic that has to run continuously rather than in response to a single client. +* **[Server RPC](/wukong-mp/docs/Server-development/custom-rpc)**, a request and response channel between a client mod and the server, declared once as a contract shared by both halves. + +Start with [Getting started](/wukong-mp/docs/Server-development/getting-started), and read [Archetypes and components](/wukong-mp/docs/Server-development/archetypes) for what the built-in entities carry. The [co-op mod](https://github.com/readycodeio/WukongMP-co-op-mod) is a small worked example of all three: two systems, one RPC handler, and a shared contract project. + +The API reference now covers the server SDK as well, under `ReadyM.Relay.Server.Sdk` and `ReadyM.Wukong.Common`. + +:::info + +Registering your own **networked** components is a preview in `0.3.0`. The server side works, but a client mod cannot register the matching archetype change yet, so those components stay server-only for now. That last piece lands in `0.3.1`, which is coming very soon. When it does, the server-side code you write today keeps working, but you will need to update your client mod to register the same components and archetype changes on its side before anything replicates. [Local components](/wukong-mp/docs/Server-development/getting-started#local-components) work end to end right now, and are the ones to reach for in the meantime. + +::: + +## Network view in the admin panel + +The panel has a new **Network** tab, showing live relay traffic in one second windows: ingress and egress, connected peers, server tick timing, and protocol overhead. + +The part worth your attention as a mod author is the per-component breakdown. It attributes payload bytes to individual ECS components, with fan-out per component, so you can see what a component that replicates every tick actually costs before you ship it. The tick duration chart covers the same update your systems run inside, which makes it the first place a system doing too much per tick shows up. + +Viewing it needs the Dashboard access permission. See [Network stats](/wukong-mp/docs/Server/network-stats) for how to read the numbers, in particular the difference between wire bytes and payload bytes. + +## Co-op fixes + +* **NPCs could turn hostile and block quests.** Monsters were created in the shared world with a default team ID instead of the team the game assigns them, so quest NPCs could end up hostile and leave the quest unfinishable. They now keep their real team. +* **Pagoda debuff sync.** The periodic Beguiling Chant debuff in the Pagoda region in act 3 now stays in sync between players. Its cycle runs on the server, so everyone in the area gets the same warning and the same active window. +* **Boss HP scaling moved to the server, with a new default.** Scaling elite and boss HP by player count is now a server-side system rather than client logic, and the default changed. It used to be 100% plus 150% for every extra player: 100% solo, 250% for two, 400% for three. It is now a flat 100% per player: 100% solo, 200% for two, 300% for three. +* **New `bosshp` command.** `bosshp ` sets the per-player multiplier, so `bosshp 150` gives you 150% per player. It applies server-wide and confirms the new value in chat. + +## What's next? + +`0.3.1` is close behind this release and completes custom data sync by adding client-side component and archetype registration, the other half of the preview above. Expect it in a matter of days rather than weeks. It will need a small update to client mods that use server-registered components, since the client has to declare the same components and archetype changes for the server's values to reach it. + +We are also continuing to move the PvP mod's logic into a server-side mod. Once that is done, the temporary PvP and Cheats APIs introduced in `0.2.0` can go away, as planned. + +## Migration guide {#migration-guide} + +Updating a client mod from `0.2.4` to `0.3.0`: + +* Update your server binaries to `0.3.0`. Older servers cannot load mods built on the `0.3.0` SDK. +* Rebuild your mod against the `0.3.0` SDK. Download the latest [mod template](https://github.com/readycodeio/wukongmp-mod-template) and copy your mod files over, then update the minimum SDK version in your `manifest.json` dependencies. +* **RPC classes changed base class.** `RpcClassBase` is now [`ClientRpcHandler`](/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler), and it no longer takes `IRpcClient` and `IRelaySerializer` in the constructor, since the SDK injects them. Replace `public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer)` with `public partial class MyRpc : ClientRpcHandler`. +* **`RunOnMainThread` is gone.** `[RpcEvent]` handlers are now scheduled onto the game thread for you, so unwrap those callbacks and put the body straight in the handler. See [Custom RPC](/wukong-mp/docs/Development/custom-rpc#threading). +* **Save file API types moved.** [`SaveFileType`](/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType) and [`FileInfo`](/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo) are no longer in `WukongMp.Sdk`, they now live in `ReadyM.Api.Saves`, shared with the server. Update your `using` directives. +* If you write a class extending `ServerRpcClient` to talk to a server-side mod, it must be annotated with `[ServerRpcFor(typeof(YourContracts))]` naming the contract class it implements. Same for `ServerRpcHandlersBase` on the server. Classes using only `[RpcEvent]` are unaffected. diff --git a/wukong-mp/docs/Development/APIs/custom-components.md b/wukong-mp/docs/Development/APIs/custom-components.md index 61c70a6..977d346 100644 --- a/wukong-mp/docs/Development/APIs/custom-components.md +++ b/wukong-mp/docs/Development/APIs/custom-components.md @@ -8,7 +8,9 @@ The WukongMP SDK allows for defining custom data components attached to entities The server half of this shipped in 0.3.0: a server-side mod can declare a networked component and attach it to an archetype, as described in [server-side development](../../Server-development/getting-started#registering-components-and-archetypes). -What is still missing is the client half. There is no way yet for a client mod to register the matching archetype change, so the client never syncs the component and a server-registered networked component stays server-only for now. That last piece lands in **0.3.1**, and nothing written against the server API needs to change when it does. +What is still missing is the client half. There is no way yet for a client mod to register the matching archetype change, so the client never syncs the component and a server-registered networked component stays server-only for now. + +That last piece lands in **0.3.1**, which is coming very soon. The server-side API stays as it is, so code you write against it today survives the upgrade. Your client mod will need updating, though: it has to declare the same components and the same archetype changes as the server mod before the values replicate. Until then, use [local components](../../Server-development/getting-started#local-components) for server-owned state and [RPC](../custom-rpc) to get what the client needs across. diff --git a/wukong-mp/docs/Server-development/archetypes.md b/wukong-mp/docs/Server-development/archetypes.md index 1120963..dceedac 100644 --- a/wukong-mp/docs/Server-development/archetypes.md +++ b/wukong-mp/docs/Server-development/archetypes.md @@ -33,7 +33,7 @@ Attach your own components to any of these in your mod's `Init`, the same way th :::info[Replication of your own components is a preview] -Attaching a component to an archetype works on the server today, and [local components](getting-started#local-components) are fully usable. Networked ones are only half wired: the client cannot register the matching archetype change yet, so it never syncs them. That other half lands in **0.3.1** with no changes needed on your side. See the note in [Getting started](getting-started#registering-components-and-archetypes). +Attaching a component to an archetype works on the server today, and [local components](getting-started#local-components) are fully usable. Networked ones are only half wired: the client cannot register the matching archetype change yet, so it never syncs them. That other half lands in **0.3.1**, coming very soon, and it will require adding the matching registration to your client mod. See the note in [Getting started](getting-started#registering-components-and-archetypes). ::: diff --git a/wukong-mp/docs/Server-development/getting-started.md b/wukong-mp/docs/Server-development/getting-started.md index 10015ab..d6f9d6e 100644 --- a/wukong-mp/docs/Server-development/getting-started.md +++ b/wukong-mp/docs/Server-development/getting-started.md @@ -50,7 +50,7 @@ A typical setup for a fully-featured mod involves **three projects**: The API below is final and the server side of it works, so you can write against it today. What is missing is the other half: there is no way yet for a client mod to register the matching archetype change, so the client never learns about your component and never syncs it. Until it lands, a mod-registered networked component is server-only state. -Client-side registration ships in **0.3.1**, and it is an additive change: your `RegisterComponent` and `ModifyArchetype` calls stay exactly as they are, and the values start replicating once both halves are in place. +Client-side registration ships in **0.3.1**, which is coming very soon. The server-side code on this page keeps working as written, but it is not a free upgrade: your client mod will need to register the same components and the same archetype changes on its side before the server's values reach it. In the meantime, [local components](#local-components) are the ones to reach for. They work end to end on the server right now. From 2045102871c3c7dcf4f2393d9bef8a7057d45241 Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Wed, 12 Aug 2026 10:38:49 +0200 Subject: [PATCH 08/12] Mention open-sourcing the SDK --- blog/2026-08-12-sdk-030.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/blog/2026-08-12-sdk-030.md b/blog/2026-08-12-sdk-030.md index dac91c4..f289e84 100644 --- a/blog/2026-08-12-sdk-030.md +++ b/blog/2026-08-12-sdk-030.md @@ -56,6 +56,8 @@ Viewing it needs the Dashboard access permission. See [Network stats](/wukong-mp We are also continuing to move the PvP mod's logic into a server-side mod. Once that is done, the temporary PvP and Cheats APIs introduced in `0.2.0` can go away, as planned. +Further out, we plan to open-source the SDKs themselves, both client-side and server-side. The [co-op and PvP mods have been public since May](/releases/wukongmp-mods-open-source), and opening the layer underneath them is the logical next step: you get to read the code your mod is built on, and fixes stop having to wait for us. More on that when we have a date. + ## Migration guide {#migration-guide} Updating a client mod from `0.2.4` to `0.3.0`: From 30366aacd5c4621a4a08e93a78a37349bdeca504 Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Wed, 12 Aug 2026 16:13:49 +0200 Subject: [PATCH 09/12] Update docs to mention replication --- blog/2026-08-12-sdk-030.md | 43 +++++-- ...eLib.Attributes.HarmonyTargetMethodHint.md | 2 +- .../PreludeLib.Attributes.In-1.md | 2 +- .../PreludeLib.Attributes.Out-1.md | 2 +- .../PreludeLib.Attributes.Ref-1.md | 2 +- .../PreludeLib.Attributes.md | 2 +- ...yM.Api.Command.ConsoleCommand.ParamInfo.md | 2 +- .../ReadyM.Api.Command.ConsoleCommand.md | 2 +- .../ReadyM.Api.Command/ReadyM.Api.Command.md | 2 +- .../ReadyM.Api.DI.DependencyContainerBase.md | 36 ++++-- .../ReadyM.Api.DI.IDependencyContainer.md | 44 +++++-- .../ReadyM.Api.DI.IHostedService.md | 2 +- .../ReadyM.Api.DI/ReadyM.Api.DI.md | 2 +- ...Api.ECS.Registry.IArchetypeRegistration.md | 22 ++++ .../ReadyM.Api.ECS.Registry.md | 7 ++ ...ReadyM.Api.ECS.Worlds.EntityBuilderBase.md | 2 +- ...eadyM.Api.ECS.Worlds.IArchetypeRegistry.md | 2 +- .../ReadyM.Api.ECS.Worlds.md | 2 +- .../ReadyM.Api.Idents.ArchetypeId.md | 2 +- .../ReadyM.Api.Idents.AreaId.md | 4 +- .../ReadyM.Api.Idents.CellId.md | 4 +- .../ReadyM.Api.Idents.FullCellId.md | 2 +- .../ReadyM.Api.Idents.PlayerId.md | 2 +- .../ReadyM.Api.Idents/ReadyM.Api.Idents.md | 2 +- ...layer.ECS.Components.AreaScopeComponent.md | 8 +- ...yer.ECS.Components.PlayerScopeComponent.md | 6 +- .../ReadyM.Api.Multiplayer.ECS.Components.md | 2 +- ...erators.DeriveINetSerializableAttribute.md | 6 +- ...ultiplayer.Generators.RpcEventAttribute.md | 2 +- .../ReadyM.Api.Multiplayer.Generators.md | 2 +- .../ReadyM.Api.Multiplayer.md | 10 +- ...pi.Multiplayer.Protocol.Enums.RelayMode.md | 2 +- .../ReadyM.Api.Multiplayer.Protocol.md | 2 +- ...Multiplayer.Protocol.DisconnectedReason.md | 2 +- .../ReadyM.Api.Multiplayer.Protocol.Enums.md | 2 +- ...yM.Api.Multiplayer.RPC.ClientRpcHandler.md | 4 +- .../ReadyM.Api.Multiplayer.RPC.RpcBase.md | 4 +- ...dyM.Api.Multiplayer.RPC.ServerRpcClient.md | 4 +- .../ReadyM.Api.Multiplayer.RPC.md | 2 +- ...Api.Multiplayer.ClientToServerAttribute.md | 2 +- ...M.Api.Multiplayer.ServerRpcForAttribute.md | 101 +++++++++++++++ ...Api.Multiplayer.ServerToClientAttribute.md | 2 +- .../ReadyM.Api.Saves.FileInfo.md | 2 +- .../ReadyM.Api.Saves.SaveFileType.md | 2 +- .../ReadyM.Api.Saves/ReadyM.Api.Saves.md | 2 +- .../ReadyM.Api.Serialization.md | 2 +- ...adyM.Api.Serialization.SerializableMode.md | 2 +- ...r.Sdk.Ecs.Components.IComponentRegistry.md | 2 +- .../ReadyM.Relay.Server.Sdk.Ecs.Components.md | 2 +- ...dk.Ecs.Systems.ModSystemBase.UpdateTick.md | 2 +- ...ay.Server.Sdk.Ecs.Systems.ModSystemBase.md | 2 +- .../ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md | 4 +- .../ReadyM.Relay.Server.Sdk.Ecs.Entity.md | 2 +- .../ReadyM.Relay.Server.Sdk.Ecs.Systems.md | 2 +- .../ReadyM.Relay.Server.Sdk.Ecs.md | 2 +- .../ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md | 4 +- .../ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md | 6 +- ...ay.Server.Sdk.Rpc.ServerRpcHandlersBase.md | 4 +- ...y.Server.Sdk.IServerDependencyContainer.md | 4 +- .../ReadyM.Relay.Server.Sdk.Rpc.md | 2 +- .../ReadyM.Relay.Server.Sdk.ServerModBase.md | 2 +- .../ReadyM.Relay.Server.Sdk.md | 2 +- ...ommon.ECS.Components.AnimationComponent.md | 2 +- ...ukong.Common.ECS.Components.HpComponent.md | 2 +- ...n.ECS.Components.MainCharacterComponent.md | 6 +- ...CS.Components.MonsterAnimationComponent.md | 2 +- ...ng.Common.ECS.Components.MovieComponent.md | 10 +- ...Common.ECS.Components.NicknameComponent.md | 2 +- ...g.Common.ECS.Components.PlayerComponent.md | 2 +- ...kong.Common.ECS.Components.PvPComponent.md | 2 +- ...Common.ECS.Components.PvpStateComponent.md | 2 +- ...ong.Common.ECS.Components.RoomComponent.md | 2 +- ...ng.Common.ECS.Components.TamerComponent.md | 18 +-- ...ong.Common.ECS.Components.TeamComponent.md | 2 +- ...ommon.ECS.Components.TransformComponent.md | 2 +- .../ReadyM.Wukong.Common.ECS.Components.md | 2 +- ...ukong.Common.ECS.Values.AttributesState.md | 2 +- ....Wukong.Common.ECS.Values.EquipPosition.md | 2 +- ...mon.ECS.Values.EquipmentState.Converter.md | 2 +- ...Wukong.Common.ECS.Values.EquipmentState.md | 2 +- ...Wukong.Common.ECS.Values.MoveSpeedLevel.md | 2 +- ...ukong.Common.ECS.Values.SpectatorReason.md | 2 +- .../ReadyM.Wukong.Common.ECS.Values.md | 2 +- .../ReadyM.Wukong.Common.Rpc.md | 2 +- .../ReadyM.Wukong.Common.Rpc.SkipMovieData.md | 2 +- ...Api.Configuration.GameplayConfiguration.md | 2 +- ...ukongMp.Api.Configuration.PatchCategory.md | 2 +- .../WukongMp.Api.Configuration.TamerKind.md | 2 +- .../WukongMp.Api.Configuration.TamerKinds.md | 2 +- ...ukongMp.Api.Configuration.UnitPathUtils.md | 2 +- .../WukongMp.Api.Configuration.md | 2 +- .../WukongMp.Api.Resources.BuiltinTexts.md | 2 +- .../WukongMp.Api.Resources.md | 2 +- .../WukongMp.Api.UI.CountdownWidget.md | 2 +- .../WukongMp.Api.UI.GameMessageWidget.md | 2 +- .../WukongMp.Api.UI.GameWidgetBase.md | 2 +- .../WukongMp.Api.UI/WukongMp.Api.UI.md | 2 +- .../WukongMp.Api.WukongUtils.GameUtils.md | 2 +- .../WukongMp.Api.WukongUtils.md | 2 +- .../WukongMp.Sdk.Api.Implementation.md | 9 ++ .../WukongMp.Api.EcsExtensions.md | 2 +- .../WukongMp.Api.IComponentApi.md | 28 +++++ .../WukongMp.Api.IWukongSaveApi.md | 6 +- .../WukongMp.Api/WukongMp.Api.Logging.md | 2 +- .../WukongMp.Api.USharpExtensions.md | 2 +- .../WukongMp.Api/WukongMp.Api.md | 6 +- ...Sdk.Api.Implementation.WukongArchetypes.md | 116 ++++++++++++++++++ .../WukongMp.Sdk.Api.IWukongChatApi.md | 2 +- .../WukongMp.Sdk.Api.IWukongCheatsApi.md | 2 +- ...ukongMp.Sdk.Api.IWukongConfigurationApi.md | 2 +- .../WukongMp.Sdk.Api.IWukongConsoleApi.md | 6 +- .../WukongMp.Sdk.Api.IWukongEventApi.md | 14 +-- .../WukongMp.Sdk.Api.IWukongFileApi.md | 2 +- .../WukongMp.Sdk.Api.IWukongInputApi.md | 2 +- .../WukongMp.Sdk.Api.IWukongLocalApi.md | 2 +- .../WukongMp.Sdk.Api.IWukongPvpApi.md | 2 +- ...ongMp.Sdk.Api.IWukongSynchronizationApi.md | 20 +-- .../WukongMp.Sdk.Api.IWukongWidgetApi.md | 2 +- .../WukongMp.Sdk.Api.WukongApi.md | 25 +++- .../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md | 6 +- .../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md | 2 +- .../WukongMp.Sdk.Entities.ReadyActor.md | 2 +- ...ongMp.Sdk.Entities.ReadyActorExtensions.md | 2 +- .../WukongMp.Sdk.Entities.ReadyCharacter.md | 2 +- ...p.Sdk.Entities.ReadyCharacterExtensions.md | 2 +- ...ukongMp.Sdk.Entities.ReadyMainCharacter.md | 4 +- .../WukongMp.Sdk.Entities.ReadyObject.md | 2 +- ...ngMp.Sdk.Entities.ReadyObjectExtensions.md | 6 +- .../WukongMp.Sdk.Entities.ReadyTamer.md | 2 +- ...ukongMp.Sdk.Serverside.WukongArchetypes.md | 32 ++--- .../WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md | 2 +- .../WukongMp.Sdk.IReadyEntity-1.md | 2 +- .../WukongMp.Sdk/WukongMp.Sdk.ModBase.md | 4 +- .../WukongMp.Sdk.ModSystemBase.UpdateTick.md | 2 +- .../WukongMp.Sdk.ModSystemBase.md | 2 +- .../WukongMp.Sdk/WukongMp.Sdk.Serverside.md | 2 +- .../WukongMp.Sdk/WukongMp.Sdk.md | 2 +- .../Development/APIs/custom-components.md | 76 ++++++++++-- wukong-mp/docs/Development/getting-started.md | 2 +- .../docs/Server-development/archetypes.md | 22 ++-- .../docs/Server-development/custom-rpc.md | 2 +- .../Server-development/getting-started.md | 56 ++++++--- 142 files changed, 722 insertions(+), 277 deletions(-) create mode 100644 wukong-mp/api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.md create mode 100644 wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerRpcForAttribute.md create mode 100644 wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Sdk.Api.Implementation.md create mode 100644 wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IComponentApi.md create mode 100644 wukong-mp/api-reference/WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes.md diff --git a/blog/2026-08-12-sdk-030.md b/blog/2026-08-12-sdk-030.md index f289e84..5b75209 100644 --- a/blog/2026-08-12-sdk-030.md +++ b/blog/2026-08-12-sdk-030.md @@ -1,6 +1,6 @@ --- title: WukongMP SDK 0.3.0 released -description: Server-side scripting, a Network view in the admin panel, and co-op fixes +description: Server-side scripting, custom component sync, a Network view in the admin panel, and co-op fixes slug: wukongmp-sdk-030 authors: readym tags: [wukongmp, adminPanel] @@ -9,6 +9,8 @@ hide_table_of_contents: false Server-side scripting is here. A mod can now run its own code inside the relay server: register components on server entities, tick systems on the server loop, and answer requests from clients over RPC. This is the piece we said was coming and the co-op mod already runs on it. +Custom components now sync both ways too, so a mod can put its own state on an entity and have the server and every client agree on it without writing any messaging code. + This release also adds a Network view to the admin panel, which shows what the relay is actually sending, broken down per ECS component. Alongside that, three co-op fixes, including NPCs that could turn hostile and block quests. Update your server binaries to `0.3.0`. Client mods built on `0.2.4` need a rebuild and a few small code changes, see the [Migration guide](/releases/wukongmp-sdk-030#migration-guide). @@ -29,11 +31,40 @@ Start with [Getting started](/wukong-mp/docs/Server-development/getting-started) The API reference now covers the server SDK as well, under `ReadyM.Relay.Server.Sdk` and `ReadyM.Wukong.Common`. -:::info +## Custom data sync + +Networked components replicate both ways in `0.3.0`. Declare a `partial struct` with `[DeriveINetworkedComponent]` in a project both halves of your mod reference, register it on each side, attach it to an archetype, and the values keep themselves in sync. No messaging code, no manual serialization. + +```csharp title="The component, in the shared project" +[DeriveINetworkedComponent] +[StructLayout(LayoutKind.Auto)] +public partial struct BountyComponent +{ + private int _kills; + private float _multiplier; +} +``` + +The server mod registers it in `RegisterComponents` and attaches it in `Init`: + +```csharp +registry.RegisterComponent(); +// ... +archetypeRegistry.ModifyArchetype(WukongArchetypes.GlobalPlayerArchetype, b => b.Add()); +``` -Registering your own **networked** components is a preview in `0.3.0`. The server side works, but a client mod cannot register the matching archetype change yet, so those components stay server-only for now. That last piece lands in `0.3.1`, which is coming very soon. When it does, the server-side code you write today keeps working, but you will need to update your client mod to register the same components and archetype changes on its side before anything replicates. [Local components](/wukong-mp/docs/Server-development/getting-started#local-components) work end to end right now, and are the ones to reach for in the meantime. +The client mod does the same from its `Initialize`, through `IComponentApi` and an `IArchetypeRegistration`: -::: +```csharp +services.Resolve().RegisterComponent(); +services.RegisterSingleton(); +``` + +Both sides name the same archetype: `WukongArchetypes` on the server, `WukongApi.Archetypes` on the client. See [Custom components](/wukong-mp/docs/Development/APIs/custom-components) for the client side and [Registering components and archetypes](/wukong-mp/docs/Server-development/getting-started#registering-components-and-archetypes) for the server side. + +The one rule worth internalising: register the same components in the same order on both sides. Component IDs are positional and travel as a byte on the wire, so a mismatch misreads the stream rather than failing loudly. Keeping the definitions in the shared project and doing the registration in one place per side is enough to stay safe. + +If the client has no business seeing a value, skip all of this and use a [local component](/wukong-mp/docs/Server-development/getting-started#local-components) instead. Those never leave the server and cost nothing on the wire. ## Network view in the admin panel @@ -52,9 +83,7 @@ Viewing it needs the Dashboard access permission. See [Network stats](/wukong-mp ## What's next? -`0.3.1` is close behind this release and completes custom data sync by adding client-side component and archetype registration, the other half of the preview above. Expect it in a matter of days rather than weeks. It will need a small update to client mods that use server-registered components, since the client has to declare the same components and archetype changes for the server's values to reach it. - -We are also continuing to move the PvP mod's logic into a server-side mod. Once that is done, the temporary PvP and Cheats APIs introduced in `0.2.0` can go away, as planned. +We are continuing to move the PvP mod's logic into a server-side mod. Once that is done, the temporary PvP and Cheats APIs introduced in `0.2.0` can go away, as planned. Further out, we plan to open-source the SDKs themselves, both client-side and server-side. The [co-op and PvP mods have been public since May](/releases/wukongmp-mods-open-source), and opening the layer underneath them is the logical next step: you get to read the code your mod is built on, and fixes stop having to wait for us. More on that when we have a date. diff --git a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md index 2095711..3a4a43d 100644 --- a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md +++ b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.HarmonyTargetMethodHint.md @@ -1,4 +1,4 @@ -# Class HarmonyTargetMethodHint +# Class HarmonyTargetMethodHint Namespace: [PreludeLib.Attributes](../PreludeLib.Attributes/PreludeLib.Attributes.md) Assembly: PreludeLib.dll diff --git a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.In-1.md b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.In-1.md index d04d441..96ec83c 100644 --- a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.In-1.md +++ b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.In-1.md @@ -1,4 +1,4 @@ -# Struct In +# Struct In Namespace: [PreludeLib.Attributes](../PreludeLib.Attributes/PreludeLib.Attributes.md) Assembly: PreludeLib.dll diff --git a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md index 6541b7a..de26878 100644 --- a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md +++ b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Out-1.md @@ -1,4 +1,4 @@ -# Struct Out +# Struct Out Namespace: [PreludeLib.Attributes](../PreludeLib.Attributes/PreludeLib.Attributes.md) Assembly: PreludeLib.dll diff --git a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md index 6518d63..b0259b7 100644 --- a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md +++ b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.Ref-1.md @@ -1,4 +1,4 @@ -# Struct Ref +# Struct Ref Namespace: [PreludeLib.Attributes](../PreludeLib.Attributes/PreludeLib.Attributes.md) Assembly: PreludeLib.dll diff --git a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.md b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.md index e6a7e63..fa7ed14 100644 --- a/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.md +++ b/wukong-mp/api-reference/PreludeLib.Attributes/PreludeLib.Attributes.md @@ -1,4 +1,4 @@ -# PreludeLib.Attributes +# PreludeLib.Attributes ### Classes diff --git a/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md b/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md index b2e7a77..aebff1a 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md +++ b/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.ParamInfo.md @@ -1,4 +1,4 @@ -# Struct ConsoleCommand.ParamInfo +# Struct ConsoleCommand.ParamInfo Namespace: [ReadyM.Api.Command](../ReadyM.Api.Command/ReadyM.Api.Command.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md b/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md index fac4c31..9dc48e1 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md +++ b/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.ConsoleCommand.md @@ -1,4 +1,4 @@ -# Struct ConsoleCommand +# Struct ConsoleCommand Namespace: [ReadyM.Api.Command](../ReadyM.Api.Command/ReadyM.Api.Command.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.md b/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.md index 34795b2..a0eb53b 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.md +++ b/wukong-mp/api-reference/ReadyM.Api.Command/ReadyM.Api.Command.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Command +# ReadyM.Api.Command ### Structs diff --git a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md index 30f1f36..63699c7 100644 --- a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md +++ b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.DependencyContainerBase.md @@ -1,4 +1,4 @@ -# Class DependencyContainerBase +# Class DependencyContainerBase Namespace: [ReadyM.Api.DI](../ReadyM.Api.DI/ReadyM.Api.DI.md) Assembly: ReadyM.Api.dll @@ -61,66 +61,80 @@ public virtual void Dispose() public virtual void Init() ``` -### RegisterSingleton\(TImplementation\) +### RegisterSingleton\(TImplementation, bool\) ```csharp -public void RegisterSingleton(TImplementation instance) where TImplementation : TService +public void RegisterSingleton(TImplementation instance, bool replace = false) where TImplementation : TService ``` #### Parameters `instance` TImplementation +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `TService` `TImplementation` -### RegisterSingleton\(\) +### RegisterSingleton\(bool\) ```csharp -public void RegisterSingleton() +public void RegisterSingleton(bool replace = false) ``` +#### Parameters + +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `T` -### RegisterSingleton\(T\) +### RegisterSingleton\(T, bool\) ```csharp -public void RegisterSingleton(T instance) +public void RegisterSingleton(T instance, bool replace = false) ``` #### Parameters `instance` T +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `T` -### RegisterSingleton\(Type\) +### RegisterSingleton\(Type, bool\) ```csharp -public void RegisterSingleton(Type type) +public void RegisterSingleton(Type type, bool replace = false) ``` #### Parameters `type` [Type](https://learn.microsoft.com/dotnet/api/system.type) +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `TService` -### RegisterSingleton\(\) +### RegisterSingleton\(bool\) ```csharp -public void RegisterSingleton() where TImplementation : TService +public void RegisterSingleton(bool replace = false) where TImplementation : TService ``` +#### Parameters + +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `TService` diff --git a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md index f9c5eea..f87f569 100644 --- a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md +++ b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IDependencyContainer.md @@ -1,4 +1,4 @@ -# Interface IDependencyContainer +# Interface IDependencyContainer Namespace: [ReadyM.Api.DI](../ReadyM.Api.DI/ReadyM.Api.DI.md) Assembly: ReadyM.Api.dll @@ -9,68 +9,90 @@ Dependency injection container interface for registering and resolving services. public interface IDependencyContainer ``` +## Remarks + +Registrations are additive by default, so several mods can each contribute an +implementation of the same service and all of them are returned by +**ResolveAll%60%601**. Pass replace: true to take over a service +another mod or the SDK already registered, which drops every existing +registration of that service type. + ## Methods -### RegisterSingleton\(\) +### RegisterSingleton\(bool\) ```csharp -void RegisterSingleton() +void RegisterSingleton(bool replace = false) ``` +#### Parameters + +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `TService` -### RegisterSingleton\(TService\) +### RegisterSingleton\(TService, bool\) ```csharp -void RegisterSingleton(TService instance) +void RegisterSingleton(TService instance, bool replace = false) ``` #### Parameters `instance` TService +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `TService` -### RegisterSingleton\(Type\) +### RegisterSingleton\(Type, bool\) ```csharp -void RegisterSingleton(Type implementationType) +void RegisterSingleton(Type implementationType, bool replace = false) ``` #### Parameters `implementationType` [Type](https://learn.microsoft.com/dotnet/api/system.type) +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `TService` -### RegisterSingleton\(\) +### RegisterSingleton\(bool\) ```csharp -void RegisterSingleton() where TImplementation : TService +void RegisterSingleton(bool replace = false) where TImplementation : TService ``` +#### Parameters + +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `TService` `TImplementation` -### RegisterSingleton\(TImplementation\) +### RegisterSingleton\(TImplementation, bool\) ```csharp -void RegisterSingleton(TImplementation instance) where TImplementation : TService +void RegisterSingleton(TImplementation instance, bool replace = false) where TImplementation : TService ``` #### Parameters `instance` TImplementation +`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean) + #### Type Parameters `TService` diff --git a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md index 446859e..6029f69 100644 --- a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md +++ b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.IHostedService.md @@ -1,4 +1,4 @@ -# Interface IHostedService +# Interface IHostedService Namespace: [ReadyM.Api.DI](../ReadyM.Api.DI/ReadyM.Api.DI.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md index 5606ad5..4d1e8a9 100644 --- a/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md +++ b/wukong-mp/api-reference/ReadyM.Api.DI/ReadyM.Api.DI.md @@ -1,4 +1,4 @@ -# ReadyM.Api.DI +# ReadyM.Api.DI ### Classes diff --git a/wukong-mp/api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration.md b/wukong-mp/api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration.md new file mode 100644 index 0000000..c2bce38 --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration.md @@ -0,0 +1,22 @@ +# Interface IArchetypeRegistration + +Namespace: [ReadyM.Api.ECS.Registry](../ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.md) +Assembly: ReadyM.Api.dll + +```csharp +public interface IArchetypeRegistration +``` + +## Methods + +### Register\(IArchetypeRegistry\) + +```csharp +void Register(IArchetypeRegistry registry) +``` + +#### Parameters + +`registry` [IArchetypeRegistry](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.md b/wukong-mp/api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.md new file mode 100644 index 0000000..cceecba --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.md @@ -0,0 +1,7 @@ +# ReadyM.Api.ECS.Registry + +### Interfaces + + [IArchetypeRegistration](../ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration.md) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md index 777a718..c7db691 100644 --- a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md +++ b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.EntityBuilderBase.md @@ -1,4 +1,4 @@ -# Class EntityBuilderBase +# Class EntityBuilderBase Namespace: [ReadyM.Api.ECS.Worlds](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md index 0c1ce92..c48b22d 100644 --- a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md +++ b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.IArchetypeRegistry.md @@ -1,4 +1,4 @@ -# Interface IArchetypeRegistry +# Interface IArchetypeRegistry Namespace: [ReadyM.Api.ECS.Worlds](../ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md index 16c4f94..308b092 100644 --- a/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md +++ b/wukong-mp/api-reference/ReadyM.Api.ECS.Worlds/ReadyM.Api.ECS.Worlds.md @@ -1,4 +1,4 @@ -# ReadyM.Api.ECS.Worlds +# ReadyM.Api.ECS.Worlds ### Classes diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md index 35a8024..0238a40 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId.md @@ -1,4 +1,4 @@ -# Struct ArchetypeId +# Struct ArchetypeId Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md index 40f7440..ca0bd17 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.AreaId.md @@ -1,4 +1,4 @@ -# Struct AreaId +# Struct AreaId Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) Assembly: ReadyM.Api.dll @@ -35,7 +35,7 @@ public AreaId(NativeString256 id) #### Parameters -`id` [NativeString256](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeString256.cs) +`id` [NativeString256](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeString256.cs) ### AreaId\(string\) diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md index beaa2cb..720aacd 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.CellId.md @@ -1,4 +1,4 @@ -# Struct CellId +# Struct CellId Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) Assembly: ReadyM.Api.dll @@ -36,7 +36,7 @@ public CellId(NativeString256 id) #### Parameters -`id` [NativeString256](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeString256.cs) +`id` [NativeString256](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeString256.cs) ### CellId\(string\) diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md index cf700ae..815b7a4 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.FullCellId.md @@ -1,4 +1,4 @@ -# Struct FullCellId +# Struct FullCellId Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md index f44cd09..4a12230 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId.md @@ -1,4 +1,4 @@ -# Struct PlayerId +# Struct PlayerId Namespace: [ReadyM.Api.Idents](../ReadyM.Api.Idents/ReadyM.Api.Idents.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md index 3aee7c7..934d5f3 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md +++ b/wukong-mp/api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Idents +# ReadyM.Api.Idents ### Structs diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md index 0fd850c..d62a3fb 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent.md @@ -1,4 +1,4 @@ -# Struct AreaScopeComponent +# Struct AreaScopeComponent Namespace: [ReadyM.Api.Multiplayer.ECS.Components](../ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md) Assembly: ReadyM.Api.Multiplayer.dll @@ -34,7 +34,7 @@ public AreaId AreaId { get; set; } #### Property Value - [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs) + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/AreaId.cs) ### MasterClient @@ -44,7 +44,7 @@ public PlayerId MasterClient { get; set; } #### Property Value - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ## Methods @@ -78,7 +78,7 @@ public AreaId GetIndexedValue() #### Returns - [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs) + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/AreaId.cs) ### Serialize\(NetDataWriter\) diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md index 807037d..bbf1240 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent.md @@ -1,4 +1,4 @@ -# Struct PlayerScopeComponent +# Struct PlayerScopeComponent Namespace: [ReadyM.Api.Multiplayer.ECS.Components](../ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md) Assembly: ReadyM.Api.Multiplayer.dll @@ -34,7 +34,7 @@ public PlayerId PlayerId { get; set; } #### Property Value - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ## Methods @@ -68,7 +68,7 @@ public PlayerId GetIndexedValue() #### Returns - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ### Serialize\(NetDataWriter\) diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md index deca5b3..beea344 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Multiplayer.ECS.Components +# ReadyM.Api.Multiplayer.ECS.Components ### Structs diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md index b9f0269..17144b8 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.DeriveINetSerializableAttribute.md @@ -1,4 +1,4 @@ -# Class DeriveINetSerializableAttribute +# Class DeriveINetSerializableAttribute Namespace: [ReadyM.Api.Multiplayer.Generators](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md) Assembly: ReadyM.Api.Multiplayer.dll @@ -74,7 +74,7 @@ public DeriveINetSerializableAttribute(SerializableMode mode = SerializableMode. #### Parameters -`mode` [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Serialization/SerializableMode.cs) +`mode` [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Serialization/SerializableMode.cs) Determines which members of the struct are serialized. See **SerializableMode** for details. @@ -88,6 +88,6 @@ public readonly SerializableMode Mode #### Field Value - [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Serialization/SerializableMode.cs) + [SerializableMode](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Serialization/SerializableMode.cs) diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md index b8dbab8..7eefa91 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute.md @@ -1,4 +1,4 @@ -# Class RpcEventAttribute +# Class RpcEventAttribute Namespace: [ReadyM.Api.Multiplayer.Generators](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md) Assembly: ReadyM.Api.Multiplayer.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md index 5578bb6..5c51840 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Multiplayer.Generators +# ReadyM.Api.Multiplayer.Generators ### Classes diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md index ac5bb76..b9bbfee 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Multiplayer +# ReadyM.Api.Multiplayer ### Namespaces @@ -17,6 +17,14 @@ On(RpcContext, ...) handler on the server. Different-shaped two-way RPCs are two (one per direction); identical-shape two-way is one method with both attributes. Every contract method needs at least one direction attribute. + [ServerRpcForAttribute](../ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerRpcForAttribute.md) + +Binds an RPC class (server ServerRpcHandlersBase, client ServerRpcClient) to the +**ServerRpcContractsAttribute** class it implements, and is required on both. +A project may reference several contract sets, directly or transitively; this is what tells the +generator which one to emit against. Only the legs declared by the named class are generated, +so one contract set per RPC class. + [ServerToClientAttribute](../ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md) Server-to-client (response/push) leg of a contract method: generates a Send(PlayerId, ...) on diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md index bd7ee14..7ed3965 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode.md @@ -1,4 +1,4 @@ -# Enum RelayMode +# Enum RelayMode Namespace: [ReadyM.Api.Multiplayer.Protocol.Enums](../ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md) Assembly: ReadyM.Api.Multiplayer.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md index 84727ca..fa965dd 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Multiplayer.Protocol +# ReadyM.Api.Multiplayer.Protocol ### Namespaces diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md index 0f296e4..be9f215 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.DisconnectedReason.md @@ -1,4 +1,4 @@ -# Enum DisconnectedReason +# Enum DisconnectedReason Namespace: [ReadyM.Api.Multiplayer.Protocol](../ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.md) Assembly: ReadyM.Api.Multiplayer.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md index bfd8e49..aa29ee8 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.Protocol/ReadyM.Api.Multiplayer.Protocol.Enums.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Multiplayer.Protocol.Enums +# ReadyM.Api.Multiplayer.Protocol.Enums ### Enums diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md index b538784..b525f0c 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler.md @@ -1,4 +1,4 @@ -# Class ClientRpcHandler +# Class ClientRpcHandler Namespace: [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md) Assembly: ReadyM.Api.Multiplayer.dll @@ -18,7 +18,7 @@ public abstract class ClientRpcHandler : RpcBase, IHostedService, IDisposable #### Implements -[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IHostedService.cs), +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/DI/IHostedService.cs), [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) #### Inherited Members diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md index d2e45a8..1b763e9 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcBase.md @@ -1,4 +1,4 @@ -# Class RpcBase +# Class RpcBase Namespace: [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md) Assembly: ReadyM.Api.Multiplayer.dll @@ -21,7 +21,7 @@ public abstract class RpcBase : IHostedService, IDisposable #### Implements -[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IHostedService.cs), +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/DI/IHostedService.cs), [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) #### Inherited Members diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md index aa533b5..5c91e06 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient.md @@ -1,4 +1,4 @@ -# Class ServerRpcClient +# Class ServerRpcClient Namespace: [ReadyM.Api.Multiplayer.RPC](../ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md) Assembly: ReadyM.Api.Multiplayer.dll @@ -17,7 +17,7 @@ public abstract class ServerRpcClient : RpcBase, IHostedService, IDisposable #### Implements -[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IHostedService.cs), +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/DI/IHostedService.cs), [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) #### Inherited Members diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md index df80753..4e6994e 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Multiplayer.RPC +# ReadyM.Api.Multiplayer.RPC ### Classes diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md index 41f6731..b0490e8 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ClientToServerAttribute.md @@ -1,4 +1,4 @@ -# Class ClientToServerAttribute +# Class ClientToServerAttribute Namespace: [ReadyM.Api.Multiplayer](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md) Assembly: ReadyM.Api.Multiplayer.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerRpcForAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerRpcForAttribute.md new file mode 100644 index 0000000..cc2d94e --- /dev/null +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerRpcForAttribute.md @@ -0,0 +1,101 @@ +# Class ServerRpcForAttribute + +Namespace: [ReadyM.Api.Multiplayer](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md) +Assembly: ReadyM.Api.Multiplayer.dll + +Binds an RPC class (server ServerRpcHandlersBase, client ServerRpcClient) to the +**ServerRpcContractsAttribute** class it implements, and is required on both. +A project may reference several contract sets, directly or transitively; this is what tells the +generator which one to emit against. Only the legs declared by the named class are generated, +so one contract set per RPC class. + +```csharp +[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)] +public sealed class ServerRpcForAttribute : Attribute +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[Attribute](https://learn.microsoft.com/dotnet/api/system.attribute) ← +[ServerRpcForAttribute](../ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerRpcForAttribute.md) + +#### Inherited Members + +[Attribute.GetCustomAttributes\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(MemberInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\)), +[Attribute.GetCustomAttributes\(MemberInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-memberinfo\-system\-boolean\)), +[Attribute.IsDefined\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.IsDefined\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(MemberInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-memberinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttributes\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(ParameterInfo, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-parameterinfo\-system\-boolean\)), +[Attribute.IsDefined\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.IsDefined\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\)), +[Attribute.GetCustomAttribute\(ParameterInfo, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-parameterinfo\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttributes\(Module\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\)), +[Attribute.GetCustomAttributes\(Module, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.IsDefined\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\)), +[Attribute.IsDefined\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Module, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\)), +[Attribute.GetCustomAttribute\(Module, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-module\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttributes\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttributes\(Assembly\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\)), +[Attribute.GetCustomAttributes\(Assembly, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattributes\#system\-attribute\-getcustomattributes\(system\-reflection\-assembly\-system\-boolean\)), +[Attribute.IsDefined\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\)), +[Attribute.IsDefined\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefined\#system\-attribute\-isdefined\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.GetCustomAttribute\(Assembly, Type\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\)), +[Attribute.GetCustomAttribute\(Assembly, Type, bool\)](https://learn.microsoft.com/dotnet/api/system.attribute.getcustomattribute\#system\-attribute\-getcustomattribute\(system\-reflection\-assembly\-system\-type\-system\-boolean\)), +[Attribute.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.equals), +[Attribute.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.gethashcode), +[Attribute.Match\(object?\)](https://learn.microsoft.com/dotnet/api/system.attribute.match), +[Attribute.IsDefaultAttribute\(\)](https://learn.microsoft.com/dotnet/api/system.attribute.isdefaultattribute), +[Attribute.TypeId](https://learn.microsoft.com/dotnet/api/system.attribute.typeid), +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### ServerRpcForAttribute\(Type\) + +Binds an RPC class (server ServerRpcHandlersBase, client ServerRpcClient) to the +**ServerRpcContractsAttribute** class it implements, and is required on both. +A project may reference several contract sets, directly or transitively; this is what tells the +generator which one to emit against. Only the legs declared by the named class are generated, +so one contract set per RPC class. + +```csharp +public ServerRpcForAttribute(Type contractsType) +``` + +#### Parameters + +`contractsType` [Type](https://learn.microsoft.com/dotnet/api/system.type) + +## Properties + +### ContractsType + +The [ServerRpcContracts] class this RPC class implements. + +```csharp +public Type ContractsType { get; } +``` + +#### Property Value + + [Type](https://learn.microsoft.com/dotnet/api/system.type) + + diff --git a/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md index 760b36f..e745029 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md +++ b/wukong-mp/api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerToClientAttribute.md @@ -1,4 +1,4 @@ -# Class ServerToClientAttribute +# Class ServerToClientAttribute Namespace: [ReadyM.Api.Multiplayer](../ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.md) Assembly: ReadyM.Api.Multiplayer.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md index b778adc..612e271 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md +++ b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.FileInfo.md @@ -1,4 +1,4 @@ -# Struct FileInfo +# Struct FileInfo Namespace: [ReadyM.Api.Saves](../ReadyM.Api.Saves/ReadyM.Api.Saves.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md index 1aba420..26f3cfc 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md +++ b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.SaveFileType.md @@ -1,4 +1,4 @@ -# Enum SaveFileType +# Enum SaveFileType Namespace: [ReadyM.Api.Saves](../ReadyM.Api.Saves/ReadyM.Api.Saves.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.md b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.md index 2e9dccc..c42210c 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.md +++ b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Saves.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Saves +# ReadyM.Api.Saves ### Structs diff --git a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Serialization.md b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Serialization.md index 903ce61..28b7750 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Serialization.md +++ b/wukong-mp/api-reference/ReadyM.Api.Saves/ReadyM.Api.Serialization.md @@ -1,4 +1,4 @@ -# ReadyM.Api.Serialization +# ReadyM.Api.Serialization ### Enums diff --git a/wukong-mp/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md b/wukong-mp/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md index dc617d6..0b9c432 100644 --- a/wukong-mp/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md +++ b/wukong-mp/api-reference/ReadyM.Api.Serialization/ReadyM.Api.Serialization.SerializableMode.md @@ -1,4 +1,4 @@ -# Enum SerializableMode +# Enum SerializableMode Namespace: [ReadyM.Api.Serialization](../ReadyM.Api.Saves/ReadyM.Api.Serialization.md) Assembly: ReadyM.Api.dll diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md index 5095afa..b325949 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.IComponentRegistry.md @@ -1,4 +1,4 @@ -# Interface IComponentRegistry +# Interface IComponentRegistry Namespace: [ReadyM.Relay.Server.Sdk.Ecs.Components](../ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md) Assembly: ReadyM.Relay.Server.Sdk.dll diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md index 0c30e69..51a9b43 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Components/ReadyM.Relay.Server.Sdk.Ecs.Components.md @@ -1,4 +1,4 @@ -# ReadyM.Relay.Server.Sdk.Ecs.Components +# ReadyM.Relay.Server.Sdk.Ecs.Components ### Interfaces diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md index 984231c..157b8d4 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick.md @@ -1,4 +1,4 @@ -# Struct ModSystemBase.UpdateTick +# Struct ModSystemBase.UpdateTick Namespace: [ReadyM.Relay.Server.Sdk.Ecs.Systems](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md) Assembly: ReadyM.Relay.Server.Sdk.dll diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md index 38a511d..ce49269 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.md @@ -1,4 +1,4 @@ -# Class ModSystemBase +# Class ModSystemBase Namespace: [ReadyM.Relay.Server.Sdk.Ecs.Systems](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md) Assembly: ReadyM.Relay.Server.Sdk.dll diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md index 28229fd..00ae837 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi.md @@ -1,4 +1,4 @@ -# Class EcsApi +# Class EcsApi Namespace: [ReadyM.Relay.Server.Sdk.Ecs](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md) Assembly: ReadyM.Relay.Server.Sdk.dll @@ -36,7 +36,7 @@ public Entity CreateEntity(ArchetypeId archetypeId) #### Parameters -`archetypeId` [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) +`archetypeId` [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) #### Returns diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md index 64ed31e..255befe 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Entity.md @@ -1,4 +1,4 @@ -# Struct Entity +# Struct Entity Namespace: [ReadyM.Relay.Server.Sdk.Ecs](../ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md) Assembly: ReadyM.Relay.Server.Sdk.dll diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md index f12890c..5226370 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.Systems.md @@ -1,4 +1,4 @@ -# ReadyM.Relay.Server.Sdk.Ecs.Systems +# ReadyM.Relay.Server.Sdk.Ecs.Systems ### Classes diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md index 1fc2d9e..94fe8cb 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.md @@ -1,4 +1,4 @@ -# ReadyM.Relay.Server.Sdk.Ecs +# ReadyM.Relay.Server.Sdk.Ecs ### Namespaces diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md index eef73d4..9ff4f36 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcApi.md @@ -1,4 +1,4 @@ -# Class RpcApi +# Class RpcApi Namespace: [ReadyM.Relay.Server.Sdk.Rpc](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md) Assembly: ReadyM.Relay.Server.Sdk.dll @@ -36,7 +36,7 @@ public void SendToOne(PlayerId player, NetDataWriter data, DeliveryMethod delive #### Parameters -`player` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) +`player` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) `data` [NetDataWriter](https://github.com/RevenantX/LiteNetLib/blob/dae6127eaf635e07d9ccfa8b3ecebb2f79094630/LiteNetLib/Utils/NetDataWriter.cs) diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md index d8d1ba5..43bfed2 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext.md @@ -1,4 +1,4 @@ -# Struct RpcContext +# Struct RpcContext Namespace: [ReadyM.Relay.Server.Sdk.Rpc](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md) Assembly: ReadyM.Relay.Server.Sdk.dll @@ -32,7 +32,7 @@ public RpcContext(PlayerId sender) #### Parameters -`sender` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) +`sender` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ## Properties @@ -46,6 +46,6 @@ public PlayerId Sender { get; } #### Property Value - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md index d6375b2..d7e34d2 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase.md @@ -1,4 +1,4 @@ -# Class ServerRpcHandlersBase +# Class ServerRpcHandlersBase Namespace: [ReadyM.Relay.Server.Sdk.Rpc](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md) Assembly: ReadyM.Relay.Server.Sdk.dll @@ -14,7 +14,7 @@ public abstract class ServerRpcHandlersBase : IHostedService, IDisposable #### Implements -[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IHostedService.cs), +[IHostedService](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/DI/IHostedService.cs), [IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable) #### Inherited Members diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md index 48001ed..8925b75 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.IServerDependencyContainer.md @@ -1,4 +1,4 @@ -# Interface IServerDependencyContainer +# Interface IServerDependencyContainer Namespace: [ReadyM.Relay.Server.Sdk](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md) Assembly: ReadyM.Relay.Server.Sdk.dll @@ -12,7 +12,7 @@ public interface IServerDependencyContainer : IDependencyContainer #### Implements -[IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IDependencyContainer.cs) +[IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/DI/IDependencyContainer.cs) ## Methods diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md index 9545181..59d139c 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.Rpc.md @@ -1,4 +1,4 @@ -# ReadyM.Relay.Server.Sdk.Rpc +# ReadyM.Relay.Server.Sdk.Rpc ### Classes diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md index 619c1dd..2a0aae2 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase.md @@ -1,4 +1,4 @@ -# Class ServerModBase +# Class ServerModBase Namespace: [ReadyM.Relay.Server.Sdk](../ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md) Assembly: ReadyM.Relay.Server.Sdk.dll diff --git a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md index 699b1d1..52cc4b4 100644 --- a/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md +++ b/wukong-mp/api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.md @@ -1,4 +1,4 @@ -# ReadyM.Relay.Server.Sdk +# ReadyM.Relay.Server.Sdk ### Namespaces diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md index 531fd9a..91b68e9 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent.md @@ -1,4 +1,4 @@ -# Struct AnimationComponent +# Struct AnimationComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md index 593b964..1320185 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent.md @@ -1,4 +1,4 @@ -# Struct HpComponent +# Struct HpComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md index eacf6e7..c55f199 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent.md @@ -1,4 +1,4 @@ -# Struct MainCharacterComponent +# Struct MainCharacterComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll @@ -194,7 +194,7 @@ public PlayerId PlayerId { get; set; } #### Property Value - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ### RebirthPointId @@ -298,7 +298,7 @@ public PlayerId GetIndexedValue() #### Returns - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ### Serialize\(NetDataWriter\) diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md index 7505c2d..b3c3dec 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent.md @@ -1,4 +1,4 @@ -# Struct MonsterAnimationComponent +# Struct MonsterAnimationComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md index 17cf847..e6d26e6 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent.md @@ -1,4 +1,4 @@ -# Struct MovieComponent +# Struct MovieComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll @@ -142,7 +142,7 @@ public NativeList.ReadOnly GetFinishedSequences() #### Returns - [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs) + [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs) ### GetFinishedSequences\(int\) @@ -166,7 +166,7 @@ public NativeList.ReadOnly GetStartedSequences() #### Returns - [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs) + [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs) ### GetStartedSequences\(int\) @@ -252,7 +252,7 @@ public void SetFinishedSequences(in NativeList value) #### Parameters -`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> +`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> ### SetFinishedSequences\(int, in int\) @@ -274,7 +274,7 @@ public void SetStartedSequences(in NativeList value) #### Parameters -`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> +`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs)<[int](https://learn.microsoft.com/dotnet/api/system.int32)\> ### SetStartedSequences\(int, in int\) diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md index e2db7c8..1699d41 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent.md @@ -1,4 +1,4 @@ -# Struct NicknameComponent +# Struct NicknameComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md index c314f8f..67f2b4b 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent.md @@ -1,4 +1,4 @@ -# Struct PlayerComponent +# Struct PlayerComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md index c2789a2..9e2fc67 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent.md @@ -1,4 +1,4 @@ -# Struct PvPComponent +# Struct PvPComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md index 73c9799..25452e2 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent.md @@ -1,4 +1,4 @@ -# Struct PvpStateComponent +# Struct PvpStateComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md index a3f7760..762c056 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent.md @@ -1,4 +1,4 @@ -# Struct RoomComponent +# Struct RoomComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md index 4ec1ff0..a67653b 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent.md @@ -1,4 +1,4 @@ -# Struct TamerComponent +# Struct TamerComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll @@ -96,7 +96,7 @@ public void AddHoldingPlayers(in PlayerId value) #### Parameters -`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) +`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ### Assign\(in TamerComponent\) @@ -122,7 +122,7 @@ public bool ContainsHoldingPlayers(in PlayerId value) #### Parameters -`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) +`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) #### Returns @@ -152,7 +152,7 @@ public NativeList.ReadOnly GetHoldingPlayers() #### Returns - [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs) + [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs)\>.[ReadOnly](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs) ### GetHoldingPlayers\(int\) @@ -166,7 +166,7 @@ public PlayerId GetHoldingPlayers(int index) #### Returns - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ### InsertHoldingPlayers\(int, in PlayerId\) @@ -178,7 +178,7 @@ public void InsertHoldingPlayers(int index, in PlayerId value) `index` [int](https://learn.microsoft.com/dotnet/api/system.int32) -`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) +`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ### RemoveAtHoldingPlayers\(int\) @@ -192,7 +192,7 @@ public PlayerId RemoveAtHoldingPlayers(int index) #### Returns - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ### Serialize\(NetDataWriter\) @@ -212,7 +212,7 @@ public void SetHoldingPlayers(in NativeList value) #### Parameters -`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/YooniCSharp/Native/Container/NativeList.cs)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\> +`value` [NativeList](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/YooniCSharp/Native/Container/NativeList.cs)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs)\> ### SetHoldingPlayers\(int, in PlayerId\) @@ -224,6 +224,6 @@ public void SetHoldingPlayers(int index, in PlayerId value) `index` [int](https://learn.microsoft.com/dotnet/api/system.int32) -`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) +`value` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md index 8163404..04d6e75 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent.md @@ -1,4 +1,4 @@ -# Struct TeamComponent +# Struct TeamComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md index 638efdd..0ddd144 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent.md @@ -1,4 +1,4 @@ -# Struct TransformComponent +# Struct TransformComponent Namespace: [ReadyM.Wukong.Common.ECS.Components](../ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md index babc52a..3b4277a 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.md @@ -1,4 +1,4 @@ -# ReadyM.Wukong.Common.ECS.Components +# ReadyM.Wukong.Common.ECS.Components ### Structs diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md index ab270d7..d155629 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.AttributesState.md @@ -1,4 +1,4 @@ -# Struct AttributesState +# Struct AttributesState Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md index eb2d30a..d19c974 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipPosition.md @@ -1,4 +1,4 @@ -# Enum EquipPosition +# Enum EquipPosition Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md index 07a2b68..e72743c 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.Converter.md @@ -1,4 +1,4 @@ -# Class EquipmentState.Converter +# Class EquipmentState.Converter Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md index dac337a..5bbe091 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.EquipmentState.md @@ -1,4 +1,4 @@ -# Struct EquipmentState +# Struct EquipmentState Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md index 5aa6b12..7ed316e 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.MoveSpeedLevel.md @@ -1,4 +1,4 @@ -# Enum MoveSpeedLevel +# Enum MoveSpeedLevel Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md index ea70562..09ed917 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.SpectatorReason.md @@ -1,4 +1,4 @@ -# Enum SpectatorReason +# Enum SpectatorReason Namespace: [ReadyM.Wukong.Common.ECS.Values](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md index c93bb35..7c83e0e 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.ECS.Values.md @@ -1,4 +1,4 @@ -# ReadyM.Wukong.Common.ECS.Values +# ReadyM.Wukong.Common.ECS.Values ### Classes diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md index dba1bb1..1175b7e 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md @@ -1,4 +1,4 @@ -# ReadyM.Wukong.Common.Rpc +# ReadyM.Wukong.Common.Rpc ### Structs diff --git a/wukong-mp/api-reference/ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md b/wukong-mp/api-reference/ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md index 5b4a58b..0e18463 100644 --- a/wukong-mp/api-reference/ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md +++ b/wukong-mp/api-reference/ReadyM.Wukong.Common.Rpc/ReadyM.Wukong.Common.Rpc.SkipMovieData.md @@ -1,4 +1,4 @@ -# Struct SkipMovieData +# Struct SkipMovieData Namespace: [ReadyM.Wukong.Common.Rpc](../ReadyM.Wukong.Common.ECS.Values/ReadyM.Wukong.Common.Rpc.md) Assembly: ReadyM.Wukong.Common.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md index f335e9c..4b04f7c 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md +++ b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.GameplayConfiguration.md @@ -1,4 +1,4 @@ -# Class GameplayConfiguration +# Class GameplayConfiguration Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md index 21bed88..26fbdc7 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md +++ b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.PatchCategory.md @@ -1,4 +1,4 @@ -# Class PatchCategory +# Class PatchCategory Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md index 7c081cc..c44d5b5 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md +++ b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKind.md @@ -1,4 +1,4 @@ -# Struct TamerKind +# Struct TamerKind Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md index 1191e94..53bcaba 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md +++ b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.TamerKinds.md @@ -1,4 +1,4 @@ -# Class TamerKinds +# Class TamerKinds Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md index 7525ff4..cb1f9ab 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md +++ b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.UnitPathUtils.md @@ -1,4 +1,4 @@ -# Class UnitPathUtils +# Class UnitPathUtils Namespace: [WukongMp.Api.Configuration](../WukongMp.Api.Configuration/WukongMp.Api.Configuration.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.md b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.md index 47670de..dcfdcb3 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.md +++ b/wukong-mp/api-reference/WukongMp.Api.Configuration/WukongMp.Api.Configuration.md @@ -1,4 +1,4 @@ -# WukongMp.Api.Configuration +# WukongMp.Api.Configuration ### Classes diff --git a/wukong-mp/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md b/wukong-mp/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md index cfd7d95..330850c 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md +++ b/wukong-mp/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.BuiltinTexts.md @@ -1,4 +1,4 @@ -# Class BuiltinTexts +# Class BuiltinTexts Namespace: [WukongMp.Api.Resources](../WukongMp.Api.Resources/WukongMp.Api.Resources.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.md b/wukong-mp/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.md index a8ba061..303c898 100644 --- a/wukong-mp/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.md +++ b/wukong-mp/api-reference/WukongMp.Api.Resources/WukongMp.Api.Resources.md @@ -1,4 +1,4 @@ -# WukongMp.Api.Resources +# WukongMp.Api.Resources ### Classes diff --git a/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md b/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md index c3d4a48..8bfcce6 100644 --- a/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md +++ b/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.CountdownWidget.md @@ -1,4 +1,4 @@ -# Class CountdownWidget +# Class CountdownWidget Namespace: [WukongMp.Api.UI](../WukongMp.Api.UI/WukongMp.Api.UI.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md b/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md index 20ce3ac..97fda0b 100644 --- a/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md +++ b/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameMessageWidget.md @@ -1,4 +1,4 @@ -# Class GameMessageWidget +# Class GameMessageWidget Namespace: [WukongMp.Api.UI](../WukongMp.Api.UI/WukongMp.Api.UI.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md b/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md index 70b68d9..ebb0d66 100644 --- a/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md +++ b/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.GameWidgetBase.md @@ -1,4 +1,4 @@ -# Class GameWidgetBase +# Class GameWidgetBase Namespace: [WukongMp.Api.UI](../WukongMp.Api.UI/WukongMp.Api.UI.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.md b/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.md index c0e28c4..73061a7 100644 --- a/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.md +++ b/wukong-mp/api-reference/WukongMp.Api.UI/WukongMp.Api.UI.md @@ -1,4 +1,4 @@ -# WukongMp.Api.UI +# WukongMp.Api.UI ### Classes diff --git a/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md b/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md index 7214493..b37ec81 100644 --- a/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md +++ b/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.GameUtils.md @@ -1,4 +1,4 @@ -# Class GameUtils +# Class GameUtils Namespace: [WukongMp.Api.WukongUtils](../WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md b/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md index c7b5a2a..85a41d0 100644 --- a/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md +++ b/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Api.WukongUtils.md @@ -1,4 +1,4 @@ -# WukongMp.Api.WukongUtils +# WukongMp.Api.WukongUtils ### Classes diff --git a/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Sdk.Api.Implementation.md b/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Sdk.Api.Implementation.md new file mode 100644 index 0000000..a68ab25 --- /dev/null +++ b/wukong-mp/api-reference/WukongMp.Api.WukongUtils/WukongMp.Sdk.Api.Implementation.md @@ -0,0 +1,9 @@ +# WukongMp.Sdk.Api.Implementation + +### Classes + + [WukongArchetypes](../WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes.md) + +Provides references for core entity archetypes in WukongMP. + + diff --git a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.EcsExtensions.md b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.EcsExtensions.md index f476633..67d57c9 100644 --- a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.EcsExtensions.md +++ b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.EcsExtensions.md @@ -1,4 +1,4 @@ -# Class EcsExtensions +# Class EcsExtensions Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IComponentApi.md b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IComponentApi.md new file mode 100644 index 0000000..d2a0bb8 --- /dev/null +++ b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IComponentApi.md @@ -0,0 +1,28 @@ +# Interface IComponentApi + +Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) +Assembly: WukongMp.Api.dll + +Provides methods for registering custom networked components. + +```csharp +public interface IComponentApi +``` + +## Methods + +### RegisterComponent\(\) + +Register a custom **INetworkedComponent** to be syncronized over the network. + +```csharp +void RegisterComponent() where T : struct, INetworkedComponent +``` + +#### Type Parameters + +`T` + +Type of the component to register. + + diff --git a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md index 94cc9f7..a46e3f4 100644 --- a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md +++ b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.IWukongSaveApi.md @@ -1,4 +1,4 @@ -# Interface IWukongSaveApi +# Interface IWukongSaveApi Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) Assembly: WukongMp.Api.dll @@ -29,7 +29,7 @@ Cancellation token to cancel the download operation. #### Returns - [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Saves/FileInfo.cs)?\> + [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Saves/FileInfo.cs)?\> The content of the player's save file if the download was successful, null otherwise. @@ -49,7 +49,7 @@ Cancellation token to cancel the download operation. #### Returns - [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Saves/FileInfo.cs)?\> + [Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)<[FileInfo](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Saves/FileInfo.cs)?\> The content of the world save file if the download was successful, null otherwise. diff --git a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.Logging.md b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.Logging.md index 013781e..9bcc7c5 100644 --- a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.Logging.md +++ b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.Logging.md @@ -1,4 +1,4 @@ -# Class Logging +# Class Logging Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.USharpExtensions.md b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.USharpExtensions.md index 9c73562..352619e 100644 --- a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.USharpExtensions.md +++ b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.USharpExtensions.md @@ -1,4 +1,4 @@ -# Class USharpExtensions +# Class USharpExtensions Namespace: [WukongMp.Api](../WukongMp.Api/WukongMp.Api.md) Assembly: WukongMp.Api.dll diff --git a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.md b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.md index d8c0431..c70a1e3 100644 --- a/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.md +++ b/wukong-mp/api-reference/WukongMp.Api/WukongMp.Api.md @@ -1,4 +1,4 @@ -# WukongMp.Api +# WukongMp.Api ### Namespaces @@ -24,6 +24,10 @@ Extension methods for Unreal Engine types and other helper methods. ### Interfaces + [IComponentApi](../WukongMp.Api/WukongMp.Api.IComponentApi.md) + +Provides methods for registering custom networked components. + [IWukongSaveApi](../WukongMp.Api/WukongMp.Api.IWukongSaveApi.md) API for managing world and player saves in Wukong Multiplayer. diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes.md b/wukong-mp/api-reference/WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes.md new file mode 100644 index 0000000..5e15ee3 --- /dev/null +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes.md @@ -0,0 +1,116 @@ +# Class WukongArchetypes + +Namespace: [WukongMp.Sdk.Api.Implementation](../WukongMp.Api.WukongUtils/WukongMp.Sdk.Api.Implementation.md) +Assembly: WukongMp.Sdk.dll + +Provides references for core entity archetypes in WukongMP. + +```csharp +public class WukongArchetypes +``` + +#### Inheritance + +[object](https://learn.microsoft.com/dotnet/api/system.object) ← +[WukongArchetypes](../WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes.md) + +#### Inherited Members + +[object.GetType\(\)](https://learn.microsoft.com/dotnet/api/system.object.gettype), +[object.MemberwiseClone\(\)](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), +[object.ToString\(\)](https://learn.microsoft.com/dotnet/api/system.object.tostring), +[object.Equals\(object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\)), +[object.Equals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.equals\#system\-object\-equals\(system\-object\-system\-object\)), +[object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), +[object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) + +## Constructors + +### WukongArchetypes\(\) + +```csharp +public WukongArchetypes() +``` + +## Properties + +### AreaArchetype + +```csharp +public ArchetypeId AreaArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) + +### GlobalPlayerArchetype + +Global player entity archetype. +Components:
+* **PlayerScopeComponent**
+* **PlayerComponent** + +```csharp +public ArchetypeId GlobalPlayerArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) + +### MainCharacterArchetype + +Area-scoped main character entity archetype. +Components:
+* **MainCharacterComponent**
+* **TransformComponent**
+* **HpComponent**
+* **NicknameComponent**
+* **TeamComponent**
+* **PvPComponent**
+ +```csharp +public ArchetypeId MainCharacterArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) + +### PvpStateArchetype + +Global PvP state entity archetype. Used by the PvP mod. +Components:
+* **PvpStateComponent** + +```csharp +[Obsolete("Will be moved to the PvP mod in future refactoring.")] +public ArchetypeId PvpStateArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) + +### TamerArchetype + +Area-scoped tamer entity archetype. +Components:
+* **TamerComponent**
+* **TransformComponent**
+* **HpComponent**
+* **NicknameComponent**
+* **TeamComponent**
+* **AnimationComponent**
+* **MonsterAnimationComponent** + +```csharp +public ArchetypeId TamerArchetype { get; } +``` + +#### Property Value + + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) + + diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md index 2697cdb..fdc0f46 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongChatApi.md @@ -1,4 +1,4 @@ -# Interface IWukongChatApi +# Interface IWukongChatApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md index f4e3120..0cfcb84 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongCheatsApi.md @@ -1,4 +1,4 @@ -# Interface IWukongCheatsApi +# Interface IWukongCheatsApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md index f43eaee..acbf336 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConfigurationApi.md @@ -1,4 +1,4 @@ -# Interface IWukongConfigurationApi +# Interface IWukongConfigurationApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md index b2f888a..c81168e 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongConsoleApi.md @@ -1,4 +1,4 @@ -# Interface IWukongConsoleApi +# Interface IWukongConsoleApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll @@ -25,7 +25,7 @@ void AddCommand(string commandName, ConsoleCommand command, IEnumerable? Text the player types to invoke the command (e.g. "spawn"). -`command` [ConsoleCommand](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Command/ConsoleCommand.cs) +`command` [ConsoleCommand](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Command/ConsoleCommand.cs) Handler that runs when the command is executed. @@ -49,7 +49,7 @@ void AddCommand(string commandName, ConsoleCommand command, Func? OnConnected #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs)\>? ### OnDisconnected @@ -43,7 +43,7 @@ event Action? OnDisconnected #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs), [DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs), [DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\>? ### OnEndPlayGameplayLevel @@ -79,7 +79,7 @@ event Action? OnJoinedArea #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/AreaId.cs)\>? ### OnLanguageChanged @@ -103,7 +103,7 @@ event Action? OnLeftArea #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[AreaId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/AreaId.cs)\>? ### OnLevelLoaded @@ -215,7 +215,7 @@ event Action? OnOtherPlayerInsideArea #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/AreaId.cs)\>? ### OnOtherPlayerOutsideArea @@ -227,7 +227,7 @@ event Action? OnOtherPlayerOutsideArea #### Event Type - [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)\>? + [Action](https://learn.microsoft.com/dotnet/api/system.action-2)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs), [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/AreaId.cs)\>? ### OnPlayerChangedTeam diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md index 8220cf1..9099fe4 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongFileApi.md @@ -1,4 +1,4 @@ -# Interface IWukongFileApi +# Interface IWukongFileApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md index 2fff0dd..7c43678 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongInputApi.md @@ -1,4 +1,4 @@ -# Interface IWukongInputApi +# Interface IWukongInputApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md index 89cc06c..a661838 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongLocalApi.md @@ -1,4 +1,4 @@ -# Interface IWukongLocalApi +# Interface IWukongLocalApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md index de085ab..38b4bd9 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongPvpApi.md @@ -1,4 +1,4 @@ -# Interface IWukongPvpApi +# Interface IWukongPvpApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md index 33d302d..7dc05e3 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongSynchronizationApi.md @@ -1,4 +1,4 @@ -# Interface IWukongSynchronizationApi +# Interface IWukongSynchronizationApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll @@ -33,7 +33,7 @@ IReadOnlyList AllPlayers { get; } #### Property Value - [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\> + [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs)\> ### AllTamers @@ -69,7 +69,7 @@ IReadOnlyList AreaPlayers { get; } #### Property Value - [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)\> + [IReadOnlyList](https://learn.microsoft.com/dotnet/api/system.collections.generic.ireadonlylist-1)<[PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs)\> ### AreaTamers @@ -93,7 +93,7 @@ AreaId? CurrentAreaId { get; } #### Property Value - [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)? + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/AreaId.cs)? ### InArea @@ -153,7 +153,7 @@ PlayerId? LocalPlayerId { get; } #### Property Value - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs)? + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs)? ## Methods @@ -185,7 +185,7 @@ void EnableSpectatorMode(ReadyMainCharacter character, SpectatorReason reason) The character to enable spectator mode for. -`reason` [SpectatorReason](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Wukong.Common/ECS/Values/SpectatorReason.cs) +`reason` [SpectatorReason](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Wukong.Common/ECS/Values/SpectatorReason.cs) The reason for enabling spectator mode. @@ -199,7 +199,7 @@ void GetDisconnectReasonAndInvoke(Action callback) #### Parameters -`callback` [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\> +`callback` [Action](https://learn.microsoft.com/dotnet/api/system.action-1)<[DisconnectedReason](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api.Multiplayer/Protocol/DisconnectedReason.cs)\> The callback to invoke with the disconnect reason. @@ -213,7 +213,7 @@ ReadyMainCharacter? GetMainCharacterByPlayerId(PlayerId playerId) #### Parameters -`playerId` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) +`playerId` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) The player ID. @@ -293,7 +293,7 @@ void SpawnEnemy(TamerKind kind, Vector3 position, int count = 1, int teamId = 2) #### Parameters -`kind` [TamerKind](https://github.com/readycodeio/wukong\-csharp\-mod/blob/ee9f19ef1810c3437563f50da3d7fcdf8f3e22ed/WukongMp.Api/Configuration/TamerKind.cs) +`kind` [TamerKind](https://github.com/readycodeio/wukong\-csharp\-mod/blob/792c639530616be62a1b7d564fb754b09bcbc5b0/WukongMp.Api/Configuration/TamerKind.cs) The kind of enemy to spawn. @@ -328,7 +328,7 @@ bool TryGetPlayerInfoById(PlayerId player, out string? nickname, out int? team) #### Parameters -`player` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) +`player` [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) The player ID. diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md index bfabe1d..4f2cd26 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.IWukongWidgetApi.md @@ -1,4 +1,4 @@ -# Interface IWukongWidgetApi +# Interface IWukongWidgetApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md index 6cf0d55..a7b07df 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.WukongApi.md @@ -1,4 +1,4 @@ -# Class WukongApi +# Class WukongApi Namespace: [WukongMp.Sdk.Api](../WukongMp.Sdk.Api/WukongMp.Sdk.Api.md) Assembly: WukongMp.Sdk.dll @@ -27,6 +27,25 @@ public static class WukongApi ## Properties +### Archetypes + +Provides references for core entity archetypes in WukongMP. + +```csharp +public static WukongArchetypes Archetypes { get; } +``` + +#### Property Value + + [WukongArchetypes](../WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes.md) + +#### Remarks + +Safe to use from an **IArchetypeRegistration**, +unlike the other APIs here: **WukongArchetypes** has no dependencies of +its own, so reaching it does not pull the ECS world back into the container while +the world is still being built. + ### Chat API for interacting with the in-game chat. @@ -148,7 +167,7 @@ public static IWukongSaveApi Saves { get; } #### Property Value - [IWukongSaveApi](https://github.com/readycodeio/wukong\-csharp\-mod/blob/ee9f19ef1810c3437563f50da3d7fcdf8f3e22ed/WukongMp.Api/IWukongSaveApi.cs) + [IWukongSaveApi](https://github.com/readycodeio/wukong\-csharp\-mod/blob/792c639530616be62a1b7d564fb754b09bcbc5b0/WukongMp.Api/IWukongSaveApi.cs) ### Services @@ -158,7 +177,7 @@ public static IDependencyContainer Services { get; } #### Property Value - [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IDependencyContainer.cs) + [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/DI/IDependencyContainer.cs) ### Sync diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.md index 42311f7..ff87bae 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Api.md @@ -1,4 +1,8 @@ -# WukongMp.Sdk.Api +# WukongMp.Sdk.Api + +### Namespaces + + [WukongMp.Sdk.Api.Implementation](../WukongMp.Api.WukongUtils/WukongMp.Sdk.Api.Implementation.md) ### Classes diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md index 4f9d85e..c6f27bd 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md @@ -1,4 +1,4 @@ -# WukongMp.Sdk.Entities +# WukongMp.Sdk.Entities ### Classes diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md index 2acded6..3786cc6 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActor.md @@ -1,4 +1,4 @@ -# Struct ReadyActor +# Struct ReadyActor Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md index 7b30378..823f14d 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyActorExtensions.md @@ -1,4 +1,4 @@ -# Class ReadyActorExtensions +# Class ReadyActorExtensions Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md index cc5ea23..9c6695e 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacter.md @@ -1,4 +1,4 @@ -# Struct ReadyCharacter +# Struct ReadyCharacter Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md index e0bd4ab..499a8c9 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyCharacterExtensions.md @@ -1,4 +1,4 @@ -# Class ReadyCharacterExtensions +# Class ReadyCharacterExtensions Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md index 3f4a877..12bd22c 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyMainCharacter.md @@ -1,4 +1,4 @@ -# Struct ReadyMainCharacter +# Struct ReadyMainCharacter Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll @@ -108,7 +108,7 @@ public PlayerId PlayerId { get; } #### Property Value - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) ### RebirthPointId diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md index ac8f3b7..c206c28 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObject.md @@ -1,4 +1,4 @@ -# Struct ReadyObject +# Struct ReadyObject Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md index 91983ed..a350939 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyObjectExtensions.md @@ -1,4 +1,4 @@ -# Class ReadyObjectExtensions +# Class ReadyObjectExtensions Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll @@ -54,7 +54,7 @@ public static AreaId? get_AreaId(TSelf obj) where TSelf : struct, IReadyE #### Returns - [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/AreaId.cs)? + [AreaId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/AreaId.cs)? #### Type Parameters @@ -92,7 +92,7 @@ public static PlayerId get_Owner(TSelf obj) where TSelf : struct, IReadyE #### Returns - [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/PlayerId.cs) + [PlayerId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/PlayerId.cs) #### Type Parameters diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md index 423365e..9d0246c 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Entities/WukongMp.Sdk.Entities.ReadyTamer.md @@ -1,4 +1,4 @@ -# Struct ReadyTamer +# Struct ReadyTamer Namespace: [WukongMp.Sdk.Entities](../WukongMp.Sdk.Api/WukongMp.Sdk.Entities.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md b/wukong-mp/api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md index 3cb5d83..5aae04e 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md +++ b/wukong-mp/api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes.md @@ -1,4 +1,4 @@ -# Class WukongArchetypes +# Class WukongArchetypes Namespace: [WukongMp.Sdk.Serverside](../WukongMp.Sdk/WukongMp.Sdk.Serverside.md) Assembly: WukongMp.Sdk.Serverside.dll @@ -6,7 +6,7 @@ Assembly: WukongMp.Sdk.Serverside.dll Provides references for core entity archetypes in WukongMP. ```csharp -public class WukongArchetypes +public static class WukongArchetypes ``` #### Inheritance @@ -24,25 +24,17 @@ public class WukongArchetypes [object.ReferenceEquals\(object?, object?\)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.GetHashCode\(\)](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) -## Constructors - -### WukongArchetypes\(\) - -```csharp -public WukongArchetypes() -``` - ## Properties ### AreaArchetype ```csharp -public ArchetypeId AreaArchetype { get; } +public static ArchetypeId AreaArchetype { get; } ``` #### Property Value - [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) ### GlobalPlayerArchetype @@ -52,12 +44,12 @@ Components:
* **PlayerComponent** ```csharp -public ArchetypeId GlobalPlayerArchetype { get; } +public static ArchetypeId GlobalPlayerArchetype { get; } ``` #### Property Value - [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) ### MainCharacterArchetype @@ -71,12 +63,12 @@ Components:
* **PvPComponent**
```csharp -public ArchetypeId MainCharacterArchetype { get; } +public static ArchetypeId MainCharacterArchetype { get; } ``` #### Property Value - [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) ### PvpStateArchetype @@ -86,12 +78,12 @@ Components:
```csharp [Obsolete("Will be moved to the PvP mod in future refactoring.")] -public ArchetypeId PvpStateArchetype { get; } +public static ArchetypeId PvpStateArchetype { get; } ``` #### Property Value - [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) ### TamerArchetype @@ -106,11 +98,11 @@ Components:
* **MonsterAnimationComponent** ```csharp -public ArchetypeId TamerArchetype { get; } +public static ArchetypeId TamerArchetype { get; } ``` #### Property Value - [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/Idents/ArchetypeId.cs) + [ArchetypeId](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/Idents/ArchetypeId.cs) diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md index efb24f6..4e93496 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.EntityList-1.md @@ -1,4 +1,4 @@ -# Struct EntityList +# Struct EntityList Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md index 4fcc8a0..68dc3d6 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.IReadyEntity-1.md @@ -1,4 +1,4 @@ -# Interface IReadyEntity +# Interface IReadyEntity Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md index c1001bb..f19a426 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase.md @@ -1,4 +1,4 @@ -# Class ModBase +# Class ModBase Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) Assembly: WukongMp.Sdk.dll @@ -115,7 +115,7 @@ protected abstract void Initialize(IDependencyContainer services) #### Parameters -`services` [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/c12780df078c882058ee18410f12720cc6ee2a0a/src/ReadyM.Api/DI/IDependencyContainer.cs) +`services` [IDependencyContainer](https://github.com/readycodeio/readym\-gameserver/blob/4a84cd6e2f2a01df3ad669f6632cd6c40d70e910/src/ReadyM.Api/DI/IDependencyContainer.cs) ### LateInit\(\) diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md index b1042d9..fc29b2c 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.UpdateTick.md @@ -1,4 +1,4 @@ -# Struct ModSystemBase.UpdateTick +# Struct ModSystemBase.UpdateTick Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md index e0f3cd8..d41f118 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.ModSystemBase.md @@ -1,4 +1,4 @@ -# Class ModSystemBase +# Class ModSystemBase Namespace: [WukongMp.Sdk](../WukongMp.Sdk/WukongMp.Sdk.md) Assembly: WukongMp.Sdk.dll diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.Serverside.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.Serverside.md index c3f37aa..2e902fd 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.Serverside.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.Serverside.md @@ -1,4 +1,4 @@ -# WukongMp.Sdk.Serverside +# WukongMp.Sdk.Serverside ### Classes diff --git a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.md b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.md index 9812cb8..127c194 100644 --- a/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.md +++ b/wukong-mp/api-reference/WukongMp.Sdk/WukongMp.Sdk.md @@ -1,4 +1,4 @@ -# WukongMp.Sdk +# WukongMp.Sdk ### Namespaces diff --git a/wukong-mp/docs/Development/APIs/custom-components.md b/wukong-mp/docs/Development/APIs/custom-components.md index 977d346..fadfb0b 100644 --- a/wukong-mp/docs/Development/APIs/custom-components.md +++ b/wukong-mp/docs/Development/APIs/custom-components.md @@ -1,17 +1,79 @@ # Custom components -The WukongMP SDK allows for defining custom data components attached to entities in the game. These can be anything from primitive values to complex structures. +The WukongMP SDK allows for defining custom data components attached to entities in the game. A **networked component** replicates between the server and every connected client, so both sides see the same values without you writing any messaging code for it. ---- +A component is one half of a pair. The [server mod](../../Server-development/getting-started#registering-components-and-archetypes) registers it and attaches it to an archetype, and the client mod does the same, against the same definition from a shared project. This page covers the client half. -:::warning[Work in progress] +## Declaring the component -The server half of this shipped in 0.3.0: a server-side mod can declare a networked component and attach it to an archetype, as described in [server-side development](../../Server-development/getting-started#registering-components-and-archetypes). +Put the component in the **shared project** that both your client mod and your server mod reference. It is a `partial struct` decorated with `[DeriveINetworkedComponent]`, and the generator turns each private field into a public property and writes the serialization code: -What is still missing is the client half. There is no way yet for a client mod to register the matching archetype change, so the client never syncs the component and a server-registered networked component stays server-only for now. +```csharp title="ExampleMod.Common/BountyComponent.cs" +using System.Runtime.InteropServices; +using ReadyM.Api.Multiplayer.Generators; -That last piece lands in **0.3.1**, which is coming very soon. The server-side API stays as it is, so code you write against it today survives the upgrade. Your client mod will need updating, though: it has to declare the same components and the same archetype changes as the server mod before the values replicate. +[DeriveINetworkedComponent] +[StructLayout(LayoutKind.Auto)] +public partial struct BountyComponent +{ + private int _kills; + private float _multiplier; +} +``` -Until then, use [local components](../../Server-development/getting-started#local-components) for server-owned state and [RPC](../custom-rpc) to get what the client needs across. +Any type the component's fields use has to live in the shared project too, for the same reason: the two sides must never disagree about its layout. + +## Registering it on the client + +Two things have to happen in your mod's `Initialize`: register the component type, and register an archetype change that attaches it to an entity. + +```csharp title="Mod.cs" +protected override void Initialize(IDependencyContainer services) +{ + services.Resolve().RegisterComponent(); + services.RegisterSingleton(); +} +``` + +[`IComponentApi.RegisterComponent`](../../../api-reference/WukongMp.Api/WukongMp.Api.IComponentApi) declares the type to the networking layer. The archetype change goes in a class implementing [`IArchetypeRegistration`](../../../api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration), which the SDK calls while it builds the ECS world: + +```csharp title="BountyRegistration.cs" +using ReadyM.Api.ECS.Registry; +using ReadyM.Api.ECS.Worlds; +using WukongMp.Sdk.Api; + +public class BountyRegistration : IArchetypeRegistration +{ + public void Register(IArchetypeRegistry registry) + { + registry.ModifyArchetype(WukongApi.Archetypes.GlobalPlayerArchetype, b => b.Add()); + } +} +``` + +`WukongApi.Archetypes` names the built-in archetypes, the same set the server SDK exposes as static members on `WukongArchetypes`. See [Archetypes and components](../../Server-development/archetypes) for what each one carries and which one your data belongs on. + +:::note + +`WukongApi.Archetypes` is the only part of `WukongApi` that is safe to touch from inside `Register`. It has no dependencies of its own, whereas the other APIs would pull the ECS world back into the container while the world is still being built. ::: + +Registrations are additive, so registering your own does not displace the SDK's. `ModifyArchetype` attaches to an existing archetype; `RegisterArchetype` on the same interface creates a new one, if your mod spawns its own kind of entity. + +## Keeping the two sides in step + +Component IDs are positional. They are assigned in registration order and travel as a single byte on the wire, and nothing renegotiates them at connection time. If the client and the server register different components, or the same ones in a different order, the mismatch is not reported: the receiving side reads the wrong component out of the stream. + +In practice this is easy to get right, as long as you: + +* keep every component definition in the shared project, so the layouts cannot drift, +* register components in one place on each side, in the same order, +* attach them to the same archetypes on both sides, +* ship the client mod and the server mod together, as versions of the same package. + +The [mod template](https://github.com/readycodeio/wukongmp-mod-template) is laid out around exactly this: `ExampleMod.Common` holds the component, `ExampleMod` registers the client half, `ExampleMod.Serverside` registers the server half. + +## Server-only state + +If the client has no business seeing a value, it does not need a component at all on this side. The server SDK has [local components](../../Server-development/getting-started#local-components) for state that never leaves the server, and they cost nothing on the wire. Use [RPC](../custom-rpc) for one-off events rather than state. diff --git a/wukong-mp/docs/Development/getting-started.md b/wukong-mp/docs/Development/getting-started.md index 30d749a..b2943e0 100644 --- a/wukong-mp/docs/Development/getting-started.md +++ b/wukong-mp/docs/Development/getting-started.md @@ -23,5 +23,5 @@ Visit the [examples](/wukong-mp/category/mod-examples) page for some inspiration | Console command API | :white_check_mark: [done](../Development/APIs/console-commands) | | Custom RPC | :white_check_mark: [done](../Development/custom-rpc) | | Save file API | :construction: [partial](../Development/APIs/save-file-management) | -| Custom data sync | :construction: [preview](../Development/APIs/custom-components), client-side registration lands in 0.3.1 | +| Custom data sync | :white_check_mark: [done](../Development/APIs/custom-components) | | Server-side mods | :white_check_mark: [done](../Server-development/getting-started) | diff --git a/wukong-mp/docs/Server-development/archetypes.md b/wukong-mp/docs/Server-development/archetypes.md index dceedac..aa19dda 100644 --- a/wukong-mp/docs/Server-development/archetypes.md +++ b/wukong-mp/docs/Server-development/archetypes.md @@ -14,14 +14,13 @@ An **archetype** is the fixed set of components an entity is created with. Wukon They are named by [WukongArchetypes](../../api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes), a small class that maps each one to its [ArchetypeId](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId): ```csharp -var archetypes = new WukongArchetypes(); -// archetypes.AreaArchetype -// archetypes.GlobalPlayerArchetype -// archetypes.TamerArchetype -// archetypes.MainCharacterArchetype +// WukongArchetypes.AreaArchetype +// WukongArchetypes.GlobalPlayerArchetype +// WukongArchetypes.TamerArchetype +// WukongArchetypes.MainCharacterArchetype ``` -The class holds fixed IDs and no state, so constructing it directly is fine. `WukongMp.Sdk.Serverside` also registers it as a singleton. +The members are static, so there is nothing to resolve or construct. The client SDK exposes the same set through [`WukongApi.Archetypes`](../../api-reference/WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes), which is how a client mod names the same archetype when it registers its half of a networked component. :::danger[Do not hardcode archetype IDs] @@ -31,12 +30,6 @@ The numeric IDs behind these properties are an implementation detail of the curr Attach your own components to any of these in your mod's `Init`, the same way the examples in [Getting started](getting-started#registering-components-and-archetypes) do. The tables below list the components each archetype already carries, so you know what is available to query. -:::info[Replication of your own components is a preview] - -Attaching a component to an archetype works on the server today, and [local components](getting-started#local-components) are fully usable. Networked ones are only half wired: the client cannot register the matching archetype change yet, so it never syncs them. That other half lands in **0.3.1**, coming very soon, and it will require adding the matching registration to your client mod. See the note in [Getting started](getting-started#registering-components-and-archetypes). - -::: - :::warning[The access API is temporary] Right now you read and write these components through the low-level [`EcsApi`](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi) (raw `Query` calls and `ref` component access). This is deliberately bare-bones for `0.3.0`. A higher-level, less raw server API is planned, so expect the way you access entity data to change in a later release. @@ -140,8 +133,7 @@ public class Mod : ServerModBase .Add()); // Attaching a component to a built-in archetype instead. - var archetypes = new WukongArchetypes(); - registry.ModifyArchetype(archetypes.GlobalPlayerArchetype, b => b.Add()); + registry.ModifyArchetype(WukongArchetypes.GlobalPlayerArchetype, b => b.Add()); } } ``` @@ -156,6 +148,6 @@ var entity = ecsApi.CreateEntity(Mod.ShrineArchetype); :::important -An archetype your mod registers exists only on the server. Once client-side registration lands in 0.3.1, the client mod will need to register a matching one, with the component set and its order identical on both sides. +An archetype your mod registers must be registered on the client too, in the same order and with the same component set, or the two sides disagree about what an entity of that archetype contains. Register archetypes from a single [`IArchetypeRegistration`](../../api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration) on the client so the order is obvious and easy to keep in step. See [Custom components](../Development/APIs/custom-components). ::: diff --git a/wukong-mp/docs/Server-development/custom-rpc.md b/wukong-mp/docs/Server-development/custom-rpc.md index 62214c6..9057542 100644 --- a/wukong-mp/docs/Server-development/custom-rpc.md +++ b/wukong-mp/docs/Server-development/custom-rpc.md @@ -70,7 +70,7 @@ The [RpcContext](../../api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Se ### Binding a class to its contract -`[ServerRpcFor]` is **required** on every server handler and client RPC class, and takes the `[ServerRpcContracts]` class it implements. Your mod may reference several contract sets, directly or through a chain of shared projects, and this is what tells the generator which one to emit against. +[`[ServerRpcFor]`](../../api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerRpcForAttribute) is **required** on every server handler and client RPC class, and takes the `[ServerRpcContracts]` class it implements. Your mod may reference several contract sets, directly or through a chain of shared projects, and this is what tells the generator which one to emit against. Only the legs declared by the named contract class are generated, so a class implements exactly one contract set. If you have several contract classes, give each its own handler class: diff --git a/wukong-mp/docs/Server-development/getting-started.md b/wukong-mp/docs/Server-development/getting-started.md index d6f9d6e..19b6a05 100644 --- a/wukong-mp/docs/Server-development/getting-started.md +++ b/wukong-mp/docs/Server-development/getting-started.md @@ -36,7 +36,7 @@ The [co-op mod](https://github.com/readycodeio/WukongMP-co-op-mod) is built on t ## Setting up the project -A server-side mod targets `net10.0`, unlike client-side mods which target `netstandard2.0`. It references the server SDK and the shared WukongMP assemblies, all of which ship in the server package. Use to the [mod template](https://github.com/readycodeio/wukongmp-mod-template) to get started with creating a server-side mod. +A server-side mod targets `net10.0`, unlike client-side mods which target `netstandard2.0`. It references the server SDK and the shared WukongMP assemblies, all of which ship in the server package. Use the [mod template](https://github.com/readycodeio/wukongmp-mod-template) to get started with creating a server-side mod. A typical setup for a fully-featured mod involves **three projects**: @@ -44,19 +44,11 @@ A typical setup for a fully-featured mod involves **three projects**: * A server-side mod, targeting `net10.0`, and referencing the shared mod. * A client-side mod, targeting `netstandard2.0`, and referencing the shared mod. -## Registering components and archetypes - -:::info[Networked components are a preview in 0.3.0] - -The API below is final and the server side of it works, so you can write against it today. What is missing is the other half: there is no way yet for a client mod to register the matching archetype change, so the client never learns about your component and never syncs it. Until it lands, a mod-registered networked component is server-only state. +The shared project targets `netstandard2.0` so both of the other two can reference it. In the template it references the SDK assemblies with `Private="false"`, which keeps the `netstandard2.0` builds out of the server mod's output folder, where the `net10.0` builds have to win. That split is why the template carries two dependency folders: `Dependencies/SDK` for the `netstandard2.0` assemblies and `Dependencies/ServerSDK` for the `net10.0` ones. -Client-side registration ships in **0.3.1**, which is coming very soon. The server-side code on this page keeps working as written, but it is not a free upgrade: your client mod will need to register the same components and the same archetype changes on its side before the server's values reach it. - -In the meantime, [local components](#local-components) are the ones to reach for. They work end to end on the server right now. - -::: +## Registering components and archetypes -A networked component is declared with `[DeriveINetworkedComponent]` on a `partial struct`. The generator turns each private field into a public property and writes the serialization code: +A **networked component** replicates between the server and every connected client. It is declared with `[DeriveINetworkedComponent]` on a `partial struct`, in the shared project, so the server mod and the client mod compile against the same definition. The generator turns each private field into a public property and writes the serialization code: ```csharp title="A networked component (in the shared project)" using System.Runtime.InteropServices; @@ -84,9 +76,8 @@ public class MyServerMod : ServerModBase protected override void Init() { var registry = Services.Resolve(); - var archetypes = new WukongArchetypes(); - registry.ModifyArchetype(archetypes.GlobalPlayerArchetype, archetype => + registry.ModifyArchetype(WukongArchetypes.GlobalPlayerArchetype, archetype => { archetype.Add(); }); @@ -96,9 +87,35 @@ public class MyServerMod : ServerModBase A running kill count is persistent, player-scoped data, so it belongs on the **global player entity**: one entity per connected player that lives for the whole session, regardless of which area the player is in. Data that describes the character's presence in the world (position, HP, team) belongs on the main character instead. See [Archetypes and components](archetypes) for what each archetype carries. +## Matching it up on the client + +The two halves are symmetric. Whatever the server mod registers and attaches, the client mod registers and attaches the same way, and the values then replicate in both directions. In the client mod's `Initialize`: + +```csharp title="The client half of the same component" +protected override void Initialize(IDependencyContainer services) +{ + services.Resolve().RegisterComponent(); + services.RegisterSingleton(); +} +``` + +```csharp title="BountyRegistration.cs" +public class BountyRegistration : IArchetypeRegistration +{ + public void Register(IArchetypeRegistry registry) + { + registry.ModifyArchetype(WukongApi.Archetypes.GlobalPlayerArchetype, b => b.Add()); + } +} +``` + +See [Custom components](../Development/APIs/custom-components) for the client side in full. + :::important -Once client-side registration lands in 0.3.1, a networked component's shape and its archetype membership must match between the server mod and every client mod. Ship server-side and client-side mods together as versions of the same package. +The two sides have to agree exactly. Register the same components, in the same order, and attach them to the same archetypes on both sides. Component IDs are positional, assigned in registration order and sent as a byte on the wire, so a mismatch does not fail loudly, it misreads the stream. + +The practical rule: keep the component definitions in the shared project, do the registration in one place on each side, and ship the client mod and the server mod together as versions of the same package. ::: @@ -124,15 +141,14 @@ protected override void RegisterComponents(IComponentRegistry registry) protected override void Init() { var registry = Services.Resolve(); - var archetypes = new WukongArchetypes(); - registry.ModifyArchetype(archetypes.MainCharacterArchetype, a => a.Add()); + registry.ModifyArchetype(WukongArchetypes.MainCharacterArchetype, a => a.Add()); } ``` -From there it behaves like any other component: it shows up in `Query`, you read and write it by `ref`, and it lives and dies with its entity. It simply never leaves the server. +From there it behaves like any other component: it shows up in `Query`, you read and write it by `ref`, and it lives and dies with its entity. It simply never leaves the server, so it needs no counterpart in the client mod and costs nothing on the wire. -This is the whole surface you need for logic the server owns and the client only ever learns about through [RPC](custom-rpc): timers, cooldowns, accumulated scores, per-player bookkeeping. +Reach for a local component whenever the client has no business seeing the value: timers, cooldowns, cheat bookkeeping, intermediate state a system rebuilds every tick. Everything the client has to render or react to belongs in a networked component instead, or in an [RPC](custom-rpc) if it is a one-off event rather than state. :::note @@ -188,9 +204,9 @@ There is a known issue in this version that overwriting data that the client cha | Feature | Status | |---|---| +| Networked components | :white_check_mark: [done](#registering-components-and-archetypes) | | Local components | :white_check_mark: [done](#local-components) | | Gameplay systems | :white_check_mark: [done](systems) | | Server RPC | :white_check_mark: [done](custom-rpc) | -| Networked components | :construction: [preview](#registering-components-and-archetypes), client-side registration lands in 0.3.1 | | Higher-level entity API | :soon: planned, see the note in [Archetypes and components](archetypes) | | Server mod manifests | :soon: not used in 0.3.0 | From ee0ef9cb271ca8bc07ded4aba618b2d701015fc6 Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Wed, 12 Aug 2026 16:50:59 +0200 Subject: [PATCH 10/12] Mention .NET runtime requirement --- .../Server-development/getting-started.md | 6 +++ wukong-mp/docs/Server/installation.mdx | 38 +++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/wukong-mp/docs/Server-development/getting-started.md b/wukong-mp/docs/Server-development/getting-started.md index 19b6a05..69e3b3e 100644 --- a/wukong-mp/docs/Server-development/getting-started.md +++ b/wukong-mp/docs/Server-development/getting-started.md @@ -38,6 +38,12 @@ The [co-op mod](https://github.com/readycodeio/WukongMP-co-op-mod) is built on t A server-side mod targets `net10.0`, unlike client-side mods which target `netstandard2.0`. It references the server SDK and the shared WukongMP assemblies, all of which ship in the server package. Use the [mod template](https://github.com/readycodeio/wukongmp-mod-template) to get started with creating a server-side mod. +:::note + +Server mods run on CoreCLR rather than inside the AOT-compiled server binary, so the machine hosting the server needs the .NET 10 runtime installed. See [Requirements](../Server/installation#requirements). + +::: + A typical setup for a fully-featured mod involves **three projects**: * A shared `netstandard2.0` mod that contains type definitions and RPC contracts. diff --git a/wukong-mp/docs/Server/installation.mdx b/wukong-mp/docs/Server/installation.mdx index d8cd9af..ad86137 100644 --- a/wukong-mp/docs/Server/installation.mdx +++ b/wukong-mp/docs/Server/installation.mdx @@ -13,6 +13,44 @@ The WukongMP server is currently distributed in the following formats: - Binary package - [Docker image](#docker) +## Requirements + +The server binary itself is self-contained, but [server-side mods](../Server-development/getting-started) run on CoreCLR, which the server starts at launch. That means the [**.NET 10 runtime**](https://dotnet.microsoft.com/download/dotnet/10.0) has to be installed on the machine, even if you do not intend to install any mods of your own. The `dotnet-runtime-10.0` package is enough, you do not need the SDK. + +The Docker image already includes it. + + + + +The [official installer](https://dotnet.microsoft.com/download/dotnet/10.0) puts the runtime where the server expects it, so there is nothing else to do. + + + + +Install it with your package manager, or with Microsoft's [install script](https://learn.microsoft.com/dotnet/core/install/linux-scripted-manual#scripted-install). The server looks for the runtime in the usual locations, in this order: + +1. `/usr/lib/dotnet` (Debian and Ubuntu packages) +2. `/usr/lib64/dotnet` (Fedora and RHEL) +3. `/usr/share/dotnet` (Microsoft packages and the install script) +4. `~/.dotnet` + +A directory only counts if it actually contains `host/fxr`, so a leftover from an uninstalled version does not get in the way. If your runtime lives somewhere else, point `DOTNET_ROOT` at it: + +```shell +DOTNET_ROOT=/opt/dotnet ./server +``` + +Check where yours is with `dotnet --info | grep 'Base Path'`. + + + + +:::note + +If the runtime is missing, the server exits at startup with `Cannot locate a .NET installation containing host/fxr` and lists the directories it checked. + +::: + ## Binary package ### Downloads From 2c51672862cc92a54802e25410e50e2164a1879f Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Wed, 12 Aug 2026 17:26:31 +0200 Subject: [PATCH 11/12] Mention that docker builds are coming soon --- .../current.json | 4 + wukong-mp/docs/Server/installation.mdx | 79 ++----------------- wukong-mp/docs/quick-start.mdx | 65 ++------------- 3 files changed, 16 insertions(+), 132 deletions(-) diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json index 2118021..8feec6f 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current.json @@ -110,5 +110,9 @@ "sidebar.oblivionMpDocsSidebar.category.Server hosting": { "message": "Server hosting", "description": "The label for category 'Server hosting' in sidebar 'oblivionMpDocsSidebar'" + }, + "sidebar.wukongMpDocsSidebar.category.Server-side development": { + "message": "服务器端开发", + "description": "The label for category 'Server-side development' in sidebar 'wukongMpDocsSidebar'" } } diff --git a/wukong-mp/docs/Server/installation.mdx b/wukong-mp/docs/Server/installation.mdx index ad86137..d7a7616 100644 --- a/wukong-mp/docs/Server/installation.mdx +++ b/wukong-mp/docs/Server/installation.mdx @@ -11,14 +11,12 @@ import TabItem from '@theme/TabItem'; The WukongMP server is currently distributed in the following formats: - Binary package -- [Docker image](#docker) +- [Docker image](#docker) (coming soon) ## Requirements The server binary itself is self-contained, but [server-side mods](../Server-development/getting-started) run on CoreCLR, which the server starts at launch. That means the [**.NET 10 runtime**](https://dotnet.microsoft.com/download/dotnet/10.0) has to be installed on the machine, even if you do not intend to install any mods of your own. The `dotnet-runtime-10.0` package is enough, you do not need the SDK. -The Docker image already includes it. - @@ -57,8 +55,8 @@ If the runtime is missing, the server exits at startup with `Cannot locate a .NE | Platform | Architecture | Download | | --- | --- | --- | -| Linux | x64 | [Download for Linux](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.2.4.zip) | -| Windows | x64 | [Download for Windows](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.2.4.zip) | +| Linux | x64 | [Download for Linux](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.3.0.zip) | +| Windows | x64 | [Download for Windows](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.3.0.zip) | ### Installation @@ -142,75 +140,8 @@ Unless changed in `config.json`, the server listens on the following ports: ## Docker -A Linux-based x64 Docker image is also available for those who prefer containerized deployments. - -Pull the image from the registry: +:::info[Coming soon] -```shell -docker pull ghcr.io/readycodeio/wukongmp-server:0.3.0 -``` - -Copy the config file from the image: - -```shell -docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.3.0 -docker cp wukongmp-tmp:/app/config.json ./config.json -docker rm wukongmp-tmp -``` - -Run: - - - - -```shell -docker run \ - -p 9050:9050/udp -p 9050:9050/tcp \ - -v ./data:/app/data \ - -v ./mods:/app/mods \ - -v ./server_mods:/app/server_mods \ - -v ./saves:/app/saves \ - -v ./config.json:/app/config.json \ - --name wukongmp-server \ - ghcr.io/readycodeio/wukongmp-server:0.3.0 -``` - - - - -```yaml title="docker-compose.yml" -services: - server: - image: ghcr.io/readycodeio/wukongmp-server:0.3.0 - container_name: wukongmp-server - restart: unless-stopped - ports: - - "9050:9050/tcp" - - "9050:9050/udp" - volumes: - - ./data:/app/data - - ./mods:/app/mods - - ./server_mods:/app/server_mods - - ./saves:/app/saves - - ./config.json:/app/config.json -``` - - - - -:::important - -The image ships **without mods**. Copy `WukongMp.Sdk` and the mode you want (`WukongMp.PvP`, `WukongMp.Coop`) from the binary ZIP into your `mods/` volume before starting the container. -The same applies to server-side mods and the `server_mods` folder. +A Linux-based x64 Docker image is on the way for those who prefer containerized deployments. It is not published yet. For now, use the binary package above. ::: - -### Configuration - -Configuring the port is done by remapping the container ports in the `docker run` command or Docker Compose file. For example, to use port 9060 instead of 9050, change the ports section to: - -```yaml title="docker-compose.yml" -ports: - - "9060:9060/tcp" - - "9060:9060/udp" -``` \ No newline at end of file diff --git a/wukong-mp/docs/quick-start.mdx b/wukong-mp/docs/quick-start.mdx index 042a31d..8567ca4 100644 --- a/wukong-mp/docs/quick-start.mdx +++ b/wukong-mp/docs/quick-start.mdx @@ -14,19 +14,21 @@ Get a WukongMP server running in under 5 minutes. -[⬇ Download for Windows (x64, v0.2.4)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.2.4.zip) +[⬇ Download for Windows (x64, v0.3.0)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.3.0.zip) -[⬇ Download for Linux (x64, v0.2.4)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.2.4.zip) +[⬇ Download for Linux (x64, v0.3.0)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.3.0.zip) -```shell -docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 -``` +:::info[Coming soon] + +The Docker image is not published yet. For now, follow the Windows or Linux steps above. + +::: @@ -47,25 +49,6 @@ Extract the `.zip` to a folder of your choice. The server is self-contained — To change the port (default: `9050`), open `config.json` and edit `Server:Port`. - - - -Copy the config file from the image: - -```shell -docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.3.0 -docker cp wukongmp-tmp:/app/config.json ./config.json -docker rm wukongmp-tmp -``` - -Port configuration is handled by remapping the container ports — see step 3. - -:::important - -The image ships **without mods**. Before starting the container, download the binary package and copy `WukongMp.Sdk` and your chosen game mode mod (`WukongMp.PvP` or `WukongMp.Coop`) into your local `./mods/` folder. - -::: - @@ -87,40 +70,6 @@ Double-click `server.exe`, or run it from a terminal: chmod +x server && ./server ``` - - - -```shell -docker run \ - -p 9050:9050/udp -p 9050:9050/tcp \ - -v ./data:/app/data \ - -v ./mods:/app/mods \ - -v ./server_mods:/app/server_mods \ - -v ./saves:/app/saves \ - -v ./config.json:/app/config.json \ - --name wukongmp-server \ - ghcr.io/readycodeio/wukongmp-server:0.3.0 -``` - -Or with Docker Compose: - -```yaml title="docker-compose.yml" -services: - server: - image: ghcr.io/readycodeio/wukongmp-server:0.3.0 - container_name: wukongmp-server - restart: unless-stopped - ports: - - "9050:9050/tcp" - - "9050:9050/udp" - volumes: - - ./data:/app/data - - ./mods:/app/mods - - ./server_mods:/app/server_mods - - ./saves:/app/saves - - ./config.json:/app/config.json -``` - From 594f26973f50cc31ef7ce9f2c9d661e2ad9d2fe5 Mon Sep 17 00:00:00 2001 From: Jakub Janaszkiewicz Date: Wed, 12 Aug 2026 17:26:38 +0200 Subject: [PATCH 12/12] Add Chinese translation --- .../Development/APIs/custom-components.md | 76 +++++- .../docs/Development/Examples/swarm-mode.md | 2 +- .../current/docs/Development/custom-rpc.md | 106 ++++++--- .../docs/Development/getting-started.md | 6 +- .../docs/Server-development/_category_.json | 6 + .../docs/Server-development/archetypes.md | 153 ++++++++++++ .../docs/Server-development/custom-rpc.md | 125 ++++++++++ .../Server-development/getting-started.md | 218 ++++++++++++++++++ .../docs/Server-development/systems.md | 125 ++++++++++ .../current/docs/Server/admin-panel.mdx | 1 + .../current/docs/Server/installation.mdx | 124 ++++------ .../current/docs/Server/mod-management.md | 33 ++- .../current/docs/Server/network-stats.mdx | 97 ++++++++ .../current/docs/quick-start.mdx | 64 +---- 14 files changed, 968 insertions(+), 168 deletions(-) create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/_category_.json create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/archetypes.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/custom-rpc.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/getting-started.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/systems.md create mode 100644 i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/network-stats.mdx diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/APIs/custom-components.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/APIs/custom-components.md index 7561530..88b69f0 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/APIs/custom-components.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/APIs/custom-components.md @@ -1,11 +1,79 @@ # 自定义组件 -WukongMP SDK 允许在游戏中的实体上定义自定义数据组件。这些组件可以是从原始值到复杂结构的任何形式。 +WukongMP SDK 允许在游戏中的实体上定义自定义数据组件。**网络化组件**会在服务器和每个已连接客户端之间同步,因此两边看到的数值一致,而你不需要为它编写任何消息传递代码。 ---- +一个组件由两半组成。[服务器模组](../../Server-development/getting-started#registering-components-and-archetypes)注册它并把它挂到原型上,客户端模组也做同样的事,双方用的是共享项目中的同一份定义。本页讲的是客户端这一半。 -:::info[正在进行中] +## 声明组件 {#declaring-the-component} -此功能正在开发中,将在未来的 SDK 版本中提供。 +把组件放在客户端模组和服务器模组都引用的**共享项目**里。它是一个带 `[DeriveINetworkedComponent]` 特性的 `partial struct`,生成器会把每个私有字段变成公有属性,并生成序列化代码: + +```csharp title="ExampleMod.Common/BountyComponent.cs" +using System.Runtime.InteropServices; +using ReadyM.Api.Multiplayer.Generators; + +[DeriveINetworkedComponent] +[StructLayout(LayoutKind.Auto)] +public partial struct BountyComponent +{ + private int _kills; + private float _multiplier; +} +``` + +组件字段用到的任何类型也必须放在共享项目里,理由相同:两边绝不能对它的内存布局产生分歧。 + +## 在客户端注册 {#registering-it-on-the-client} + +在模组的 `Initialize` 中要做两件事:注册组件类型,以及注册一个把它挂到实体上的原型变更。 + +```csharp title="Mod.cs" +protected override void Initialize(IDependencyContainer services) +{ + services.Resolve().RegisterComponent(); + services.RegisterSingleton(); +} +``` + +[`IComponentApi.RegisterComponent`](../../../api-reference/WukongMp.Api/WukongMp.Api.IComponentApi) 把类型声明给网络层。原型变更则写在一个实现 [`IArchetypeRegistration`](../../../api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration) 的类中,SDK 会在构建 ECS 世界时调用它: + +```csharp title="BountyRegistration.cs" +using ReadyM.Api.ECS.Registry; +using ReadyM.Api.ECS.Worlds; +using WukongMp.Sdk.Api; + +public class BountyRegistration : IArchetypeRegistration +{ + public void Register(IArchetypeRegistry registry) + { + registry.ModifyArchetype(WukongApi.Archetypes.GlobalPlayerArchetype, b => b.Add()); + } +} +``` + +`WukongApi.Archetypes` 用来指定内置原型,与服务器 SDK 以静态成员形式在 `WukongArchetypes` 上暴露的是同一套。每个原型带有哪些组件、你的数据该放在哪一个上,请参见[原型与组件](../../Server-development/archetypes)。 + +:::note + +`WukongApi.Archetypes` 是 `WukongApi` 中唯一可以在 `Register` 内部安全使用的部分。它自身没有依赖项,而其他 API 会在 ECS 世界还在构建时把它重新拉回容器。 ::: + +注册是叠加式的,所以注册你自己的并不会顶替掉 SDK 的。`ModifyArchetype` 是挂到已有原型上;同一个接口上的 `RegisterArchetype` 则创建一个新原型,适用于你的模组要生成自己的实体种类的情况。 + +## 让两边保持一致 {#keeping-the-two-sides-in-step} + +组件 ID 是按位置分配的。它们按注册顺序编号,以一个字节的形式在网络上传输,并且在连接时不会重新协商。如果客户端和服务器注册了不同的组件,或者以不同顺序注册了相同的组件,这种不匹配不会被报告出来:接收方会从数据流中读出错误的组件。 + +实际操作中这并不难做对,只要你: + +* 把每个组件定义都放在共享项目里,这样内存布局不会漂移, +* 每一侧的组件注册都集中在一处,并保持相同顺序, +* 在两边把它们挂到相同的原型上, +* 把客户端模组和服务器模组作为同一个包的同一版本一起发布。 + +[模组模板](https://github.com/readycodeio/wukongmp-mod-template)就是围绕这一点组织的:`ExampleMod.Common` 存放组件,`ExampleMod` 注册客户端这一半,`ExampleMod.Serverside` 注册服务器这一半。 + +## 仅服务器的状态 {#server-only-state} + +如果客户端没有必要看到某个值,那么在客户端根本不需要为它准备组件。服务器 SDK 提供了[本地组件](../../Server-development/getting-started#local-components),用于永远不离开服务器的状态,而且它们不占用任何网络流量。一次性事件而非状态,请用 [RPC](../custom-rpc)。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/Examples/swarm-mode.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/Examples/swarm-mode.md index 36b141d..f442523 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/Examples/swarm-mode.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/Examples/swarm-mode.md @@ -70,7 +70,7 @@ mode](../../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Mu 请参阅 [RPC 文档](../custom-rpc),以了解在 RPC 类中你还能做些什么。 ```csharp title="自定义 RPC 类" -public partial class Rpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class Rpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestAll)] private void OnSwarmStarted(PlayerId __sender) diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/custom-rpc.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/custom-rpc.md index a5ed9c1..9fb6ae4 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/custom-rpc.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/custom-rpc.md @@ -4,20 +4,25 @@ sidebar_position: 5 # 自定义 RPC -WukongMP SDK 的核心功能之一是支持任意远程过程调用 (RPC) 函数。这些函数可以携带任意有效负载,并支持多种 -[中继模式](../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode)。 +WukongMP SDK 支持两种远程过程调用 (RPC) 消息: + +* **客户端中继 RPC**:由客户端发送,服务器把它转发给其他客户端。服务器不对这类消息作出反应,只负责转发。本页大部分内容讲的是这种 RPC。 +* **服务器 RPC**:由客户端发送给服务器,服务器运行你的服务器端逻辑,并可以回复。它的契约和服务器端处理程序在[服务器端开发](../Server-development/custom-rpc)中定义。本页讲的是如何处理服务器 RPC 的客户端一侧。 -RPC 处理程序允许你定义自己的事件,这些事件将发送给连接到同一服务器的其他玩家。 +## 客户端中继 RPC {#client-relayed-rpc} + +客户端中继 RPC 让你定义自己的事件,发送给连接到同一服务器的其他玩家,不涉及任何服务器端逻辑。这些事件可以携带任意有效负载,并支持多种 +[中继模式](../../api-reference/ReadyM.Api.Multiplayer.Protocol.Enums/ReadyM.Api.Multiplayer.Protocol.Enums.RelayMode)。 -## 声明一个 RPC 处理程序类 +### 声明一个 RPC 处理程序类 {#declaring-an-rpc-handler-class} 为了向你的模组添加自定义 RPC 过程,你必须定义一个 [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) 类,它继承自 -[RpcClassBase](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase)。 +[ClientRpcHandler](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ClientRpcHandler)。 ```csharp title="最简 RPC 类定义" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { // 在此处编写 RPC 处理器 } @@ -28,9 +33,18 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc 要注册任何 RPC 处理程序,类 **必须**被添加到 DI 容器中,在你的模组的 `Initialize` 方法中。请查阅 [ModBase](../../api-reference/WukongMp.Sdk/WukongMp.Sdk.ModBase) 的文档。 +```csharp +protected override void Initialize(IDependencyContainer services) +{ + services.RegisterSingleton(); +} +``` + ::: -## 定义 RPC 处理程序 +依赖项通过构造函数注入,所以需要日志记录器或其他服务的处理程序把它写成主构造函数参数即可:`public partial class MyRpc(ILogger logger) : ClientRpcHandler`。 + +### 定义 RPC 处理程序 {#defining-rpc-handlers} 为了向你的模组添加一个新的 RPC 处理程序,请添加一个带有 [RpcEvent](../../api-reference/ReadyM.Api.Multiplayer.Generators/ReadyM.Api.Multiplayer.Generators.RpcEventAttribute) @@ -39,7 +53,7 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc 方法名必须以“On...”开头——在同一个类中会自动为发送 RPC 生成相应的“Send...”方法。 ```csharp title="最简 RPC 处理器" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestOthers)] private void OnMyCustomCall() @@ -65,7 +79,7 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc | **GlobalOthers** | 消息已发送给服务器上的所有其他玩家 | | **GlobalAll** | 消息已发送给服务器上的所有玩家,包括发送者 | -## 正在发送数据 +### 发送数据 {#sending-data} RPC 处理程序支持在参数中传递数据,这些数据要么是: @@ -77,14 +91,14 @@ RPC 处理程序支持在参数中传递数据,这些数据要么是: 一个 RPC 处理程序可以按任意数量、任意顺序声明这些参数。生成的“Send...”方法将具有相同的参数(不包括注入的参数)。 -### 基本数据类型 +#### 基本数据类型 {#primitive-data-types} 我们支持在 C# 运行时定义的所有原始数据类型:`bool`、`char`、`sbyte`、`byte`、`short`、`ushort`、`int`、`uint`、`long`、`ulong`、`float`、`double`,以及 `string`。 ```csharp title="传递基本数据" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestOthers)] private void OnMyCustomCall(int number, string text) @@ -97,7 +111,7 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc } ``` -### 复杂数据类型 +#### 复杂数据类型 {#complex-data-types} 您可以在 RPC 参数中使用复杂的数据结构。这些数据结构必须实现 [INetSerializable](https://revenantx.github.io/LiteNetLib/api/LiteNetLib.Utils.INetSerializable.html) @@ -107,7 +121,7 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc [INetSerializable](https://revenantx.github.io/LiteNetLib/api/LiteNetLib.Utils.INetSerializable.html)。 ```csharp title="复杂 RPC 参数示例" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestOthers)] private void OnPlayerBuffed(BuffData payload) @@ -160,7 +174,7 @@ public struct BuffAddData(int buffId, float duration) : INetSerializable } ``` -### 特殊参数 +#### 特殊参数 {#special-parameters} 目前只能使用一个特殊参数。我们可能会在未来版本的 SDK 中扩展此功能。 @@ -171,7 +185,7 @@ public struct BuffAddData(int buffId, float duration) : INetSerializable 此参数可与其他参数一起使用,但在生成的“Send...”方法中不可见。 ```csharp title="使用注入的参数" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestOthers)] private void OnComplexEvent(int number, PlayerId __sender, BuffData buffData) @@ -188,26 +202,64 @@ public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : Rpc } ``` -## 在主线程执行回调 +### 线程 {#threading} -RPC 处理程序在单独的网络线程上执行,因此它们不应直接与游戏世界交互,因为这样做可能会导致崩溃。不过,你可以使用在你的 RPC 处理程序类中提供的 -[RunOnMainThread](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.RpcClassBase#-runonmainthreadaction) -方法,将回调安排在主线程上执行。 +消息到达时在单独的网络线程上,但 SDK 会在调用每个 `[RpcEvent]` 处理程序之前把它调度到游戏线程上。因此处理程序内部可以直接操作游戏世界,操作 Unreal Engine 对象不需要额外处理: -```csharp title="Running code on the main thread" -public partial class MyRpc(IRpcClient client, IRelaySerializer serializer) : RpcClassBase(client, serializer) +```csharp title="在处理程序中操作游戏世界" +public partial class MyRpc : ClientRpcHandler { [RpcEvent(RelayMode.AreaOfInterestAll)] private void OnDespawnAllMonsters() { - // destroying an Unreal Engine pawn must be done on the main thread - RunOnMainThread(() => + foreach (var monster in WukongApi.Sync.AreaTamers) + { + monster.Tamer?.CurrentRef.DestroyTamer(); // 调用 BGU_UnrealWorldUtil.DestroyActor + } + } +} +``` + +由于处理程序运行在游戏线程上,它们也共用游戏线程的时间预算。开销大的工作应该放到[系统](systems)里或后台任务上,而不是处理程序体内。 + +:::note + +这只适用于客户端中继 RPC。服务器 RPC 的响应处理程序**不会**被自动调度,见下文。 + +::: + +## 在客户端处理服务器 RPC {#handling-server-rpc-on-the-client} + +服务器 RPC 契约声明在服务器模组和客户端模组共享的公共项目中,描述了请求(客户端到服务器)和响应(服务器到客户端)两个方向的数据形状。它们的定义方式请见[服务器端开发](../Server-development/custom-rpc)。 + +在客户端,定义一个继承 +[ServerRpcClient](../../api-reference/ReadyM.Api.Multiplayer.RPC/ReadyM.Api.Multiplayer.RPC.ServerRpcClient) +的 [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) +类,用来向服务器发送请求并处理它的响应。这个类必须用 `[ServerRpcFor]` 标注它所实现的契约类,并且和客户端中继 RPC 一样,必须在模组的 `Initialize` 方法中注册。 + +与 `[RpcEvent]` 处理程序不同,这些方法是在解析响应时于网络线程上调用的。任何接触游戏世界的代码都要用 `RunOnGameThread` 包起来: + +```csharp title="客户端处理服务器 RPC" +[ServerRpcFor(typeof(ExampleRpcContracts))] +public partial class MyServerRpc : ServerRpcClient +{ + // 服务器响应我们的 ScaleBossHp 请求时调用 + partial void OnBossHpScaleConfirm(int scalingPercent, int players) + { + RunOnGameThread(() => { - foreach (var monster in WukongApi.Sync.AreaTamers) - { - monster.Tamer?.CurrentRef.DestroyTamer(); // calls BGU_UnrealWorldUtil.DestroyActor - } + WukongApi.Chat.ShowLocalMessage( + $"Boss HP is set to {scalingPercent}% and multiplied by {players} players.", + FLinearColor.Gray); }); } } ``` + +调用生成的 `Send...` 方法即可把请求发给服务器: + +```csharp +WukongApi.Services.Resolve().SendScaleBossHp(150); +``` + +只有共享契约中声明的方向会被生成:单向的客户端到服务器 RPC 在客户端没有 `On...` 处理程序桩,单向的服务器到客户端 RPC 没有 `Send...` 方法。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/getting-started.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/getting-started.md index 8a5ee04..ef91dda 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/getting-started.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Development/getting-started.md @@ -15,7 +15,7 @@ sidebar_position: 1 目前你可以开发对游戏事件、实体数据(玩家、敌人)有访问权限的模组,并且可以定义自定义命令和游戏逻辑系统。 -服务器端逻辑和自定义数据同步的支持正在推进中。 +模组也可以在服务器上运行逻辑,参见[服务器端开发](../Server-development/getting-started)。 请访问 [examples](/wukong-mp/category/mod-examples) 页面以获取灵感,或浏览 [co-op](https://github.com/readycodeio/WukongMP-co-op-mod) 与 @@ -28,5 +28,5 @@ sidebar_position: 1 | 控制台命令 API | :white_check_mark: [已完成](../Development/APIs/console-commands) | | 自定义 RPC | :white_check_mark: [已完成](../Development/custom-rpc) | | 保存文件 API | :construction: [部分](../Development/APIs/save-file-management) | -| 自定义数据同步 | :soon: [进行中](../Development/APIs/custom-components) | -| 服务器端模组 | :soon: 进行中 | +| 自定义数据同步 | :white_check_mark: [已完成](../Development/APIs/custom-components) | +| 服务器端模组 | :white_check_mark: [已完成](../Server-development/getting-started) | diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/_category_.json b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/_category_.json new file mode 100644 index 0000000..211a8ce --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/_category_.json @@ -0,0 +1,6 @@ +{ + "collapsible": true, + "collapsed": false, + "position": 5, + "label": "服务器端开发" +} diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/archetypes.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/archetypes.md new file mode 100644 index 0000000..0f656fd --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/archetypes.md @@ -0,0 +1,153 @@ +--- +sidebar_position: 4 +--- + +# 原型与组件 + +**原型**是一个实体创建时所带的固定组件集合。WukongMP 提供了四个内置原型,你的服务器模组可以查询和扩展它们: + +- **区域**实体(每个活动区域一个), +- **全局玩家实体**(每个已连接玩家一个), +- **驯化目标**(世界中的敌人), +- **主角**(玩家在世界中的角色)。 + +它们由 [WukongArchetypes](../../api-reference/WukongMp.Sdk.Serverside/WukongMp.Sdk.Serverside.WukongArchetypes) 命名,这是一个把每个原型映射到其 [ArchetypeId](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.ArchetypeId) 的小类: + +```csharp +// WukongArchetypes.AreaArchetype +// WukongArchetypes.GlobalPlayerArchetype +// WukongArchetypes.TamerArchetype +// WukongArchetypes.MainCharacterArchetype +``` + +这些成员是静态的,所以不需要解析或构造任何东西。客户端 SDK 通过 [`WukongApi.Archetypes`](../../api-reference/WukongMp.Sdk.Api.Implementation/WukongMp.Sdk.Api.Implementation.WukongArchetypes) 暴露同一套原型,客户端模组注册网络化组件的那一半时就用它来指定同一个原型。 + +:::danger[不要硬编码原型 ID] + +这些属性背后的数字 ID 是当前版本的实现细节,将来会变。不要硬编码它们,而应该通过 `WukongArchetypes` 访问。 + +::: + +在模组的 `Init` 中把你自己的组件挂到其中任意一个上,做法与[快速上手](getting-started#registering-components-and-archetypes)中的示例相同。下面的表格列出了每个原型已经带有的组件,方便你知道有哪些可供查询。 + +:::warning[访问 API 是临时的] + +目前你通过底层的 [`EcsApi`](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi) 读写这些组件(原始的 `Query` 调用和 `ref` 组件访问)。这在 `0.3.0` 中是刻意保持简陋的。我们计划提供一套更高层、不那么原始的服务器 API,所以请预期访问实体数据的方式在后续版本中会有变化。 + +::: + +## 区域实体 {#area-entity} + +每个活动区域一个实体,承载属于该区域而非属于其中任何玩家的状态。 + +:::info[什么是区域?] + +在《黑神话:悟空》中,区域是一张已加载的地图。每个主线章节有一个,每个隐藏 Boss 地点或竞技场也各有一个,等等。如果需要经过加载画面,那就是在切换区域。 + +::: + +房间规则就存放在这里,所以需要知道是否允许作弊、或者某段过场动画是否已经播放过的系统,会在这里读取。 + +| 组件 | 说明 | +| --- | --- | +| [`AreaScopeComponent`](../../api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.AreaScopeComponent) | 该实体所属的 `AreaId`。 | +| [`RoomComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.RoomComponent) | 房间配置:关卡、锦标赛回合数,是否允许葫芦、消耗品、定身、旋风冲刺、聊天和作弊,以及对战中生成敌人所对应的 NG+ 等级。 | +| [`MovieComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MovieComponent) | 本区域内哪些过场动画已开始、哪些已结束。 | + +`AreaScopeComponent` 是每个区域范围实体都会匹配到的组件。把它和你自己的组件配对,就是把查询限定到单个区域的方式,SDK 自己的过场动画处理程序就是这么做的。 + +## 全局玩家实体 {#global-player-entity} + +每个已连接玩家一个实体。它在整个会话期间存在,与玩家身处哪个区域无关,是挂载**需要持久保存、以玩家为范围**的数据的合适位置。玩家通过该实体上的 [`PlayerId`](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId) 来标识。 + +| 组件 | 说明 | +| --- | --- | +| [`PlayerScopeComponent`](../../api-reference/ReadyM.Api.Multiplayer.ECS.Components/ReadyM.Api.Multiplayer.ECS.Components.PlayerScopeComponent) | 所属玩家的 `PlayerId`。 | +| [`PlayerComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PlayerComponent) | 持久保存的昵称和玩家的队伍 ID。 | + +模组注册的“全局”玩家组件就是挂到这个原型上的。 + +## 驯化目标 {#tamer} + +驯化目标是敌人实体:从四处游荡的小怪到 Boss 都算。它属于区域范围,因此在区域活动期间存在,并在最后一名玩家离开时随区域一同销毁。 + +| 组件 | 说明 | +| --- | --- | +| [`TamerComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TamerComponent) | 该驯化目标的 GUID 和单位路径、是否为 Boss 或精英、其逻辑是否已暂停,以及哪些玩家正让它保持生成状态。 | +| [`TransformComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent) | 世界位置与旋转。 | +| [`HpComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent) | 当前 HP、基础最大 HP、最大 HP 的百分比乘数,以及死亡状态。 | +| [`NicknameComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent) | 显示名称。在对战中用于在头顶显示“Bot”。 | +| [`TeamComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent) | 底层游戏 actor 的队伍 ID。 | +| [`AnimationComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.AnimationComponent) | 移动动画状态:速度、加速度和移动速度档位。 | +| [`MonsterAnimationComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MonsterAnimationComponent) | 移动 AI 类型和动画播放速率。 | + +## 主角 {#main-character} + +玩家在世界中的角色:一个**区域范围**的实体,在玩家处于某个区域期间存在。它承载角色的实时状态,并通过相同的 `PlayerId` 与全局玩家实体关联。 + +跨区域时该实体会被销毁并重新创建,所以不要把需要持久保存的数据放在这里。 + +| 组件 | 说明 | +| --- | --- | +| [`MainCharacterComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.MainCharacterComponent) | 所属 `PlayerId`,以及角色的实时状态:移动、动画标志、变身、观战状态、复活点、属性和装备。 | +| [`TransformComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TransformComponent) | 世界位置与旋转。 | +| [`HpComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.HpComponent) | 当前 HP、基础最大 HP、最大 HP 的百分比乘数,以及死亡状态。 | +| [`NicknameComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.NicknameComponent) | 玩家的显示名称,在切换区域时从 `PlayerComponent` 复制而来。 | +| [`TeamComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.TeamComponent) | 底层游戏 actor 的队伍 ID。 | +| [`PvPComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvPComponent) | 玩家是否已准备好进行对战。 | + +当你需要按玩家区分的数据时,`MainCharacterComponent` 就是要配对的那个组件,因为它是在世界中携带 `PlayerId` 的组件。服务器模组里几乎每个查询都从它开始。 + +以上全部都是游戏自带的网络化组件,定义在 `ReadyM.Wukong.Common` 中。 + +:::note[对战状态] + +对战模组另外添加了第五个全局原型,其中只有一个 [`PvpStateComponent`](../../api-reference/ReadyM.Wukong.Common.ECS.Components/ReadyM.Wukong.Common.ECS.Components.PvpStateComponent),承载比赛设置和回合状态。`WukongArchetypes.PvpStateArchetype` 仍然为它命名,但已标记为过时,并将迁移进对战模组,所以请把它当作对战模组内部的东西,而不是 SDK 对外接口的一部分。 + +::: + +## 注册你自己的原型 {#registering-your-own-archetype} + +除了扩展内置原型,模组还可以用 `RegisterArchetype` 注册一个全新的原型。先在 `RegisterComponents` 中注册你的组件,然后在 `Init` 中构建原型,并保留返回的 `ArchetypeId`,以便之后用它创建实体。 + +```csharp title="注册一个新原型,并给已有原型挂上一个组件" +public class Mod : ServerModBase +{ + public static ArchetypeId ShrineArchetype { get; private set; } + + protected override void RegisterComponents(IComponentRegistry registry) + { + // 组件必须先注册,任何原型才能使用它。 + // 服务器专有状态用 RegisterLocalComponent,需要同步的用 RegisterComponent。 + registry.RegisterLocalComponent(); + registry.RegisterComponent(); + } + + protected override void Init() + { + var registry = Services.Resolve(); + + // 一个全新的原型:一个游戏自带组件加上一个我们自己的组件。 + ShrineArchetype = registry.RegisterArchetype(b => b + .Add() + .Add()); + + // 也可以改为给内置原型挂上一个组件。 + registry.ModifyArchetype(WukongArchetypes.GlobalPlayerArchetype, b => b.Add()); + } +} +``` + +两个调用都接受一个构建器,其中 `Add()` 在原型上声明一个组件。游戏自带的组件按类型解析,所以你可以自由地把它们和自己的组件混用。 + +拿到 `ArchetypeId` 之后,通过 `EcsApi` 用它创建实体: + +```csharp +var entity = ecsApi.CreateEntity(Mod.ShrineArchetype); +``` + +:::important + +你的模组注册的原型也必须在客户端注册,顺序相同、组件集合相同,否则两边对该原型的实体包含什么会产生分歧。请在客户端把原型注册集中在一个 [`IArchetypeRegistration`](../../api-reference/ReadyM.Api.ECS.Registry/ReadyM.Api.ECS.Registry.IArchetypeRegistration) 中,这样顺序一目了然,也容易保持一致。参见[自定义组件](../Development/APIs/custom-components)。 + +::: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/custom-rpc.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/custom-rpc.md new file mode 100644 index 0000000..6f0d303 --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/custom-rpc.md @@ -0,0 +1,125 @@ +--- +sidebar_position: 3 +--- + +# 自定义 RPC + +服务器 RPC 让客户端向服务器发送请求,并可以选择接收响应。与[客户端中继 RPC](../Development/custom-rpc#client-relayed-rpc) 不同,服务器总是先运行你的代码:由它决定是否回复以及如何回复。 + +服务器 RPC 只定义一次,作为服务器模组和客户端模组共享的**契约**,放在两者都引用的公共项目中。契约声明消息每个方向的数据形状。服务器模组实现处理程序,客户端模组实现响应处理程序,后者在[在客户端处理服务器 RPC](../Development/custom-rpc#handling-server-rpc-on-the-client) 中说明。 + +## 声明契约 {#declaring-a-contract} + +契约是一个带 `[ServerRpcContracts]` 特性的 [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) 静态类,每个 RPC 对应其中一个分部方法。每个方法必须标注 `[ClientToServer]`、`[ServerToClient]` 或两者,用来声明它承载哪个(哪些)方向: + +```csharp title="包含一个单向推送和一对请求/响应的契约" +using ReadyM.Api.Multiplayer; + +[ServerRpcContracts] +public static partial class RpcContracts +{ + // 单向推送:只有服务器可以发送 + [ServerToClient] public static partial void BeguilingChant(byte state); + + // 请求/响应:两个方向可以有不同的负载,因为它们 + // 声明为两个独立的重载 + [ClientToServer] public static partial void ScaleBossHp(int scalingPercent); + [ServerToClient] public static partial void BossHpScaleConfirm(int scalingPercent, int players); +} +``` + +* 只带 `[ClientToServer]` 的方法是单向命令:客户端发送,服务器处理,没有回复。 +* 只带 `[ServerToClient]` 的方法是单向推送:只有服务器可以发送。 +* 同名的两个重载,各带一个特性,构成一对请求/响应。它们的负载不需要一致。 +* 同时带**两个**特性的单个方法是对称的双向消息,共用一种负载形状。 + +参数遵循与[客户端中继 RPC](../Development/custom-rpc#sending-data) 相同的规则:基本类型或带 `[DeriveINetSerializable]` 的结构体。 + +:::important + +契约项目会被服务器模组和客户端模组同时引用,两边都从其中读取线路编码。请一起重新编译并一起发布,否则两边对某个编码的含义会产生分歧。 + +::: + +## 声明服务器端处理程序 {#declaring-server-side-handlers} + +在一个继承 [ServerRpcHandlersBase](../../api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.ServerRpcHandlersBase) 的 [partial](https://learn.microsoft.com/dotnet/csharp/programming-guide/classes-and-structs/partial-classes-and-methods) 类中实现契约的服务器一侧,并用 `[ServerRpcFor]` 标注它所实现的契约类。对该契约的每个 `[ClientToServer]` 方向,定义一个对应的 `On...` 分部方法。SDK 会为每个 `[ServerToClient]` 方向生成相应的 `Send...` 方法。 + +```csharp title="服务器端 RPC 处理程序" +[ServerRpcFor(typeof(RpcContracts))] +public partial class RpcHandlers(ScaleHpSystem hpScaling, EcsApi ecs) : ServerRpcHandlersBase +{ + partial void OnScaleBossHp(RpcContext context, int scalingPercent) + { + hpScaling.ScalingPercent = scalingPercent; + + var players = 0; + ecs.Query(ref players, static (ref _, ref players) => { players++; }); + + // 该设置影响整个服务器,所以向所有人确认 + ecs.Query((ref player) => + { + // 由 SDK 生成 + SendBossHpScaleConfirm(player.PlayerId, scalingPercent, players); + }); + } +} +``` + +[RpcContext](../../api-reference/ReadyM.Relay.Server.Sdk.Rpc/ReadyM.Relay.Server.Sdk.Rpc.RpcContext) 参数总是作为第一个参数注入,它暴露 `Sender`,即发送该请求的客户端的 [PlayerId](../../api-reference/ReadyM.Api.Idents/ReadyM.Api.Idents.PlayerId)。生成的 `Send...` 方法以一个 `PlayerId` 收件人作为第一个参数,后面才是响应负载。没有广播重载:要发给每个玩家,就像上面那样查询主角实体并逐个发送。 + +### 把类绑定到它的契约 {#binding-a-class-to-its-contract} + +[`[ServerRpcFor]`](../../api-reference/ReadyM.Api.Multiplayer/ReadyM.Api.Multiplayer.ServerRpcForAttribute) 在每个服务器处理程序类和客户端 RPC 类上都是**必需的**,参数是它所实现的 `[ServerRpcContracts]` 类。你的模组可能直接或通过一连串共享项目引用了多个契约集合,而这个特性就是告诉生成器该针对哪一个生成代码。 + +只有被指定的契约类所声明的方向会被生成,因此一个类恰好实现一个契约集合。如果你有多个契约类,就给每个类配一个自己的处理程序类: + +```csharp title="每个契约集合一个处理程序类" +[ServerRpcFor(typeof(BossContracts))] +public partial class BossRpc(EcsApi ecs) : ServerRpcHandlersBase { /* 只有 boss 相关的方向 */ } + +[ServerRpcFor(typeof(ArenaContracts))] +public partial class ArenaRpc(EcsApi ecs) : ServerRpcHandlersBase { /* 只有 arena 相关的方向 */ } +``` + +省略该特性是编译错误(`SRPC004`),指定一个没有 `[ServerRpcContracts]` 标注的类也是编译错误(`SRPC005`)。 + +:::important + +要让任何 RPC 处理程序被注册,该类**必须**在模组的 `Init` 方法中加入依赖注入容器。 + +```csharp +protected override void Init() +{ + Services.RegisterSingleton(); +} +``` + +::: + +## 只回复发送者 {#replying-to-just-the-sender} + +当响应只对发起请求的那个客户端有意义时,把发送者和你即将读取的实体对应起来。把你自己的组件与 `MainCharacterComponent` 配对,就能拿到用于比较的 `PlayerId`: + +```csharp title="只回答一个玩家" +partial void OnGetBounty(RpcContext context) +{ + ecs.Query((ref main, ref bounty) => + { + if (main.PlayerId == context.Sender) + { + SendGetBounty(context.Sender, bounty.Kills); + } + }); +} +``` + +客户端只能请求服务器代表它自己行事,但没有任何机制阻止一个畸形或恶意的请求指向别人的实体,或者传入超出范围的值。在修改实体之前,务必用 `context.Sender` 核对你即将修改的实体,并在应用负载之前校验它。 + +## 处理程序运行在网络线程上 {#handlers-run-on-the-network-thread} + +`On...` 方法是在解析数据包时于网络线程上调用的,而不是在服务器 tick 上。在处理程序中通过 `EcsApi` 读写组件是受支持的,但耗时较长的工作不行:那会阻塞所有客户端的数据包处理。如果响应依赖只有系统才能得出的状态,就把请求保存下来,让系统去处理,做法见[游戏系统](systems#systems-and-rpc-handlers-together)。 + +## 客户端一侧 {#client-side} + +如何从客户端模组发送请求并处理响应,请见[在客户端处理服务器 RPC](../Development/custom-rpc#handling-server-rpc-on-the-client)。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/getting-started.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/getting-started.md new file mode 100644 index 0000000..3cd5bfb --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/getting-started.md @@ -0,0 +1,218 @@ +--- +sidebar_position: 1 +--- + +# 快速上手 + +服务器端模组运行在 WukongMP 中继服务器内部。它们可以注册自己的网络化组件、把组件挂到已有的原型上、在服务器 tick 上运行游戏系统,以及处理客户端发来的 RPC。 + +服务器端模组是一个引用了服务器 SDK 的 .NET 类库,其中定义一个继承 [ServerModBase](../../api-reference/ReadyM.Relay.Server.Sdk/ReadyM.Relay.Server.Sdk.ServerModBase) 的类。它的程序集直接放在服务器的 [`server_mods/` 目录](../Server/mod-management#server-side-mods)中,这与面向客户端的 `mods/` 文件夹是两个不同的位置。服务器启动时,模组加载器会在那里找到它并实例化该类。 + +```csharp title="最简服务器模组类" +using ReadyM.Relay.Server.Sdk; +using ReadyM.Relay.Server.Sdk.Ecs.Components; + +public class MyServerMod : ServerModBase +{ + protected override void RegisterComponents(IComponentRegistry registry) + { + // 在此注册你的自定义组件 + } + + protected override void Init() + { + // 在此注册系统、RPC 处理程序,以及修改原型 + } +} +``` + +`RegisterComponents` 最先执行,在服务器的 ECS 架构定型之前。这是唯一可以注册新网络化组件的地方。`Init` 随后执行,你在这里解析服务、注册[系统](systems)和 [RPC 处理程序](custom-rpc),并把组件挂到原型上。 + +:::tip[从已发布的模组中学习] + +[联机合作模组](https://github.com/readycodeio/WukongMP-co-op-mod)基于这套 SDK 构建,并随服务器一同分发。它的 `WukongMp.Coop.Serverside` 项目是这几页内容的一个小而完整的示例:两个系统、一个 RPC 处理程序,以及一个共享契约项目。[对战模组](https://github.com/readycodeio/WukongMP-PvP-mod)还没有改用服务器端功能。 + +::: + +## 建立项目 {#setting-up-the-project} + +服务器端模组的目标框架是 `net10.0`,而客户端模组是 `netstandard2.0`。它引用服务器 SDK 和共享的 WukongMP 程序集,这些都随服务器包一同分发。请使用[模组模板](https://github.com/readycodeio/wukongmp-mod-template)开始创建服务器端模组。 + +:::note + +服务器模组运行在 CoreCLR 上,而不是在 AOT 编译的服务器二进制文件内部,因此运行服务器的机器需要安装 .NET 10 运行时。参见[系统要求](../Server/installation)。 + +::: + +一个功能完整的模组通常包含**三个项目**: + +* 一个 `netstandard2.0` 的共享项目,存放类型定义和 RPC 契约。 +* 一个服务器端模组,目标框架 `net10.0`,引用共享项目。 +* 一个客户端模组,目标框架 `netstandard2.0`,引用共享项目。 + +共享项目的目标框架是 `netstandard2.0`,这样另外两个项目都能引用它。在模板中,它引用 SDK 程序集时带上了 `Private="false"`,这样 `netstandard2.0` 的构建产物就不会进入服务器模组的输出目录,因为那里必须由 `net10.0` 的构建产物胜出。正是这种区分,让模板带了两个依赖文件夹:`Dependencies/SDK` 存放 `netstandard2.0` 程序集,`Dependencies/ServerSDK` 存放 `net10.0` 程序集。 + +## 注册组件与原型 {#registering-components-and-archetypes} + +**网络化组件**会在服务器和每个已连接客户端之间同步。它声明为带 `[DeriveINetworkedComponent]` 特性的 `partial struct`,放在共享项目中,这样服务器模组和客户端模组编译时用的是同一份定义。生成器会把每个私有字段变成公有属性,并生成序列化代码: + +```csharp title="一个网络化组件(位于共享项目中)" +using System.Runtime.InteropServices; +using ReadyM.Api.Multiplayer.Generators; + +[DeriveINetworkedComponent] +[StructLayout(LayoutKind.Auto)] +public partial struct BountyComponent +{ + private int _kills; + private float _multiplier; +} +``` + +在 `RegisterComponents` 中注册它,然后在 `Init` 中把它挂到原型上: + +```csharp title="注册组件并挂到全局玩家原型上" +public class MyServerMod : ServerModBase +{ + protected override void RegisterComponents(IComponentRegistry registry) + { + registry.RegisterComponent(); + } + + protected override void Init() + { + var registry = Services.Resolve(); + + registry.ModifyArchetype(WukongArchetypes.GlobalPlayerArchetype, archetype => + { + archetype.Add(); + }); + } +} +``` + +累计击杀数是需要持久保存、以玩家为范围的数据,所以它属于**全局玩家实体**:每个已连接玩家一个实体,在整个会话期间存在,与玩家身处哪个区域无关。描述角色在世界中存在状态的数据(位置、HP、队伍)则应该放在主角实体上。每个原型都带有哪些组件,请参见[原型与组件](archetypes)。 + +## 在客户端对应起来 {#matching-it-up-on-the-client} + +两边是对称的。服务器模组注册和挂载了什么,客户端模组就以同样的方式注册和挂载,随后数值就会双向同步。在客户端模组的 `Initialize` 中: + +```csharp title="同一个组件的客户端一半" +protected override void Initialize(IDependencyContainer services) +{ + services.Resolve().RegisterComponent(); + services.RegisterSingleton(); +} +``` + +```csharp title="BountyRegistration.cs" +public class BountyRegistration : IArchetypeRegistration +{ + public void Register(IArchetypeRegistry registry) + { + registry.ModifyArchetype(WukongApi.Archetypes.GlobalPlayerArchetype, b => b.Add()); + } +} +``` + +客户端一侧的完整说明请见[自定义组件](../Development/APIs/custom-components)。 + +:::important + +两边必须完全一致。注册相同的组件、以相同的顺序注册,并在两边挂到相同的原型上。组件 ID 是按位置分配的,按注册顺序编号,并以一个字节的形式在网络上传输,因此不匹配时不会报错,而是会把数据流读错。 + +实用原则:把组件定义放在共享项目里,每一侧的注册都集中在一处,并且把客户端模组和服务器模组作为同一个包的同一版本一起发布。 + +::: + +## 本地组件 {#local-components} + +**本地组件**是挂在实体上的服务器端状态,不参与任何同步。它就是一个实现 `IComponent` 的普通 `struct`: + +```csharp title="一个本地组件" +public struct CooldownComponent : IComponent +{ + public float RemainingSeconds; +} +``` + +用 `RegisterLocalComponent` 而不是 `RegisterComponent` 来注册它,挂到原型上的方式完全相同: + +```csharp title="注册一个本地组件" +protected override void RegisterComponents(IComponentRegistry registry) +{ + registry.RegisterLocalComponent(); +} + +protected override void Init() +{ + var registry = Services.Resolve(); + + registry.ModifyArchetype(WukongArchetypes.MainCharacterArchetype, a => a.Add()); +} +``` + +之后它的行为和任何其他组件一样:会出现在 `Query` 中,你通过 `ref` 读写它,它随实体一同创建和销毁。它只是永远不会离开服务器,所以在客户端模组里不需要对应的一半,也不占用任何网络流量。 + +只要客户端没有必要看到某个值,就用本地组件:计时器、冷却、作弊记录,以及系统每 tick 重建的中间状态。客户端需要渲染或需要作出反应的一切,则应该放在网络化组件里;如果那是一次性事件而不是状态,就用 [RPC](custom-rpc)。 + +:::note + +每个组件最大 256 字节,本地组件和网络化组件都一样,而且服务器的组件槽位数量是固定的。超出任何一个限制时,注册都会明确报错。 + +::: + +## 读写实体数据 {#reading-and-writing-entity-data} + +在模组内部,用 [EcsApi](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi)(通过 `Services.Resolve()` 解析,或注入到你的类中)来查询和修改实体。每次调用会遍历每个匹配的实体一次,所请求的组件以引用方式传入: + +```csharp title="查询实体" +ecsApi.Query((ref bounty) => +{ + bounty.Kills += 1; +}); +``` + +`Query` 的重载最多可以同时接受六个组件类型,只有同时带有全部这些组件的实体才会被遍历。把某个组件和 `MainCharacterComponent` 配对,是访问玩家所属实体的常用做法: + +```csharp title="同时查询两个组件" +ecsApi.Query((ref main, ref hp) => +{ + if (hp.IsDead) + { + logger.LogDebug("Player {PlayerId} is down", main.PlayerId); + } +}); +``` + +每个重载还有一个把 `ref` 状态值贯穿回调的变体。当你需要累加结果时用它,因为这样回调可以保持 `static`,避免每 tick 都分配一个闭包: + +```csharp title="用 ref 状态计数" +var alive = 0; +ecsApi.Query(ref alive, static (ref hp, ref alive) => +{ + if (!hp.IsDead) + alive++; +}); +``` + +来自服务器模组的写入具有权威性:SDK 会把它们标记为服务器写入,因此你的模组对某个有归属的组件所做的修改会同步回归属客户端,而不会被客户端覆盖。 + +:::warning[已知问题] + +当前版本存在一个已知问题:覆盖客户端每帧都会修改的数据(例如位置)通常不会生效。 + +**这将在 SDK 的后续更新中解决。** 目前请改用 RPC 来更新这类组件。举例来说,不要试图在服务器端的查询中设置 `TransformComponent.Position` 来传送玩家,而应该发送一个 RPC,让客户端执行传送逻辑。 + +::: + +## 功能状态 {#feature-status} + +| 功能 | 状态 | +|---|---| +| 网络化组件 | :white_check_mark: [已完成](#registering-components-and-archetypes) | +| 本地组件 | :white_check_mark: [已完成](#local-components) | +| 游戏系统 | :white_check_mark: [已完成](systems) | +| 服务器 RPC | :white_check_mark: [已完成](custom-rpc) | +| 更高层的实体 API | :soon: 计划中,参见[原型与组件](archetypes)中的说明 | +| 服务器模组清单 | :soon: 0.3.0 中未使用 | diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/systems.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/systems.md new file mode 100644 index 0000000..b6d60be --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server-development/systems.md @@ -0,0 +1,125 @@ +--- +sidebar_position: 2 +--- + +# 游戏系统 + +和客户端一样,服务器 SDK 也提供**系统**:暴露一个 tick 方法、在服务器自己的更新循环上运行的类。凡是应该在服务器上持续运行、不依赖某一次 RPC 调用的逻辑都适合放在这里。计时器、周期性的世界状态检查,以及根据在线玩家数量调整的缩放规则,都属于这一类。 + +## 声明系统 {#declaring-systems} + +服务器端系统继承 [ModSystemBase](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase) 并重写 `OnUpdate`: + +```csharp title="最简服务器系统示例" +public class MySystem : ModSystemBase +{ + protected override void OnUpdate(UpdateTick tick) + { + // 每个服务器 tick 都会执行 + } +} +``` + +传给 `OnUpdate` 的 [UpdateTick](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs.Systems/ReadyM.Relay.Server.Sdk.Ecs.Systems.ModSystemBase.UpdateTick) 提供 `deltaTime`(距上一个 tick 的秒数)和 `time`(服务器启动以来的秒数)。 + +:::important + +与客户端系统不同,服务器端系统**不会**被自动发现。请在模组的 `Init` 方法中逐个显式注册: + +```csharp +protected override void Init() +{ + Services.RegisterSystem(); +} +``` + +::: + +你可以通过构造函数注入依赖项,例如 [EcsApi](../../api-reference/ReadyM.Relay.Server.Sdk.Ecs/ReadyM.Relay.Server.Sdk.Ecs.EcsApi) 或日志记录器,方式和从依赖注入容器解析的任何其他服务一样。 + +```csharp title="带依赖项的系统" +public class BountySystem(EcsApi ecs, ILogger logger) : ModSystemBase +{ + protected override void OnUpdate(UpdateTick tick) + { + ecs.Query((ref bounty) => + { + bounty.Multiplier = 1f + bounty.Kills * 0.05f; + }); + } +} +``` + +## 响应玩家数量 {#reacting-to-player-count} + +用系统而不是 RPC 处理程序,最常见的理由是:答案取决于整个世界的状态,而不是某个客户端的请求。按在线玩家数量缩放 Boss 血量就是一个已发布的例子,取自联机合作模组: + +```csharp title="按玩家数量缩放精英与 Boss 的 HP" +public class ScaleHpSystem(EcsApi ecs, ILogger logger) : ModSystemBase +{ + // 由 RPC 处理程序在网络线程上写入,在这里由服务器循环读取 + public int ScalingPercent { get { ... } set { ... } } + + protected override void OnUpdate(UpdateTick tick) + { + // 统计服务器上的所有玩家,而不只是本区域内的玩家 + var players = 0; + ecs.Query(ref players, static (ref _, ref players) => { players++; }); + + if (players == 0) return; + + var targetScalingPercent = ScalingPercent * players; + + ecs.Query((ref tamer, ref hp) => + { + if (!tamer.IsBossOrElite) + return; // 不缩放普通敌人 + + if (hp is { HpMaxBase: 0, Hp: 0 }) + return; // 尚未生成的怪物没有可缩放的 HP + + var currentMultPercent = hp.HpMaxMulPercent == 0 ? 100 : hp.HpMaxMulPercent; + if (targetScalingPercent != currentMultPercent) + { + hp.Hp *= (float)targetScalingPercent / currentMultPercent; + hp.HpMaxMulPercent = targetScalingPercent; + } + }); + } +} +``` + +请留意这个系统的写法:它每 tick 读取世界状态,与自己已经应用过的值比较,只有两者不一致时才写入。无条件写入的系统会在每个 tick 向每个客户端发送一次组件增量,这会立刻体现为[网络统计](../Server/network-stats)里的出站流量。 + +## 系统与 RPC 处理程序配合 {#systems-and-rpc-handlers-together} + +`RegisterSystem` 同时会让该系统可以从容器解析,因此 [RPC 处理程序](custom-rpc)可以把它作为构造函数依赖项。面向客户端的设置就是这样传到系统里的:处理程序负责校验并保存,系统负责执行。 + +```csharp title="配置系统的处理程序" +protected override void Init() +{ + Services.RegisterSystem(); + Services.RegisterSingleton(); +} +``` + +```csharp +[ServerRpcFor(typeof(RpcContracts))] +public partial class RpcHandlers(ScaleHpSystem hpScaling) : ServerRpcHandlersBase +{ + partial void OnScaleBossHp(RpcContext context, int scalingPercent) + { + hpScaling.ScalingPercent = scalingPercent; + } +} +``` + +:::warning + +RPC 处理程序运行在网络线程上,而系统在服务器循环上 tick。凡是处理程序写入、系统读取的字段都应当视为共享状态:把它限制为一个可以安全地被读到中间值的单一数值,或者用 `Volatile` 访问器或锁保护它。 + +::: + +## 系统的开销 {#cost-of-a-system} + +你的模组注册的每个系统都在服务器的系统根更新中运行,而这正是[网络统计](../Server/network-stats)里 **服务器 tick 耗时** 图表所测量的对象。一个用定时器扫描全部实体、而不是对变化作出反应的系统,通常就是 p99 上升而 p50 平稳的原因。要判断是不是你的系统在吃掉 tick 时间,那一页是最快的办法。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/admin-panel.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/admin-panel.mdx index 1cc10c4..54c523b 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/admin-panel.mdx +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/admin-panel.mdx @@ -47,6 +47,7 @@ alt="管理面板终端" /> 管理面板提供以下视图: * **终端** - 查看服务器状态、在线玩家、运行时间和实时日志。 +* **Network** - 查看实时中继流量、服务器 tick 耗时,以及按组件细分的同步数据量。参见[网络统计](./network-stats)。 * **Players** - 查看自服务器上线以来曾连接过的玩家列表,以及他们的首次和最后访问日期。 * **模组** - 查看服务器上当前安装的模组列表。 * **管理员** - 查看服务器管理员列表、添加新的管理员,以及管理他们的权限。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/installation.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/installation.mdx index e1542ed..1c1746c 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/installation.mdx +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/installation.mdx @@ -11,7 +11,45 @@ import TabItem from '@theme/TabItem'; WukongMP 服务器当前以以下格式分发: - 二进制软件包 -- [Docker 镜像](#docker) +- [Docker 镜像](#docker)(即将推出) + + + +## 系统要求 + +服务器二进制文件本身是自包含的,但[服务器端模组](../Server-development/getting-started)运行在 CoreCLR 上,而服务器在启动时就会启动它。这意味着这台机器上必须安装 [**.NET 10 运行时**](https://dotnet.microsoft.com/download/dotnet/10.0),即使你并不打算安装任何自己的模组。装 `dotnet-runtime-10.0` 包就够了,不需要 SDK。 + + + + +[官方安装程序](https://dotnet.microsoft.com/download/dotnet/10.0)会把运行时装到服务器预期的位置,所以不需要再做别的。 + + + + +用你的包管理器安装,或者用微软的[安装脚本](https://learn.microsoft.com/dotnet/core/install/linux-scripted-manual#scripted-install)。服务器会按以下顺序在常见位置查找运行时: + +1. `/usr/lib/dotnet`(Debian 与 Ubuntu 的软件包) +2. `/usr/lib64/dotnet`(Fedora 与 RHEL) +3. `/usr/share/dotnet`(微软的软件包和安装脚本) +4. `~/.dotnet` + +只有确实包含 `host/fxr` 的目录才算有效,所以卸载后残留的目录不会造成干扰。如果你的运行时装在别处,请用 `DOTNET_ROOT` 指向它: + +```shell +DOTNET_ROOT=/opt/dotnet ./server +``` + +用 `dotnet --info | grep 'Base Path'` 可以查看你的运行时在哪里。 + + + + +:::note + +如果缺少运行时,服务器会在启动时退出,并报出 `Cannot locate a .NET installation containing host/fxr`,同时列出它检查过的目录。 + +::: ## 二进制软件包 @@ -19,8 +57,8 @@ WukongMP 服务器当前以以下格式分发: | 平台 | 架构 | 下载 | | ------- | --- | --------------------------------------------------------------------------------------------------------------- | -| Linux | x64 | [Linux 版下载](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.2.4.zip) | -| Windows | x64 | [Windows 版下载](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.2.4.zip) | +| Linux | x64 | [Linux 版下载](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.3.0.zip) | +| Windows | x64 | [Windows 版下载](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.3.0.zip) | ### 安装 @@ -35,11 +73,14 @@ WukongMP 服务器当前以以下格式分发: server/ ├── server.exe # 主服务器二进制文件 ├── config.json # 配置文件 -├── mods/ # 模组目录 +├── mods/ # 客户端模组目录 | ├── WukongMp.Sdk/ # SDK 模组 | └── WukongMp.PvP/ # 对战模组 ├── optional_mods/ # 将其中任意模组移动到 "mods" 文件夹以启用 | └── WukongMp.Coop/ # 合作模组 +├── server_mods/ # 服务器端模组目录 +| ├── WukongMp.Sdk.Serverside.dll # 服务器端 SDK +| └── WukongMp.Coop.Serverside.dll # 合作模组,服务器端 ├── saves/ # 游戏存档目录(默认为空) ├── wwwroot/ # 管理面板资源 ├── e_sqlite3.dll # 依赖项 @@ -53,11 +94,14 @@ server/ server/ ├── server # 主服务器二进制文件 ├── config.json # 配置文件 -├── mods/ # 模组目录 +├── mods/ # 客户端模组目录 | ├── WukongMp.Sdk/ # SDK 模组 | └── WukongMp.PvP/ # 对战模组 ├── optional_mods/ # 将其中任意模组移动到 "mods" 文件夹以启用 | └── WukongMp.Coop/ # 合作模组 +├── server_mods/ # 服务器端模组目录 +| ├── WukongMp.Sdk.Serverside.dll # 服务器端 SDK +| └── WukongMp.Coop.Serverside.dll # 合作模组,服务器端 ├── saves/ # 游戏存档目录(默认为空) ├── wwwroot/ # 管理面板资源 └── libe_sqlite3.so # 依赖项 @@ -97,74 +141,8 @@ server/ ## Docker -也提供了基于 Linux 的 x64 Docker 镜像,供偏好容器化部署的用户使用。 +:::info[即将推出] -从注册表拉取镜像: - -```shell -docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 -``` - -从镜像中复制配置文件: - -```shell -docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.2.4 -docker cp wukongmp-tmp:/app/config.json ./config.json -docker rm wukongmp-tmp -``` - -运行: - - - - -```shell -docker run \ - -p 9050:9050/udp -p 9050:9050/tcp \ - -v ./data:/app/data \ - -v ./mods:/app/mods \ - -v ./saves:/app/saves \ - -v ./config.json:/app/config.json \ - --name wukongmp-server \ - ghcr.io/readycodeio/wukongmp-server:0.2.4 -``` - - - - -```yaml title="docker-compose.yml" -services: - server: - image: ghcr.io/readycodeio/wukongmp-server:0.2.4 - container_name: wukongmp-server - restart: unless-stopped - ports: - - "9050:9050/tcp" - - "9050:9050/udp" - volumes: - - ./data:/app/data - - ./mods:/app/mods - - ./saves:/app/saves - - ./config.json:/app/config.json -``` - - - - -:::important - -镜像 **不带模组**。在启动容器之前,将 `WukongMp.Sdk` -以及你想要的模式(`WukongMp.PvP`、`WukongMp.Coop`)从二进制 ZIP 文件复制到你的 `mods/` 卷中。 +我们正在准备基于 Linux 的 x64 Docker 镜像,供偏好容器化部署的用户使用。它目前还没有发布。在此之前请使用上面的二进制软件包。 ::: - -### 配置 - -端口的配置是通过在 `docker run` 命令或 Docker Compose 文件中重新映射容器端口来完成的。例如,要使用端口 9060 而不是 -9050,请将端口部分更改为: - -```yaml title="docker-compose.yml" -ports: - - "9060:9060/tcp" - - "9060:9060/udp" -``` diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/mod-management.md b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/mod-management.md index b3e5eba..71ea9a1 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/mod-management.md +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/mod-management.md @@ -55,10 +55,37 @@ mods/ └── other_files... # mod 所需的其他文件(可选) ``` -## 服务器端模组 +## 服务器端模组 {#server-side-mods} -:::info[正在进行中] +除了客户端内容之外,WukongMP 模组也可以在服务器上运行逻辑。服务器端模组放在与 `mods/` 并列的**独立** `server_mods/` 目录中,加载方式也不同。 -此功能正在开发中,将在未来的 SDK 版本中提供。 +与客户端模组不同,服务器端模组不是带清单文件的文件夹。把模组的程序集(以及它的依赖项)直接放进 `server_mods/` 即可。服务器启动时会递归扫描该目录下的 `.dll` 文件,加载其中包含模组类的程序集。 + +```text title="server_mods/ 目录结构示例" +server_mods/ +├── WukongMp.Sdk.Serverside.dll # 服务器端 SDK,随服务器一同分发 +├── ReadyM.Wukong.Common.dll # 共享的组件与 RPC 定义 +├── WukongMp.Coop.Serverside.dll # 联机合作模组,服务器端 +├── WukongMp.Coop.Common.dll # 联机合作模组,共享契约 +└── MyServerMod.dll # 你的服务器端模组 +``` + +除上面列出的模组之外,服务器本身不带任何游戏逻辑。你可以自己写一个服务器端模组,或者安装社区制作的模组。 + +:::important + +服务器端模组和它对话的客户端模组是同一件东西的两半。它们的网络化组件形状和 RPC 契约必须一致,所以请把它们作为同一个包的同一版本一起发布:客户端一半放进 `mods/`,服务器端一半放进 `server_mods/`。 + +::: + +服务器端模组可以注册网络化 ECS 组件、在服务器 tick 上运行游戏系统,以及处理客户端发来的服务器 RPC。构建方法请参见[服务器端开发](../Server-development/getting-started)文档。 + +:::danger[安全提示] + +WukongMP SDK 与服务器的早期访问版本不包含任何针对模组的沙箱或安全机制。 + +只使用来自可信来源的模组,因为它们可以在服务器和已连接的客户端上执行任意代码。 + +绝不要在服务器上运行不可信的模组,尤其是当服务器可以公开访问时。 ::: diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/network-stats.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/network-stats.mdx new file mode 100644 index 0000000..c58a1cd --- /dev/null +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/Server/network-stats.mdx @@ -0,0 +1,97 @@ +--- +sidebar_position: 6 +--- + +# 网络统计 + +[管理面板](./admin-panel)中的 **Network** 视图是对中继实际发送内容的实时细分。要回答“我的模组在网络上花了多少代价”,它是最快的途径,所以在你发布一个每 tick 都同步的组件之前,值得先学会怎么看这一页。 + +查看它需要 **Dashboard access** 权限。 + +管理面板中的 Network 标签页 + +## 采样方式 + +服务器每秒关闭一个测量窗口,并通过事件流推送到面板。它保留最近 300 个窗口;图表和表格显示最近的 120 个,这就是 **LIVE** 标记旁 `last 120s` 标签的含义。 + +窗口之间不重叠,也不会跨窗口做平滑。每个计数器都在窗口边界处被取样并清零。因此一次流量突发会一直留在汇总数据里,直到它从 120 个窗口的视图末端滑出,然后自行消失。这是正常现象,不是统计被重置了。 + +只有在连续五秒没有收到样本之后,数据流才会被报告为中断。连接断开会自行重试,服务器在重连时会重放它保留的历史,所以短暂中断不会在图表上留下缺口。 + +## 线路字节与负载字节 + +关于这一页几乎所有的困惑,都来自把两个计量层混为一谈,而它们是刻意分开的,永远不会相等。 + +**线路(Wire)** 是来自 LiteNetLib 的真实数据:它实际写入套接字的每一个字节,包括通道头、确认包、心跳和可靠重传。Ingress、Egress 和 UDP 吞吐量这几个数字都基于它。 + +**负载(Payload)** 只统计应用层字节,在服务器组装和解析数据包的位置计数。按组件和按消息类型的表格显示的就是它,而它也是唯一能把字节归因到你的模组的那一层。 + +负载的总和永远小于线路。二者之差就是 **Protocol overhead** 这块指标,它本身也是有用的信号:差距大意味着开销来自确认包和重传,而不是你的数据。 + +两个层都不统计每个数据报都要携带的 28 字节 IP 与 UDP 头。**Link egress** 把它们加了回来,也只有这个数字才反映你的主机实际计费的量。 + +:::note + +出站流量按收件人计数。一份增量组装一次、转发给五个对端,就是五倍的出站流量,因为那才是真正离开机器的量。这也是为什么对于任何要同步给繁忙区域的数据,扇出比负载大小更重要。 + +::: + +## 汇总指标块 + +| 指标块 | 含义 | +| --- | --- | +| **Ingress** | 每秒接收的线路字节数,下方是每秒数据包数。仅最新窗口。 | +| **Egress** | 每秒发送的线路字节数,下方是每秒数据包数。仅最新窗口。 | +| **Connected peers** | LiteNetLib 当前保持连接的对端数量。 | +| **Server tick p99** | 最新窗口内 tick 耗时的 99 分位值,下方是实际达到的网络循环频率。 | +| **Protocol overhead** | 线路出站减去负载出站,以速率表示。只有当窗口内负载超过 16 KB 时才显示占出站流量的百分比,否则会直接说明原因,而不是基于一个接近零的分母给出一个看似确定的数字。 | +| **Link egress** | 线路出站加上每个数据报 28 字节。大量小包在负载上很便宜,在这里却很贵。 | + +## UDP 吞吐量 + +每秒进出的线路字节数,每个窗口一个点。不含 IP 与 UDP 头,所以请把它与 **Link egress** 比较,而不是与主机的带宽图表比较。 + +## 服务器 tick 耗时 + +一次服务器 tick 耗时的 p50 和 p99,测量范围覆盖整个系统根更新。[你的服务器模组注册的系统](../Server-development/systems)就运行在其中,所以某个系统每 tick 做得太多,最先会在这张图上显现。 + +耗时按 1 微秒的桶做直方图统计,所以分位值是精确的,而不是插值得出的。超过 20 毫秒的都会归入最高的桶;如果你看到一条平在 20 毫秒的直线,那么真实值比它更差。 + +p99 上升而 p50 平稳,通常是某个系统偶尔要做重活的典型形状,例如一个用定时器扫描全部实体、而不是对变化作出反应的系统。 + +## 出站流量最高的组件 + +负载出站速率最高的八个组件。低于这八个的会被合并成一行 `Other (n)` 而不是被丢弃,所以这些条形始终能对上完整的总量。 + +坐标轴标签会去掉末尾的 `Component` 后缀以节省宽度,所以 `MonsterAnimationComponent` 在图上显示为 `MonsterAnimation`。下方表格保留完整名称。 + +## 按 ECS 组件的流量 + +按组件统计的负载,在可见窗口范围内汇总。这里的名称就是[内置原型上的组件类型](../Server-development/archetypes),以及你的模组注册的任何组件。 + +| 列 | 含义 | +| --- | --- | +| **Component** | 组件的类型名。 | +| **In** / **Out** | 每秒负载字节数,在整个可见窗口上取平均。 | +| **In msgs** / **Out msgs** | 消息数量。与旁边的字节列不同,这两列是窗口内的总数,不是速率。 | +| **In/msg** / **Out/msg** | 每条消息的平均负载字节数。 | +| **Fan-out** | 出站除以入站,基于汇总值。表示一次客户端更新会扩散多远。 | + +每一行都除以同一个窗口总时长,所以一次性的加入负载会报告为一个较小的每秒数值,而不会看起来像持续负载。各行之间本就是可以互相比较的。 + +某个“每条消息”列上出现黄色 `!`,表示平均负载小于每个数据报所需的 28 字节封装开销,也就是说链路开销的大部分是包头而不是数据。解决办法是每个包里多带一些状态,而不是继续压缩负载。 + +**Fan-out** 显示 `-` 表示该组件在窗口内完全没有入站流量。那是未定义,而不是零,对于客户端从不发送、由服务器写入的组件来说,这正是预期的读数。凡是[服务器端系统](../Server-development/systems)写入的组件都属于这一类。 + +排序标签(`total`、`egress`、`ingress`、`fan-out`)只会重新排列各行。扇出未定义的组件会排在最后,而不是当作零处理。 + +## 按消息类型的流量 + +同样是那些负载字节,但按线路消息编码而不是按组件分组。用它来区分 ECS 状态同步、RPC 和一次性事件。 + +内置编码会以其协议名称显示:`EcsDelta`、`EcsSnapshot`、`EcsCreateEntity`、`EcsDeleteEntity`、`EcsChangeOwnership`、`AreaEvent`、`HandshakeConnected` 等等。自定义 RPC 编码没有可查的名称,会显示为 `ServerRpc(n)` 和 `ClientRpc(n)`,按其线路编码编号。你自己的[客户端中继 RPC](../Development/custom-rpc) 出现在 `ClientRpc` 区间,[服务器 RPC](../Server-development/custom-rpc) 出现在 `ServerRpc` 区间。 + +如果 `EcsSnapshot` 占出站流量的比例很大,说明玩家频繁跨越范围边界。快照是可靠发送且内容完整的,所以比随后的增量昂贵得多。 diff --git a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/quick-start.mdx b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/quick-start.mdx index 5d498ed..0842eee 100644 --- a/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/quick-start.mdx +++ b/i18n/zh-Hans/docusaurus-plugin-content-docs/current/docs/quick-start.mdx @@ -14,20 +14,22 @@ import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem'; [⬇ Windows -下载(x64,v0.2.4)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.2.4.zip) +下载(x64,v0.3.0)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-win64-0.3.0.zip) [⬇ Linux -下载(x64,v0.2.4)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.2.4.zip) +下载(x64,v0.3.0)](https://readycodestorage.blob.core.windows.net/wukong-server-releases/wukong-server-linux64-0.3.0.zip) -```shell -docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 -``` +:::info[即将推出] + +Docker 镜像尚未发布。目前请按上面的 Windows 或 Linux 步骤操作。 + +::: @@ -48,26 +50,6 @@ docker pull ghcr.io/readycodeio/wukongmp-server:0.2.4 如要更改端口(默认值:`9050`),打开 `config.json` 并编辑 `Server:Port`。 - - - -从镜像中复制配置文件: - -```shell -docker create --name wukongmp-tmp ghcr.io/readycodeio/wukongmp-server:0.2.4 -docker cp wukongmp-tmp:/app/config.json ./config.json -docker rm wukongmp-tmp -``` - -端口配置通过重新映射容器端口来处理 — 请参见第3步。 - -:::important - -镜像 **不带模组**。在启动容器之前,请下载二进制程序包并将 `WukongMp.Sdk` 以及你选择的游戏模式模组(`WukongMp.PvP` 或 -`WukongMp.Coop`)复制到本地 `./mods/` 文件夹中。 - -::: - @@ -89,38 +71,6 @@ docker rm wukongmp-tmp chmod +x server && ./server ``` - - - -```shell -docker run \ - -p 9050:9050/udp -p 9050:9050/tcp \ - -v ./data:/app/data \ - -v ./mods:/app/mods \ - -v ./saves:/app/saves \ - -v ./config.json:/app/config.json \ - --name wukongmp-server \ - ghcr.io/readycodeio/wukongmp-server:0.2.4 -``` - -或者使用 Docker Compose: - -```yaml title="docker-compose.yml" -services: - server: - image: ghcr.io/readycodeio/wukongmp-server:0.2.4 - container_name: wukongmp-server - restart: unless-stopped - ports: - - "9050:9050/tcp" - - "9050:9050/udp" - volumes: - - ./data:/app/data - - ./mods:/app/mods - - ./saves:/app/saves - - ./config.json:/app/config.json -``` -