mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-23 09:12:53 +08:00
Format code [skip actions]
This commit is contained in:
parent
fb0c2dbc84
commit
1f15d6219b
@ -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 {
|
||||
|
@ -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);
|
||||
|
@ -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.*;
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user