diff --git a/Makefile b/Makefile index bb65274..7d9e777 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,9 @@ build: genversion genbuilddate test build-win: test genversion GOOS=windows GOARCH=amd64 go build -v -o flokatirc.exe flokatirc +docker: build + ./dockerbuild.sh + genversion: ./genversion.sh diff --git a/modules/nickserv.go b/modules/nickserv.go deleted file mode 100644 index ea90c9e..0000000 --- a/modules/nickserv.go +++ /dev/null @@ -1,20 +0,0 @@ -// vi:ts=4:sts=4:sw=4:noet:tw=72 - -package modules - -import ( - "fmt" - "time" -) - -func init() { - RunFuncs["nickserv"] = nickservRun -} - -func nickservRun() { - pass := ModParams["nickserv-pass"] - email := ModParams["nickserv-email"] - time.Sleep(10 * time.Second) - SayCh <- fmt.Sprintf("%s\n%s %s %s", "N", "REGISTER", pass, email) - SayCh <- fmt.Sprintf("%s\n%s %s", "N", "IDENTIFY", pass) -} diff --git a/modules/quiz.go b/modules/quiz.go index 79cfdc2..707c111 100644 --- a/modules/quiz.go +++ b/modules/quiz.go @@ -99,9 +99,24 @@ func quizRun() { } func quizPrintRanklist(ranklist map[string]int) { + if len(ranklist) == 0 { + return + } SayCh <- fmt.Sprintf("%s\nAktueller Punktestand:", "*") - for k, v := range ranklist { - SayCh <- fmt.Sprintf("%s\n%s: %d", "*", k, v) + for { + maxk := "" + maxv := -1 + if len(ranklist) == 0 { + break + } + for k, v := range ranklist { + if v > maxv { + maxv = v + maxk = k + } + } + delete(ranklist, maxk) + SayCh <- fmt.Sprintf("%s\n%s: %d", "*", maxk, maxv) } }