stuff idk

This commit is contained in:
Ethan O'Brien
2024-05-24 12:43:34 -05:00
parent 7df2f3e277
commit baa14654f5
24 changed files with 443 additions and 794 deletions

View File

@@ -1,18 +1,13 @@
use json::object;
use json::{object, JsonValue};
use actix_web::{HttpResponse, HttpRequest};
use crate::router::global;
use crate::encryption;
pub fn error(req: HttpRequest, body: String) -> HttpResponse {
pub fn error(req: HttpRequest, body: String) -> Option<JsonValue> {
let body = json::parse(&encryption::decrypt_packet(&body).unwrap()).unwrap();
println!("client error: {}", body["code"]);
let resp = object!{
"code": 2,
"server_time": global::timestamp(),
"message": ""
};
global::send(resp, req)
None
}