Skip to content

Commit dff0dba

Browse files
committed
Initial commit
0 parents  commit dff0dba

27 files changed

+1684
-0
lines changed

.gitignore

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# User-specific stuff
2+
.idea/
3+
4+
*.iml
5+
*.ipr
6+
*.iws
7+
8+
# IntelliJ
9+
out/
10+
11+
# Compiled class file
12+
*.class
13+
14+
# Log file
15+
*.log
16+
17+
# BlueJ files
18+
*.ctxt
19+
20+
# Package Files #
21+
*.jar
22+
*.war
23+
*.nar
24+
*.ear
25+
*.zip
26+
*.tar.gz
27+
*.rar
28+
29+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
30+
hs_err_pid*
31+
32+
*~
33+
34+
# temporary files which can be created if a process still has a handle open of a deleted file
35+
.fuse_hidden*
36+
37+
# KDE directory preferences
38+
.directory
39+
40+
# Linux trash folder which might appear on any partition or disk
41+
.Trash-*
42+
43+
# .nfs files are created when an open file is removed but is still being accessed
44+
.nfs*
45+
46+
# General
47+
.DS_Store
48+
.AppleDouble
49+
.LSOverride
50+
51+
# Icon must end with two \r
52+
Icon
53+
54+
# Thumbnails
55+
._*
56+
57+
# Files that might appear in the root of a volume
58+
.DocumentRevisions-V100
59+
.fseventsd
60+
.Spotlight-V100
61+
.TemporaryItems
62+
.Trashes
63+
.VolumeIcon.icns
64+
.com.apple.timemachine.donotpresent
65+
66+
# Directories potentially created on remote AFP share
67+
.AppleDB
68+
.AppleDesktop
69+
Network Trash Folder
70+
Temporary Items
71+
.apdisk
72+
73+
# Windows thumbnail cache files
74+
Thumbs.db
75+
Thumbs.db:encryptable
76+
ehthumbs.db
77+
ehthumbs_vista.db
78+
79+
# Dump file
80+
*.stackdump
81+
82+
# Folder config file
83+
[Dd]esktop.ini
84+
85+
# Recycle Bin used on file shares
86+
$RECYCLE.BIN/
87+
88+
# Windows Installer files
89+
*.cab
90+
*.msi
91+
*.msix
92+
*.msm
93+
*.msp
94+
95+
# Windows shortcuts
96+
*.lnk
97+
98+
target/
99+
100+
pom.xml.tag
101+
pom.xml.releaseBackup
102+
pom.xml.versionsBackup
103+
pom.xml.next
104+
105+
release.properties
106+
dependency-reduced-pom.xml
107+
buildNumber.properties
108+
.mvn/timing.properties
109+
.mvn/wrapper/maven-wrapper.jar
110+
.flattened-pom.xml
111+
112+
# Common working directory
113+
run/

