Enha: filter out some words
This commit is contained in:
		| @@ -301,7 +301,10 @@ func recoverBots() { | ||||
| } | ||||
|  | ||||
| func recoverBot(bm map[string]string) error { | ||||
| 	// TODO: check if room still exists | ||||
| 	// check if room still exists | ||||
| 	if _, err := getRoomByID(bm["room_id"]); err != nil { | ||||
| 		return fmt.Errorf("no such room: %s; err: %w", bm["room_id"], err) | ||||
| 	} | ||||
| 	log.Debug("recovering bot", "bot", bm) | ||||
| 	_, err := llmapi.NewBot(bm["role"], bm["team"], bm["bot_name"], bm["room_id"], cfg) | ||||
| 	if err != nil { | ||||
|   | ||||
| @@ -151,7 +151,7 @@ func makeCookie(username string, remote string) (*http.Cookie, error) { | ||||
| 	log.Info("check remote addr for cookie set", | ||||
| 		"remote", remote, "session", session) | ||||
| 	if strings.Contains(remote, "192.168.0") { | ||||
| 		cookie.Domain = "192.168.0.106" | ||||
| 		cookie.Domain = "192.168.0.100" | ||||
| 		cookie.SameSite = http.SameSiteLaxMode | ||||
| 		cookie.Secure = false | ||||
| 		log.Info("changing cookie domain", "domain", cookie.Domain) | ||||
|   | ||||
| @@ -85,12 +85,14 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 	// if opened card is of color of opp team, change turn | ||||
| 	oppositeColor := fi.Room.GetOppositeTeamColor() | ||||
| 	fi.Room.OpenedThisTurn++ | ||||
| 	if fi.Room.ThisTurnLimit >= fi.Room.OpenedThisTurn { | ||||
| 		// end turn | ||||
| 		fi.Room.TeamTurn = oppositeColor | ||||
| 		fi.Room.MimeDone = false | ||||
| 		fi.Room.OpenedThisTurn = 0 | ||||
| 		fi.Room.ThisTurnLimit = 0 | ||||
| 	if fi.Room.ThisTurnLimit > 0 { | ||||
| 		if fi.Room.ThisTurnLimit >= fi.Room.OpenedThisTurn { | ||||
| 			// end turn | ||||
| 			fi.Room.TeamTurn = oppositeColor | ||||
| 			fi.Room.MimeDone = false | ||||
| 			fi.Room.OpenedThisTurn = 0 | ||||
| 			fi.Room.ThisTurnLimit = 0 | ||||
| 		} | ||||
| 	} | ||||
| 	switch string(color) { | ||||
| 	case "black": | ||||
|   | ||||
| @@ -262,6 +262,7 @@ func HandleGiveClue(w http.ResponseWriter, r *http.Request) { | ||||
| 	fi.Room.ActionHistory = append(fi.Room.ActionHistory, action) | ||||
| 	fi.Room.MimeDone = true | ||||
| 	fi.Room.ThisTurnLimit = uint8(guessLimitU64) + 1 | ||||
| 	log.Debug("given clue", "clue", clue, "limit", guessLimitU64) | ||||
| 	notify(models.NotifyBacklogPrefix+fi.Room.ID, clue+num) | ||||
| 	notifyBotIfNeeded(fi) | ||||
| 	if err := saveFullInfo(fi); err != nil { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder