Removed useless stuff

This commit is contained in:
Joren 2024-07-18 14:57:16 +02:00
parent 257a7aebde
commit 201552d647
Signed by: Joren
GPG Key ID: 280E33DFBC0F1B55

11
main.go
View File

@ -587,6 +587,10 @@ func resetCommandHandler(client *discordgo.Session, i *discordgo.InteractionCrea
} }
} }
for _, uid := range userUIDs {
log.Printf("Reset the HWID of user with UID %d for %s", uid, softwareType)
}
err = client.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{ err = client.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource, Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{ Data: &discordgo.InteractionResponseData{
@ -681,8 +685,6 @@ func resetHWID(tableName string, uids []int) {
} }
func resetAndVerify(tableName string, uids []int) ([]bool, []error) { func resetAndVerify(tableName string, uids []int) ([]bool, []error) {
var beforeHashes []string
var afterHashes []string
var successes []bool var successes []bool
var errorsSlice []error var errorsSlice []error
@ -706,10 +708,6 @@ func resetAndVerify(tableName string, uids []int) ([]bool, []error) {
beforeHashesMap[uid] = beforeHash beforeHashesMap[uid] = beforeHash
} }
for _, uid := range uids {
beforeHashes = append(beforeHashes, beforeHashesMap[uid])
}
resetHWID(tableName, uids) resetHWID(tableName, uids)
rows, err = db.Query(fmt.Sprintf(`SELECT "UID", MD5(CONCAT("StorageIdentifier", "BootIdentifier")) FROM public.%q WHERE "UID" = ANY($1)`, tableName), pq.Array(uids)) rows, err = db.Query(fmt.Sprintf(`SELECT "UID", MD5(CONCAT("StorageIdentifier", "BootIdentifier")) FROM public.%q WHERE "UID" = ANY($1)`, tableName), pq.Array(uids))
@ -739,7 +737,6 @@ func resetAndVerify(tableName string, uids []int) ([]bool, []error) {
successes = append(successes, false) successes = append(successes, false)
continue continue
} }
afterHashes = append(afterHashes, afterHash)
successes = append(successes, beforeHashesMap[uid] != afterHash || afterHash == "d41d8cd98f00b204e9800998ecf8427e") successes = append(successes, beforeHashesMap[uid] != afterHash || afterHash == "d41d8cd98f00b204e9800998ecf8427e")
} }