hburn7 / BanchoSharp

C# library for communicating with osu!Bancho
GNU General Public License v3.0
11 stars 2 forks source link

Test cases for MultiplayerLobby #8

Closed hburn7 closed 1 year ago

hburn7 commented 2 years ago

Test the entire BanchoBot parser / all relevant events pertaining to the lobby.

There's a lot to test but it's necessary, most of these tests are very quick implementations.

Most of these are events:

Properties of MultiplayerLobby:

Test parsing of all mods in a multiplayer lobby, including [Relaxv2], null (not present), and [None]:

matte-ek commented 2 years ago

Commands

!mp settings

Room name: 3.00* - 5.00* | Auto Host Rotate, History: https://osu.ppy.sh/mp/104803682
Beatmap: https://osu.ppy.sh/b/2216531 Sayuri - Koukai no Uta (TV Size)
Team mode: HeadToHead, Win condition: Score
Active mods: Freemod
Players: 7
Slot 1  Not Ready https://osu.ppy.sh/u/22547049 Player 1        [Host]
Slot 2  Not Ready https://osu.ppy.sh/u/14607058 Player 2        [Hidden, HardRock]
Slot 3  Not Ready https://osu.ppy.sh/u/28851081 Player 3        
Slot 4  Not Ready https://osu.ppy.sh/u/27831164 Player 4        
Slot 6  Not Ready https://osu.ppy.sh/u/18028068 PlayerNameLarge1[Hidden, HardRock]
Slot 7  Not Ready https://osu.ppy.sh/u/22940358 Player 6        
Slot 8  Not Ready https://osu.ppy.sh/u/11796227 Player 7        

!mp host Player_1

Changed match host to Player 1

!mp start

Started the match

!mp abort

Aborted the match

!mp map 2038622

Changed beatmap to https://osu.ppy.sh/b/2038622 GALNERYUS - RAISE MY SWORD

Events

PlayerJoin

Player 1 joined in slot 1.
Player 1 joined in slot 1 for team blue.
Player 1 joined in slot 1 for team red.

TeamChange

Player 1 changed to Blue
Player 1 changed to Red

SlotChange

Player 1 moved to slot 12

PlayerLeave

Player 1 left the game.

MatchFinished

Player 1 finished playing (Score: 7428260, PASSED).
Player 3 finished playing (Score: 1964090, FAILED).
...
The match has finished!

MatchStarted

The match has started!

HostChanged

Player 1 became the host.

BeatmapChanged

Beatmap changed to: GALNERYUS - RAISE MY SWORD [Hard] (https://osu.ppy.sh/b/2038622)

Notice

As specified in the osu!wiki: Usernames must have any whitespace be replaced with underscores ( _ ). #<userid> may substitute <username> in all of the commands.

This means that the test data have had spaces replaced with _, however the Bancho response should be the same. Some of the already existing methods like SetHostAsync should probably consider this, and should be brought up in a separate issue.

There are also cases where a player name could be longer than 16 characters, which may break the name parsing, this should also be investigated further. This seems to be happening to either very old accounts, or accounts which names has been "stolen", and been replaced with <old_name>_old_1 This has not been included in the data as of now.

hburn7 commented 1 year ago

this issue is a nightmare...I'm just going to be using the code coverage to track this instead.