Updated the server plugin

This commit is contained in:
2020-10-01 00:41:02 +02:00
parent aa5392b70b
commit f7bd9e3231
12 changed files with 36 additions and 20 deletions

0
DiscordVerifier/.DS_Store vendored Normal file → Executable file
View File

0
DiscordVerifier/DiscordVerifier.iml Normal file → Executable file
View File

56
DiscordVerifier/src/Main.java Normal file → Executable file
View File

@@ -1,3 +1,4 @@
import org.bukkit.entity.Player;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
@@ -11,27 +12,42 @@ public class Main extends JavaPlugin {
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);
}
}
start_socketserver();
} catch (Exception e) {
System.out.println("error man");
System.out.println(e);
}
}
public void start_socketserver() {
new Thread(() -> {
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);
String[] info = inputLine.split("\t");
Player player = getServer().getPlayer(info[0]);
String code = info[1];
send_chat(player, code);
}
}
} catch (Exception e) {
System.out.println(e);
}
}).start();
}
public void send_chat(Player player, String code){
player.sendMessage(code);
}
public void onDisable() {

0
DiscordVerifier/src/plugin.yml Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
bot.py Normal file → Executable file
View File

0
cogs/modcommands.py Normal file → Executable file
View File

0
cogs/servertatus.py Normal file → Executable file
View File

0
data/constants.py Normal file → Executable file
View File

0
files/images/server_icon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 171 KiB

0
functions/checks.py Normal file → Executable file
View File

0
sockettest.py Normal file → Executable file
View File