1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone)]
pub struct LoginRequestPacket {
    pub character_id: u64,
    pub ticket: String,
    pub client_protocol: String,
    pub client_build: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<bool>, // used internnaly to identify deserialization errors
}

#[derive(Serialize, Deserialize, Clone)]
pub struct LoginReplyPacket {
    pub logged_in: bool,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<bool>, // used internnaly to identify deserialization errors
}

#[derive(Serialize, Deserialize)]
pub struct ChannelIsRoutablePacket {
    pub is_routable: bool,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub error: Option<bool>, // used internnaly to identify deserialization errors
}

#[derive(Serialize)]
// Internal
pub struct TunnelPacket {
    pub name: &'static str,
    pub channel: u8,
    pub tunnel_data: Vec<u8>,
}