|
204 | 204 | "startedAt": { "$ref": "#/definitions/unixTime" } |
205 | 205 | }, |
206 | 206 | "required": ["startedAt"] |
| 207 | + }, |
| 208 | + "currentVote": { |
| 209 | + "type": "object", |
| 210 | + "properties": { |
| 211 | + "id": { "type": "string" }, |
| 212 | + "action": { "$ref": "#/definitions/voteActions" }, |
| 213 | + "initiator": { "$ref": "#/definitions/userId" }, |
| 214 | + "voters": { |
| 215 | + "description": "indexed by the userId. The initiator is also included in this object", |
| 216 | + "type": "object", |
| 217 | + "patternProperties": { |
| 218 | + "^(.*)$": { |
| 219 | + "type": "object", |
| 220 | + "properties": { |
| 221 | + "vote": { |
| 222 | + "enum": [ |
| 223 | + "pending", |
| 224 | + "yes", |
| 225 | + "no", |
| 226 | + "abstain" |
| 227 | + ] |
| 228 | + } |
| 229 | + }, |
| 230 | + "required": ["vote"] |
| 231 | + } |
| 232 | + } |
| 233 | + }, |
| 234 | + "until": { "$ref": "#/definitions/unixTime" } |
| 235 | + }, |
| 236 | + "required": ["id", "action", "initiator", "voters", "until"] |
207 | 237 | } |
208 | 238 | }, |
209 | 239 | "required": [ |
|
503 | 533 | "status" |
504 | 534 | ] |
505 | 535 | }, |
506 | | - "userId": { "type": "string", "examples": ["351"] } |
| 536 | + "userId": { "type": "string", "examples": ["351"] }, |
| 537 | + "voteActions": { |
| 538 | + "anyOf": [ |
| 539 | + { |
| 540 | + "type": "object", |
| 541 | + "properties": { "type": { "const": "start" } }, |
| 542 | + "required": ["type"] |
| 543 | + }, |
| 544 | + { |
| 545 | + "type": "object", |
| 546 | + "properties": { |
| 547 | + "type": { "const": "changeMap" }, |
| 548 | + "newMapName": { "type": "string" } |
| 549 | + }, |
| 550 | + "required": ["type", "newMapName"] |
| 551 | + } |
| 552 | + ] |
| 553 | + } |
507 | 554 | }, |
508 | 555 | "anyOf": [ |
509 | 556 | { |
|
3538 | 3585 | }, |
3539 | 3586 | { "type": "null" } |
3540 | 3587 | ] |
| 3588 | + }, |
| 3589 | + "currentVote": { |
| 3590 | + "anyOf": [ |
| 3591 | + { |
| 3592 | + "type": "object", |
| 3593 | + "properties": { |
| 3594 | + "id": { "type": "string" }, |
| 3595 | + "action": { |
| 3596 | + "anyOf": [ |
| 3597 | + { |
| 3598 | + "$ref": "#/definitions/voteActions" |
| 3599 | + }, |
| 3600 | + { "type": "null" } |
| 3601 | + ] |
| 3602 | + }, |
| 3603 | + "initiator": { |
| 3604 | + "$ref": "#/definitions/userId" |
| 3605 | + }, |
| 3606 | + "voters": { |
| 3607 | + "type": "object", |
| 3608 | + "patternProperties": { |
| 3609 | + "^(.*)$": { |
| 3610 | + "type": "object", |
| 3611 | + "properties": { |
| 3612 | + "vote": { |
| 3613 | + "enum": [ |
| 3614 | + "pending", |
| 3615 | + "yes", |
| 3616 | + "no", |
| 3617 | + "abstain" |
| 3618 | + ] |
| 3619 | + } |
| 3620 | + }, |
| 3621 | + "required": ["vote"] |
| 3622 | + } |
| 3623 | + } |
| 3624 | + }, |
| 3625 | + "until": { |
| 3626 | + "$ref": "#/definitions/unixTime" |
| 3627 | + } |
| 3628 | + }, |
| 3629 | + "required": ["id"] |
| 3630 | + }, |
| 3631 | + { "type": "null" } |
| 3632 | + ] |
3541 | 3633 | } |
3542 | 3634 | }, |
3543 | 3635 | "required": ["id"] |
3544 | 3636 | } |
3545 | 3637 | }, |
3546 | 3638 | "required": ["type", "messageId", "commandId", "data"] |
3547 | 3639 | }, |
| 3640 | + { |
| 3641 | + "title": "LobbyVoteEndedEvent", |
| 3642 | + "tachyon": { |
| 3643 | + "source": "server", |
| 3644 | + "target": "user", |
| 3645 | + "scopes": ["tachyon.lobby"] |
| 3646 | + }, |
| 3647 | + "type": "object", |
| 3648 | + "properties": { |
| 3649 | + "type": { "const": "event" }, |
| 3650 | + "messageId": { "type": "string" }, |
| 3651 | + "commandId": { "const": "lobby/voteEnded" }, |
| 3652 | + "data": { |
| 3653 | + "title": "LobbyVoteEndedEventData", |
| 3654 | + "type": "object", |
| 3655 | + "properties": { |
| 3656 | + "id": { "type": "string" }, |
| 3657 | + "outcome": { |
| 3658 | + "enum": ["passed", "failed", "cancelled", "timeout"] |
| 3659 | + } |
| 3660 | + }, |
| 3661 | + "required": ["id", "outcome"] |
| 3662 | + } |
| 3663 | + }, |
| 3664 | + "required": ["type", "messageId", "commandId", "data"] |
| 3665 | + }, |
| 3666 | + { |
| 3667 | + "title": "LobbyVoteSubmitRequest", |
| 3668 | + "tachyon": { |
| 3669 | + "source": "user", |
| 3670 | + "target": "server", |
| 3671 | + "scopes": ["tachyon.lobby"] |
| 3672 | + }, |
| 3673 | + "type": "object", |
| 3674 | + "properties": { |
| 3675 | + "type": { "const": "request" }, |
| 3676 | + "messageId": { "type": "string" }, |
| 3677 | + "commandId": { "const": "lobby/voteSubmit" }, |
| 3678 | + "data": { |
| 3679 | + "title": "LobbyVoteSubmitRequestData", |
| 3680 | + "type": "object", |
| 3681 | + "properties": { |
| 3682 | + "id": { "type": "string" }, |
| 3683 | + "vote": { "enum": ["yes", "no", "abstain"] } |
| 3684 | + }, |
| 3685 | + "required": ["id", "vote"] |
| 3686 | + } |
| 3687 | + }, |
| 3688 | + "required": ["type", "messageId", "commandId", "data"] |
| 3689 | + }, |
| 3690 | + { |
| 3691 | + "title": "LobbyVoteSubmitResponse", |
| 3692 | + "tachyon": { |
| 3693 | + "source": "server", |
| 3694 | + "target": "user", |
| 3695 | + "scopes": ["tachyon.lobby"] |
| 3696 | + }, |
| 3697 | + "anyOf": [ |
| 3698 | + { |
| 3699 | + "title": "LobbyVoteSubmitOkResponse", |
| 3700 | + "type": "object", |
| 3701 | + "properties": { |
| 3702 | + "type": { "const": "response" }, |
| 3703 | + "messageId": { "type": "string" }, |
| 3704 | + "commandId": { "const": "lobby/voteSubmit" }, |
| 3705 | + "status": { "const": "success" } |
| 3706 | + }, |
| 3707 | + "required": ["type", "messageId", "commandId", "status"] |
| 3708 | + }, |
| 3709 | + { |
| 3710 | + "title": "LobbyVoteSubmitFailResponse", |
| 3711 | + "type": "object", |
| 3712 | + "properties": { |
| 3713 | + "type": { "const": "response" }, |
| 3714 | + "messageId": { "type": "string" }, |
| 3715 | + "commandId": { "const": "lobby/voteSubmit" }, |
| 3716 | + "status": { "const": "failed" }, |
| 3717 | + "reason": { |
| 3718 | + "enum": [ |
| 3719 | + "internal_error", |
| 3720 | + "unauthorized", |
| 3721 | + "invalid_request", |
| 3722 | + "command_unimplemented" |
| 3723 | + ] |
| 3724 | + }, |
| 3725 | + "details": { "type": "string" } |
| 3726 | + }, |
| 3727 | + "required": [ |
| 3728 | + "type", |
| 3729 | + "messageId", |
| 3730 | + "commandId", |
| 3731 | + "status", |
| 3732 | + "reason" |
| 3733 | + ] |
| 3734 | + } |
| 3735 | + ] |
| 3736 | + }, |
3548 | 3737 | { |
3549 | 3738 | "title": "MatchmakingCancelRequest", |
3550 | 3739 | "tachyon": { |
|
0 commit comments