Skip to content

Commit 0194512

Browse files
committed
Updated ViaProxy API usage
1 parent e58ff2f commit 0194512

File tree

3 files changed

+37
-2
lines changed

3 files changed

+37
-2
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
* This file is part of ViaProxyOpenAuthMod - https://github.com/ViaVersionAddons/ViaProxyOpenAuthMod
3+
* Copyright (C) 2024-2025 RK_01/RaphiMC and contributors
4+
*
5+
* This program is free software: you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*/
18+
package net.raphimc.openauthmodplugin;
19+
20+
import java.math.BigInteger;
21+
import java.nio.charset.StandardCharsets;
22+
23+
public class OpenAuthModConstants {
24+
25+
public static final String BASE_CHANNEL = "oam:";
26+
public static final byte[] LEGACY_MAGIC_BYTES = new byte[]{2, 20, 12, 3}; // 1.8 - 1.12.2
27+
public static final String LEGACY_MAGIC_STRING = new String(LEGACY_MAGIC_BYTES, StandardCharsets.UTF_8); // 1.8 - 1.12.2
28+
public static final int LEGACY_MAGIC_INT = -new BigInteger(LEGACY_MAGIC_BYTES).intValueExact(); // 1.8 - 1.12.2
29+
30+
// Request
31+
public static final String JOIN_CHANNEL = BASE_CHANNEL + "join"; // 1.8 - latest
32+
public static final String SIGN_NONCE_CHANNEL = BASE_CHANNEL + "sign_nonce"; // 1.19 - latest
33+
34+
// Response
35+
public static final String DATA_CHANNEL = BASE_CHANNEL + "data"; // 1.8 - latest
36+
37+
}

src/main/java/net/raphimc/openauthmodplugin/OpenAuthModPacketHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import net.raphimc.netminecraft.packet.impl.login.S2CLoginCustomQueryPacket;
3232
import net.raphimc.netminecraft.packet.impl.login.S2CLoginDisconnectPacket;
3333
import net.raphimc.netminecraft.packet.impl.play.S2CPlayCustomPayloadPacket;
34-
import net.raphimc.viaproxy.proxy.external_interface.OpenAuthModConstants;
3534
import net.raphimc.viaproxy.proxy.packethandler.PacketHandler;
3635
import net.raphimc.viaproxy.proxy.session.ProxyConnection;
3736

src/main/java/net/raphimc/openauthmodplugin/OpenAuthModPlugin.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import net.raphimc.viaproxy.plugins.events.JoinServerRequestEvent;
3030
import net.raphimc.viaproxy.plugins.events.ViaProxyLoadedEvent;
3131
import net.raphimc.viaproxy.protocoltranslator.viaproxy.ViaProxyConfig;
32-
import net.raphimc.viaproxy.proxy.external_interface.OpenAuthModConstants;
3332
import net.raphimc.viaproxy.ui.I18n;
3433

3534
import java.util.Map;

0 commit comments

Comments
 (0)