SubCreator Console Support & Aethstetic Changes

You can now popout SubCreator with SubServers.Console: /popoutc
This commit is contained in:
ME1312 2017-01-10 22:23:29 -05:00
parent 8133970000
commit 39fa66c828
23 changed files with 863 additions and 244 deletions

Binary file not shown.

Binary file not shown.

View File

@ -633,6 +633,12 @@
<dd>
<div class="block">Get Content Handle</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#getHandle--">getHandle()</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.Internal.<a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host.Internal">InternalSubLogger</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/SubLogger.html#getHandle--">getHandle()</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.<a href="net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a></dt>
<dd>
<div class="block">Gets the Object using this Logger</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Network/Client.html#getHandler--">getHandler()</a></span> - Method in class net.ME1312.SubServers.Bungee.Network.<a href="net/ME1312/SubServers/Bungee/Network/Client.html" title="class in net.ME1312.SubServers.Bungee.Network">Client</a></dt>
<dd>
<div class="block">Gets the Linked Handler</div>
@ -715,8 +721,14 @@
<dd>
<div class="block">Get a List by Handle</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubCreator.html#getLogger--">getLogger()</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.Internal.<a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubCreator.html" title="class in net.ME1312.SubServers.Bungee.Host.Internal">InternalSubCreator</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubServer.html#getLogger--">getLogger()</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.Internal.<a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubServer.html" title="class in net.ME1312.SubServers.Bungee.Host.Internal">InternalSubServer</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/SubCreator.html#getLogger--">getLogger()</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.<a href="net/ME1312/SubServers/Bungee/Host/SubCreator.html" title="class in net.ME1312.SubServers.Bungee.Host">SubCreator</a></dt>
<dd>
<div class="block">Gets the Logger for the creator</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/SubServer.html#getLogger--">getLogger()</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.<a href="net/ME1312/SubServers/Bungee/Host/SubServer.html" title="class in net.ME1312.SubServers.Bungee.Host">SubServer</a></dt>
<dd>
<div class="block">Get Process Logger</div>
@ -1099,7 +1111,7 @@
<dd>
<div class="block">Internal Process Logger Class</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#InternalSubLogger-java.lang.Process-java.lang.String-net.ME1312.SubServers.Bungee.Library.Container-java.io.File-">InternalSubLogger(Process, String, Container&lt;Boolean&gt;, File)</a></span> - Constructor for class net.ME1312.SubServers.Bungee.Host.Internal.<a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host.Internal">InternalSubLogger</a></dt>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#InternalSubLogger-java.lang.Process-java.lang.Object-java.lang.String-net.ME1312.SubServers.Bungee.Library.Container-java.io.File-">InternalSubLogger(Process, Object, String, Container&lt;Boolean&gt;, File)</a></span> - Constructor for class net.ME1312.SubServers.Bungee.Host.Internal.<a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host.Internal">InternalSubLogger</a></dt>
<dd>
<div class="block">Creates a new Internal Process Logger</div>
</dd>
@ -1804,6 +1816,10 @@
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubServer.html#start-java.util.UUID-">start(UUID)</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.Internal.<a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubServer.html" title="class in net.ME1312.SubServers.Bungee.Host.Internal">InternalSubServer</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/SubLogFilter.html#start--">start()</a></span> - Method in interface net.ME1312.SubServers.Bungee.Host.<a href="net/ME1312/SubServers/Bungee/Host/SubLogFilter.html" title="interface in net.ME1312.SubServers.Bungee.Host">SubLogFilter</a></dt>
<dd>
<div class="block">Called when the logging has started</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/SubLogger.html#start--">start()</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.<a href="net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a></dt>
<dd>
<div class="block">Start Logger</div>
@ -1834,6 +1850,10 @@
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubServer.html#stop-java.util.UUID-">stop(UUID)</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.Internal.<a href="net/ME1312/SubServers/Bungee/Host/Internal/InternalSubServer.html" title="class in net.ME1312.SubServers.Bungee.Host.Internal">InternalSubServer</a></dt>
<dd>&nbsp;</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/SubLogFilter.html#stop--">stop()</a></span> - Method in interface net.ME1312.SubServers.Bungee.Host.<a href="net/ME1312/SubServers/Bungee/Host/SubLogFilter.html" title="interface in net.ME1312.SubServers.Bungee.Host">SubLogFilter</a></dt>
<dd>
<div class="block">Called when the logging has stopped</div>
</dd>
<dt><span class="memberNameLink"><a href="net/ME1312/SubServers/Bungee/Host/SubLogger.html#stop--">stop()</a></span> - Method in class net.ME1312.SubServers.Bungee.Host.<a href="net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a></dt>
<dd>
<div class="block">Stop Logger</div>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -192,18 +192,24 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubCreator.html#getLogger--">getLogger</a></span>()</code>
<div class="block">Gets the Logger for the creator</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubCreator.html#isBusy--">isBusy</a></span>()</code>
<div class="block">Gets the status of SubCreator</div>
</td>
</tr>
<tr id="i4" class="altColor">
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubCreator.html#terminate--">terminate</a></span>()</code>
<div class="block">Terminate SubCreator</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubCreator.html#waitFor--">waitFor</a></span>()</code>
<div class="block">Wait for SubCreator to Finish</div>
@ -358,6 +364,22 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.
</dl>
</li>
</ul>
<a name="getLogger--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLogger</h4>
<pre>public&nbsp;<a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a>&nbsp;getLogger()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#getLogger--">SubCreator</a></code></span></div>
<div class="block">Gets the Logger for the creator</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#getLogger--">getLogger</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html" title="class in net.ME1312.SubServers.Bungee.Host">SubCreator</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
</dl>
</li>
</ul>
<a name="isBusy--">
<!-- -->
</a>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10};
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -133,7 +133,8 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.h
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#InternalSubLogger-java.lang.Process-java.lang.String-net.ME1312.SubServers.Bungee.Library.Container-java.io.File-">InternalSubLogger</a></span>(java.lang.Process&nbsp;process,
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#InternalSubLogger-java.lang.Process-java.lang.Object-java.lang.String-net.ME1312.SubServers.Bungee.Library.Container-java.io.File-">InternalSubLogger</a></span>(java.lang.Process&nbsp;process,
java.lang.Object&nbsp;user,
java.lang.String&nbsp;name,
<a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Container.html" title="class in net.ME1312.SubServers.Bungee.Library">Container</a>&lt;java.lang.Boolean&gt;&nbsp;log,
java.io.File&nbsp;file)</code>
@ -156,34 +157,40 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.h
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#getHandle--">getHandle</a></span>()</code>
<div class="block">Gets the Object using this Logger</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#getName--">getName</a></span>()</code>
<div class="block">Gets the Name of the task logging</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<tr id="i2" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#isLogging--">isLogging</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#registerFilter-net.ME1312.SubServers.Bungee.Host.SubLogFilter-">registerFilter</a></span>(<a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogFilter.html" title="interface in net.ME1312.SubServers.Bungee.Host">SubLogFilter</a>&nbsp;filter)</code>
<div class="block">Register Filter</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#start--">start</a></span>()</code>
<div class="block">Start Logger</div>
</td>
</tr>
<tr id="i4" class="altColor">
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#stop--">stop</a></span>()</code>
<div class="block">Stop Logger</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubLogger.html#unregisterFilter-net.ME1312.SubServers.Bungee.Host.SubLogFilter-">unregisterFilter</a></span>(<a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogFilter.html" title="interface in net.ME1312.SubServers.Bungee.Host">SubLogFilter</a>&nbsp;filter)</code>
<div class="block">Unregister Filter</div>
@ -211,13 +218,14 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.h
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="InternalSubLogger-java.lang.Process-java.lang.String-net.ME1312.SubServers.Bungee.Library.Container-java.io.File-">
<a name="InternalSubLogger-java.lang.Process-java.lang.Object-java.lang.String-net.ME1312.SubServers.Bungee.Library.Container-java.io.File-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>InternalSubLogger</h4>
<pre>public&nbsp;InternalSubLogger(java.lang.Process&nbsp;process,
java.lang.Object&nbsp;user,
java.lang.String&nbsp;name,
<a href="../../../../../../net/ME1312/SubServers/Bungee/Library/Container.html" title="class in net.ME1312.SubServers.Bungee.Library">Container</a>&lt;java.lang.Boolean&gt;&nbsp;log,
java.io.File&nbsp;file)</pre>
@ -225,6 +233,7 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.h
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>process</code> - Process</dd>
<dd><code>user</code> - Object using this logger (or null)</dd>
<dd><code>name</code> - Prefix</dd>
<dd><code>log</code> - Console Logging Status</dd>
<dd><code>file</code> - File to log to (or null for disabled)</dd>
@ -303,6 +312,23 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.h
</dl>
</li>
</ul>
<a name="getHandle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHandle</h4>
<pre>public&nbsp;java.lang.Object&nbsp;getHandle()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from class:&nbsp;<code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#getHandle--">SubLogger</a></code></span></div>
<div class="block">Gets the Object using this Logger</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#getHandle--">getHandle</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Object</dd>
</dl>
</li>
</ul>
<a name="getName--">
<!-- -->
</a>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":10,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6};
var methods = {"i0":10,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -202,18 +202,24 @@ extends java.lang.Object</pre>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#getLogger--">getLogger</a></span>()</code>
<div class="block">Gets the Logger for the creator</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#isBusy--">isBusy</a></span>()</code>
<div class="block">Gets the status of SubCreator</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<tr id="i6" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#terminate--">terminate</a></span>()</code>
<div class="block">Terminate SubCreator</div>
</td>
</tr>
<tr id="i6" class="altColor">
<tr id="i7" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#waitFor--">waitFor</a></span>()</code>
<div class="block">Wait for SubCreator to Finish</div>
@ -361,6 +367,19 @@ extends java.lang.Object</pre>
</dl>
</li>
</ul>
<a name="getLogger--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLogger</h4>
<pre>public abstract&nbsp;<a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a>&nbsp;getLogger()</pre>
<div class="block">Gets the Logger for the creator</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
</dl>
</li>
</ul>
<a name="isBusy--">
<!-- -->
</a>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":6};
var methods = {"i0":6,"i1":6,"i2":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -126,6 +126,18 @@ var activeTableTab = "activeTableTab";
<div class="block">Determine if this message should be logged</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/Bungee/Host/SubLogFilter.html#start--">start</a></span>()</code>
<div class="block">Called when the logging has started</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogFilter.html#stop--">stop</a></span>()</code>
<div class="block">Called when the logging has stopped</div>
</td>
</tr>
</table>
</li>
</ul>
@ -141,10 +153,20 @@ var activeTableTab = "activeTableTab";
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="start--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre>void&nbsp;start()</pre>
<div class="block">Called when the logging has started</div>
</li>
</ul>
<a name="log-java.util.logging.Level-java.lang.String-">
<!-- -->
</a>
<ul class="blockListLast">
<ul class="blockList">
<li class="blockList">
<h4>log</h4>
<pre>boolean&nbsp;log(java.util.logging.Level&nbsp;level,
@ -159,6 +181,16 @@ var activeTableTab = "activeTableTab";
</dl>
</li>
</ul>
<a name="stop--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>stop</h4>
<pre>void&nbsp;stop()</pre>
<div class="block">Called when the logging has stopped</div>
</li>
</ul>
</li>
</ul>
</li>

View File

@ -17,7 +17,7 @@
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6};
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
@ -150,34 +150,40 @@ extends java.lang.Object</pre>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>abstract java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#getHandle--">getHandle</a></span>()</code>
<div class="block">Gets the Object using this Logger</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>abstract java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#getName--">getName</a></span>()</code>
<div class="block">Gets the Name of the task logging</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<tr id="i2" class="altColor">
<td class="colFirst"><code>abstract boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#isLogging--">isLogging</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i2" class="altColor">
<tr id="i3" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#registerFilter-net.ME1312.SubServers.Bungee.Host.SubLogFilter-">registerFilter</a></span>(<a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogFilter.html" title="interface in net.ME1312.SubServers.Bungee.Host">SubLogFilter</a>&nbsp;filter)</code>
<div class="block">Register Filter</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<tr id="i4" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#start--">start</a></span>()</code>
<div class="block">Start Logger</div>
</td>
</tr>
<tr id="i4" class="altColor">
<tr id="i5" class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#stop--">stop</a></span>()</code>
<div class="block">Stop Logger</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<tr id="i6" class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html#unregisterFilter-net.ME1312.SubServers.Bungee.Host.SubLogFilter-">unregisterFilter</a></span>(<a href="../../../../../net/ME1312/SubServers/Bungee/Host/SubLogFilter.html" title="interface in net.ME1312.SubServers.Bungee.Host">SubLogFilter</a>&nbsp;filter)</code>
<div class="block">Unregister Filter</div>
@ -236,6 +242,20 @@ extends java.lang.Object</pre>
</dl>
</li>
</ul>
<a name="getHandle--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getHandle</h4>
<pre>public abstract&nbsp;java.lang.Object&nbsp;getHandle()</pre>
<div class="block">Gets the Object using this Logger</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Object</dd>
</dl>
</li>
</ul>
<a name="start--">
<!-- -->
</a>

View File

@ -2,4 +2,4 @@ Manifest-Version: 1.0
Class-Path: BungeeCord.jar
Main-Class: net.ME1312.SubServers.Bungee.Launch
Implementation-Version: 2.11.2f
Specification-Version: 1
Specification-Version: 2

View File

@ -1,10 +1,7 @@
package net.ME1312.SubServers.Bungee.Host.Internal;
import net.ME1312.SubServers.Bungee.Event.SubCreateEvent;
import net.ME1312.SubServers.Bungee.Host.Executable;
import net.ME1312.SubServers.Bungee.Host.Host;
import net.ME1312.SubServers.Bungee.Host.SubCreator;
import net.ME1312.SubServers.Bungee.Host.SubServer;
import net.ME1312.SubServers.Bungee.Host.*;
import net.ME1312.SubServers.Bungee.Library.Config.YAMLConfig;
import net.ME1312.SubServers.Bungee.Library.Config.YAMLSection;
import net.ME1312.SubServers.Bungee.Library.Container;
@ -34,6 +31,7 @@ import java.util.UUID;
public class InternalSubCreator extends SubCreator {
private InternalHost host;
private String gitBash;
private InternalSubLogger logger;
private Process process = null;
private Thread thread = null;
@ -46,6 +44,7 @@ public class InternalSubCreator extends SubCreator {
public InternalSubCreator(InternalHost host, String gitBash) {
this.host = host;
this.gitBash = gitBash;
this.logger = new InternalSubLogger(null, this, host.getName() + "/Creator", new Container<Boolean>(false), null);
}
@ -166,8 +165,10 @@ public class InternalSubCreator extends SubCreator {
this.process = Runtime.getRuntime().exec((System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)?
"\"" + gitBash + "\" --login -i -c \"bash build.sh " + version.toString() + " " + type.toString().toLowerCase() + "\""
:("bash build.sh " + version.toString() + " " + type.toString().toLowerCase() + " " + System.getProperty("user.home")), null, dir);
InternalSubLogger read = new InternalSubLogger(this.process, host.getName() + "/Creator", new Container<Boolean>(host.plugin.config.get().getSection("Settings").getBoolean("Log-Creator")), new File(dir, "SubCreator-" + type.toString() + "-" + version.toString().replace("::", "@") + ".log"));
read.start();
logger.process = this.process;
logger.log.set(host.plugin.config.get().getSection("Settings").getBoolean("Log-Creator"));
logger.file = new File(dir, "SubCreator-" + type.toString() + "-" + version.toString().replace("::", "@") + ".log");
logger.start();
try {
this.process.waitFor();
Thread.sleep(500);
@ -246,6 +247,11 @@ public class InternalSubCreator extends SubCreator {
return gitBash;
}
@Override
public SubLogger getLogger() {
return logger;
}
@Override
public boolean isBusy() {
return thread != null && thread.isAlive();

View File

@ -17,10 +17,11 @@ import java.util.regex.Pattern;
*/
public class InternalSubLogger extends SubLogger {
protected Process process;
private String name;
private Container<Boolean> log;
private Object handle;
protected String name;
protected Container<Boolean> log;
private List<SubLogFilter> filters = new ArrayList<SubLogFilter>();
private File file;
protected File file;
private PrintWriter writer = null;
private boolean started = false;
private Thread out = null;
@ -30,12 +31,14 @@ public class InternalSubLogger extends SubLogger {
* Creates a new Internal Process Logger
*
* @param process Process
* @param user Object using this logger (or null)
* @param name Prefix
* @param log Console Logging Status
* @param file File to log to (or null for disabled)
*/
public InternalSubLogger(Process process, String name, Container<Boolean> log, File file) {
public InternalSubLogger(Process process, Object user, String name, Container<Boolean> log, File file) {
this.process = process;
this.handle = user;
this.name = name;
this.log = log;
this.file = file;
@ -55,6 +58,7 @@ public class InternalSubLogger extends SubLogger {
}
if (out == null) (out = new Thread(() -> start(process.getInputStream(), false))).start();
if (err == null) (err = new Thread(() -> start(process.getErrorStream(), true))).start();
for (SubLogFilter filter : filters) filter.start();
}
private void start(InputStream in, boolean isErr) {
@ -136,6 +140,7 @@ public class InternalSubLogger extends SubLogger {
private void destroy() {
if (started) {
started = false;
for (SubLogFilter filter : filters) filter.stop();
if (writer != null) {
int l = (int) Math.floor((("---------- LOG START \u2014 " + name + " ----------").length() - 9) / 2);
String s = "";
@ -147,6 +152,11 @@ public class InternalSubLogger extends SubLogger {
}
}
@Override
public Object getHandle() {
return handle;
}
@Override
public String getName() {
return name;

View File

@ -62,7 +62,7 @@ public class InternalSubServer extends SubServer {
this.executable = executable;
this.stopcmd = stopcmd;
this.process = null;
this.logger = new InternalSubLogger(null, getName(), this.log, null);
this.logger = new InternalSubLogger(null, this, getName(), this.log, null);
this.thread = null;
this.command = null;
this.restart = restart;

View File

@ -72,6 +72,13 @@ public abstract class SubCreator {
*/
public abstract String getGitBashDirectory();
/**
* Gets the Logger for the creator
*
* @return
*/
public abstract SubLogger getLogger();
/**
* Gets the status of SubCreator
*

View File

@ -7,6 +7,11 @@ import java.util.logging.Level;
*/
public interface SubLogFilter {
/**
* Called when the logging has started
*/
void start();
/**
* Determine if this message should be logged
*
@ -15,4 +20,9 @@ public interface SubLogFilter {
* @return If this message should be logged
*/
boolean log(Level level, String message);
/**
* Called when the logging has stopped
*/
void stop();
}

View File

@ -12,6 +12,13 @@ public abstract class SubLogger {
*/
public abstract String getName();
/**
* Gets the Object using this Logger
*
* @return Object
*/
public abstract Object getHandle();
/**
* Start Logger
*/

View File

@ -3,7 +3,7 @@ network_compression_threshold: 256
stats: 'undefined'
permissions:
default:
- bungeecord.command.server
- bungeecord.command.logger
- bungeecord.command.list
admin:
- bungeecord.command.find
@ -21,7 +21,7 @@ servers:
timeout: 30000
listeners:
- query_port: 25564
motd: '&1Another Bungee server'
motd: '&1Another Bungee logger'
priorities:
- Lobby
bind_local_address: true

View File

@ -3,9 +3,9 @@ Lang:
'Bungee.Server.Current': '&6You are currently connected to $str$'
'Bungee.Server.Available': '&6You may connect to the following servers at this time:'
'Bungee.Server.List': '&6$str$'
'Bungee.Server.Hover': '$int$ player(s)\n&oClick to connect to the server'
'Bungee.Server.Hover': '$int$ player(s)\n&oClick to connect to the logger'
'Bungee.Server.Divider': '&6, '
'Bungee.Server.Invalid': '&cThe specified server does not exist.'
'Bungee.Server.Invalid': '&cThe specified logger does not exist.'
'Bungee.List.Format': '&a[$str$] &e($int$): '
'Bungee.List.List': '&f$str$'
'Bungee.List.Divider': '&f, '
@ -31,31 +31,31 @@ Lang:
'Command.List.Server-Header': '&7SubServers \u00BB Server List:'
'Command.List.Divider': '&7, '
'Command.Start': '&aSubServers \u00BB Starting SubServer'
'Command.Start.Unknown': '&cSubServers \u00BB There is no server with that name'
'Command.Start.Unknown': '&cSubServers \u00BB There is no logger with that name'
'Command.Start.Invalid': '&cSubServers \u00BB That Server is not a SubServer'
'Command.Start.Host-Disabled': '&cSubServers \u00BB That SubServer\u0027s Host is not enabled'
'Command.Start.Server-Disabled': '&cSubServers \u00BB That SubServer is not enabled'
'Command.Start.Running': '&cSubServers \u00BB That SubServer is already running'
'Command.Stop': '&aSubServers \u00BB Stopping SubServer'
'Command.Stop.Unknown': '&cSubServers \u00BB There is no server with that name'
'Command.Stop.Unknown': '&cSubServers \u00BB There is no logger with that name'
'Command.Stop.Invalid': '&cSubServers \u00BB That Server is not a SubServer'
'Command.Stop.Not-Running': '&cSubServers \u00BB That SubServer is not running'
'Command.Terminate': '&aSubServers \u00BB Stopping SubServer'
'Command.Terminate.Unknown': '&cSubServers \u00BB There is no server with that name'
'Command.Terminate.Unknown': '&cSubServers \u00BB There is no logger with that name'
'Command.Terminate.Invalid': '&cSubServers \u00BB That Server is not a SubServer'
'Command.Terminate.Not-Running': '&cSubServers \u00BB That SubServer is not running'
'Command.Command': '&aSubServers \u00BB Sending command to SubServer'
'Command.Command.Unknown': '&cSubServers \u00BB There is no server with that name'
'Command.Command.Unknown': '&cSubServers \u00BB There is no logger with that name'
'Command.Command.Invalid': '&cSubServers \u00BB That Server is not a SubServer'
'Command.Command.Not-Running': '&cSubServers \u00BB That SubServer is not running'
'Command.Teleport': '&aSubServers \u00BB Teleporting...'
'Command.Teleport.Offline': '&cSubServers \u00BB There is no player online with that name'
'Command.Teleport.Invalid': '&cSubServers \u00BB There is no server with that name'
'Command.Teleport.Invalid': '&cSubServers \u00BB There is no logger with that name'
'Command.Creator': '&aSubServers \u00BB Creating SubServer'
'Command.Creator.Exists': '&cSubServers \u00BB There is already a SubServer with that name'
'Command.Creator.Unknown-Host': '&cSubServers \u00BB There is no host with that name'
'Command.Creator.Running': '&cSubServers \u00BB The SubCreator instance on that host is already running'
'Command.Creator.Invalid-Type': '&cSubServers \u00BB There is no server type with that name'
'Command.Creator.Invalid-Type': '&cSubServers \u00BB There is no logger type with that name'
'Command.Creator.Invalid-Version': '&cSubServers \u00BB SubCreator cannot create servers before Minecraft 1.8'
'Command.Creator.Invalid-Port': '&cSubServers \u00BB Invalid Port Number'
'Command.Creator.Invalid-Memory': '&cSubServers \u00BB Invalid RAM Amount'
@ -90,8 +90,8 @@ Lang:
'Interface.Host-Creator.Edit-Type': 'Change Server Type'
'Interface.Host-Creator.Edit-Type.Title': '&eSubCreator\n&6Enter a Type of Server'
'Interface.Host-Creator.Edit-Type.Message': '&eSubCreator \u00BB Enter a Type of Server via Chat'
'Interface.Host-Creator.Edit-Type.Invalid': '&cSubCreator \u00BB There is no server type with that name'
'Interface.Host-Creator.Edit-Type.Invalid-Title': '&eSubCreator\n&cThere is no server type with that name'
'Interface.Host-Creator.Edit-Type.Invalid': '&cSubCreator \u00BB There is no logger type with that name'
'Interface.Host-Creator.Edit-Type.Invalid-Title': '&eSubCreator\n&cThere is no logger type with that name'
'Interface.Host-Creator.Edit-Version': 'Change Server Version'
'Interface.Host-Creator.Edit-Version.Title': '&eSubCreator\n&6Enter a Server Version'
'Interface.Host-Creator.Edit-Version.Message': '&eSubCreator \u00BB Enter a Server Version via Chat'

View File

@ -51,13 +51,13 @@ permissions:
subservers.subserver.command.*:
description: 'Grants Access to Send Commands to a SubServer'
default: op
subservers.server.*:
subservers.logger.*:
description: 'Grants Access to SubServer Server Actions'
default: op
children:
subservers.server.teleport-others:
subservers.logger.teleport-others:
description: 'Grants Acces to Teleport Others to a Server'
default: op
subservers.server.teleport.*:
subservers.logger.teleport.*:
description: 'Grants Acces to Teleport to a Server'
default: op

View File

@ -1,7 +1,8 @@
package net.ME1312.SubServers.Console;
import net.ME1312.SubServers.Bungee.Event.SubCreateEvent;
import net.ME1312.SubServers.Bungee.Event.SubSendCommandEvent;
import net.ME1312.SubServers.Bungee.Event.SubStartEvent;
import net.ME1312.SubServers.Bungee.Event.SubStoppedEvent;
import net.ME1312.SubServers.Bungee.Library.Config.YAMLConfig;
import net.ME1312.SubServers.Bungee.SubPlugin;
import net.md_5.bungee.api.plugin.Listener;
@ -9,13 +10,15 @@ import net.md_5.bungee.api.plugin.Plugin;
import net.md_5.bungee.event.EventHandler;
import net.md_5.bungee.event.EventPriority;
import javax.swing.*;
import java.io.File;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
public class ConsolePlugin extends Plugin implements Listener {
public HashMap<String, ConsoleWindow> current = new HashMap<String, ConsoleWindow>();
public HashMap<String, ConsoleWindow> cCurrent = new HashMap<String, ConsoleWindow>();
public HashMap<String, ConsoleWindow> sCurrent = new HashMap<String, ConsoleWindow>();
public YAMLConfig config;
@Override
@ -23,33 +26,56 @@ public class ConsolePlugin extends Plugin implements Listener {
try {
getDataFolder().mkdirs();
config = new YAMLConfig(new File(getDataFolder(), "config.yml"));
boolean save = false;
if (!config.get().getKeys().contains("Enabled-Servers")) {
config.get().set("Enabled-Servers", Collections.emptyList());
config.save();
save = true;
} if (!config.get().getKeys().contains("Enabled-Creators")) {
config.get().set("Enabled-Creators", Collections.emptyList());
}
getProxy().getPluginManager().registerListener(this, this);
getProxy().getPluginManager().registerCommand(this, new PopoutCommand(this, "popout"));
getProxy().getPluginManager().registerCommand(this, new PopoutCommand.SERVER(this, "popout"));
getProxy().getPluginManager().registerCommand(this, new PopoutCommand.SERVER(this, "popouts"));
getProxy().getPluginManager().registerCommand(this, new PopoutCommand.CREATOR(this, "popoutc"));
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
new JFrame("SubServers 2");
} catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) {
e.printStackTrace();
}
} catch (IOException e) {
e.printStackTrace();
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onServerStart(SubStartEvent event) {
if (!event.isCancelled() && config.get().getStringList("Enabled-Servers").contains(event.getServer().getName().toLowerCase())) {
ConsoleWindow window = new ConsoleWindow(event.getServer());
current.put(event.getServer().getName().toLowerCase(), window);
window.open();
public void onServerCreate(SubCreateEvent event) {
if (!event.isCancelled() && config.get().getStringList("Enabled-Creators").contains(event.getHost().getName().toLowerCase())) {
if (!cCurrent.keySet().contains(event.getHost().getName().toLowerCase())) {
cCurrent.put(event.getHost().getName().toLowerCase(), new ConsoleWindow(event.getHost().getCreator().getLogger()));
} else {
cCurrent.get(event.getHost().getName().toLowerCase()).clear();
}
}
}
@EventHandler
public void onServerStop(SubStoppedEvent event) {
if (current.keySet().contains(event.getServer().getName().toLowerCase())) {
current.get(event.getServer().getName().toLowerCase()).close();
current.remove(event.getServer().getName().toLowerCase());
@EventHandler(priority = EventPriority.HIGHEST)
public void onServerStart(SubStartEvent event) {
if (!event.isCancelled() && config.get().getStringList("Enabled-Servers").contains(event.getServer().getName().toLowerCase())) {
if (!sCurrent.keySet().contains(event.getServer().getName().toLowerCase())) {
sCurrent.put(event.getServer().getName().toLowerCase(), new ConsoleWindow(event.getServer().getLogger()));
} else {
sCurrent.get(event.getServer().getName().toLowerCase()).clear();
}
}
}
@EventHandler(priority = EventPriority.HIGHEST)
public void onServerCommand(SubSendCommandEvent event) {
if (!event.isCancelled() && sCurrent.keySet().contains(event.getServer().getName().toLowerCase())) {
sCurrent.get(event.getServer().getName().toLowerCase()).log('<' + ((event.getPlayer() == null)?"CONSOLE":((getProxy().getPlayer(event.getPlayer()) == null)?event.getPlayer().toString():getProxy().getPlayer(event.getPlayer()).getName())) + "> /" + event.getCommand());
}
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="net.ME1312.SubServers.Console.ConsoleWindow">
<grid id="27dc6" binding="window" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<grid id="27dc6" binding="panel" layout-manager="GridLayoutManager" row-count="4" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="806" height="400"/>
@ -11,47 +11,57 @@
<clientProperties>
<html.disable class="java.lang.Boolean" value="false"/>
</clientProperties>
<border type="none" title="SubServers 2 Console" title-justification="2" title-position="3">
<border type="none" title-justification="2" title-position="3">
<font/>
<title-color color="-1"/>
</border>
<children>
<component id="18cff" class="javax.swing.JTextField" binding="input">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="8" fill="1" indent="0" use-parent-layout="false">
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<background color="-14144467"/>
<caretColor color="-2302756"/>
<dragEnabled value="true"/>
<editable value="true"/>
<font name="Courier" size="14"/>
<foreground color="-14144467"/>
<foreground color="-1"/>
<horizontalAlignment value="10"/>
<text value=""/>
<text value="&gt;"/>
<toolTipText value="Write a command here..."/>
</properties>
<clientProperties>
<html.disable class="java.lang.Boolean" value="true"/>
</clientProperties>
</component>
<scrollpane id="d684e" binding="scroll">
<scrollpane id="d684e" binding="vScroll">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="7" hsize-policy="7" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<foreground color="-14144467"/>
<horizontalScrollBarPolicy value="31"/>
<verticalScrollBarPolicy value="22"/>
</properties>
<border type="none"/>
<border type="none">
<font/>
<title-color color="-4473925"/>
</border>
<children>
<component id="71cb5" class="javax.swing.JTextArea" binding="log">
<constraints/>
<properties>
<background color="-14144467"/>
<caretColor color="-2302756"/>
<disabledTextColor color="-1"/>
<dragEnabled value="true"/>
<editable value="false"/>
<enabled value="true"/>
<font name="Courier" size="12"/>
<foreground color="-14144467"/>
<foreground color="-1"/>
<lineWrap value="false"/>
</properties>
<clientProperties>
@ -60,6 +70,76 @@
</component>
</children>
</scrollpane>
<component id="1e628" class="javax.swing.JScrollBar" binding="hScroll">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<maximum value="0"/>
<orientation value="0"/>
</properties>
</component>
<grid id="35647" binding="find" layout-manager="GridLayoutManager" row-count="1" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-12236470"/>
<enabled value="true"/>
<visible value="false"/>
</properties>
<clientProperties>
<html.disable class="java.lang.Boolean" value="true"/>
</clientProperties>
<border type="none"/>
<children>
<component id="92cd5" class="javax.swing.JTextField" binding="findT">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties>
<background color="-14144467"/>
<caretColor color="-2302756"/>
<font name="Courier" size="14"/>
<foreground color="-1"/>
<toolTipText value="Search"/>
</properties>
<clientProperties>
<html.disable class="java.lang.Boolean" value="true"/>
</clientProperties>
</component>
<component id="b34cc" class="javax.swing.JButton" binding="findN">
<constraints>
<grid row="0" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-12236470"/>
<text value="Next"/>
</properties>
</component>
<component id="b4434" class="javax.swing.JButton" binding="findP">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-12236470"/>
<text value="Previous"/>
</properties>
</component>
<component id="e6826" class="javax.swing.JButton" binding="findD">
<constraints>
<grid row="0" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-12236470"/>
<text value="Done"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</form>

View File

@ -1,117 +1,371 @@
package net.ME1312.SubServers.Console;
import net.ME1312.SubServers.Bungee.Host.SubLogFilter;
import net.ME1312.SubServers.Bungee.Host.SubLogger;
import net.ME1312.SubServers.Bungee.Host.SubServer;
import javax.swing.*;
import javax.swing.text.DefaultCaret;
import javax.swing.text.DefaultEditorKit;
import javax.swing.text.JTextComponent;
import javax.swing.text.TextAction;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;
import java.lang.reflect.InvocationTargetException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Collections;
import java.util.LinkedList;
import java.util.*;
import java.util.List;
import java.util.logging.Level;
public class ConsoleWindow extends JFrame implements SubLogFilter {
private JPanel window;
public class ConsoleWindow implements SubLogFilter {
private JFrame window;
private JPanel panel;
private JTextField input;
private TextFieldPopup popup;
private JTextArea log;
private JScrollPane scroll;
private JScrollPane vScroll;
private JScrollBar hScroll;
private List<Integer> eScroll = new ArrayList<Integer>();
private JPanel find;
private JTextField findT;
private JButton findN;
private JButton findP;
private JButton findD;
private int findO = 0;
private int findI = 0;
private List<Runnable> events;
private boolean running;
private boolean open;
private SubServer server;
private SubLogger logger;
private KeyEventDispatcher keys = event -> {
if (window.isVisible() && window.isFocused()) {
switch (event.getID()) {
case KeyEvent.KEY_PRESSED:
if (event.getKeyCode() == KeyEvent.VK_UP) {
popup.prev(input);
}
break;
public ConsoleWindow(SubServer server) {
this.server = server;
this.open = false;
JMenuBar jMenu = new JMenuBar();
JMenu menu = new JMenu("View");
JMenuItem item = new JMenuItem("Scroll to Top");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> scroll.getVerticalScrollBar().setValue(0));
menu.add(item);
item = new JMenuItem("Scroll to Bottom");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> scroll.getVerticalScrollBar().setValue(scroll.getVerticalScrollBar().getMaximum() - scroll.getVerticalScrollBar().getVisibleAmount()));
menu.add(item);
menu.addSeparator();
item = new JMenuItem("Reset Text Size");
item.addActionListener(event -> log.setFont(new Font(log.getFont().getName(), log.getFont().getStyle(), 12)));
menu.add(item);
item = new JMenuItem("Bigger Text");
item.setAccelerator(KeyStroke.getKeyStroke('=', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() + KeyEvent.SHIFT_MASK, true));
item.addActionListener(event -> log.setFont(new Font(log.getFont().getName(), log.getFont().getStyle(), log.getFont().getSize() + 2)));
menu.add(item);
item = new JMenuItem("Smaller Text");
item.setAccelerator(KeyStroke.getKeyStroke('-', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> log.setFont(new Font(log.getFont().getName(), log.getFont().getStyle(), log.getFont().getSize() - 2)));
menu.add(item);
jMenu.add(menu);
setJMenuBar(jMenu);
setContentPane(window);
pack();
setTitle(server.getName() + " \u2014 SubServers 2");
setSize(1024, 576);
Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
int x = (int) ((dimension.getWidth() - getWidth()) / 2);
int y = (int) ((dimension.getHeight() - getHeight()) / 2);
setLocation(x, y);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
close();
case KeyEvent.KEY_RELEASED:
if (event.getKeyCode() == KeyEvent.VK_DOWN) {
popup.next(input);
}
break;
}
}
return false;
};
public ConsoleWindow(SubLogger logger) {
this.logger = logger;
this.open = false;
this.running = false;
this.events = new LinkedList<Runnable>();
events.add(() -> {
window = new JFrame();
JMenuBar jMenu = new JMenuBar();
JMenu menu = new JMenu("View");
JMenuItem item = new JMenuItem("Scroll to Top");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> vScroll.getVerticalScrollBar().setValue(0));
menu.add(item);
item = new JMenuItem("Scroll to Bottom");
item.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> vScroll.getVerticalScrollBar().setValue(vScroll.getVerticalScrollBar().getMaximum() - vScroll.getVerticalScrollBar().getVisibleAmount()));
menu.add(item);
item = new JMenuItem("Find");
item.setAccelerator(KeyStroke.getKeyStroke('F', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> {
if (find.isVisible()) {
find.setVisible(false);
findI = 0;
findO = 0;
} else {
find.setVisible(true);
findT.selectAll();
findT.requestFocusInWindow();
}
});
menu.add(item);
menu.addSeparator();
item = new JMenuItem("Reset Text Size");
item.addActionListener(event -> {
log.setFont(new Font(log.getFont().getName(), log.getFont().getStyle(), 12));
SwingUtilities.invokeLater(this::hScroll);
});
menu.add(item);
item = new JMenuItem("Bigger Text");
item.setAccelerator(KeyStroke.getKeyStroke('=', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> {
log.setFont(new Font(log.getFont().getName(), log.getFont().getStyle(), log.getFont().getSize() + 2));
SwingUtilities.invokeLater(this::hScroll);
});
menu.add(item);
item = new JMenuItem("Smaller Text");
item.setAccelerator(KeyStroke.getKeyStroke('-', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> {
log.setFont(new Font(log.getFont().getName(), log.getFont().getStyle(), log.getFont().getSize() - 2));
SwingUtilities.invokeLater(this::hScroll);
});
menu.add(item);
menu.addSeparator();
item = new JMenuItem("Clear Screen");
item.setAccelerator(KeyStroke.getKeyStroke('L', Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(), true));
item.addActionListener(event -> clear());
menu.add(item);
jMenu.add(menu);
window.setJMenuBar(jMenu);
window.setContentPane(panel);
window.pack();
window.setTitle(logger.getName() + " \u2014 SubServers 2");
window.setSize(1024, 576);
Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize();
int x = (int) ((dimension.getWidth() - window.getWidth()) / 2);
int y = (int) ((dimension.getHeight() - window.getHeight()) / 2);
window.setLocation(x, y);
window.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
close();
}
});
vScroll.setBorder(BorderFactory.createLineBorder(new Color(40, 44, 45)));
new SmartScroller(vScroll, SmartScroller.VERTICAL, SmartScroller.END);
log.setText("\n");
log.setBorder(BorderFactory.createLineBorder(new Color(40, 44, 45)));
new TextFieldPopup(log, false);
((AbstractDocument) log.getDocument()).setDocumentFilter(new DocumentFilter() {
@Override
public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
super.insertString(fb, offset, string, attr);
hScroll();
}
@Override
public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException {
super.replace(fb, offset, length, text, attrs);
hScroll();
}
@Override
public void remove(FilterBypass fb, int offset, int length) throws BadLocationException {
super.remove(fb, offset, length);
hScroll();
}
});
popup = new TextFieldPopup(input, true);
input.setBorder(BorderFactory.createLineBorder(new Color(69, 73, 74)));
input.addActionListener((ActionEvent event) -> {
if (logger.getHandle() instanceof SubServer && input.getText().length() > 0 && !input.getText().equals(">")) {
if (((SubServer) logger.getHandle()).command((input.getText().startsWith(">")) ? input.getText().substring(1) : input.getText())) {
popup.commands.add((input.getText().startsWith(">")) ? input.getText().substring(1) : input.getText());
popup.current = 0;
popup.last = true;
input.setText("");
}
}
});
((AbstractDocument) input.getDocument()).setDocumentFilter(new DocumentFilter() {
@Override
public void insertString(FilterBypass fb, int offset, String string, AttributeSet attr) throws BadLocationException {
if (offset < 1) {
return;
}
super.insertString(fb, offset, string, attr);
}
@Override
public void replace(FilterBypass fb, int offset, int length, String text, AttributeSet attrs) throws BadLocationException {
if (offset < 1) {
length = Math.max(0, length - 1);
offset = 1;
}
super.replace(fb, offset, length, text, attrs);
}
@Override
public void remove(FilterBypass fb, int offset, int length) throws BadLocationException {
if (offset < 1) {
length = Math.max(0, length + offset - 1);
offset = 1;
}
if (length > 0) {
super.remove(fb, offset, length);
}
}
});
vScroll.getHorizontalScrollBar().addAdjustmentListener(event -> {
if (!eScroll.contains(event.getValue())) {
eScroll.add(event.getValue());
hScroll.setValue(event.getValue());
} else {
eScroll.remove((Object) event.getValue());
}
});
hScroll.addAdjustmentListener(event -> {
if (!eScroll.contains(event.getValue())) {
eScroll.add(event.getValue());
vScroll.getHorizontalScrollBar().setValue(event.getValue());
} else {
eScroll.remove((Object) event.getValue());
}
});
new TextFieldPopup(findT, false);
findT.setBorder(BorderFactory.createLineBorder(new Color(69, 73, 74)));
findP.addActionListener(event -> find(false));
findN.addActionListener(event -> find(true));
findD.addActionListener(event -> {
find.setVisible(false);
findI = 0;
findO = 0;
});
if (!(logger.getHandle() instanceof SubServer)) {
input.setVisible(false);
hScroll.setVisible(false);
vScroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
}
KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(keys);
});
scroll.setBorder(BorderFactory.createLineBorder(new Color(40, 44, 45)));
scroll.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
new SmartScroller(scroll, SmartScroller.VERTICAL, SmartScroller.END);
log.setText("\n");
log.setForeground(Color.WHITE);
log.setBorder(BorderFactory.createLineBorder(new Color(40, 44, 45)));
new TextFieldPopup(log);
input.setForeground(Color.WHITE);
input.setBorder(BorderFactory.createLineBorder(new Color(40, 44, 45)));
popup = new TextFieldPopup(input);
input.addActionListener(event -> {
if (input.getText().length() > 0 && !input.getText().equals("/")) server.command((input.getText().startsWith("/"))?input.getText().substring(1):input.getText());
popup.commands.add(input.getText());
popup.current = 0;
popup.last = true;
input.setText("/");
});
input.setText("/");
server.getLogger().registerFilter(this);
logger.registerFilter(this);
runEvents();
}
private void hScroll() {
hScroll.setMaximum(vScroll.getHorizontalScrollBar().getMaximum());
hScroll.setMinimum(vScroll.getHorizontalScrollBar().getMinimum());
hScroll.setVisibleAmount(vScroll.getHorizontalScrollBar().getVisibleAmount());
}
private void find(boolean direction) {
if (!direction) findI -= findO + 1;
String find = findT.getText().toLowerCase();
log.requestFocusInWindow();
if (find.length() > 0) {
Document document = log.getDocument();
int findLength = find.length();
try {
boolean found = false;
if (findI + findLength >= document.getLength()) findI = 1;
while (findLength <= document.getLength()) {
String match = document.getText(findI, findLength).toLowerCase();
if (match.equals(find)) {
found = true;
break;
}
if (direction) findI++;
else findI--;
}
if (found) {
Rectangle viewRect = log.modelToView(findI);
log.scrollRectToVisible(viewRect);
log.setCaretPosition(findI + findLength);
log.moveCaretPosition(findI);
findI += findLength;
findO = findLength;
}
} catch (BadLocationException e) {
findI = log.getText().length() - 1;
JOptionPane.showMessageDialog(window,
"There are no more results\nSearch again to start from the " + ((direction)?"top":"bottom"),
"Find",
JOptionPane.WARNING_MESSAGE);
}
}
}
public void clear() {
events.add(() -> log.setText("\n"));
runEvents();
}
public void log(String message) {
events.add(() -> log.setText(log.getText() + ' ' + new SimpleDateFormat("hh:mm:ss").format(Calendar.getInstance().getTime()) + ' ' + message + " \n"));
runEvents();
}
@Override
public boolean log(Level level, String message) {
log.setText(log.getText() + ' ' + new SimpleDateFormat("hh:mm:ss").format(Calendar.getInstance().getTime()) + " [" + level.getLocalizedName() + "] " + message + " \n");
log("[" + level.getLocalizedName() + "] " + message);
return !open;
}
public SubServer getServer() {
return server;
public boolean runEvents() {
return runEvents(false);
}
private boolean runEvents(boolean force) {
if (events.size() > 0 && (force || !running)) {
running = true;
final Runnable event = events.get(0);
SwingUtilities.invokeLater(() -> {
try {
event.run();
} catch (Throwable e) {
new InvocationTargetException(e, "Exception while running SubServers Console Window Event").printStackTrace();
}
events.remove(0);
if (!runEvents(true)) running = false;
});
return true;
} else return false;
}
@Override
public void start() {
open();
}
public void open() {
if (!open) {
setVisible(true);
toFront();
this.open = true;
}
events.add(() -> {
if (!open) {
window.setVisible(true);
this.open = true;
}
window.toFront();
});
runEvents();
}
public SubLogger getLogger() {
return logger;
}
@Override
public void stop() {
close();
}
public void close() {
if (open) {
this.open = false;
setVisible(false);
}
events.add(() -> {
if (open) {
this.open = false;
if (find.isVisible()) {
find.setVisible(false);
findI = 0;
findO = 0;
}
window.setVisible(false);
}
});
runEvents();
}
public void destroy() {
close();
logger.unregisterFilter(this);
KeyboardFocusManager.getCurrentKeyboardFocusManager().removeKeyEventDispatcher(keys);
}
private class TextFieldPopup extends JPanel {
@ -119,44 +373,26 @@ public class ConsoleWindow extends JFrame implements SubLogFilter {
protected int current = 0;
protected boolean last = true;
public TextFieldPopup(JTextComponent field) {
public TextFieldPopup(JTextComponent field, boolean command) {
JPopupMenu menu = new JPopupMenu();
if (field.isEditable()) {
Action backward = new TextAction("Previous Command") {
public void actionPerformed(ActionEvent e) {
JTextComponent field = getFocusedComponent();
if (field.isEditable()) {
LinkedList<String> list = new LinkedList<String>(commands);
Collections.reverse(list);
if (list.size() > current) {
if (!last) current++;
last = true;
field.setText(list.get(current++));
}
if (command) {
Action backward = new TextAction("Previous Command") {
public void actionPerformed(ActionEvent e) {
prev(getFocusedComponent());
}
}
};
// TODO find a good shortcut key combo
menu.add(backward);
};
menu.add(backward);
Action forward = new TextAction("Next Command") {
public void actionPerformed(ActionEvent e) {
JTextComponent field = getFocusedComponent();
if (field.isEditable()) {
LinkedList<String> list = new LinkedList<String>(commands);
Collections.reverse(list);
if (current > 0) {
if (last) current--;
last = false;
field.setText(list.get(--current));
} else field.setText("/");
Action forward = new TextAction("Next Command") {
public void actionPerformed(ActionEvent e) {
next(getFocusedComponent());
}
}
};
// TODO find a good shortcut key combo
menu.add(forward);
menu.addSeparator();
};
menu.add(forward);
menu.addSeparator();
}
Action cut = new DefaultEditorKit.CutAction();
cut.putValue(Action.NAME, "Cut");
@ -188,6 +424,32 @@ public class ConsoleWindow extends JFrame implements SubLogFilter {
field.setComponentPopupMenu(menu);
}
public void next(JTextComponent field) {
if (field.isEditable()) {
LinkedList<String> list = new LinkedList<String>(commands);
Collections.reverse(list);
if (current > 0) {
if (last && current != 1) current--;
last = false;
field.setText(list.get(--current));
} else field.setText("");
field.setCaretPosition(field.getText().length());
}
}
public void prev(JTextComponent field) {
if (field.isEditable()) {
LinkedList<String> list = new LinkedList<String>(commands);
Collections.reverse(list);
if (list.size() > current) {
if (!last) current++;
last = true;
field.setText(list.get(current++));
field.setCaretPosition(field.getText().length());
}
}
}
}
private class SmartScroller implements AdjustmentListener {
public final static int HORIZONTAL = 0;
@ -218,7 +480,7 @@ public class ConsoleWindow extends JFrame implements SubLogFilter {
{
if (scrollDirection != HORIZONTAL
&& scrollDirection != VERTICAL)
throw new IllegalArgumentException("invalid scroll direction specified");
throw new IllegalArgumentException("invalid vScroll direction specified");
if (viewportPosition != START
&& viewportPosition != END)
@ -263,7 +525,7 @@ public class ConsoleWindow extends JFrame implements SubLogFilter {
*/
private void checkScrollBar(AdjustmentEvent e)
{
// The scroll bar listModel contains information needed to determine
// The vScroll bar listModel contains information needed to determine
// whether the viewport should be repositioned or not.
JScrollBar scrollBar = (JScrollBar)e.getSource();
@ -286,8 +548,8 @@ public class ConsoleWindow extends JFrame implements SubLogFilter {
}
// Reset the "value" so we can reposition the viewport and
// distinguish between a user scroll and a program scroll.
// (ie. valueChanged will be false on a program scroll)
// distinguish between a user vScroll and a program vScroll.
// (ie. valueChanged will be false on a program vScroll)
if (adjustScrollBar && viewportPosition == END)
{

View File

@ -1,5 +1,6 @@
package net.ME1312.SubServers.Console;
import net.ME1312.SubServers.Bungee.Host.Host;
import net.ME1312.SubServers.Bungee.Host.SubServer;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
@ -9,67 +10,138 @@ import net.md_5.bungee.command.ConsoleCommandSender;
import java.util.List;
import java.util.Map;
public class PopoutCommand extends Command {
private ConsolePlugin plugin;
private String label;
public class PopoutCommand {
private PopoutCommand() {}
public static class SERVER extends Command {
private ConsolePlugin plugin;
private String label;
public PopoutCommand(ConsolePlugin plugin, String command) {
super(command);
this.plugin = plugin;
this.label = command;
}
public SERVER(ConsolePlugin plugin, String command) {
super(command);
this.plugin = plugin;
this.label = command;
}
@Override
public void execute(CommandSender sender, String[] args) {
if (sender instanceof ConsoleCommandSender) {
if (args.length > 0) {
Map<String, SubServer> servers = plugin.getProxy().api.getSubServers();
if (servers.keySet().contains(args[0].toLowerCase())) {
boolean success = false;
if (servers.get(args[0].toLowerCase()).isRunning()) {
if (!plugin.current.keySet().contains(args[0].toLowerCase())) {
ConsoleWindow window = new ConsoleWindow(servers.get(args[0].toLowerCase()));
plugin.current.put(args[0].toLowerCase(), window);
window.open();
} else {
plugin.current.get(args[0].toLowerCase()).open();
}
System.out.println("SubConsole > Opening Window...");
success = true;
}
try {
if (args.length > 1) {
if (args[1].equalsIgnoreCase("true")) {
List<String> list = plugin.config.get().getStringList("Enabled-Servers");
list.add(args[0].toLowerCase());
plugin.config.get().set("Enabled-Servers", list);
plugin.config.save();
if (!success) System.out.println("SubConsole > " + servers.get(args[0].toLowerCase()).getName() + " was added to the enabled list");
success = true;
} else if (args[1].equalsIgnoreCase("false")) {
List<String> list = plugin.config.get().getStringList("Enabled-Servers");
list.remove(args[0].toLowerCase());
plugin.config.get().set("Enabled-Servers", list);
if (!success) System.out.println("SubConsole > " + servers.get(args[0].toLowerCase()).getName() + " was removed from the enabled list");
success = true;
@Override
public void execute(CommandSender sender, String[] args) {
if (sender instanceof ConsoleCommandSender) {
if (args.length > 0) {
Map<String, SubServer> servers = plugin.getProxy().api.getSubServers();
if (servers.keySet().contains(args[0].toLowerCase())) {
boolean success = false;
if (servers.get(args[0].toLowerCase()).isRunning()) {
if (!plugin.sCurrent.keySet().contains(args[0].toLowerCase())) {
ConsoleWindow window = new ConsoleWindow(servers.get(args[0].toLowerCase()).getLogger());
plugin.sCurrent.put(args[0].toLowerCase(), window);
window.open();
} else {
plugin.sCurrent.get(args[0].toLowerCase()).open();
}
System.out.println("SubConsole > Opening Window...");
success = true;
}
} catch (Exception e) {
e.printStackTrace();
}
if (!success) System.out.println("SubConsole > That SubServer is not running right now.");
try {
if (args.length > 1) {
if (args[1].equalsIgnoreCase("true")) {
if (!plugin.config.get().getStringList("Enabled-Servers").contains(args[0].toLowerCase())) {
List<String> list = plugin.config.get().getStringList("Enabled-Servers");
list.add(args[0].toLowerCase());
plugin.config.get().set("Enabled-Servers", list);
plugin.config.save();
}
if (!success) System.out.println("SubConsole > " + servers.get(args[0].toLowerCase()).getName() + " was added to the enabled list");
success = true;
} else if (args[1].equalsIgnoreCase("false")) {
List<String> list = plugin.config.get().getStringList("Enabled-Servers");
list.remove(args[0].toLowerCase());
plugin.config.get().set("Enabled-Servers", list);
if (!success) System.out.println("SubConsole > " + servers.get(args[0].toLowerCase()).getName() + " was removed from the enabled list");
success = true;
}
}
} catch (Exception e) {
e.printStackTrace();
}
if (!success) System.out.println("SubConsole > That SubServer is not running right now.");
} else {
System.out.println("SubConsole > There is no SubServer with that name.");
}
} else {
System.out.println("SubConsole > There is no SubServer with that name.");
System.out.println("SubConsole > Usage: /" + label + " <SubServer> [Remember]");
}
} else {
System.out.println("SubConsole > Usage: /" + label + " <SubServer> [Remember]");
String str = label;
for (String arg : args) str += ' ' + arg;
((ProxiedPlayer) sender).chat(str);
}
}
}
public static class CREATOR extends Command {
private ConsolePlugin plugin;
private String label;
public CREATOR(ConsolePlugin plugin, String command) {
super(command);
this.plugin = plugin;
this.label = command;
}
@Override
public void execute(CommandSender sender, String[] args) {
if (sender instanceof ConsoleCommandSender) {
if (args.length > 0) {
Map<String, Host> hosts = plugin.getProxy().api.getHosts();
if (hosts.keySet().contains(args[0].toLowerCase())) {
boolean success = false;
if (hosts.get(args[0].toLowerCase()).getCreator().isBusy()) {
if (!plugin.cCurrent.keySet().contains(args[0].toLowerCase())) {
ConsoleWindow window = new ConsoleWindow(hosts.get(args[0].toLowerCase()).getCreator().getLogger());
plugin.cCurrent.put(args[0].toLowerCase(), window);
window.open();
} else {
plugin.cCurrent.get(args[0].toLowerCase()).open();
}
System.out.println("SubConsole > Opening Window...");
success = true;
}
try {
if (args.length > 1) {
if (args[1].equalsIgnoreCase("true")) {
if (!plugin.config.get().getStringList("Enabled-Creators").contains(args[0].toLowerCase())) {
List<String> list = plugin.config.get().getStringList("Enabled-Creators");
list.add(args[0].toLowerCase());
plugin.config.get().set("Enabled-Creators", list);
plugin.config.save();
}
if (!success) System.out.println("SubConsole > " + hosts.get(args[0].toLowerCase()).getName() + "/Creator was added to the enabled list");
success = true;
} else if (args[1].equalsIgnoreCase("false")) {
List<String> list = plugin.config.get().getStringList("Enabled-Creators");
list.remove(args[0].toLowerCase());
plugin.config.get().set("Enabled-Creators", list);
if (!success) System.out.println("SubConsole > " + hosts.get(args[0].toLowerCase()).getName() + "/Creator was removed from the enabled list");
success = true;
}
}
} catch (Exception e) {
e.printStackTrace();
}
if (!success) System.out.println("SubConsole > That Host's Creator is not running right now.");
} else {
System.out.println("SubConsole > There is no Host with that name.");
}
} else {
System.out.println("SubConsole > Usage: /" + label + " <Host> [Remember]");
}
} else {
String str = label;
for (String arg : args) str += ' ' + arg;
((ProxiedPlayer) sender).chat(str);
}
} else {
String str = label;
for (String arg : args) str += ' ' + arg;
((ProxiedPlayer) sender).chat(str);
}
}
}