mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 10:15:52 +01:00
SubServers Console v2.12a
This commit is contained in:
parent
df9797496a
commit
c02db9890c
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -198,7 +198,7 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.
|
||||
</tr>
|
||||
<tr id="i4" class="altColor">
|
||||
<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/External/ExternalSubCreator.html#getLogger-java.lang.String-">getLogger</a></span>(java.lang.String thread)</code>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/External/ExternalSubCreator.html#getLogger-java.lang.String-">getLogger</a></span>(java.lang.String name)</code>
|
||||
<div class="block">Gets the Logger for a SubCreator Instance</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -451,14 +451,14 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getLogger</h4>
|
||||
<pre>public <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a> getLogger(java.lang.String thread)</pre>
|
||||
<pre>public <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a> getLogger(java.lang.String name)</pre>
|
||||
<div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#getLogger-java.lang.String-">SubCreator</a></code></span></div>
|
||||
<div class="block">Gets the Logger for a SubCreator Instance</div>
|
||||
<dl>
|
||||
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
||||
<dd><code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#getLogger-java.lang.String-">getLogger</a></code> in class <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="paramLabel">Parameters:</span></dt>
|
||||
<dd><code>thread</code> - Thread ID</dd>
|
||||
<dd><code>name</code> - Thread ID</dd>
|
||||
<dt><span class="returnLabel">Returns:</span></dt>
|
||||
<dd>SubCreator Logger</dd>
|
||||
</dl>
|
||||
|
@ -198,7 +198,7 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.
|
||||
</tr>
|
||||
<tr id="i4" class="altColor">
|
||||
<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-java.lang.String-">getLogger</a></span>(java.lang.String thread)</code>
|
||||
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/Internal/InternalSubCreator.html#getLogger-java.lang.String-">getLogger</a></span>(java.lang.String name)</code>
|
||||
<div class="block">Gets the Logger for a SubCreator Instance</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -451,14 +451,14 @@ extends <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.
|
||||
<ul class="blockList">
|
||||
<li class="blockList">
|
||||
<h4>getLogger</h4>
|
||||
<pre>public <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a> getLogger(java.lang.String thread)</pre>
|
||||
<pre>public <a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubLogger.html" title="class in net.ME1312.SubServers.Bungee.Host">SubLogger</a> getLogger(java.lang.String name)</pre>
|
||||
<div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#getLogger-java.lang.String-">SubCreator</a></code></span></div>
|
||||
<div class="block">Gets the Logger for a SubCreator Instance</div>
|
||||
<dl>
|
||||
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
||||
<dd><code><a href="../../../../../../net/ME1312/SubServers/Bungee/Host/SubCreator.html#getLogger-java.lang.String-">getLogger</a></code> in class <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="paramLabel">Parameters:</span></dt>
|
||||
<dd><code>thread</code> - Thread ID</dd>
|
||||
<dd><code>name</code> - Thread ID</dd>
|
||||
<dt><span class="returnLabel">Returns:</span></dt>
|
||||
<dd>SubCreator Logger</dd>
|
||||
</dl>
|
||||
|
@ -120,8 +120,8 @@ public class ExternalSubCreator extends SubCreator {
|
||||
|
||||
@Override
|
||||
public void terminate(String name) {
|
||||
if (this.thread.keySet().contains(name)) {
|
||||
host.getSubData().sendPacket(new PacketExCreateServer(name));
|
||||
if (this.thread.keySet().contains(name.toLowerCase())) {
|
||||
host.getSubData().sendPacket(new PacketExCreateServer(name.toLowerCase()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,7 +136,7 @@ public class ExternalSubCreator extends SubCreator {
|
||||
|
||||
@Override
|
||||
public void waitFor(String name) throws InterruptedException {
|
||||
while (this.thread.keySet().contains(name)) {
|
||||
while (this.thread.keySet().contains(name.toLowerCase())) {
|
||||
Thread.sleep(250);
|
||||
}
|
||||
}
|
||||
@ -157,8 +157,8 @@ public class ExternalSubCreator extends SubCreator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubLogger getLogger(String thread) {
|
||||
return this.thread.get(thread);
|
||||
public SubLogger getLogger(String name) {
|
||||
return this.thread.get(name.toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -151,6 +151,8 @@ public class InternalSubCreator extends SubCreator {
|
||||
Thread.sleep(500);
|
||||
|
||||
if (thread.get().exitValue() != 0) error = true;
|
||||
} catch (InterruptedException e) {
|
||||
error = true;
|
||||
} catch (Exception e) {
|
||||
error = true;
|
||||
e.printStackTrace();
|
||||
@ -244,11 +246,11 @@ public class InternalSubCreator extends SubCreator {
|
||||
|
||||
@Override
|
||||
public void terminate(String name) {
|
||||
if (this.thread.get(name).get().get() != null && this.thread.get(name).get().get().isAlive()) {
|
||||
this.thread.get(name).get().get().destroyForcibly();
|
||||
if (this.thread.get(name.toLowerCase()).get().get() != null && this.thread.get(name.toLowerCase()).get().get().isAlive()) {
|
||||
this.thread.get(name.toLowerCase()).get().get().destroyForcibly();
|
||||
}
|
||||
if (this.thread.get(name).name() != null && this.thread.get(name).name().isAlive()) {
|
||||
this.thread.get(name).name().interrupt();
|
||||
if (this.thread.get(name.toLowerCase()).name() != null && this.thread.get(name.toLowerCase()).name().isAlive()) {
|
||||
this.thread.get(name.toLowerCase()).name().interrupt();
|
||||
}
|
||||
}
|
||||
|
||||
@ -263,7 +265,7 @@ public class InternalSubCreator extends SubCreator {
|
||||
|
||||
@Override
|
||||
public void waitFor(String name) throws InterruptedException {
|
||||
while (this.thread.get(name).name() != null && this.thread.get(name).name().isAlive()) {
|
||||
while (this.thread.get(name.toLowerCase()) != null && this.thread.get(name.toLowerCase()).name() != null && this.thread.get(name.toLowerCase()).name().isAlive()) {
|
||||
Thread.sleep(250);
|
||||
}
|
||||
}
|
||||
@ -290,8 +292,8 @@ public class InternalSubCreator extends SubCreator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public SubLogger getLogger(String thread) {
|
||||
return this.thread.get(thread).get().name();
|
||||
public SubLogger getLogger(String name) {
|
||||
return this.thread.get(name.toLowerCase()).get().name();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Binary file not shown.
@ -1,4 +1,4 @@
|
||||
name: SubServers-Console
|
||||
main: net.ME1312.SubServers.Console.ConsolePlugin
|
||||
version: 2.11.2b
|
||||
version: 2.12a
|
||||
author: ME1312
|
@ -64,9 +64,9 @@ public final class ConsolePlugin extends Plugin implements Listener {
|
||||
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())) {
|
||||
SwingUtilities.invokeLater(() -> cCurrent.put(event.getHost().getName().toLowerCase(), new ConsoleWindow(this, event.getHost().getCreator().getLogger())));
|
||||
SwingUtilities.invokeLater(() -> cCurrent.put(event.getName().toLowerCase(), new ConsoleWindow(this, event.getHost().getCreator().getLogger(event.getName().toLowerCase()))));
|
||||
} else {
|
||||
cCurrent.get(event.getHost().getName().toLowerCase()).clear();
|
||||
cCurrent.get(event.getName().toLowerCase()).clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -99,17 +99,19 @@ public final class PopoutCommand {
|
||||
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 (hosts.get(args[0].toLowerCase()).getCreator().getReservedNames().size() > 0) {
|
||||
if (!plugin.cCurrent.keySet().contains(args[0].toLowerCase())) {
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
ConsoleWindow window = new ConsoleWindow(plugin, hosts.get(args[0].toLowerCase()).getCreator().getLogger());
|
||||
plugin.cCurrent.put(args[0].toLowerCase(), window);
|
||||
for (String reserved : hosts.get(args[0].toLowerCase()).getCreator().getReservedNames()) {
|
||||
ConsoleWindow window = new ConsoleWindow(plugin, hosts.get(args[0].toLowerCase()).getCreator().getLogger(reserved));
|
||||
plugin.cCurrent.put(reserved.toLowerCase(), window);
|
||||
window.open();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
plugin.cCurrent.get(args[0].toLowerCase()).open();
|
||||
}
|
||||
System.out.println("SubConsole > Opening Window...");
|
||||
System.out.println("SubConsole > Opening Windows...");
|
||||
success = true;
|
||||
}
|
||||
|
||||
|
@ -283,6 +283,8 @@ public class SubCreator {
|
||||
Thread.sleep(500);
|
||||
|
||||
if (thread.get().exitValue() != 0) error = true;
|
||||
} catch (InterruptedException e) {
|
||||
error = true;
|
||||
} catch (Exception e) {
|
||||
error = true;
|
||||
thread.name().logger.error.println(e);
|
||||
|
Loading…
Reference in New Issue
Block a user