bancho.irc

Provides an IRC connection to Bancho (osu!'s server system) and access to its commands (Multiplayer room creation)

Members

Classes

BanchoBot
class BanchoBot

Represents a Bancho IRC connection.

ChannelNotFoundException
class ChannelNotFoundException
Undocumented in source.
NoServerResponseException
class NoServerResponseException
Undocumented in source.
OsuRoom
class OsuRoom

Represents a multiplayer lobby in osu! Automatically does ratelimiting by not sending more than a message every 2 seconds.

WaitTimeoutException
class WaitTimeoutException
Undocumented in source.

Enums

GameMode
enum GameMode

Represents a gamemode with integer mapping in the osu! api.

Mod
enum Mod
ModNumber
enum ModNumber
ScoreMode
enum ScoreMode
Team
enum Team
TeamMode
enum TeamMode

Functions

commandWithIgnoredResponse
auto commandWithIgnoredResponse(BanchoBot bot, bool delegate(Message) @(safe) nothrow checkResponse, string channel, const(char)[] message, bool ratelimit, int retries)
Undocumented in source. Be warned that the author may not have intended to support it.
commandWithIgnoredResponse
auto commandWithIgnoredResponse(OsuRoom room, bool delegate(Message) @(safe) nothrow checkResponse, const(char)[] message)

Runs some command up to 3 times whether or not checkResponse returns true. Expects a response from BanchoBot.

commandWithResponse
auto commandWithResponse(BanchoBot bot, bool delegate(Message) @(safe) nothrow checkResponse, string channel, const(char)[] message, bool ratelimit, int retries)
auto commandWithResponse(OsuRoom room, bool delegate(Message) @(safe) nothrow checkResponse, const(char)[] message)

Runs some command up to 3 times whether or not checkResponse returns true. Expects a response from BanchoBot.

despam
const(char)[] despam(const(char)[] command)

Alters an !mp command sent to bancho such that it doesn't get ignored because of flood protection because of sending identical commands. The current implementation simply inserts alternating 0, 1 and 2 spaces after !mp.

fixUsername
auto fixUsername(inout(char)[] username)

Replaces spaces with underscores in an osu! username

isSettingsMessage
bool isSettingsMessage(string msg)
Undocumented in source. Be warned that the author may not have intended to support it.
isValidOsuUsername
bool isValidOsuUsername(const(char)[] username, size_t maxLen)

Checks if a username is a valid osu username for registering now. Note that older usernames MAY be longer or contain illegal character combinations. Some character combinations are denied by user registration but are not checked for in here (such as admin).

orTimeout
T orTimeout(T value, Cb cb, string file, size_t line)

Returns the value given in first parameter or executes the callback if evaluating it threw a WaitTimeoutException. If any other exception is thrown, an AssertError will be triggered.

shortForm
string shortForm(Mod mod)

Generates the short form for a mod (eg Hidden -> HD), can be more than 2 characters

tryCommandWithResponse
bool tryCommandWithResponse(BanchoBot bot, bool delegate(Message) @(safe) nothrow checkResponse, Message result, string channel, const(char)[] message, bool ratelimit, int retries)
Undocumented in source. Be warned that the author may not have intended to support it.
tryCommandWithResponse
bool tryCommandWithResponse(BanchoBot bot, bool delegate(Message) @(safe) nothrow checkResponse, Message[] result, string channel, const(char)[] message, bool ratelimit, int retries)
Undocumented in source. Be warned that the author may not have intended to support it.
tryCommandWithResponse
bool tryCommandWithResponse(OsuRoom room, bool delegate(Message) @(safe) nothrow checkResponse, Message ret, const(char)[] message)
bool tryCommandWithResponse(OsuRoom room, bool delegate(Message) @(safe) nothrow checkResponse, Message[] ret, const(char)[] message)

Runs some command up to 3 times whether or not checkResponse returns true. Expects a response from BanchoBot.

Manifest constants

SettingsLineMinLength
enum SettingsLineMinLength;
Undocumented in source.

Mixin templates

Processor
mixintemplate Processor(string fn, Arg, size_t backlog, Duration ttl)

Utility mixin template implementing dynamic timeout based event subscribing + static backlog Creates methods waitFor<fn>, processfn, fetchOldfnLog, clearfnLog

Static variables

banchoBotNick
string banchoBotNick;

Username of BanchoBot (for sending !mp commands & checking source)

Structs

BeatmapInfo
struct BeatmapInfo
MembershipEvent
struct MembershipEvent

Represents a join/leave event.

Message
struct Message

Represents a simple sent message from bancho

Quit
struct Quit

Represents a user quitting or joining the IRC ingame or via web/irc

TopicChange
struct TopicChange

Represents a topic change event (in the case of a multi room being created)

Variables

despamState
int despamState;

Cyclic int how to modify a message to avoid message-flooding protection from bancho.

Meta