Add broadcastPacket method to clients

This commit is contained in:
ME1312 2017-08-07 15:51:11 -04:00
parent 693b6e8394
commit 65002c767d
11 changed files with 106 additions and 32 deletions

Binary file not shown.

Binary file not shown.

View File

@ -207,6 +207,10 @@
<dd> <dd>
<div class="block">Reopens the previous window</div> <div class="block">Reopens the previous window</div>
</dd> </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> <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>&nbsp;</dd> <dd>&nbsp;</dd>
</dl> </dl>

View File

@ -17,7 +17,7 @@
catch(err) { 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 tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor"; var altColor = "altColor";
var rowColor = "rowColor"; var rowColor = "rowColor";
@ -172,68 +172,74 @@ extends java.lang.Object</pre>
</tr> </tr>
<tr id="i0" class="altColor"> <tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td> <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>&nbsp;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&nbsp;reconnect)</code> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/SubDataClient.html#destroy-int-">destroy</a></span>(int&nbsp;reconnect)</code>
<div class="block">Drops All Connections and Stops the SubData Listener</div> <div class="block">Drops All Connections and Stops the SubData Listener</div>
</td> </td>
</tr> </tr>
<tr id="i1" class="rowColor"> <tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td> <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>&nbsp;packet, <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>&nbsp;packet,
java.lang.String&nbsp;location)</code> java.lang.String&nbsp;location)</code>
<div class="block">Forward Packet to Client</div> <div class="block">Forward Packet to Client</div>
</td> </td>
</tr> </tr>
<tr id="i2" class="altColor"> <tr id="i3" class="rowColor">
<td class="colFirst"><code>java.net.Socket</code></td> <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> <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> <div class="block">Gets the Server Socket</div>
</td> </td>
</tr> </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="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> <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> <div class="block">Gets the Connection's Encryption method</div>
</td> </td>
</tr> </tr>
<tr id="i4" class="altColor"> <tr id="i5" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td> <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> <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> <div class="block">Gets the Assigned Server Name</div>
</td> </td>
</tr> </tr>
<tr id="i5" class="rowColor"> <tr id="i6" class="altColor">
<td class="colFirst"><code>static java.util.List&lt;? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketIn</a>&gt;</code></td> <td class="colFirst"><code>static java.util.List&lt;? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketIn</a>&gt;</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&nbsp;handle)</code> <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&nbsp;handle)</code>
<div class="block">Grab PacketIn Instances via handle</div> <div class="block">Grab PacketIn Instances via handle</div>
</td> </td>
</tr> </tr>
<tr id="i6" class="altColor"> <tr id="i7" class="rowColor">
<td class="colFirst"><code>static void</code></td> <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&lt;? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a>&gt;&nbsp;packet, <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&lt;? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a>&gt;&nbsp;packet,
java.lang.String&nbsp;handle)</code> java.lang.String&nbsp;handle)</code>
<div class="block">Register PacketOut to the Network</div> <div class="block">Register PacketOut to the Network</div>
</td> </td>
</tr> </tr>
<tr id="i7" class="rowColor"> <tr id="i8" class="altColor">
<td class="colFirst"><code>static void</code></td> <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>&nbsp;packet, <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>&nbsp;packet,
java.lang.String&nbsp;handle)</code> java.lang.String&nbsp;handle)</code>
<div class="block">Register PacketIn to the Network</div> <div class="block">Register PacketIn to the Network</div>
</td> </td>
</tr> </tr>
<tr id="i8" class="altColor"> <tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td> <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>&nbsp;packet)</code> <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>&nbsp;packet)</code>
<div class="block">Send Packet to Server</div> <div class="block">Send Packet to Server</div>
</td> </td>
</tr> </tr>
<tr id="i9" class="rowColor"> <tr id="i10" class="altColor">
<td class="colFirst"><code>static void</code></td> <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&lt;? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a>&gt;&nbsp;packet)</code> <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&lt;? extends <a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a>&gt;&nbsp;packet)</code>
<div class="block">Unregister PacketOut to the Network</div> <div class="block">Unregister PacketOut to the Network</div>
</td> </td>
</tr> </tr>
<tr id="i10" class="altColor"> <tr id="i11" class="rowColor">
<td class="colFirst"><code>static void</code></td> <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>&nbsp;packet)</code> <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>&nbsp;packet)</code>
<div class="block">Unregister PacketIn from the Network</div> <div class="block">Unregister PacketIn from the Network</div>
@ -442,6 +448,20 @@ extends java.lang.Object</pre>
</dl> </dl>
</li> </li>
</ul> </ul>
<a name="broadcastPacket-net.ME1312.SubServers.Client.Bukkit.Network.PacketOut-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>broadcastPacket</h4>
<pre>public&nbsp;void&nbsp;broadcastPacket(<a href="../../../../../../net/ME1312/SubServers/Client/Bukkit/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Client.Bukkit.Network">PacketOut</a>&nbsp;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 name="destroy-int-">
<!-- --> <!-- -->
</a> </a>

View File

@ -195,6 +195,10 @@
</a> </a>
<h2 class="title">B</h2> <h2 class="title">B</h2>
<dl> <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> <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>&nbsp;</dd> <dd>&nbsp;</dd>
</dl> </dl>

View File

@ -17,7 +17,7 @@
catch(err) { 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 tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor"; var altColor = "altColor";
var rowColor = "rowColor"; var rowColor = "rowColor";
@ -172,68 +172,74 @@ extends java.lang.Object</pre>
</tr> </tr>
<tr id="i0" class="altColor"> <tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td> <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>&nbsp;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&nbsp;reconnect)</code> <td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Host/Network/SubDataClient.html#destroy-int-">destroy</a></span>(int&nbsp;reconnect)</code>
<div class="block">Drops All Connections and Stops the SubData Listener</div> <div class="block">Drops All Connections and Stops the SubData Listener</div>
</td> </td>
</tr> </tr>
<tr id="i1" class="rowColor"> <tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td> <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>&nbsp;packet, <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>&nbsp;packet,
java.lang.String&nbsp;location)</code> java.lang.String&nbsp;location)</code>
<div class="block">Forward Packet to Server</div> <div class="block">Forward Packet to Server</div>
</td> </td>
</tr> </tr>
<tr id="i2" class="altColor"> <tr id="i3" class="rowColor">
<td class="colFirst"><code>java.net.Socket</code></td> <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> <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> <div class="block">Gets the Server Socket</div>
</td> </td>
</tr> </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="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> <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> <div class="block">Gets the Connection's Encryption method</div>
</td> </td>
</tr> </tr>
<tr id="i4" class="altColor"> <tr id="i5" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td> <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> <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> <div class="block">Gets the Assigned Host Name</div>
</td> </td>
</tr> </tr>
<tr id="i5" class="rowColor"> <tr id="i6" class="altColor">
<td class="colFirst"><code>static java.util.List&lt;? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Host.Network">PacketIn</a>&gt;</code></td> <td class="colFirst"><code>static java.util.List&lt;? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketIn.html" title="interface in net.ME1312.SubServers.Host.Network">PacketIn</a>&gt;</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&nbsp;handle)</code> <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&nbsp;handle)</code>
<div class="block">Grab PacketIn Instances via handle</div> <div class="block">Grab PacketIn Instances via handle</div>
</td> </td>
</tr> </tr>
<tr id="i6" class="altColor"> <tr id="i7" class="rowColor">
<td class="colFirst"><code>static void</code></td> <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&lt;? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a>&gt;&nbsp;packet, <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&lt;? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a>&gt;&nbsp;packet,
java.lang.String&nbsp;handle)</code> java.lang.String&nbsp;handle)</code>
<div class="block">Register PacketOut to the Network</div> <div class="block">Register PacketOut to the Network</div>
</td> </td>
</tr> </tr>
<tr id="i7" class="rowColor"> <tr id="i8" class="altColor">
<td class="colFirst"><code>static void</code></td> <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>&nbsp;packet, <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>&nbsp;packet,
java.lang.String&nbsp;handle)</code> java.lang.String&nbsp;handle)</code>
<div class="block">Register PacketIn to the Network</div> <div class="block">Register PacketIn to the Network</div>
</td> </td>
</tr> </tr>
<tr id="i8" class="altColor"> <tr id="i9" class="rowColor">
<td class="colFirst"><code>void</code></td> <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>&nbsp;packet)</code> <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>&nbsp;packet)</code>
<div class="block">Send Packet to Client</div> <div class="block">Send Packet to Client</div>
</td> </td>
</tr> </tr>
<tr id="i9" class="rowColor"> <tr id="i10" class="altColor">
<td class="colFirst"><code>static void</code></td> <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&lt;? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a>&gt;&nbsp;packet)</code> <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&lt;? extends <a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a>&gt;&nbsp;packet)</code>
<div class="block">Unregister PacketOut to the Network</div> <div class="block">Unregister PacketOut to the Network</div>
</td> </td>
</tr> </tr>
<tr id="i10" class="altColor"> <tr id="i11" class="rowColor">
<td class="colFirst"><code>static void</code></td> <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>&nbsp;packet)</code> <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>&nbsp;packet)</code>
<div class="block">Unregister PacketIn from the Network</div> <div class="block">Unregister PacketIn from the Network</div>
@ -442,6 +448,20 @@ extends java.lang.Object</pre>
</dl> </dl>
</li> </li>
</ul> </ul>
<a name="broadcastPacket-net.ME1312.SubServers.Host.Network.PacketOut-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>broadcastPacket</h4>
<pre>public&nbsp;void&nbsp;broadcastPacket(<a href="../../../../../net/ME1312/SubServers/Host/Network/PacketOut.html" title="interface in net.ME1312.SubServers.Host.Network">PacketOut</a>&nbsp;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 name="destroy-int-">
<!-- --> <!-- -->
</a> </a>

View File

@ -11,9 +11,7 @@ import java.lang.reflect.InvocationTargetException;
import java.net.InetSocketAddress; import java.net.InetSocketAddress;
import java.net.Socket; import java.net.Socket;
import java.net.SocketException; import java.net.SocketException;
import java.util.Base64; import java.util.*;
import java.util.Timer;
import java.util.TimerTask;
/** /**
* Network Client Class * Network Client Class
@ -79,12 +77,20 @@ public class Client {
if (auth || packet instanceof PacketAuthorization) { if (auth || packet instanceof PacketAuthorization) {
try { try {
if (json.keySet().contains("f")) { if (json.keySet().contains("f")) {
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 {
Client client = subdata.getClient(json.getString("f")); Client client = subdata.getClient(json.getString("f"));
if (client != null) { if (client != null) {
client.writer.println(input); client.writer.println(input);
} else { } else {
throw new IllegalPacketException(getAddress().toString() + ": Unknown Forward Address: " + json.getString("f")); throw new IllegalPacketException(getAddress().toString() + ": Unknown Forward Address: " + json.getString("f"));
} }
}
} else { } else {
packet.execute(Client.this, (json.keySet().contains("c"))?json.getJSONObject("c"):null); packet.execute(Client.this, (json.keySet().contains("c"))?json.getJSONObject("c"):null);
} }

View File

@ -329,7 +329,9 @@ public final class SubDataServer {
*/ */
public void broadcastPacket(PacketOut packet) { public void broadcastPacket(PacketOut packet) {
if (Util.isNull(packet)) throw new NullPointerException(); 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); client.sendPacket(packet);
} }
} }

View File

@ -285,7 +285,7 @@ public final class SubDataClient {
* @param location Where to send * @param location Where to send
*/ */
public void forwardPacket(PacketOut packet, String location) { 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) { if (socket == null) {
queue.add(new NamedContainer<>(location, packet)); queue.add(new NamedContainer<>(location, packet));
} else { } 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 * JSON Encode PacketOut
* *

View File

@ -297,7 +297,7 @@ public final class SubDataClient {
* @param location Where to send * @param location Where to send
*/ */
public void forwardPacket(PacketOut packet, String location) { 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) { if (socket == null) {
queue.add(new NamedContainer<>(location, packet)); queue.add(new NamedContainer<>(location, packet));
} else { } 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 * JSON Encode PacketOut
* *