Skip to content

Commit

Permalink
Updated ViaProxy API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphiMC committed Jan 13, 2025
1 parent e58ff2f commit 0194512
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* This file is part of ViaProxyOpenAuthMod - https://github.com/ViaVersionAddons/ViaProxyOpenAuthMod
* Copyright (C) 2024-2025 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.openauthmodplugin;

import java.math.BigInteger;
import java.nio.charset.StandardCharsets;

public class OpenAuthModConstants {

public static final String BASE_CHANNEL = "oam:";
public static final byte[] LEGACY_MAGIC_BYTES = new byte[]{2, 20, 12, 3}; // 1.8 - 1.12.2
public static final String LEGACY_MAGIC_STRING = new String(LEGACY_MAGIC_BYTES, StandardCharsets.UTF_8); // 1.8 - 1.12.2
public static final int LEGACY_MAGIC_INT = -new BigInteger(LEGACY_MAGIC_BYTES).intValueExact(); // 1.8 - 1.12.2

// Request
public static final String JOIN_CHANNEL = BASE_CHANNEL + "join"; // 1.8 - latest
public static final String SIGN_NONCE_CHANNEL = BASE_CHANNEL + "sign_nonce"; // 1.19 - latest

// Response
public static final String DATA_CHANNEL = BASE_CHANNEL + "data"; // 1.8 - latest

}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import net.raphimc.netminecraft.packet.impl.login.S2CLoginCustomQueryPacket;
import net.raphimc.netminecraft.packet.impl.login.S2CLoginDisconnectPacket;
import net.raphimc.netminecraft.packet.impl.play.S2CPlayCustomPayloadPacket;
import net.raphimc.viaproxy.proxy.external_interface.OpenAuthModConstants;
import net.raphimc.viaproxy.proxy.packethandler.PacketHandler;
import net.raphimc.viaproxy.proxy.session.ProxyConnection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
import net.raphimc.viaproxy.plugins.events.JoinServerRequestEvent;
import net.raphimc.viaproxy.plugins.events.ViaProxyLoadedEvent;
import net.raphimc.viaproxy.protocoltranslator.viaproxy.ViaProxyConfig;
import net.raphimc.viaproxy.proxy.external_interface.OpenAuthModConstants;
import net.raphimc.viaproxy.ui.I18n;

import java.util.Map;
Expand Down

0 comments on commit 0194512

Please sign in to comment.