mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Use interface to access API
Allows for better testability.
This commit is contained in:
@ -18,6 +18,19 @@ namespace osu.Game.Online.API
|
||||
/// </summary>
|
||||
bool IsLoggedIn { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The last username provided by the end-user.
|
||||
/// May not be authenticated.
|
||||
/// </summary>
|
||||
string ProvidedUsername { get; }
|
||||
|
||||
/// <summary>
|
||||
/// The URL endpoint for this API. Does not include a trailing slash.
|
||||
/// </summary>
|
||||
string Endpoint { get; }
|
||||
|
||||
APIState State { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Queue a new request.
|
||||
/// </summary>
|
||||
@ -29,5 +42,32 @@ namespace osu.Game.Online.API
|
||||
/// </summary>
|
||||
/// <param name="component">The component to register.</param>
|
||||
void Register(IOnlineComponent component);
|
||||
|
||||
/// <summary>
|
||||
/// Unregisters a component to receive state changes.
|
||||
/// </summary>
|
||||
/// <param name="component">The component to unregister.</param>
|
||||
void Unregister(IOnlineComponent component);
|
||||
|
||||
/// <summary>
|
||||
/// Attempt to login using the provided credentials. This is a non-blocking operation.
|
||||
/// </summary>
|
||||
/// <param name="username">The user's username.</param>
|
||||
/// <param name="password">The user's password.</param>
|
||||
void Login(string username, string password);
|
||||
|
||||
/// <summary>
|
||||
/// Log out the current user.
|
||||
/// </summary>
|
||||
void Logout();
|
||||
|
||||
/// <summary>
|
||||
/// Create a new user account. This is a blocking operation.
|
||||
/// </summary>
|
||||
/// <param name="email">The email to create the account with.</param>
|
||||
/// <param name="username">The username to create the account with.</param>
|
||||
/// <param name="password">The password to create the account with.</param>
|
||||
/// <returns>Any errors encoutnered during account creation.</returns>
|
||||
RegistrationRequest.RegistrationRequestErrors CreateAccount(string email, string username, string password);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user