1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-04-27 17:07:46 +00:00
kawari/src/bin/kawari-patch.rs

40 lines
No EOL
1.1 KiB
Rust

use std::net::SocketAddr;
use axum::{Form, Json, Router, routing::get};
use axum::extract::Query;
use axum::response::Html;
use axum::routing::post;
use serde::{Deserialize, Serialize};
use kawari::config::Config;
use axum::extract::Path;
use axum::response::IntoResponse;
use axum::http::HeaderMap;
async fn verify_session(Path(game_version): Path<String>, Path(sid): Path<String>) -> impl IntoResponse {
let mut headers = HeaderMap::new();
headers.insert("X-Patch-Unique-Id", sid.parse().unwrap());
(headers)
}
async fn verify_boot(Path(boot_version): Path<String>) -> impl IntoResponse {
let mut headers = HeaderMap::new();
(headers)
}
#[tokio::main]
async fn main() {
tracing_subscriber::fmt::init();
let app = Router::new()
.route("/http/win32/ffxivneo_release_game/:game_version/:sid", post(verify_session))
.route("/http/win32/ffxivneo_release_boot/:boot_version", get(verify_boot));
let addr = SocketAddr::from(([127, 0, 0, 1], 6900));
tracing::info!("Frontier server started on {}", addr);
axum::Server::bind(&addr)
.serve(app.into_make_service())
.await
.unwrap();
}