mirror of
https://github.com/statbate/special-pancake.git
synced 2026-08-11 03:12:42 +00:00
update
This commit is contained in:
parent
b0ed58805a
commit
ec371734fc
1 changed files with 11 additions and 10 deletions
|
|
@ -236,7 +236,7 @@ func xWorker(workerData Info, u url.URL) {
|
||||||
fmt.Println(err.Error(), workerData.room)
|
fmt.Println(err.Error(), workerData.room)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
for _, msg := range topmsg.Messages {
|
for _, msg := range topmsg {
|
||||||
inmsg := &Data{}
|
inmsg := &Data{}
|
||||||
|
|
||||||
if err := json.Unmarshal([]byte(msg.Data), inmsg); err != nil {
|
if err := json.Unmarshal([]byte(msg.Data), inmsg); err != nil {
|
||||||
|
|
@ -244,16 +244,17 @@ func xWorker(workerData Info, u url.URL) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// inmsg.User.Username, inmsg.User.Gender, inmsg.User.IsBroadcast, inmsg.Action
|
fmt.Println(inmsg.User.Username, inmsg.User.Gender, inmsg.User.IsBroadcast, inmsg.Action, workerData.room)
|
||||||
|
|
||||||
if inmsg.User.Username == workerData.room && inmsg.User.IsBroadcast && inmsg.Action == "leave" {
|
if inmsg.User.Username == workerData.room && inmsg.User.IsBroadcast {
|
||||||
fmt.Println("leave, start ticker", workerData.room)
|
if inmsg.Action == "leave" {
|
||||||
leave.Reset(60 * 5 * time.Second)
|
fmt.Println("leave, start ticker", workerData.room)
|
||||||
}
|
leave.Reset(60 * 5 * time.Second)
|
||||||
|
}
|
||||||
if inmsg.User.Username == workerData.room && inmsg.User.IsBroadcast && inmsg.Action == "enter" {
|
if inmsg.Action == "enter" {
|
||||||
fmt.Println("enter, stop ticker", workerData.room)
|
fmt.Println("enter, stop ticker", workerData.room)
|
||||||
leave.Reset(60 * 60 * 8 * time.Second)
|
leave.Reset(60 * 60 * 8 * time.Second)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue