fix(CS): send crown shield packet (0xB2/0x16) only on change, not every tick
Some checks failed
.NET Core / build (push) Has been cancelled
Some checks failed
.NET Core / build (push) Has been cancelled
The shield packet pops a modal message box on the client; sending it every tick re-opened the modal continuously and froze player input at siege start. Track the shield state in the context and only push the packet when it actually flips.
This commit is contained in:
@@ -428,7 +428,12 @@ public sealed class CastleSiegeEventPlugIn : IPeriodicTaskPlugIn, ISupportCustom
|
||||
return;
|
||||
}
|
||||
|
||||
await player.InvokeViewPlugInAsync<ICastleSiegeStatusViewPlugIn>(p => p.SetCrownShieldAsync(crown.ShieldDown)).ConfigureAwait(false);
|
||||
// Only tell the client when the shield state actually flips — the 0xB2/0x16 packet pops a modal
|
||||
// message box, so sending it every tick would block player input.
|
||||
if (crown.ShieldChanged)
|
||||
{
|
||||
await player.InvokeViewPlugInAsync<ICastleSiegeStatusViewPlugIn>(p => p.SetCrownShieldAsync(crown.ShieldDown)).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
switch (crown.Event)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user