changed file section

This commit is contained in:
yoncodes
2025-10-29 14:13:47 -04:00
parent 1badd8cb4f
commit 397c34bec1
1568 changed files with 3068 additions and 3575 deletions

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameActionEndRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_action_end;
use sqlx::SqlitePool;
#[put("MiniGameActionEnd")]
async fn mini_game_action_end_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameActionEndRequest>("MiniGameActionEnd", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameActionEnd: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_action_end::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameActionInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_action_info;
use sqlx::SqlitePool;
#[put("MiniGameActionInfo")]
async fn mini_game_action_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameActionInfoRequest>("MiniGameActionInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameActionInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_action_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameActionRankingRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_action_ranking;
use sqlx::SqlitePool;
#[put("MiniGameActionRanking")]
async fn mini_game_action_ranking_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameActionRankingRequest>("MiniGameActionRanking", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameActionRanking: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_action_ranking::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameActionStartRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_action_start;
use sqlx::SqlitePool;
#[put("MiniGameActionStart")]
async fn mini_game_action_start_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameActionStartRequest>("MiniGameActionStart", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameActionStart: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_action_start::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameBingoInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_bingo_info;
use sqlx::SqlitePool;
#[put("MiniGameBingoInfo")]
async fn mini_game_bingo_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameBingoInfoRequest>("MiniGameBingoInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameBingoInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_bingo_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameBingoPlayRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_bingo_play;
use sqlx::SqlitePool;
#[put("MiniGameBingoPlay")]
async fn mini_game_bingo_play_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameBingoPlayRequest>("MiniGameBingoPlay", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameBingoPlay: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_bingo_play::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameBoardInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_board_info;
use sqlx::SqlitePool;
#[put("MiniGameBoardInfo")]
async fn mini_game_board_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameBoardInfoRequest>("MiniGameBoardInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameBoardInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_board_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameBoardPlayRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_board_play;
use sqlx::SqlitePool;
#[put("MiniGameBoardPlay")]
async fn mini_game_board_play_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameBoardPlayRequest>("MiniGameBoardPlay", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameBoardPlay: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_board_play::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameDefenseEndRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_defense_end;
use sqlx::SqlitePool;
#[put("MiniGameDefenseEnd")]
async fn mini_game_defense_end_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameDefenseEndRequest>("MiniGameDefenseEnd", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameDefenseEnd: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_defense_end::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameDefenseInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_defense_info;
use sqlx::SqlitePool;
#[put("MiniGameDefenseInfo")]
async fn mini_game_defense_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameDefenseInfoRequest>("MiniGameDefenseInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameDefenseInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_defense_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameDefenseMatchingRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_defense_matching;
use sqlx::SqlitePool;
#[put("MiniGameDefenseMatching")]
async fn mini_game_defense_matching_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameDefenseMatchingRequest>("MiniGameDefenseMatching", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameDefenseMatching: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_defense_matching::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,22 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameDefenseStartRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_defense_start;
use sqlx::SqlitePool;
#[put("MiniGameDefenseStart")]
async fn mini_game_defense_start_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameDefenseStartRequest>("MiniGameDefenseStart", &body).map_err(
|e| {
tracing::warn!("Failed to parse MiniGameDefenseStart: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
},
)?;
let response = mini_game_defense_start::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameFieldEndRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_field_end;
use sqlx::SqlitePool;
#[put("MiniGameFieldEnd")]
async fn mini_game_field_end_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameFieldEndRequest>("MiniGameFieldEnd", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameFieldEnd: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_field_end::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameFieldInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_field_info;
use sqlx::SqlitePool;
#[put("MiniGameFieldInfo")]
async fn mini_game_field_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameFieldInfoRequest>("MiniGameFieldInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameFieldInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_field_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameFieldQuickRewardRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_field_quick_reward;
use sqlx::SqlitePool;
#[put("MiniGameFieldQuickReward")]
async fn mini_game_field_quick_reward_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameFieldQuickRewardRequest>("MiniGameFieldQuickReward", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameFieldQuickReward: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_field_quick_reward::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameFieldRewardRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_field_reward;
use sqlx::SqlitePool;
#[put("MiniGameFieldReward")]
async fn mini_game_field_reward_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameFieldRewardRequest>("MiniGameFieldReward", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameFieldReward: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_field_reward::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameFieldScoreRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_field_score;
use sqlx::SqlitePool;
#[put("MiniGameFieldScore")]
async fn mini_game_field_score_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameFieldScoreRequest>("MiniGameFieldScore", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameFieldScore: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_field_score::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameFieldStartRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_field_start;
use sqlx::SqlitePool;
#[put("MiniGameFieldStart")]
async fn mini_game_field_start_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameFieldStartRequest>("MiniGameFieldStart", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameFieldStart: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_field_start::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameHubInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_hub_info;
use sqlx::SqlitePool;
#[put("MiniGameHubInfo")]
async fn mini_game_hub_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameHubInfoRequest>("MiniGameHubInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameHubInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_hub_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRelayServerInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_relay_server_info;
use sqlx::SqlitePool;
#[put("MiniGameRelayServerInfo")]
async fn mini_game_relay_server_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRelayServerInfoRequest>("MiniGameRelayServerInfo", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameRelayServerInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_relay_server_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRhythmInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_rhythm_info;
use sqlx::SqlitePool;
#[put("MiniGameRhythmInfo")]
async fn mini_game_rhythm_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameRhythmInfoRequest>("MiniGameRhythmInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameRhythmInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_rhythm_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRhythmPlayEndRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_rhythm_play_end;
use sqlx::SqlitePool;
#[put("MiniGameRhythmPlayEnd")]
async fn mini_game_rhythm_play_end_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRhythmPlayEndRequest>("MiniGameRhythmPlayEnd", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameRhythmPlayEnd: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_rhythm_play_end::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRhythmPlayStartRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_rhythm_play_start;
use sqlx::SqlitePool;
#[put("MiniGameRhythmPlayStart")]
async fn mini_game_rhythm_play_start_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRhythmPlayStartRequest>("MiniGameRhythmPlayStart", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameRhythmPlayStart: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_rhythm_play_start::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRhythmRankingRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_rhythm_ranking;
use sqlx::SqlitePool;
#[put("MiniGameRhythmRanking")]
async fn mini_game_rhythm_ranking_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRhythmRankingRequest>("MiniGameRhythmRanking", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameRhythmRanking: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_rhythm_ranking::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,22 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRouletteDrawRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_roulette_draw;
use sqlx::SqlitePool;
#[put("MiniGameRouletteDraw")]
async fn mini_game_roulette_draw_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRouletteDrawRequest>("MiniGameRouletteDraw", &body).map_err(
|e| {
tracing::warn!("Failed to parse MiniGameRouletteDraw: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
},
)?;
let response = mini_game_roulette_draw::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,22 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRouletteInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_roulette_info;
use sqlx::SqlitePool;
#[put("MiniGameRouletteInfo")]
async fn mini_game_roulette_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRouletteInfoRequest>("MiniGameRouletteInfo", &body).map_err(
|e| {
tracing::warn!("Failed to parse MiniGameRouletteInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
},
)?;
let response = mini_game_roulette_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRunEndRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_run_end;
use sqlx::SqlitePool;
#[put("MiniGameRunEnd")]
async fn mini_game_run_end_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRunEndRequest>("MiniGameRunEnd", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameRunEnd: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_run_end::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRunInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_run_info;
use sqlx::SqlitePool;
#[put("MiniGameRunInfo")]
async fn mini_game_run_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRunInfoRequest>("MiniGameRunInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameRunInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_run_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRunQuickRewardRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_run_quick_reward;
use sqlx::SqlitePool;
#[put("MiniGameRunQuickReward")]
async fn mini_game_run_quick_reward_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRunQuickRewardRequest>("MiniGameRunQuickReward", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameRunQuickReward: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_run_quick_reward::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameRunStartRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_run_start;
use sqlx::SqlitePool;
#[put("MiniGameRunStart")]
async fn mini_game_run_start_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameRunStartRequest>("MiniGameRunStart", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameRunStart: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_run_start::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSichuanEndRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_sichuan_end;
use sqlx::SqlitePool;
#[put("MiniGameSichuanEnd")]
async fn mini_game_sichuan_end_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameSichuanEndRequest>("MiniGameSichuanEnd", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameSichuanEnd: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_sichuan_end::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSichuanInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_sichuan_info;
use sqlx::SqlitePool;
#[put("MiniGameSichuanInfo")]
async fn mini_game_sichuan_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameSichuanInfoRequest>("MiniGameSichuanInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameSichuanInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_sichuan_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSichuanRankingRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_sichuan_ranking;
use sqlx::SqlitePool;
#[put("MiniGameSichuanRanking")]
async fn mini_game_sichuan_ranking_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSichuanRankingRequest>("MiniGameSichuanRanking", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameSichuanRanking: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_sichuan_ranking::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,22 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSichuanStartRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_sichuan_start;
use sqlx::SqlitePool;
#[put("MiniGameSichuanStart")]
async fn mini_game_sichuan_start_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSichuanStartRequest>("MiniGameSichuanStart", &body).map_err(
|e| {
tracing::warn!("Failed to parse MiniGameSichuanStart: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
},
)?;
let response = mini_game_sichuan_start::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,22 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalCharUpgradeRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_char_upgrade;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalCharUpgrade")]
async fn mini_game_survival_char_upgrade_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameSurvivalCharUpgradeRequest>("MiniGameSurvivalCharUpgrade", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameSurvivalCharUpgrade: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_survival_char_upgrade::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,24 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalCharUpgradeResetRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_char_upgrade_reset;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalCharUpgradeReset")]
async fn mini_game_survival_char_upgrade_reset_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSurvivalCharUpgradeResetRequest>(
"MiniGameSurvivalCharUpgradeReset",
&body,
)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameSurvivalCharUpgradeReset: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_survival_char_upgrade_reset::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalEndRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_end;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalEnd")]
async fn mini_game_survival_end_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniGameSurvivalEndRequest>("MiniGameSurvivalEnd", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniGameSurvivalEnd: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_survival_end::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,22 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_info;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalInfo")]
async fn mini_game_survival_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSurvivalInfoRequest>("MiniGameSurvivalInfo", &body).map_err(
|e| {
tracing::warn!("Failed to parse MiniGameSurvivalInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
},
)?;
let response = mini_game_survival_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,22 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalPlayRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_play;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalPlay")]
async fn mini_game_survival_play_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSurvivalPlayRequest>("MiniGameSurvivalPlay", &body).map_err(
|e| {
tracing::warn!("Failed to parse MiniGameSurvivalPlay: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
},
)?;
let response = mini_game_survival_play::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalRankingRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_ranking;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalRanking")]
async fn mini_game_survival_ranking_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSurvivalRankingRequest>("MiniGameSurvivalRanking", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameSurvivalRanking: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_survival_ranking::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,24 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalSkillSelectListRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_skill_select_list;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalSkillSelectList")]
async fn mini_game_survival_skill_select_list_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSurvivalSkillSelectListRequest>(
"MiniGameSurvivalSkillSelectList",
&body,
)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameSurvivalSkillSelectList: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_survival_skill_select_list::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalSkillUpRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_skill_up;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalSkillUp")]
async fn mini_game_survival_skill_up_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSurvivalSkillUpRequest>("MiniGameSurvivalSkillUp", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameSurvivalSkillUp: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_survival_skill_up::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniGameSurvivalStartRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_game_survival_start;
use sqlx::SqlitePool;
#[put("MiniGameSurvivalStart")]
async fn mini_game_survival_start_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniGameSurvivalStartRequest>("MiniGameSurvivalStart", &body)
.map_err(|e| {
tracing::warn!("Failed to parse MiniGameSurvivalStart: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_game_survival_start::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,21 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniPuzzleAllOpenRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_puzzle_all_open;
use sqlx::SqlitePool;
#[put("MiniPuzzleAllOpen")]
async fn mini_puzzle_all_open_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req =
parse_packet::<MiniPuzzleAllOpenRequest>("MiniPuzzleAllOpen", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniPuzzleAllOpen: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_puzzle_all_open::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniPuzzleInfoRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_puzzle_info;
use sqlx::SqlitePool;
#[put("MiniPuzzleInfo")]
async fn mini_puzzle_info_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniPuzzleInfoRequest>("MiniPuzzleInfo", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniPuzzleInfo: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_puzzle_info::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniPuzzleOpenRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_puzzle_open;
use sqlx::SqlitePool;
#[put("MiniPuzzleOpen")]
async fn mini_puzzle_open_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniPuzzleOpenRequest>("MiniPuzzleOpen", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniPuzzleOpen: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_puzzle_open::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,20 @@
use actix_web::{put, web, HttpResponse, Result};
use bd2::proto::proto_net::MiniPuzzleRenewRequest;
use crypto::network::parse_packet;
use gameserver::logic::game::mini::mini_puzzle_renew;
use sqlx::SqlitePool;
#[put("MiniPuzzleRenew")]
async fn mini_puzzle_renew_handler(
pool: web::Data<SqlitePool>,
body: String,
user_id: web::ReqData<i64>,
) -> Result<HttpResponse> {
let uid = *user_id;
let req = parse_packet::<MiniPuzzleRenewRequest>("MiniPuzzleRenew", &body).map_err(|e| {
tracing::warn!("Failed to parse MiniPuzzleRenew: {}", e);
actix_web::error::ErrorBadRequest("Invalid packet")
})?;
let response = mini_puzzle_renew::handle(&pool, uid, req).await;
Ok(HttpResponse::Ok().json(response))
}

View File

@@ -0,0 +1,47 @@
pub mod mini_game_action_end;
pub mod mini_game_action_info;
pub mod mini_game_action_ranking;
pub mod mini_game_action_start;
pub mod mini_game_bingo_info;
pub mod mini_game_bingo_play;
pub mod mini_game_board_info;
pub mod mini_game_board_play;
pub mod mini_game_defense_end;
pub mod mini_game_defense_info;
pub mod mini_game_defense_matching;
pub mod mini_game_defense_start;
pub mod mini_game_field_end;
pub mod mini_game_field_info;
pub mod mini_game_field_quick_reward;
pub mod mini_game_field_reward;
pub mod mini_game_field_score;
pub mod mini_game_field_start;
pub mod mini_game_hub_info;
pub mod mini_game_relay_server_info;
pub mod mini_game_rhythm_info;
pub mod mini_game_rhythm_play_end;
pub mod mini_game_rhythm_play_start;
pub mod mini_game_rhythm_ranking;
pub mod mini_game_roulette_draw;
pub mod mini_game_roulette_info;
pub mod mini_game_run_end;
pub mod mini_game_run_info;
pub mod mini_game_run_quick_reward;
pub mod mini_game_run_start;
pub mod mini_game_sichuan_end;
pub mod mini_game_sichuan_info;
pub mod mini_game_sichuan_ranking;
pub mod mini_game_sichuan_start;
pub mod mini_game_survival_char_upgrade;
pub mod mini_game_survival_char_upgrade_reset;
pub mod mini_game_survival_end;
pub mod mini_game_survival_info;
pub mod mini_game_survival_play;
pub mod mini_game_survival_ranking;
pub mod mini_game_survival_skill_select_list;
pub mod mini_game_survival_skill_up;
pub mod mini_game_survival_start;
pub mod mini_puzzle_all_open;
pub mod mini_puzzle_info;
pub mod mini_puzzle_open;
pub mod mini_puzzle_renew;