misc(refactor): put back error messages for malformed commands
This commit is contained in:
10
src/main.rs
10
src/main.rs
@@ -125,6 +125,8 @@ async fn handle_connection(
|
|||||||
error!("handle_player_list: {}", e);
|
error!("handle_player_list: {}", e);
|
||||||
let _ = send(&tx, e.to_string().as_str());
|
let _ = send(&tx, e.to_string().as_str());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let _ = send(&tx, "ERROR:INVALID:PLAYER");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"GAME" => {
|
"GAME" => {
|
||||||
@@ -159,6 +161,8 @@ async fn handle_connection(
|
|||||||
let _ = send(&tx, "ERROR:INVALID:TERMINATE");
|
let _ = send(&tx, "ERROR:INVALID:TERMINATE");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let _ = send(&tx, "ERROR:INVALID:GAME");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"ADMIN" => {
|
"ADMIN" => {
|
||||||
@@ -174,6 +178,8 @@ async fn handle_connection(
|
|||||||
error!("handle_admin_kick: {}", e);
|
error!("handle_admin_kick: {}", e);
|
||||||
let _ = send(&tx, e.to_string().as_str());
|
let _ = send(&tx, e.to_string().as_str());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let _ = send(&tx, "ERROR:INVALID:ADMIN");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"TOURNAMENT" => {
|
"TOURNAMENT" => {
|
||||||
@@ -201,6 +207,8 @@ async fn handle_connection(
|
|||||||
let _ = send(&tx, "ERROR:INVALID:TOURNAMENT");
|
let _ = send(&tx, "ERROR:INVALID:TOURNAMENT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let _ = send(&tx, "ERROR:INVALID:TOURNAMENT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
"GET" => {
|
"GET" => {
|
||||||
@@ -214,6 +222,8 @@ async fn handle_connection(
|
|||||||
error!("handle_get_tournament_status: {}", e);
|
error!("handle_get_tournament_status: {}", e);
|
||||||
let _ = send(&tx, e.to_string().as_str());
|
let _ = send(&tx, e.to_string().as_str());
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let _ = send(&tx, "ERROR:INVALID:GET");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
|
|||||||
Reference in New Issue
Block a user