mirror of
https://github.com/unmojang/OnlineModeFix.git
synced 2025-09-10 07:47:20 -04:00
Removed banlist/whitelist broadcasting.
This commit is contained in:
parent
756d3e2913
commit
2457525c4b
@ -1,5 +1,5 @@
|
|||||||
name: MineOnlineBroadcast
|
name: MineOnlineBroadcast
|
||||||
version: 1.0.4
|
version: 1.0.5
|
||||||
description: Lists a server on mineonline.codie.gg/servers
|
description: Lists a server on mineonline.codie.gg/servers
|
||||||
author: codieradical
|
author: codieradical
|
||||||
authors: [Codie]
|
authors: [Codie]
|
||||||
|
@ -9,7 +9,6 @@ import java.net.URL;
|
|||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.security.MessageDigest;
|
import java.security.MessageDigest;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.LinkedList;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -20,27 +19,6 @@ public class MineOnlineBroadcast extends JavaPlugin {
|
|||||||
MineOnlineBroadcastListener listener;
|
MineOnlineBroadcastListener listener;
|
||||||
Logger log;
|
Logger log;
|
||||||
|
|
||||||
public static String[] readUsersFile(String path) {
|
|
||||||
try {
|
|
||||||
File usersFile = new File(path);
|
|
||||||
if (usersFile.exists()) {
|
|
||||||
LinkedList list = new LinkedList();
|
|
||||||
BufferedReader reader = new BufferedReader(new FileReader(usersFile));
|
|
||||||
String line;
|
|
||||||
while ((line = reader.readLine()) != null) {
|
|
||||||
list.add(line);
|
|
||||||
}
|
|
||||||
reader.close();
|
|
||||||
|
|
||||||
return (String[])list.toArray(new String[0]);
|
|
||||||
}
|
|
||||||
} catch (IOException ex) {
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new String[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
public static byte[] createChecksum(String filename) throws Exception {
|
public static byte[] createChecksum(String filename) throws Exception {
|
||||||
InputStream fis = new FileInputStream(filename);
|
InputStream fis = new FileInputStream(filename);
|
||||||
|
|
||||||
@ -68,13 +46,6 @@ public class MineOnlineBroadcast extends JavaPlugin {
|
|||||||
boolean onlineMode,
|
boolean onlineMode,
|
||||||
String md5,
|
String md5,
|
||||||
boolean whitelisted,
|
boolean whitelisted,
|
||||||
String[] whitelistUsers,
|
|
||||||
String[] whitelistIPs,
|
|
||||||
String[] whitelistUUIDs,
|
|
||||||
String[] bannedUsers,
|
|
||||||
String[] bannedIPs,
|
|
||||||
String[] bannedUUIDs,
|
|
||||||
String owner,
|
|
||||||
String[] playerNames
|
String[] playerNames
|
||||||
) {
|
) {
|
||||||
HttpURLConnection connection = null;
|
HttpURLConnection connection = null;
|
||||||
@ -91,14 +62,6 @@ public class MineOnlineBroadcast extends JavaPlugin {
|
|||||||
jsonObject.put("onlinemode", onlineMode);
|
jsonObject.put("onlinemode", onlineMode);
|
||||||
jsonObject.put("md5", md5);
|
jsonObject.put("md5", md5);
|
||||||
jsonObject.put("whitelisted", whitelisted);
|
jsonObject.put("whitelisted", whitelisted);
|
||||||
jsonObject.put("whitelistUsers", whitelistUsers);
|
|
||||||
jsonObject.put("whitelistIPs", whitelistIPs);
|
|
||||||
jsonObject.put("whitelistUUIDs", whitelistUUIDs);
|
|
||||||
jsonObject.put("bannedUsers", bannedUsers);
|
|
||||||
jsonObject.put("bannedIPs", bannedIPs);
|
|
||||||
jsonObject.put("bannedUUIDs", bannedUUIDs);
|
|
||||||
if(owner != null)
|
|
||||||
jsonObject.put("owner", owner);
|
|
||||||
jsonObject.put("players", playerNames);
|
jsonObject.put("players", playerNames);
|
||||||
|
|
||||||
String json = jsonObject.toString();
|
String json = jsonObject.toString();
|
||||||
@ -164,16 +127,7 @@ public class MineOnlineBroadcast extends JavaPlugin {
|
|||||||
boolean onlineMode = propertiesFile.getProperty("online-mode", "true").equals("true");
|
boolean onlineMode = propertiesFile.getProperty("online-mode", "true").equals("true");
|
||||||
String md5 = propertiesFile.getProperty("version-md5", "");
|
String md5 = propertiesFile.getProperty("version-md5", "");
|
||||||
boolean whitelisted = propertiesFile.getProperty("whitelist", "false").equals("true");
|
boolean whitelisted = propertiesFile.getProperty("whitelist", "false").equals("true");
|
||||||
String[] whitelistUsers = new String[0];
|
|
||||||
|
|
||||||
if (whitelisted) {
|
|
||||||
whitelistUsers = readUsersFile("white-list.txt");
|
|
||||||
}
|
|
||||||
|
|
||||||
String[] bannedUsers = readUsersFile("banned-players.txt");
|
|
||||||
String[] bannedIPs = readUsersFile("banned-ips.txt");
|
|
||||||
|
|
||||||
String owner = null;
|
|
||||||
String[] playerNames = Arrays.stream(getServer().getOnlinePlayers()).map(Player::getName).collect(Collectors.toList()).toArray(new String[users]);
|
String[] playerNames = Arrays.stream(getServer().getOnlinePlayers()).map(Player::getName).collect(Collectors.toList()).toArray(new String[users]);
|
||||||
|
|
||||||
listServer(
|
listServer(
|
||||||
@ -185,13 +139,6 @@ public class MineOnlineBroadcast extends JavaPlugin {
|
|||||||
onlineMode,
|
onlineMode,
|
||||||
md5,
|
md5,
|
||||||
whitelisted,
|
whitelisted,
|
||||||
whitelistUsers,
|
|
||||||
new String[0],
|
|
||||||
new String[0],
|
|
||||||
bannedUsers,
|
|
||||||
bannedIPs,
|
|
||||||
new String[0],
|
|
||||||
owner,
|
|
||||||
playerNames
|
playerNames
|
||||||
);
|
);
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user