Remove game tags and persona/nucleus ids everywhere. Forward score-fetch statuscode. Fix login issue.
This commit is contained in:
@@ -50,19 +50,12 @@ func GetPlayersByClanHTML(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
game, err := GetActiveGame(c)
|
||||
if err != nil {
|
||||
c.String(http.StatusBadRequest, "")
|
||||
utils.Logger.Errorf("[PLAYER] No active game not found! Error: %s", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
var playerIDs []uint
|
||||
for _, player := range players {
|
||||
playerIDs = append(playerIDs, player.ID)
|
||||
}
|
||||
|
||||
scores, err := models.PlayerCache.GetScores(playerIDs, game.Tag)
|
||||
scores, err := models.PlayerCache.GetScores(playerIDs)
|
||||
if err != nil {
|
||||
c.String(http.StatusBadRequest, "")
|
||||
utils.Logger.Errorf("[PLAYER] Could not get scores! Error: %s", err.Error())
|
||||
@@ -107,14 +100,7 @@ func AddPlayer(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
personaID, nucleusID, statusCode := GetPlayerIds(input.Name)
|
||||
if personaID == 0 || nucleusID == 0 {
|
||||
c.JSON(statusCode, gin.H{"error": "Player not found!"})
|
||||
utils.Logger.Errorf("[PLAYER] Could not find player! Name: %s, Status: %d", input.Name, statusCode)
|
||||
return
|
||||
}
|
||||
|
||||
player = models.Player{Name: input.Name, ClanID: input.ClanID, PersonaID: personaID, NucleusID: nucleusID}
|
||||
player = models.Player{Name: input.Name, ClanID: input.ClanID}
|
||||
if err := models.DB.Create(&player); err.Error != nil {
|
||||
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error.Error()})
|
||||
utils.Logger.Errorf("[PLAYER] Could not create player! Error: %s", err.Error.Error())
|
||||
|
||||
Reference in New Issue
Block a user