aboutsummaryrefslogtreecommitdiff
path: root/server/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/main.rs')
-rw-r--r--server/src/main.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/server/src/main.rs b/server/src/main.rs
index 797e21f9..8a54d7f3 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -116,7 +116,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
loop {
tick.tick().await;
if let Err(e) = state.write().await.tick_outer(dt).await {
- warn!("tick failed: {e}");
+ warn!("Tick failed: {e}");
}
}
});
@@ -125,7 +125,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
for id in (1..).map(ConnectionID) {
let (sock, addr) = ws_listener.accept().await?;
let Ok(sock) = tokio_tungstenite::accept_async(sock).await else {
- warn!("invalid ws handshake");
+ warn!("Invalid ws handshake");
continue;
};
info!("{addr} connected via websocket");
@@ -156,7 +156,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
))
.await
{
- warn!("ws error on init: {e}");
+ warn!("WebSocket error when sending initial packets: {e}");
return;
}
}
@@ -166,7 +166,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
Ok(e) => e,
Err(e) => {
rx = rx.resubscribe();
- warn!("client was lagging. resubscribed: {e}");
+ warn!("Client was lagging; resubscribed: {e}");
PacketC::ServerMessage {
text: "Lagging behind. Some clientbound packets were dropped."
.to_string(),
@@ -175,7 +175,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
}),
p = error_rx.recv() => p
) else {
- info!("client outbound sender dropped. closing connection");
+ info!("Client outbound sender dropped. closing connection");
break;
};
let message = if supports_binary.load(Ordering::Relaxed) {
@@ -184,7 +184,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
Message::Text(serde_json::to_string(&packet).unwrap())
};
if let Err(e) = write.send(message).await {
- warn!("ws error: {e}");
+ warn!("WebSocket error: {e}");
break;
}
}
@@ -197,7 +197,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
Message::Text(line) => match serde_json::from_str(&line) {
Ok(p) => p,
Err(e) => {
- warn!("invalid json packet: {e}");
+ warn!("Invalid json packet: {e}");
break;
}
},
@@ -206,7 +206,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
match bincode::decode_from_slice::<PacketS, _>(&packet, BINCODE_CONFIG) {
Ok((p, _size)) => p,
Err(e) => {
- warn!("invalid binary packet: {e}");
+ warn!("Invalid binary packet: {e}");
break;
}
}
@@ -226,7 +226,7 @@ async fn run(addr: SocketAddr) -> anyhow::Result<()> {
let packet_out = match state.write().await.packet_in_outer(id, packet).await {
Ok(packets) => packets,
Err(e) => {
- warn!("client error: {e}");
+ warn!("Client error: {e}");
vec![PacketC::Error {
message: format!("{e}"),
}]