Skip to content

Conversation

@Nanle-code
Copy link

The following are the updates made to this project:

use-stacks.ts:

  1. Added cancelGameTimeout to imports
  2. Added handleCancelGameTimeout function
  3. Exported handleCancelGameTimeout in the return statement

play-game.tsx:

  1. Added imports: canCancelGame, CancelCheckResponse, blocksToTime
  2. Added handleCancelGameTimeout from useStacks hook
  3. Added state for cancelCheck
  4. Added useEffect to poll cancel status every 30 seconds
  5. Added logic to determine if user canCancel
  6. Added timeout countdown display in game info
  7. Added warning message and cancel button when timeout is reached

contract:

  1. Added Timeout not reached error

  2. Added not a player error

  3. Added Game already over error

  4. A constant for block timeout as u86400 but u10 for quick demo

  5. Added a function to cancel game due to timeout

  6. Check if a game can be cancelled due to timeout.

Features i really hope to add subsequently:

  1. I hope to add two individuals in a team making it a 4 people Game in total.
  2. A straight 3 win makes the address a king. He has a privilege to enter another game and help a friend who permits him with a move.

@Nanle-code Nanle-code changed the title added features Feature: Timeout and Inactivity Cancellation for Ongoing Games Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant