mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +01:00
Add broadcastPacket method to clients
This commit is contained in:
parent
693b6e8394
commit
65002c767d
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -207,6 +207,10 @@
|
||||
<dd>
|
||||
<div class="block">Reopens the previous window</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#broadcastPacket-net.ME1312.SubServers.Client.Bukkit.Network.PacketOut-">broadcastPacket(PacketOut)</a></span> - Method in class net.ME1312.SubServers.Client.Bukkit.Network.<a href="net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html" title="class in net.ME1312.SubServers.Client.Bukkit.Network">SubDataClient</a></dt>
|
||||
<dd>
|
||||
<div class="block">Broadcast packet to all Clients</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Client/Bukkit/SubPlugin.html#bversion">bversion</a></span> - Variable in class net.ME1312.SubServers.Client.Bukkit.<a href="net/ME1312/SubServers/Client/Bukkit/SubPlugin.html" title="class in net.ME1312.SubServers.Client.Bukkit">SubPlugin</a></dt>
|
||||
<dd> </dd>
|
||||
</dl>
|
||||
|
@ -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</pre>
|
||||
</tr>
|
||||
<tr id="i0" class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#broadcastPacket-net.ME1312.SubServers.Client.Bukkit.Network.PacketOut-">broadcastPacket</a></span>(<a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a> packet)</code>
|
||||
<div class="block">Broadcast packet to all Clients</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i1" class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#destroy-int-">destroy</a></span>(int reconnect)</code>
|
||||
<div class="block">Drops All Connections and Stops the SubData Listener</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i1" class="rowColor">
|
||||
<tr id="i2" class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#forwardPacket-net.ME1312.SubServers.Client.Bukkit.Network.PacketOut-java.lang.String-">forwardPacket</a></span>(<a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a> packet,
|
||||
java.lang.String location)</code>
|
||||
<div class="block">Forward Packet to Client</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i2" class="altColor">
|
||||
<tr id="i3" class="rowColor">
|
||||
<td class="colFirst"><code>java.net.Socket</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#getClient--">getClient</a></span>()</code>
|
||||
<div class="block">Gets the Server Socket</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i3" class="rowColor">
|
||||
<tr id="i4" class="altColor">
|
||||
<td class="colFirst"><code><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.Encryption.html" title="enum in net.ME1312.SubServers.Client.Bukkit.Network">SubDataClient.Encryption</a></code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#getEncryption--">getEncryption</a></span>()</code>
|
||||
<div class="block">Gets the Connection's Encryption method</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i4" class="altColor">
|
||||
<tr id="i5" class="rowColor">
|
||||
<td class="colFirst"><code>java.lang.String</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#getName--">getName</a></span>()</code>
|
||||
<div class="block">Gets the Assigned Server Name</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i5" class="rowColor">
|
||||
<tr id="i6" class="altColor">
|
||||
<td class="colFirst"><code>static java.util.List<? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketIn</a>></code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#getPacket-java.lang.String-">getPacket</a></span>(java.lang.String handle)</code>
|
||||
<div class="block">Grab PacketIn Instances via handle</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i6" class="altColor">
|
||||
<tr id="i7" class="rowColor">
|
||||
<td class="colFirst"><code>static void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#registerPacket-java.lang.Class-java.lang.String-">registerPacket</a></span>(java.lang.Class<? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a>> packet,
|
||||
java.lang.String handle)</code>
|
||||
<div class="block">Register PacketOut to the Network</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i7" class="rowColor">
|
||||
<tr id="i8" class="altColor">
|
||||
<td class="colFirst"><code>static void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#registerPacket-net.ME1312.SubServers.Client.Bukkit.Network.PacketIn-java.lang.String-">registerPacket</a></span>(<a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketIn</a> packet,
|
||||
java.lang.String handle)</code>
|
||||
<div class="block">Register PacketIn to the Network</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i8" class="altColor">
|
||||
<tr id="i9" class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#sendPacket-net.ME1312.SubServers.Client.Bukkit.Network.PacketOut-">sendPacket</a></span>(<a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a> packet)</code>
|
||||
<div class="block">Send Packet to Server</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i9" class="rowColor">
|
||||
<tr id="i10" class="altColor">
|
||||
<td class="colFirst"><code>static void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#unregisterPacket-java.lang.Class-">unregisterPacket</a></span>(java.lang.Class<? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a>> packet)</code>
|
||||
<div class="block">Unregister PacketOut to the Network</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i10" class="altColor">
|
||||
<tr id="i11" class="rowColor">
|
||||
<td class="colFirst"><code>static void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#unregisterPacket-net.ME1312.SubServers.Client.Bukkit.Network.PacketIn-">unregisterPacket</a></span>(<a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketIn</a> packet)</code>
|
||||
<div class="block">Unregister PacketIn from the Network</div>
|
||||
@ -442,6 +448,20 @@ extends java.lang.Object</pre>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="broadcastPacket-net.ME1312.SubServers.Client.Bukkit.Network.PacketOut-">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>broadcastPacket</h4>
|
||||
<pre>public void broadcastPacket(<a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a> packet)</pre>
|
||||
<div class="block">Broadcast packet to all Clients</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
<dd><code>packet</code> - Packet to send</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="destroy-int-">
|
||||
<!-- -->
|
||||
</a>
|
||||
|
@ -195,6 +195,10 @@
|
||||
</a>
|
||||
<h2 class="title">B</h2>
|
||||
<dl>
|
||||
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/Network/SubDataClient.html#broadcastPacket-net.ME1312.SubServers.Host.Network.PacketOut-">broadcastPacket(PacketOut)</a></span> - Method in class net.ME1312.SubServers.Host.Network.<a href="net/ME1312/SubServers/Host/Network/SubDataClient.html" title="class in net.ME1312.SubServers.Host.Network">SubDataClient</a></dt>
|
||||
<dd>
|
||||
<div class="block">Broadcast packet to all Clients</div>
|
||||
</dd>
|
||||
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Host/ExHost.html#bversion">bversion</a></span> - Variable in class net.ME1312.SubServers.Host.<a href="net/ME1312/SubServers/Host/ExHost.html" title="class in net.ME1312.SubServers.Host">ExHost</a></dt>
|
||||
<dd> </dd>
|
||||
</dl>
|
||||
|
@ -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</pre>
|
||||
</tr>
|
||||
<tr id="i0" class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#broadcastPacket-net.ME1312.SubServers.Host.Network.PacketOut-">broadcastPacket</a></span>(<a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a> packet)</code>
|
||||
<div class="block">Broadcast packet to all Clients</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i1" class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#destroy-int-">destroy</a></span>(int reconnect)</code>
|
||||
<div class="block">Drops All Connections and Stops the SubData Listener</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i1" class="rowColor">
|
||||
<tr id="i2" class="altColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#forwardPacket-net.ME1312.SubServers.Host.Network.PacketOut-java.lang.String-">forwardPacket</a></span>(<a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a> packet,
|
||||
java.lang.String location)</code>
|
||||
<div class="block">Forward Packet to Server</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i2" class="altColor">
|
||||
<tr id="i3" class="rowColor">
|
||||
<td class="colFirst"><code>java.net.Socket</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#getClient--">getClient</a></span>()</code>
|
||||
<div class="block">Gets the Server Socket</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i3" class="rowColor">
|
||||
<tr id="i4" class="altColor">
|
||||
<td class="colFirst"><code><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.Encryption.html" title="enum in net.ME1312.SubServers.Host.Network">SubDataClient.Encryption</a></code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#getEncryption--">getEncryption</a></span>()</code>
|
||||
<div class="block">Gets the Connection's Encryption method</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i4" class="altColor">
|
||||
<tr id="i5" class="rowColor">
|
||||
<td class="colFirst"><code>java.lang.String</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#getName--">getName</a></span>()</code>
|
||||
<div class="block">Gets the Assigned Host Name</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i5" class="rowColor">
|
||||
<tr id="i6" class="altColor">
|
||||
<td class="colFirst"><code>static java.util.List<? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Host.Network">PacketIn</a>></code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#getPacket-java.lang.String-">getPacket</a></span>(java.lang.String handle)</code>
|
||||
<div class="block">Grab PacketIn Instances via handle</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i6" class="altColor">
|
||||
<tr id="i7" class="rowColor">
|
||||
<td class="colFirst"><code>static void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#registerPacket-java.lang.Class-java.lang.String-">registerPacket</a></span>(java.lang.Class<? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a>> packet,
|
||||
java.lang.String handle)</code>
|
||||
<div class="block">Register PacketOut to the Network</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i7" class="rowColor">
|
||||
<tr id="i8" class="altColor">
|
||||
<td class="colFirst"><code>static void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#registerPacket-net.ME1312.SubServers.Host.Network.PacketIn-java.lang.String-">registerPacket</a></span>(<a href="../../../../../net/ME1312/SubServers/Host/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Host.Network">PacketIn</a> packet,
|
||||
java.lang.String handle)</code>
|
||||
<div class="block">Register PacketIn to the Network</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i8" class="altColor">
|
||||
<tr id="i9" class="rowColor">
|
||||
<td class="colFirst"><code>void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#sendPacket-net.ME1312.SubServers.Host.Network.PacketOut-">sendPacket</a></span>(<a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a> packet)</code>
|
||||
<div class="block">Send Packet to Client</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i9" class="rowColor">
|
||||
<tr id="i10" class="altColor">
|
||||
<td class="colFirst"><code>static void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#unregisterPacket-java.lang.Class-">unregisterPacket</a></span>(java.lang.Class<? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a>> packet)</code>
|
||||
<div class="block">Unregister PacketOut to the Network</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="i10" class="altColor">
|
||||
<tr id="i11" class="rowColor">
|
||||
<td class="colFirst"><code>static void</code></td>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#unregisterPacket-net.ME1312.SubServers.Host.Network.PacketIn-">unregisterPacket</a></span>(<a href="../../../../../net/ME1312/SubServers/Host/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Host.Network">PacketIn</a> packet)</code>
|
||||
<div class="block">Unregister PacketIn from the Network</div>
|
||||
@ -442,6 +448,20 @@ extends java.lang.Object</pre>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="broadcastPacket-net.ME1312.SubServers.Host.Network.PacketOut-">
|
||||
<!-- -->
|
||||
</a>
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>broadcastPacket</h4>
|
||||
<pre>public void broadcastPacket(<a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a> packet)</pre>
|
||||
<div class="block">Broadcast packet to all Clients</div>
|
||||
<dl>
|
||||
<dt><span class="paramLabel">Parameters:</span></dt>
|
||||
<dd><code>packet</code> - Packet to send</dd>
|
||||
</dl>
|
||||
</li>
|
||||
</ul>
|
||||
<a name="destroy-int-">
|
||||
<!-- -->
|
||||
</a>
|
||||
|
@ -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<Client> clients = new ArrayList<Client>();
|
||||
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);
|
||||
|
@ -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<Client> clients = new ArrayList<Client>();
|
||||
clients.addAll(getClients());
|
||||
for (Client client : clients) {
|
||||
client.sendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
*
|
||||
|
@ -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
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user