Created
October 9, 2013 21:01
-
-
Save tleyden/6908316 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
votes := &OutgoingVotes{} | |
votesId := fmt.Sprintf("vote:%s", game.user.Id) | |
err := game.db.Retrieve(votesId, votes) | |
if err != nil { | |
logg.LogTo("MAIN", "Unable to find existing vote doc: %v", votesId) | |
} | |
votes.Id = votesId | |
votes.Turn = game.gameState.Turn | |
votes.PieceId = validMove.PieceId | |
votes.TeamId = game.ourTeamId | |
votes.GameId = game.gameState.Number | |
// TODO: this is actually a bug, because if there is a | |
// double jump it will only send the first jump move | |
endLocation := validMove.Locations[0] | |
locations := []int{validMove.StartLocation, endLocation} | |
votes.Locations = locations | |
newId, newRevision, err := game.db.Insert(votes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment