Enha: wait for mime clue
This commit is contained in:
		| @@ -51,6 +51,10 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 		abortWithError(w, err.Error()) | ||||
| 		return | ||||
| 	} | ||||
| 	if !fi.Room.MimeDone { | ||||
| 		abortWithError(w, "wait for the clue") | ||||
| 		return | ||||
| 	} | ||||
| 	color, exists := roundWords[word] | ||||
| 	log.Debug("got show-color request", "word", word, "color", color) | ||||
| 	if !exists { | ||||
|   | ||||
| @@ -40,12 +40,6 @@ func HandleCreateRoom(w http.ResponseWriter, r *http.Request) { | ||||
| 		return | ||||
| 	} | ||||
| 	notify(models.NotifyRoomListUpdate, "") | ||||
| 	// send msg of created room | ||||
| 	// h.Broker.Notifier <- broker.NotificationEvent{ | ||||
| 	// 	EventName: models.MsgRoomListUpdate, | ||||
| 	// 	Payload:   fmt.Sprintf("%s created a room named %s", r.CreatorName, r.RoomName), | ||||
| 	// } | ||||
| 	// return html | ||||
| 	tmpl, err := template.ParseGlob("components/*.html") | ||||
| 	if err != nil { | ||||
| 		abortWithError(w, err.Error()) | ||||
|   | ||||
| @@ -94,6 +94,10 @@ func HandleExit(w http.ResponseWriter, r *http.Request) { | ||||
| 		abortWithError(w, err.Error()) | ||||
| 		return | ||||
| 	} | ||||
| 	if fi.Room.IsRunning { | ||||
| 		abortWithError(w, "cannot leave when game is running") | ||||
| 		return | ||||
| 	} | ||||
| 	var creatorLeft bool | ||||
| 	if fi.Room.CreatorName == fi.State.Username { | ||||
| 		creatorLeft = true | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder