mirror of
https://github.com/yoncodes/BD2PS.git
synced 2026-08-05 06:12:14 +02:00
pushing
This commit is contained in:
20
httpserver/src/routes/game/achievement_clear.rs
Normal file
20
httpserver/src/routes/game/achievement_clear.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result };
|
||||
use bd2::proto::proto_net::AchievementClearRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::achievement_clear;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("AchievementClear")]
|
||||
async fn achievement_clear_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<AchievementClearRequest>("AchievementClear", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse AchievementClear: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = achievement_clear::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/achievement_info.rs
Normal file
20
httpserver/src/routes/game/achievement_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::AchievementInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::achievement_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("AchievementInfo")]
|
||||
async fn achievement_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<AchievementInfoRequest>("AchievementInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse AchievementInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = achievement_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/achievement_update.rs
Normal file
21
httpserver/src/routes/game/achievement_update.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::AchievementUpdateRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::achievement_update;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("AchievementUpdate")]
|
||||
async fn achievement_update_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<AchievementUpdateRequest>("AchievementUpdate", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse AchievementUpdate: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = achievement_update::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/active_map.rs
Normal file
20
httpserver/src/routes/game/active_map.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::ActiveMapRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::active_map;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("ActiveMap")]
|
||||
async fn active_map_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<ActiveMapRequest>("ActiveMap", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse ActiveMap: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = active_map::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/alchemy.rs
Normal file
20
httpserver/src/routes/game/alchemy.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::AlchemyRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::alchemy;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("Alchemy")]
|
||||
async fn alchemy_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<AlchemyRequest>("Alchemy", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse Alchemy: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = alchemy::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/alchemy_batch.rs
Normal file
20
httpserver/src/routes/game/alchemy_batch.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::AlchemyBatchRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::alchemy_batch;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("AlchemyBatch")]
|
||||
async fn alchemy_batch_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<AlchemyBatchRequest>("AlchemyBatch", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse AlchemyBatch: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = alchemy_batch::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
23
httpserver/src/routes/game/all_char_refresh.rs
Normal file
23
httpserver/src/routes/game/all_char_refresh.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::AllCharRefreshRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::all_char_refresh;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("AllCharRefresh")]
|
||||
async fn all_char_refresh_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
|
||||
let req = parse_packet::<AllCharRefreshRequest>("AllCharRefresh", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse AllCharRefresh: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
|
||||
let response = all_char_refresh::handle(&pool, uid, req).await;
|
||||
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
23
httpserver/src/routes/game/attendance.rs
Normal file
23
httpserver/src/routes/game/attendance.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::AttendanceRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::attendance;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("Attendance")]
|
||||
async fn attendance_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
|
||||
let req = parse_packet::<AttendanceRequest>("Attendance", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse Attendance: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
|
||||
let response = attendance::handle(&pool, uid, req).await;
|
||||
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/attendance_info.rs
Normal file
21
httpserver/src/routes/game/attendance_info.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{HttpResponse, Result, put, web};
|
||||
use bd2::proto::proto_net::AttendanceInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::attendance;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("AttendanceInfo")]
|
||||
async fn attendance_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<AttendanceInfoRequest>("AttendanceInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse AttendanceInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
//let response = attendance_info::handle(&pool, uid, req).await;
|
||||
let response = ""; // need to fix
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/balance_version_check.rs
Normal file
21
httpserver/src/routes/game/balance_version_check.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{HttpResponse, Result, put, web};
|
||||
use bd2::proto::proto_net::BalanceVersionCheckRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::balance_version_check;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BalanceVersionCheck")]
|
||||
async fn balance_version_check_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<BalanceVersionCheckRequest>("BalanceVersionCheck", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BalanceVersionCheck: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = balance_version_check::handle(req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/battle_end.rs
Normal file
20
httpserver/src/routes/game/battle_end.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleEndRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_end;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleEnd")]
|
||||
async fn battle_end_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<BattleEndRequest>("BattleEnd", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleEnd: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_end::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/battle_end_test.rs
Normal file
20
httpserver/src/routes/game/battle_end_test.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleEndTestRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_end_test;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleEndTest")]
|
||||
async fn battle_end_test_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<BattleEndTestRequest>("BattleEndTest", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleEndTest: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_end_test::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/battle_enter.rs
Normal file
20
httpserver/src/routes/game/battle_enter.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleEnterRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_enter;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleEnter")]
|
||||
async fn battle_enter_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<BattleEnterRequest>("BattleEnter", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleEnter: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_enter::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/battle_exit.rs
Normal file
20
httpserver/src/routes/game/battle_exit.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleExitRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_exit;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleExit")]
|
||||
async fn battle_exit_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<BattleExitRequest>("BattleExit", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleExit: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_exit::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/battle_give_up.rs
Normal file
20
httpserver/src/routes/game/battle_give_up.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleGiveUpRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_give_up;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleGiveUp")]
|
||||
async fn battle_give_up_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<BattleGiveUpRequest>("BattleGiveUp", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleGiveUp: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_give_up::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/battle_retry.rs
Normal file
20
httpserver/src/routes/game/battle_retry.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleRetryRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_retry;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleRetry")]
|
||||
async fn battle_retry_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<BattleRetryRequest>("BattleRetry", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleRetry: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_retry::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/battle_retry_previous_turn.rs
Normal file
21
httpserver/src/routes/game/battle_retry_previous_turn.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleRetryPreviousTurnRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_retry_previous_turn;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleRetryPreviousTurn")]
|
||||
async fn battle_retry_previous_turn_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<BattleRetryPreviousTurnRequest>("BattleRetryPreviousTurn", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleRetryPreviousTurn: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_retry_previous_turn::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/battle_start.rs
Normal file
20
httpserver/src/routes/game/battle_start.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleStartRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_start;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleStart")]
|
||||
async fn battle_start_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<BattleStartRequest>("BattleStart", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleStart: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_start::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/battle_verify_state.rs
Normal file
21
httpserver/src/routes/game/battle_verify_state.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::BattleVerifyStateRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::battle_verify_state;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("BattleVerifyState")]
|
||||
async fn battle_verify_state_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<BattleVerifyStateRequest>("BattleVerifyState", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse BattleVerifyState: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = battle_verify_state::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/cafeteria_cumulative_reward.rs
Normal file
21
httpserver/src/routes/game/cafeteria_cumulative_reward.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaCumulativeRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_cumulative_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaCumulativeReward")]
|
||||
async fn cafeteria_cumulative_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaCumulativeRewardRequest>("CafeteriaCumulativeReward", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaCumulativeReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_cumulative_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaDailyConnectionCostumeRefreshRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_daily_connection_costume_refresh;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaDailyConnectionCostumeRefresh")]
|
||||
async fn cafeteria_daily_connection_costume_refresh_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaDailyConnectionCostumeRefreshRequest>(
|
||||
"CafeteriaDailyConnectionCostumeRefresh",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!(
|
||||
"Failed to parse CafeteriaDailyConnectionCostumeRefresh: {}",
|
||||
e
|
||||
);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_daily_connection_costume_refresh::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaEventNpcInteractionRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_event_npc_interaction_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaEventNpcInteractionReward")]
|
||||
async fn cafeteria_event_npc_interaction_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaEventNpcInteractionRewardRequest>(
|
||||
"CafeteriaEventNpcInteractionReward",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaEventNpcInteractionReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_event_npc_interaction_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/cafeteria_info.rs
Normal file
20
httpserver/src/routes/game/cafeteria_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaInfo")]
|
||||
async fn cafeteria_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaInfoRequest>("CafeteriaInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaIntroductionStoryRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_introduction_story_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaIntroductionStoryReward")]
|
||||
async fn cafeteria_introduction_story_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaIntroductionStoryRewardRequest>(
|
||||
"CafeteriaIntroductionStoryReward",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaIntroductionStoryReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_introduction_story_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/cafeteria_level_up.rs
Normal file
20
httpserver/src/routes/game/cafeteria_level_up.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaLevelUpRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_level_up;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaLevelUp")]
|
||||
async fn cafeteria_level_up_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaLevelUpRequest>("CafeteriaLevelUp", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaLevelUp: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_level_up::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/cafeteria_manage_item_add.rs
Normal file
21
httpserver/src/routes/game/cafeteria_manage_item_add.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaManageItemAddRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_manage_item_add;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaManageItemAdd")]
|
||||
async fn cafeteria_manage_item_add_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaManageItemAddRequest>("CafeteriaManageItemAdd", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaManageItemAdd: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_manage_item_add::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaRareNpcInteractionRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_rare_npc_interaction_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaRareNpcInteractionReward")]
|
||||
async fn cafeteria_rare_npc_interaction_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaRareNpcInteractionRewardRequest>(
|
||||
"CafeteriaRareNpcInteractionReward",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaRareNpcInteractionReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_rare_npc_interaction_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaRegularCostumeInteractionAllRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_regular_costume_interaction_all_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaRegularCostumeInteractionAllReward")]
|
||||
async fn cafeteria_regular_costume_interaction_all_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaRegularCostumeInteractionAllRewardRequest>(
|
||||
"CafeteriaRegularCostumeInteractionAllReward",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!(
|
||||
"Failed to parse CafeteriaRegularCostumeInteractionAllReward: {}",
|
||||
e
|
||||
);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_regular_costume_interaction_all_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaRegularCostumeInteractionRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_regular_costume_interaction_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaRegularCostumeInteractionReward")]
|
||||
async fn cafeteria_regular_costume_interaction_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaRegularCostumeInteractionRewardRequest>(
|
||||
"CafeteriaRegularCostumeInteractionReward",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!(
|
||||
"Failed to parse CafeteriaRegularCostumeInteractionReward: {}",
|
||||
e
|
||||
);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_regular_costume_interaction_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaRegularCostumeNoteAllRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_regular_costume_note_all_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaRegularCostumeNoteAllReward")]
|
||||
async fn cafeteria_regular_costume_note_all_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaRegularCostumeNoteAllRewardRequest>(
|
||||
"CafeteriaRegularCostumeNoteAllReward",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!(
|
||||
"Failed to parse CafeteriaRegularCostumeNoteAllReward: {}",
|
||||
e
|
||||
);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_regular_costume_note_all_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaRegularCostumeNoteInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_regular_costume_note_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaRegularCostumeNoteInfo")]
|
||||
async fn cafeteria_regular_costume_note_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaRegularCostumeNoteInfoRequest>(
|
||||
"CafeteriaRegularCostumeNoteInfo",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaRegularCostumeNoteInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_regular_costume_note_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaRegularCostumeNoteRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_regular_costume_note_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaRegularCostumeNoteReward")]
|
||||
async fn cafeteria_regular_costume_note_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaRegularCostumeNoteRewardRequest>(
|
||||
"CafeteriaRegularCostumeNoteReward",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaRegularCostumeNoteReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_regular_costume_note_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaRewardReceiptTimeUpdateUsingCheatRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_reward_receipt_time_update_using_cheat;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaRewardReceiptTimeUpdateUsingCheat")]
|
||||
async fn cafeteria_reward_receipt_time_update_using_cheat_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaRewardReceiptTimeUpdateUsingCheatRequest>(
|
||||
"CafeteriaRewardReceiptTimeUpdateUsingCheat",
|
||||
&body,
|
||||
)
|
||||
.map_err(|e| {
|
||||
tracing::warn!(
|
||||
"Failed to parse CafeteriaRewardReceiptTimeUpdateUsingCheat: {}",
|
||||
e
|
||||
);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_reward_receipt_time_update_using_cheat::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/cafeteria_spawn_reset.rs
Normal file
21
httpserver/src/routes/game/cafeteria_spawn_reset.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaSpawnResetRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_spawn_reset;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaSpawnReset")]
|
||||
async fn cafeteria_spawn_reset_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<CafeteriaSpawnResetRequest>("CafeteriaSpawnReset", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaSpawnReset: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_spawn_reset::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/cafeteria_spawn_reset_cheat.rs
Normal file
21
httpserver/src/routes/game/cafeteria_spawn_reset_cheat.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CafeteriaSpawnResetCheatRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cafeteria_spawn_reset_cheat;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CafeteriaSpawnResetCheat")]
|
||||
async fn cafeteria_spawn_reset_cheat_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CafeteriaSpawnResetCheatRequest>("CafeteriaSpawnResetCheat", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CafeteriaSpawnResetCheat: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cafeteria_spawn_reset_cheat::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/cancel_leave_user.rs
Normal file
20
httpserver/src/routes/game/cancel_leave_user.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CancelLeaveUserRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cancel_leave_user;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CancelLeaveUser")]
|
||||
async fn cancel_leave_user_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CancelLeaveUserRequest>("CancelLeaveUser", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CancelLeaveUser: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cancel_leave_user::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/cash_mail_info.rs
Normal file
20
httpserver/src/routes/game/cash_mail_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CashMailInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cash_mail_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CashMailInfo")]
|
||||
async fn cash_mail_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CashMailInfoRequest>("CashMailInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CashMailInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cash_mail_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/cash_shop_buy.rs
Normal file
20
httpserver/src/routes/game/cash_shop_buy.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CashShopBuyRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cash_shop_buy;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CashShopBuy")]
|
||||
async fn cash_shop_buy_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CashShopBuyRequest>("CashShopBuy", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CashShopBuy: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cash_shop_buy::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/cash_shop_info.rs
Normal file
20
httpserver/src/routes/game/cash_shop_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CashShopInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cash_shop_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CashShopInfo")]
|
||||
async fn cash_shop_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CashShopInfoRequest>("CashShopInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CashShopInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cash_shop_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/cash_shop_purchase_count_info.rs
Normal file
21
httpserver/src/routes/game/cash_shop_purchase_count_info.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CashShopPurchaseCountInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cash_shop_purchase_count_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CashShopPurchaseCountInfo")]
|
||||
async fn cash_shop_purchase_count_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CashShopPurchaseCountInfoRequest>("CashShopPurchaseCountInfo", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CashShopPurchaseCountInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cash_shop_purchase_count_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_all_revival.rs
Normal file
20
httpserver/src/routes/game/char_all_revival.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharAllRevivalRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_all_revival;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharAllRevival")]
|
||||
async fn char_all_revival_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharAllRevivalRequest>("CharAllRevival", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharAllRevival: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_all_revival::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/char_auto_revive_set.rs
Normal file
21
httpserver/src/routes/game/char_auto_revive_set.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharAutoReviveSetRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_auto_revive_set;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharAutoReviveSet")]
|
||||
async fn char_auto_revive_set_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<CharAutoReviveSetRequest>("CharAutoReviveSet", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharAutoReviveSet: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_auto_revive_set::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_awake_active.rs
Normal file
20
httpserver/src/routes/game/char_awake_active.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharAwakeActiveRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_awake_active;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharAwakeActive")]
|
||||
async fn char_awake_active_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharAwakeActiveRequest>("CharAwakeActive", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharAwakeActive: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_awake_active::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_awake_info.rs
Normal file
20
httpserver/src/routes/game/char_awake_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharAwakeInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_awake_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharAwakeInfo")]
|
||||
async fn char_awake_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharAwakeInfoRequest>("CharAwakeInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharAwakeInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_awake_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_class_up.rs
Normal file
20
httpserver/src/routes/game/char_class_up.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharClassUpRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_class_up;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharClassUp")]
|
||||
async fn char_class_up_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharClassUpRequest>("CharClassUp", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharClassUp: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_class_up::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_expiry.rs
Normal file
20
httpserver/src/routes/game/char_expiry.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharExpiryRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_expiry;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharExpiry")]
|
||||
async fn char_expiry_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharExpiryRequest>("CharExpiry", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharExpiry: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_expiry::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_growth.rs
Normal file
20
httpserver/src/routes/game/char_growth.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharGrowthRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_growth;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharGrowth")]
|
||||
async fn char_growth_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharGrowthRequest>("CharGrowth", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharGrowth: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_growth::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_healing.rs
Normal file
20
httpserver/src/routes/game/char_healing.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharHealingRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_healing;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharHealing")]
|
||||
async fn char_healing_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharHealingRequest>("CharHealing", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharHealing: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_healing::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_immortal.rs
Normal file
20
httpserver/src/routes/game/char_immortal.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharImmortalRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_immortal;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharImmortal")]
|
||||
async fn char_immortal_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharImmortalRequest>("CharImmortal", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharImmortal: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_immortal::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/char_imprint_level_up.rs
Normal file
21
httpserver/src/routes/game/char_imprint_level_up.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharImprintLevelUpRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_imprint_level_up;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharImprintLevelUp")]
|
||||
async fn char_imprint_level_up_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<CharImprintLevelUpRequest>("CharImprintLevelUp", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharImprintLevelUp: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_imprint_level_up::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_info.rs
Normal file
20
httpserver/src/routes/game/char_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharInfo")]
|
||||
async fn char_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharInfoRequest>("CharInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_level_up.rs
Normal file
20
httpserver/src/routes/game/char_level_up.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharLevelUpRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_level_up;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharLevelUp")]
|
||||
async fn char_level_up_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharLevelUpRequest>("CharLevelUp", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharLevelUp: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_level_up::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_partner_info.rs
Normal file
20
httpserver/src/routes/game/char_partner_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharPartnerInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_partner_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharPartnerInfo")]
|
||||
async fn char_partner_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharPartnerInfoRequest>("CharPartnerInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharPartnerInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_partner_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/char_partner_reward.rs
Normal file
21
httpserver/src/routes/game/char_partner_reward.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharPartnerRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_partner_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharPartnerReward")]
|
||||
async fn char_partner_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<CharPartnerRewardRequest>("CharPartnerReward", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharPartnerReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_partner_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/char_partner_story_reward.rs
Normal file
21
httpserver/src/routes/game/char_partner_story_reward.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharPartnerStoryRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_partner_story_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharPartnerStoryReward")]
|
||||
async fn char_partner_story_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharPartnerStoryRewardRequest>("CharPartnerStoryReward", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharPartnerStoryReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_partner_story_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/char_scout_info.rs
Normal file
20
httpserver/src/routes/game/char_scout_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharScoutInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_scout_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharScoutInfo")]
|
||||
async fn char_scout_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharScoutInfoRequest>("CharScoutInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharScoutInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_scout_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/char_special_scout_buy.rs
Normal file
21
httpserver/src/routes/game/char_special_scout_buy.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharSpecialScoutBuyRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_special_scout_buy;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharSpecialScoutBuy")]
|
||||
async fn char_special_scout_buy_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<CharSpecialScoutBuyRequest>("CharSpecialScoutBuy", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharSpecialScoutBuy: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_special_scout_buy::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/char_special_scout_reset.rs
Normal file
21
httpserver/src/routes/game/char_special_scout_reset.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CharSpecialScoutResetRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::char_special_scout_reset;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CharSpecialScoutReset")]
|
||||
async fn char_special_scout_reset_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CharSpecialScoutResetRequest>("CharSpecialScoutReset", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CharSpecialScoutReset: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = char_special_scout_reset::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
23
httpserver/src/routes/game/charge_cost_info.rs
Normal file
23
httpserver/src/routes/game/charge_cost_info.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::ChargeCostInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::charge_cost_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("ChargeCostInfo")]
|
||||
async fn charge_cost_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
|
||||
let req = parse_packet::<ChargeCostInfoRequest>("ChargeCostInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse ChargeCostInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
|
||||
let response = charge_cost_info::handle(&pool, uid, req).await;
|
||||
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/clear_package_reward.rs
Normal file
21
httpserver/src/routes/game/clear_package_reward.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::ClearPackageRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::clear_package_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("ClearPackageReward")]
|
||||
async fn clear_package_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<ClearPackageRewardRequest>("ClearPackageReward", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse ClearPackageReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = clear_package_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/client_custom_log.rs
Normal file
20
httpserver/src/routes/game/client_custom_log.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::ClientCustomLogRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::client_custom_log;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("ClientCustomLog")]
|
||||
async fn client_custom_log_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<ClientCustomLogRequest>("ClientCustomLog", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse ClientCustomLog: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = client_custom_log::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/community_reward.rs
Normal file
20
httpserver/src/routes/game/community_reward.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CommunityRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::community_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CommunityReward")]
|
||||
async fn community_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CommunityRewardRequest>("CommunityReward", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CommunityReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = community_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/community_reward_info.rs
Normal file
21
httpserver/src/routes/game/community_reward_info.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CommunityRewardInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::community_reward_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CommunityRewardInfo")]
|
||||
async fn community_reward_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<CommunityRewardInfoRequest>("CommunityRewardInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CommunityRewardInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = community_reward_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/cooking.rs
Normal file
20
httpserver/src/routes/game/cooking.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CookingRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cooking;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("Cooking")]
|
||||
async fn cooking_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CookingRequest>("Cooking", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse Cooking: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cooking::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/cooking_research.rs
Normal file
20
httpserver/src/routes/game/cooking_research.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CookingResearchRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::cooking_research;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CookingResearch")]
|
||||
async fn cooking_research_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CookingResearchRequest>("CookingResearch", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CookingResearch: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = cooking_research::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/costume_all_rounder_upgrade.rs
Normal file
21
httpserver/src/routes/game/costume_all_rounder_upgrade.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CostumeAllRounderUpgradeRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::costume_all_rounder_upgrade;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CostumeAllRounderUpgrade")]
|
||||
async fn costume_all_rounder_upgrade_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CostumeAllRounderUpgradeRequest>("CostumeAllRounderUpgrade", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CostumeAllRounderUpgrade: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = costume_all_rounder_upgrade::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/costume_clear.rs
Normal file
20
httpserver/src/routes/game/costume_clear.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CostumeClearRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::costume_clear;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CostumeClear")]
|
||||
async fn costume_clear_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CostumeClearRequest>("CostumeClear", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CostumeClear: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = costume_clear::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/costume_info.rs
Normal file
20
httpserver/src/routes/game/costume_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CostumeInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::costume_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CostumeInfo")]
|
||||
async fn costume_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CostumeInfoRequest>("CostumeInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CostumeInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = costume_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/costume_node_activation.rs
Normal file
21
httpserver/src/routes/game/costume_node_activation.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CostumeNodeActivationRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::costume_node_activation;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CostumeNodeActivation")]
|
||||
async fn costume_node_activation_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CostumeNodeActivationRequest>("CostumeNodeActivation", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CostumeNodeActivation: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = costume_node_activation::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/costume_potential_connect.rs
Normal file
21
httpserver/src/routes/game/costume_potential_connect.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CostumePotentialConnectRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::costume_potential_connect;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CostumePotentialConnect")]
|
||||
async fn costume_potential_connect_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CostumePotentialConnectRequest>("CostumePotentialConnect", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse CostumePotentialConnect: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = costume_potential_connect::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/costume_upgrade.rs
Normal file
20
httpserver/src/routes/game/costume_upgrade.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CostumeUpgradeRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::costume_upgrade;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CostumeUpgrade")]
|
||||
async fn costume_upgrade_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CostumeUpgradeRequest>("CostumeUpgrade", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CostumeUpgrade: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = costume_upgrade::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/costume_use.rs
Normal file
20
httpserver/src/routes/game/costume_use.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::CostumeUseRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::costume_use;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("CostumeUse")]
|
||||
async fn costume_use_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<CostumeUseRequest>("CostumeUse", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse CostumeUse: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = costume_use::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/dating_episode_clear.rs
Normal file
21
httpserver/src/routes/game/dating_episode_clear.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DatingEpisodeClearRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::dating_episode_clear;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DatingEpisodeClear")]
|
||||
async fn dating_episode_clear_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<DatingEpisodeClearRequest>("DatingEpisodeClear", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse DatingEpisodeClear: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = dating_episode_clear::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/dating_info.rs
Normal file
20
httpserver/src/routes/game/dating_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DatingInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::dating_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DatingInfo")]
|
||||
async fn dating_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<DatingInfoRequest>("DatingInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse DatingInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = dating_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/dating_message_update.rs
Normal file
21
httpserver/src/routes/game/dating_message_update.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DatingMessageUpdateRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::dating_message_update;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DatingMessageUpdate")]
|
||||
async fn dating_message_update_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<DatingMessageUpdateRequest>("DatingMessageUpdate", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse DatingMessageUpdate: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = dating_message_update::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/deck_char_auto_revive.rs
Normal file
21
httpserver/src/routes/game/deck_char_auto_revive.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DeckCharAutoReviveRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::deck_char_auto_revive;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DeckCharAutoRevive")]
|
||||
async fn deck_char_auto_revive_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<DeckCharAutoReviveRequest>("DeckCharAutoRevive", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse DeckCharAutoRevive: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = deck_char_auto_revive::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/deck_costume_setting_info.rs
Normal file
21
httpserver/src/routes/game/deck_costume_setting_info.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DeckCostumeSettingInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::deck_costume_setting_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DeckCostumeSettingInfo")]
|
||||
async fn deck_costume_setting_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<DeckCostumeSettingInfoRequest>("DeckCostumeSettingInfo", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse DeckCostumeSettingInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = deck_costume_setting_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/deck_costume_setting_save.rs
Normal file
21
httpserver/src/routes/game/deck_costume_setting_save.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DeckCostumeSettingSaveRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::deck_costume_setting_save;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DeckCostumeSettingSave")]
|
||||
async fn deck_costume_setting_save_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<DeckCostumeSettingSaveRequest>("DeckCostumeSettingSave", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse DeckCostumeSettingSave: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = deck_costume_setting_save::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/deck_info.rs
Normal file
20
httpserver/src/routes/game/deck_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DeckInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::deck_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DeckInfo")]
|
||||
async fn deck_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<DeckInfoRequest>("DeckInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse DeckInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = deck_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/deck_save.rs
Normal file
20
httpserver/src/routes/game/deck_save.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DeckSaveRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::deck_save;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DeckSave")]
|
||||
async fn deck_save_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<DeckSaveRequest>("DeckSave", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse DeckSave: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = deck_save::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/dispatch_info.rs
Normal file
20
httpserver/src/routes/game/dispatch_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DispatchInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::dispatch_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DispatchInfo")]
|
||||
async fn dispatch_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<DispatchInfoRequest>("DispatchInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse DispatchInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = dispatch_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/dispatch_reward.rs
Normal file
20
httpserver/src/routes/game/dispatch_reward.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::DispatchRewardRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::dispatch_reward;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("DispatchReward")]
|
||||
async fn dispatch_reward_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<DispatchRewardRequest>("DispatchReward", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse DispatchReward: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = dispatch_reward::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/eat_food.rs
Normal file
20
httpserver/src/routes/game/eat_food.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EatFoodRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::eat_food;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EatFood")]
|
||||
async fn eat_food_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EatFoodRequest>("EatFood", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EatFood: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = eat_food::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/eat_food_auto.rs
Normal file
20
httpserver/src/routes/game/eat_food_auto.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EatFoodAutoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::eat_food_auto;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EatFoodAuto")]
|
||||
async fn eat_food_auto_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EatFoodAutoRequest>("EatFoodAuto", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EatFoodAuto: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = eat_food_auto::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_add_slot.rs
Normal file
20
httpserver/src/routes/game/equip_add_slot.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipAddSlotRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_add_slot;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipAddSlot")]
|
||||
async fn equip_add_slot_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipAddSlotRequest>("EquipAddSlot", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipAddSlot: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_add_slot::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_batch_use.rs
Normal file
20
httpserver/src/routes/game/equip_batch_use.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipBatchUseRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_batch_use;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipBatchUse")]
|
||||
async fn equip_batch_use_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipBatchUseRequest>("EquipBatchUse", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipBatchUse: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_batch_use::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_break.rs
Normal file
20
httpserver/src/routes/game/equip_break.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipBreakRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_break;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipBreak")]
|
||||
async fn equip_break_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipBreakRequest>("EquipBreak", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipBreak: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_break::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_change.rs
Normal file
20
httpserver/src/routes/game/equip_change.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipChangeRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_change;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipChange")]
|
||||
async fn equip_change_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipChangeRequest>("EquipChange", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipChange: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_change::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_clear.rs
Normal file
20
httpserver/src/routes/game/equip_clear.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipClearRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_clear;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipClear")]
|
||||
async fn equip_clear_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipClearRequest>("EquipClear", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipClear: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_clear::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/equip_from_making_to_break.rs
Normal file
21
httpserver/src/routes/game/equip_from_making_to_break.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipFromMakingToBreakRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_from_making_to_break;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipFromMakingToBreak")]
|
||||
async fn equip_from_making_to_break_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipFromMakingToBreakRequest>("EquipFromMakingToBreak", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipFromMakingToBreak: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_from_making_to_break::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/equip_from_making_to_upgrade.rs
Normal file
21
httpserver/src/routes/game/equip_from_making_to_upgrade.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipFromMakingToUpgradeRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_from_making_to_upgrade;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipFromMakingToUpgrade")]
|
||||
async fn equip_from_making_to_upgrade_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipFromMakingToUpgradeRequest>("EquipFromMakingToUpgrade", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipFromMakingToUpgrade: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_from_making_to_upgrade::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/equip_from_upgrade_to_break.rs
Normal file
21
httpserver/src/routes/game/equip_from_upgrade_to_break.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipFromUpgradeToBreakRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_from_upgrade_to_break;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipFromUpgradeToBreak")]
|
||||
async fn equip_from_upgrade_to_break_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipFromUpgradeToBreakRequest>("EquipFromUpgradeToBreak", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipFromUpgradeToBreak: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_from_upgrade_to_break::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
23
httpserver/src/routes/game/equip_info.rs
Normal file
23
httpserver/src/routes/game/equip_info.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipInfo")]
|
||||
async fn equip_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
|
||||
let req = parse_packet::<EquipInfoRequest>("ChargeCostInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse ChargeCostInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
|
||||
let response = equip_info::handle(&pool, uid, req).await;
|
||||
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_lock.rs
Normal file
20
httpserver/src/routes/game/equip_lock.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipLockRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_lock;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipLock")]
|
||||
async fn equip_lock_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipLockRequest>("EquipLock", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipLock: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_lock::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_making.rs
Normal file
20
httpserver/src/routes/game/equip_making.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipMakingRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_making;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipMaking")]
|
||||
async fn equip_making_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipMakingRequest>("EquipMaking", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipMaking: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_making::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_mark_delete.rs
Normal file
20
httpserver/src/routes/game/equip_mark_delete.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipMarkDeleteRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_mark_delete;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipMarkDelete")]
|
||||
async fn equip_mark_delete_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipMarkDeleteRequest>("EquipMarkDelete", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipMarkDelete: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_mark_delete::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_mark_set.rs
Normal file
20
httpserver/src/routes/game/equip_mark_set.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipMarkSetRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_mark_set;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipMarkSet")]
|
||||
async fn equip_mark_set_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipMarkSetRequest>("EquipMarkSet", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipMarkSet: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_mark_set::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/equip_option_re_roll.rs
Normal file
21
httpserver/src/routes/game/equip_option_re_roll.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipOptionReRollRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_option_re_roll;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipOptionReRoll")]
|
||||
async fn equip_option_re_roll_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req =
|
||||
parse_packet::<EquipOptionReRollRequest>("EquipOptionReRoll", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipOptionReRoll: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_option_re_roll::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
21
httpserver/src/routes/game/equip_option_re_roll_confirm.rs
Normal file
21
httpserver/src/routes/game/equip_option_re_roll_confirm.rs
Normal file
@@ -0,0 +1,21 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipOptionReRollConfirmRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_option_re_roll_confirm;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipOptionReRollConfirm")]
|
||||
async fn equip_option_re_roll_confirm_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipOptionReRollConfirmRequest>("EquipOptionReRollConfirm", &body)
|
||||
.map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipOptionReRollConfirm: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_option_re_roll_confirm::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
20
httpserver/src/routes/game/equip_preset_info.rs
Normal file
20
httpserver/src/routes/game/equip_preset_info.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use actix_web::{put, web, HttpResponse, Result};
|
||||
use bd2::proto::proto_net::EquipPresetInfoRequest;
|
||||
use crypto::network::parse_packet;
|
||||
use gameserver::logic::game::equip_preset_info;
|
||||
use sqlx::SqlitePool;
|
||||
|
||||
#[put("EquipPresetInfo")]
|
||||
async fn equip_preset_info_handler(
|
||||
pool: web::Data<SqlitePool>,
|
||||
body: String,
|
||||
user_id: web::ReqData<i64>,
|
||||
) -> Result<HttpResponse> {
|
||||
let uid = *user_id;
|
||||
let req = parse_packet::<EquipPresetInfoRequest>("EquipPresetInfo", &body).map_err(|e| {
|
||||
tracing::warn!("Failed to parse EquipPresetInfo: {}", e);
|
||||
actix_web::error::ErrorBadRequest("Invalid packet")
|
||||
})?;
|
||||
let response = equip_preset_info::handle(&pool, uid, req).await;
|
||||
Ok(HttpResponse::Ok().json(response))
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user