shine bright like a diamond

This commit is contained in:
winter 2023-01-01 17:24:04 +09:00
parent 31b59f76e0
commit 6785d0e936
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
require "uri"
include CrystalGauntlet
CrystalGauntlet.endpoints["/updateGJUserScore22.php"] = ->(body : String): String {
params = URI::Params.parse(body)
puts params.inspect
user_id, account_id = Accounts.auth(params)
if !(user_id && account_id)
return "-1"
end
# todo: prevent username change unless it's a capitalization change
# todo: update account username casing w/ user username
# todo: keep track of stat changes to look out for leaderboard cheating & whatnot
# todo: cap out demon count at the current amount of uploaded demons? same for stars & user coins. could be expensive though
# todo: cap icon type
DATABASE.exec("update accounts set messages_enabled=?, friend_requests_enabled=?, comments_enabled=?, youtube_url=?, twitter_url=?, twitch_url=? where id=?", params["mS"].to_i32, params["frS"].to_i32, params["cS"].to_i32, params["yt"], params["twitter"], params["twitch"], account_id)
"1"
}