Started creating server plugin

This commit is contained in:
2020-09-30 13:32:23 +02:00
parent ec2d75e896
commit aa5392b70b
6 changed files with 74 additions and 0 deletions

BIN
DiscordVerifier/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="spigot-1.15.2" level="project" />
</component>
</module>

View File

@@ -0,0 +1,43 @@
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.*;
import java.net.ServerSocket;
import java.net.Socket;
public class Main extends JavaPlugin {
public void onEnable() {
getLogger().info("DiscordVerifier Plugin enabled");
PluginManager pm = getServer().getPluginManager();
try{
ServerSocket ss = new ServerSocket(3333);
while (true) {
Socket s = ss.accept();
PrintWriter out =
new PrintWriter(s.getOutputStream(), true);
BufferedReader in = new BufferedReader(
new InputStreamReader(s.getInputStream()));
String inputLine, outputLine;
inputLine = in.readLine();
if (inputLine != null) {
outputLine = "test succeeded";
out.println(outputLine);
System.out.println("message: " + inputLine);
}
}
} catch (Exception e) {
System.out.println("error man");
System.out.println(e);
}
}
public void onDisable() {
getLogger().info("Plugin disabled");
}
}

View File

@@ -0,0 +1,5 @@
name: DiscordVerifier
main: Main
version: 0.0.1
description: Verify Mincraftnames
api-version: 1.13