Closed px3l closed 6 years ago
maybe greater than 1? then at least you end up with more than where you started?
So it sounds like we need to:
minPlayers
startGame
and endGame
absolute timestamps into a gamePeriod
single, relative timestampThen - on each call to play
- it says are there enough players now
- if yes and game has not started - set gameStarted
to current block timestamp and gameWillEnd
to gameStarted + gamePeriod
We probably need another var called gameActive
so the various require
statements in canPlayGame
still work with regard to the game being active but the time period not technically started.
Ofcourse, player at index minPlayer will need to pay for a couple of lines of extra computational cost!
On 22 Mar 2018, at 12:06, Kai Davenport notifications@github.com wrote:
So it sounds like we need to:
have a parameter of a game called minPlayers merge the startGame and endGame absolute timestamps into a gamePeriod single, relative timestamp Then - on each call to play - it says are there enough players now - if yes and game has not started - set gameStarted to current block timestamp and gameWillEnd to gameStarted + gamePeriod
We probably need another var called gameActive so the various require statements in canPlayGame still work with regard to the game being active but the time period not technically started.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/strange-labs-uk/ethereum-raffle/issues/18#issuecomment-375281346, or mute the thread https://github.com/notifications/unsubscribe-auth/ACFJMv9TF9HvoYdxaeKNxu1_QOdF_bkzks5tg5PCgaJpZM4S2qJl.
New proposal - have a minPlayers
variable as part of the contract - if the endTime
comes and there are < X
players - trigger the refundAll function
To avoid: