osuAkatsuki / bancho.py

An osu! server for the generic public, optimized for maintainability in modern python
https://akatsuki.gg
MIT License
212 stars 127 forks source link

Add mods to beatmap.last_np #478

Closed cmyui closed 7 months ago

cmyui commented 1 year ago

The last_np field is used for keeping context of what the player's last /np'ed.

We currently parse the mods out of the /np in regex: https://github.com/osuAkatsuki/bancho.py/blob/a043f12e4a77f83faa180938214e02f79333872d/app/api/domains/cho.py#L74-L79

But we do not store this in the beatmap.last_np field after parsing from regex: 1) https://github.com/osuAkatsuki/bancho.py/blob/a043f12e4a77f83faa180938214e02f79333872d/app/api/domains/cho.py#L1226-L1230 2) https://github.com/osuAkatsuki/bancho.py/blob/a043f12e4a77f83faa180938214e02f79333872d/app/api/domains/cho.py#L402-L406

This data is useful so it can then later be used for e.g. pp calculation based on context.

minisbett commented 1 year ago

If this is implemented it could directly be integrated into the !with command. Make sure to merge #356 first