pub struct AutohostUpdateEventData {
pub battle_id: Uuid,
pub time: UnixTime,
pub update: AutohostUpdateEventDataUpdate,
}Expand description
AutohostUpdateEventData
JSON schema
{
"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"
}
}
}
]
}
}
}Fields§
§battle_id: Uuid§time: UnixTime§update: AutohostUpdateEventDataUpdateImplementations§
Source§impl AutohostUpdateEventData
impl AutohostUpdateEventData
pub fn builder() -> AutohostUpdateEventData
Trait Implementations§
Source§impl Clone for AutohostUpdateEventData
impl Clone for AutohostUpdateEventData
Source§fn clone(&self) -> AutohostUpdateEventData
fn clone(&self) -> AutohostUpdateEventData
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 AutohostUpdateEventData
impl Debug for AutohostUpdateEventData
Source§impl<'de> Deserialize<'de> for AutohostUpdateEventData
impl<'de> Deserialize<'de> for AutohostUpdateEventData
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<AutohostUpdateEventData> for AutohostUpdateEventData
impl From<AutohostUpdateEventData> for AutohostUpdateEventData
Source§fn from(value: AutohostUpdateEventData) -> Self
fn from(value: AutohostUpdateEventData) -> Self
Converts to this type from the input type.
Source§impl Serialize for AutohostUpdateEventData
impl Serialize for AutohostUpdateEventData
Source§impl TryFrom<AutohostUpdateEventData> for AutohostUpdateEventData
impl TryFrom<AutohostUpdateEventData> for AutohostUpdateEventData
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: AutohostUpdateEventData) -> Result<Self, ConversionError>
fn try_from(value: AutohostUpdateEventData) -> Result<Self, ConversionError>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for AutohostUpdateEventData
impl RefUnwindSafe for AutohostUpdateEventData
impl Send for AutohostUpdateEventData
impl Sync for AutohostUpdateEventData
impl Unpin for AutohostUpdateEventData
impl UnsafeUnpin for AutohostUpdateEventData
impl UnwindSafe for AutohostUpdateEventData
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