Skip to content

Commit

Permalink
2024
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Jan 1, 2024
1 parent c883414 commit 9fc0b65
Show file tree
Hide file tree
Showing 24 changed files with 144 additions and 114 deletions.
2 changes: 1 addition & 1 deletion .idea/copyright/Apache_2_0.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 7 additions & 5 deletions src/main/java/de/florianmichael/classic4j/BetaCraftHandler.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -35,6 +35,7 @@
* This class provides methods to interact with the BetaCraft API. These API methods are used to request the Multiplayer Pass for a server.
*/
public class BetaCraftHandler {

public final static URI BETACRAFT_ROOT_URI = URI.create("https://api.betacraft.uk");

public final static URI GET_MP_PASS = BETACRAFT_ROOT_URI.resolve("/getmppass.jsp");
Expand Down Expand Up @@ -159,4 +160,5 @@ private static String sha1(final byte[] input) {
return null;
}
}

}
12 changes: 7 additions & 5 deletions src/main/java/de/florianmichael/classic4j/ClassiCubeHandler.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -38,6 +38,7 @@
* This class provides methods to interact with the ClassiCube API.
*/
public class ClassiCubeHandler {

public final static Gson GSON = new GsonBuilder().serializeNulls().create();

/**
Expand Down Expand Up @@ -167,4 +168,5 @@ public static void requestAuthentication(final CCAccount account, final String l
});
});
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -28,4 +28,5 @@ public interface JoinServerInterface {
* @param serverId The server ID to use for the request.
*/
void sendAuthRequest(final String serverId);

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -41,4 +41,5 @@ public interface LoginProcessHandler {
* @param throwable The throwable that caused the login to fail.
*/
void handleException(final Throwable throwable);

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -24,6 +24,7 @@
* This interface represents a BetaCraft server info specification.
*/
public interface BCServerInfoSpec {

String name();

String description();
Expand Down Expand Up @@ -55,4 +56,5 @@ default Optional<byte[]> icon() {
String softwareVersion();

long lastPingTime();

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -110,4 +110,5 @@ public String toString() {
"servers=" + servers +
'}';
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* This file is part of RClasses - https://github.com/FlorianMichael/RClasses
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -108,4 +108,5 @@ public record Info(@SerializedName("public_id") UUID publicId, String name, Stri
@SerializedName("online_mode") boolean onlineMode) {

}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -63,4 +63,5 @@ public List<String> playerNames() {

return Arrays.stream(this._playerNames.split(", ")).toList();
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -27,6 +27,7 @@
* This class represents the response of the ClassiCube server list when authenticating. It is used by {@link de.florianmichael.classic4j.ClassiCubeHandler}.
*/
public class CCAuthenticationResponse {

public final String token;
public final String username;
public final boolean authenticated;
Expand Down Expand Up @@ -79,4 +80,5 @@ public boolean mfaRequired() {
public static CCAuthenticationResponse fromJson(final String json) {
return ClassiCubeHandler.GSON.fromJson(json, CCAuthenticationResponse.class);
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -21,6 +21,7 @@
* This enum represents an error that can occur when logging in to ClassiCube.
*/
public enum CCError {

TOKEN("Incorrect token. Is your ViaFabricPlus out of date?"),
USERNAME("Invalid username."),
PASSWORD("Invalid password."),
Expand All @@ -32,4 +33,5 @@ public enum CCError {
CCError(final String description) {
this.description = description;
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -26,6 +26,7 @@
* This class represents an account on the ClassiCube server list. It is used by {@link de.florianmichael.classic4j.ClassiCubeHandler}.
*/
public class CCAccount {

public final CookieStore cookieStore = new CookieStore();

public String token;
Expand Down Expand Up @@ -101,4 +102,5 @@ public String toString() {
", password='" + password + '\'' +
'}';
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -23,6 +23,7 @@
* This class represents the data needed to authenticate with the ClassiCube server list. It is used by {@link de.florianmichael.classic4j.ClassiCubeHandler}.
*/
public class CCAuthenticationData {

private final String username;
private final String password;
private final String previousToken;
Expand Down Expand Up @@ -86,4 +87,5 @@ public String toString() {
", loginCode='" + loginCode + '\'' +
'}';
}

}
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
* This file is part of Classic4J - https://github.com/FlorianMichael/Classic4J
* Copyright (C) 2023 FlorianMichael/EnZaXD and contributors
* Copyright (C) 2023-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -61,4 +61,5 @@ public String toString() {
", mpPass='" + mpPass + '\'' +
'}';
}

}
Loading

0 comments on commit 9fc0b65

Please sign in to comment.