mirror of
https://github.com/statbate/shiny-potato.git
synced 2026-08-11 03:12:42 +00:00
update
This commit is contained in:
parent
f2970c325c
commit
d42503ad10
5 changed files with 31 additions and 104 deletions
12
app/save.go
12
app/save.go
|
|
@ -131,16 +131,18 @@ func saveDB() {
|
|||
|
||||
if m.Amount > 49 {
|
||||
msg, err := json.Marshal(struct {
|
||||
Chanel string `json:"chanel"`
|
||||
Room string `json:"room"`
|
||||
Donator string `json:"donator"`
|
||||
Amount int64 `json:"amount"`
|
||||
}{
|
||||
Chanel: "stripchat",
|
||||
Room: m.Room,
|
||||
Donator: m.From,
|
||||
Amount: m.Amount,
|
||||
})
|
||||
if err == nil {
|
||||
ws.Send <- msg
|
||||
socketServer <- msg
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -154,10 +156,14 @@ func saveDB() {
|
|||
if minutes >= 5 && now > index["last"]+30 {
|
||||
seconds += minutes * 60
|
||||
msg, err := json.Marshal(struct {
|
||||
Chanel string `json:"chanel"`
|
||||
Index float64 `json:"index"`
|
||||
}{Index: float64(index["tokens"]) / float64(seconds) * 3600 * 0.05 / 1000})
|
||||
}{
|
||||
Chanel: "stripchat",
|
||||
Index: float64(index["tokens"]) / float64(seconds) * 3600 * 0.05 / 1000,
|
||||
})
|
||||
if err == nil {
|
||||
ws.Send <- msg
|
||||
socketServer <- msg
|
||||
}
|
||||
index["last"] = now
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue