Format code [skip actions]

This commit is contained in:
github-actions 2023-09-16 21:40:49 +00:00
parent fb0c2dbc84
commit 1f15d6219b
4 changed files with 12 additions and 14 deletions

View File

@ -2,7 +2,6 @@ package emu.grasscutter.net.packet;
import com.google.protobuf.GeneratedMessageV3;
import emu.grasscutter.net.proto.PacketHeadOuterClass.PacketHead;
import emu.grasscutter.utils.Crypto;
import java.io.*;
public class BasePacket {

View File

@ -119,8 +119,7 @@ public class HandlerGetPlayerTokenReq extends PacketHandler {
var clientSeedEncrypted = Utils.base64Decode(req.getClientRandKey());
var clientSeed = ByteBuffer.wrap(cipher.doFinal(clientSeedEncrypted)).getLong();
var seedBytes =
ByteBuffer.wrap(new byte[8]).putLong(encryptSeed ^ clientSeed).array();
var seedBytes = ByteBuffer.wrap(new byte[8]).putLong(encryptSeed ^ clientSeed).array();
cipher.init(Cipher.ENCRYPT_MODE, Crypto.EncryptionKeys.get(req.getKeyId()));
var seedEncrypted = cipher.doFinal(seedBytes);

View File

@ -3,7 +3,6 @@ package emu.grasscutter.utils;
import emu.grasscutter.Grasscutter;
import emu.grasscutter.server.http.objects.QueryCurRegionRspJson;
import emu.grasscutter.utils.algorithms.MersenneTwister64;
import java.io.ByteArrayOutputStream;
import java.nio.file.Path;
import java.security.*;

View File

@ -4,7 +4,8 @@ public final class MersenneTwister64 {
// Period parameters
private static final int N = 312;
private static final int M = 156;
private static final long MATRIX_A = 0xB5026F5AA96619E9L; // private static final * constant vector a
private static final long MATRIX_A =
0xB5026F5AA96619E9L; // private static final * constant vector a
private static final long UPPER_MASK = 0xFFFFFFFF80000000L; // most significant w-r bits
private static final int LOWER_MASK = 0x7FFFFFFF; // least significant r bits