RynthAi: a relog ends "never reached your hand" weapon bans
A 'never reached your hand' ban is a guess from a missing answer, unlike the server's own 'skill too low' refusal. Track those bans separately and lift them when the character logs in (or relogs); 'skill too low' bans stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
70941f12d6
commit
3b439a66f1
2 changed files with 44 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ internal static class WieldBanTests
|
|||
{
|
||||
r.Add("wield ban: a weapon seen wielded between combat's looks is not banned, its tries start over", SeenWieldedNotBanned);
|
||||
r.Add("wield ban: no ban while the equipment list shows the weapon at the give-up", ListShowsItAtGiveUp);
|
||||
r.Add("wield ban: a relog ends 'never reached your hand' bans, not 'skill too low' ones", RelogClearsNeverReached);
|
||||
r.Add("wield ban: a wield that never shows in the list is still banned", NeverShownStillBanned);
|
||||
r.Add("wield ban: one sighting, then three wields never seen: banned (a new run forgets the sighting)", SeenOnceThenNeverBanned);
|
||||
r.Add("wield ban: a weapon in the shield slot is not a main-hand sighting, it still rests", ShieldSlotNotASighting);
|
||||
|
|
@ -39,10 +40,11 @@ internal static class WieldBanTests
|
|||
private readonly MethodInfo _send = typeof(CombatManager).GetMethod("MarkWieldSent", F)!;
|
||||
private readonly MethodInfo _step = typeof(CombatManager).GetMethod("SwapStep", F)!;
|
||||
|
||||
public Rig(bool equipped = true)
|
||||
public Rig(bool equipped = true, bool weenieErrors = false)
|
||||
{
|
||||
FakeHost.Reset();
|
||||
FakeHost.EquippedCalls = equipped;
|
||||
FakeHost.WeenieErrorCalls = weenieErrors;
|
||||
FakeHost.Names[Blade] = "Test Blade";
|
||||
FakeHost.Names[Wand] = "Fire Wand";
|
||||
FakeHost.Names[Nodachi] = "Nodachi";
|
||||
|
|
@ -117,6 +119,28 @@ internal static class WieldBanTests
|
|||
finally { EquippedState.Invalidate(); }
|
||||
}
|
||||
|
||||
/// <summary>SetPlayerId (a login or relog) ends 'never reached' bans only.</summary>
|
||||
private static void RelogClearsNeverReached()
|
||||
{
|
||||
var rig = new Rig(weenieErrors: true);
|
||||
try
|
||||
{
|
||||
// The blade: three wields that never show in the list -> 'never reached your hand'.
|
||||
for (int i = 1; i <= 3; i++) { rig.Send(Blade, Wand); rig.C.OnHeartbeat(); rig.Step(Blade, Wand); }
|
||||
Check.True(rig.Banned(Blade), "setup: the blade left out as 'never reached your hand'");
|
||||
// Nodachi: the server answers 'skill too low'.
|
||||
rig.Send(Nodachi, Wand);
|
||||
FakeHost.WeenieError(CombatManager.SkillTooLowErr, 0x00A0, Nodachi);
|
||||
rig.Step(Nodachi, Wand);
|
||||
Check.True(rig.Banned(Nodachi), "setup: Nodachi left out as 'skill too low'");
|
||||
|
||||
rig.C.SetPlayerId(Player); // the same character logs in again
|
||||
Check.False(rig.Banned(Blade), "relog: the 'never reached your hand' ban is over");
|
||||
Check.True(rig.Banned(Nodachi), "relog: the server's 'skill too low' ban stays");
|
||||
}
|
||||
finally { EquippedState.Invalidate(); }
|
||||
}
|
||||
|
||||
/// <summary>A wield the client or server truly refuses (never in the list) still bans.</summary>
|
||||
private static void NeverShownStillBanned()
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue