diff --git a/src/GameLogic/Views/MiniGames/IShowHeykelSavasiTeamPanelPlugIn.cs b/src/GameLogic/Views/MiniGames/IShowHeykelSavasiTeamPanelPlugIn.cs new file mode 100644 index 0000000..1d3aac4 --- /dev/null +++ b/src/GameLogic/Views/MiniGames/IShowHeykelSavasiTeamPanelPlugIn.cs @@ -0,0 +1,18 @@ +// +// Licensed under the MIT License. See LICENSE file in the project root for full license information. +// + +namespace MUnique.OpenMU.GameLogic.Views.MiniGames; + +/// +/// Interface of a view whose implementation informs about the opened Heykel Savasi team-select panel. +/// +public interface IShowHeykelSavasiTeamPanelPlugIn : IViewPlugIn +{ + /// + /// Shows the Heykel Savasi team-select panel. + /// + /// The current number of players in the red team. + /// The current number of players in the blue team. + ValueTask ShowTeamPanelAsync(int redCount, int blueCount); +} diff --git a/src/GameServer/RemoteView/MiniGames/ShowHeykelSavasiTeamPanelPlugIn.cs b/src/GameServer/RemoteView/MiniGames/ShowHeykelSavasiTeamPanelPlugIn.cs new file mode 100644 index 0000000..0ccefce --- /dev/null +++ b/src/GameServer/RemoteView/MiniGames/ShowHeykelSavasiTeamPanelPlugIn.cs @@ -0,0 +1,39 @@ +// +// Licensed under the MIT License. See LICENSE file in the project root for full license information. +// + +namespace MUnique.OpenMU.GameServer.RemoteView.MiniGames; + +using System.Runtime.InteropServices; +using MUnique.OpenMU.GameLogic; +using MUnique.OpenMU.GameLogic.Views.MiniGames; +using MUnique.OpenMU.Network.Packets.ServerToClient; +using MUnique.OpenMU.PlugIns; + +/// +/// The default implementation of the which is forwarding everything to the game client with specific data packets. +/// +[PlugIn] +[Guid("bccff260-8f1c-40fe-90b2-110723e13374")] +public class ShowHeykelSavasiTeamPanelPlugIn : IShowHeykelSavasiTeamPanelPlugIn +{ + private readonly RemotePlayer _player; + + /// + /// Initializes a new instance of the class. + /// + /// The player. + public ShowHeykelSavasiTeamPanelPlugIn(RemotePlayer player) => this._player = player; + + /// + public async ValueTask ShowTeamPanelAsync(int redCount, int blueCount) + { + var connection = this._player.Connection; + if (connection is null) + { + return; + } + + await connection.SendHeykelSavasiOpenTeamPanelAsync((byte)redCount, (byte)blueCount).ConfigureAwait(false); + } +}