Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gimuserver/gme/handlers/GmeControllerHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ static GmeHandler getHandler(std::string_view cmd)
REGISTER("2o4axPIC", FriendGet, "EoYuZ2nbImhCU1c0");
REGISTER("F7JvPk5H", GachaAction, "bL9fipzaSy7xN2w1");
REGISTER("Uo86DcRh", GachaList, "8JbxFvuSaB2CK7Ln");
REGISTER("k57TdKDj", UnitSelectorGachaTicket, "1IJ8SaNk");
REGISTER("NiYWKdzs", HomeInfo, "f6uOewOD");
REGISTER("9TvyNR5H", MissionEnd, "oINq0rfUFPx5MgmT");
REGISTER("jE6Sp0q4", MissionStart, "csiVLDKkxEwBfR70");
Expand All @@ -87,6 +88,7 @@ static GmeHandler getHandler(std::string_view cmd)
REGISTER("ynB7X5P9", UpdateInfoLight, "7kH9NXwC");
REGISTER("cTZ3W2JG", UserInfo, "ScJx6ywWEb0A3njT");


}
}

Expand Down Expand Up @@ -150,6 +152,7 @@ drogon::Task<GmeAction> GmeController::Handle(drogon::SessionPtr session, const
catch (const drogon::orm::DrogonDbException& ex)
{
LOG_ERROR << "Handler error " << header.id << " (" << handler.name << ") database exception: " << ex.base().what();
logReq << "EXCEPTION (db): " << ex.base().what() << "\n";
GmeError err{};
err.cmd = GmeErrorCommand::Close;
err.flag = GmeErrorFlags::IsInError;
Expand All @@ -159,6 +162,7 @@ drogon::Task<GmeAction> GmeController::Handle(drogon::SessionPtr session, const
catch (const std::exception& ex)
{
LOG_ERROR << "Handler error " << header.id << " (" << handler.name << ") exception: " << ex.what();
logReq << "EXCEPTION (std): " << ex.what() << "\n";
GmeError err{};
err.cmd = GmeErrorCommand::Close;
err.flag = GmeErrorFlags::IsInError;
Expand Down
1 change: 1 addition & 0 deletions gimuserver/gme/handlers/Handlers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ namespace GmeHandlers
HANDLE(FriendGet);
HANDLE(GachaAction);
HANDLE(GachaList);
HANDLE(UnitSelectorGachaTicket);
HANDLE(HomeInfo);
HANDLE(MissionEnd);
HANDLE(MissionStart);
Expand Down
37 changes: 37 additions & 0 deletions gimuserver/gme/handlers/UnitSelectorGachaTicket.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "App.hpp"
#include "Handlers.hpp"

// UnitSelectorGachaTicket — handler stub for the "use a Unit Selector Gacha
// Ticket" client request. Triggered by the user tapping a per-door ticket
// button on a selector gacha (e.g. the Burst Heroes Selector banner under
// the Veteran summon category).
//
// GroupId = "k57TdKDj"
// AES key = "1IJ8SaNk"
// (per BraveFrontier IDA readParam and Handler exports.../UnitSelectorGachaTicketRequestHandler.hpp)
//
// Request shape (from bfdata/createbody/UnitSelectorGachaTicketRequest.txt):
// "CGHaOZda": [{
// "7Ffmi96v": "<gacha_id>", target gacha door
// "XIvaD6Jp": "<selector_id>", which selector entry within that gacha
// "pn16CNah": "<unit_id>", the unit the user picked from the pool
// "H6k1LIxC": "<?>", unknown — possibly count or ticket-id
// "C5QbG2DM": "<?>", unknown — possibly cost
// }]
//
// Response: empty `{}` for now. The full flow needs:
// 1. Verify the user owns at least one matching V2 ticket
// 2. INSERT the selected unit into user_units
// 3. Decrement user_summon_tickets_v2 for the ticket type
// 4. Return UserUnitInfo + UnitSelectorGachaUserInfoResponse (CGHaOZda)
//
// Even an empty `{}` is useful as a registration test — the BF client may
// hide UI elements whose target endpoint isn't registered on the server
// (since tapping would error out). See handbook §7.11.6 for the broader
// "use ticket" button-visibility investigation.
HANDLEF(UnitSelectorGachaTicket)
{
(void)session;
LOG_INFO << "UnitSelectorGachaTicket (stub): " << json;
co_return HandleResult::success("{}");
}