mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-17 09:25:06 +01:00
Merge branch 'development' into api
# Conflicts: # src/main/java/emu/grasscutter/plugin/api/ServerHook.java
This commit is contained in:
@@ -34,7 +34,7 @@ public final class Crypto {
|
||||
public static void extractSecretKeyBuffer(byte[] data) {
|
||||
try {
|
||||
GetPlayerTokenRsp p = GetPlayerTokenRsp.parseFrom(data);
|
||||
FileUtils.write(Grasscutter.getConfig().KEY_FOLDER + "secretKeyBuffer.bin", p.getSecretKeyBuffer().toByteArray());
|
||||
FileUtils.write(Grasscutter.getConfig().KEY_FOLDER + "secretKeyBuffer.bin", p.getSecretKeyBytes().toByteArray());
|
||||
Grasscutter.getLogger().info("Secret Key: " + p.getSecretKey());
|
||||
} catch (Exception e) {
|
||||
Grasscutter.getLogger().error("Crypto error.", e);
|
||||
|
||||
16
src/main/java/emu/grasscutter/utils/DateHelper.java
Normal file
16
src/main/java/emu/grasscutter/utils/DateHelper.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package emu.grasscutter.utils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Calendar;
|
||||
|
||||
public final class DateHelper {
|
||||
public static Date onlyYearMonthDay(Date now) {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(now);
|
||||
calendar.set(Calendar.HOUR_OF_DAY, 0);
|
||||
calendar.set(Calendar.MINUTE, 0);
|
||||
calendar.set(Calendar.SECOND, 0);
|
||||
calendar.set(Calendar.MILLISECOND, 0);
|
||||
return calendar.getTime();
|
||||
}
|
||||
}
|
||||
@@ -174,11 +174,11 @@ public final class Utils {
|
||||
// Check for resources folder.
|
||||
if(!fileExists(resourcesFolder)) {
|
||||
logger.info("Creating resources folder...");
|
||||
logger.info("Place a copy of 'GenshinData' in the resources folder.");
|
||||
logger.info("Place a copy of 'BinOutput' and 'ExcelBinOutput' in the resources folder.");
|
||||
createFolder(resourcesFolder); exit = true;
|
||||
}
|
||||
|
||||
// Check for GenshinData.
|
||||
// Check for BinOutput + ExcelBinOuput.
|
||||
if(!fileExists(resourcesFolder + "BinOutput") ||
|
||||
!fileExists(resourcesFolder + "ExcelBinOutput")) {
|
||||
logger.info("Place a copy of 'BinOutput' and 'ExcelBinOutput' in the resources folder.");
|
||||
|
||||
Reference in New Issue
Block a user