mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-01-25 04:15:34 +08:00
Move config java files to their own package
This commit is contained in:
parent
55541fa1da
commit
408fa90728
@ -11,6 +11,7 @@ import emu.grasscutter.auth.DefaultAuthentication;
|
||||
import emu.grasscutter.command.CommandMap;
|
||||
import emu.grasscutter.command.DefaultPermissionHandler;
|
||||
import emu.grasscutter.command.PermissionHandler;
|
||||
import emu.grasscutter.config.ConfigContainer;
|
||||
import emu.grasscutter.data.ResourceLoader;
|
||||
import emu.grasscutter.database.DatabaseManager;
|
||||
import emu.grasscutter.plugin.PluginManager;
|
||||
@ -26,7 +27,6 @@ import emu.grasscutter.server.http.handlers.GachaHandler;
|
||||
import emu.grasscutter.server.http.handlers.GenericHandler;
|
||||
import emu.grasscutter.server.http.handlers.LogHandler;
|
||||
import emu.grasscutter.tools.Tools;
|
||||
import emu.grasscutter.utils.ConfigContainer;
|
||||
import emu.grasscutter.utils.Crypto;
|
||||
import emu.grasscutter.utils.Language;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
@ -43,8 +43,8 @@ import javax.annotation.Nullable;
|
||||
import java.io.*;
|
||||
import java.util.Calendar;
|
||||
|
||||
import static emu.grasscutter.Configuration.DATA;
|
||||
import static emu.grasscutter.Configuration.SERVER;
|
||||
import static emu.grasscutter.config.Configuration.DATA;
|
||||
import static emu.grasscutter.config.Configuration.SERVER;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
public final class Grasscutter {
|
||||
|
@ -6,7 +6,7 @@ import emu.grasscutter.game.Account;
|
||||
import emu.grasscutter.server.http.objects.ComboTokenResJson;
|
||||
import emu.grasscutter.server.http.objects.LoginResultJson;
|
||||
|
||||
import static emu.grasscutter.Configuration.ACCOUNT;
|
||||
import static emu.grasscutter.config.Configuration.ACCOUNT;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
/**
|
||||
|
@ -15,7 +15,7 @@ import java.security.KeyFactory;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
/**
|
||||
|
@ -1,10 +1,10 @@
|
||||
package emu.grasscutter.command.commands;
|
||||
|
||||
import at.favre.lib.crypto.bcrypt.BCrypt;
|
||||
import emu.grasscutter.Configuration;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.command.Command;
|
||||
import emu.grasscutter.command.CommandHandler;
|
||||
import emu.grasscutter.config.Configuration;
|
||||
import emu.grasscutter.database.DatabaseHelper;
|
||||
import emu.grasscutter.game.Account;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
|
@ -20,7 +20,7 @@ import javax.swing.text.html.parser.Entity;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
@Command(label = "spawn", usage = "spawn <entityId> [amount] [level(monster only)] [<x> <y> <z>(monster only, optional)]", aliases = {"drop"}, permission = "server.spawn", permissionTargeted = "server.spawn.others", description = "commands.spawn.description")
|
||||
|
@ -6,11 +6,12 @@ import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.server.packet.send.PacketChangeMpTeamAvatarRsp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
@Command(label = "team", usage = "team <add|remove|set> [avatarId,...] [index|first|last|index-index,...]",
|
||||
permission = "player.team", permissionTargeted = "player.team.others", description = "commands.team.description")
|
||||
public final class TeamCommand implements CommandHandler {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package emu.grasscutter.utils;
|
||||
package emu.grasscutter.config;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import emu.grasscutter.Grasscutter;
|
@ -1,9 +1,7 @@
|
||||
package emu.grasscutter;
|
||||
|
||||
import emu.grasscutter.utils.ConfigContainer;
|
||||
import emu.grasscutter.utils.ConfigContainer.*;
|
||||
package emu.grasscutter.config;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static emu.grasscutter.Grasscutter.config;
|
@ -6,6 +6,8 @@ import emu.grasscutter.tools.Tools;
|
||||
import emu.grasscutter.utils.FileUtils;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.DATA;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
@ -14,8 +16,6 @@ import java.io.InputStreamReader;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
import static emu.grasscutter.Configuration.DATA;
|
||||
|
||||
public class DataLoader {
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@ import emu.grasscutter.data.common.ScenePointConfig;
|
||||
import emu.grasscutter.game.world.SpawnDataEntry.*;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
public class ResourceLoader {
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.database;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import com.mongodb.MongoCommandException;
|
||||
import com.mongodb.client.MongoClient;
|
||||
import com.mongodb.client.MongoClients;
|
||||
@ -26,8 +28,6 @@ import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.quest.GameMainQuest;
|
||||
import emu.grasscutter.game.quest.GameQuest;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public final class DatabaseManager {
|
||||
private static Datastore gameDatastore;
|
||||
private static Datastore dispatchDatastore;
|
||||
|
@ -5,13 +5,13 @@ import emu.grasscutter.database.DatabaseHelper;
|
||||
import emu.grasscutter.utils.Crypto;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.bson.Document;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
@Entity(value = "accounts", useDiscriminator = false)
|
||||
public class Account {
|
||||
@Id private String id;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.game.avatar;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
@ -62,8 +64,6 @@ import it.unimi.dsi.fastutil.ints.Int2IntOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
import static emu.grasscutter.Configuration.GAME_OPTIONS;
|
||||
|
||||
@Entity(value = "avatars", useDiscriminator = false)
|
||||
public class Avatar {
|
||||
@Id private ObjectId id;
|
||||
|
@ -8,14 +8,14 @@ import emu.grasscutter.server.game.GameServer;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.io.FileReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class ExpeditionSystem extends BaseGameSystem {
|
||||
private final Int2ObjectMap<List<ExpeditionRewardDataList>> expeditionRewardData;
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.game.gacha;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import emu.grasscutter.data.common.ItemParamData;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.net.proto.GachaInfoOuterClass.GachaInfo;
|
||||
@ -7,8 +9,6 @@ import emu.grasscutter.net.proto.GachaUpInfoOuterClass.GachaUpInfo;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
import lombok.Getter;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class GachaBanner {
|
||||
@Getter private int gachaType;
|
||||
@Getter private int scheduleId;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.game.gacha;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileReader;
|
||||
import java.io.InputStreamReader;
|
||||
@ -45,8 +47,6 @@ import it.unimi.dsi.fastutil.ints.IntArrayList;
|
||||
import it.unimi.dsi.fastutil.ints.IntList;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class GachaSystem extends BaseGameSystem {
|
||||
private final Int2ObjectMap<GachaBanner> gachaBanners;
|
||||
private WatchService watchService;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.game.inventory;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
@ -30,8 +32,6 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectOpenHashMap;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class Inventory extends BasePlayerManager implements Iterable<GameItem> {
|
||||
private final Long2ObjectMap<GameItem> store;
|
||||
private final Int2ObjectMap<InventoryTab> inventoryTypes;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.game.managers;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
|
||||
|
||||
import emu.grasscutter.game.player.BasePlayerManager;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.game.props.PlayerProperty;
|
||||
@ -8,8 +10,6 @@ import emu.grasscutter.server.packet.send.PacketPlayerPropNotify;
|
||||
import emu.grasscutter.server.packet.send.PacketResinChangeNotify;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
|
||||
import static emu.grasscutter.Configuration.GAME_OPTIONS;
|
||||
|
||||
public class ResinManager extends BasePlayerManager {
|
||||
|
||||
public ResinManager(Player player) {
|
||||
|
@ -12,13 +12,14 @@ import emu.grasscutter.server.packet.send.PacketPullRecentChatRsp;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class ChatManager implements ChatManagerHandler {
|
||||
static final String PREFIXES = "[/!]";
|
||||
static final Pattern RE_PREFIXES = Pattern.compile(PREFIXES);
|
||||
|
@ -32,8 +32,6 @@ import it.unimi.dsi.fastutil.ints.Int2IntMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
import static emu.grasscutter.Configuration.GAME_OPTIONS;
|
||||
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.Collection;
|
||||
@ -42,6 +40,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
|
||||
import static java.util.Map.entry;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
@ -22,9 +22,9 @@ import emu.grasscutter.server.packet.send.*;
|
||||
import emu.grasscutter.utils.Position;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.*;
|
||||
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
|
||||
|
||||
import static emu.grasscutter.Configuration.GAME_OPTIONS;
|
||||
import java.util.*;
|
||||
|
||||
public class StaminaManager extends BasePlayerManager {
|
||||
|
||||
|
@ -76,6 +76,8 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import lombok.Getter;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
@ -83,8 +85,6 @@ import java.time.ZoneId;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
@Entity(value = "players", useDiscriminator = false)
|
||||
public class Player {
|
||||
@Id private int id;
|
||||
|
@ -1,13 +1,13 @@
|
||||
package emu.grasscutter.game.player;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import dev.morphia.annotations.Entity;
|
||||
import emu.grasscutter.game.avatar.Avatar;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
@Entity
|
||||
public class TeamInfo {
|
||||
private String name;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.game.player;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import dev.morphia.annotations.Entity;
|
||||
@ -38,8 +40,6 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
@Entity
|
||||
public class TeamManager extends BasePlayerDataManager {
|
||||
@Transient private Player player;
|
||||
|
@ -12,6 +12,8 @@ import emu.grasscutter.utils.Utils;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.io.FileReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
@ -20,8 +22,6 @@ import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class ShopSystem extends BaseGameSystem {
|
||||
private final Int2ObjectMap<List<ShopInfo>> shopData;
|
||||
private final List<ShopChestTable> shopChestData;
|
||||
|
@ -7,14 +7,14 @@ import emu.grasscutter.data.excels.TowerScheduleData;
|
||||
import emu.grasscutter.server.game.BaseGameSystem;
|
||||
import emu.grasscutter.server.game.GameServer;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.io.FileReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class TowerSystem extends BaseGameSystem {
|
||||
|
||||
public TowerSystem(GameServer server) {
|
||||
|
@ -6,12 +6,12 @@ import emu.grasscutter.server.game.GameServer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.net.URLClassLoader;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
/**
|
||||
* The base class for all plugins to extend.
|
||||
*/
|
||||
|
@ -6,14 +6,15 @@ import emu.grasscutter.utils.Utils;
|
||||
import lombok.*;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.PLUGIN;
|
||||
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.util.jar.*;
|
||||
|
||||
import static emu.grasscutter.Configuration.PLUGIN;
|
||||
|
||||
/**
|
||||
* Manages the server's plugins and the event system.
|
||||
*/
|
||||
|
@ -13,11 +13,12 @@ import lombok.ToString;
|
||||
import javax.script.Bindings;
|
||||
import javax.script.CompiledScript;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.SCRIPT;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static emu.grasscutter.Configuration.SCRIPT;
|
||||
|
||||
@ToString
|
||||
@Setter
|
||||
public class SceneBlock {
|
||||
|
@ -10,13 +10,14 @@ import org.luaj.vm2.LuaValue;
|
||||
import javax.script.Bindings;
|
||||
import javax.script.CompiledScript;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.SCRIPT;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static emu.grasscutter.Configuration.SCRIPT;
|
||||
|
||||
@ToString
|
||||
@Setter
|
||||
public class SceneGroup {
|
||||
|
@ -11,12 +11,13 @@ import lombok.ToString;
|
||||
import javax.script.Bindings;
|
||||
import javax.script.CompiledScript;
|
||||
import javax.script.ScriptException;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.SCRIPT;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static emu.grasscutter.Configuration.SCRIPT;
|
||||
|
||||
@ToString
|
||||
@Setter
|
||||
public class SceneMeta {
|
||||
|
@ -44,8 +44,8 @@ import java.time.OffsetDateTime;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
@Getter
|
||||
public final class GameServer extends KcpServer {
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.server.game;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import emu.grasscutter.server.event.game.ReceivePacketEvent;
|
||||
@ -14,8 +16,6 @@ import emu.grasscutter.server.game.GameSession.SessionState;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public class GameServerPacketHandler {
|
||||
private final Int2ObjectMap<PacketHandler> handlers;
|
||||
|
@ -17,8 +17,8 @@ import emu.grasscutter.utils.Utils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class GameSession implements GameSessionManager.KcpChannel {
|
||||
private final GameServer server;
|
||||
|
@ -13,7 +13,7 @@ import org.eclipse.jetty.util.ssl.SslContextFactory;
|
||||
import java.io.File;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
/**
|
||||
|
@ -29,8 +29,7 @@ import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.security.Signature;
|
||||
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.net.proto.QueryRegionListHttpRspOuterClass.QueryRegionListHttpRsp;
|
||||
|
||||
/**
|
||||
|
@ -1,16 +1,17 @@
|
||||
package emu.grasscutter.server.http.documentation;
|
||||
|
||||
import static emu.grasscutter.Configuration.RESOURCE;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.data.GameData;
|
||||
import emu.grasscutter.data.excels.AvatarData;
|
||||
import emu.grasscutter.data.excels.ItemData;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
import static emu.grasscutter.Configuration.DOCUMENT_LANGUAGE;
|
||||
import express.http.Request;
|
||||
import express.http.Response;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.DOCUMENT_LANGUAGE;
|
||||
import static emu.grasscutter.config.Configuration.RESOURCE;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package emu.grasscutter.server.http.documentation;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
@ -1,6 +1,6 @@
|
||||
package emu.grasscutter.server.http.documentation;
|
||||
|
||||
import static emu.grasscutter.Configuration.DATA;
|
||||
import static emu.grasscutter.config.Configuration.DATA;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
|
@ -12,6 +12,8 @@ import express.http.Request;
|
||||
import express.http.Response;
|
||||
import io.javalin.Javalin;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
@ -19,8 +21,6 @@ import java.io.InputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Objects;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
/**
|
||||
* Handles requests related to the announcements page.
|
||||
*/
|
||||
|
@ -22,7 +22,7 @@ import java.util.Arrays;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import static emu.grasscutter.Configuration.DATA;
|
||||
import static emu.grasscutter.config.Configuration.DATA;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.server.http.handlers;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.ACCOUNT;
|
||||
|
||||
import emu.grasscutter.GameConstants;
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.server.http.objects.HttpJsonResponse;
|
||||
@ -10,8 +12,6 @@ import express.http.Request;
|
||||
import express.http.Response;
|
||||
import io.javalin.Javalin;
|
||||
|
||||
import static emu.grasscutter.Configuration.ACCOUNT;
|
||||
|
||||
/**
|
||||
* Handles all generic, hard-coded responses.
|
||||
*/
|
||||
|
@ -10,8 +10,8 @@ import express.http.HttpContextHandler;
|
||||
import express.http.Request;
|
||||
import express.http.Response;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public final class HttpJsonResponse implements HttpContextHandler {
|
||||
private final String response;
|
||||
|
@ -10,11 +10,11 @@ import express.http.Request;
|
||||
import express.http.Response;
|
||||
import io.javalin.core.util.FileUtil;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.DATA;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import static emu.grasscutter.Configuration.DATA;
|
||||
|
||||
public class WebStaticVersionResponse implements HttpContextHandler {
|
||||
|
||||
@Override
|
||||
|
@ -1,8 +1,5 @@
|
||||
package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import static emu.grasscutter.Configuration.ACCOUNT;
|
||||
import static emu.grasscutter.Configuration.GAME_OPTIONS;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.database.DatabaseHelper;
|
||||
import emu.grasscutter.game.Account;
|
||||
@ -21,6 +18,9 @@ import emu.grasscutter.utils.Utils;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.ACCOUNT;
|
||||
import static emu.grasscutter.config.Configuration.GAME_OPTIONS;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.security.Signature;
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.ACCOUNT;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.database.DatabaseHelper;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
@ -13,8 +15,6 @@ import emu.grasscutter.server.game.GameSession.SessionState;
|
||||
import emu.grasscutter.server.packet.send.PacketPlayerLoginRsp;
|
||||
import emu.grasscutter.server.packet.send.PacketTakeAchievementRewardReq;
|
||||
|
||||
import static emu.grasscutter.Configuration.ACCOUNT;
|
||||
|
||||
@Opcodes(PacketOpcodes.PlayerLoginReq) // Sends initial data packets
|
||||
public class HandlerPlayerLoginReq extends PacketHandler {
|
||||
|
||||
|
@ -17,9 +17,9 @@ import emu.grasscutter.server.event.game.PlayerCreationEvent;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import emu.grasscutter.server.game.GameSession.SessionState;
|
||||
|
||||
import java.util.Arrays;
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
import java.util.Arrays;
|
||||
|
||||
@Opcodes(PacketOpcodes.SetPlayerBornDataReq)
|
||||
public class HandlerSetPlayerBornDataReq extends PacketHandler {
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.server.packet.recv;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.SERVER;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.net.packet.Opcodes;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
@ -9,8 +11,6 @@ import emu.grasscutter.net.packet.PacketHandler;
|
||||
import emu.grasscutter.server.game.GameSession;
|
||||
import emu.grasscutter.Grasscutter.ServerDebugMode;
|
||||
|
||||
import static emu.grasscutter.Configuration.SERVER;
|
||||
|
||||
@Opcodes(PacketOpcodes.UnionCmdNotify)
|
||||
public class HandlerUnionCmdNotify extends PacketHandler {
|
||||
@Override
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import emu.grasscutter.GameConstants;
|
||||
import emu.grasscutter.game.friends.Friendship;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
@ -11,8 +13,6 @@ import emu.grasscutter.net.proto.GetPlayerFriendListRspOuterClass.GetPlayerFrien
|
||||
import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture;
|
||||
import emu.grasscutter.net.proto.PlatformTypeOuterClass;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class PacketGetPlayerFriendListRsp extends BasePacket {
|
||||
|
||||
public PacketGetPlayerFriendListRsp(Player player) {
|
||||
|
@ -13,12 +13,12 @@ import emu.grasscutter.server.http.dispatch.RegionHandler;
|
||||
import emu.grasscutter.utils.Crypto;
|
||||
import emu.grasscutter.utils.FileUtils;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Base64;
|
||||
import java.util.Objects;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class PacketPlayerLoginRsp extends BasePacket {
|
||||
|
||||
private static QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp regionCache;
|
||||
|
@ -1,5 +1,7 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import emu.grasscutter.game.inventory.GameItem;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
@ -8,8 +10,6 @@ import emu.grasscutter.net.proto.ItemOuterClass.Item;
|
||||
import emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify;
|
||||
import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class PacketPlayerStoreNotify extends BasePacket {
|
||||
|
||||
public PacketPlayerStoreNotify(Player player) {
|
||||
|
@ -8,7 +8,7 @@ import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo;
|
||||
import emu.grasscutter.net.proto.PullRecentChatRspOuterClass.PullRecentChatRsp;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -1,12 +1,12 @@
|
||||
package emu.grasscutter.server.packet.send;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import emu.grasscutter.net.packet.BasePacket;
|
||||
import emu.grasscutter.net.packet.PacketOpcodes;
|
||||
import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType;
|
||||
import emu.grasscutter.net.proto.StoreWeightLimitNotifyOuterClass.StoreWeightLimitNotify;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public class PacketStoreWeightLimitNotify extends BasePacket {
|
||||
|
||||
public PacketStoreWeightLimitNotify() {
|
||||
|
@ -27,8 +27,8 @@ import emu.grasscutter.data.excels.QuestData;
|
||||
import emu.grasscutter.data.excels.SceneData;
|
||||
import emu.grasscutter.utils.Utils;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
import static emu.grasscutter.utils.Language.translate;
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public final class Tools {
|
||||
public static void createGmHandbook() throws Exception {
|
||||
|
@ -6,12 +6,13 @@ import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.game.player.Player;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static emu.grasscutter.config.Configuration.*;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static emu.grasscutter.Configuration.*;
|
||||
|
||||
public final class Language {
|
||||
private static final Map<String, Language> cachedLanguages = new ConcurrentHashMap<>();
|
||||
|
||||
|
@ -10,6 +10,7 @@ import java.util.*;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import emu.grasscutter.Grasscutter;
|
||||
import emu.grasscutter.config.ConfigContainer;
|
||||
import emu.grasscutter.data.DataLoader;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.ByteBufUtil;
|
||||
|
Loading…
Reference in New Issue
Block a user