Browse Source

remove some debug statements

pbs
jake 5 years ago
parent
commit
7664771cf5
  1. 6
      src/common/client.rs
  2. 1
      src/common/clientpool.rs
  3. 4
      src/common/mainloop.rs

6
src/common/client.rs

@ -95,7 +95,7 @@ impl<S, R> Client<S, R> where
let pkt_data = self.incoming_data.drain(..pkt_len).collect::<Vec<_>>();
println!("[recv: buf] {:?}", pkt_data);
//println!("[recv: buf] {:?}", pkt_data);
let pkt = R::from_bytes(&pkt_data[..pkt_size])
.map_err(|err| -> PacketNetworkError { err.into() })?;
@ -108,12 +108,12 @@ impl<S, R> Client<S, R> where
pub fn send_pkt(&mut self, pkt: S) {
println!("[send] {:?}", pkt);
let buf = pkt.as_bytes();
if buf.len() < 1024*2 {
/*if buf.len() < 1024*2 {
println!("[send: buf] {:?}", buf);
}
else {
println!("[send: buf] [...large buffer...]");
}
}*/
let mut cbuf = self.cipher_out.encrypt(&buf).unwrap();
self.send_buffer.append(&mut cbuf);
self.send_data();

1
src/common/clientpool.rs

@ -103,7 +103,6 @@ impl<S, R> ClientPool<S, R> where
Ok(action) => {
match action {
ClientAction::EncryptionKeys(client_id, cipher_in, cipher_out) => {
println!("enc {:?}", client_id);
self.clients.get_mut(&client_id)
.map(|client| {
client.set_cipher(cipher_in, cipher_out);

4
src/common/mainloop.rs

@ -5,10 +5,6 @@ use mio_extras::channel::{channel, Sender, Receiver};
use crate::common::clientpool::{ClientPool, ClientAction, ClientPoolAction};
use crate::common::serverstate::{RecvServerPacket, SendServerPacket, ServerState, OnConnect};
fn recv_from_clientpool<STATE, S, R, E>(state: &mut STATE,
pool_recv: &Receiver<ClientPoolAction<R>>,
pool_send: &Sender<ClientAction<S>>) where

Loading…
Cancel
Save