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

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

KingRainbow44's avatar
KingRainbow44 committed
7
public final class Config {
8

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
24
25
26
	public GameServerOptions GameServer = new GameServerOptions();
	public DispatchServerOptions DispatchServer = new DispatchServerOptions();

	public GameServerOptions getGameServerOptions() {
		return GameServer;
Melledy's avatar
Melledy committed
27
	}
28
29
30
31

	public DispatchServerOptions getDispatchOptions() { return DispatchServer; }

	public static class DispatchServerOptions {
32
33
		public String Ip = "0.0.0.0";
		public String PublicIp = "127.0.0.1";
34
		public int Port = 443;
35
		public int PublicPort = 0;
36
		public String KeystorePath = "./keystore.p12";
37
		public String KeystorePassword = "123456";
38
		public Boolean UseSSL = true;
39
		public Boolean FrontHTTPS = true;
40
41

		public boolean AutomaticallyCreateAccounts = false;
memetrollsXD's avatar
memetrollsXD committed
42
		public String[] defaultPermissions = new String[] { "" };
43
44
45
46
47
48
49
50
51
52
53
54
55

		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
56
57
	}
	
58
59
	public static class GameServerOptions {
		public String Name = "Test";
60
61
		public String Ip = "0.0.0.0";
		public String PublicIp = "127.0.0.1";
62
		public int Port = 22102;
xtaodada's avatar
xtaodada committed
63
		public int PublicPort = 0;
64

65
66
67
		public String DispatchServerDatabaseUrl = "mongodb://localhost:27017";
		public String DispatchServerDatabaseCollection = "grasscutter";

68
69
70
71
72
73
74
		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
75
		public int MaxEntityLimit = 1000; // Max entity limit per world. // TODO: Enforce later.
76
		public boolean WatchGacha = false;
xtaodada's avatar
xtaodada committed
77
		public String ServerNickname = "Server";
xtaodada's avatar
xtaodada committed
78
		public int ServerAvatarId = 10000007;
Melledy's avatar
Melledy committed
79
80
		public int[] WelcomeEmotes = {2007, 1002, 4010};
		public String WelcomeMotd = "Welcome to Grasscutter emu";
memetrollsXD's avatar
memetrollsXD committed
81
		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\"/> <type=\"browser\" text=\"GitHub\" href=\"https://github.com/Melledy/Grasscutter\"/>";
筱傑's avatar
筱傑 committed
82
83
84
85
		public Mail.MailItem[] WelcomeMailItems = {
				new Mail.MailItem(13509, 1, 1),
				new Mail.MailItem(201, 10000, 1),
		};
86

Kengxxiao's avatar
Kengxxiao committed
87
		public boolean EnableOfficialShop = true;
88
89
90
91
92
93
94
95
96
97

		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
98
99
	}
}