pub struct AutohostUpdateEventDataUpdate {
pub subtype_0: Option<StartUpdate>,
pub subtype_1: Option<FinishedUpdate>,
pub subtype_2: Option<EngineMessageUpdate>,
pub subtype_3: Option<EngineWarningUpdate>,
pub subtype_4: Option<EngineQuitUpdate>,
pub subtype_5: Option<EngineCrashUpdate>,
pub subtype_6: Option<PlayerJoinedUpdate>,
pub subtype_7: Option<PlayerLeftUpdate>,
pub subtype_8: Option<PlayerChatUpdate>,
pub subtype_9: Option<PlayerDefeatedUpdate>,
pub subtype_10: Option<LuaMsgUpdate>,
}Expand description
AutohostUpdateEventDataUpdate
JSON schema
{
"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"
}
}
}
]
}Fields§
§subtype_0: Option<StartUpdate>§subtype_1: Option<FinishedUpdate>§subtype_2: Option<EngineMessageUpdate>§subtype_3: Option<EngineWarningUpdate>§subtype_4: Option<EngineQuitUpdate>§subtype_5: Option<EngineCrashUpdate>§subtype_6: Option<PlayerJoinedUpdate>§subtype_7: Option<PlayerLeftUpdate>§subtype_8: Option<PlayerChatUpdate>§subtype_9: Option<PlayerDefeatedUpdate>§subtype_10: Option<LuaMsgUpdate>Implementations§
Trait Implementations§
Source§impl Clone for AutohostUpdateEventDataUpdate
impl Clone for AutohostUpdateEventDataUpdate
Source§fn clone(&self) -> AutohostUpdateEventDataUpdate
fn clone(&self) -> AutohostUpdateEventDataUpdate
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<'de> Deserialize<'de> for AutohostUpdateEventDataUpdate
impl<'de> Deserialize<'de> for AutohostUpdateEventDataUpdate
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<AutohostUpdateEventDataUpdate> for AutohostUpdateEventDataUpdate
impl From<AutohostUpdateEventDataUpdate> for AutohostUpdateEventDataUpdate
Source§fn from(value: AutohostUpdateEventDataUpdate) -> Self
fn from(value: AutohostUpdateEventDataUpdate) -> Self
Converts to this type from the input type.
Source§impl TryFrom<AutohostUpdateEventDataUpdate> for AutohostUpdateEventDataUpdate
impl TryFrom<AutohostUpdateEventDataUpdate> for AutohostUpdateEventDataUpdate
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(
value: AutohostUpdateEventDataUpdate,
) -> Result<Self, ConversionError>
fn try_from( value: AutohostUpdateEventDataUpdate, ) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for AutohostUpdateEventDataUpdate
impl RefUnwindSafe for AutohostUpdateEventDataUpdate
impl Send for AutohostUpdateEventDataUpdate
impl Sync for AutohostUpdateEventDataUpdate
impl Unpin for AutohostUpdateEventDataUpdate
impl UnsafeUnpin for AutohostUpdateEventDataUpdate
impl UnwindSafe for AutohostUpdateEventDataUpdate
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