This commit is contained in:
shenjack-5600u 2025-04-11 01:05:02 +08:00
parent 56469f6fbb
commit f4ceef050f
Signed by: shenjack
GPG Key ID: FDF9864E11C7E79F

View File

@ -8,7 +8,7 @@ use ed25519_dalek::{Signature, Signer, SigningKey};
use rust_socketio::Payload; use rust_socketio::Payload;
use rust_socketio::asynchronous::Client; use rust_socketio::asynchronous::Client;
use serde_json::{Value, json}; use serde_json::{Value, json};
use tracing::{Level, event, span, warn}; use tracing::{Level, event, span};
/// "安全" 的 发送一条消息 /// "安全" 的 发送一条消息
pub async fn send_message(client: &Client, message: &SendMessage) -> bool { pub async fn send_message(client: &Client, message: &SendMessage) -> bool {
@ -19,7 +19,7 @@ pub async fn send_message(client: &Client, message: &SendMessage) -> bool {
true true
} }
Err(e) => { Err(e) => {
warn!("send_message faild:{}", format!("{:#?}", e).red()); event!(Level::WARN, "send_message faild:{}", format!("{:#?}", e).red());
false false
} }
} }
@ -71,7 +71,8 @@ async fn inner_sign(payload: Payload, client: &Client) -> ClientResult<(), IcaEr
.as_str() .as_str()
.unwrap_or("unknow"); .unwrap_or("unknow");
if server_protocol_version != crate::ica::ICA_PROTOCOL_VERSION { if server_protocol_version != crate::ica::ICA_PROTOCOL_VERSION {
warn!( event!(
Level::WARN,
"服务器版本与兼容版本不一致\n服务器协议版本:{:?}\n兼容版本:{}", "服务器版本与兼容版本不一致\n服务器协议版本:{:?}\n兼容版本:{}",
version.get("protocolVersion"), version.get("protocolVersion"),
crate::ica::ICA_PROTOCOL_VERSION crate::ica::ICA_PROTOCOL_VERSION