bancho.py icon indicating copy to clipboard operation
bancho.py copied to clipboard

feat: make !purge to clear user plays - e.g. they are blatant/other.

Open GamebP opened this issue 11 months ago • 12 comments

GamebP avatar Mar 01 '24 18:03 GamebP

I wanted to implement that, could do that on sunday.

If anyone else plans to, I'd suggest giving the ability to only wipe a certain timeframe and mode, but that might increase complexity since it requires a user stats recalc on that user though.

minisbett avatar Mar 01 '24 18:03 minisbett

Certain timeframe as years/months/weeks/days/hours/minutes/seaconds... whatever how long - it be helpful. Since it needs recalc, I don't know then.. You might be a experienced user on recalc.

Purge can also mean, /purge [chat] <#channel (e.g. #osu)> /purge <user (e.g. dumm123)> <mode (e.g. vn!)> And some other things that other people have in mind.

GamebP avatar Mar 01 '24 19:03 GamebP

Certain timeframe as years/months/weeks/days/hours/minutes/seaconds... whatever how long - it be helpful.

I was thinking more of specifying two dates inbetween which the wipe is done, with all-time as the default. And also I would not make this command responsible for purging chats as well.

I think this command should be called smth like !wipeuser, and for channels smth like !clear in the channel to be cleared

minisbett avatar Mar 01 '24 19:03 minisbett

Yeah. It can be called !wipeuser that associated with clearing users plays. I don't have anythin alse to say then. But for chat, if it's gonna be implemented (but not needed).

GamebP avatar Mar 01 '24 19:03 GamebP

I like the idea overall -- eventually I'd like to introduce a rework of the scores schema to allow for soft-deletion, so you don't need to effectively delete evidence by hard wiping the data. (easy to adjust later though -- this can be implemented as a hard-delete for now)

Scores & stats should get reset, and the player's session should get updated, and everyone else online notified. I'd probably suggest to keep replay data when this happens since the score ids are sequential/non-recurring?

cmyui avatar Mar 01 '24 19:03 cmyui

but that might increase complexity since it requires a user stats recalc on that user though.

stats recalc will be required regardless if removing scores

cmyui avatar Mar 01 '24 19:03 cmyui

stats recalc will be required regardless if removing scores

Not on a full wipe, you can just set all stats to 0 then.

minisbett avatar Mar 01 '24 19:03 minisbett

eventually I'd like to introduce a rework of the scores schema to allow for soft-deletion, so you don't need to effectively delete evidence by hard wiping the data

Maybe make an issue for that? And leave ur thoughts on implementation there, maybe I'll implement it sometime

minisbett avatar Mar 01 '24 19:03 minisbett

stats recalc will be required regardless if removing scores

Not on a full wipe, you can just set all stats to 0 then.

Yes

GamebP avatar Mar 01 '24 19:03 GamebP

eventually I'd like to introduce a rework of the scores schema to allow for soft-deletion, so you don't need to effectively delete evidence by hard wiping the data

Maybe make an issue for that? And leave ur thoughts on implementation there, maybe I'll implement it sometime

Yeah I'm meditating on it since this - similar topic: https://github.com/osuAkatsuki/bancho.py/pull/642#discussion_r1505210365

I'll create tracking soon..

cmyui avatar Mar 01 '24 20:03 cmyui

How's the progress

GamebP avatar May 19 '24 17:05 GamebP

How's the progress

no one's probably interesting in working on it, but if you want to do it manually, delete the scores via DELETE * FROM scores WHERE userid = :id AND mode = :mode, and update the stats via UPDATE stats SET pp = 0 WHERE id = :id AND mode = :mode.

Note that this does not update the global & country ranks, but they would be re-calculated when the !unrestrict command is performed.

minisbett avatar May 19 '24 22:05 minisbett