Updated session version
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ dependencies {
|
|||||||
modApi "dev.felnull:special-model-loader:1.4.0+pre.1"
|
modApi "dev.felnull:special-model-loader:1.4.0+pre.1"
|
||||||
include "dev.felnull:special-model-loader:1.4.0+pre.1"
|
include "dev.felnull:special-model-loader:1.4.0+pre.1"
|
||||||
|
|
||||||
implementation 'com.github.selimaj-dev:session-java:v0.1.0'
|
implementation 'com.github.selimaj-dev:session-java:0.1.3'
|
||||||
|
|
||||||
include modImplementation("dev.kosmx.player-anim:player-animation-lib-fabric:${project.player_anim}")
|
include modImplementation("dev.kosmx.player-anim:player-animation-lib-fabric:${project.player_anim}")
|
||||||
//You might want bendy-lib. playerAnimator will wrap it.
|
//You might want bendy-lib. playerAnimator will wrap it.
|
||||||
|
|||||||
@@ -1,36 +1,15 @@
|
|||||||
package org.saturnclient.saturnclient.client;
|
package org.saturnclient.saturnclient.client;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
|
||||||
import com.fasterxml.jackson.databind.node.JsonNodeType;
|
|
||||||
import com.fasterxml.jackson.databind.node.TextNode;
|
import com.fasterxml.jackson.databind.node.TextNode;
|
||||||
|
|
||||||
import dev.selimaj.session.types.Method;
|
import dev.selimaj.session.types.Method;
|
||||||
|
|
||||||
public class ServiceMethods {
|
public class ServiceMethods {
|
||||||
public static class AuthResponse extends JsonNode {
|
public record AuthResponse(
|
||||||
@JsonProperty(required = true)
|
String username,
|
||||||
private String token;
|
String password) {
|
||||||
|
|
||||||
@JsonProperty(required = true)
|
|
||||||
private String userId;
|
|
||||||
|
|
||||||
// Constructor enforcing required fields
|
|
||||||
public AuthResponse(String token, String userId) {
|
|
||||||
this.token = token;
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Default constructor needed for Jackson deserialization
|
public static final Method<TextNode, AuthResponse, TextNode> Authenticate = new Method<>("auth",
|
||||||
public AuthResponse() {
|
TextNode.class, AuthResponse.class, TextNode.class);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public JsonNodeType getNodeType() {
|
|
||||||
return JsonNodeType.OBJECT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static final Method<TextNode, AuthResponse, TextNode> Authenticate = new Method<>("auth",
|
|
||||||
TextNode.class, TextNode.class, TextNode.class);
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user