コード例 #1
0
        public void HandleStoryPanel(ICommandContext context,
                                     [Parameter("Story panel entry to send to character.")]
                                     uint storyPanelId)
        {
            StoryPanelEntry entry = GameTableManager.Instance.StoryPanel.GetEntry(storyPanelId);

            if (entry == null)
            {
                context.SendError($"Invalid story panel entry {storyPanelId}!");
                return;
            }

            StoryBuilder.Instance.SendStoryPanel(entry, context.GetTargetOrInvoker <Player>());
        }
コード例 #2
0
ファイル: StoryBuilder.cs プロジェクト: sergeev/NexusForever
        /// <summary>
        /// Sends a story panel to the <see cref="Player"/> based on the provided <see cref="StoryPanelEntry"/>.
        /// </summary>
        public void SendStoryPanel(StoryPanelEntry entry, Player player)
        {
            if (entry == null)
            {
                throw new ArgumentNullException(nameof(entry));
            }

            var storyMessage = new StoryMessage
            {
                MsgId       = entry.Id,
                GeneralVoId = entry.SoundEventId
            };

            storyMessage.AddPlayer(player);

            player.Session.EnqueueMessageEncrypted(new ServerStoryPanelHide());
            player.Session.EnqueueMessageEncrypted(new ServerStoryPanelShow
            {
                StoryMessage = storyMessage
            });
        }