This commit is contained in:
poiuty 2023-05-14 13:57:18 +03:00
parent 4b0b928cef
commit e42f70e789
3 changed files with 43 additions and 44 deletions

View file

@ -93,8 +93,8 @@ func initClickhouse() {
func socketHandler() { func socketHandler() {
var( var (
err error err error
conn net.Conn conn net.Conn
) )
@ -159,7 +159,7 @@ func fastStart() {
workerData := Info{ workerData := Info{
room: k, room: k,
Id: v.Id, Id: v.Id,
Auth: v.Auth, Auth: v.Auth,
Proxy: v.Proxy, Proxy: v.Proxy,
Online: v.Online, Online: v.Online,
Start: v.Start, Start: v.Start,

View file

@ -172,8 +172,8 @@ func saveDB() {
Chanel string `json:"chanel"` Chanel string `json:"chanel"`
Index int64 `json:"index"` Index int64 `json:"index"`
}{ }{
Chanel: "chaturbate", Chanel: "chaturbate",
Index: index["tokens"] / int64(seconds) * 3600 / 1000 * 5 / 100, Index: index["tokens"] / int64(seconds) * 3600 / 1000 * 5 / 100,
}) })
if err == nil { if err == nil {
socketServer <- msg socketServer <- msg

View file

@ -5,8 +5,8 @@ import (
"net/http" "net/http"
//"net/url" //"net/url"
//"strconv" //"strconv"
"time"
"net/url" "net/url"
"time"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
@ -56,11 +56,11 @@ func announceCount() {
rooms.Count <- 0 rooms.Count <- 0
l := <-rooms.Count l := <-rooms.Count
msg, err := json.Marshal(struct { msg, err := json.Marshal(struct {
Chanel string `json:"chanel"` Chanel string `json:"chanel"`
Count int `json:"count"` Count int `json:"count"`
}{ }{
Chanel: "chaturbate", Chanel: "chaturbate",
Count: l Count: l,
}) })
if err == nil { if err == nil {
socketServer <- msg socketServer <- msg
@ -140,10 +140,10 @@ func xWorker(workerData Info, u url.URL) {
slog <- saveLog{Rid: workerData.Rid, Now: time.Now().Unix(), Mes: string(message)} slog <- saveLog{Rid: workerData.Rid, Now: time.Now().Unix(), Mes: string(message)}
input := struct { input := struct {
Action int `json:"action"` Action int `json:"action"`
Key string `json:"connectionkey"` Key string `json:"connectionkey"`
Error jsoniter.RawMessage `json:"error"` Error jsoniter.RawMessage `json:"error"`
Channel string `json:"channel"` Channel string `json:"channel"`
Messages jsoniter.RawMessage `json:"messages"` Messages jsoniter.RawMessage `json:"messages"`
}{} }{}
@ -182,7 +182,6 @@ func xWorker(workerData Info, u url.URL) {
} }
} }
for { for {
select { select {