cloud-game/pkg/api/worker.go
Sergey Stepanov cd056ee976
Bump to v3
2023-03-16 23:46:53 +03:00

68 lines
1.3 KiB
Go

package api
import "github.com/giongto35/cloud-game/v3/pkg/network"
type GameInfo struct {
Name string `json:"name"`
Base string `json:"base"`
Path string `json:"path"`
Type string `json:"type"`
}
type (
ChangePlayerRequest = struct {
StatefulRoom
Index int `json:"index"`
}
ChangePlayerResponse int
GameQuitRequest struct {
StatefulRoom
}
LoadGameRequest struct {
StatefulRoom
}
LoadGameResponse string
SaveGameRequest struct {
StatefulRoom
}
SaveGameResponse string
StartGameRequest struct {
StatefulRoom
Record bool
RecordUser string
Game GameInfo `json:"game"`
PlayerIndex int `json:"player_index"`
}
StartGameResponse struct {
Room
Record bool
}
RecordGameRequest struct {
StatefulRoom
Active bool `json:"active"`
User string `json:"user"`
}
RecordGameResponse string
TerminateSessionRequest struct {
Stateful
}
ToggleMultitapRequest struct {
StatefulRoom
}
WebrtcAnswerRequest struct {
Stateful
Sdp string `json:"sdp"`
}
WebrtcIceCandidateRequest struct {
Stateful
Candidate string `json:"candidate"`
}
WebrtcInitRequest struct {
Stateful
}
WebrtcInitResponse string
)
func NewWebrtcIceCandidateRequest(id network.Uid, can string) (PT, any) {
return WebrtcIce, WebrtcIceCandidateRequest{Stateful: Stateful{id}, Candidate: can}
}