diff --git a/Artifacts/SubServers.Bungee.jar b/Artifacts/SubServers.Bungee.jar
index 91799511..8591764c 100644
Binary files a/Artifacts/SubServers.Bungee.jar and b/Artifacts/SubServers.Bungee.jar differ
diff --git a/Artifacts/SubServers.Client.Bukkit.jar b/Artifacts/SubServers.Client.Bukkit.jar
index ba050ab4..1c9d198f 100644
Binary files a/Artifacts/SubServers.Client.Bukkit.jar and b/Artifacts/SubServers.Client.Bukkit.jar differ
diff --git a/Artifacts/SubServers.Host.jar b/Artifacts/SubServers.Host.jar
index 07734200..3aa81656 100644
Binary files a/Artifacts/SubServers.Host.jar and b/Artifacts/SubServers.Host.jar differ
diff --git a/Javadoc/SubServers.Client.Bukkit/index-all.html b/Javadoc/SubServers.Client.Bukkit/index-all.html
index d8348d51..7df0c199 100644
--- a/Javadoc/SubServers.Client.Bukkit/index-all.html
+++ b/Javadoc/SubServers.Client.Bukkit/index-all.html
@@ -207,6 +207,10 @@
Reopens the previous window
+broadcastPacket(PacketOut) - Method in class net.ME1312.SubServers.Client.Bukkit.Network.SubDataClient
+
+Broadcast packet to all Clients
+
bversion - Variable in class net.ME1312.SubServers.Client.Bukkit.SubPlugin
diff --git a/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html b/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html
index 1b9a22d7..d3e2c3aa 100644
--- a/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html
+++ b/Javadoc/SubServers.Client.Bukkit/net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html
@@ -17,7 +17,7 @@
catch(err) {
}
//-->
-var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":9,"i7":9,"i8":10,"i9":9,"i10":9};
+var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":9,"i7":9,"i8":9,"i9":10,"i10":9,"i11":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@@ -172,68 +172,74 @@ extends java.lang.Object
void |
+broadcastPacket(PacketOut packet)
+Broadcast packet to all Clients
+ |
+
+
+void |
destroy(int reconnect)
Drops All Connections and Stops the SubData Listener
|
-
+
void |
forwardPacket(PacketOut packet,
java.lang.String location)
Forward Packet to Client
|
-
+
java.net.Socket |
getClient()
Gets the Server Socket
|
-
+
SubDataClient.Encryption |
getEncryption()
Gets the Connection's Encryption method
|
-
+
java.lang.String |
getName()
Gets the Assigned Server Name
|
-
+
static java.util.List<? extends PacketIn> |
getPacket(java.lang.String handle)
Grab PacketIn Instances via handle
|
-
+
static void |
registerPacket(java.lang.Class<? extends PacketOut> packet,
java.lang.String handle)
Register PacketOut to the Network
|
-
+
static void |
registerPacket(PacketIn packet,
java.lang.String handle)
Register PacketIn to the Network
|
-
+
void |
sendPacket(PacketOut packet)
Send Packet to Server
|
-
+
static void |
unregisterPacket(java.lang.Class<? extends PacketOut> packet)
Unregister PacketOut to the Network
|
-
+
static void |
unregisterPacket(PacketIn packet)
Unregister PacketIn from the Network
@@ -442,6 +448,20 @@ extends java.lang.Object
+
+
+
+
diff --git a/Javadoc/SubServers.Host/index-all.html b/Javadoc/SubServers.Host/index-all.html
index cb2d493d..e6c4d23f 100644
--- a/Javadoc/SubServers.Host/index-all.html
+++ b/Javadoc/SubServers.Host/index-all.html
@@ -195,6 +195,10 @@
B
+- broadcastPacket(PacketOut) - Method in class net.ME1312.SubServers.Host.Network.SubDataClient
+-
+
Broadcast packet to all Clients
+
- bversion - Variable in class net.ME1312.SubServers.Host.ExHost
-
diff --git a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Network/SubDataClient.html b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Network/SubDataClient.html
index c8570d1b..d57c40ab 100644
--- a/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Network/SubDataClient.html
+++ b/Javadoc/SubServers.Host/net/ME1312/SubServers/Host/Network/SubDataClient.html
@@ -17,7 +17,7 @@
catch(err) {
}
//-->
-var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":9,"i6":9,"i7":9,"i8":10,"i9":9,"i10":9};
+var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":9,"i7":9,"i8":9,"i9":10,"i10":9,"i11":9};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@@ -172,68 +172,74 @@ extends java.lang.Object
|
void |
+broadcastPacket(PacketOut packet)
+Broadcast packet to all Clients
+ |
+
+
+void |
destroy(int reconnect)
Drops All Connections and Stops the SubData Listener
|
-
+
void |
forwardPacket(PacketOut packet,
java.lang.String location)
Forward Packet to Server
|
-
+
java.net.Socket |
getClient()
Gets the Server Socket
|
-
+
SubDataClient.Encryption |
getEncryption()
Gets the Connection's Encryption method
|
-
+
java.lang.String |
getName()
Gets the Assigned Host Name
|
-
+
static java.util.List<? extends PacketIn> |
getPacket(java.lang.String handle)
Grab PacketIn Instances via handle
|
-
+
static void |
registerPacket(java.lang.Class<? extends PacketOut> packet,
java.lang.String handle)
Register PacketOut to the Network
|
-
+
static void |
registerPacket(PacketIn packet,
java.lang.String handle)
Register PacketIn to the Network
|
-
+
void |
sendPacket(PacketOut packet)
Send Packet to Client
|
-
+
static void |
unregisterPacket(java.lang.Class<? extends PacketOut> packet)
Unregister PacketOut to the Network
|
-
+
static void |
unregisterPacket(PacketIn packet)
Unregister PacketIn from the Network
@@ -442,6 +448,20 @@ extends java.lang.Object
+
+
+
+
diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/Client.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/Client.java
index 752366b8..37b3278f 100644
--- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/Client.java
+++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/Client.java
@@ -11,9 +11,7 @@ import java.lang.reflect.InvocationTargetException;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketException;
-import java.util.Base64;
-import java.util.Timer;
-import java.util.TimerTask;
+import java.util.*;
/**
* Network Client Class
@@ -79,11 +77,19 @@ public class Client {
if (auth || packet instanceof PacketAuthorization) {
try {
if (json.keySet().contains("f")) {
- Client client = subdata.getClient(json.getString("f"));
- if (client != null) {
- client.writer.println(input);
+ if (json.getString("f").length() <= 0) {
+ List clients = new ArrayList();
+ clients.addAll(subdata.getClients());
+ for (Client client : clients) {
+ client.writer.println(input);
+ }
} else {
- throw new IllegalPacketException(getAddress().toString() + ": Unknown Forward Address: " + json.getString("f"));
+ Client client = subdata.getClient(json.getString("f"));
+ if (client != null) {
+ client.writer.println(input);
+ } else {
+ throw new IllegalPacketException(getAddress().toString() + ": Unknown Forward Address: " + json.getString("f"));
+ }
}
} else {
packet.execute(Client.this, (json.keySet().contains("c"))?json.getJSONObject("c"):null);
diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/SubDataServer.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/SubDataServer.java
index 45fd7ef7..93959f23 100644
--- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/SubDataServer.java
+++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Network/SubDataServer.java
@@ -329,7 +329,9 @@ public final class SubDataServer {
*/
public void broadcastPacket(PacketOut packet) {
if (Util.isNull(packet)) throw new NullPointerException();
- for (Client client : clients.values()) {
+ List clients = new ArrayList();
+ clients.addAll(getClients());
+ for (Client client : clients) {
client.sendPacket(packet);
}
}
diff --git a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.java b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.java
index 0d7a7138..a1e016f4 100644
--- a/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.java
+++ b/SubServers.Client/Bukkit/src/net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.java
@@ -285,7 +285,7 @@ public final class SubDataClient {
* @param location Where to send
*/
public void forwardPacket(PacketOut packet, String location) {
- if (Util.isNull(packet)) throw new NullPointerException();
+ if (Util.isNull(packet, location)) throw new NullPointerException();
if (socket == null) {
queue.add(new NamedContainer<>(location, packet));
} else {
@@ -312,6 +312,15 @@ public final class SubDataClient {
}
}
+ /**
+ * Broadcast packet to all Clients
+ *
+ * @param packet Packet to send
+ */
+ public void broadcastPacket(PacketOut packet) {
+ forwardPacket(packet, "");
+ }
+
/**
* JSON Encode PacketOut
*
diff --git a/SubServers.Host/src/net/ME1312/SubServers/Host/Network/SubDataClient.java b/SubServers.Host/src/net/ME1312/SubServers/Host/Network/SubDataClient.java
index d8535a54..02888739 100644
--- a/SubServers.Host/src/net/ME1312/SubServers/Host/Network/SubDataClient.java
+++ b/SubServers.Host/src/net/ME1312/SubServers/Host/Network/SubDataClient.java
@@ -297,7 +297,7 @@ public final class SubDataClient {
* @param location Where to send
*/
public void forwardPacket(PacketOut packet, String location) {
- if (Util.isNull(packet)) throw new NullPointerException();
+ if (Util.isNull(packet, location)) throw new NullPointerException();
if (socket == null) {
queue.add(new NamedContainer<>(location, packet));
} else {
@@ -324,6 +324,15 @@ public final class SubDataClient {
}
}
+ /**
+ * Broadcast packet to all Clients
+ *
+ * @param packet Packet to send
+ */
+ public void broadcastPacket(PacketOut packet) {
+ forwardPacket(packet, "");
+ }
+
/**
* JSON Encode PacketOut
*
|