summaryrefslogtreecommitdiffstats
path: root/wat/db.go
diff options
context:
space:
mode:
authoralex2019-01-04 09:20:39 +0000
committeralex2019-01-04 09:20:39 +0000
commitd4c4e38ba8d203a35ddf9e7ef057fee2db80d0f9 (patch)
tree58475851780c7cffd19db6165f5ee68d14b06cf1 /wat/db.go
parentca91956e27ab31b5cef5af4927fe37b0671ce092 (diff)
downloadwatbot-d4c4e38ba8d203a35ddf9e7ef057fee2db80d0f9.tar.gz
watbot-d4c4e38ba8d203a35ddf9e7ef057fee2db80d0f9.tar.bz2
watbot-d4c4e38ba8d203a35ddf9e7ef057fee2db80d0f9.zip
Added time limited bankrupcy, steroids for benching (don't persist across restarts), removed aliases from command list, ping, strongest, don't allow vlk to roll.
Diffstat (limited to 'wat/db.go')
-rw-r--r--wat/db.go15
1 files changed, 11 insertions, 4 deletions
diff --git a/wat/db.go b/wat/db.go
index 5f80af4..fb677d8 100644
--- a/wat/db.go
+++ b/wat/db.go
@@ -85,10 +85,11 @@ func (w *WatDb) Update(upd ...interface{}) {
}
const (
- Action_Mine ActionType = 1
- Action_Rest ActionType = 2
- Action_Lift ActionType = 3
- Action_Riot ActionType = 4
+ Action_Mine ActionType = 1
+ Action_Rest ActionType = 2
+ Action_Lift ActionType = 3
+ Action_Riot ActionType = 4
+ Action_Bankrupt ActionType = 5
)
type ActionType int
@@ -109,6 +110,12 @@ func (w *WatDb) Act(player *Player, actionType ActionType) {
}
}
+func (w *WatDb) Strongest() []Player {
+ var user = make([]Player, 10)
+ w.db.Limit(10).Order("anarchy desc").Find(&user)
+ return user
+}
+
func (w *WatDb) TopLost() []Player {
var user = make([]Player, 10)
w.db.Limit(10).Order("coins_lost desc").Find(&user)