RynthCore/tools/VendorRateTests/VendorRateTests.csproj
Daniel Wallace f68d9c2199 VendorTrade: price a 0-rate vendor at 0, log free vendors, pin wiring
Review follow-up to the 0-rate fix.

- A vendor rate of exactly 0 now means free: PlayerPaysForStack and
  VendorPaysForStack return 0 instead of the 1-per-stack floor (notes
  included). Every rate above 0 keeps the stock ACE floor. With the
  floor, a free storage vendor refused withdrawals to a player with no
  pyreals ("costs N pyreals, you have 0") and deposits with no free pack
  slot (the estimated "payout" needed one), though the vault charges and
  pays nothing. The server stays the authority on the real price.
- The two price helpers move to VendorRatePolicy.cs; VendorTrade keeps
  thin forwarders so its call sites are unchanged.
- A vendor with buy=0 and sell=0 is logged once per vendor id as a
  zero-rate (free) vendor.
- tools\VendorRateTests covers the pricing (rate 0 -> cost 0 and payout
  0; rate 0.001, value 1 -> still 1) and reads VendorTrade.cs to pin that
  it calls VendorRatePolicy, so reverting the wiring fails the test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 20:16:09 -07:00

24 lines
1.1 KiB
XML

<Project Sdk="Microsoft.NET.Sdk">
<!--
Offline checks for VendorTrade's profile rate check (2026-10-30, a free storage vendor on a
custom server, buy=0 sell=0, had trading turned off): src\RynthCore.Engine\Compatibility\VendorRatePolicy.cs,
compiled in. 0 and ordinary rates pass; negative, NaN, infinite and huge rates fail. A 0 rate
prices at 0 (cost and payout), any rate above 0 keeps ACE's 1-per-stack floor. Reads
src\RynthCore.Engine\Compatibility\VendorTrade.cs (found by walking up) to pin that it calls
VendorRatePolicy. No AC. Run: dotnet run -c Release (exit 0 = pass, 1 = fail)
-->
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<InvariantGlobalization>true</InvariantGlobalization>
<RootNamespace>VendorRateTests</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\src\RynthCore.Engine\Compatibility\VendorRatePolicy.cs" Link="Engine\VendorRatePolicy.cs" />
</ItemGroup>
</Project>