Config.java 3.91 KB
Newer Older
Melledy's avatar
Melledy committed
1
2
package emu.grasscutter;

Secretboy's avatar
Secretboy committed
3
import java.util.Locale;
4
5
import emu.grasscutter.Grasscutter.ServerDebugMode;
import emu.grasscutter.Grasscutter.ServerRunMode;
筱傑's avatar
筱傑 committed
6
7
import emu.grasscutter.game.mail.Mail;

KingRainbow44's avatar
KingRainbow44 committed
8
public final class Config {
Melledy's avatar
Melledy committed
9
10
	public String DatabaseUrl = "mongodb://localhost:27017";
	public String DatabaseCollection = "grasscutter";
Jaida Wu's avatar
Jaida Wu committed
11

Melledy's avatar
Melledy committed
12
13
14
15
16
	public String RESOURCE_FOLDER = "./resources/";
	public String DATA_FOLDER = "./data/";
	public String PACKETS_FOLDER = "./packets/";
	public String DUMPS_FOLDER = "./dumps/";
	public String KEY_FOLDER = "./keys/";
17
	public String SCRIPTS_FOLDER = "./resources/Scripts/";
KingRainbow44's avatar
KingRainbow44 committed
18
	public String PLUGINS_FOLDER = "./plugins/";
19

20
21
	public ServerDebugMode DebugMode = ServerDebugMode.NONE; // ALL, MISSING, NONE
	public ServerRunMode RunMode = ServerRunMode.HYBRID; // HYBRID, DISPATCH_ONLY, GAME_ONLY
22
23
	public GameServerOptions GameServer = new GameServerOptions();
	public DispatchServerOptions DispatchServer = new DispatchServerOptions();
Secretboy's avatar
Secretboy committed
24
	public Locale LocaleLanguage = Locale.getDefault();
25
	public Locale DefaultLanguage = Locale.ENGLISH;
26

27
	public Boolean OpenStamina = true;
28
29
	public GameServerOptions getGameServerOptions() {
		return GameServer;
Melledy's avatar
Melledy committed
30
	}
31
32
33
34

	public DispatchServerOptions getDispatchOptions() { return DispatchServer; }

	public static class DispatchServerOptions {
35
36
		public String Ip = "0.0.0.0";
		public String PublicIp = "127.0.0.1";
37
		public int Port = 443;
38
		public int PublicPort = 0;
39
		public String KeystorePath = "./keystore.p12";
40
		public String KeystorePassword = "123456";
41
		public Boolean UseSSL = true;
42
		public Boolean FrontHTTPS = true;
43
44
		public Boolean CORS = false;
		public String[] CORSAllowedOrigins = new String[] { "*" };
45
46

		public boolean AutomaticallyCreateAccounts = false;
memetrollsXD's avatar
memetrollsXD committed
47
		public String[] defaultPermissions = new String[] { "" };
48
49
50
51
52
53
54
55
56
57
58
59
60

		public RegionInfo[] GameServers = {};

		public RegionInfo[] getGameServers() {
			return GameServers;
		}

		public static class RegionInfo {
			public String Name = "os_usa";
			public String Title = "Test";
			public String Ip = "127.0.0.1";
			public int Port = 22102;
		}
Melledy's avatar
Melledy committed
61
	}
Secretboy's avatar
Secretboy committed
62

63
64
	public static class GameServerOptions {
		public String Name = "Test";
65
66
		public String Ip = "0.0.0.0";
		public String PublicIp = "127.0.0.1";
67
		public int Port = 22102;
xtaodada's avatar
xtaodada committed
68
		public int PublicPort = 0;
69

70
71
72
		public String DispatchServerDatabaseUrl = "mongodb://localhost:27017";
		public String DispatchServerDatabaseCollection = "grasscutter";

73
74
75
76
77
78
79
		public int InventoryLimitWeapon = 2000;
		public int InventoryLimitRelic = 2000;
		public int InventoryLimitMaterial = 2000;
		public int InventoryLimitFurniture = 2000;
		public int InventoryLimitAll = 30000;
		public int MaxAvatarsInTeam = 4;
		public int MaxAvatarsInTeamMultiplayer = 4;
KingRainbow44's avatar
KingRainbow44 committed
80
		public int MaxEntityLimit = 1000; // Max entity limit per world. // TODO: Enforce later.
81
		public boolean WatchGacha = false;
xtaodada's avatar
xtaodada committed
82
		public String ServerNickname = "Server";
xtaodada's avatar
xtaodada committed
83
		public int ServerAvatarId = 10000007;
84
85
86
87
		public int ServerNameCardId = 210001;
		public int ServerLevel = 1;
		public int ServerWorldLevel = 1;
		public String ServerSignature = "Server Signature";
Melledy's avatar
Melledy committed
88
89
		public int[] WelcomeEmotes = {2007, 1002, 4010};
		public String WelcomeMotd = "Welcome to Grasscutter emu";
90
91
92
		public String WelcomeMailTitle = "Welcome to Grasscutter!";
		public String WelcomeMailSender = "Lawnmower";
		public String WelcomeMailContent = "Hi there!\r\nFirst of all, welcome to Grasscutter. If you have any issues, please let us know so that Lawnmower can help you! \r\n\r\nCheck out our:\r\n<type=\"browser\" text=\"Discord\" href=\"https://discord.gg/T5vZU6UyeG\"/>";
筱傑's avatar
筱傑 committed
93
94
95
96
		public Mail.MailItem[] WelcomeMailItems = {
				new Mail.MailItem(13509, 1, 1),
				new Mail.MailItem(201, 10000, 1),
		};
97

Kengxxiao's avatar
Kengxxiao committed
98
		public boolean EnableOfficialShop = true;
99
100
101
102
103
104
105
106
107
108

		public GameRates Game = new GameRates();

		public GameRates getGameRates() { return Game; }

		public static class GameRates {
			public float ADVENTURE_EXP_RATE = 1.0f;
			public float MORA_RATE = 1.0f;
			public float DOMAIN_DROP_RATE = 1.0f;
		}
Melledy's avatar
Melledy committed
109
110
	}
}