Skip to content

Commit

Permalink
Incorporate SlantingStds changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheiLLeniumStudios committed Jan 15, 2024
1 parent b764e6f commit 58eccf9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
9 changes: 6 additions & 3 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,9 @@ impl Client {
publisher: Sender<ClientMessage>,
) -> Self {
let tokens = authenticate.get_tokens().iter().map(|token| token.to_string()).collect();
let mut targets = Vec::with_capacity(30);
targets.resize_with(30, Default::default);
let capacity = 256;
let mut targets = Vec::with_capacity(capacity);
targets.resize_with(capacity, Default::default);

Self {
version,
Expand Down Expand Up @@ -182,13 +183,15 @@ impl Client {
let mut server_sync = ServerSync::default();
server_sync.set_max_bandwidth(144000);
server_sync.set_session(self.session_id);
server_sync.set_welcome_text("SoZ Mumble Server".to_string());
server_sync.set_welcome_text("ZUMBLE Server".to_string());

self.send_message(MessageKind::ServerSync, &server_sync).await
}

pub async fn send_server_config(&self) -> Result<(), MumbleError> {
let mut server_config = ServerConfig::default();
server_config.set_max_bandwidth(144000);
server_config.set_max_users(2048);
server_config.set_allow_html(true);
server_config.set_message_length(512);
server_config.set_image_message_length(0);
Expand Down
2 changes: 1 addition & 1 deletion src/server/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async fn handle_new_client(acceptor: TlsAcceptor,
let (version, authenticate, crypt_state) = Client::init(&mut stream, server_version).await.context("init client")?;

let (read, write) = io::split(stream);
let (tx, rx) = mpsc::channel(128);
let (tx, rx) = mpsc::channel(1024 * 4);

let username = authenticate.get_username().to_string();
let client = {
Expand Down
6 changes: 3 additions & 3 deletions src/server/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ async fn handle_packet(mut buffer: BytesMut, size: usize, addr: SocketAddr, prot
let mut send = Cursor::new(vec![0u8; 24]);
send.write_u32::<byteorder::BigEndian>(protocol_version)?;
send.write_u64::<byteorder::LittleEndian>(timestamp)?;
send.write_u32::<byteorder::BigEndian>(0)?;
send.write_u32::<byteorder::BigEndian>(250)?;
send.write_u32::<byteorder::BigEndian>(72000)?;
send.write_u32::<byteorder::BigEndian>(state.read_err().await?.clients.len() as u32)?;
send.write_u32::<byteorder::BigEndian>(2048)?;
send.write_u32::<byteorder::BigEndian>(144000)?;

socket.send_to(send.get_ref().as_slice(), addr).await?;

Expand Down

0 comments on commit 58eccf9

Please sign in to comment.