Skip to content

Conversation

@Abidoyesimze
Copy link

  • Add last-move-block tracking to game state
  • Implement cancel-game function for timeout scenarios
  • Add can-cancel-game read-only function
  • Add comprehensive timeout tests (6 new test cases)
  • Prevent players from indefinitely stalling games
  • Ensure fair fund distribution when games are cancelled
  • Only game participants can cancel games
  • Games that have ended cannot be cancelled

Resolves the griefing issue where losing players could refuse to make moves, leaving games in limbo with locked funds.

- Add last-move-block tracking to game state
- Implement cancel-game function for timeout scenarios
- Add can-cancel-game read-only function
- Add comprehensive timeout tests (6 new test cases)
- Prevent players from indefinitely stalling games
- Ensure fair fund distribution when games are cancelled
- Only game participants can cancel games
- Games that have ended cannot be cancelled

Resolves the griefing issue where losing players could refuse
to make moves, leaving games in limbo with locked funds.
 Features Added:
- Timeout protection system to prevent griefing by inactive players
- Smart contract functions: cancel-game and can-cancel-game
- Frontend UI components for timeout management
- Real-time timeout status checking

 Technical Implementation:
- Updated contract address to deployed testnet version
- Added last-move-block field to game data structure
- Created TimeoutIndicator React component with cancel button
- Integrated cancel-game functionality in useStacks hook
- Added canCancelGame read-only function for UI state management

 UI/UX Enhancements:
- Timeout warning banner for ongoing games
- One-click game cancellation for eligible players
- Visual feedback for timeout protection status
- Seamless integration with existing game flow

 Anti-Griefing Measures:
- Players can cancel games after timeout period
- Automatic fund distribution to non-timeout player
- Prevents indefinite game stalling
- Protects player investments from bad actors

This implementation solves the critical griefing issue where losing players could refuse to make moves, locking up both players' funds indefinitely.
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