Skip to content

Instantly share code, notes, and snippets.

View ScarletLovell's full-sized avatar
🕶️
coding. coding. coding. coding. coding. coding. coding.

Scarlet_Lovell ScarletLovell

🕶️
coding. coding. coding. coding. coding. coding. coding.
View GitHub Profile
@ScarletLovell
ScarletLovell / NetClientHandler.java
Last active February 23, 2023 02:09
Adds both new & old authentication methods for servers through one function
private String tryHandshake(String urlStr, String userOrSession) throws IOException {
URL url = new URL(
urlStr + /*joinserver.jsp*/ "?" +
"user=" + this.mc.session.username +
"&sessionId=" + this.mc.session.sessionId +
"&serverId=" + userOrSession
);
// Create URL with timeout
HttpURLConnection huc = (HttpURLConnection) url.openConnection();