mirror of
https://github.com/statbate/special-pancake.git
synced 2026-08-11 03:12:42 +00:00
fixup
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
parent
18edef423a
commit
f95ad6ce97
1 changed files with 24 additions and 27 deletions
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/url"
|
"net/url"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/gorilla/websocket"
|
"github.com/gorilla/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -25,23 +26,23 @@ func statRoom(room, room_uid, authToken string) {
|
||||||
initMessages := []string{
|
initMessages := []string{
|
||||||
`{"action":16, "connectionKey":{"accessToken":"` + authToken + `"}}`,
|
`{"action":16, "connectionKey":{"accessToken":"` + authToken + `"}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:tip_alert:` + room_uid + `","params":{}}`,
|
`{"action":10,"flags":327680,"channel":"room:tip_alert:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:purchase:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:purchase:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:fanclub:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:fanclub:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:message:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:message:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"global:push_service","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"global:push_service","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room_anon:presence:` + room_uid + `:0","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room_anon:presence:` + room_uid + `:0","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:quality_update:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:quality_update:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:notice:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:notice:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:enter_leave:` + room_uid + `","params":{}}`,
|
`{"action":10,"flags":327680,"channel":"room:enter_leave:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:password_protected:` + room_uid + `:13","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:password_protected:` + room_uid + `:13","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:mod_promoted:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:mod_promoted:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:mod_revoked:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:mod_revoked:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:status:` + room_uid + `:13","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:status:` + room_uid + `:13","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:title_change:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:title_change:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:silence:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:silence:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:kick:` + room_uid + `","params":{}}`,
|
`{"action":10,"flags":327680,"channel":"room:kick:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:update:` + room_uid + `","params":{}}`,
|
`{"action":10,"flags":327680,"channel":"room:update:` + room_uid + `","params":{}}`,
|
||||||
`{"action":10,"flags":327680,"channel":"room:settings:` + room_uid + `","params":{}}`,
|
//`{"action":10,"flags":327680,"channel":"room:settings:` + room_uid + `","params":{}}`,
|
||||||
}
|
}
|
||||||
|
|
||||||
for {
|
for {
|
||||||
|
|
@ -60,10 +61,10 @@ func statRoom(room, room_uid, authToken string) {
|
||||||
fmt.Println(string(message))
|
fmt.Println(string(message))
|
||||||
|
|
||||||
input := struct {
|
input := struct {
|
||||||
Action int `json:"action"`
|
Action int `json:"action"`
|
||||||
Key string `json:"connectionkey"`
|
Key string `json:"connectionkey"`
|
||||||
Error json.RawMessage `json:"error"`
|
Error json.RawMessage `json:"error"`
|
||||||
Channel string `json:"channel"`
|
Channel string `json:"channel"`
|
||||||
Messages json.RawMessage `json:"messages"`
|
Messages json.RawMessage `json:"messages"`
|
||||||
}{}
|
}{}
|
||||||
|
|
||||||
|
|
@ -81,14 +82,10 @@ func statRoom(room, room_uid, authToken string) {
|
||||||
init = true
|
init = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if input.Action == 15 {
|
if input.Action == 15 {
|
||||||
|
|
||||||
timeout = time.Now().Unix() + 60*60
|
timeout = time.Now().Unix() + 60*60
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if input.Channel == "room:tip_alert:"+room_uid {
|
if input.Channel == "room:tip_alert:"+room_uid {
|
||||||
|
|
||||||
tips := []struct {
|
tips := []struct {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue