feat: game order api methods
This commit is contained in:
@@ -40,23 +40,17 @@ type UserGamesOrder struct {
|
||||
|
||||
// UpdatedAt is the client-side timestamp used for stale-order
|
||||
// detection on the engine side.
|
||||
UpdatedAt int `json:"updatedAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
|
||||
// Commands is the player order batch.
|
||||
Commands []DecodableCommand `json:"cmd"`
|
||||
}
|
||||
|
||||
type Order struct {
|
||||
// TODO: check with already stored order, if any, and generate an error, if newer order exists
|
||||
UpdatedAt int `json:"updatedAt"`
|
||||
Commands []DecodableCommand `json:"cmd"`
|
||||
}
|
||||
|
||||
func (o Order) MarshalBinary() (data []byte, err error) {
|
||||
func (o UserGamesOrder) MarshalBinary() (data []byte, err error) {
|
||||
return json.Marshal(&o)
|
||||
}
|
||||
|
||||
func (o *Order) UnmarshalBinary(data []byte) error {
|
||||
func (o *UserGamesOrder) UnmarshalBinary(data []byte) error {
|
||||
return json.Unmarshal(data, o)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user