|
| 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 | +} |
0 commit comments