Update readme
This commit is contained in:
99
README.md
99
README.md
@ -314,46 +314,55 @@ Response body:
|
|||||||
### WS Data format
|
### WS Data format
|
||||||
- json
|
- json
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"message": message_type,
|
||||||
|
"data": ...
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
### Game state structure
|
### Game state structure
|
||||||
|
|
||||||
URI: `/game-state`
|
Message: `game_dump`
|
||||||
|
|
||||||
Data:
|
Data:
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"board": {
|
"board": {
|
||||||
"width": 21,
|
"width": 10,
|
||||||
"height": 21
|
"height": 10
|
||||||
},
|
},
|
||||||
"destination": {
|
"destination": {
|
||||||
"position": {
|
"position": {
|
||||||
"x": 10,
|
"x": 5,
|
||||||
"y": 10
|
"y": 5
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"players": [
|
"players": [
|
||||||
{
|
{
|
||||||
"id": "test-player-id",
|
"id": "test-player-pero",
|
||||||
"name": "Pero",
|
"name": "Pero",
|
||||||
"active": true,
|
"active": true,
|
||||||
"position": {
|
"position": {
|
||||||
"x": 2,
|
"x": 3,
|
||||||
"y": 2
|
"y": 3
|
||||||
},
|
},
|
||||||
"move_count": 3,
|
"move_count": 0,
|
||||||
"move_attempt_count": 3
|
"move_attempt_count": 0,
|
||||||
|
"state": "CREATED"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "95962b49-0003-4bf2-b205-71f2590f2318",
|
"id": "test-player-mirko",
|
||||||
"name": "Mirko",
|
"name": "Mirko",
|
||||||
"active": true,
|
"active": true,
|
||||||
"position": {
|
"position": {
|
||||||
"x": 0,
|
"x": 4,
|
||||||
"y": 0
|
"y": 4
|
||||||
},
|
},
|
||||||
"move_count": 15,
|
"move_count": 0,
|
||||||
"move_attempt_count": 20
|
"move_attempt_count": 0,
|
||||||
|
"state": "CREATED"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"layers": [
|
"layers": [
|
||||||
@ -363,36 +372,22 @@ Data:
|
|||||||
{
|
{
|
||||||
"type": "OBSTACLE",
|
"type": "OBSTACLE",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 4,
|
"x": 0,
|
||||||
"y": 2
|
"y": 6
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "OBSTACLE",
|
|
||||||
"position": {
|
|
||||||
"x": 4,
|
|
||||||
"y": 13
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "OBSTACLE",
|
|
||||||
"position": {
|
|
||||||
"x": 18,
|
|
||||||
"y": 18
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "OBSTACLE",
|
"type": "OBSTACLE",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 5,
|
"x": 5,
|
||||||
"y": 4
|
"y": 1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "OBSTACLE",
|
"type": "OBSTACLE",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 7,
|
"x": 1,
|
||||||
"y": 10
|
"y": 6
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -403,8 +398,8 @@ Data:
|
|||||||
{
|
{
|
||||||
"type": "DESTINATION",
|
"type": "DESTINATION",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 10,
|
"x": 5,
|
||||||
"y": 10
|
"y": 5
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -415,15 +410,15 @@ Data:
|
|||||||
{
|
{
|
||||||
"type": "PLAYER",
|
"type": "PLAYER",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 2,
|
"x": 3,
|
||||||
"y": 2
|
"y": 3
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "PLAYER",
|
"type": "PLAYER",
|
||||||
"position": {
|
"position": {
|
||||||
"x": 0,
|
"x": 4,
|
||||||
"y": 0
|
"y": 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -431,3 +426,27 @@ Data:
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Product purchase start
|
||||||
|
|
||||||
|
Message: `product_purchase_start`
|
||||||
|
|
||||||
|
Data:
|
||||||
|
```json
|
||||||
|
```
|
||||||
|
|
||||||
|
### Product purchase timer tick
|
||||||
|
|
||||||
|
Message: `product_purchase_timer_tick`
|
||||||
|
|
||||||
|
Data:
|
||||||
|
```json
|
||||||
|
```
|
||||||
|
|
||||||
|
### Product purchase timer done
|
||||||
|
|
||||||
|
Message: `product_purchase_done`
|
||||||
|
|
||||||
|
Data:
|
||||||
|
```json
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user