Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
@@ -0,0 +1,27 @@
|
||||
package partydata
|
||||
|
||||
import (
|
||||
"log"
|
||||
)
|
||||
|
||||
func (c *PartyData) GetPartyData() PartyDataResponse {
|
||||
req := PartyDataRequest{Type: "baseDlRequest", UUID: "UUID"}
|
||||
|
||||
c.Websocket.WriteJSON(req)
|
||||
|
||||
var res PartyDataResponse
|
||||
for {
|
||||
err := c.Websocket.ReadJSON(&res)
|
||||
if err != nil {
|
||||
log.Fatal("PartyDataRequest - Error getting party data:", err)
|
||||
}
|
||||
|
||||
if res.Type == "partyBaseData" {
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
c.Websocket.Close()
|
||||
|
||||
return res
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package partydata
|
||||
|
||||
import (
|
||||
"github.com/gorilla/websocket"
|
||||
)
|
||||
|
||||
type PartyData struct {
|
||||
Websocket *websocket.Conn
|
||||
}
|
||||
|
||||
type PartyDataRequest struct {
|
||||
Type string `json:"type"`
|
||||
UUID string `json:"uuid"`
|
||||
}
|
||||
|
||||
type PartyDataResponse struct {
|
||||
Data []struct {
|
||||
Color int `json:"color"`
|
||||
FadingColor int `json:"fadingColor"`
|
||||
HlaForceIdentifier int `json:"hlaForceIdentifier"`
|
||||
ID int `json:"id"`
|
||||
IsUsedBy bool `json:"isUsedBy"`
|
||||
Name string `json:"name"`
|
||||
RoleID int `json:"roleId"`
|
||||
} `json:"data"`
|
||||
Type string `json:"type"`
|
||||
UUID string `json:"uuid"`
|
||||
}
|
||||
Reference in new issue
Block a user