1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00

make it compile

This commit is contained in:
mat 2022-10-30 20:02:20 -05:00
parent 430d812dd7
commit 4e5b4be30d
4 changed files with 13 additions and 13 deletions

View file

@ -2,9 +2,8 @@ use std::time::{SystemTime, UNIX_EPOCH};
use azalea_crypto::MessageSignature;
use azalea_protocol::packets::game::{
clientbound_player_chat_packet::LastSeenMessagesUpdate,
serverbound_chat_command_packet::ServerboundChatCommandPacket,
serverbound_chat_packet::ServerboundChatPacket,
serverbound_chat_packet::{LastSeenMessagesUpdate, ServerboundChatPacket},
};
use crate::Client;
@ -16,7 +15,7 @@ impl Client {
/// should use that instead.
pub async fn send_chat_packet(&self, message: &str) -> Result<(), std::io::Error> {
// TODO: chat signing
let signature = sign_message();
// let signature = sign_message();
let packet = ServerboundChatPacket {
message: message.to_string(),
timestamp: SystemTime::now()
@ -26,8 +25,7 @@ impl Client {
.try_into()
.expect("Instant should fit into a u64"),
salt: azalea_crypto::make_salt(),
signature,
signed_preview: false,
signature: None,
last_seen_messages: LastSeenMessagesUpdate::default(),
}
.get();
@ -48,7 +46,6 @@ impl Client {
.expect("Instant should fit into a u64"),
salt: azalea_crypto::make_salt(),
argument_signatures: vec![],
signed_preview: false,
last_seen_messages: LastSeenMessagesUpdate::default(),
}
.get();

View file

@ -179,6 +179,14 @@ where
Ok(())
}
}
impl<const N: usize> Default for FixedBitSet<N>
where
[u64; N.div_ceil(64)]: Sized,
{
fn default() -> Self {
Self::new()
}
}
#[cfg(test)]
mod tests {

View file

@ -9,15 +9,10 @@ pub struct ServerboundChatCommandPacket {
pub command: String,
pub timestamp: u64,
pub salt: u64,
pub argument_signatures: ArgumentSignatures,
pub argument_signatures: Vec<ArgumentSignature>,
pub last_seen_messages: LastSeenMessagesUpdate,
}
#[derive(Clone, Debug, McBuf)]
pub struct ArgumentSignatures {
pub entries: Vec<ArgumentSignature>,
}
#[derive(Clone, Debug, McBuf)]
pub struct ArgumentSignature {
pub name: String,

View file

@ -12,7 +12,7 @@ pub struct ServerboundChatPacket {
pub last_seen_messages: LastSeenMessagesUpdate,
}
#[derive(Clone, Debug, McBuf)]
#[derive(Clone, Debug, McBuf, Default)]
pub struct LastSeenMessagesUpdate {
#[var]
pub offset: u32,