Skip to content

Commit 8b97324

Browse files
committed
Main files.
1 parent 01aeaf1 commit 8b97324

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+6209
-0
lines changed

core/core.iml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module version="4">
3+
<component name="FacetManager">
4+
<facet type="minecraft" name="Minecraft">
5+
<configuration>
6+
<autoDetectTypes>
7+
<platformType>BUNGEECORD</platformType>
8+
</autoDetectTypes>
9+
<projectReimportVersion>1</projectReimportVersion>
10+
</configuration>
11+
</facet>
12+
</component>
13+
</module>

core/pom.xml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>club.netsafe.hybrid</groupId>
9+
<artifactId>hybrid-parent</artifactId>
10+
<version>1.0.0</version>
11+
</parent>
12+
13+
<artifactId>core</artifactId>
14+
<packaging>jar</packaging>
15+
16+
<dependencies>
17+
<dependency>
18+
<groupId>net.md-5</groupId>
19+
<artifactId>bungeecord-api</artifactId>
20+
</dependency>
21+
<dependency>
22+
<groupId>com.zaxxer</groupId>
23+
<artifactId>HikariCP</artifactId>
24+
</dependency>
25+
<dependency>
26+
<groupId>mysql</groupId>
27+
<artifactId>mysql-connector-java</artifactId>
28+
</dependency>
29+
<dependency>
30+
<groupId>org.xerial</groupId>
31+
<artifactId>sqlite-jdbc</artifactId>
32+
<version>3.45.3.0</version>
33+
</dependency>
34+
<dependency>
35+
<groupId>redis.clients</groupId>
36+
<artifactId>jedis</artifactId>
37+
<version>4.2.3</version>
38+
</dependency>
39+
<dependency>
40+
<groupId>com.google.code.gson</groupId>
41+
<artifactId>gson</artifactId>
42+
<version>2.9.0</version>
43+
</dependency>
44+
<dependency>
45+
<groupId>org.bstats</groupId>
46+
<artifactId>bstats-bungeecord</artifactId>
47+
<version>3.1.0</version>
48+
<scope>compile</scope>
49+
</dependency>
50+
</dependencies>
51+
52+
<build>
53+
<finalName>HybridCore-${project.version}</finalName>
54+
<resources>
55+
<resource>
56+
<directory>src/main/resources</directory>
57+
<filtering>true</filtering>
58+
</resource>
59+
</resources>
60+
<plugins>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-shade-plugin</artifactId>
64+
<version>3.2.4</version>
65+
<executions>
66+
<execution>
67+
<phase>package</phase>
68+
<goals>
69+
<goal>shade</goal>
70+
</goals>
71+
<configuration>
72+
<relocations>
73+
<relocation>
74+
<pattern>com.zaxxer.hikari</pattern>
75+
<shadedPattern>club.netsafe.hybrid.libs.hikari</shadedPattern>
76+
</relocation>
77+
<relocation>
78+
<pattern>redis.clients.jedis</pattern>
79+
<shadedPattern>club.netsafe.hybrid.libs.jedis</shadedPattern>
80+
</relocation>
81+
<relocation>
82+
<pattern>com.google.gson</pattern>
83+
<shadedPattern>club.netsafe.hybrid.libs.gson</shadedPattern>
84+
</relocation>
85+
<relocation>
86+
<pattern>org.bstats</pattern>
87+
<shadedPattern>club.netsafe.hybrid.libs.bstats</shadedPattern>
88+
</relocation>
89+
</relocations>
90+
<filters>
91+
<filter>
92+
<artifact>*:*</artifact>
93+
<excludes>
94+
<exclude>META-INF/*.SF</exclude>
95+
<exclude>META-INF/*.DSA</exclude>
96+
<exclude>META-INF/*.RSA</exclude>
97+
<exclude>META-INF/MANIFEST.MF</exclude>
98+
</excludes>
99+
</filter>
100+
</filters>
101+
<transformers>
102+
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
103+
</transformers>
104+
<createDependencyReducedPom>false</createDependencyReducedPom>
105+
</configuration>
106+
</execution>
107+
</executions>
108+
</plugin>
109+
</plugins>
110+
</build>
111+
</project>
Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
package club.netsafe.hybrid.core;
2+
3+
import club.netsafe.hybrid.core.commands.*;
4+
import club.netsafe.hybrid.core.listener.BungeeCordCommandLoggerListener;
5+
import club.netsafe.hybrid.core.listener.CaptchaListener;
6+
import club.netsafe.hybrid.core.listener.CommandLoggerListener;
7+
import club.netsafe.hybrid.core.listener.MaintenanceListener;
8+
import club.netsafe.hybrid.core.listener.PartyChatListener;
9+
import club.netsafe.hybrid.core.listener.PlayerListener;
10+
import club.netsafe.hybrid.core.listener.SecurityListener;
11+
import club.netsafe.hybrid.core.listener.ServerListListener;
12+
import club.netsafe.hybrid.core.manager.*;
13+
import club.netsafe.hybrid.core.util.MessageUtils;
14+
import net.md_5.bungee.api.plugin.Plugin;
15+
import net.md_5.bungee.config.Configuration;
16+
import org.bstats.bungeecord.Metrics;
17+
18+
/**
19+
* @author HCFAlerts
20+
* @project Hybrid
21+
* @org NetSafe LLC
22+
* @date 10/09/25
23+
*/
24+
25+
public class HybridCore extends Plugin {
26+
27+
private static HybridCore instance;
28+
private ConfigManager configManager;
29+
private DatabaseManager databaseManager;
30+
private RedisManager redisManager;
31+
private PartyManager partyManager;
32+
private FriendManager friendManager;
33+
private ServerStatsManager serverStatsManager;
34+
private AnnouncementManager announcementManager;
35+
private CaptchaManager captchaManager;
36+
private ModerationManager moderationManager;
37+
private CommandLoggerManager commandLoggerManager;
38+
39+
@Override
40+
public void onEnable() {
41+
instance = this;
42+
43+
configManager = new ConfigManager(getDataFolder());
44+
configManager.load();
45+
Configuration modules = configManager.getConfig().getSection("MODULES");
46+
47+
if (modules.getBoolean("FRIENDS") || modules.getBoolean("PARTIES")) {
48+
databaseManager = new DatabaseManager(this);
49+
}
50+
51+
if (modules.getBoolean("SERVER_MANAGER") || modules.getBoolean("SECURITY")) {
52+
redisManager = new RedisManager(this);
53+
}
54+
55+
if (modules.getBoolean("FRIENDS")) {
56+
friendManager = new FriendManager(this);
57+
getProxy().getPluginManager().registerCommand(this, new FriendCommand(this));
58+
getProxy().getPluginManager().registerListener(this, new PlayerListener(this));
59+
getLogger().info("Friends module enabled.");
60+
}
61+
62+
if (modules.getBoolean("PARTIES")) {
63+
partyManager = new PartyManager(this);
64+
getProxy().getPluginManager().registerCommand(this, new PartyCommand(this));
65+
getProxy().getPluginManager().registerListener(this, new PartyChatListener(this));
66+
getLogger().info("Parties module enabled.");
67+
}
68+
69+
if (modules.getBoolean("MAINTENANCE")) {
70+
getProxy().getPluginManager().registerCommand(this, new MaintenanceCommand(this));
71+
getProxy().getPluginManager().registerListener(this, new MaintenanceListener());
72+
getLogger().info("Maintenance module enabled.");
73+
}
74+
75+
if (modules.getBoolean("MOTD")) {
76+
getProxy().getPluginManager().registerCommand(this, new MotdCommand(this));
77+
getProxy().getPluginManager().registerListener(this, new ServerListListener(this));
78+
getLogger().info("MOTD module enabled.");
79+
}
80+
81+
if (modules.getBoolean("HUB_COMMAND")) {
82+
getProxy().getPluginManager().registerCommand(this, new HubCommand(this));
83+
getLogger().info("Hub Command enabled.");
84+
}
85+
86+
if (modules.getBoolean("SEND_COMMAND")) {
87+
getProxy().getPluginManager().registerCommand(this, new SendCommand(this));
88+
getLogger().info("Send Command enabled.");
89+
}
90+
91+
if (modules.getBoolean("MSG_COMMAND")) {
92+
getProxy().getPluginManager().registerCommand(this, new MsgCommand(this));
93+
getLogger().info("Message Command enabled.");
94+
}
95+
96+
if (modules.getBoolean("SERVER_MANAGER")) {
97+
serverStatsManager = new ServerStatsManager();
98+
redisManager.startServerStatsSubscriber(serverStatsManager);
99+
getProxy().getPluginManager().registerCommand(this, new ServerManagerCommand(this));
100+
getLogger().info("Server Manager module enabled.");
101+
}
102+
103+
if (modules.getBoolean("SECURITY")) {
104+
getProxy().getPluginManager().registerListener(this, new SecurityListener(this));
105+
getLogger().info("Security module enabled.");
106+
}
107+
108+
if (modules.getBoolean("ANNOUNCEMENTS")) {
109+
announcementManager = new AnnouncementManager(this);
110+
getProxy().getPluginManager().registerCommand(this, new AnnouncementCommand(this));
111+
getLogger().info("Announcements module enabled.");
112+
}
113+
114+
if (modules.getBoolean("CAPTCHA")) {
115+
captchaManager = new CaptchaManager(this);
116+
getProxy().getPluginManager().registerCommand(this, new CaptchaCommand(this));
117+
getProxy().getPluginManager().registerListener(this, new CaptchaListener(this));
118+
getLogger().info("Captcha module enabled.");
119+
}
120+
121+
if (modules.getBoolean("MODERATION")) {
122+
moderationManager = new ModerationManager(this);
123+
getProxy().getPluginManager().registerCommand(this, new HelpopCommand(this));
124+
getProxy().getPluginManager().registerCommand(this, new ReportCommand(this));
125+
getLogger().info("Moderation module enabled.");
126+
}
127+
128+
if (modules.getBoolean("COMMAND_LOGGER")) {
129+
commandLoggerManager = new CommandLoggerManager(this);
130+
getProxy().getPluginManager().registerCommand(this, new CommandLoggerCommand(this));
131+
getProxy().getPluginManager().registerListener(this, new CommandLoggerListener(this));
132+
getProxy().getPluginManager().registerListener(this, new BungeeCordCommandLoggerListener(this));
133+
getLogger().info("Command Logger module enabled.");
134+
}
135+
136+
new Metrics(this, 27360);
137+
138+
getLogger().info("");
139+
getLogger().info(MessageUtils.color("&b██╗ ██╗██╗ ██╗██████╗ ██████╗ ██╗██████╗ "));
140+
getLogger().info(MessageUtils.color("&b██║ ██║╚██╗ ██╔╝██╔══██╗██╔══██╗██║██╔══██╗"));
141+
getLogger().info(MessageUtils.color("&b███████║ ╚████╔╝ ██████╔╝██████╔╝██║██║ ██║"));
142+
getLogger().info(MessageUtils.color("&b██╔══██║ ╚██╔╝ ██╔══██╗██╔══██╗██║██║ ██║"));
143+
getLogger().info(MessageUtils.color("&b██║ ██║ ██║ ██████╔╝██║ ██║██║██████╔╝"));
144+
getLogger().info(MessageUtils.color("&b╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝╚═════╝ "));
145+
getLogger().info("");
146+
getLogger().info(MessageUtils.color("&bHybridCore BungeeCord &7v1.0.0 &asuccessfully loaded!"));
147+
getLogger().info(MessageUtils.color("&7Made with &c❤ &7by &bNetSafe LLC &7- &ediscord.netsafe.club"));
148+
getLogger().info("");
149+
}
150+
151+
@Override
152+
public void onDisable() {
153+
if (databaseManager != null) {
154+
databaseManager.close();
155+
}
156+
if (redisManager != null) {
157+
redisManager.close();
158+
}
159+
if (announcementManager != null) {
160+
announcementManager.stop();
161+
}
162+
if (captchaManager != null) {
163+
captchaManager.stop();
164+
}
165+
if (moderationManager != null) {
166+
moderationManager.stop();
167+
}
168+
if (commandLoggerManager != null) {
169+
commandLoggerManager.stop();
170+
}
171+
getLogger().info("HybridCore disconnected, goodbye.");
172+
}
173+
174+
public static HybridCore getInstance() {
175+
return instance;
176+
}
177+
178+
public ConfigManager getConfigManager() {
179+
return configManager;
180+
}
181+
182+
public RedisManager getRedisManager() {
183+
return redisManager;
184+
}
185+
186+
public PartyManager getPartyManager() {
187+
return partyManager;
188+
}
189+
190+
public DatabaseManager getDatabaseManager() {
191+
return databaseManager;
192+
}
193+
194+
public FriendManager getFriendManager() {
195+
return friendManager;
196+
}
197+
198+
public ServerStatsManager getServerStatsManager() {
199+
return serverStatsManager;
200+
}
201+
202+
public AnnouncementManager getAnnouncementManager() {
203+
return announcementManager;
204+
}
205+
206+
public CaptchaManager getCaptchaManager() {
207+
return captchaManager;
208+
}
209+
210+
public ModerationManager getModerationManager() {
211+
return moderationManager;
212+
}
213+
214+
public CommandLoggerManager getCommandLoggerManager() {
215+
return commandLoggerManager;
216+
}
217+
}

0 commit comments

Comments
 (0)