new arch
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m11s
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m11s
This commit is contained in:
19
src/models/protocol.go
Normal file
19
src/models/protocol.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package models
|
||||
|
||||
type MsgType string
|
||||
|
||||
const (
|
||||
InputMsgType MsgType = "input"
|
||||
ChatMsgType MsgType = "chat"
|
||||
)
|
||||
|
||||
type InputMessage struct {
|
||||
PlayerID int64
|
||||
DX float64 `json:"dx"`
|
||||
DY float64 `json:"dy"`
|
||||
}
|
||||
|
||||
type StateMessage struct {
|
||||
Type MsgType `json:"type"`
|
||||
Payload any `json:"payload"`
|
||||
}
|
||||
Reference in New Issue
Block a user