Krazick / 18XX-Game-Engine

18XX Game Engine
MIT License
2 stars 0 forks source link

Share Exchange broke if a few ways #236

Closed Krazick closed 4 months ago

Krazick commented 6 months ago

For first Exchanging Player, if 3 or less shares being exchanged:

  1. One Share went to Open Marked - Correct
  2. Two Shares went to Closed -- Correct
  3. One CGR Share was provided to player, but was the 20% Prez Share -- Should have been 10% Share ~~ maybe right?
  4. IPO Holdings -- bottom right, show CGR 27 Certs, 180%, WRONG, should be 8 Certs/80% or 18 Certs.90% based on first or second issue.

Attempting to Undo the Share Exchange Failed. Action Report:

ERROR: Failed trying to undo Transfer Ownership Action, Effect Transfer Ownership ERROR: null

The Game Engine did not send the Action to the Remote Clients The Game Engine did not enable the game to proceed (buttons all disabled)

Krazick commented 6 months ago

The failure of the Transfer Ownership is due to the first exchange has a player only trading in 2 (or 3) Shares for CGR, and no president yet. Currently fixed to NOT add a Transfer Ownership Effect if no Certificate was found in IPO to transfer.

Going to add a 0% Prez [GHOST] Certificate to allow player to be flagged. When another 10%/5% Cert is acquired it will merge. Or if another player get more % than the Current Prez [GHOST], and acquires 20%/10% these will merge.

The Action was not sent to remote clients, because of the Exception, broke the control flow, this also caused all buttons to be disabled. So this is currently fixed.

Krazick commented 6 months ago

The Ghost (0%) Prez share being created on initial Share Exchange, if required. And being removed during later Share Exchange specifies the new President. The Effects are created, and are properly undone.

  1. Purchase of a second share
  2. If the President does not have enough Cash to pay for the 2nd Share, then Forced Buy to be implemented, with a Forced Buy Coupon, like for force payment Coupon for Loan Interest.
  3. Claim the proper President Certificate:
    • [1] Remove 0% Cert
    • [2] Transfer the 10%/5% Cert back to IPO
    • [3] Transfer 20% President Cert to the Player's Portfolio from the IPO
  4. If another player buys a 2nd Share before the current President's Stock Turn, then handle a Change of President, like in the Share Exchange Round, Claim the 20%/10% President Certificate from the IPO, and remove the 0% President Certificate from the current President's Portfolio.
Krazick commented 6 months ago

Network tests show the Share Exchange works correctly. and the 0% cert is removed. However, when shifting to the Token Exchange phase, if the President is not the next player, The effect names the correct president, but it does not make him the primary, simply the next player in order.

Krazick commented 4 months ago

Attempting to recreate the issue at this point has been difficult... Going to mark this closed... and will reopen if it happens again