Aborts a running match
Aborts any running countdown
Returns the channel name as on IRC
Makes nobody host (make it system/bog managed)
Closes the room
Gives host to a player
Invites a player to the room
Kicks a player from the room
Property to lock slots (disallow changing slots & joining)
Changes the map to a beatmap ID (b/ url)
Changes the mods in this lobby (pass FreeMod first if you want FreeMod)
Moves a player to another slot
Returns the game ID as usable in osu://mp/ID urls
Sets the match password (password will be visible to existing players)
Processes a room closed event
Processes a user finish playing event & updates the state
Processes a user host event & updates the state
Processes a user join event & updates the state
Processes a user leave event & updates the state
Processes a match end event & updates the state
Processes a user move event & updates the state
Processes a room size change event & updates the state
Processes a user team switch event & updates the state
Manually wait until you can send a message again
Returns the room ID as usable in the mp history URL or IRC joinable via #mp_ID
Sends a message with a 2 second ratelimit
Sets up teammode, scoremode & lobby size
Changes a user's team
Sets a timer using !mp timer
Returns the current mp settings
Changes the slot limit of this lobby
Starts a match after a specified amount of seconds. If after is <= 0 the game will be started immediately. The timeout can be canceled using abortTimer.
Waits for a player to join the room & return the username
Waits for an existing timer/countdown to finish (wont start one)
Returned by !mp settings
Host changed map
Host is changing beatmap
The room has been closed
A timer finished
Match has ended (all players finished)
Match has started
A message by anyone has been sent
A user finished playing. username + score + passed
emitted when all players are ready
username as argument
username + slot (0 based) as argument
username as argument
username + slot (0 based) as argument
username & team as argument
Automatically managed state of player slots, empty slots are Player.init
1 BanchoBot banchoConnection = new BanchoBot("WebFreak", ""); 2 bool running = true; 3 auto botTask = runTask({ 4 while (running) 5 { 6 banchoConnection.connect(); 7 logDiagnostic("Got disconnected from bancho..."); 8 sleep(2.seconds); 9 } 10 }); 11 sleep(3.seconds); 12 auto users = ["WebFreak", "Node"]; 13 OsuRoom room = banchoConnection.createRoom("bob"); 14 runTask({ 15 foreach (user; users) 16 room.invite(user); 17 }); 18 runTask({ 19 room.password = "123456"; 20 room.size = 8; 21 room.mods = [Mod.Hidden, Mod.DoubleTime]; 22 room.map = "1158325"; 23 }); 24 runTask({ 25 int joined; 26 try 27 { 28 while (true) 29 { 30 string user = room.waitForJoin(30.seconds); 31 joined++; 32 room.sendMessage("yay welcome " ~ user ~ "!", HighPriority.yes); 33 } 34 } 35 catch (InterruptException) 36 { 37 if (joined == 0) 38 { 39 // forever alone 40 room.close(); 41 return; 42 } 43 } 44 room.sendMessage("This is an automated test, this room will close in 10 seconds on timer"); 45 room.setTimer(10.seconds); 46 try 47 { 48 room.waitForTimer(15.seconds); 49 } 50 catch (InterruptException) 51 { 52 room.sendMessage("Timer didn't trigger :("); 53 room.sendMessage("closing the room in 5s"); 54 sleep(5.seconds); 55 } 56 room.close(); 57 }).join(); 58 running = false; 59 banchoConnection.disconnect(); 60 botTask.join();
Represents a multiplayer lobby in osu! Automatically does ratelimiting by not sending more than a message every 2 seconds.
All slot indices are 0 based.