Commit 408fa907 authored by Melledy's avatar Melledy
Browse files

Move config java files to their own package

parent 55541fa1
...@@ -22,7 +22,7 @@ import java.util.Arrays; ...@@ -22,7 +22,7 @@ import java.util.Arrays;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.Set; import java.util.Set;
import static emu.grasscutter.Configuration.DATA; import static emu.grasscutter.config.Configuration.DATA;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
/** /**
......
package emu.grasscutter.server.http.handlers; package emu.grasscutter.server.http.handlers;
import static emu.grasscutter.config.Configuration.ACCOUNT;
import emu.grasscutter.GameConstants; import emu.grasscutter.GameConstants;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.server.http.objects.HttpJsonResponse; import emu.grasscutter.server.http.objects.HttpJsonResponse;
...@@ -10,8 +12,6 @@ import express.http.Request; ...@@ -10,8 +12,6 @@ import express.http.Request;
import express.http.Response; import express.http.Response;
import io.javalin.Javalin; import io.javalin.Javalin;
import static emu.grasscutter.Configuration.ACCOUNT;
/** /**
* Handles all generic, hard-coded responses. * Handles all generic, hard-coded responses.
*/ */
......
...@@ -10,8 +10,8 @@ import express.http.HttpContextHandler; ...@@ -10,8 +10,8 @@ import express.http.HttpContextHandler;
import express.http.Request; import express.http.Request;
import express.http.Response; import express.http.Response;
import static emu.grasscutter.config.Configuration.*;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
import static emu.grasscutter.Configuration.*;
public final class HttpJsonResponse implements HttpContextHandler { public final class HttpJsonResponse implements HttpContextHandler {
private final String response; private final String response;
......
...@@ -10,11 +10,11 @@ import express.http.Request; ...@@ -10,11 +10,11 @@ import express.http.Request;
import express.http.Response; import express.http.Response;
import io.javalin.core.util.FileUtil; import io.javalin.core.util.FileUtil;
import static emu.grasscutter.config.Configuration.DATA;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import static emu.grasscutter.Configuration.DATA;
public class WebStaticVersionResponse implements HttpContextHandler { public class WebStaticVersionResponse implements HttpContextHandler {
@Override @Override
......
package emu.grasscutter.server.packet.recv; 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.Grasscutter;
import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.game.Account; import emu.grasscutter.game.Account;
...@@ -21,6 +18,9 @@ import emu.grasscutter.utils.Utils; ...@@ -21,6 +18,9 @@ import emu.grasscutter.utils.Utils;
import javax.crypto.Cipher; 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.nio.ByteBuffer;
import java.security.Signature; import java.security.Signature;
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import static emu.grasscutter.config.Configuration.ACCOUNT;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.database.DatabaseHelper; import emu.grasscutter.database.DatabaseHelper;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
...@@ -13,8 +15,6 @@ import emu.grasscutter.server.game.GameSession.SessionState; ...@@ -13,8 +15,6 @@ import emu.grasscutter.server.game.GameSession.SessionState;
import emu.grasscutter.server.packet.send.PacketPlayerLoginRsp; import emu.grasscutter.server.packet.send.PacketPlayerLoginRsp;
import emu.grasscutter.server.packet.send.PacketTakeAchievementRewardReq; import emu.grasscutter.server.packet.send.PacketTakeAchievementRewardReq;
import static emu.grasscutter.Configuration.ACCOUNT;
@Opcodes(PacketOpcodes.PlayerLoginReq) // Sends initial data packets @Opcodes(PacketOpcodes.PlayerLoginReq) // Sends initial data packets
public class HandlerPlayerLoginReq extends PacketHandler { public class HandlerPlayerLoginReq extends PacketHandler {
......
...@@ -17,9 +17,9 @@ import emu.grasscutter.server.event.game.PlayerCreationEvent; ...@@ -17,9 +17,9 @@ import emu.grasscutter.server.event.game.PlayerCreationEvent;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.server.game.GameSession.SessionState; 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) @Opcodes(PacketOpcodes.SetPlayerBornDataReq)
public class HandlerSetPlayerBornDataReq extends PacketHandler { public class HandlerSetPlayerBornDataReq extends PacketHandler {
......
package emu.grasscutter.server.packet.recv; package emu.grasscutter.server.packet.recv;
import static emu.grasscutter.config.Configuration.SERVER;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.net.packet.Opcodes; import emu.grasscutter.net.packet.Opcodes;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
...@@ -9,8 +11,6 @@ import emu.grasscutter.net.packet.PacketHandler; ...@@ -9,8 +11,6 @@ import emu.grasscutter.net.packet.PacketHandler;
import emu.grasscutter.server.game.GameSession; import emu.grasscutter.server.game.GameSession;
import emu.grasscutter.Grasscutter.ServerDebugMode; import emu.grasscutter.Grasscutter.ServerDebugMode;
import static emu.grasscutter.Configuration.SERVER;
@Opcodes(PacketOpcodes.UnionCmdNotify) @Opcodes(PacketOpcodes.UnionCmdNotify)
public class HandlerUnionCmdNotify extends PacketHandler { public class HandlerUnionCmdNotify extends PacketHandler {
@Override @Override
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import static emu.grasscutter.config.Configuration.*;
import emu.grasscutter.GameConstants; import emu.grasscutter.GameConstants;
import emu.grasscutter.game.friends.Friendship; import emu.grasscutter.game.friends.Friendship;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
...@@ -11,8 +13,6 @@ import emu.grasscutter.net.proto.GetPlayerFriendListRspOuterClass.GetPlayerFrien ...@@ -11,8 +13,6 @@ import emu.grasscutter.net.proto.GetPlayerFriendListRspOuterClass.GetPlayerFrien
import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture; import emu.grasscutter.net.proto.ProfilePictureOuterClass.ProfilePicture;
import emu.grasscutter.net.proto.PlatformTypeOuterClass; import emu.grasscutter.net.proto.PlatformTypeOuterClass;
import static emu.grasscutter.Configuration.*;
public class PacketGetPlayerFriendListRsp extends BasePacket { public class PacketGetPlayerFriendListRsp extends BasePacket {
public PacketGetPlayerFriendListRsp(Player player) { public PacketGetPlayerFriendListRsp(Player player) {
......
...@@ -13,12 +13,12 @@ import emu.grasscutter.server.http.dispatch.RegionHandler; ...@@ -13,12 +13,12 @@ import emu.grasscutter.server.http.dispatch.RegionHandler;
import emu.grasscutter.utils.Crypto; import emu.grasscutter.utils.Crypto;
import emu.grasscutter.utils.FileUtils; import emu.grasscutter.utils.FileUtils;
import static emu.grasscutter.config.Configuration.*;
import java.io.File; import java.io.File;
import java.util.Base64; import java.util.Base64;
import java.util.Objects; import java.util.Objects;
import static emu.grasscutter.Configuration.*;
public class PacketPlayerLoginRsp extends BasePacket { public class PacketPlayerLoginRsp extends BasePacket {
private static QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp regionCache; private static QueryCurrRegionHttpRspOuterClass.QueryCurrRegionHttpRsp regionCache;
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import static emu.grasscutter.config.Configuration.*;
import emu.grasscutter.game.inventory.GameItem; import emu.grasscutter.game.inventory.GameItem;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.packet.BasePacket;
...@@ -8,8 +10,6 @@ import emu.grasscutter.net.proto.ItemOuterClass.Item; ...@@ -8,8 +10,6 @@ import emu.grasscutter.net.proto.ItemOuterClass.Item;
import emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify; import emu.grasscutter.net.proto.PlayerStoreNotifyOuterClass.PlayerStoreNotify;
import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType; import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType;
import static emu.grasscutter.Configuration.*;
public class PacketPlayerStoreNotify extends BasePacket { public class PacketPlayerStoreNotify extends BasePacket {
public PacketPlayerStoreNotify(Player player) { public PacketPlayerStoreNotify(Player player) {
......
...@@ -8,7 +8,7 @@ import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo; ...@@ -8,7 +8,7 @@ import emu.grasscutter.net.proto.ChatInfoOuterClass.ChatInfo;
import emu.grasscutter.net.proto.PullRecentChatRspOuterClass.PullRecentChatRsp; import emu.grasscutter.net.proto.PullRecentChatRspOuterClass.PullRecentChatRsp;
import emu.grasscutter.utils.Utils; import emu.grasscutter.utils.Utils;
import static emu.grasscutter.Configuration.*; import static emu.grasscutter.config.Configuration.*;
import java.util.List; import java.util.List;
......
package emu.grasscutter.server.packet.send; package emu.grasscutter.server.packet.send;
import static emu.grasscutter.config.Configuration.*;
import emu.grasscutter.net.packet.BasePacket; import emu.grasscutter.net.packet.BasePacket;
import emu.grasscutter.net.packet.PacketOpcodes; import emu.grasscutter.net.packet.PacketOpcodes;
import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType; import emu.grasscutter.net.proto.StoreTypeOuterClass.StoreType;
import emu.grasscutter.net.proto.StoreWeightLimitNotifyOuterClass.StoreWeightLimitNotify; import emu.grasscutter.net.proto.StoreWeightLimitNotifyOuterClass.StoreWeightLimitNotify;
import static emu.grasscutter.Configuration.*;
public class PacketStoreWeightLimitNotify extends BasePacket { public class PacketStoreWeightLimitNotify extends BasePacket {
public PacketStoreWeightLimitNotify() { public PacketStoreWeightLimitNotify() {
......
...@@ -27,8 +27,8 @@ import emu.grasscutter.data.excels.QuestData; ...@@ -27,8 +27,8 @@ import emu.grasscutter.data.excels.QuestData;
import emu.grasscutter.data.excels.SceneData; import emu.grasscutter.data.excels.SceneData;
import emu.grasscutter.utils.Utils; import emu.grasscutter.utils.Utils;
import static emu.grasscutter.config.Configuration.*;
import static emu.grasscutter.utils.Language.translate; import static emu.grasscutter.utils.Language.translate;
import static emu.grasscutter.Configuration.*;
public final class Tools { public final class Tools {
public static void createGmHandbook() throws Exception { public static void createGmHandbook() throws Exception {
......
...@@ -6,12 +6,13 @@ import emu.grasscutter.Grasscutter; ...@@ -6,12 +6,13 @@ import emu.grasscutter.Grasscutter;
import emu.grasscutter.game.player.Player; import emu.grasscutter.game.player.Player;
import javax.annotation.Nullable; import javax.annotation.Nullable;
import static emu.grasscutter.config.Configuration.*;
import java.io.InputStream; import java.io.InputStream;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.Map; import java.util.Map;
import static emu.grasscutter.Configuration.*;
public final class Language { public final class Language {
private static final Map<String, Language> cachedLanguages = new ConcurrentHashMap<>(); private static final Map<String, Language> cachedLanguages = new ConcurrentHashMap<>();
......
...@@ -10,6 +10,7 @@ import java.util.*; ...@@ -10,6 +10,7 @@ import java.util.*;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
import emu.grasscutter.Grasscutter; import emu.grasscutter.Grasscutter;
import emu.grasscutter.config.ConfigContainer;
import emu.grasscutter.data.DataLoader; import emu.grasscutter.data.DataLoader;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil; import io.netty.buffer.ByteBufUtil;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment