Exemplo n.º 1
0
func checkPlayer(platform, player string) {
	resp, ok := requestURL("https://na.api.pvp.net/observer-mode/rest/consumer/getSpectatorGameInfo/" + platform + "/" + player + "?api_key=" + apiKey)
	if !ok {
		return
	}
	game := parseMatch(resp)

	if game.Id > 0 {
		gameId := strconv.FormatFloat(game.Id, 'f', 0, 64)
		record.Record(platform, gameId, game.Observers.EncryptionKey, player)
	}
}
Exemplo n.º 2
0
func (c App) Record(region, gameId, encryptionKey string) revel.Result {
	record.Record(region, gameId, encryptionKey)
	return c.RenderText("ok.")
}