- HeykelSavasiContext.IsItemAllowedToEquip disallows wings/capes during Playing only (so entry is never rejected for wearing wings); auto-unequips any equipped wing/cape into a free inventory slot in OnGameStartAsync. - New S2C packet HeykelSavasiHudState (C1, code FB, length 11) carrying phase, team, counts, statue progress and remaining seconds, plus its view plugin/interface, broadcast once per second across registration/prep/ battle and one-shot on join/statue-break/game-end.
40 lines
1.5 KiB
C#
40 lines
1.5 KiB
C#
// <copyright file="HeykelSavasiHudStatePlugIn.cs" company="MUnique">
|
|
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
|
|
// </copyright>
|
|
|
|
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;
|
|
|
|
/// <summary>
|
|
/// The default implementation of the <see cref="IHeykelSavasiHudStatePlugIn"/> which is forwarding everything to the game client with specific data packets.
|
|
/// </summary>
|
|
[PlugIn]
|
|
[Guid("ef0cc7e9-07c6-4e60-afae-f8dd19332ad7")]
|
|
public class HeykelSavasiHudStatePlugIn : IHeykelSavasiHudStatePlugIn
|
|
{
|
|
private readonly RemotePlayer _player;
|
|
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="HeykelSavasiHudStatePlugIn"/> class.
|
|
/// </summary>
|
|
/// <param name="player">The player.</param>
|
|
public HeykelSavasiHudStatePlugIn(RemotePlayer player) => this._player = player;
|
|
|
|
/// <inheritdoc/>
|
|
public async ValueTask UpdateHudStateAsync(byte phase, byte myTeam, byte redCount, byte blueCount, byte redProgress, byte blueProgress, ushort remainingSeconds)
|
|
{
|
|
var connection = this._player.Connection;
|
|
if (connection is null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
await connection.SendHeykelSavasiHudStateAsync(phase, myTeam, redCount, blueCount, redProgress, blueProgress, remainingSeconds).ConfigureAwait(false);
|
|
}
|
|
}
|