pub struct AutohostUpdateEvent {
pub command_id: Value,
pub data: AutohostUpdateEventData,
pub message_id: String,
pub type_: Value,
}Expand description
AutohostUpdateEvent
JSON schema
{
"title": "AutohostUpdateEvent",
"type": "object",
"required": [
"commandId",
"data",
"messageId",
"type"
],
"properties": {
"commandId": {
"const": "autohost/update"
},
"data": {
"title": "AutohostUpdateEventData",
"type": "object",
"required": [
"battleId",
"time",
"update"
],
"properties": {
"battleId": {
"type": "string",
"format": "uuid"
},
"time": {
"$ref": "#/definitions/unixTime"
},
"update": {
"anyOf": [
{
"title": "StartUpdate",
"description": "The battle has started.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"const": "start"
}
}
},
{
"title": "FinishedUpdate",
"description": "The battle finished, generated once per every single player reporting who won.",
"type": "object",
"required": [
"type",
"userId",
"winningAllyTeams"
],
"properties": {
"type": {
"const": "finished"
},
"userId": {
"$ref": "#/definitions/userId"
},
"winningAllyTeams": {
"description": "Ally team IDs",
"type": "array",
"items": {
"type": "integer"
},
"minItems": 1
}
}
},
{
"title": "EngineMessageUpdate",
"description": "A message from the engine, e.g. some ip is trying to connect.",
"type": "object",
"required": [
"message",
"type"
],
"properties": {
"message": {
"type": "string"
},
"type": {
"const": "engine_message"
}
}
},
{
"title": "EngineWarningUpdate",
"description": "A warning from the engine.",
"type": "object",
"required": [
"message",
"type"
],
"properties": {
"message": {
"type": "string"
},
"type": {
"const": "engine_warning"
}
}
},
{
"title": "EngineQuitUpdate",
"description": "The engine process for battle has quit cleanly, no more updates will be sent for this battle.",
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"const": "engine_quit"
}
}
},
{
"title": "EngineCrashUpdate",
"description": "The engine process for battle has crashed, no more updates will be sent for this battle.",
"type": "object",
"required": [
"type"
],
"properties": {
"details": {
"description": "Optional, short, details of the crash.",
"type": "string"
},
"type": {
"const": "engine_crash"
}
}
},
{
"title": "PlayerJoinedUpdate",
"type": "object",
"required": [
"playerNumber",
"type",
"userId"
],
"properties": {
"playerNumber": {
"description": "Player number in the game, can be useful for custom commands",
"type": "integer"
},
"type": {
"const": "player_joined"
},
"userId": {
"$ref": "#/definitions/userId"
}
}
},
{
"title": "PlayerLeftUpdate",
"type": "object",
"required": [
"reason",
"type",
"userId"
],
"properties": {
"reason": {
"enum": [
"lost_connection",
"left",
"kicked"
]
},
"type": {
"const": "player_left"
},
"userId": {
"$ref": "#/definitions/userId"
}
}
},
{
"title": "PlayerChatUpdate",
"anyOf": [
{
"type": "object",
"required": [
"destination",
"message",
"type",
"userId"
],
"properties": {
"destination": {
"enum": [
"allies",
"all",
"spectators"
]
},
"message": {
"type": "string"
},
"type": {
"const": "player_chat"
},
"userId": {
"$ref": "#/definitions/userId"
}
}
},
{
"type": "object",
"required": [
"destination",
"message",
"toUserId",
"type",
"userId"
],
"properties": {
"destination": {
"const": "player"
},
"message": {
"type": "string"
},
"toUserId": {
"$ref": "#/definitions/userId"
},
"type": {
"const": "player_chat"
},
"userId": {
"$ref": "#/definitions/userId"
}
}
}
]
},
{
"title": "PlayerDefeatedUpdate",
"type": "object",
"required": [
"type",
"userId"
],
"properties": {
"type": {
"const": "player_defeated"
},
"userId": {
"$ref": "#/definitions/userId"
}
}
},
{
"title": "LuaMsgUpdate",
"description": "This update is generated only for messages matching luamsgRegexp set in the battle start script.",
"type": "object",
"required": [
"data",
"script",
"type",
"userId"
],
"properties": {
"data": {
"type": "string",
"contentEncoding": "base64",
"contentMediaType": "application/octet-stream"
},
"script": {
"enum": [
"ui",
"game",
"rules"
]
},
"type": {
"const": "luamsg"
},
"uiMode": {
"description": "Set when script is 'ui'",
"enum": [
"all",
"allies",
"spectators"
]
},
"userId": {
"$ref": "#/definitions/userId"
}
}
}
]
}
}
},
"messageId": {
"type": "string"
},
"type": {
"const": "event"
}
},
"tachyon": {
"scopes": [
"tachyon.lobby"
],
"source": "autohost",
"target": "server"
}
}Fields§
§command_id: Value§data: AutohostUpdateEventData§message_id: String§type_: ValueImplementations§
Source§impl AutohostUpdateEvent
impl AutohostUpdateEvent
pub fn builder() -> AutohostUpdateEvent
Trait Implementations§
Source§impl Clone for AutohostUpdateEvent
impl Clone for AutohostUpdateEvent
Source§fn clone(&self) -> AutohostUpdateEvent
fn clone(&self) -> AutohostUpdateEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AutohostUpdateEvent
impl Debug for AutohostUpdateEvent
Source§impl<'de> Deserialize<'de> for AutohostUpdateEvent
impl<'de> Deserialize<'de> for AutohostUpdateEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AutohostUpdateEvent> for AutohostUpdateEvent
impl From<AutohostUpdateEvent> for AutohostUpdateEvent
Source§fn from(value: AutohostUpdateEvent) -> Self
fn from(value: AutohostUpdateEvent) -> Self
Converts to this type from the input type.
Source§impl Serialize for AutohostUpdateEvent
impl Serialize for AutohostUpdateEvent
Source§impl TryFrom<AutohostUpdateEvent> for AutohostUpdateEvent
impl TryFrom<AutohostUpdateEvent> for AutohostUpdateEvent
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: AutohostUpdateEvent) -> Result<Self, ConversionError>
fn try_from(value: AutohostUpdateEvent) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for AutohostUpdateEvent
impl RefUnwindSafe for AutohostUpdateEvent
impl Send for AutohostUpdateEvent
impl Sync for AutohostUpdateEvent
impl Unpin for AutohostUpdateEvent
impl UnsafeUnpin for AutohostUpdateEvent
impl UnwindSafe for AutohostUpdateEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more