Enha: stop timer if turn ended
This commit is contained in:
		| @@ -84,6 +84,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 		fi.Room.OpenedThisTurn = 0 | ||||
| 		fi.Room.ThisTurnLimit = 0 | ||||
| 		fi.Room.ClearMarks() | ||||
| 		StopTurnTimer(fi.Room.ID) | ||||
| 	} | ||||
| 	switch string(color) { | ||||
| 	case string(models.WordColorBlack): | ||||
| @@ -102,6 +103,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 		fi.Room.ThisTurnLimit = 0 | ||||
| 		fi.Room.ActionHistory = append(fi.Room.ActionHistory, action) | ||||
| 		fi.Room.ClearMarks() | ||||
| 		StopTurnTimer(fi.Room.ID) | ||||
| 	case string(models.WordColorWhite), string(oppositeColor): | ||||
| 		log.Debug("opened opposite color word", "room", fi.Room, "opposite-color", oppositeColor) | ||||
| 		// end turn | ||||
| @@ -109,6 +111,7 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 		fi.Room.MimeDone = false | ||||
| 		fi.Room.OpenedThisTurn = 0 | ||||
| 		fi.Room.ThisTurnLimit = 0 | ||||
| 		StopTurnTimer(fi.Room.ID) | ||||
| 		// check if no cards left => game over | ||||
| 		if fi.Room.BlueCounter == 0 { | ||||
| 			// blue won | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder