mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[DOC] Документация к AuthProvider/AuthHandler
This commit is contained in:
parent
c5d09557da
commit
5f6da3a638
2 changed files with 34 additions and 0 deletions
|
@ -33,14 +33,38 @@ public static void registerHandlers() {
|
||||||
|
|
||||||
protected transient LaunchServer srv;
|
protected transient LaunchServer srv;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the UUID associated with the account
|
||||||
|
* @param authResult {@link pro.gravit.launchserver.auth.provider.AuthProvider} result
|
||||||
|
* @return User UUID
|
||||||
|
* @throws IOException
|
||||||
|
* Internal Script Error
|
||||||
|
*/
|
||||||
public abstract UUID auth(AuthProviderResult authResult) throws IOException;
|
public abstract UUID auth(AuthProviderResult authResult) throws IOException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates serverID
|
||||||
|
* @param username user name
|
||||||
|
* @param serverID serverID to check
|
||||||
|
* @return user UUID
|
||||||
|
* @throws IOException
|
||||||
|
* Internal Script Error
|
||||||
|
*/
|
||||||
public abstract UUID checkServer(String username, String serverID) throws IOException;
|
public abstract UUID checkServer(String username, String serverID) throws IOException;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public abstract void close() throws IOException;
|
public abstract void close() throws IOException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks assessToken for validity and saves serverID if successful
|
||||||
|
* @param username user name
|
||||||
|
* @param accessToken assessToken to check
|
||||||
|
* @param serverID serverID to save
|
||||||
|
* @return true - allow, false - deny
|
||||||
|
* @throws IOException
|
||||||
|
* Internal Script Error
|
||||||
|
*/
|
||||||
public abstract boolean joinServer(String username, String accessToken, String serverID) throws IOException;
|
public abstract boolean joinServer(String username, String accessToken, String serverID) throws IOException;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,16 @@ public static void registerProviders() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies the username and password
|
||||||
|
* @param login user login
|
||||||
|
* @param password user password
|
||||||
|
* @param ip user ip
|
||||||
|
* @return player privileges, effective username and authorization token
|
||||||
|
* @throws Exception
|
||||||
|
* Throws an exception {@link AuthException} {@link pro.gravit.utils.HookException} if the verification script returned a meaningful error
|
||||||
|
* In other cases, throwing an exception indicates a serious error
|
||||||
|
*/
|
||||||
public abstract AuthProviderResult auth(String login, String password, String ip) throws Exception;
|
public abstract AuthProviderResult auth(String login, String password, String ip) throws Exception;
|
||||||
|
|
||||||
public void preAuth(String login, String password, String customText, String ip) {
|
public void preAuth(String login, String password, String customText, String ip) {
|
||||||
|
|
Loading…
Reference in a new issue