Exemplo n.º 1
0
func handle_bidder(msg Message, room *DraftRoom) {
	captain := draft.GetAuctioner(msg.From)
	if captain != nil {
		str := fmt.Sprintf("%d", captain.Points)
		room.messageWithID(msg.From, &Message{Type: "points", Text: str})
		room.messageWithID(msg.From, &Message{Type: "team", Text: captain.TeamName})
	}

}
Exemplo n.º 2
0
func handle_bid(msg Message, room *DraftRoom) {
	amt, err := strconv.Atoi(msg.Text)
	//log.Println(msg)
	if err == nil {
		bidSuccess := draft.Bid(msg.From, amt)
		captain := draft.GetAuctioner(msg.From)
		if bidSuccess {
			formattedStr := fmt.Sprintf("<h5>%s bid <span  class='text-success'>%d</span> on <span class='text-success'>%s</span></h5>",
				captain.TeamName, amt, draft.GetCurrentPlayer().Ign)
			go Handle(Message{Type: "event", Text: formattedStr})
			currentCountdown = startingCountdownTime
			allowTicks = true
		}
	}
}