pom.xml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
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+
<groupId>ad1tya2</groupId>
8+
<artifactId>AdiAuth</artifactId>
9+
<version>1.0</version>
10+
<packaging>jar</packaging>
11+
12+
<name>AdiAuth</name>
13+
14+
<properties>
15+
<java.version>1.8</java.version>
16+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
17+
</properties>
18+
19+
<build>
20+
<defaultGoal>clean package</defaultGoal>
21+
<plugins>
22+
<plugin>
23+
<groupId>org.apache.maven.plugins</groupId>
24+
<artifactId>maven-compiler-plugin</artifactId>
25+
<version>3.8.1</version>
26+
<configuration>
27+
<source>${java.version}</source>
28+
<target>${java.version}</target>
29+
</configuration>
30+
</plugin>
31+
<plugin>
32+
<groupId>org.apache.maven.plugins</groupId>
33+
<artifactId>maven-shade-plugin</artifactId>
34+
<version>3.2.4</version>
35+
<executions>
36+
<execution>
37+
<phase>package</phase>
38+
<goals>
39+
<goal>shade</goal>
40+
</goals>
41+
<configuration>
42+
<minimizeJar>true</minimizeJar>
43+
<createDependencyReducedPom>false</createDependencyReducedPom>
44+
</configuration>
45+
</execution>
46+
</executions>
47+
</plugin>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-dependency-plugin</artifactId>
51+
<version>3.2.0</version>
52+
<executions>
53+
<execution>
54+
<id>copy-installed-bungee</id>
55+
<phase>package</phase>
56+
<goals>
57+
<goal>copy</goal>
58+
</goals>
59+
<configuration>
60+
<artifactItems>
61+
<artifactItem>
62+
<groupId>${project.groupId}</groupId>
63+
<artifactId>${project.artifactId}</artifactId>
64+
<version>${project.version}</version>
65+
<type>${project.packaging}</type>
66+
<overWrite>true</overWrite>
67+
</artifactItem>
68+
</artifactItems>
69+
<outputDirectory>D:/bungee/plugins/</outputDirectory>
70+
</configuration>
71+
</execution>
72+
<execution>
73+
<id>copy-installed-spigot</id>
74+
<phase>package</phase>
75+
<goals>
76+
<goal>copy</goal>
77+
</goals>
78+
<configuration>
79+
<artifactItems>
80+
<artifactItem>
81+
<groupId>${project.groupId}</groupId>
82+
<artifactId>${project.artifactId}</artifactId>
83+
<version>${project.version}</version>
84+
<type>${project.packaging}</type>
85+
<overWrite>true</overWrite>
86+
</artifactItem>
87+
</artifactItems>
88+
<outputDirectory>D:/bungee testing backend/plugins/</outputDirectory>
89+
</configuration>
90+
</execution>
91+
</executions>
92+
</plugin>
93+
</plugins>
94+
<resources>
95+
<resource>
96+
<directory>src/main/resources</directory>
97+
<filtering>true</filtering>
98+
</resource>
99+
</resources>
100+
</build>
101+
102+
<repositories>
103+
<repository>
104+
<id>sonatype</id>
105+
<url>https://oss.sonatype.org/content/groups/public/</url>
106+
</repository>
107+
<repository>
108+
<id>codemc-repo</id>
109+
<url>https://repo.codemc.io/repository/maven-public/</url>
110+
</repository>
111+
</repositories>
112+
113+
<dependencies>
114+
<dependency>
115+
<groupId>net.md-5</groupId>
116+
<artifactId>bungeecord-proxy</artifactId>
117+
<version>1.17-R0.1-SNAPSHOT</version>
118+
<scope>provided</scope>
119+
</dependency>
120+
<dependency>
121+
<groupId>com.zaxxer</groupId>
122+
<artifactId>HikariCP</artifactId>
123+
<version>4.0.3</version>
124+
<scope>compile</scope>
125+
</dependency>
126+
<dependency>
127+
<groupId>org.apache.httpcomponents.client5</groupId>
128+
<artifactId>httpclient5</artifactId>
129+
<version>5.1</version>
130+
<scope>compile</scope>
131+
</dependency>
132+
<dependency>
133+
<groupId>org.spigotmc</groupId>
134+
<artifactId>spigot-api</artifactId>
135+
<version>1.8.8-R0.1-SNAPSHOT</version>
136+
<scope>provided</scope>
137+
</dependency>
138+
</dependencies>
139+
140+
</project>
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
package ad1tya2.adiauth.Bungee;
2+
3+
import ad1tya2.adiauth.Bungee.commands.*;
4+
import ad1tya2.adiauth.Bungee.data.mysql;
5+
import ad1tya2.adiauth.Bungee.data.servers;
6+
import ad1tya2.adiauth.Bungee.data.storage;
7+
import ad1tya2.adiauth.Bungee.events.Handler;
8+
import net.md_5.bungee.api.plugin.Plugin;
9+
10+
import java.util.Arrays;
11+
import java.util.List;
12+
import java.util.concurrent.ScheduledThreadPoolExecutor;
13+
import java.util.logging.Filter;
14+
import java.util.logging.LogRecord;
15+
16+
public final class AdiAuth extends Plugin {
17+
public static Plugin instance;
18+
private static List<String> sensitiveCommands = Arrays.asList("/login", "/l", "/register", "/reg");
19+
public static ScheduledThreadPoolExecutor executor;
20+
@Override
21+
public void onEnable() {
22+
executor = new ScheduledThreadPoolExecutor(4);
23+
// Plugin startup logic
24+
instance = this;
25+
26+
load();
27+
28+
getProxy().getPluginManager().registerListener(this, new Handler());
29+
getProxy().getLogger().setFilter(new Filter() {
30+
@Override
31+
public boolean isLoggable(LogRecord record) {
32+
String msg = record.getMessage();
33+
if(msg != null){
34+
for(String cmd: sensitiveCommands){
35+
if(msg.contains(cmd)){
36+
return false;
37+
}
38+
}
39+
}
40+
return true;
41+
}
42+
});
43+
44+
//Load commands
45+
getProxy().getPluginManager().registerCommand(this, new register());
46+
getProxy().getPluginManager().registerCommand(this, new login());
47+
getProxy().getPluginManager().registerCommand(this, new reload());
48+
getProxy().getPluginManager().registerCommand(this, new logout());
49+
getProxy().getPluginManager().registerCommand(this, new changepass());
50+
getProxy().getPluginManager().registerCommand(this, new unregister());
51+
getProxy().getPluginManager().registerCommand(this, new forcechangepass());
52+
servers.serversStatusChecker();
53+
}
54+
55+
public static void load(){
56+
Config.load();
57+
storage.load();
58+
servers.load();
59+
}
60+
61+
public static void runAsync(Runnable task){
62+
executor.execute(task);
63+
}
64+
65+
@Override
66+
public void onDisable() {
67+
mysql.close();
68+
executor.shutdownNow();
69+
// Plugin shutdown logic
70+
}
71+
}

0 commit comments

Comments
 (0)