Better support for custom card account flagging

This commit is contained in:
Ethan O'Brien
2026-07-26 22:02:01 -05:00
parent d06aaae9ac
commit 3ca5dcf1ea
7 changed files with 412 additions and 317 deletions

View File

@@ -25,7 +25,6 @@ fn get_asset_hash(req: &HttpRequest, body: &JsonValue) -> Option<String> {
}
async fn asset_hash(req: HttpRequest, Body(body): Body) -> impl Responder {
match get_asset_hash(&req, &body) {
Some(hash) => global::api(&req, Some(object!{
"asset_hash": hash
@@ -35,7 +34,6 @@ async fn asset_hash(req: HttpRequest, Body(body): Body) -> impl Responder {
}
async fn start(req: HttpRequest, Session { key, body }: Session) -> impl Responder {
let Some(asset_hash) = get_asset_hash(&req, &body) else {
return global::api_error(&req, global::RESULT_GAME_VERSION_UPDATED);
};
@@ -47,6 +45,11 @@ async fn start(req: HttpRequest, Session { key, body }: Session) -> impl Respond
user["user"]["last_login_time"] = global::timestamp().into();
userdata::save_acc(&key, user);
userdata::save_protocol_version(&key, global::client_protocol_version(&req));
if !crate::router::card::client_supports_custom_cards(&req) && crate::router::card::account_supports_custom_cards(&key) {
return global::api_error(&req, global::RESULT_GAME_VERSION_UPDATED); // todo - maybe compatibility layer?
}
global::api(&req, Some(object!{
"asset_hash": asset_hash,