Add online (aka ReplayCenter) module
Add localization extra (formally known as LocalizedResourcePack) Add version checker extra
This commit is contained in:
45
src/main/java/com/replaymod/online/api/AuthData.java
Normal file
45
src/main/java/com/replaymod/online/api/AuthData.java
Normal file
@@ -0,0 +1,45 @@
|
||||
package com.replaymod.online.api;
|
||||
|
||||
/**
|
||||
* Represents a set of persistent authentication data.
|
||||
*/
|
||||
public interface AuthData {
|
||||
/**
|
||||
* Returns the user name of the authenticated user.
|
||||
* @return user name or {@code null} if not logged in
|
||||
*/
|
||||
String getUserName();
|
||||
|
||||
/**
|
||||
* Returns the authentication key of the authenticated user.
|
||||
* @return auth key or {@code null} if not logged in
|
||||
*/
|
||||
String getAuthKey();
|
||||
|
||||
/**
|
||||
* Store the authentication data after login.
|
||||
* @param userName The user name
|
||||
* @param authKey The authentication key
|
||||
*/
|
||||
void setData(String userName, String authKey);
|
||||
|
||||
/**
|
||||
* Result of authentication operations.
|
||||
*/
|
||||
enum AuthResult {
|
||||
/**
|
||||
* The operation succeeded without errors.
|
||||
*/
|
||||
SUCCESS,
|
||||
|
||||
/**
|
||||
* The data provided got rejected due to it being invalid.
|
||||
*/
|
||||
INVALID_DATA,
|
||||
|
||||
/**
|
||||
* Operation could not be performed due to connectivity problems.
|
||||
*/
|
||||
IO_ERROR,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user